vue-list.blade.php 33 KB

1
  1. @extends('layouts.base') @section('title', "订单列表") @section('content') <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/> <style> .edit-i{display:none;} .el-table_1_column_2:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;} .el-tabs__item,.is-top{font-size:16px} .el-tabs__active-bar { height: 3px;} .list-title{display:flex;width:100%;background:#f9f9f9;padding:15px 10px;font-weight:900;border:1px solid #e9e9e9;} .list-title .list-title-1{display:flex;align-items:center;justify-content: center;} .list-info{display:flex ;padding: 10px;justify-content: left;background:#f9f9f9;} .list-con{display:flex;width:100%;font-size:12px;font-weight:500;align-items: stretch;border-bottom: 1px solid rgb(233, 233, 233);} .list-con-goods{display:flex;align-items:center;justify-content: center;box-sizing:border-box;padding-left:10px;border-top:1px solid #e9e9e9;min-height:90px} .list-con-goods-text{min-height:70px;overflow:hidden;flex:1;display: flex;flex-direction: column;justify-content: space-between;} .list-con-goods-price{border-right:1px solid #e9e9e9;border-left:1px solid #e9e9e9;min-width:150px;min-height:90px;text-align: left;padding:20px;display: flex;flex-direction: column;} .list-con-goods-title{font-size:14px;line-height:20px;text-overflow: -o-ellipsis-lastline;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;line-clamp: 2;-webkit-box-orient: vertical;} .list-con-goods-option{font-size:12px;color:#999} .list-con-member-info{display:flex;padding:0 2px;flex-direction: column;flex:1;min-width: 120px;line-height:28px;justify-content: center;text-align:left;font-size:14px;border-top:1px solid #e9e9e9;border-right:1px solid #e9e9e9;} .list-member{padding: 10px;font-size: 12px;font-weight: 500;display:flex} .list-num{flex:3;display:flex;align-items:center;border-right:1px solid #e9e9e9;justify-content: center;} .list-gen{display:flex;align-items:center;justify-content: center;line-height:28px;} .list-gen-txt{flex:1;border-right:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9;align-items:center;justify-content: center;display:flex;} .list-opt{flex:1;display:flex;align-items:center;border-left:1px solid #e9e9e9;justify-content: center;} /* 导航 */ .el-radio-button .el-radio-button__inner,.el-radio-button:first-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;border-left: 0px;} .el-radio-button__inner{border:0;} .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;} .a-btn { border-radius: 2px; padding: 8px 12px; box-sizing: border-box; color: #666; font-weight: 500; text-align: center; margin-left: 1%; background-color: #fff; } .a-btn:hover{ background-color: #29BA9C; color: #FFF; } .a-colour1 { background-color: #fff; color: #666; } .a-colour2 { background-color: #29BA9C; color: #FFF; } </style> <div class="all"> <div id="app" v-cloak> <div class="vue-head"> <div class="vue-main-title" style="margin-bottom:20px"> <div class="vue-main-title-left"></div> <div class="vue-main-title-content">订单筛选</div> <div class="vue-main-title-button"> </div> </div> <div class="vue-search"> <el-form :inline="true" :model="search_form" class="demo-form-inline"> <el-form-item label="" prop=""> <el-select v-model="search_form.middleground_configuration_id" placeholder="请选择供应链" clearable remote filterable > <el-option v-for="item in middleground_configuration" :key="item.id" :label="item.title" :value="item.id"></el-option> </el-select> </el-form-item> <el-form-item label=""> <el-select v-model="search_form.order_searchs" clearable placeholder="订单搜索项" @change="orderSearchsChange" style="width:150px"> <el-option v-for="(item,index) in order_searchs_options" :key="item.value" :label="item.label" :value="item.value"></el-option> </el-select> </el-form-item> <el-form-item label=""> <el-input v-model="search_form.order_searchs_string" :placeholder="order_searchs_string_placeholder"></el-input> </el-form-item> <el-form-item label=""> <el-input v-model="search_form.product_title" placeholder="商品名称"></el-input> </el-form-item> <el-form-item label=""> <el-select v-model="search_form.order_status" clearable placeholder="订单状态" style="width:150px"> <el-option label="待支付" value="waitPay"></el-option> <el-option label="待发货" value="1"></el-option> <el-option label="待收货" value="2"></el-option> <el-option label="已完成" value="3"></el-option> <el-option label="已关闭" value="-1"></el-option> <el-option label="退换货" value="5"></el-option> <el-option label="已退款" value="6"></el-option> </el-select> </el-form-item> <el-form-item label=""> <el-date-picker v-model="times" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-left:5px;" align="right"> </el-date-picker> </el-form-item> <el-form-item label=""> <el-button type="primary" @click="search(1)">搜索</el-button> <el-button @click="orderexport()">导出</el-button> </el-form-item> </el-form> </div> </div> <div class="vue-main"> <div class="vue-main-form"> <div class="vue-main-title" style="margin-bottom:20px"> <div class="vue-main-title-left"></div> <div class="" style="text-align:left;font-size:14px;color:#999"> <span>订单数:[[count]]</span>&nbsp;&nbsp;&nbsp; </div> <div class="vue-main-title-button"> </div> </div> <div v-for="(item,index) in list" style="border:1px solid #e9e9e9;border-radius:10px;margin-bottom:10px"> <div class="list-info"> <div style="display:flex;flex-wrap:wrap"> <div class="vue-ellipsis" style="color:#999;max-width:150px"> <strong>订单ID:</strong>[[item.id]]&nbsp;&nbsp;&nbsp; </div> <div v-if="item.order_sn" class="vue-ellipsis" style="color:#999;max-width:240px"> <strong>订单编号:</strong>[[item.order_sn]]&nbsp;&nbsp;&nbsp; </div> <div v-if="item.pay_info.pay_sn" class="vue-ellipsis" style="color:#999;max-width:240px"> <strong>支付单号:</strong>[[item.pay_info.pay_sn]]&nbsp;&nbsp;&nbsp; </div> <div class="vue-ellipsis" style="color:#999;max-width:230px"> <strong>下单时间:</strong>[[item.created_at]]&nbsp;&nbsp;&nbsp; </div> </div> </div> <div class="list-con"> <div style="flex:3;min-width:400px"> <div v-for="(item1,index1) in item.order_items" class="list-con-goods"> <div class="list-con-goods-img" style="width:80px"> <el-image :src="item1.image_url" style="width:70px;height:70px"></el-image> </div> <div class="list-con-goods-text" :style="{justifyContent:(item1.sku_title?'':'center')}"> <div class="list-con-goods-title" style="color:#29BA9C;cursor: pointer;" v-if="item1.yz_goods_id" @click="gotoGoods(item1.yz_goods_id)">[[item1.title]]</div> <div class="list-con-goods-title" style="color:#29BA9C;cursor: pointer;" v-else>[[item1.title]] <div style="color: red;">(非云仓推送的商品)</div></div> <div class="list-con-goods-option" v-if="item1.sku_title">规格:[[item1.sku_title]]</div> </div> <div class="list-con-goods-price" style="width:200px;margin: 0 auto;"> <div>中台-商品供货价:[[item1.supply_amount]]</div> <div>金额:[[item1.amount]]</div> <div>数量:[[item1.qty]]</div> </div> </div> </div> <div class="list-con-member-info vue-ellipsis"> <div style="min-width:70%;margin:0 auto"> <div v-if="item.user.nickname != '' ">第三方用户昵称:[[item.user.nickname]]</div> <div v-if="item.user.mobile != '' ">第三方用户手机号:[[item.user.mobile]]</div> <div>第三方用户id:[[item.user.id]]</div> </div> </div> <div class="list-con-member-info vue-ellipsis" style="text-align:center;min-width: 90px;"> <div><strong>[[item.pay_type_name]]</strong></div> <div><strong v-if="item.pay_type">[[item.pay_type]]</strong></div> </div> <div class="list-con-member-info vue-ellipsis" style="min-width: 120px;"> <div style="min-width:75%;margin:0 auto"> <div v-for="(item2,index2) in item.amount_detail.amount_items">[[item2.title]]:¥[[item2.amount]]</div> <div>应付款:¥[[item.amount_detail.amount]]</div> </div> </div> <div class="list-con-member-info vue-ellipsis" style="text-align:center"> <div style="min-width:70%;margin:0 auto"> <div style="color:#29BA9C">[[item.status_name]]</div> </div> </div> <div class="list-con-member-info vue-ellipsis" style="text-align:center;min-width: 80px;border-right:0"> <div v-if="item.status == 0"> <el-button @click="cancelOrder(item.id,item)" size="mini" type="primary" style="width:80%;margin:0 auto;margin-bottom:5px;">关闭订单</el-button><br> </div> <div v-if="item.status == 1"> <el-button @click="confirmSend(item.id,item)" size="mini" type="primary" style="width:80%;margin:0 auto;margin-bottom:5px;">确认发货</el-button><br> </div> {{-- <div v-if="item.status == 0">--}} {{-- <el-button @click="confirmCancel(item.id,item)" size="mini" type="primary" style="width:80%;margin:0 auto;margin-bottom:5px;">取消订单</el-button><br>--}} {{-- </div>--}} </div> </div> <div class="list-member"> <div v-if="item.shipping_address"> [[item.shipping_address.realname]]&nbsp;&nbsp;&nbsp;[[item.shipping_address.mobile]]&nbsp;&nbsp;&nbsp;[[item.shipping_address.province]][[item.shipping_address.city]][[item.shipping_address.county]][[item.shipping_address.town]][[item.shipping_address.detail]] </div> <div style="justify-content: flex-end;flex:1;display:flex"> <a @click="gotoDetail(item)" style="color:#29BA9C">查看详情</a> </div> </div> </div> </div> </div> <div> <!-- 确认发货 --> <el-dialog :visible.sync="confirm_send_show" width="750px" title="确认发货"> <div style="height:400px;overflow:auto" id="confirm-send"> <el-form ref="send" :model="send" :rules="send_rules" label-width="15%"> <el-form-item label="收件人信息" prop="aggregation"> <div>收 件 人: [[address_info.realname]] / [[address_info.mobile]]</div> <div>收货地址: [[address_info.province]][[address_info.city]][[address_info.county]][[address_info.town]][[address_info.detail]]</div> </el-form-item> <el-form-item label="配送方式" prop=""> <el-radio v-model="send.dispatch_type_id" :label="1">快递</el-radio> <el-radio v-model="send.dispatch_type_id" :label="2">无需物流</el-radio> </el-form-item> <div v-if="send.dispatch_type_id == 1"> <el-form-item label="快递公司"> <el-select v-model="send.express_code" clearable filterable placeholder="快递公司" :disabled='readonly' style="width:70%;"> <el-option label="请选择快递" value=""></el-option> <el-option v-for="(item,index) in expressCompanies" :key="index" :label="item.name" :value="item.code"></el-option> </el-select> </el-form-item> <el-form-item label="快递单号" prop=""> <el-input v-model="send.express_sn" :disabled='readonly' style="width:70%;"></el-input> </el-form-item> </div> <el-table ref="multipleTable" :data="order_goods_send_list" tooltip-effect="dark" height="250" style="width: 100%" @selection-change="moreSendChange"> <el-table-column type="selection" :selectable="checkSelectable" width="55"></el-table-column> <el-table-column width="550"> <template slot-scope="scope"> <div style="display:flex;width: 88%;"> <div style="width:50px;height:50px"> <img :src="scope.row.image_url" alt="" style="width:50px;height:50px"> </div> <div style="margin-left:20px;display: flex;flex-direction: column;justify-content: space-between;"> <div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">[[scope.row.title]]</div> <div style="color:#999">[[scope.row.product_id]]</div> </div> </div> </template> </el-table-column> <el-table-column> <template slot-scope="scope"> <div style="color:#999">[[scope.row.sku_title]]</div> </template> </el-table-column> </el-table> </el-form> </div> <span slot="footer" class="dialog-footer"> <el-button @click="confirm_send_show = false">取 消</el-button> <el-button type="primary" @click="sureconfirmSend()">确认发货 </el-button> </span> </el-dialog> </div> <!-- 分页 --> <div class="vue-page" v-if="total>0"> <el-row> <el-col align="right"> <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total" :page-size="per_page" :current-page="current_page" background ></el-pagination> </el-col> </el-row> </div> </div> </div> {{--@include('public.admin.orderOperation')--}} {{--@include('public.admin.orderOperationV')--}} <script> var app = new Vue({ el: "#app", delimiters: ['[[', ']]'], name: 'test', data() { return { {{--commonPartUrl: '{!! yzWebFullUrl('order.order-list.common-part') !!}', //获取公共参数链接--}} listUrl: '{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-order.index') !!}',//获取订单数据链接 exportUrl: '{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-order.export') !!}',//订单数据导出链接 list:[], count:0, has_many_level:[], change_sort:'', times:[], //页面返回全部参数 responseResults:{}, //插件判断条件 extra_param:{}, //订单条件 code:'all', expressCompanies:[],//快递公司 middleground_configuration:[],//中台供应链 //搜索条件参数 search_form:{ middleground_configuration_id:0, order_searchs:1, }, order_searchs_string_placeholder:"请输入订单编号", order_searchs_options:[ {  value: 1, label: '订单编号'}, {  value: 2, label: '支付单号'}, {  value: 3, label: '快递单号'}, {  value: 4, label: '会员id'}, {  value: 5, label: '会员昵称'}, {  value: 6, label: '收货人姓名'}, {  value: 7, label: '收货人手机号'}, ], close_order_id:"", close_order_api:"", close_order1_id:"", close_order1_api:"", cancel_send_show:false,// 取消发货弹窗 cancel_send_con:"",//取消发货原因 cancel_send_id:'', confirm_send_show:false,// 确认发货弹窗 confirm_send_id:"", order_model:{}, dispatch_price:0,//运费 order_goods_model:[], address_info:{}, //发货提交信息 send:{ dispatch_type_id:1, express_code:"", express_sn:"", order_sn:"", }, send_rules:{ }, order_goods_send_list:[ // {'goods_id':231284,'title':'测试','thumb':'https://fjfff-1301507422.cos.ap-guangzhou.myqcloud.com//images//5//2020//08//GjeOooWqo8O2dlw2v5ODzDOZOqMOeJ.jpg'}, // {'goods_id':231284,'title':'测试','thumb':'https://fjfff-1301507422.cos.ap-guangzhou.myqcloud.com//images//5//2020//08//GjeOooWqo8O2dlw2v5ODzDOZOqMOeJ.jpg'} ], send_order_goods_ids:[], street:0, province_list:[], city_list : [], district_list : [], street_list : [], areaLoading:false, rules: {}, current_page:1, total:1, per_page:1, readonly:false, operationType:'', operationOrder:{}, dialog_show:0, } }, created() { let result = this.viewReturn(); this.__initial(result); this.search_form.member_id = this.getParam('member_id') }, mounted() { this.getMiddlegroundConfiguration(); }, methods: { //视图返回数据 viewReturn() { return {!! $data?:'{}' !!}; }, //初始化页面数据,请求链接 __initial(data) { if (data.code) { this.code = data.code; } if (data.listUrl) { this.listUrl = data.listUrl; } this.responseResults = data; console.log(data); }, getMiddlegroundConfiguration(){ this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.get-middleground-configurations') !!}').then(function (response) { if (response.data.result) { this.middleground_configuration = response.data.data; this.search_form.middleground_configuration_id = this.middleground_configuration[0].id; this.getData(1); } else { this.$message({message: response.data.msg, type: 'error'}); } }, function (response) { this.$message({message: response.data.msg, type: 'error'}); }) }, checkSelectable(item){ return item.send_status == 0; }, //订单筛选项更改时更改输入框提示语 orderSearchsChange(e){ if(e != ""){ this.order_searchs_string_placeholder = "请输入"+this.order_searchs_options[e-1].label; } }, //订单取消 cancelOrder(id,item){ this.$confirm('确定取消编号:'+item.order_sn+'订单吗?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => { let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'}); this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-order.cancel-order') !!}',{order_id:id,order_sn:item.order_sn,middleground_configuration_id:this.search_form.middleground_configuration_id}).then(function (response) { if (response.data.result) { this.$message({type: 'success',message: '取消成功!'}); this.getData(1); } else{ this.$message({type: 'error',message: response.data.msg}); } loading.close(); },function (response) { this.$message({type: 'error',message: response.data.msg}); loading.close(); } ); }).catch(() => { this.$message({type: 'info',message: '已取消'}); }); }, // 确认发货 confirmSend(id,item) { let json = { order_id:id, middleground_configuration_id:this.search_form.middleground_configuration_id }; let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'}); this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-order.goods-send-info') !!}',json).then(function(response) { loading.close(); if (response.data.result) { this.confirm_send_show = true; this.confirm_send_con = ""; this.send = { dispatch_type_id :1, express_code:"", express_sn:"", order_sn:item.order_sn } this.confirm_send_id = response.data.data.order.id; this.address_info = response.data.data.order.shipping_address || {}; this.order_goods_send_list = response.data.data.order.order_items; this.expressCompanies = response.data.data.express; } else { this.$message({ message: response.data.msg, type: 'error' }); } }, function(response) { this.$message({ message: response.data.msg, type: 'error' }); loading.close(); }); }, sureconfirmSend(){ let json = { dispatch_type_id :this.send.dispatch_type_id, express_code:this.send.express_code, express_sn:this.send.express_sn, order_item_ids:this.send_order_goods_ids, order_id:this.confirm_send_id, order_sn:this.send.order_sn, middleground_configuration_id:this.search_form.middleground_configuration_id }; let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'}); this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-order.send') !!}',json).then(function(response) { if (response.data.result) { this.$message({ message: '发货成功', type: 'success' }); this.confirm_send_show = false; this.getData(this.current_page); } else { this.$message({ message: response.data.msg, type: 'error' }); } loading.close(); }, function(response) { this.$message({ message: response.data.msg, type: 'error' }); loading.close(); }); }, getData(page) { let requestData = { page:page, code: this.code, search: JSON.parse(JSON.stringify(this.search_form)), middleground_configuration_id:this.search_form.middleground_configuration_id }; if(this.times && this.times.length>0) { requestData.search.start_time = this.times[0]; requestData.search.end_time = this.times[1]; } console.log(requestData); let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'}); this.$http.post(this.listUrl,requestData).then(function(response) { console.log(response.data.data); if (response.data.result) { this.count = response.data.data.total; this.list = response.data.data.data; this.current_page = response.data.data.page; this.total = response.data.data.total; this.per_page = response.data.data.per_page; loading.close(); } else { this.$message({ message: response.data.msg, type: 'error' }); } loading.close(); }, function(response) { this.$message({ message: response.data.msg, type: 'error' }); loading.close(); }); }, getExpressCompanies(){ this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-order.get-express-companies') !!}').then(response => { if (response.data.result == 1) { this.expressCompanies = response.data.data.data; console.log(this.expressCompanies); } else { that.$message.error(response.data.msg); } }), function (res) { console.log(res); }; }, // 多包裹确认发货 选择商品 moreSendChange(selection) { let arr = []; for(let j = 0,len = selection.length; j < len; j++){ console.log(selection[j].id); arr.push(selection[j].id); } this.send_order_goods_ids = arr; }, gotoDetail(item) { let link = '{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-order.detail') !!}'; {{--let link = '{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.vue-detail') !!}';--}} link = link+'&middleground_configuration_id='+this.search_form.middleground_configuration_id+'&id='+item.id; console.log(link); window.open(link); }, search(val) { this.getData(val); }, orderConfirm(operationType, order) { console.log(operationType, order); this.dialog_show++; this.operationOrder = order; this.operationType = operationType; }, orderexport(){ let requestData = { code: this.code, search: JSON.parse(JSON.stringify(this.search_form)), middleground_configuration_id:this.search_form.middleground_configuration_id }; if(this.times && this.times.length>0) { requestData.search.start_time = this.times[0]; requestData.search.end_time = this.times[1]; } // window.location.href = this.exportUrl; let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'}); this.$http.post(this.exportUrl,requestData).then(function(response) { console.log(response.data.data.link); if (response.data.result) { let $eleForm = $("<form method='get'></form>"); $eleForm.attr("action",response.data.data.link); $(document.body).append($eleForm); //提交表单,实现下载 $eleForm.submit(); loading.close(); } else { this.$message({ message: response.data.msg, type: 'error' }); } loading.close(); }, function(response) { this.$message({ message: response.data.msg, type: 'error' }); loading.close(); }); }, gotoGoods(id) { let link = '{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.edit') !!}'; window.location.href = link+`&id=`+id; }, // 字符转义 escapeHTML(a) { a = "" + a; return a.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&apos;/g, "'");; }, getParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; }, reloadList() { this.search(this.current_page) } }, }) </script> @endsection