(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[808],{9770:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return p}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"conent"},[e("el-card",[e("el-form",{ref:"form",attrs:{inline:!0,"label-width":"90px"}},[e("el-form-item",{attrs:{label:"所属店铺:"}},[e("el-select",{attrs:{placeholder:"店铺"},on:{change:function(e){return t.handleChoose()}},model:{value:t.filter.shop_id,callback:function(e){t.$set(t.filter,"shop_id",e)},expression:"filter.shop_id"}},t._l(t.shopsList,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),e("el-form-item",{attrs:{label:"发货状态:"}},[e("el-select",{attrs:{placeholder:"发货状态"},on:{change:function(e){return t.handleChoose()}},model:{value:t.filter.shipping_status,callback:function(e){t.$set(t.filter,"shipping_status",e)},expression:"filter.shipping_status"}},[e("el-option",{attrs:{value:"",label:"全部"}}),e("el-option",{attrs:{value:"0",label:"未发货"}}),e("el-option",{attrs:{value:"2",label:"部分发货"}}),e("el-option",{attrs:{value:"1",label:"已发货"}})],1)],1),e("el-form-item",{attrs:{label:"订单类型:"}},[e("el-select",{attrs:{placeholder:"订单类型"},on:{change:function(e){return t.handleChoose()}},model:{value:t.filter.is_supplier,callback:function(e){t.$set(t.filter,"is_supplier",e)},expression:"filter.is_supplier"}},[e("el-option",{attrs:{value:"",label:"全部订单"}}),e("el-option",{attrs:{value:1,label:"自卖团订单"}}),e("el-option",{attrs:{value:0,label:"帮卖团订单"}})],1)],1),e("el-form-item",{attrs:{label:"订单状态:"}},[e("el-select",{attrs:{placeholder:"订单状态"},on:{change:function(e){return t.handleChoose()}},model:{value:t.filter.cancel_status,callback:function(e){t.$set(t.filter,"cancel_status",e)},expression:"filter.cancel_status"}},[e("el-option",{attrs:{value:"",label:"全部"}}),e("el-option",{attrs:{value:0,label:"未取消"}}),e("el-option",{attrs:{value:1,label:"已取消"}})],1)],1),e("el-form-item",{attrs:{label:"售后状态:"}},[e("el-select",{attrs:{placeholder:"售后状态"},on:{change:function(e){return t.handleChoose()}},model:{value:t.filter.after_sales_status,callback:function(e){t.$set(t.filter,"after_sales_status",e)},expression:"filter.after_sales_status"}},[e("el-option",{attrs:{value:"",label:"全部"}}),e("el-option",{attrs:{value:0,label:"未售后"}}),e("el-option",{attrs:{value:1,label:"有售后"}})],1)],1),e("el-form-item",{attrs:{label:"商品数量:"}},[e("el-select",{attrs:{placeholder:"商品数量"},on:{change:function(e){return t.handleChoose()}},model:{value:t.filter.goods_sku_num,callback:function(e){t.$set(t.filter,"goods_sku_num",e)},expression:"filter.goods_sku_num"}},[e("el-option",{attrs:{value:"",label:"全部"}}),e("el-option",{attrs:{value:1,label:"1个商品"}}),e("el-option",{attrs:{value:2,label:"2-5个商品"}}),e("el-option",{attrs:{value:6,label:"6个以上商品"}})],1)],1),e("el-form-item",{attrs:{label:"订单商品:"}},[e("el-select",{attrs:{multiple:"",filterable:"",remote:"","reserve-keyword":"",placeholder:"订单商品","remote-method":t.remoteMethod,loading:t.searchLoading},model:{value:t.filter.external_sku_ids,callback:function(e){t.$set(t.filter,"external_sku_ids",e)},expression:"filter.external_sku_ids"}},t._l(t.options,(function(t){return e("el-option",{key:t.external_sku_id,attrs:{label:t.title,value:t.external_sku_id}})})),1)],1),e("el-form-item",{attrs:{label:"下单时间:"}},[e("el-date-picker",{attrs:{type:"datetimerange","range-separator":"-","start-placeholder":"起","end-placeholder":"止",format:"yyyy-MM-dd HH:mm:ss","value-format":"yyyy-MM-dd HH:mm:ss"},on:{change:function(e){return t.handleChoose()}},model:{value:t.confirmAt,callback:function(e){t.confirmAt=e},expression:"confirmAt"}})],1),e("el-form-item",{attrs:{label:"跟团号:"}},[e("el-input",{attrs:{placeholder:"跟团号"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleChoose.apply(null,arguments)}},model:{value:t.filter.pno,callback:function(e){t.$set(t.filter,"pno",e)},expression:"filter.pno"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:t.handleChoose}},[t._v("筛选")]),e("el-button",{attrs:{plain:""},on:{click:t.handleReChoose}},[t._v("重置筛选")]),e("el-button",{attrs:{type:"primary"},on:{click:t.print}},[t._v("打印")]),e("el-button",{attrs:{type:"warning",loading:t.exportLoading,icon:"el-icon-download"},on:{click:t.handleExport}},[t._v("数据导出")])],1)],1)],1),e("el-card",{staticStyle:{"margin-top":"10px"}},[e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.orderList,border:""},on:{"selection-change":t.handleSelectionChange}},[e("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e("el-table-column",{attrs:{label:"店铺名称",prop:"shop.name"}}),e("el-table-column",{attrs:{label:"跟团号",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.is_supplier?"自卖团: ":"帮卖团: ")+" "+t._s(e.row.is_supplier?e.row.participate_no:e.row.supply_participate_no)+" ")]}}])}),e("el-table-column",{attrs:{label:"收件人信息",width:"240"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("p",[t._v(t._s(r.row.receiver_name)+"  "+t._s(r.row.receiver_mobile))]),e("p",[t._v(t._s(r.row.receiver_address_province)+"/"+t._s(r.row.receiver_address_city)+"/"+t._s(r.row.receiver_address_district))]),e("p",[t._v(t._s(r.row.receiver_address_detail))])]}}])}),e("el-table-column",{attrs:{prop:"shipping_status",label:"发货状态",align:"center"}}),e("el-table-column",{attrs:{prop:"cancel_status",label:"订单状态",align:"center"}}),e("el-table-column",{attrs:{prop:"after_sales_status",label:"售后状态",align:"center"}}),e("el-table-column",{attrs:{label:"商品信息",width:"380"},scopedSlots:t._u([{key:"default",fn:function(r){return t._l(r.row.items,(function(r){return e("div",{key:r.id},[t._v(" "+t._s(r.goods_name)+" "),e("span",{staticStyle:{color:"red"}},[t._v("+"+t._s(r.goods_number))])])}))}}])}),e("el-table-column",{attrs:{prop:"confirm_at",label:"下单时间",width:"150",align:"center"}})],1),e("div",{staticClass:"page-pagination"},[e("el-pagination",{attrs:{"current-page":t.page,"page-sizes":[10,50,100],"page-size":t.per_page,layout:"prev, pager, next, sizes, jumper, total",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)],1)},o=[],s=(r(560),r(8858),r(1318),r(3228),r(5522)),i=r(9998),a=r(9036),u=r(7484),l=r.n(u),c={data(){return{filter:{shop_id:"",shipping_status:"",is_supplier:"",cancel_status:0,after_sales_status:0,goods_sku_num:"",external_sku_ids:"",pno:""},loading:!1,searchLoading:!1,options:[],orderList:[],total:0,page:1,per_page:10,shopsList:[],confirmAt:[],print_order_ids:"",print_documents:[],socket:null,lockReconnect:!1,timeout:58e3,timeoutObj:null,serverTimeoutObj:null,timeoutnum:null,defaultPrinter:null,taskIDArray:[],requestIDGetGlobalConfig:"",exportLoading:!1}},created(){let t=l()().format("YYYY-MM-DD")+" 00:00:00",e=l()().format("YYYY-MM-DD")+" 23:59:59";this.confirmAt=[t,e],this.getOrderList(),this.getShopsList()},methods:{getOrderList(){this.loading=!0;let t={...this.filter,page:this.page,per_page:this.per_page,confirm_at_start:this.confirmAt?this.confirmAt[0]:"",confirm_at_end:this.confirmAt?this.confirmAt[1]:""};(0,s.lU)(t).then((t=>{this.orderList=t.data.data,this.total=t.data.meta.total,this.loading=!1})).catch((()=>{this.loading=!1}))},getShopsList(){let t={page:0,per_page:99};(0,i.nH)(t).then((t=>{this.shopsList=t.data.data}))},handleSizeChange(t){this.page=1,this.per_page=t,this.getOrderList()},handleCurrentChange(t){this.page=t,this.getOrderList()},handleChoose(){this.page=1,this.getOrderList()},handleReChoose(){this.filter={shop_id:"",shipping_status:"",is_supplier:"",cancel_status:0,after_sales_status:0,goods_sku_num:"",external_sku_ids:"",pno:""},this.page=1,this.getOrderList()},remoteMethod(t){""!==t?(this.searchLoading=!0,setTimeout((()=>{this.searchLoading=!1,(0,a.NR)(t).then((e=>{this.options=e.data.filter((e=>e.title.toLowerCase().indexOf(t.toLowerCase())>-1))}))}),200)):this.options=[]},print(){const t=this.$loading({lock:!0,text:"Loading",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});(0,s.kT)(this.filter).then((e=>{this.print_documents=e.data.documents,this.print_order_ids=e.data.order_ids,t.close(),this.doPrint()}))},handleSelectionChange(t){let e=[];t.forEach((t=>{e.push(t.id)})),this.filter.ids=e},initWebSocket(){const t="ws://127.0.0.1:5000";this.socket=new WebSocket(t),this.socket.onmessage=this.websocketonmessage,this.socket.onopen=this.websocketonopen,this.socket.onerror=this.websocketonerror,this.socket.onclose=this.websocketclose},websocketonopen(){this.start(),1===this.socket.readyState&&this.getPrinters()},start(){console.log("开启心跳");var t=this;t.timeoutObj&&clearTimeout(t.timeoutObj),t.serverTimeoutObj&&clearTimeout(t.serverTimeoutObj),t.timeoutObj=setTimeout((function(){1==t.socket.readyState||t.reconnect(),t.serverTimeoutObj=setTimeout((function(){t.socket.close()}),t.timeout)}),t.timeout)},reconnect(){var t=this;t.lockReconnect||(t.lockReconnect=!0,t.timeoutnum&&clearTimeout(t.timeoutnum),t.timeoutnum=setTimeout((function(){t.initWebSocket(),t.lockReconnect=!1}),5e3))},websocketonerror(){console.log("出现错误"),this.reconnect()},websocketonmessage(t){console.log(t),void 0!==JSON.parse(t.data).printers&&(this.defaultPrinter=JSON.parse(t.data).defaultPrinter),console.log("默认打印机"+this.defaultPrinter),"success"===JSON.parse(t.data).status&&console.log("打印就绪.."),"failed"===JSON.parse(t.data).status&&console.log("打印未就绪.."),"printed"===JSON.parse(t.data).taskStatus&&(console.log("出纸成功--打印成功"),(0,s.EB)({order_ids:this.print_order_ids}).then((t=>{console.log(t)}))),"failed"===JSON.parse(t.data).taskStatus&&console.log("打印失败!"),"canceled"===JSON.parse(t.data).taskStatus&&console.log("打印取消!"),this.reset()},reset(){var t=this;clearTimeout(t.timeoutObj),clearTimeout(t.serverTimeoutObj),t.start()},websocketsend(t){this.socket.send(t)},websocketclose(t){console.log("断开连接",t),this.reconnect()},getPrinters(){var t=this.getRequestObject("getPrinters");this.websocketsend(JSON.stringify(t))},doPrint(){var t=this.getRequestObject("print");t.task=new Object,t.task.taskID=this.getUUID(8,10),this.taskIDArray.push(t.task.taskID),this.requestIDGetGlobalConfig=t.task.taskID,t.task.preview=!1,t.task.printer=this.defaultPrinter,t.task.documents=this.print_documents,console.log(t.task.documents),this.websocketsend(JSON.stringify(t))},getRequestObject(t){var e=new Object;return e.requestID=this.getUUID(8,16),e.version="1.0",e.cmd=t,e},getUUID(t,e){var r,n,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];if(e=e||o.length,t)for(r=0;r{this.downLoadXls(t.data),this.$message({type:"success",message:"导出成功!"}),this.exportLoading=!1})).catch((()=>{this.exportLoading=!1}))},downLoadXls(t){const e=t,r=new Blob([e]),n=(new Date).toLocaleDateString(),o=`订单列表${n}.xlsx`;if("download"in document.createElement("a")){const t=document.createElement("a");t.download=o,t.style.display="none",t.href=URL.createObjectURL(r),document.body.appendChild(t),t.click(),URL.revokeObjectURL(t.href),document.body.removeChild(t)}else navigator.msSaveBlob(r,o)},objectToQueryString(t){return Object.keys(t).map((e=>encodeURIComponent(e)+"="+(t[e]?encodeURIComponent(t[e]):""))).join("&")}}},f=c,d=r(1001),h=(0,d.Z)(f,n,o,!1,null,"2df17226",null),p=h.exports},7484:function(t){!function(e,r){t.exports=r()}(0,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",o="second",s="minute",i="hour",a="day",u="week",l="month",c="quarter",f="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},v=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},_={s:v,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+v(n,2,"0")+":"+v(o,2,"0")},m:function t(e,r){if(e.date()1)return t(i[0])}else{var a=e.name;y[a]=e,o=a}return!n&&o&&(b=o),o||!n&&b},O=function(t,e){if(w(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new x(r)},S=_;S.l=$,S.i=w,S.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function g(t){this.$L=$(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[k]=!0}var v=g.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(S.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(p);if(n){var o=n[2]-1||0,s=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(e)}(t),this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return S},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var r=O(t);return this.startOf(e)<=r&&r<=this.endOf(e)},v.isAfter=function(t,e){return O(t)c)if(a=u[c++],a!==a)return!0}else for(;l>c;c++)if((t||c in u)&&u[c]===r)return t||c||0;return!t&&-1}};t.exports={includes:i(!0),indexOf:i(!1)}},5649:function(t,e,r){"use strict";var n=r(7697),o=r(2297),s=TypeError,i=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=a?function(t,e){if(o(t)&&!i(t,"length").writable)throw new s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},926:function(t,e,r){"use strict";var n=r(3043),o=r(9985),s=r(6648),i=r(4201),a=i("toStringTag"),u=Object,l="Arguments"===s(function(){return arguments}()),c=function(t,e){try{return t[e]}catch(r){}};t.exports=n?s:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=c(e=u(t),a))?r:l?s(e):"Object"===(n=s(e))&&o(e.callee)?"Arguments":n}},8758:function(t,e,r){"use strict";var n=r(6812),o=r(9152),s=r(2474),i=r(2560);t.exports=function(t,e,r){for(var a=o(e),u=i.f,l=s.f,c=0;cr)throw e("Maximum allowed index exceeded");return t}},2739:function(t){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9989:function(t,e,r){"use strict";var n=r(9037),o=r(2474).f,s=r(5773),i=r(1880),a=r(5014),u=r(8758),l=r(5266);t.exports=function(t,e){var r,c,f,d,h,p,m=t.target,g=t.global,v=t.stat;if(c=g?n:v?n[m]||a(m,{}):n[m]&&n[m].prototype,c)for(f in e){if(h=e[f],t.dontCallGetSet?(p=o(c,f),d=p&&p.value):d=c[f],r=l(g?f:m+(v?".":"#")+f,t.forced),!r&&void 0!==d){if(typeof h==typeof d)continue;u(h,d)}(t.sham||d&&d.sham)&&s(h,"sham",!0),i(c,f,h,t)}}},4413:function(t,e,r){"use strict";var n=r(8844),o=r(3689),s=r(6648),i=Object,a=n("".split);t.exports=o((function(){return!i("z").propertyIsEnumerable(0)}))?function(t){return"String"===s(t)?a(t,""):i(t)}:i},2297:function(t,e,r){"use strict";var n=r(6648);t.exports=Array.isArray||function(t){return"Array"===n(t)}},5266:function(t,e,r){"use strict";var n=r(3689),o=r(9985),s=/#|\.prototype\./,i=function(t,e){var r=u[a(t)];return r===c||r!==l&&(o(e)?n(e):!!e)},a=i.normalize=function(t){return String(t).replace(s,".").toLowerCase()},u=i.data={},l=i.NATIVE="N",c=i.POLYFILL="P";t.exports=i},6310:function(t,e,r){"use strict";var n=r(3126);t.exports=function(t){return n(t.length)}},8828:function(t){"use strict";var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},2474:function(t,e,r){"use strict";var n=r(7697),o=r(2615),s=r(9556),i=r(5684),a=r(5290),u=r(8360),l=r(6812),c=r(8506),f=Object.getOwnPropertyDescriptor;e.f=n?f:function(t,e){if(t=a(t),e=u(e),c)try{return f(t,e)}catch(r){}if(l(t,e))return i(!o(s.f,t,e),t[e])}},2741:function(t,e,r){"use strict";var n=r(4948),o=r(2739),s=o.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,s)}},7518:function(t,e){"use strict";e.f=Object.getOwnPropertySymbols},4948:function(t,e,r){"use strict";var n=r(8844),o=r(6812),s=r(5290),i=r(4328).indexOf,a=r(7248),u=n([].push);t.exports=function(t,e){var r,n=s(t),l=0,c=[];for(r in n)!o(a,r)&&o(n,r)&&u(c,r);while(e.length>l)o(n,r=e[l++])&&(~i(c,r)||u(c,r));return c}},9556:function(t,e){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},9152:function(t,e,r){"use strict";var n=r(6058),o=r(8844),s=r(2741),i=r(7518),a=r(5027),u=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=s.f(a(t)),r=i.f;return r?u(e,r(t)):e}},7578:function(t,e,r){"use strict";var n=r(8700),o=Math.max,s=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):s(r,e)}},5290:function(t,e,r){"use strict";var n=r(4413),o=r(4684);t.exports=function(t){return n(o(t))}},8700:function(t,e,r){"use strict";var n=r(8828);t.exports=function(t){var e=+t;return e!==e||0===e?0:n(e)}},3126:function(t,e,r){"use strict";var n=r(8700),o=Math.min;t.exports=function(t){var e=n(t);return e>0?o(e,9007199254740991):0}},3043:function(t,e,r){"use strict";var n=r(4201),o=n("toStringTag"),s={};s[o]="z",t.exports="[object z]"===String(s)},4327:function(t,e,r){"use strict";var n=r(926),o=String;t.exports=function(t){if("Symbol"===n(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},1500:function(t){"use strict";var e=TypeError;t.exports=function(t,r){if(t