(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6ad2"],{DNkW:function(t,e,o){var i=o("93I4"),s=Math.floor;t.exports=function(t){return!i(t)&&isFinite(t)&&s(t)===t}},"GW1+":function(t,e,o){"use strict";var i=o("mxV5"),s=o.n(i);e.a=function(t){return new s.a(t)}},JHxs:function(t,e,o){"use strict";o.r(e);var i=o("dWSf"),s={name:"storage-check-check",components:{yrtSelector:o("vh95").a},mixins:[i.a],data:function(){return{selectorConfig:{title:"物料选择器",width:"1000px",visible:!1,router:"/selector/s-product-selector"},selectorPositionConfig:{title:"物料库存选择器",width:"1000px",visible:!1,router:"/selector/x-product-selector",url:"/api/common/GroupDataList"},actionField:{},defaultValue:{statusID:1,statusText:"新建",isBlind:0},operationType:null,dialogLandingTime:!1,fileList:[],importMsg:null}},activated:function(){this.common.hasSaaSAuth("库存盘点",this.$refs.container)},mounted:function(){this.editor.$refs["import-dialog"].isShowTemplateButton=!1},methods:{detailButtonClick:function(t){switch(t){case"add":return this.selectorConfig.visible=!0,!0;case"detailAddPisition":return this.openPositionSelected(),!0;case"exportList":return this.exportList(),!0;case"importList":return this.importList(),!0}},buttonClick:function(){},onSelected:function(t){this.editor.addDetailDataRow(t),this.selectorConfig.visible=!1},onDeleteBefore:function(t){var e=!0;return t.forEach(function(t){"新建"!==t.statusText&&(e=!1)}),!!e||(this.$message.error("仅可删除新建的盘点单!"),!1)},openPositionSelected:function(){var t=this.editor;t.formData.consignorName?t.formData.storageName?(this.$refs["selector-position-dialog"].setSearchValue("consignor_Id",[t.formData.consignor_Id]),this.$refs["selector-position-dialog"].setSearchValue("storage_Id",[t.formData.storage_Id]),this.$refs["selector-position-dialog"].loadData(),this.selectorPositionConfig.visible=!0):this.$message({message:"请选择仓库!",type:"warning"}):this.$message({message:"请选择货主!",type:"warning"})},onPositionSelected:function(t){t.forEach(function(t){t.quantity=t.productStorage}),this.editor.addDetailDataRow(t),this.selectorPositionConfig.visible=!1},subimtCheckBill:function(t,e){var o=this;this.$confirm("提示:确实要提交当前盘点吗","确认提交",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var t=o.editor.formData;if("新建"===t.statusText){var e={check_Id:t.check_Id};o.common.ajax("/api/storage/check/submit",e,function(t){o.common.showMsg(t),t.result&&(o.dataList.loadData(),o.editor.reload())},o.dataList)}else o.$message({type:"info",message:"只有新建状态的单子才能提交!"})}).catch(function(){o.$message({type:"info",message:"已取消"})})},createProfitLoss:function(t,e){var o=this;this.$confirm("提示:确定要生成盈亏单吗!","确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var t=o.editor.formData;if("已提交"===t.statusText){var e=t.check_Id,i=o.dataList,s={check_Id:e};o.common.ajax("/api/storage/check/createYKD",s,function(t){o.common.showMsg(t),t.result&&(o.editorOptions.config.visible=!1,i.loadData())},i)}else o.$message({type:"info",message:"只有已提交状态的单子才能生成!"})}).catch(function(){o.$message({type:"info",message:"已取消"})})},onChange:function(t,e,o,i){switch(o.options.prop){case"storageName":this.$refs["selector-position-dialog"].setSearchValue("storageName",i.storageName),this.$refs["selector-position-dialog"].loadData();break;case"consignorName":this.$refs["selector-position-dialog"].setSearchValue("consignorName",i.consignorName),this.$refs["selector-position-dialog"].loadData()}},setSearchDefault:function(t){},getCustomWhere:function(t){var e={};return">0"===this.operationType?e.productStorage={operator:">",value:0}:">=0"===this.operationType?e.productStorage={operator:">=",value:0}:"=0"===this.operationType&&(e.productStorage={operator:"=",value:0}),e},onSaveBefore:function(t){var e=0,o=0,i=0,s=0,a=0,n=0,r=0,l=0;t.Storage_CheckList.rows.forEach(function(t){e+=t.checkQuantity||0,o+=t.productStorage||0,i+=t.totalWeight||0,s+=t.purchaseMoney||0,a+=t.profitQuantity||0,n+=t.profitMoney||0,r+=t.lossQuantity||0,l+=t.lossMoney||0}),this.editor.changeValue("totalCheckQuantity",e),this.editor.changeValue("totalPurchaseMoney",s),this.editor.changeValue("totalProductStorage",o),this.editor.changeValue("totalWeight",i),this.editor.changeValue("totalProfitQuantity",a),this.editor.changeValue("totalProfitMoney",n),this.editor.changeValue("totalLossQuantity",r),this.editor.changeValue("totalLossMoney",l)},onDetailChange:function(t,e,o,i){var s=0,a=0,n=o.checkQuantity-o.productStorage;if(n>=0){o.profitQuantity=n,o.lossQuantity=0;var r=Math.Round(n*o.purchasePrice,2);o.profitMoney=r,o.lossMoney=0}else{o.profitQuantity=0,o.lossQuantity=0-n;var l=Math.Round(n*o.purchasePrice,2);o.profitMoney=0,o.lossMoney=0-l}this.editor.formData.Storage_CheckList.rows.forEach(function(t){s+=t.checkQuantity,a+=t.totalWeight,t.profitWeight=Math.Round(t.profitQuantity*t.weight,4)}),this.editor.changeValue("totalCheckQuantity",s),this.editor.changeValue("totalWeight",Math.Round(a,4))},onEditLoadAfter:function(t){var e=t.statusText;"新建"===e?(this.$set(this.btnReadOnly,"subimtCheckBill",!1),this.$set(this.btnReadOnly,"createProfitLoss",!0),this.editorOptions.config.disabled=!1):"已提交"===e?(this.$set(this.btnReadOnly,"subimtCheckBill",!0),this.$set(this.btnReadOnly,"createProfitLoss",!1),this.editorOptions.config.disabled=!0):"已生成盈亏单"===e&&(this.$set(this.btnReadOnly,"subimtCheckBill",!0),this.$set(this.btnReadOnly,"createProfitLoss",!0),this.editorOptions.config.disabled=!0)},onPageSizeChange:function(t){this.editorOptions.fields.filter(function(t){return"detail-grid"===t.type})[0].options.pageSize=t},doDataParser:function(t){t.Storage_CheckList.rows.forEach(function(t,e){null===t.checkQuantity&&delete t.checkQuantity})},exportList:function(){var t=this,e=[];this.editor.formData.Storage_CheckList.rows.map(function(t,o,i){e.push(t.checkList_Id)});var o={ids:e.join(",")};this.common.ajax("/api/storage/check/exportList",o,function(e){if(t.common.showMsg(e),e.result){var o=t.common.domain+"/api/common/download?url="+e.data.url;window.open(o)}},!0)},importList:function(){this.dialogLandingTime=!0},handlePreview:function(t){},handleRemove:function(t,e){this.fullFileRote=null},upLoadUrl:function(){return this.common.domain+"/api/common/uploadSingleFile"},handleSuccess:function(t,e){this.common.showMsg("上传成功!"),this.fullFileRote=t.data.url},submitImport:function(){var t=this,e=this.editor.formData[this.dataOptions.idField];if(this.importMsg=null,this.fullFileRote){var o=this.dataList,i={url:this.fullFileRote,check_Id:e};this.common.ajax("api/storage/check/importExel",i,function(e){e.result?(t.fullFileRote=null,t.fileList=[],t.importMsg=e.msg,o.loadData()):t.importMsg="<font color='red'>"+e.msg+"</font>"},!0)}else this.$message.error("请上传文件!")}}},a=o("KHd+"),n=Object(a.a)(s,function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{ref:"container",staticClass:"page-list-container"},[o("yrt-data-list",{ref:t.dataListRef,attrs:{"editor-ref":t.editorRef,"data-options":t.dataOptions,fields:t.dataListOptions.fields,buttons:t.dataListOptions.buttons,"button-click":t.buttonClick,"action-field":t.actionField,"on-delete-before":t.onDeleteBefore,"data-list-selections":t.dataListSelections,"auth-nodes":t.authNodes},on:{"update:fields":function(e){return t.$set(t.dataListOptions,"fields",e)},"update:dataListSelections":function(e){t.dataListSelections=e},"update:data-list-selections":function(e){t.dataListSelections=e}}}),t._v(" "),o("yrt-editor",t._b({ref:t.editorRef,attrs:{"data-list-ref":t.dataListRef,"data-options":t.dataOptions,action:t.editorOptions.action,top:t.editorOptions.top,visible:t.editorOptions.config.visible,"detail-button-click":t.detailButtonClick,"btn-read-only":t.btnReadOnly,"auth-nodes":t.authNodes,"do-data-parser":t.doDataParser,"on-save-before":t.onSaveBefore},on:{"update:action":function(e){return t.$set(t.editorOptions,"action",e)},"update:top":function(e){return t.$set(t.editorOptions,"top",e)},"update:visible":function(e){return t.$set(t.editorOptions.config,"visible",e)},"on-detail-change":t.onDetailChange,"on-add-load-after":t.onEditLoadAfter,"on-edit-load-after":t.onEditLoadAfter},scopedSlots:t._u([{key:"footer-button-region",fn:function(e){var i=e.formData,s=e.details;return[o("el-button",{attrs:{disabled:t.btnReadOnly.subimtCheckBill,type:"success",icon:"el-icon-yrt-pan"},nativeOn:{click:function(e){return t.subimtCheckBill(i,s)}}},[t._v("提交")]),t._v(" "),o("el-button",{attrs:{disabled:t.btnReadOnly.createProfitLoss,type:"success",icon:"el-icon-yrt-pan"},nativeOn:{click:function(e){return t.createProfitLoss(i,s)}}},[t._v("生成盈亏单")])]}}])},"yrt-editor",t.editorOptions,!1)),t._v(" "),o("el-dialog",{attrs:{visible:t.dialogLandingTime},on:{"update:visible":function(e){t.dialogLandingTime=e}}},[o("el-form",[o("el-upload",{ref:"upload",staticClass:"upload-bill",attrs:{"on-preview":t.handlePreview,"on-remove":t.handleRemove,"on-success":t.handleSuccess,"file-list":t.fileList,"auto-upload":!0,action:t.upLoadUrl(),limit:1}},[o("el-button",{attrs:{slot:"trigger",size:"small",type:"primary"},slot:"trigger"},[t._v("选取文件")]),t._v(" "),o("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"small",type:"success"},on:{click:function(e){return t.submitImport()}}},[t._v("开始导入")]),t._v(" "),o("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"small",type:"primary",plain:""}},[o("a",{staticStyle:{color:"while","font-size":"12px"},attrs:{href:t.common.ossDomain+"/node-wms/template/盘点单明细导入模板.xlsx"}},[t._v("下载模板")])]),t._v(" "),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("只能上传扩展名为.xlsx的excel文件")])],1)],1),t._v(" "),o("div",{staticClass:"margin-10",domProps:{innerHTML:t._s(t.importMsg)}},[t._v(t._s(t.importMsg))]),t._v(" "),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"})],1),t._v(" "),o("yrt-selector",{ref:"selector-dialog",attrs:{config:t.selectorConfig,visible:t.selectorConfig.visible},on:{"update:visible":function(e){return t.$set(t.selectorConfig,"visible",e)},"on-selected":t.onSelected}}),t._v(" "),o("yrt-selector",{ref:"selector-position-dialog",attrs:{config:t.selectorPositionConfig,visible:t.selectorPositionConfig.visible,url:t.selectorPositionConfig.url,"set-search-default":t.setSearchDefault,"get-custom-where":t.getCustomWhere},on:{"update:visible":function(e){return t.$set(t.selectorPositionConfig,"visible",e)},"on-selected":t.onPositionSelected,"on-page-size-change":t.onPageSizeChange}},[o("template",{slot:"search-form-item"},[o("el-select",{staticClass:"w-150",attrs:{splaceholder:"账面库存量"},model:{value:t.operationType,callback:function(e){t.operationType=e},expression:"operationType"}},[o("el-option",{attrs:{label:"库存大于0",value:">0"}}),t._v(" "),o("el-option",{attrs:{label:"库存大于等于0",value:">=0"}}),t._v(" "),o("el-option",{attrs:{label:"库存等于0",value:"=0"}}),t._v(" "),o("el-option",{attrs:{label:"全部",value:""}})],1)],1)],2)],1)},[],!1,null,null,null);n.options.__file="check.vue";e.default=n.exports},h5AQ:function(t,e,o){o("hRZT"),t.exports=o("WEpk").Number.isInteger},hRZT:function(t,e,o){var i=o("Y7ZC");i(i.S,"Number",{isInteger:o("DNkW")})},ql3t:function(t,e,o){t.exports={default:o("h5AQ"),__esModule:!0}},yaWU:function(t,e,o){"use strict";o.d(e,"a",function(){return i});var i={bind:function(t,e,o){t.children[2].onscroll=function(e){var o=t.children[3];o&&o.classList.contains("el-table__footer-wrapper")&&(o.scrollLeft=e.target.scrollLeft)}},update:function(t,e,o){}}}}]);
|