webpackJsonp([32],{"EP+z":function(e,t,r){(e.exports=r("FZ+f")(!1)).push([e.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-aa9be1be] {\n width: 95%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-aa9be1be] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.mx .button[data-v-aa9be1be] {\n margin-left: 10px;\n}\n.bg-in-stock[data-v-aa9be1be] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.bg-in-stock .numOrder[data-v-aa9be1be] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n[data-v-aa9be1be] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-aa9be1be] .error-input .el-input__inner {\n border: 1px solid red;\n}\n/** 表格中输入框样式 */\n.tableFormItem[data-v-aa9be1be] {\n width: 100%;\n margin-bottom: 0;\n}\n/** 输入框错误提示样式 */\n/** date-picker宽度和其他输入框保持一致 */\n[data-v-aa9be1be] .el-date-editor .el-input__inner {\n -webkit-padding-start: 15px;\n padding-inline-start: 15px;\n}\n[data-v-aa9be1be] .el-date-editor .el-input__prefix {\n display: none;\n}\n.redClass[data-v-aa9be1be] .el-form-item__content {\n font-weight: 700;\n width: 500px !important;\n}\n[data-v-aa9be1be] .el-form-item {\n width: 100%;\n height: auto;\n}\n[data-v-aa9be1be] .el-form-item .el-input {\n width: 200px;\n}\n',""])},ZU1L:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,n=r("bOdI"),a=r.n(n),o=r("Xxa5"),s=r.n(o),l=r("exGp"),c=r.n(l),u=r("Dd8w"),d=r.n(u),p=r("NYxO"),m=r("FWz8"),h=r("dClm"),_=r("ocgh"),f=r("hky6"),g=r("aANz"),b=r("UVPs"),v=r("G+dR"),y=r("jQQ7"),x=r("9EK1"),w=(r("38N9"),r("eMjc")),O=r.n(w),F=r("MJLE"),k=r.n(F),T={product_list:[],payment_list:[],tax_price:0,total_price:0,discount_price:0,pay_price:0,deposit_price:0,send_type:"express",subtract_stock:!1,payment_status:"NOT_PAY",start_time:null,real_price:0},L=(i={name:"orderAdd",data:function(){return{brcode:!1,options:x.b,selectedOptions:[],warehouseList:[],memberList:[],marketingList:[],storeList:[],collectingAccountList:[],fileList:[],deliveryTypeList:[{code:"express",name:"快递配送"},{code:"self_pick",name:"门店自提"}],id:"",OrderForm:{province_city_area:"",address:"",real_price:"",province_city_area_address:"",subtract_stock:!1,warehouse_id:[],return_warehouse_id:"",start_time:null,customer_name:"",customer_phone:""},formLoading:!1,isDetail:void 0,multipleSelection:[],batchUpdateNum:0,showUpdateNum:!1,batchDiscountType:0,batchDiscountPrice:0,showDiscountPrice:!1,batchTaxRate:0,showTaxRate:!1,rules:{customer_name:[this.MixinRequired("请输入客户名称","blur")],type:[this.MixinRequired("请选择订单类型","change")],pay_type:[this.MixinRequired("请选择付款方式","change")],pay_price:[this.MixinRequired("请输入付款金额","blur")],marketing_id:[this.MixinRequired("请选择销售人员","change")],send_type:[this.MixinRequired("请选择配送方式","change")],warehouse_id:[this.MixinRequired("请选择仓库","change")],return_warehouse_id:[this.MixinRequired("请选择返回仓库","change")],order_time:[this.MixinRequired("下单时间不能为空","change")],payment_status:[this.MixinRequired("支付状态不能为空","change")],payment_time:[this.MixinRequired("支付时间不能为空","change")],real_price:[this.MixinRequired("请输入实付金额","blur")],product_list:{num:[this.MixinRequired("数量不能为空","change"),{validator:function(e,t,r){t&&!y.RegExp.integer.test(t)?r(new Error("请输入正整数")):r()}}],tax_rate:[this.MixinRequired("税率不能为空","change"),{validator:function(e,t,r){t&&!y.RegExp.money.test(t)?r(new Error("请输入正确的税率")):r()},trigger:"blur"}],price:[this.MixinRequired("单价不能为空","change"),{validator:function(e,t,r){t&&!y.RegExp.money.test(t)?r(new Error("请输入正确的价格")):r()},trigger:"blur"}],discount_price:[this.MixinRequired("优惠金额不能为空","change"),{validator:function(e,t,r){t&&!y.RegExp.money.test(t)?r(new Error("请输入正确的金额")):r()},trigger:"blur"}]},payment_list:{collecting_account_id:[this.MixinRequired("请选择支付方式","change")],price:[this.MixinRequired("支付金额不能为空","change"),{validator:function(e,t,r){t&&!y.RegExp.money.test(t)?r(new Error("请输入正确的金额")):r()},trigger:"blur"},{validator:function(e,t,r){t&&1*t<=0?r(new Error("支付金额必须大于0")):r()},trigger:"blur"}]},customer_phone:[this.MixinRequired("请输入手机号码!"),{validator:function(e,t,r){y.RegExp.mobile.test(t)?r():r(new Error("手机号码格式有误!"))},trigger:["change","blur"]}]},deptList:[],customerList:[],orderTypeList:[],barcodeValue:"",time:[],customer:{dialogVisible:!1,supplierRules:{custom_sn:[this.MixinRequired("请输入客户编号!"),{min:2,max:20,message:"长度在 2 到 20 个字符"},{validator:function(e,t,r){t&&!y.RegExp.userName.test(t)?r(new Error("只支持汉字、字母、数字、“-”、“_”的组合!")):r()}}],postal_address:[this.MixinRequired("请输入通讯地址!")],telephone:[this.MixinRequired("请输入联系电话!"),{validator:function(e,t,r){y.RegExp.mobile.test(t)?r():r(new Error("联系电话格式有误!"))},trigger:["change","blur"]}],name:[this.MixinRequired("请输入联系人!")],mobile:[this.MixinRequired("请输入手机号码!"),{validator:function(e,t,r){y.RegExp.mobile.test(t)?r():r(new Error("手机号码格式有误!"))},trigger:["change","blur"]}],gender:[{required:!0,message:"请选择性别",trigger:"change"}],type:[{required:!0,message:"请选择客户类别",trigger:"change"}],contact:[{required:!0,message:"请输入客户联系人",trigger:"blur"}]},supplierForm:{},options:[]},discount:"",pickerOptions:{disabledDate:function(e){return e.getTime()<(new Date).getTime()-864e5}},pickerOptionsEnd:{disabledDate:function(e){return e.getTime()<(new Date).getTime()}},type:"",goodsData:[],goodsVisible:!1,goodsList:[],params:{pages:1,size:10},orderType:"",payurl:"",channList:[],totalAmount:0}},computed:d()({},Object(p.b)(["user"])),mounted:function(){this.payurl=window.location.href.split("#")[0],this.type=this.$route.params.type,this.orderType=this.$route.params.type,this.GET_WarehouseList(),this.GET_MemberList(),this.GET_MarketingList(),this.GET_StoreList(),this.GET_CollectingAccountList(),this.GET_CustomerList()},methods:{getchannName:function(e){var t=this.channList.find(function(t){return t.id===e});return t?t.name:"未知类型"},creatQrCode:function(){var e=this;this.$nextTick(function(){e.$refs.qrCodeDiv.innerHTML="",new k.a(e.$refs.qrCodeDiv,{text:e.payurl+"#/payType?id="+e.id+"&sn="+e.barcodeValue+"&price="+e.OrderForm.real_price,width:200,height:200,colorDark:"#333333",colorLight:"#ffffff",correctLevel:k.a.CorrectLevel.L})},500)},cleanUrl:function(e){if(e.endsWith(".png")){var t=e.indexOf(".png")+4;return e.substring(0,t)}var r=e.lastIndexOf("_");return-1!==r?e.substring(0,r):e},warehouseNames:function(e){var t=[];return this.warehouseList.map(function(r){e.map(function(e){if(r.id==e)return t.push(r.name)})}),t.join("/")},getSendType:function(e){var t=this.deliveryTypeList.find(function(t){return t.value===e});return t?t.label:"未知类型"},getMarketingName:function(e){var t=this.marketingList.find(function(t){return t.id===e});return t?t.real_name:"未知类型"},getPayType:function(e){var t=this.collectingAccountList.find(function(t){return t.id===e});return t?t.name:"未知类型"},getMemberName:function(e){var t=this.customerList.find(function(t){return t.id===e});return t?t.name:"未知类型"},getTypeName:function(e){var t=this.orderTypeList.find(function(t){return t.value===e});return t?t.label:"未知类型"},selMember:function(e){var t=this;h.z(e).then(function(e){t.$set(t.OrderForm,"customer_name",e.name),t.$set(t.OrderForm,"customer_phone",e.mobile)})},handleSelChange:function(e){if(e.length>1){var t=e[e.length-1];this.$refs.table.clearSelection(),this.$refs.table.toggleRowSelection(t,!0)}this.goodsList=e},submitGoosData:function(){var e=this;this.goodsList.length>=1?b.d(this.OrderForm.warehouse_id,this.goodsList[0].id).then(function(t){t.map(function(t){e.OrderForm.product_list.push(t)}),e.goodsVisible=!1}):this.$message.error("请选择商品信息")},closeGoosData:function(){this.goodsVisible=!1},handleBlur:function(){var e=this.discount;/^(10|([1-9](\.\d{0,1})?))$/.test(e)||(this.discount="")},printIng:function(){var e=this.$refs.printId,t=e.clientWidth,r=e.clientHeight,i=document.createElement("canvas");i.width=1*t,i.height=1*r,i.style.width=1*t+"px",i.style.height=1*r+"px",i.getContext("2d").scale(1,1);var n=document.documentElement.scrollTop||document.body.scrollTop,a=document.documentElement.scrollLeft||document.body.scrollLeft;O()(e,{canvas:i,backgroundColor:null,useCORS:!0,windowHeight:document.body.scrollHeight,scrollX:-a,scrollY:-n}).then(function(e){var t=e.toDataURL("image/png");printJS({printable:t,type:"image",documentTitle:"",style:"@page{size:auto;margin: 0cm 1cm 0cm 1cm;}"})}).catch(function(e){console.error(e)})},warehouseName:function(e){var t="";return this.warehouseList.map(function(r){if(r.id==e)return t=r.name}),t},handleDialogOpen:function(){var e=this;setTimeout(function(){e.$refs.supplierForm.clearValidate()}),this.customer.supplierForm={}},submitSupplierForm:function(){var e=this;this.$refs.supplierForm.validate(function(t){if(!t)return e.$message.error("表单填写有误,请核对!"),!1;e.customer.supplierForm.id;var r=e.MixinClone(e.customer.supplierForm);h.c(r).then(function(){e.customer.dialogVisible=!1,e.$message.success("添加成功!"),e.GET_CustomerList()})})},addCust:function(){this.customer.dialogVisible=!0},handleChange:function(e){this.OrderForm.province_city_area=e.join(",")},init:function(){var e=this,t=this.$route.params.id;t?(this.id=t,this.GET_OrderDetail()):(this.OrderForm=this.MixinClone(T),this.$set(this.OrderForm,"order_time",(new Date).getTime()),this.$nextTick(function(){e.$refs.orderFormRef.clearValidate()})),this.isDetail="orderDetail"===this.$route.name},cleanGoodsList:function(){this.$set(this.OrderForm,"product_list",[])},GET_CustomerList:function(){var e=this;h.i(this.params).then(function(t){e.customerList=t.data}).catch(function(){}),f.u({dictType:"order_type"}).then(function(t){e.orderTypeList=t.data}),f.u({dictType:"order_send_type"}).then(function(t){e.deliveryTypeList=t.data})},GET_MemberList:function(){var e=this;_.f({page_no:1,page_size:-1,disable_flag:!1}).then(function(t){e.memberList=t.data})},GET_MarketingList:function(){var e=this;h.E().then(function(t){e.marketingList=t}),v.d(this.params).then(function(t){e.channList=t.data}).catch(function(){})},GET_StoreList:function(){var e=this;h.w({page_no:1,page_size:-1}).then(function(t){e.storeList=t.data})},GET_CollectingAccountList:function(){var e=this;g.d({page_no:1,page_size:-1,enable_flag:!0}).then(function(t){e.collectingAccountList=t.data})},roBack:function(){var e=this.$route.params.callback;"function"==typeof e&&e(),this.$store.dispatch("delCurrentViews",{view:this.$route,$router:this.$router}),this.$router.push({name:"order"})},handleSelectGoods:function(){var e=this;return c()(s.a.mark(function t(){var r,i;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.OrderForm.type){t.next=3;break}return e.$message.error("请选择订单类型!"),t.abrupt("return");case 3:if(0!=e.OrderForm.warehouse_id.length){t.next=6;break}return e.$message.error("请选择仓库!"),t.abrupt("return");case 6:return r=e.OrderForm.warehouse_id.join(","),t.next=9,e.$EnPickerGoods({goodsApi:"/admin/erp/warehouseOut/getGoodByWarehouse/warehouseIdAndOrderType/"+e.OrderForm.type+"/"+r,selectedIds:e.OrderForm.product_list.map(function(e){return e.product_id})});case 9:(i=t.sent).map(function(e){e.end_time=""}),e.OrderForm.product_list=i;case 12:case"end":return t.stop()}},t,e)}))()},handlePageSizeChange:function(e){var t=this;this.params.size=e,b.e(this.params).then(function(e){t.goodsData=e,t.goodsVisible=!0})},handlePageCurrentChange:function(e){var t=this;this.params.page=e,b.e(this.params).then(function(e){t.goodsData=e,t.goodsVisible=!0})},handleSelectGrou:function(){var e=this;this.OrderForm.type?0!=this.OrderForm.warehouse_id.length?(this.params.order_choose_type=this.OrderForm.type,b.e(this.params).then(function(t){e.goodsData=t,e.goodsVisible=!0})):this.$message.error("请选择仓库!"):this.$message.error("请选择订单类型!")},handleInsertPayment:function(){this.collectingAccountList.findLast(function(e){return!0===e.default_flag})},handleSelectionChange:function(e){this.multipleSelection=e},handleShowUpdateNum:function(){var e=this;0!==this.multipleSelection.length?(this.showUpdateNum=!0,this.batchUpdateNum=1,this.$nextTick(function(){e.$refs.batchSetNumRef.focus()})):this.$message.error("请先勾选商品")},handleCancelUpdateNum:function(){this.showUpdateNum=!1},handleConfirmUpdateNum:function(){this.showUpdateNum=!1;for(var e=0;e