| 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-1679fd29\"],{4806:function(t,e,a){},6455:function(t,e,a){},\"91fd\":function(t,e,a){\"use strict\";a(\"6455\")},c148:function(t,e,a){\"use strict\";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a(\"ContainerTit\",{staticClass:\"storageInfo\"},[a(\"div\",{staticStyle:{position:\"relative\"}},[a(\"div\",{staticClass:\"btn-top-div\"},[t.$accessCheck(t.$Access.storageUpdatePurchaseInStatus)&&1===t.orderInfo.auditStatus?a(\"el-button\",{attrs:{type:\"primary\",loading:t.audit_loading},on:{click:t.updatePurchaseInStatus}},[t._v(\" 入库审核 \")]):t._e(),t.$accessCheck(t.$Access.storageUpdatePurchaseInStatus)&&1===t.orderInfo.auditStatus&&[\"采购入库\",\"商户入库\"].includes(t.orderInfo.typeName)?a(\"el-button\",{attrs:{type:\"warning\",loading:t.audit_loading},on:{click:t.rejectInventoryTip}},[t._v(\" 驳回 \")]):t._e()],1)]),a(\"el-tabs\",{model:{value:t.activeName,callback:function(e){t.activeName=e},expression:\"activeName\"}},[a(\"el-tab-pane\",{attrs:{label:\"入库单详情\",name:\"one\"}},[a(\"el-row\",{staticStyle:{\"padding-bottom\":\"13px\"}},[a(\"el-col\",{attrs:{span:24}},[a(\"p\",{staticClass:\"order_midden_left_text el-icon-arrow-right\",staticStyle:{\"padding-left\":\"20px\"}},[t._v(\" 入库单信息 \")])]),a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"单据编号\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(t._s(t.orderInfo.no))])]),a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"审核状态\")]),a(\"span\",{staticClass:\"form_right\"},[2===t.orderInfo.auditStatus?a(\"span\",{staticClass:\"success-status\"},[t._v(\" 已审核 \")]):a(\"span\",{staticClass:\"warning-status\"},[t._v(\"待审核\")])])]),a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"入库类型\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(t._s(t.orderInfo.typeName))])]),12===t.orderInfo.type?a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"调出仓库\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(t._s(t.orderInfo.outWarehouseName))])]):t._e(),12===t.orderInfo.type?a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"调入仓库\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(t._s(t.orderInfo.inWarehouseName))])]):t._e(),t.orderInfo.operatorId?a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"审核人员\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(t._s(t.orderInfo.auditName||\"--\"))])]):t._e(),t.orderInfo.operatorId?a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"审核时间\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(\" \"+t._s(t.orderInfo.auditTime?t.$_common.formatDate(t.orderInfo.auditTime):\"---\")+\" \")])]):t._e(),t.orderInfo.operatorId&&\"商户入库\"===t.orderInfo.typeName?a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"商户名称\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(t._s(t.orderInfo.merchantName||\"--\"))])]):t._e(),a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"制单人员\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(t._s(t.orderInfo.operatorName))])]),a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"制单时间\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(\" \"+t._s(t.orderInfo.createTime?t.$_common.formatDate(t.orderInfo.createTime):\"---\")+\" \")])]),a(\"el-col\",{staticClass:\"form\",attrs:{span:6}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"入库仓库\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(\" \"+t._s(t.orderInfo.warehouseName)+\" \")])]),2===t.orderInfo.auditStatus?a(\"el-col\",{staticClass:\"form\",attrs:{span:24}},[a(\"span\",{staticClass:\"form_left\"},[t._v(\"备注说明\")]),a(\"span\",{staticClass:\"form_right\"},[t._v(\" \"+t._s(t.orderInfo.remark||\"无\")+\" \")])]):t._e()],1)],1)],1),a(\"div\",{staticClass:\"order_bottom\"},[a(\"p\",{staticClass:\"text\"},[t._v(\"商品清单\")]),a(\"el-table\",{attrs:{\"summary-method\":t.getSummaries,\"show-summary\":\"\",data:t.queryData}},[a(\"el-table-column\",{attrs:{prop:\"materielName\",\"min-width\":\"180\",\"show-overflow-tooltip\":\"\",label:\"商品名称\"}}),a(\"el-table-column\",{attrs:{prop:\"materielCode\",label:\"商品编码\",width:\"160\"}}),a(\"el-table-column\",{attrs:{prop:\"unitName\",label:\"规格\",\"min-width\":\"140\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[t._v(\" \"+t._s(e.row.unitName)+\";\"+t._s(e.row.skuName)+\" \")]}}])}),a(\"el-table-column\",{attrs:{label:3===t.orderInfo.type?\"采购数量\":\"数量\",\"min-width\":\"120\",prop:\"num\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[t._v(\" \"+t._s(t.$_common.formatNub(e.row.num))+\" \")]}}])}),15!==t.orderInfo.type?a(\"el-table-column\",{attrs:{prop:\"unitPrice\",label:3===t.orderInfo.type?\"采购成本\":12===t.orderInfo.type?\"调拨成本\":\"采购成本\",\"min-width\":\"140\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[t._v(\" \"+t._s(t.$_common.formattedNumber(e.row.unitPrice))+\" \")]}}],null,!1,3271022938)}):t._e(),15!==t.orderInfo.type?a(\"el-table-column\",{attrs:{prop:\"totalPrice\",label:3===t.orderInfo.type?\"采购总成本\":12===t.orderInfo.type?\"调拨总成本\":\"采购总成本\",\"min-width\":\"140\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[t._v(\" \"+t._s(t.$_common.formattedNumber(e.row.totalPrice))+\" \")]}}],null,!1,179250718)}):t._e(),a(\"el-table-column\",{attrs:{\"min-width\":\"120\",prop:\"inNum\",label:\"入库数量\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[2===t.orderInfo.auditStatus?a(\"span\",[t._v(\" \"+t._s(t.$_common.formatNub(e.row.inNum))+\" \")]):a(\"el-input-number\",{staticStyle:{width:\"100%\"},attrs:{size:\"small\",min:1,controls:!1},on:{blur:function(a){return t.inNumBlur(e.$index)}},model:{value:e.row.inNum,callback:function(a){t.$set(e.row,\"inNum\",a)},expression:\"scope.row.inNum\"}})]}}])}),a(\"el-table-column\",{attrs:{\"min-width\":\"120\",prop:\"otherNum\",label:\"其他单位\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[2===t.orderInfo.auditStatus?a(\"span\",[t._v(\" \"+t._s(5===e.row.isEq?t.$_common.formatNub(e.row.otherNum):\"--\")+\" \")]):5===e.row.isEq?a(\"el-input-number\",{staticStyle:{width:\"100%\"},attrs:{min:0,controls:!1},model:{value:e.row.otherNum,callback:function(a){t.$set(e.row,\"otherNum\",a)},expression:\"scope.row.otherNum\"}}):a(\"span\",[t._v(\"--\")])]}}])}),a(\"el-table-column\",{attrs:{label:3===t.orderInfo.type?\"入库成本\":\"入库单价\",prop:\"unitPrice\",\"min-width\":\"140\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[2===t.orderInfo.auditStatus?a(\"span\",[t._v(\" \"+t._s(t.$_common.formattedNumber(e.row.inCost))+\" \")]):a(\"el-input-number\",{staticStyle:{width:\"100%\"},attrs:{min:0,controls:!1},on:{blur:function(a){return t.inNumBlur(e.$index)}},model:{value:e.row.inCost,callback:function(a){t.$set(e.row,\"inCost\",a)},expression:\"scope.row.inCost\"}})]}}])}),a(\"el-table-column\",{attrs:{prop:\"totalPrice\",label:3===t.orderInfo.type?\"入库总成本\":\"入库总金额\",\"min-width\":\"140\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[2===t.orderInfo.auditStatus?a(\"span\",[t._v(\" \"+t._s(t.$_common.formattedNumber(e.row.inCostTotal))+\" \")]):a(\"el-input-number\",{staticStyle:{width:\"100%\"},attrs:{min:0,controls:!1},model:{value:e.row.inCostTotal,callback:function(a){t.$set(e.row,\"inCostTotal\",a)},expression:\"scope.row.inCostTotal\"}})]}}])}),5===t.shelfLifeSetUp?a(\"el-table-column\",{attrs:{prop:\"num\",label:\"生产日期\",\"min-width\":\"140\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[2!==t.orderInfo.auditStatus?a(\"div\",{staticStyle:{cursor:\"pointer\"},on:{click:function(a){return t.openTimeShow(e.row)}}},[a(\"el-input\",{attrs:{value:t.$_common.formatDate(e.row.productionData,\"yyyy-MM-dd\"),readonly:\"\",placeholder:\"请选择生产日期\",\"suffix-icon\":\"el-icon-date\"}})],1):a(\"div\",[t._v(\" \"+t._s(t.$_common.formatDate(e.row.productionData,\"yyyy-MM-dd\"))+\" \")])]}}],null,!1,1653321172)}):t._e(),5===t.enableLocationManagement?a(\"el-table-column\",{attrs:{label:\"库区库位\",\"min-width\":\"160\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[2!==t.orderInfo.auditStatus?a(\"div\",{staticStyle:{cursor:\"pointer\"}},[a(\"el-input\",{staticStyle:{width:\"150px\"},attrs:{placeholder:\"库区库位\",clearable:\"\",readonly:\"\"},model:{value:e.row.storageLocationName,callback:function(a){t.$set(e.row,\"storageLocationName\",a)},expression:\"scope.row.storageLocationName\"}},[a(\"i\",{staticClass:\"el-input__icon el-icon-search\",attrs:{slot:\"suffix\"},on:{click:function(a){return t.storageShow(e.row,e.$index)}},slot:\"suffix\"})])],1):a(\"div\",[t._v(t._s(e.row.storageLocationName||\"--\"))])]}}],null,!1,3287131875)}):t._e(),a(\"el-table-column\",{attrs:{prop:\"barCode\",label:\"商品条码\",\"min-width\":\"140\"}}),a(\"el-table-column\",{attrs:{prop:\"storage\",label:\"货架编码\",\"min-width\":\"120\"}}),2!==t.orderInfo.auditStatus&&[3,30].includes(t.orderInfo.type)?a(\"el-table-column\",{attrs:{fixed:\"right\",label:\"操作\",width:\"80\"},scopedSlots:t._u([{key:\"default\",fn:function(e){return[a(\"el-button\",{attrs:{disabled:1===t.queryData.length,type:\"text\"},on:{click:function(a){return t.delGoods(e.$index,e.row)}}},[t._v(\" 删除 \")])]}}],null,!1,3990681016)}):t._e()],1)],1),2!==t.orderInfo.auditStatus?a(\"div\",{staticClass:\"order_bottom\"},[a(\"p\",{staticClass:\"text\"},[t._v(\"备注说明\")]),a(\"div\",{staticStyle:{\"margin-bottom\":\"10px\"}},[a(\"el-input\",{attrs:{readonly:2===t.orderInfo.auditStatus,type:\"textarea\",placeholder:\"备注说明\"},model:{value:t.orderInfo.remark,callback:function(e){t.$set(t.orderInfo,\"remark\",e)},expression:\"orderInfo.remark\"}})],1)]):t._e(),2!==t.orderInfo.auditStatus?a(\"div\",{staticClass:\"order_bottom\"},[a(\"p\",{staticClass:\"text\"},[t._v(\"分摊\")]),a(\"div\",{staticStyle:{\"margin-left\":\"30px\"}},[a(\"el-form\",{attrs:{inline:!0}},[a(\"el-form-item\",{attrs:{label:\"分摊方式:\"}},[a(\"el-select\",{attrs:{placeholder:\"请选择\"},model:{value:t.orderInfo.costAllocationType,callback:function(e){t.$set(t.orderInfo,\"costAllocationType\",e)},expression:\"orderInfo.costAllocationType\"}},t._l(t.options,(function(t){return a(\"el-option\",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a(\"el-form-item\",{attrs:{label:\"费用金额:\"}},[a(\"el-input-number\",{attrs:{size:\"small\",controls:!1,min:0,placeholder:\"请输入费用金额\"},model:{value:t.orderInfo.costAllocation,callback:function(e){t.$set(t.orderInfo,\"costAllocation\",e)},expression:\"orderInfo.costAllocation\"}})],1),a(\"el-button\",{attrs:{type:\"primary\",disabled:t.is_count,loading:t.loading},on:{click:t.countPurchaseCost}},[t._v(\" 确定分摊 \")]),a(\"el-button\",{attrs:{type:\"warning\"},on:{click:t.delCountPurchaseCost}},[t._v(\" 取消分摊 \")])],1)],1)]):t._e(),t.time_show?a(\"ProductionData\",{attrs:{show:t.time_show,\"goods-data\":t.batch_goods},on:{cancel:function(e){t.time_show=!1},confirm:t.timeEditConfirm}}):t._e(),t.storage_show?a(\"StorageLocation\",{attrs:{\"is-check\":!1,\"is-show\":t.storage_show,\"warehouse-id\":t.warehouse_id},on:{confirm:t.selStorage,cancel:function(e){t.storage_show=!1}}}):t._e()],1)},s=[],r=a(\"7c33\"),n=a(\"478b\"),i=a(\"61ea\"),l=a(\"2f62\");var c={name:\"StorageInfo\",components:{ProductionData:i[\"default\"],StorageLocation:r[\"default\"]},data(){return{sheetCode:\"\",createTime:\"\",operatorId:\"\",warehouseId:\"\",mark:\"\",orderInfo:{costAllocationType:5,costAllocation:\"\"},queryData:[],audit_loading:!1,is_count:!1,options:[{value:4,label:\"按数量\"},{value:5,label:\"按金额\"}],skuData:[],loading:!1,delete_ids:[],time_show:!1,batch_goods:{},storage_show:!1,warehouse_id:\"\",index:\"\",activeName:\"one\"}},created(){this.getPurchaseInInfo()},computed:{...Object(l[\"c\"])({enableLocationManagement:\"MUser/enableLocationManagement\"})},methods:{inNumBlur(t){const e=this.$_common.deepClone(this.queryData);e[t].inCostTotal=this.$NP.times(e[t].inCost,e[t].inNum),this.queryData=e},async getPurchaseInInfo(){if(!this.$route.params.id)return;const t=await Object(n[\"getPurchaseInInfo\"])(this.$route.params.id);this.orderInfo=t.data,this.queryData=t.data.details.map(t=>{let e=0;return e=2===this.orderInfo.auditStatus?t.inNum:Number(t.inNum)?Number(t.inNum):Number(t.num),{...t,inCost:Number(t.inCost)||t.unitPrice,inCostTotal:Number(t.inCostTotal)||this.$NP.times(e,t.unitPrice),inNum:e,productionData:t.productionData?1e3*t.productionData:(new Date).getTime(),areaId:t.areaId||\"\",areaName:t.areaName||\"\",areaCode:t.areaCode||\"\",storageLocationId:t.storageLocationId||\"\",storageLocationName:t.storageLocationName||\"\",storageLocationCode:t.storageLocationCode||\"\"}}),console.log(this.queryData)},updatePurchaseInStatus(){if(!this.queryData.length)return void this.$message.warning(\"没有要入库的商品\");if(5===this.shelfLifeSetUp){let t=0,e=!1;for(let a in this.queryData){let o=this.queryData[a];if(!o.productionData){t=a,e=!0;break}}if(e)return void this.$message.warning(`请选择第${Number(t)+1}行的生产日期`)}let t={};for(let o in this.queryData){let e=this.queryData[o];t[e.skuId]?t[e.skuId].inNum+=e.inNum:t[e.skuId]={inNum:e.inNum,num:Number(e.num),materielName:e.materielName,skuName:e.unitName+\";\"+e.skuName}}const e=Object.values(t).some(t=>t.inNum>t.num);let a=\"确定要审核该入库单吗?\";e&&(a=\"商品的入库数量大于了采购数量,确定要入库吗?\"),this.$confirm(a,\"提示\",{confirmButtonText:\"确定\",cancelButtonText:\"取消\",type:\"warning\"}).then(async()=>{let t=this.queryData.map(t=>(5===this.shelfLifeSetUp&&(t.productionData=parseInt(t.productionData/1e3)),t)),e={id:this.$route.params.id,auditName:this.userName,remark:this.orderInfo.remark,details:t,costAllocationType:this.orderInfo.costAllocationType,costAllocation:Number(this.orderInfo.costAllocation)};this.audit_loading=!0,await this.deleteDetailByInventoryInId();try{await Object(n[\"updatePurchaseInStatus\"])(e);this.audit_loading=!1,this.$message({type:\"success\",message:\"操作成功!\"}),await this.getPurchaseInInfo()}catch(a){this.audit_loading=!1}})},async countPurchaseCost(){if(this.orderInfo.costAllocationType)if(Number(this.orderInfo.costAllocation)){this.skuData=this.queryData.map(t=>({skuId:t.skuId,num:Number(t.inNum),cost:Number(t.unitPrice),money:Number(t.inCostTotal)})),this.loading=!0;try{const{data:t}=await Object(n[\"countPurchaseCost\"])({money:this.orderInfo.costAllocation,type:this.orderInfo.costAllocationType,skuData:this.skuData});this.is_count=!0,this.queryData=this.queryData.map(e=>(e.inCost=t[e.skuId].cost,e.inCostTotal=t[e.skuId].money,e)),this.loading=!1,this.$message.success(\"分摊成功\")}catch{this.loading=!1}}else this.$message.warning(\"费用金额须大于0\");else this.$message.warning(\"请先选择分摊方式\")},delCountPurchaseCost(){this.is_count=!1,this.orderInfo.costAllocation=\"\",this.$message.success(\"取消分摊成功\"),this.getPurchaseInInfo()},delGoods(t,e){e.id&&this.delete_ids.push(e.id),this.queryData.splice(t,1)},async deleteDetailByInventoryInId(){if(!this.delete_ids.length)return;const{data:t}=await Object(n[\"deleteDetailByInventoryInId\"])({inventoryInId:this.$route.params.id,inventoryInDetailIds:this.delete_ids})},openTimeShow(t){this.batch_goods=t,this.time_show=!0},timeEditConfirm(t){if(!t.length)return;const e=this.queryData.findIndex(e=>e.skuId===t[0].skuId&&e.materielCode===t[0].materielCode);e>-1&&(this.queryData[e].id&&(t[0].id=this.queryData[e].id),this.queryData.splice(e,1)),this.queryData=this.queryData.concat(t)},rejectInventoryTip(){this.$confirm(\"确定要驳回该入库单吗?\",\"提示\",{confirmButtonText:\"确定\",cancelButtonText:\"取消\",type:\"warning\"}).then(async()=>{const t=this.queryData.map(t=>t.id);await Object(n[\"rejectInventory\"])({inventoryInId:this.$route.params.id,inventoryInDetailIds:t});this.$message({type:\"success\",message:\"操作成功!\"}),this.$closeCurrentGoEdit(\"/stock/OutIn/storage\")})},selStorage(t){const e=this.$_common.deepClone(this.queryData);e[this.index]={...e[this.index],areaId:t[0].areaId,areaName:t[0].areaName,areaCode:t[0].areaCode,storageLocationId:t[0].id,storageLocationName:t[0].name,storageLocationCode:t[0].code},this.queryData=e},storageShow(t,e){this.index=e,this.storage_show=!0,this.warehouse_id=this.orderInfo.warehouseId},getSummaries(t){const e=3===this.orderInfo.type?\"采购总成本\":12===this.orderInfo.type?\"调拨总成本\":\"采购总成本\",a=3===this.orderInfo.type?\"入库总成本\":\"入库总金额\";return this.$_common.getSummaries(t,[\"采购数量\",\"入库数量\",e,a])}}},u=c,d=(a(\"f782\"),a(\"91fd\"),a(\"2877\")),m=Object(d[\"a\"])(u,o,s,!1,null,\"f3a8a2e4\",null);e[\"default\"]=m.exports},f782:function(t,e,a){\"use strict\";a(\"4806\")}}]);","extractedComments":[]}
|