12d8b24c154a5478845900e477834613cb408479b7336ec67a3f39482c2f584f9b64d80495ce437843edeba27ea85445c670d29a7acd097d19aafe10f4c7 64 KB

1
  1. {"code":"/*!\n * build: vue-admin-beautiful \n * copyright: chuzhixin 1204505056@qq.com \n * time: 2022-12-12 09:51:32\n */\n(window[\"webpackJsonp\"]=window[\"webpackJsonp\"]||[]).push([[\"chunk-03d014c8\"],{\"038a\":function(e,t,r){\"use strict\";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r(\"ContainerTit\",[r(\"div\",{attrs:{slot:\"headr\"},slot:\"headr\"},[e.orderId?e._e():r(\"el-button\",{on:{click:function(t){return e.delPauseSave(1)}}},[e._v(\"清除暂存\")]),e.orderId?e._e():r(\"el-button\",{on:{click:e.addPauseSave}},[e._v(\"暂存\")]),r(\"el-button\",{attrs:{loading:e.sub_loading,type:\"primary\"},on:{click:e.subData}},[e._v(\" 提交保存 \")])],1),r(\"div\",{staticClass:\"page-tip-div\"},[r(\"i\",{staticClass:\"el-icon-info\"}),e._v(\" 抄码商品只能选择一个单位进行下单,重复选择则不能勾选 \")]),r(\"el-form\",{ref:\"add_form\",attrs:{rules:e.add_rules,model:e.add_form,size:\"small\",inline:\"\"}},[r(\"div\",{staticClass:\"detail-tab-item\"},[r(\"p\",{staticClass:\"detail-tab-title\"},[e._v(\"基本信息\")]),r(\"div\",{staticClass:\"detail-tab-main\"},[r(\"el-form-item\",{attrs:{label:\"客户\",prop:\"customerId\"}},[r(\"SelectCustomer\",{attrs:{clearable:!1,disabled:5===parseInt(e.order_detail.payStatus)},on:{change:e.customerSel},model:{value:e.add_form.customerName,callback:function(t){e.$set(e.add_form,\"customerName\",t)},expression:\"add_form.customerName\"}}),5!==parseInt(e.order_detail.payStatus)?r(\"el-button\",{attrs:{size:\"mini\",type:\"text\"},on:{click:function(t){return e.$router.push(\"/Customer/CustomerAdmin/AddCustomer\")}}},[e._v(\" 【新建客户】 \")]):e._e()],1),r(\"el-form-item\",{attrs:{label:\"配送方式\",prop:\"deliveryType\"}},[r(\"el-select\",{attrs:{disabled:5===parseInt(e.order_detail.payStatus),placeholder:\"请选择\"},on:{change:e.deliveryTypeChange},model:{value:e.add_form.deliveryType,callback:function(t){e.$set(e.add_form,\"deliveryType\",t)},expression:\"add_form.deliveryType\"}},e._l(e.deliveryType_list,(function(e){return r(\"el-option\",{key:e.id,attrs:{label:e.title,value:e.deliveryType}})})),1)],1),2!==e.add_form.deliveryType&&e.add_form.customerName?r(\"el-form-item\",{attrs:{label:\"收货信息\",prop:\"addressId\"}},[r(\"el-dropdown\",{on:{command:e.addressChange}},[r(\"div\",{staticClass:\"clearfix\",staticStyle:{\"min-width\":\"300px\",cursor:\"pointer\",border:\"1px solid #dcdfe6\",\"border-radius\":\"4px\",padding:\"0 10px\",\"font-size\":\"13px\",\"vertical-align\":\"middle\",height:\"32px\",\"line-height\":\"32px\"}},[r(\"span\",{staticClass:\"float_left\"},[e._v(e._s(e.address_name||\"请选择\"))]),r(\"span\",{staticClass:\"float_right\"},[r(\"i\",{staticClass:\"el-icon-arrow-down el-icon--right\"})])]),r(\"el-dropdown-menu\",{attrs:{slot:\"dropdown\"},slot:\"dropdown\"},[e._l(e.address_list,(function(t,a){return r(\"el-dropdown-item\",{key:a,attrs:{command:t.id}},[e._v(\" \"+e._s(t.addressName)+\" \")])})),e.address_list.length?e._e():r(\"el-dropdown-item\",[e._v(\" 当前客户未设置地址 \")])],2)],1),e.add_form.customerId?r(\"el-button\",{staticStyle:{\"margin-left\":\"5px\",transform:\"translateY(-10px)\"},attrs:{type:\"text\",size:\"small\",plain:\"\"},on:{click:function(t){e.AddAddress=!0}}},[e._v(\" 新增地址 \")]):e._e()],1):e._e(),3===e.add_form.deliveryType&&e.add_form.customerName?r(\"el-form-item\",{attrs:{label:\"物流类型\"}},[r(\"el-select\",{attrs:{placeholder:\"请选择\"},on:{change:e.deliveryTypeChange},model:{value:e.add_form.particularsType,callback:function(t){e.$set(e.add_form,\"particularsType\",t)},expression:\"add_form.particularsType\"}},e._l(e.particularsType_list,(function(e){return r(\"el-option\",{key:e.id,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),2===e.add_form.deliveryType?r(\"el-form-item\",{attrs:{label:\"自提点\"}},[r(\"el-select\",{staticStyle:{width:\"400px\"},attrs:{placeholder:\"请选择\"},on:{change:e.selfRuleIdChange},model:{value:e.add_form.selfRuleId,callback:function(t){e.$set(e.add_form,\"selfRuleId\",t)},expression:\"add_form.selfRuleId\"}},e._l(e.self_express_list,(function(e,t){return r(\"el-option\",{key:t,attrs:{label:e.addressName,value:e.id}})})),1)],1):e._e(),r(\"el-form-item\",{attrs:{label:\"支付方式\"}},[r(\"el-select\",{attrs:{placeholder:\"请选择\"},on:{change:e.deliveryTypeChange},model:{value:e.add_form.payType,callback:function(t){e.$set(e.add_form,\"payType\",t)},expression:\"add_form.payType\"}},e._l(e.payType_list,(function(e){return r(\"el-option\",{key:e.id,attrs:{label:e.label,value:e.value}})})),1)],1)],1)]),r(\"div\",{staticClass:\"detail-tab-item\"},[r(\"p\",{staticClass:\"detail-tab-title\"},[e._v(\"商品清单\")]),r(\"el-table\",{attrs:{data:e.saleOrderGoods,height:e.saleOrderGoods.length>=10?500:\"\"}},[r(\"el-table-column\",{attrs:{type:\"index\",width:\"50\",label:\"#\"}}),r(\"el-table-column\",{attrs:{\"min-width\":\"200\",prop:\"goodsName\",label:\"商品名称\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[r(\"ConditionSelGoods\",{attrs:{disabled:5===parseInt(e.order_detail.payStatus)||!e.userCenterId,\"user-center-id\":e.userCenterId,\"spec-check\":e.spec_check,\"enable-status\":5,\"shop-id\":e.shop_id},on:{goodsVisibleChange:function(r){return e.goodsVisibleChange(r,t.$index)},specSelConfirm:e.specSelConfirm,selectSelGoods:e.selectSelGoods,selGoods:e.selGoods},model:{value:t.row.goodsName,callback:function(r){e.$set(t.row,\"goodsName\",r)},expression:\"scope.row.goodsName\"}})]}}])}),r(\"el-table-column\",{attrs:{prop:\"specGroup\",\"min-width\":\"130\",label:\"规格\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[r(\"span\",[e._v(e._s(t.row.unitName||\"--\")+\";\")]),e._l(t.row.specGroup,(function(t,a){return r(\"span\",{key:a},[e._v(\" \"+e._s(t.specValueName)+\"; \")])}))]}}])}),r(\"el-table-column\",{attrs:{prop:\"inventory\",\"min-width\":\"120\",label:\"可用库存\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[r(\"div\",{staticClass:\"inventory-text\",class:[t.row.inventory<=0?\"danger-color\":\"success-color\"]},[e._v(\" \"+e._s(e.$_common.formatNub(t.row.inventory))+\" \")])]}}])}),r(\"el-table-column\",{attrs:{prop:\"buyNum\",label:\"数量\",\"min-width\":\"100\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[4===t.row.isDistribution?r(\"vxe-input\",{staticStyle:{width:\"100%\"},attrs:{disabled:5===parseInt(e.order_detail.payStatus),min:0,max:t.row.inventory,size:\"mini\",placeholder:\"数值类型\",type:\"number\"},on:{change:function(r){return e.updateBuyNum(t.$index)}},model:{value:t.row.buyNum,callback:function(r){e.$set(t.row,\"buyNum\",r)},expression:\"scope.row.buyNum\"}}):r(\"vxe-input\",{staticStyle:{width:\"100%\"},attrs:{disabled:5===parseInt(e.order_detail.payStatus),min:0,size:\"mini\",placeholder:\"数值类型\",type:\"number\"},on:{change:function(r){return e.updateBuyNum(t.$index)}},model:{value:t.row.buyNum,callback:function(r){e.$set(t.row,\"buyNum\",r)},expression:\"scope.row.buyNum\"}}),r(\"br\"),5===t.row.isEq&&5===t.row.isMaster?r(\"vxe-input\",{staticStyle:{width:\"100%\",\"margin-top\":\"5px\"},attrs:{disabled:5===parseInt(e.order_detail.payStatus),size:\"mini\",placeholder:\"其他单位数量\",type:\"integer\"},model:{value:t.row.otherNum,callback:function(r){e.$set(t.row,\"otherNum\",r)},expression:\"scope.row.otherNum\"}}):e._e()]}}])}),r(\"el-table-column\",{attrs:{\"min-width\":\"100\",prop:\"price\",label:\"单价\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[e.$accessCheck(e.$Access.OrderAddeditGoodsPrice)?r(\"vxe-input\",{staticStyle:{width:\"100%\"},attrs:{size:\"mini\",disabled:5===parseInt(e.order_detail.payStatus),min:0},on:{change:function(r){return e.updateBuyNum(t.$index)}},model:{value:t.row.salePrice,callback:function(r){e.$set(t.row,\"salePrice\",r)},expression:\"scope.row.salePrice\"}}):r(\"span\",[e._v(\" \"+e._s(t.row.salePrice)+\" \")])]}}])}),r(\"el-table-column\",{attrs:{\"min-width\":\"100\",prop:\"totalMoney\",label:\"小计\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[e.$accessCheck(e.$Access.OrderAddeditGoodsPrice)?r(\"vxe-input\",{staticStyle:{width:\"100%\"},attrs:{size:\"mini\",disabled:5===parseInt(e.order_detail.payStatus)},model:{value:t.row.subMoney,callback:function(r){e.$set(t.row,\"subMoney\",r)},expression:\"scope.row.subMoney\"}}):r(\"span\",[e._v(\" \"+e._s(t.row.subMoney)+\" \")])]}}])}),r(\"el-table-column\",{attrs:{fixed:\"right\",prop:\"tag\",label:\"管理\",width:\"120\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[r(\"el-button\",{attrs:{size:\"mini\",type:\"text\",disabled:5===parseInt(e.order_detail.payStatus)},on:{click:function(r){return e.deleteRowGoods(t.$index)}}},[e._v(\" 删除 \")]),r(\"el-button\",{attrs:{disabled:5===parseInt(e.order_detail.payStatus),size:\"mini\",type:\"text\"},on:{click:e.addListGoods}},[e._v(\" 新增 \")])]}}])})],1),r(\"div\",{staticClass:\"price-div\"},[r(\"span\",{staticClass:\"de_label\"},[e._v(\"商品总额:\")]),r(\"span\",{staticClass:\"de_val\"},[e._v(\" \"+e._s(e.$_common.formattedNumber(e.orderAmount))+\" \")]),r(\"span\",{staticClass:\"de_label\"},[e._v(\"优惠金额:\")]),r(\"span\",{staticClass:\"de_val\"},[e._v(\" ¥ \"),e.$accessCheck(e.$Access.OrderAddeditGoodsPrice)?r(\"el-input-number\",{attrs:{controls:!1,size:\"small\",disabled:5===parseInt(e.order_detail.payStatus),min:0,max:e.orderAmount},model:{value:e.totalReduceMoney,callback:function(t){e.totalReduceMoney=t},expression:\"totalReduceMoney\"}}):r(\"span\",[e._v(e._s(e.totalReduceMoney))])],1),r(\"span\",{staticClass:\"de_label\"},[e._v(\"应收:\")]),r(\"span\",{staticClass:\"de_val\"},[e._v(e._s(e.$_common.formattedNumber(e.payMoney)))]),r(\"span\",{staticClass:\"de_label\"},[e._v(\"实收:\")]),r(\"span\",{staticClass:\"de_val\"},[e._v(\" ¥ \"),e.$accessCheck(e.$Access.OrderAddeditGoodsPrice)?r(\"el-input-number\",{attrs:{controls:!1,size:\"small\",disabled:5===parseInt(e.order_detail.payStatus),min:0,max:e.payMoney},model:{value:e.add_form.receivedMoney,callback:function(t){e.$set(e.add_form,\"receivedMoney\",t)},expression:\"add_form.receivedMoney\"}}):r(\"span\",[e._v(e._s(e.add_form.receivedMoney))])],1),r(\"span\",{staticClass:\"de_label\"},[e._v(\"结算账户:\")]),r(\"span\",{staticClass:\"de_val\"},[r(\"el-input\",{staticStyle:{width:\"200px\"},attrs:{readonly:\"\",disabled:!e.add_form.customerId||5===parseInt(e.order_detail.payStatus),size:\"small\",placeholder:\"结算账户\"},model:{value:e.accountName,callback:function(t){e.accountName=t},expression:\"accountName\"}},[r(\"i\",{staticClass:\"el-input__icon el-icon-search\",attrs:{slot:\"suffix\"},on:{click:function(t){e.account_show=!0}},slot:\"suffix\"})])],1)])],1),e._e(),r(\"div\",{staticClass:\"detail-tab-item\"},[r(\"p\",{staticClass:\"detail-tab-title\"},[e._v(\"备注说明\")]),r(\"div\",{staticClass:\"detail-tab-main\"},[r(\"el-input\",{staticStyle:{width:\"100%\"},attrs:{type:\"textarea\",rows:2,placeholder:\"请输入一些说明吧\"},model:{value:e.add_form.remark,callback:function(t){e.$set(e.add_form,\"remark\",t)},expression:\"add_form.remark\"}})],1)])]),r(\"el-dialog\",{attrs:{title:\"新增地址\",visible:e.AddAddress,\"show-close\":!1,width:\"50%\",\"before-close\":e.handleClose,\"close-on-press-escape\":!1,\"close-on-click-modal\":!1},on:{\"update:visible\":function(t){e.AddAddress=t},close:function(t){return e.closeDialog(\"form\")}}},[r(\"el-form\",{ref:\"form\",attrs:{model:e.form,size:\"medium\",\"label-width\":\"100px\",rules:e.form_rules}},[r(\"el-form-item\",{attrs:{label:\"收货人\",prop:\"name\"}},[r(\"el-input\",{staticStyle:{width:\"350px\"},attrs:{placeholder:\"收货人名称\",autocomplete:\"off\"},model:{value:e.form.name,callback:function(t){e.$set(e.form,\"name\",t)},expression:\"form.name\"}})],1),r(\"el-form-item\",{attrs:{label:\"收货地址\",prop:\"provinceCode\"}},[r(\"RegionSelect\",{staticStyle:{\"margin-bottom\":\"10px\"},attrs:{size:\"medium\"},on:{change:e.regionChange},model:{value:e.regionName,callback:function(t){e.regionName=t},expression:\"regionName\"}})],1),r(\"el-form-item\",{attrs:{label:\"详细地址\",prop:\"address\"}},[r(\"el-input\",{staticStyle:{width:\"350px\"},attrs:{placeholder:\"详细地址,例如楼牌,门号\",autocomplete:\"off\"},model:{value:e.form.address,callback:function(t){e.$set(e.form,\"address\",t)},expression:\"form.address\"}})],1),r(\"el-form-item\",{attrs:{label:\"联系方式\",prop:\"mobile\"}},[r(\"el-input\",{staticStyle:{width:\"350px\"},attrs:{placeholder:\"填写收货人联系方式\"},model:{value:e.form.mobile,callback:function(t){e.$set(e.form,\"mobile\",t)},expression:\"form.mobile\"}})],1),r(\"el-form-item\",{attrs:{label:\"是否默认\"}},[r(\"el-switch\",{attrs:{\"active-color\":\"#ff4949\",\"inactive-color\":\"#36B365\"},model:{value:e.form.defaultStatus,callback:function(t){e.$set(e.form,\"defaultStatus\",t)},expression:\"form.defaultStatus\"}})],1)],1),r(\"div\",{staticClass:\"dialog-footer\",attrs:{slot:\"footer\"},slot:\"footer\"},[r(\"el-button\",{on:{click:function(t){e.AddAddress=!1}}},[e._v(\"取 消\")]),r(\"el-button\",{attrs:{type:\"primary\"},on:{click:e.addShippingAddress}},[e._v(\"确 定\")])],1)],1),e.account_show?r(\"AccountType\",{attrs:{id:e.account_shopId,\"is-check\":!1,\"is-show\":e.account_show},on:{cancel:function(t){e.account_show=!1},confirm:e.accountsel}}):e._e()],1)},d=[],n=r(\"3241\"),o=r(\"d177\"),s=r(\"7f10\"),i=r(\"049b\"),c=r(\"d8dd\"),u=r(\"2934\"),l=r(\"866f\"),p=r(\"8156\");const f={skuId:0,code:\"\",goodsId:0,buyNum:1,shopId:0,basicGoodsId:0,goodsName:\"\",unitName:\"\",specGroup:\"\",inventory:0,salePrice:0,subMoney:0,shopName:\"\",goodsImages:\"\",brandId:0,brandName:\"\",categoryPath:\"\",categoryName:\"\",conversion:\"\",barCode:\"\",storageCode:\"\",warehouseId:0,originPrice:\"\",specType:\"\"};var m={name:\"OrderAdd\",components:{SelectCustomer:p[\"default\"],RegionSelect:n[\"default\"],ConditionSelGoods:o[\"default\"],AccountType:l[\"default\"]},data(){const e=(e,t,r)=>{const a=/^1[3456789]\\d{9}$/;\"\"===t?r(new Error):a.test(t)?r():r(new Error(\"手机号格式有误,请重新输入!\"))},t=(e,t,r)=>{2!==this.add_form.deliveryType?t?r():r(new Error(\"请选择收货信息\")):r()};return{address_name:\"\",warehouse:\"\",warehouse_show:!1,account_shopId:0,account_show:!1,AddAddress:!1,loading:!1,userCenterId:\"\",deliveryType_list:[],saleOrderGoods:[],giveawayGoods:[],add_rules:{customerId:[{required:!0,message:\"请选择购买客户\",trigger:\"change\"}],addressId:[{required:!0,validator:t,trigger:\"change\"}],deliveryType:[{required:!0,message:\"请选择配送方式\",trigger:\"change\"}]},form_rules:{name:[{required:!0,message:\"请填写收货人\",trigger:\"change\"}],address:[{required:!0,message:\"请输入详细地址\",trigger:\"blur\"}],mobile:[{required:!0,message:\"请填写联系方式\",trigger:\"blur\"},{validator:e,trigger:\"blur\"}],provinceCode:[{required:!0,message:\"请选择收货地址\",trigger:\"change\"}]},mobile:\"\",address:\"\",address_list:[],accountName:\"\",add_form:{currentAccountName:\"\",receivedMoney:0,accountList:[],deliveryType:\"\",customerName:\"\",customerId:\"\",remark:\"\",addressId:\"\",selfRuleId:[],selfRuleData:{},payType:3,particularsType:\"\"},totalReduceMoney:0,regionName:[],form:{name:\"\",provinceCode:\"\",cityCode:\"\",districtCode:\"\",address:\"\",mobile:\"\",defaultStatus:5},pageName:\"\",orderId:\"\",goods_index:0,give_goods_index:0,spec_check:[],self_express_list:[],order_detail:{},change_num:0,payWay:3,operatorName:\"\",shop_id:\"\",payType_list:[{label:\"货到付款\",value:3},{label:\"先款后货\",value:9}],particularsType_list:[{label:\"物流专线\",value:4},{label:\"物流专车\",value:5}]}},computed:{orderAmount(){if(this.saleOrderGoods.length){if(1===this.saleOrderGoods.length)return Number(this.saleOrderGoods[0].subMoney);{let e=0;return this.saleOrderGoods.forEach(t=>{e=this.$NP.plus(e,Number(t.subMoney)||0)}),e}}return 0},payMoney(){return this.$NP.minus(this.orderAmount||0,this.totalReduceMoney||0)}},async created(){await this.getAllDelivery(),await this.getAllSelfExpressRule(),this.pageName=this.$route.name,this.orderId=this.$route.params.id,this.userCenterId=this.$route.params.userCenterId,this.add_form.currentAccountName=this.userName,this.orderId?await this.getOrderInfoById():(this.pushGoods(),await this.getPauseSave())},methods:{pushGoods(){this.saleOrderGoods=[];for(let e=0;e<1;e++)this.saleOrderGoods.push(this.$_common.deepClone(f))},goodsVisibleChange(e,t){e&&(this.goods_index=t)},giveawayVisibleChange(e,t){e&&(this.give_goods_index=t)},specSelConfirm(e){if(console.log(e.goodsD),5===e.now_goods_data.isEq){const t=this.saleOrderGoods.find(t=>t.goodsId===e.now_goods_data.id);if(t){const r=e.goodsD.find(e=>e.spec.unitName!==t.unitName);if(r)return void this.$message.warning(`【${e.now_goods_data.title}】为抄码商品,只能选择一个单位进行下单`)}else{let t=e.goodsD[0].spec.unitId,r=e.goodsD.every(e=>e.spec.unitId===t);if(!r)return void this.$message.warning(`【${e.now_goods_data.title}】为抄码商品,只能选择一个单位进行下单`)}}const t=e.goodsD.map(t=>({skuId:t.skuId,code:e.now_goods_data.code,goodsId:e.now_goods_data.id,buyNum:1,shopId:e.now_goods_data.shopId,basicGoodsId:e.now_goods_data.basicGoodsId,goodsName:e.now_goods_data.title,unitName:t.spec.unitName,specGroup:t.spec.specGroup,inventory:t.spec.inventory,salePrice:t.spec.salePrice,subMoney:t.spec.salePrice,shopName:e.now_goods_data.shopName,goodsImages:t.spec.specImage||e.now_goods_data.images[0],brandId:e.now_goods_data.brandId,brandName:e.now_goods_data.brandName,categoryPath:e.now_goods_data.categoryPath,categoryName:e.now_goods_data.categoryName,conversion:t.spec.conversion,barCode:t.spec.barCode,storageCode:e.now_goods_data.storage,warehouseId:e.now_goods_data.warehouseId,originPrice:t.spec.originPrice,specType:t.spec.specType,supplierId:t.supplierId,supplierName:t.supplierName,isEq:t.isEq,isMaster:t.spec.isMaster,isDistribution:t.isDistribution,merchantId:t.merchantId}));this.saleOrderGoods=t.concat(this.saleOrderGoods)},giveawaySpecSelConfirm(e){const t=e.goodsD.map(t=>({skuId:t.skuId,code:e.now_goods_data.code,goodsId:e.now_goods_data.id,buyNum:1,shopId:e.now_goods_data.shopId,basicGoodsId:e.now_goods_data.basicGoodsId,goodsName:e.now_goods_data.title,unitName:t.spec.unitName,specGroup:t.spec.specGroup,inventory:t.spec.inventory,salePrice:t.spec.salePrice,subMoney:t.spec.salePrice,shopName:e.now_goods_data.shopName,goodsImages:t.spec.specImage||e.now_goods_data.images[0],brandId:e.now_goods_data.brandId,brandName:e.now_goods_data.brandName,categoryPath:e.now_goods_data.categoryPath,categoryName:e.now_goods_data.categoryName,conversion:t.spec.conversion,barCode:t.spec.barCode,storageCode:e.now_goods_data.storage,warehouseId:e.now_goods_data.warehouseId,originPrice:t.spec.originPrice,specType:t.spec.specType,supplierId:t.supplierId,supplierName:t.supplierName,isEq:t.isEq,isMaster:t.spec.isMaster,isDistribution:t.isDistribution,merchantId:t.merchantId}));this.giveawayGoods=t.concat(this.giveawayGoods)},selectSelGoods(e){this.spec_check=this.saleOrderGoods.filter(t=>t.goodsId===e).map(e=>e.skuId)},giveawaySelectSelGoods(e){this.spec_check=this.giveawayGoods.filter(t=>t.goodsId===e).map(e=>e.skuId)},addListGoods(){this.saleOrderGoods.push(this.$_common.deepClone(f))},giveawayAddListGoods(){this.giveawayGoods.push(this.$_common.deepClone(f))},async addShippingAddress(){if(!this.form.name.trim()||!this.regionName||!this.form.mobile.trim()||!this.form.address.trim())return void this.$message.warning(\"都是必填项不能为空\");await Object(i[\"addShippingAddress\"])({...this.form,customerId:this.add_form.customerId});this.$message({type:\"success\",message:\"添加成功\"}),this.AddAddress=!1,await this.getAllShippingAddress(this.add_form.customerId)},regionChange(e,t){this.form.provinceCode=e[0],this.form.cityCode=e[1],this.form.districtCode=e[2]},handleClose(){this.form={}},async getOrderInfoById(){const{data:e}=await Object(s[\"getOrderInfoById\"])(this.$route.params.userCenterId,{orderId:this.orderId});if(this.order_detail=e,this.add_form={accountList:e.accountList||[],deliveryType:e.deliveryType,customerName:e.customerName,customerId:e.customerId,remark:e.remark,addressId:e.receiveData.id,selfRuleId:e.selfRuleId,selfRuleData:e.selfRuleData,receivedMoney:e.receivedMoney,payType:Number(e.payType)},4===this.add_form.deliveryType&&(this.add_form.deliveryType=3,this.add_form.particularsType=4),5===this.add_form.deliveryType&&(this.add_form.deliveryType=3,this.add_form.particularsType=5),e.receiveData.area&&(this.address_name=e.receiveData.realName+\" \"+e.receiveData.mobile+\" \"+e.receiveData.area.provinceName+\"-\"+e.receiveData.area.cityName+\"-\"+e.receiveData.area.districtName+\"-\"+e.receiveData.address),e.accountList&&e.accountList.length&&(this.accountName=e.accountList[0].accountName),this.add_form.currentAccountName=e.currentAccountName,this.totalReduceMoney=e.totalReduceMoney||0,this.userCenterId=e.userCenterId,this.saleOrderGoods=e.goodsData.map(e=>({...e,subMoney:e.totalMoney,salePrice:e.price,code:e.goodsCode,goodsImages:e.images[0]})),e.customerId&&await this.getAllShippingAddress(e.customerId),this.shop_id=e.shopId,this.account_shopId=e.shopId,2===this.add_form.deliveryType){const t=JSON.parse(e.selfRuleData);this.mobile=t.mobile,this.address=t.provinceName+\" \"+t.cityName+\" \"+t.districtName+\" \"+t.address}else{const t=e.receiveData;this.mobile=t.mobile,this.address=t.area.provinceName+\" \"+t.area.cityName+\" \"+t.area.districtName+\" \"+t.address}},async addPauseSave(){const e={add_form:this.add_form,totalReduceMoney:this.totalReduceMoney,saleOrderGoods:this.saleOrderGoods,userCenterId:this.userCenterId};await Object(u[\"addPauseSave\"])({key:this.pageName,data:e});this.$message({type:\"success\",message:\"暂存成功\"}),2===this.systemType?this.$closeCurrentGoEdit(\"/SingleStore/order/OrderList/waitAudit\"):this.$closeCurrentGoEdit(\"/order/manageO/orderQuery\")},async getPauseSave(){const{data:e}=await Object(u[\"getPauseSave\"])({key:this.pageName});\"{}\"!==JSON.stringify(e)&&e.add_form&&(this.add_form=e.add_form,e.add_form.customerId&&await this.getAllShippingAddress(e.add_form.customerId),this.totalReduceMoney=e.totalReduceMoney||0,this.saleOrderGoods=e.saleOrderGoods||[f],this.userCenterId=e.userCenterId||0)},async getAllDelivery(){const{data:e}=await Object(c[\"getAllDelivery\"])({page:1,pageSize:100});this.deliveryType_list=e;const t=e.find(e=>5===e.defaultStatus);t&&!this.add_form.deliveryType&&(this.add_form.deliveryType=t.deliveryType)},async delPauseSave(e){Object(u[\"delPauseSave\"])({key:this.pageName});e&&(this.$message({type:\"success\",message:\"清除暂存成功\"}),2===this.systemType?this.$closeCurrentGoEdit(\"/SingleStore/order/OrderList/waitAudit\"):this.$closeCurrentGoEdit(\"/order/manageO/orderQuery\"))},subData(){2!==this.add_form.deliveryType||this.add_form.selfRuleId?this.$refs.add_form.validate(async e=>{if(e){const e=this.saleOrderGoods.filter(e=>e.skuId),t=e.every(e=>5!==e.isEq||5!==e.isMaster||e.otherNum>0);if(!t)return void this.$message.warning(\"抄码商品其他单位数量不能为0\");const r=e.every(e=>e.buyNum>0);if(!r)return void this.$message.warning(\"请输入大于0的商品数量\");e.every(e=>e.salePrice>0),e.every(e=>e.subMoney>0);const a=e.map(e=>(this.orderId||(delete e.inventory,delete e.enabledLadder,delete e.ladderPrice),e));if(!a.length)return void this.$message.warning(\"请选择商品\");if(this.add_form.receivedMoney>0&&!this.add_form.accountList.length)return void this.$message.warning(\"请选择结算账户\");this.orderId?await this.editOrder(a):await this.addOrder(a)}}):this.$message.warning(\"请选择自提点\")},async editOrder(e){this.add_form.particularsType&&(this.add_form.deliveryType=this.add_form.particularsType);const t=e.map(e=>({...e,totalMoney:e.subMoney,price:e.salePrice,goodsCode:e.code,images:[e.goodsImages]}));this.sub_loading=!0;try{await Object(s[\"newOrderEdit\"])(this.orderId,{...this.order_detail,deliveryType:this.add_form.deliveryType,customerName:this.add_form.customerName,addressId:this.add_form.addressId,remark:this.add_form.remark,accountList:this.add_form.accountList,totalMoney:this.orderAmount,payMoney:this.payMoney,totalReduceMoney:this.totalReduceMoney||0,receivedMoney:this.add_form.receivedMoney,currentAccountName:this.add_form.currentAccountName,userCenterId:this.userCenterId,customerId:this.add_form.customerId,selfRuleId:this.add_form.selfRuleId,selfRuleData:this.add_form.selfRuleData,goodsData:t,payType:this.add_form.payType});this.sub_loading=!1,this.$message({type:\"success\",message:\"提交成功\"}),2===this.systemType?this.$closeCurrentGoEdit(\"/SingleStore/order/OrderList/waitAudit\"):this.$closeCurrentGoEdit(\"/order/manageO/orderQuery\")}finally{this.sub_loading=!1}},async addOrder(e){\"\"===this.totalReduceMoney&&(this.totalReduceMoney=0),this.add_form.particularsType&&(this.add_form.deliveryType=this.add_form.particularsType);let t={deliveryType:this.add_form.deliveryType,customerName:this.add_form.customerName,addressId:this.add_form.addressId,remark:this.add_form.remark,accountList:this.add_form.accountList,currentAccountName:this.add_form.currentAccountName,receivedMoney:this.add_form.receivedMoney,lists:e,totalMoney:this.orderAmount,payMoney:this.payMoney,totalReduceMoney:this.totalReduceMoney||0,userCenterId:this.userCenterId,customerId:this.add_form.customerId,selfRuleId:this.add_form.selfRuleId,selfRuleData:this.add_form.selfRuleData,operatorName:this.userName,payType:this.add_form.payType};this.sub_loading=!0;try{await Object(s[\"newAddOrder\"])(t);this.sub_loading=!1,this.$message({type:\"success\",message:\"提交成功\"}),await this.delPauseSave(),2===this.systemType?this.$closeCurrentGoEdit(\"/SingleStore/order/OrderList/waitAudit\"):this.$closeCurrentGoEdit(\"/order/manageO/orderQuery\")}finally{this.sub_loading=!1}},async selGoods(e){if(e.length){let t=[],r=!1;for(let s in e){const a=e[s];if(5===a.isEq){if(t.find(e=>e.id===a.id&&e.unitId!==a.unitId)){this.$message.warning(\"抄码商品只能选择一个单位进行下单,请重新勾选\"),r=!0;break}t.push(a)}}if(r)return;let a=e.map(e=>{let t=0;return t=e.enabledLadder?e.ladderPrice[0].price:e.salePrice,{goodsName:e.title,skuId:e.skuId,code:e.code,goodsId:e.id,buyNum:1,otherNum:\"\",shopId:e.shopId,basicGoodsId:e.basicGoodsId,unitName:e.unitName,unitId:e.unitId,specGroup:e.specGroup,inventory:e.inventory,salePrice:t,subMoney:e.salePrice,shopName:e.shopName,goodsImages:e.images[0],brandId:e.brandId,brandName:\"\",categoryPath:e.categoryPath,categoryName:e.categoryName,conversion:e.conversion,barCode:\"\",storageCode:\"\",warehouseId:e.warehouseId,originPrice:e.originPrice,specType:e.specType,enabledLadder:e.enabledLadder,ladderPrice:e.ladderPrice,supplierId:e.supplierId,supplierName:e.supplierName,isEq:e.isEq,isMaster:e.isMaster,isDistribution:e.isDistribution,merchantId:e.merchantId}});const d=this.$_common.deepClone(this.saleOrderGoods);a=a.filter(e=>{let t=-1;return 5===e.isEq&&(t=d.findIndex(t=>t.goodsId===e.goodsId&&t.unitId!==e.unitId)),-1===t});const n=d.filter(e=>e.skuId),o=d.filter(e=>!e.skuId);this.saleOrderGoods=[...n,...a].concat(o)}},async giveawaySelGoods(e){if(e.length){const t=e.map(e=>{let t=0;return t=e.enabledLadder?e.ladderPrice[0].price:e.salePrice,{goodsName:e.title,skuId:e.skuId,code:e.code,goodsId:e.id,buyNum:1,otherNum:\"\",shopId:e.shopId,basicGoodsId:e.basicGoodsId,unitName:e.unitName,specGroup:e.specGroup,inventory:e.inventory,salePrice:t,subMoney:e.salePrice,shopName:e.shopName,goodsImages:e.images[0],brandId:e.brandId,brandName:\"\",categoryPath:e.categoryPath,categoryName:e.categoryName,conversion:e.conversion,barCode:\"\",storageCode:\"\",warehouseId:e.warehouseId,originPrice:e.originPrice,specType:e.specType,enabledLadder:e.enabledLadder,ladderPrice:e.ladderPrice,supplierId:e.supplierId,supplierName:e.supplierName,isEq:e.isEq,isDistribution:e.isDistribution,merchantId:e.merchantId}}),r=this.giveawayGoods.filter(e=>e.skuId),a=this.giveawayGoods.filter(e=>!e.skuId);this.giveawayGoods=[...r,...t].concat(a)}},async updateBuyNum(e){const t=this.$_common.deepClone(this.saleOrderGoods);let r=t[e].salePrice,a=t[e].inventory,d=t[e].isDistribution;if(4===d&&t[e].buyNum>a&&(t[e].buyNum=t[e].inventory),t[e].enabledLadder){let a=t[e].ladderPrice.find(r=>t[e].buyNum>=r.from&&t[e].buyNum<=r.to);r=a?a.price:t[e].salePrice}t[e].subMoney=this.$NP.times(r,t[e].buyNum),t[e].salePrice=r,console.log(t),this.saleOrderGoods=t},async giveawayUpdateBuyNum(e){const t=this.$_common.deepClone(this.giveawayGoods);let r=t[e].salePrice,a=t[e].buyNum,d=t[e].inventory,n=t[e].isDistribution;if(4===n&&a>d&&(t[e].buyNum=t[e].inventory),t[e].enabledLadder){let d=t[e].ladderPrice.find(e=>a>=e.from&&a<=e.to);r=d?d.price:t[e].salePrice}t[e].subMoney=this.$NP.times(r,a),t[e].salePrice=r,this.giveawayGoods=t},customerSel(e,t){const r=t[0];this.add_form.customerId=r.id,this.account_shopId=r.shopId,this.userCenterId=r.userCenterId,this.add_form.addressId=\"\",this.address_name=\"\",this.saleOrderGoods=[this.$_common.deepClone(f)],2!==this.add_form.deliveryType&&this.getAllShippingAddress(this.add_form.customerId)},accountsel(e){this.accountName=e[0].name,this.add_form.accountList=[{accountId:e[0].id,accountNumber:e[0].accountNumber,accountName:e[0].name,money:this.add_form.receivedMoney,discountMoney:0,finalMoney:this.add_form.receivedMoney,payWay:this.payWay,remark:e[0].remark}]},async getAllShippingAddress(e){const{data:t}=await Object(i[\"getAllShippingAddress\"])(e);t.length?(this.add_form.addressId=t[0].id,this.address_list=t.map(e=>({...e,addressName:e.name+\" \"+e.mobile+\" \"+e.area.provinceName+\"-\"+e.area.cityName+\"-\"+e.area.districtName+\"-\"+e.address})),this.address_name=this.address_list[0].addressName):this.address_list=[]},async deleteRowGoods(e){this.saleOrderGoods.length>1?this.saleOrderGoods.splice(e,1):this.$message.warning(\"至少保留一条商品\")},async giveawayDeleteRowGoods(e){this.giveawayGoods.splice(e,1)},async getAllSelfExpressRule(){const{data:e}=await Object(c[\"getAllSelfExpressRule\"])();this.self_express_list=e.map(e=>({...e,addressName:e.setData.name+\" \"+e.setData.mobile+\" \"+e.setData.provinceName+\"-\"+e.setData.cityName+\"-\"+e.setData.districtName+\"-\"+e.setData.address})),e.length&&(this.add_form.selfRuleId=e[0].id,this.add_form.selfRuleData=e[0].setData)},deliveryTypeChange(e){if(this.payType_list.forEach(t=>{e===t.value&&(this.order_detail.payTypeMsg=t.label)}),1===e)this.getAllShippingAddress(this.add_form.customerId);else if(2===e&&this.self_express_list.length){const e=this.self_express_list[0];this.add_form.selfRuleId=e.id,this.add_form.selfRuleData=e.setData}},addressChange(e){this.add_form.addressId=e,this.address_name=this.address_list.find(t=>t.id===e).addressName},closeDialog(e){this.regionName=[],this.$refs[e].resetFields()},selfRuleIdChange(e){const t=this.self_express_list.find(t=>t.id===e);this.add_form.selfRuleData=t?t.setData:{}}}},h=m,g=(r(\"50b4\"),r(\"2877\")),_=Object(g[\"a\"])(h,a,d,!1,null,\"77a30958\",null);t[\"default\"]=_.exports},\"1ccb\":function(e,t,r){\"use strict\";r(\"8d2f\")},\"3e4b\":function(e,t,r){\"use strict\";r(\"8c5f\")},\"50b4\":function(e,t,r){\"use strict\";r(\"6963\")},6963:function(e,t,r){},\"7f10\":function(e,t,r){\"use strict\";r.r(t),r.d(t,\"getOrderInfoByIds\",(function(){return d})),r.d(t,\"addSalesOrder\",(function(){return n})),r.d(t,\"updateOrderPayData\",(function(){return o})),r.d(t,\"printIncr\",(function(){return s})),r.d(t,\"searchOrder\",(function(){return i})),r.d(t,\"keywordSearch\",(function(){return c})),r.d(t,\"exportKeywordSearch\",(function(){return u})),r.d(t,\"exportSearchOrder\",(function(){return l})),r.d(t,\"getAllOrder\",(function(){return p})),r.d(t,\"exportGetAllOrder\",(function(){return f})),r.d(t,\"updateAuditStatus\",(function(){return m})),r.d(t,\"revokeAudit\",(function(){return h})),r.d(t,\"batchUpdateAuditStatus\",(function(){return g})),r.d(t,\"delOrder\",(function(){return _})),r.d(t,\"setSalesMan\",(function(){return y})),r.d(t,\"getOrderInfoById\",(function(){return b})),r.d(t,\"exprotsgetOrderProfit\",(function(){return O})),r.d(t,\"getAllOrderData\",(function(){return v})),r.d(t,\"exportGetAllOrderData\",(function(){return I})),r.d(t,\"addOrder\",(function(){return A})),r.d(t,\"newAddOrder\",(function(){return w})),r.d(t,\"saveEdit\",(function(){return S})),r.d(t,\"orderEdit\",(function(){return k})),r.d(t,\"newOrderEdit\",(function(){return N})),r.d(t,\"reStockOut\",(function(){return R})),r.d(t,\"editOrderExpress\",(function(){return C})),r.d(t,\"updateOrderStatus\",(function(){return T})),r.d(t,\"addOrderOut\",(function(){return j})),r.d(t,\"getAllOrderOut\",(function(){return x})),r.d(t,\"exportGetAllOrderOut\",(function(){return P})),r.d(t,\"auditOrderOut\",(function(){return G})),r.d(t,\"deleteOrderOut\",(function(){return F})),r.d(t,\"getOrderOut\",(function(){return D})),r.d(t,\"updateOrderOut\",(function(){return $})),r.d(t,\"getOrderProfit\",(function(){return M})),r.d(t,\"searchAllOrderOut\",(function(){return E})),r.d(t,\"exportSearchAllOrderOut\",(function(){return B})),r.d(t,\"getAllOrderOrder\",(function(){return q})),r.d(t,\"OrderVerification\",(function(){return L})),r.d(t,\"getOrderByVerifyCode\",(function(){return z})),r.d(t,\"cashierOrder\",(function(){return V})),r.d(t,\"statistics\",(function(){return J})),r.d(t,\"getDistributionAll\",(function(){return U})),r.d(t,\"retAmount\",(function(){return Q})),r.d(t,\"addLogistics\",(function(){return W})),r.d(t,\"rejectOrderReturn\",(function(){return K})),r.d(t,\"getAllOrderPicking\",(function(){return Y})),r.d(t,\"getOrderPickingInfo\",(function(){return H})),r.d(t,\"getAllPickingGoodsDetail\",(function(){return X}));var a=r(\"b775\");function d(e){return Object(a[\"default\"])({url:\"/Order/Order/getOrderInfoByIds\",method:\"post\",data:e})}function n(e,t){return Object(a[\"default\"])({url:\"/Order/Order/addSalesOrder/\"+e,method:\"post\",data:t})}function o(e,t){return Object(a[\"default\"])({url:\"/Order/Order/updateOrderPayData/\"+e,method:\"put\",data:t})}function s(e,t){return Object(a[\"default\"])({url:\"/Order/Order/printIncr/\"+e,method:\"put\",data:t})}function i(e){return Object(a[\"default\"])({url:\"/Order/Order/search\",method:\"post\",data:e})}function c(e){return Object(a[\"default\"])({url:\"/Order/Order/keywordSearch\",method:\"post\",data:e})}function u(e){return Object(a[\"default\"])({url:\"/Order/Order/keywordSearch\",method:\"post\",responseType:\"blob\",data:e})}function l(e){return Object(a[\"default\"])({url:\"/Order/Order/search\",method:\"post\",responseType:\"blob\",data:e})}function p(e){return Object(a[\"default\"])({url:\"/Order/Order/getAllOrder\",method:\"post\",data:e})}function f(e){return Object(a[\"default\"])({url:\"/Order/Order/getAllOrder\",responseType:\"blob\",method:\"post\",data:e})}function m(e,t){return Object(a[\"default\"])({url:\"/Order/Order/updateAuditStatus/\"+e,method:\"put\",data:t})}function h(e,t){return Object(a[\"default\"])({url:\"/Order/Order/revokeAudit/\"+e,method:\"put\",data:t})}function g(e){return Object(a[\"default\"])({url:\"/Order/Order/batchUpdateAuditStatus\",method:\"post\",data:e})}function _(e,t){return Object(a[\"default\"])({url:\"/Order/Order/delOrder/\"+e,method:\"delete\",data:t})}function y(e){return Object(a[\"default\"])({url:\"/Order/Order/setSalesMan\",method:\"post\",data:e})}function b(e,t){return Object(a[\"default\"])({url:\"/Order/Order/getOrderInfoById/\"+e,method:\"post\",data:t})}function O(e){return Object(a[\"default\"])({url:\"Order/Order/getOrderProfit\",method:\"post\",responseType:\"blob\",data:e})}function v(e){return Object(a[\"default\"])({url:\"/Order/Order/getAllOrderData\",method:\"post\",data:e})}function I(e){return Object(a[\"default\"])({url:\"/Order/Order/getAllOrderData\",method:\"post\",responseType:\"blob\",data:e})}function A(e,t){return Object(a[\"default\"])({url:\"/Order/Order/addOrder/\"+e,method:\"post\",data:t})}function w(e){return Object(a[\"default\"])({url:\"/Order/Order/add\",method:\"post\",data:e})}function S(e){return Object(a[\"default\"])({url:\"/Order/Order/saveEdit\",method:\"post\",data:e})}function k(e,t){return Object(a[\"default\"])({url:\"/Order/Order/orderEdit/\"+e,method:\"post\",data:t})}function N(e,t){return Object(a[\"default\"])({url:\"/Order/Order/edit/\"+e,method:\"post\",data:t})}function R(e,t){return Object(a[\"default\"])({url:\"/Order/Order/reStockOut/\"+e,method:\"post\",data:t})}function C(e,t){return Object(a[\"default\"])({url:\"/Order/Order/editOrderExpress/\"+e,method:\"put\",data:t})}function T(e,t){return Object(a[\"default\"])({url:\"/Order/Order/updateOrderStatus/\"+e,method:\"put\",data:t})}function j(e){return Object(a[\"default\"])({url:\"/Order/OrderReturn/addOrderReturn\",method:\"post\",data:e})}function x(e){return Object(a[\"default\"])({url:\"/Order/OrderReturn/getAllOrderReturn\",method:\"post\",data:e})}function P(e){return Object(a[\"default\"])({url:\"/Order/OrderReturn/getAllOrderReturn\",responseType:\"blob\",method:\"post\",data:e})}function G(e,t){return Object(a[\"default\"])({url:\"/Order/OrderReturn/auditOrderReturn/\"+e,method:\"put\",data:t})}function F(e,t){return Object(a[\"default\"])({url:\"/Order/OrderReturn/deleteOrderReturn/\"+e,method:\"get\",data:t})}function D(e,t){return Object(a[\"default\"])({url:\"/Order/OrderReturn/getOrderReturn/\"+e,method:\"get\",data:t})}function $(e,t){return Object(a[\"default\"])({url:\"/Order/OrderReturn/updateOrderReturn/\"+e,method:\"put\",data:t})}function M(e){return Object(a[\"default\"])({url:\"/Order/Order/getOrderProfit\",method:\"put\",data:e})}function E(e){return Object(a[\"default\"])({url:\"/Order/OrderReturn/searchAllOrderReturn\",method:\"post\",data:e})}function B(e){return Object(a[\"default\"])({url:\"/Order/OrderReturn/searchAllOrderReturn\",method:\"post\",responseType:\"blob\",data:e})}function q(e){return Object(a[\"default\"])({url:\"/Order/Order/getAllOrder\",method:\"post\",data:e})}function L(e,t){return Object(a[\"default\"])({url:\"/Order/Order/verification/\"+e,method:\"put\",data:t})}function z(e){return Object(a[\"default\"])({url:\"/Order/Order/getOrderByVerifyCode\",method:\"post\",data:e})}function V(e){return Object(a[\"default\"])({url:\"/Order/Order/cashierOrder\",method:\"post\",data:e})}function J(e){return Object(a[\"default\"])({url:\"/Order/Order/statistics\",method:\"post\",data:e})}function U(e){return Object(a[\"default\"])({url:\"/Order/Order/getDistributionAll\",method:\"POST\",data:e})}function Q(e){return Object(a[\"default\"])({url:\"Order/Order/retAmount\",method:\"POST\",data:e})}function W(e){return Object(a[\"default\"])({url:\"Order/Order/addLogistics\",method:\"POST\",data:e})}function K(e){return Object(a[\"default\"])({url:\"Order/OrderReturn/rejectOrderReturn\",method:\"put\",data:e})}function Y(e){return Object(a[\"default\"])({url:\"Order/OrderPicking/getAllOrderPicking\",method:\"post\",data:e})}function H(e,t){return Object(a[\"default\"])({url:\"Order/OrderPicking/getOrderPickingInfo/\"+e,method:\"post\",data:t})}function X(e){return Object(a[\"default\"])({url:\"Order/OrderPicking/getAllPickingGoodsDetail\",method:\"post\",data:e})}},\"866f\":function(e,t,r){\"use strict\";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r(\"el-dialog\",{attrs:{title:e.title,visible:e.isShow,\"close-on-press-escape\":!1,\"close-on-click-modal\":!1,width:\"60%\"},on:{close:e.cancel}},[r(\"vxe-table\",{ref:\"xTable1\",attrs:{border:\"inner\",data:e.tableData},on:{\"radio-change\":e.radioChangeEvent}},[e.isRadio?r(\"vxe-table-column\",{attrs:{type:\"radio\",width:\"60\"}}):e._e(),r(\"vxe-table-column\",{attrs:{\"min-width\":\"140\",field:\"accountCode\",title:\"账户编号\"}}),r(\"vxe-table-column\",{attrs:{\"min-width\":\"140\",field:\"name\",title:\"账户名称\"}}),r(\"vxe-table-column\",{attrs:{field:\"accountNumber\",\"min-width\":\"160\",title:\"账户号\"}}),r(\"vxe-table-column\",{attrs:{field:\"money\",title:\"当前余额\",\"min-width\":\"110\"},scopedSlots:e._u([{key:\"default\",fn:function(t){var r=t.row;return[e._v(\" \"+e._s(e.$_common.formattedNumber(r.money))+\" \")]}}])}),r(\"vxe-table-column\",{attrs:{field:\"createTime\",title:\"建账日期\",\"min-width\":\"160\"},scopedSlots:e._u([{key:\"default\",fn:function(t){var r=t.row;return[e._v(\" \"+e._s(e.$_common.formatDate(r.createTime))+\" \")]}}])}),r(\"vxe-table-column\",{attrs:{field:\"beginMoney\",title:\"期初余额\",\"min-width\":\"110\"},scopedSlots:e._u([{key:\"default\",fn:function(t){var r=t.row;return[e._v(\" \"+e._s(e.$_common.formattedNumber(r.beginMoney))+\" \")]}}])}),r(\"vxe-table-column\",{attrs:{field:\"shopName\",\"show-overflow\":\"\",title:\"所属商铺\",\"min-width\":\"140\"}}),e.isRadio?e._e():r(\"vxe-table-column\",{attrs:{fixed:\"right\",title:\"选择\",width:\"90\"},scopedSlots:e._u([{key:\"default\",fn:function(t){var a=t.row;return[r(\"el-button\",{attrs:{icon:\"el-icon-check\",size:\"mini\"},on:{click:function(t){return e.dbSelect(a)}}})]}}],null,!1,2398928997)})],1),r(\"FooterPage\",{attrs:{\"page-size\":e.pre_page,\"total-page\":e.total,\"current-page\":e.page},on:{\"update:totalPage\":function(t){e.total=t},\"update:total-page\":function(t){e.total=t},\"update:currentPage\":function(t){e.page=t},\"update:current-page\":function(t){e.page=t},pageChange:e.pageChange,sizeChange:e.sizeChange}},[e.isRadio?r(\"div\",{attrs:{slot:\"btn-div\"},slot:\"btn-div\"},[r(\"el-button\",{attrs:{size:\"small\",type:\"primary\"},on:{click:e.confirm}},[e._v(\"确定\")]),r(\"el-button\",{attrs:{size:\"small\"},on:{click:e.cancel}},[e._v(\"取消\")])],1):e._e()])],1)},d=[],n=r(\"d099\"),o=r(\"3c48\"),s={name:\"AccountType\",components:{FooterPage:o[\"default\"]},props:{title:{type:String,default:\"账户列表\"},isShow:{type:Boolean,default:!1},isRadio:{type:Boolean,default:!1},shopId:{type:Number,default:0},type:{type:[Number,String],default:\"\"},isMem:{type:[Number,String],default:\"\"}},data(){return{choose_data:[],clientList:[],tableData:[],pre_page:10,page:1,selectedIndex:null,total:0,loading:!1,pageLayout:\"total, prev, pager, next\",selectedClient:{}}},created(){this.getAllAccount()},methods:{radioChangeEvent({row:e}){this.choose_data=e,console.log(\"单选事件\")},async getAllAccount(){let e={page:this.page,pageSize:this.pre_page,enableStatus:5,isMem:this.isMem};this.shopId&&(e.shopId=this.shopId),this.type&&(e.type=this.type);const{data:t,pageTotal:r}=await Object(n[\"getAllAccount\"])(e);this.tableData=t,this.total=r},dbSelect(e){this.choose_data=[e],this.$emit(\"confirm\",this.choose_data),this.cancel()},selectionChange(e){this.choose_data=e},confirm(){this.$emit(\"confirm\",this.choose_data),this.cancel()},cancel(){this.$emit(\"cancel\")},pageChange(e){this.page=e,this.getAllAccount()},sizeChange(e){this.pre_page=e,this.pageChange(1)}}},i=s,c=(r(\"3e4b\"),r(\"2877\")),u=Object(c[\"a\"])(i,a,d,!1,null,\"0a96e346\",null);t[\"default\"]=u.exports},\"8c5f\":function(e,t,r){},\"8d2f\":function(e,t,r){},d099:function(e,t,r){\"use strict\";r.r(t),r.d(t,\"addFinanceType\",(function(){return d})),r.d(t,\"editFinanceType\",(function(){return n})),r.d(t,\"delFinanceType\",(function(){return o})),r.d(t,\"getAllFinanceType\",(function(){return s})),r.d(t,\"getAllFinanceTypeNoPage\",(function(){return i})),r.d(t,\"updateFinanceTypeStatus\",(function(){return c})),r.d(t,\"updateFinanceTypeDefaultStatus\",(function(){return u})),r.d(t,\"getAllReceive\",(function(){return l})),r.d(t,\"exportGetAllReceive\",(function(){return p})),r.d(t,\"searchAllReceive\",(function(){return f})),r.d(t,\"exportSearchAllReceive\",(function(){return m})),r.d(t,\"getReceiveInfo\",(function(){return h})),r.d(t,\"updateReceiveStatus\",(function(){return g})),r.d(t,\"getReceivedByOrder\",(function(){return _})),r.d(t,\"getAllPay\",(function(){return y})),r.d(t,\"exportGetAllPay\",(function(){return b})),r.d(t,\"searchPay\",(function(){return O})),r.d(t,\"exportSearchPay\",(function(){return v})),r.d(t,\"updatePayStatus\",(function(){return I})),r.d(t,\"getPayInfo\",(function(){return A})),r.d(t,\"addAccount\",(function(){return w})),r.d(t,\"getAllAccount\",(function(){return S})),r.d(t,\"editAccount\",(function(){return k})),r.d(t,\"delAccount\",(function(){return N})),r.d(t,\"updateAccountDefaultStatus\",(function(){return R})),r.d(t,\"updateAccountStatus\",(function(){return C})),r.d(t,\"getAccountInfo\",(function(){return T})),r.d(t,\"getAllAccountDetail\",(function(){return j})),r.d(t,\"addReceived\",(function(){return x})),r.d(t,\"deleteReceived\",(function(){return P})),r.d(t,\"exportsgetAllReceived\",(function(){return G})),r.d(t,\"getAllReceived\",(function(){return F})),r.d(t,\"getReceivedInfo\",(function(){return D})),r.d(t,\"updateReceivedStatus\",(function(){return $})),r.d(t,\"updateReceiptRequisitionStatus\",(function(){return M})),r.d(t,\"getTempReceivedData\",(function(){return E})),r.d(t,\"ReceivedSearch\",(function(){return B})),r.d(t,\"editReceived\",(function(){return q})),r.d(t,\"addPaid\",(function(){return L})),r.d(t,\"searchPaid\",(function(){return z})),r.d(t,\"getAllPaid\",(function(){return V})),r.d(t,\"exportsgetAllPaid\",(function(){return J})),r.d(t,\"getPaidInfo\",(function(){return U})),r.d(t,\"updatePaidStatus\",(function(){return Q})),r.d(t,\"getTempPaidData\",(function(){return W})),r.d(t,\"editPaid\",(function(){return K})),r.d(t,\"getAllCustomerBalance\",(function(){return Y})),r.d(t,\"exportgetAllCustomerBalance\",(function(){return H})),r.d(t,\"getAllCustomerBalanceDetail\",(function(){return X})),r.d(t,\"exportgetAllCustomerBalanceDetail\",(function(){return Z})),r.d(t,\"getAllSupplierBalance\",(function(){return ee})),r.d(t,\"exportGetAllSupplierBalance\",(function(){return te})),r.d(t,\"exportgetAllSupplierBalanceDetail\",(function(){return re})),r.d(t,\"getAllSupplierBalanceDetail\",(function(){return ae})),r.d(t,\"addAccountTransfer\",(function(){return de})),r.d(t,\"getAccountTransferInfo\",(function(){return ne})),r.d(t,\"editAccountTransfer\",(function(){return oe})),r.d(t,\"getAllAccountTransfer\",(function(){return se})),r.d(t,\"updateAccountTransferStatus\",(function(){return ie})),r.d(t,\"getTempAccountTransferData\",(function(){return ce})),r.d(t,\"getTodayStatistics\",(function(){return ue})),r.d(t,\"getAllReceiptRequisition\",(function(){return le})),r.d(t,\"addReceiptRequisition\",(function(){return pe})),r.d(t,\"editReceiptRequisition\",(function(){return fe})),r.d(t,\"getReceiptRequisitionInfo\",(function(){return me})),r.d(t,\"getAllAccountType\",(function(){return he})),r.d(t,\"addAccountType\",(function(){return ge})),r.d(t,\"delAccountType\",(function(){return _e})),r.d(t,\"getAccountTypeInfo\",(function(){return ye})),r.d(t,\"editAccountType\",(function(){return be})),r.d(t,\"getAllExpenseSingle\",(function(){return Oe})),r.d(t,\"addExpenseSingle\",(function(){return ve})),r.d(t,\"getExpenseSingleInfo\",(function(){return Ie})),r.d(t,\"editExpenseSingle\",(function(){return Ae})),r.d(t,\"delExpenseSingle\",(function(){return we})),r.d(t,\"updateExpenseStatus\",(function(){return Se})),r.d(t,\"getAllRefund\",(function(){return ke})),r.d(t,\"addRefund\",(function(){return Ne})),r.d(t,\"getRefundInfo\",(function(){return Re})),r.d(t,\"editRefund\",(function(){return Ce})),r.d(t,\"updateRefundStatus\",(function(){return Te})),r.d(t,\"getAllReceivedOffset\",(function(){return je})),r.d(t,\"getAllPaidOffset\",(function(){return xe}));var a=r(\"b775\");function d(e){return Object(a[\"default\"])({url:\"/Finance/FinanceType/addFinanceType\",method:\"post\",data:e})}function n(e,t){return Object(a[\"default\"])({url:\"/Finance/FinanceType/editFinanceType/\"+e,method:\"put\",data:t})}function o(e,t){return Object(a[\"default\"])({url:\"/Finance/FinanceType/delFinanceType/\"+e,method:\"delete\",data:t})}function s(e){return Object(a[\"default\"])({url:\"/Finance/FinanceType/getAllFinanceType\",method:\"post\",data:e})}function i(e,t){return Object(a[\"default\"])({url:\"/Finance/FinanceType/getAllFinanceTypeNoPage/\"+e,method:\"post\",data:t})}function c(e){return Object(a[\"default\"])({url:\"/Finance/FinanceType/updateFinanceTypeStatus\",method:\"post\",data:e})}function u(e){return Object(a[\"default\"])({url:\"/Finance/FinanceType/updateFinanceTypeDefaultStatus\",method:\"post\",data:e})}function l(e){return Object(a[\"default\"])({url:\"/Finance/Receive/getAllReceive\",method:\"post\",data:e})}function p(e){return Object(a[\"default\"])({url:\"/Finance/Receive/getAllReceive\",responseType:\"blob\",method:\"post\",data:e})}function f(e){return Object(a[\"default\"])({url:\"/Finance/Receive/search\",method:\"post\",data:e})}function m(e){return Object(a[\"default\"])({url:\"/Finance/Receive/search\",responseType:\"blob\",method:\"post\",data:e})}function h(e){return Object(a[\"default\"])({url:\"/Finance/Receive/getReceiveInfo\",method:\"post\",data:e})}function g(e){return Object(a[\"default\"])({url:\"/Finance/Receive/updateReceiveStatus\",method:\"post\",data:e})}function _(e){return Object(a[\"default\"])({url:\"/Finance/Received/getReceivedByOrder\",method:\"post\",data:e})}function y(e){return Object(a[\"default\"])({url:\"/Finance/Pay/getAllPay\",method:\"post\",data:e})}function b(e){return Object(a[\"default\"])({url:\"/Finance/Pay/getAllPay\",responseType:\"blob\",method:\"post\",data:e})}function O(e){return Object(a[\"default\"])({url:\"/Finance/Pay/search\",method:\"post\",data:e})}function v(e){return Object(a[\"default\"])({url:\"/Finance/Pay/search\",responseType:\"blob\",method:\"post\",data:e})}function I(e){return Object(a[\"default\"])({url:\"/Finance/Pay/updatePayStatus\",method:\"post\",data:e})}function A(e){return Object(a[\"default\"])({url:\"/Finance/Pay/getPayInfo\",method:\"post\",data:e})}function w(e){return Object(a[\"default\"])({url:\"/Finance/Account/addAccount\",method:\"post\",data:e})}function S(e){return Object(a[\"default\"])({url:\"/Finance/Account/getAllAccount\",method:\"post\",data:e})}function k(e,t){return Object(a[\"default\"])({url:\"/Finance/Account/editAccount/\"+e,method:\"put\",data:t})}function N(e,t){return Object(a[\"default\"])({url:\"/Finance/Account/delAccount/\"+e,method:\"delete\",data:t})}function R(e){return Object(a[\"default\"])({url:\"/Finance/Account/updateAccountDefaultStatus\",method:\"post\",data:e})}function C(e){return Object(a[\"default\"])({url:\"/Finance/Account/updateAccountStatus\",method:\"post\",data:e})}function T(e,t){return Object(a[\"default\"])({url:\"/Finance/Account/getAccountInfo/\"+e,method:\"get\",data:t})}function j(e){return Object(a[\"default\"])({url:\"/Finance/AccountDetail/getAllAccountDetail\",method:\"post\",data:e})}function x(e){return Object(a[\"default\"])({url:\"/Finance/Received/addReceived\",method:\"post\",data:e})}function P(e,t){return Object(a[\"default\"])({url:\"/Finance/Received/deleteReceived/\"+e,method:\"delete\",data:t})}function G(e){return Object(a[\"default\"])({url:\"/Finance/Received/getAllReceived\",method:\"post\",responseType:\"blob\",data:e})}function F(e){return Object(a[\"default\"])({url:\"Finance/Received/getAllReceived\",method:\"post\",data:e})}function D(e){return Object(a[\"default\"])({url:\"/Finance/Received/getReceivedInfo\",method:\"post\",data:e})}function $(e){return Object(a[\"default\"])({url:\"/Finance/Received/updateReceivedStatus\",method:\"post\",data:e})}function M(e){return Object(a[\"default\"])({url:\"Finance/ReceiptRequisition/updateReceiptRequisitionStatus\",method:\"post\",data:e})}function E(e){return Object(a[\"default\"])({url:\"/Finance/Received/getTempReceivedData\",method:\"get\",data:e})}function B(e){return Object(a[\"default\"])({url:\"/Finance/Received/search\",method:\"post\",data:e})}function q(e,t){return Object(a[\"default\"])({url:\"/Finance/Received/editReceived/\"+e,method:\"post\",data:t})}function L(e){return Object(a[\"default\"])({url:\"/Finance/Paid/addPaid\",method:\"post\",data:e})}function z(e){return Object(a[\"default\"])({url:\"/Finance/Paid/search\",method:\"post\",data:e})}function V(e){return Object(a[\"default\"])({url:\"/Finance/Paid/getAllPaid\",method:\"post\",data:e})}function J(e){return Object(a[\"default\"])({url:\"/Finance/Paid/getAllPaid\",method:\"post\",responseType:\"blob\",data:e})}function U(e){return Object(a[\"default\"])({url:\"/Finance/Paid/getPaidInfo\",method:\"post\",data:e})}function Q(e){return Object(a[\"default\"])({url:\"/Finance/Paid/updatePaidStatus\",method:\"post\",data:e})}function W(e){return Object(a[\"default\"])({url:\"/Finance/Paid/getTempPaidData\",method:\"get\",data:e})}function K(e,t){return Object(a[\"default\"])({url:\"/Finance/Paid/editPaid/\"+e,method:\"post\",data:t})}function Y(e){return Object(a[\"default\"])({url:\"/Finance/CustomerBalance/getAllCustomerBalance\",method:\"post\",data:e})}function H(e){return Object(a[\"default\"])({url:\"Finance/CustomerBalance/getAllCustomerBalance\",method:\"post\",responseType:\"blob\",data:e})}function X(e){return Object(a[\"default\"])({url:\"/Finance/CustomerBalanceDetail/getAllCustomerBalanceDetail\",method:\"post\",data:e})}function Z(e){return Object(a[\"default\"])({url:\"/Finance/CustomerBalanceDetail/getAllCustomerBalanceDetail\",method:\"post\",responseType:\"blob\",data:e})}function ee(e){return Object(a[\"default\"])({url:\"/Finance/SupplierBalance/getAllSupplierBalance\",method:\"post\",data:e})}function te(e){return Object(a[\"default\"])({url:\"/Finance/SupplierBalance/getAllSupplierBalance\",method:\"post\",responseType:\"blob\",data:e})}function re(e){return Object(a[\"default\"])({url:\"/Finance/SupplierBalanceDetail/getAllSupplierBalanceDetail\",method:\"post\",responseType:\"blob\",data:e})}function ae(e){return Object(a[\"default\"])({url:\"/Finance/SupplierBalanceDetail/getAllSupplierBalanceDetail\",method:\"post\",data:e})}function de(e){return Object(a[\"default\"])({url:\"/Finance/AccountTransfer/addAccountTransfer\",method:\"post\",data:e})}function ne(e,t){return Object(a[\"default\"])({url:\"/Finance/AccountTransfer/getAccountTransferInfo/\"+e,method:\"get\",data:t})}function oe(e,t){return Object(a[\"default\"])({url:\"/Finance/AccountTransfer/editAccountTransfer/\"+e,method:\"put\",data:t})}function se(e){return Object(a[\"default\"])({url:\"/Finance/AccountTransfer/getAllAccountTransfer\",method:\"post\",data:e})}function ie(e,t){return Object(a[\"default\"])({url:\"/Finance/AccountTransfer/updateAccountTransferStatus/\"+e,method:\"put\",data:t})}function ce(e){return Object(a[\"default\"])({url:\"/Finance/AccountTransfer/getTempAccountTransferData\",method:\"post\",data:e})}function ue(e){return Object(a[\"default\"])({url:\"Finance/Account/getTodayStatistics\",method:\"post\",data:e})}function le(e){return Object(a[\"default\"])({url:\"Finance/ReceiptRequisition/getAllReceiptRequisition\",method:\"post\",data:e})}function pe(e){return Object(a[\"default\"])({url:\"Finance/ReceiptRequisition/addReceiptRequisition\",method:\"post\",data:e})}function fe(e,t){return Object(a[\"default\"])({url:\"Finance/ReceiptRequisition/editReceiptRequisition/\"+e,method:\"post\",data:t})}function me(e,t){return Object(a[\"default\"])({url:\"Finance/ReceiptRequisition/getReceiptRequisitionInfo/\"+e,method:\"get\",data:t})}function he(e){return Object(a[\"default\"])({url:\"Finance/AccountType/getAllAccountType\",method:\"post\",data:e})}function ge(e){return Object(a[\"default\"])({url:\"Finance/AccountType/addAccountType\",method:\"post\",data:e})}function _e(e,t){return Object(a[\"default\"])({url:\"Finance/AccountType/delAccountType/\"+e,method:\"delete\",data:t})}function ye(e,t){return Object(a[\"default\"])({url:\"Finance/AccountType/getAccountTypeInfo/\"+e,method:\"post\",data:t})}function be(e){return Object(a[\"default\"])({url:\"Finance/AccountType/editAccountType\",method:\"post\",data:e})}function Oe(e){return Object(a[\"default\"])({url:\"Finance/ExpenseSingle/getAllExpenseSingle\",method:\"post\",data:e})}function ve(e){return Object(a[\"default\"])({url:\"Finance/ExpenseSingle/addExpenseSingle\",method:\"post\",data:e})}function Ie(e,t){return Object(a[\"default\"])({url:\"Finance/ExpenseSingle/getExpenseSingleInfo/\"+e,method:\"get\",data:t})}function Ae(e,t){return Object(a[\"default\"])({url:\"Finance/ExpenseSingle/editExpenseSingle/\"+e,method:\"post\",data:t})}function we(e,t){return Object(a[\"default\"])({url:\"Finance/ExpenseSingle/delExpenseSingle/\"+e,method:\"delete\",data:t})}function Se(e){return Object(a[\"default\"])({url:\"Finance/ExpenseSingle/updateExpenseStatus\",method:\"post\",data:e})}function ke(e){return Object(a[\"default\"])({url:\"Finance/Refund/getAllRefund\",method:\"post\",data:e})}function Ne(e){return Object(a[\"default\"])({url:\"Finance/Refund/addRefund\",method:\"post\",data:e})}function Re(e){return Object(a[\"default\"])({url:\"Finance/Refund/getRefundInfo\",method:\"post\",data:e})}function Ce(e,t){return Object(a[\"default\"])({url:\"Finance/Refund/editRefund/\"+e,method:\"post\",data:t})}function Te(e){return Object(a[\"default\"])({url:\"Finance/Refund/updateRefundStatus\",method:\"post\",data:e})}function je(e){return Object(a[\"default\"])({url:\"Finance/Received/getAllReceivedOffset\",method:\"post\",data:e})}function xe(e){return Object(a[\"default\"])({url:\"Finance/Paid/getAllPaidOffset\",method:\"post\",data:e})}},d177:function(e,t,r){\"use strict\";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r(\"div\",{staticClass:\"out-div\"},[r(\"el-select\",{staticStyle:{width:\"100%\"},attrs:{size:e.size,value:e.value,filterable:\"\",remote:\"\",\"reserve-keyword\":\"\",disabled:e.disabled,placeholder:\"请输入关键词首字母\",\"remote-method\":e.remoteMethod,loading:e.select_loading},on:{change:e.selectSelGoods,\"visible-change\":e.goodsVisibleChange}},e._l(e.goods_options,(function(e,t){return r(\"el-option\",{key:t,attrs:{label:e.title,value:e.id}})})),1),r(\"span\",{staticClass:\"el-icon-search sel-icon\",on:{click:e.openGoodsModel}}),r(\"el-dialog\",{staticStyle:{\"text-align\":\"left\"},attrs:{\"close-on-press-escape\":!1,\"close-on-click-modal\":!1,title:\"选择属性\",visible:e.spec_model,width:\"40%\"},on:{\"update:visible\":function(t){e.spec_model=t}}},[r(\"el-checkbox\",{on:{change:e.checkAllSpecChange},model:{value:e.check_all_spec,callback:function(t){e.check_all_spec=t},expression:\"check_all_spec\"}},[e._v(\" 全选 \")]),e._l(e.spec_check_list,(function(t,a){return r(\"div\",{key:a,staticStyle:{padding:\"10px\",border:\"1px solid #eee\",margin:\"10px 0\"}},[r(\"el-checkbox\",{attrs:{indeterminate:t.is_spec_indeterminate},on:{change:function(t){return e.checkUnitSpecChange(t,a)}},model:{value:t.check_unit_spec,callback:function(r){e.$set(t,\"check_unit_spec\",r)},expression:\"item.check_unit_spec\"}},[e._v(\" \"+e._s(t.unitName)+\" \")]),r(\"div\",{staticStyle:{padding:\"10px 15px 0\"}},[r(\"el-checkbox-group\",{on:{change:function(t){return e.specCheckChange(t,a)}},model:{value:t.spec_check,callback:function(r){e.$set(t,\"spec_check\",r)},expression:\"item.spec_check\"}},e._l(t.children,(function(t,a){return r(\"el-checkbox\",{key:a,staticStyle:{\"padding-bottom\":\"5px\"},attrs:{label:t.id}},[r(\"span\",{staticStyle:{\"font-weight\":\"400\"}},[e._v(e._s(t.specGropName))])])})),1)],1)],1)})),r(\"span\",{staticClass:\"dialog-footer\",attrs:{slot:\"footer\"},slot:\"footer\"},[r(\"el-button\",{on:{click:function(t){e.spec_model=!1}}},[e._v(\"取 消\")]),r(\"el-button\",{attrs:{type:\"primary\"},on:{click:e.specSelConfirm}},[e._v(\"确 定\")])],1)],2),e.show_goods?r(\"SaleGoodsSel\",{attrs:{\"merchant-id\":e.merchantId,\"base-goods\":e.type,\"is-show\":e.show_goods,\"user-center-id\":e.userCenterId,\"is-reveal-sku\":4,\"is-eq-master\":e.isEqMaster,\"is-purchase\":e.isPurchase,\"shop-id\":e.shopId},on:{cancel:function(t){e.show_goods=!1},confirm:e.selGoods}}):e._e()],1)},d=[],n=r(\"c40e\"),o=r(\"0d53\"),s={name:\"ConditionSelGoods\",components:{SaleGoodsSel:o[\"default\"]},model:{prop:\"value\",event:\"change\"},props:{merchantId:{type:[Number,String],default:\"\"},type:{type:Boolean,default:!1},isPurchase:{type:Boolean,default:!1},isEqMaster:{type:Boolean,default:!0},isAddGoods:{type:[Number,String],default:5},userCenterId:{type:[Number,String],default:\"\"},shopId:{type:[Number,String,Array],default:\"\"},enableStatus:{type:[Number,String],default:\"\"},value:{type:String,default:\"\"},disabled:{type:Boolean,default:!1},specCheck:{type:Array,default:()=>[]},isRevealSku:{type:[Number,String],default:4},size:{type:String,default:\"small\"}},data(){return{goodsName:\"\",goods_options:[],show_goods:!1,select_loading:!1,spec_model:!1,check_all_spec:!1,is_spec_indeterminate:!1,spec_check:[],spec_check_list:[],now_goods_data:{}}},watch:{specCheck(e){this.spec_check=e}},mounted(){console.log(this.isPurchase)},methods:{openGoodsModel(){this.disabled||(this.show_goods=!0)},async remoteMethod(e){if(!e)return void(this.goods_options=[]);let t={condition:e,type:this.type,enableStatus:this.enableStatus};this.shopId&&(t.shopId=Array.isArray(this.shopId)?this.shopId:[this.shopId]),this.merchantId&&(t.merchantId=this.merchantId),this.select_loading=!0;const{data:r}=await Object(n[\"getGoodsByCondition\"])(t);this.select_loading=!1,\"{}\"===JSON.stringify(r)?this.goods_options=[]:this.goods_options=r},goodsVisibleChange(e){this.$emit(\"goodsVisibleChange\",e)},selectSelGoods(e){this.$emit(\"selectSelGoods\",e),this.check_all_spec=!1,this.type?this.getGoodsBasicInfoById(e):this.getGoodsInfo(e)},async getGoodsInfo(e){const{data:t}=await Object(n[\"getGoodsInfo\"])(e,{userCenterId:this.userCenterId});this.now_goods_data=t,this.spec_model=!0,2===t.specType?this.spec_check_list=t.unitData.map(e=>({...e,is_spec_indeterminate:!1,check_unit_spec:!1,spec_check:[],children:t.specMultiple.filter(t=>t.unitId===e.unitId).map(e=>({...e,specGropName:e.specGroup.map(e=>e.specValueName).join(\"_\")}))})):this.spec_check_list=t.specMultiple.map(e=>({...e,is_spec_indeterminate:!1,check_unit_spec:!1,spec_check:[]})),1!==this.spec_check_list.length||this.spec_check_list[0].children?1===this.spec_check_list.length&&1===this.spec_check_list[0].children.length&&(this.spec_model=!1,this.$emit(\"specSelConfirm\",{goodsD:[{skuId:this.spec_check_list[0].children[0].id,spec:this.spec_check_list[0].children[0]}],spec_check_list:this.spec_check_list,now_goods_data:this.now_goods_data})):(this.spec_model=!1,this.$emit(\"specSelConfirm\",{goodsD:[{skuId:this.spec_check_list[0].id,spec:this.spec_check_list[0]}],spec_check_list:this.spec_check_list,now_goods_data:this.now_goods_data}))},async getGoodsBasicInfoById(e){const{data:t}=await Object(n[\"getGoodsBasicInfoById\"])(e,{isAddGoods:this.isAddGoods});this.now_goods_data=t,this.spec_model=!0,2===t.specType?this.spec_check_list=t.unitData.map(e=>({...e,is_spec_indeterminate:!1,check_unit_spec:!1,spec_check:[],children:t.specMultiple.filter(t=>t.unitId===e.unitId).map(e=>({...e,specGropName:e.specGroup.map(e=>e.specValueName).join(\"_\")}))})):this.spec_check_list=t.specMultiple.map(e=>({...e,is_spec_indeterminate:!1,check_unit_spec:!1,spec_check:[]})),this.isPurchase&&5===t.isEq&&(this.spec_check_list=this.spec_check_list.filter(e=>5===e.isMaster))},specSelConfirm(){let e=[],t=[];2===this.now_goods_data.specType?(this.spec_check_list.forEach(t=>{t.spec_check&&t.spec_check.length&&e.push(t.spec_check.join(\",\"))}),this.spec_check=e.join(\",\").split(\",\").map(e=>parseInt(e)),t=this.spec_check.map(e=>{let t={};for(let r in this.spec_check_list){let a=this.spec_check_list[r];const d=a.children&&a.children.length?a.children.find(t=>t.id===e):\"\";if(d){t=d;break}}return{skuId:e,spec:t}})):t=this.spec_check_list.filter(e=>e.check_unit_spec).map(e=>({skuId:e.id,spec:e})),this.$emit(\"specSelConfirm\",{goodsD:t,spec_check_list:this.spec_check_list,now_goods_data:this.now_goods_data}),this.spec_model=!1},specCheckChange(e,t){const r=this.$_common.deepClone(this.spec_check_list);let a=e.length;r[t].check_unit_spec=a===r[t].children.length,r[t].is_spec_indeterminate=a>0&&a<r[t].children.length,this.spec_check_list=r,this.check_all_spec=this.spec_check_list.every(e=>e.check_unit_spec)},checkAllSpecChange(e){this.spec_check_list.forEach(t=>{t.check_unit_spec=e,t.is_spec_indeterminate=!1,t.spec_check=e&&t.children&&t.children.length?t.children.map(e=>e.id):[]}),this.is_spec_indeterminate=!1},checkUnitSpecChange(e,t){const r=this.$_common.deepClone(this.spec_check_list);r[t].spec_check=e&&r[t].children&&r[t].children.length?r[t].children.map(e=>e.id):[],r[t].is_spec_indeterminate=!1,this.spec_check_list=r,this.check_all_spec=this.spec_check_list.every(e=>e.check_unit_spec)},selGoods(e){console.log(e),this.$emit(\"selGoods\",e)}}},i=s,c=(r(\"1ccb\"),r(\"2877\")),u=Object(c[\"a\"])(i,a,d,!1,null,\"410451b4\",null);t[\"default\"]=u.exports}}]);","extractedComments":[]}