webpackJsonp([8],{"55y+":function(e,t,r){var i=r("Rhud");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);r("rjj0")("8d4b0d74",i,!0)},Rhud:function(e,t,r){(e.exports=r("FZ+f")(!1)).push([e.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-8490e436] {\n width: 95%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-8490e436] {\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-8490e436] {\n margin-left: 10px;\n}\n.bg-in-stock[data-v-8490e436] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.bg-in-stock .numOrder[data-v-8490e436] {\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-8490e436] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-8490e436] .error-input .el-input__inner {\n border: 1px solid red;\n}\n/** 表格中输入框样式 */\n.tableFormItem[data-v-8490e436] {\n width: 100%;\n margin-bottom: 0;\n}\n/** 输入框错误提示样式 */\n/** date-picker宽度和其他输入框保持一致 */\n[data-v-8490e436] .el-date-editor .el-input__inner {\n -webkit-padding-start: 15px;\n padding-inline-start: 15px;\n}\n[data-v-8490e436] .el-date-editor .el-input__prefix {\n display: none;\n}\n.redClass[data-v-8490e436] .el-form-item__content {\n font-weight: 700;\n width: 500px !important;\n}\n[data-v-8490e436] .el-form-item {\n width: 100%;\n height: auto;\n}\n[data-v-8490e436] .el-form-item .el-input {\n width: 200px;\n}\n[data-v-8490e436].avatar-uploader .el-upload {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n}\n.avatar-uploader .el-upload[data-v-8490e436]:hover {\n border-color: #409EFF;\n}\n.avatar-uploader-icon[data-v-8490e436] {\n font-size: 28px;\n color: #8c939d;\n width: 178px;\n height: 178px;\n line-height: 178px;\n text-align: center;\n}\n.avatar[data-v-8490e436] {\n width: 178px;\n height: 178px;\n display: block;\n}\n',""])},Xb5K:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r("bOdI"),n=r.n(i),a=r("Xxa5"),o=r.n(a),s=r("exGp"),l=r.n(s),c=r("Dd8w"),u=r.n(c),d=r("NYxO"),m=r("FWz8"),p=r("dClm"),h=r("ocgh"),_=r("hky6"),f=r("aANz"),b=r("UVPs"),g=r("jQQ7"),v=r("G+dR"),y=r("9EK1"),x=(r("38N9"),r("eMjc")),F=r.n(x);var O,k=y.b.map(function(e){var t=e.children.filter(function(e){var t=!e.children||0===e.children.length,r=e.children&&e.children.every(function(e){return"市辖区"!==e.name});return t||r});return u()({},e,{children:t})}).filter(function(e){return e.children&&e.children.length>0}),w={product_list:[],payment_list:[],tax_price:0,total_price:0,discount_price:0,pay_price:0,deposit_price:0,send_type:"INTRA_CITY_SERVICE",subtract_stock:!1,payment_status:"NOT_PAY",start_time:null,real_price:0},$=(O={name:"orderAdd",data:function(){return{brcode:!1,options:k,selectedOptions:[],warehouseList:[],memberList:[],marketingList:[],storeList:[],collectingAccountList:[],fileList:[],deliveryTypeList:[],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:"",marketing_id:""},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&&!g.RegExp.integer.test(t)?r(new Error("请输入正整数")):r()}}],tax_rate:[this.MixinRequired("税率不能为空","change"),{validator:function(e,t,r){t&&!g.RegExp.money.test(t)?r(new Error("请输入正确的税率")):r()},trigger:"blur"}],price:[this.MixinRequired("单价不能为空","change"),{validator:function(e,t,r){t&&!g.RegExp.money.test(t)?r(new Error("请输入正确的价格")):r()},trigger:"blur"}],discount_price:[this.MixinRequired("优惠金额不能为空","change"),{validator:function(e,t,r){t&&!g.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&&!g.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){g.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&&!g.RegExp.userName.test(t)?r(new Error("只支持汉字、字母、数字、“-”、“_”的组合!")):r()}}],postal_address:[this.MixinRequired("请输入通讯地址!")],telephone:[this.MixinRequired("请输入联系电话!"),{validator:function(e,t,r){g.RegExp.mobile.test(t)?r():r(new Error("联系电话格式有误!"))},trigger:["change","blur"]}],name:[this.MixinRequired("请输入联系人!")],mobile:[this.MixinRequired("请输入手机号码!"),{validator:function(e,t,r){g.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:0,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:"",monthDiff:0,channList:[],totalAmount:0,reimListVisible:!1,reimburVisible:!1,reimburForm:{order_id:"",money:"",file_url:""},TO_Cmoney:0}},computed:u()({},Object(d.b)(["user"])),mounted:function(){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(),this.OrderForm.marketing_id=JSON.parse(JSON.parse(localStorage.getItem("admin_user")).data).uid},methods:{addReimburForm:function(){var e=this;m.f(this.reimburForm,this.reimburForm.id).then(function(t){e.$message.success("修改成功!"),e.reimburVisible=!1,e.GET_OrderDetail()})},handleAvatarSuccess:function(e,t){this.reimburForm.file_url=t.response.url},beforeAvatarUpload:function(e){var t=e.size/1024/1024<2;return t||this.$message.error("上传头像图片大小不能超过 2MB!"),t},editReim:function(e){this.reimburForm=e,this.reimburForm.file_url="",this.reimburVisible=!0},reimList:function(){this.reimListVisible=!0},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},timeChange:function(e){var t=this,r=new Date(e[1]),i=new Date(e[0]),n=Math.abs(i.getTime()-r.getTime());this.monthDiff=Math.ceil(n/864e5)+1,this.OrderForm.product_list.map(function(e){e.day_num=t.monthDiff})},selMember:function(e){var t=this;p.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){"TO_C"==e.OrderForm.type&&(t.day_num=e.monthDiff),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;F()(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);p.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(w),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;p.i(this.params).then(function(t){e.customerList=t.data}).catch(function(){}),_.u({dictType:"order_type"}).then(function(t){e.orderTypeList=t.data}),_.u({dictType:"order_send_type"}).then(function(t){e.deliveryTypeList=t.data})},GET_MemberList:function(){var e=this;h.f({page_no:1,page_size:-1,disable_flag:!1}).then(function(t){e.memberList=t.data})},GET_MarketingList:function(){var e=this;p.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;p.w({page_no:1,page_size:-1}).then(function(t){e.storeList=t.data})},GET_CollectingAccountList:function(){var e=this;f.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 l()(o.a.mark(function t(){var r,i;return o.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(t){t.day_num=e.monthDiff,console.log(t)}),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