webpackJsonp([30],{GFyi:function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__=__webpack_require__("mvHQ"),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__=__webpack_require__("Dd8w"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__),__WEBPACK_IMPORTED_MODULE_2__components_System_dialogChooseSingleLocation__=__webpack_require__("tiiE"),__WEBPACK_IMPORTED_MODULE_3__components_btnInput_vue__=__webpack_require__("ysqt"),__WEBPACK_IMPORTED_MODULE_4__warehouse_returnMateriel_printReturnMateriel_vue__=__webpack_require__("HdZt"),__WEBPACK_IMPORTED_MODULE_5__utils_tools__=__webpack_require__("GKmE"),__WEBPACK_IMPORTED_MODULE_6_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleUser__=__webpack_require__("3MlD"),__WEBPACK_IMPORTED_MODULE_8__components_Dialog_dialogChooseConsumingStock__=__webpack_require__("r+dk"),__WEBPACK_IMPORTED_MODULE_9__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_10_js_cookie__=__webpack_require__("lbHh"),__WEBPACK_IMPORTED_MODULE_10_js_cookie___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_js_cookie__);__webpack_exports__.a={inject:["reload"],components:{btnInput:__WEBPACK_IMPORTED_MODULE_3__components_btnInput_vue__.a,printReturnMateriel:__WEBPACK_IMPORTED_MODULE_4__warehouse_returnMateriel_printReturnMateriel_vue__.a,dialogChooseConsumingStock:__WEBPACK_IMPORTED_MODULE_8__components_Dialog_dialogChooseConsumingStock__.a,DialogChooseSingleUser:__WEBPACK_IMPORTED_MODULE_7__components_System_dialogChooseSingleUser__.a,dialogChooseSingleLocation:__WEBPACK_IMPORTED_MODULE_2__components_System_dialogChooseSingleLocation__.a},data:function(){return{formData:{outTime:"",operatorName:"",operator:""},auditStatus:"",config:__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a,btnDisabled:!0,itemIds:[],fac_type_list:[],fac_location_list:[],warehouseRow:"",returnMaterielId:"",availableCount:0,totalCount:0,model:{rules:{count:{required:!0,message:"退回数量必填",trigger:"change"}},childList:[]},btnOtherDisabled:!0,btnDelDisabled:!1,isDisabled:!1,chooseOperatorVisible:!1,ChooseMaterielVisible:!1,chooseClientrVisible:!1,ChooseStockVisible:!1,ChooseConsumingStockVisible:!1,chooseUserVisible:!1,ChooseLocationVisible:!1,loading:!1,materielId:"",currentIndex:"",ruleForm:{outTime:[{required:!0,message:"请选择出库时间",trigger:"change"}],operatorName:[{required:!0,message:"请选择退料人",trigger:"change"}]},printTotal:{count:"",amount:""},printList:[],printDetail:{deptName:"",inOutTime:"",outCode:""},printForm:[{title:"物料代码",prop_:"materielSerialNo"},{title:"物料名称",prop_:"materielName"},{title:"规格型号",prop_:"specification"},{title:"辅助单位",prop_:"supportUomName"},{title:"批号",prop_:"batch"},{title:"退料数量(辅助单位",prop_:"subQuoteCount"},{title:"单价",prop_:"unitPrice"},{title:"金额",prop_:"amount"},{title:"仓库",prop_:"warehouseName"},{title:"库位",prop_:"warehLocationName"}]}},mounted:function(){if(this.initialize(),this.$route.query.id)this.formData.id=this.$route.query.id,this.returnMaterielId=this.$route.query.id;else{this.userInfo=JSON.parse(__WEBPACK_IMPORTED_MODULE_10_js_cookie___default.a.get("userInfo")),this.$set(this.formData,"operatorName",this.userInfo.name),this.$set(this.formData,"operator",this.userInfo.userId),this.$set(this.formData,"deptName",this.userInfo.deptName);var e=new Date;this.$set(this.formData,"outTime",e.getFullYear()+"-"+this.settime(e.getMonth()+1)+"-"+this.settime(e.getDate()))}this.returnMaterielId&&this.getDetail()},watch:{returnMaterielId:{handler:function(e,t){this.btnDelDisabled=""!=e&&void 0!=e}},formData:{handler:function(e,t){""==e.operator&&(this.formData.deptName="",this.formData.deptId="")},deep:!0},model:{handler:function(e,t){e.childList.forEach(function(e){void 0!=e.facId&&""!=e.facId||(e.locationName="",e.locationId="")})},deep:!0}},methods:__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_6_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{changeCount:function(e){if(e.error_count){for(var t=0,a=0;a=t&&this.model.childList.forEach(function(t){t.sourceId==e.sourceId&&delete t.error_count})}},settime:function(e){return 1==e.toString().length?"0"+e.toString():e},changeWarehouse:function(e){console.log(e.facId),this.$set(e,"locationName","选择仓位"),this.$set(e,"locationId","")},chooseLocation:function(e){this.warehouseRow=e,this.ChooseLocationVisible=!0},getLocation:function(e){this.$set(this.warehouseRow,"locationId",e.id),this.$set(this.warehouseRow,"locationName",e.name)},initialize:function(){var e=this;this.$api.gylInventoryAPI.facilityList({pageno:1,pagesize:1e3,auditSign:179}).then(function(t){e.fac_type_list=t.data.datas?t.data.datas:""}).catch(function(e){console.log(e)}),this.$api.gylInventoryAPI.facilityLocationList({pageno:1,pagesize:1e3}).then(function(t){e.fac_location_list=t.data.datas?t.data.datas:""}).catch(function(e){console.log(e)})},getDetail:function(){var e=this,t=this;this.loading=!0,this.$nextTick().then(function(){e.$api.returnMaterielAPI.getDtailOfOtherIn({inHeadIds:e.returnMaterielId}).then(function(a){e.loading=!1,t.$set(t.formData,"auditStatus",a.data.deatilOfhead.auditSign?a.data.deatilOfhead.auditSign:""),t.auditStatus=e.formData.auditStatus,t.$set(t.formData,"deptName",a.data.deatilOfhead.deptName?a.data.deatilOfhead.deptName:""),t.$set(t.formData,"deptId",a.data.deatilOfhead.deptId?a.data.deatilOfhead.deptId:""),t.$set(t.formData,"operatorName",a.data.deatilOfhead.operatorName?a.data.deatilOfhead.operatorName:""),t.$set(t.formData,"operator",a.data.deatilOfhead.operator?a.data.deatilOfhead.operator:""),t.$set(t.formData,"outTime",a.data.deatilOfhead.inOutTime?a.data.deatilOfhead.inOutTime:""),t.$set(t.formData,"remarks",a.data.deatilOfhead.remarks?a.data.deatilOfhead.remarks:""),t.$set(t.formData,"createUserName",a.data.deatilOfhead.crateByName?a.data.deatilOfhead.crateByName:""),t.$set(t.formData,"createTime",a.data.deatilOfhead.createTime?a.data.deatilOfhead.createTime:""),t.$set(t.formData,"auditTime",a.data.deatilOfhead.auditTime?a.data.deatilOfhead.auditTime:""),t.$set(t.formData,"auditorName",a.data.deatilOfhead.auditorName?a.data.deatilOfhead.auditorName:""),t.model.childList=a.data.deatilOfBody,t.model.childList.forEach(function(a){e.$set(a,"onlyId",a.materielId+"_"+Math.random()),a.materielSerialNo=a.serialno?a.serialno:"",a.materielName=a.proName?a.proName:"",a.unitUomName=a.unitName?a.unitName:"",a.returnReason=a.returnReason?a.returnReason:"",a.sellUnitPrice=a.unitPrice?a.unitPrice:0,t.$set(a,"unitPrice",a.unitPrice?a.unitPrice:0),t.$set(a,"amount",a.amount?a.amount:0),a.materielId=a.materielId?a.materielId:"",a.newId=a.id?a.id:"",a.stockId=a.stockId?a.stockId:"",a.thisSourceTypeName=a.sourceTypeName?a.sourceTypeName:"",t.$set(a,"facId",a.warehouse?a.warehouse:""),t.$set(a,"facName",a.warehouseName?a.warehouseName:""),t.$set(a,"locationId",a.warehLocation?a.warehLocation:""),t.$set(a,"locationName",a.warehLocationName?a.warehLocationName:""),a.code=a.sourceCode?a.sourceCode:"",a.sourceId=a.sourceId?a.sourceId:"",a.thisSourceType=a.sourceType?a.sourceType:""}),e.printDetail.deptName=a.data.deatilOfhead.deptName,e.printDetail.createByName=e.formData.createUserName,e.printDetail.createTimePrint=Object(__WEBPACK_IMPORTED_MODULE_5__utils_tools__.i)(e.formData.createTime,"{y}-{m}-{d}"),e.printDetail.auditorName=e.formData.auditorName,e.printDetail.auditTimePrint=e.formData.auditTime?Object(__WEBPACK_IMPORTED_MODULE_5__utils_tools__.i)(e.formData.auditTime,"{y}-{m}-{d}"):"",e.printDetail.inOutTime=/\d{4}-\d{1,2}-\d{1,2}/g.exec(a.data.deatilOfhead.inOutTime)[0],e.printDetail.inheadCode=a.data.deatilOfhead.inheadCode,e.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(e.model.childList))})})},clear:function(){this.$route.query.id&&(this.formData.id=void 0,this.returnMaterielId=void 0),this.auditStatus="",this.model.childList=[],this.formData={},this.itemIds=[],this.$refs.form.resetFields();var e=new Date;this.$set(this.formData,"outTime",e.getFullYear()+"-"+this.settime(e.getMonth()+1)+"-"+this.settime(e.getDate()))},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/warehouse/returnMateriel",query:{t:Date.now()}}),this.clear()},save:function(e){var t=this,a=void 0;this.$refs.formChild.validate(function(e,t){a=e}),this.$refs[e].validate(function(e){if(e){if(0==t.model.childList.length)return void t.$message({message:"请导入关联单据",type:"warning"});if(!a)return void t.$message({message:"有必填项未填写",type:"warning"});var i=!0;if(t.model.childList.forEach(function(e){e.subQuoteCount<=0&&(i=!1)}),!i)return void t.$message({message:"退回数量必须大于0",type:"warning"});if(t.formData.id){var o=[];if(t.model.childList.forEach(function(e){var a={id:e.newId,stockId:e.stockId,materielId:e.materielId,count:e.count.toFixed(e.quantityAccuracy),supportUom:e.supportUom,convCoefficient:e.convCoefficient,backCount:e.subQuoteCount?e.subQuoteCount.toFixed(e.quantityAccuracy):0,unitPrice:e.sellUnitPrice.toFixed(e.priceAccuracy),amount:e.sellAmount,sourceId:e.sourceId,sourceType:e.thisSourceType,sourceCode:e.code,returnReason:e.returnReason?e.returnReason:""};e.facId&&(a.warehouse=e.facId),e.locationId&&""!=e.locationId&&(a.warehLocation=e.locationId),e.batch&&""!=e.batch&&(a.batch=e.batch),o.push(a),t.formData.item=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(o)}),t.isDisabled)return;t.isDisabled=!0,t.$api.returnMaterielAPI.saveAndChange({id:t.formData.id,inOutTime:t.formData.outTime,operator:t.formData.operator,deptId:t.formData.deptId,remarks:t.formData.remarks,bodyDetail:t.formData.item,itemIds:t.itemIds}).then(function(e){t.isDisabled=!1,0===e.code?t.$message({message:e.msg,type:"success"}):500===e.code&&e.data?(t.$message({message:e.msg,type:"error"}),t.model.childList.forEach(function(a){a.sourceId&&a.sourceId==e.data.sourceId&&(t.$set(a,"error_count",!0),t.$set(a,"sourceCount",e.data.sourceCount))})):t.$message({message:e.msg,type:"error"})})}else{var r=[];if(t.model.childList.forEach(function(e){console.log(e);var a={stockId:e.stockId,materielId:e.materielId,count:e.count.toFixed(e.quantityAccuracy),supportUom:e.supportUom,convCoefficient:e.convCoefficient,backCount:e.subQuoteCount?e.subQuoteCount.toFixed(e.quantityAccuracy):0,unitPrice:e.sellUnitPrice.toFixed(e.priceAccuracy),amount:e.sellAmount,sourceId:e.sourceId,sourceType:e.thisSourceType,sourceCode:e.code,returnReason:e.returnReason?e.returnReason:""};e.facId&&(a.warehouse=e.facId),e.locationId&&""!=e.locationId&&(a.warehLocation=e.locationId),e.batch&&""!=e.batch&&(a.batch=e.batch),r.push(a),t.formData.item=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(r)}),t.isDisabled)return;t.isDisabled=!0,t.$api.returnMaterielAPI.saveAndChange({operator:t.formData.operator,deptId:t.formData.deptId,inOutTime:t.formData.outTime,remarks:t.formData.remarks,bodyDetail:t.formData.item}).then(function(e){t.isDisabled=!1,0===e.code?(t.$message({message:e.msg,type:"success"}),t.returnMaterielId=e.inHeadId,window.location.href=t.changeURLArg("id",e.inHeadId)):500===e.code&&e.data?(t.$message({message:e.msg,type:"error"}),t.model.childList.forEach(function(a){a.sourceId&&a.sourceId==e.data.sourceId&&(t.$set(a,"error_count",!0),t.$set(a,"sourceCount",e.data.sourceCount))})):t.$message({message:e.msg,type:"error"})})}}})},changeURLArg:function changeURLArg(arg,arg_val){var url=window.location.href,pattern=arg+"=([^&]*)",replaceText=arg+"="+arg_val;if(url.match(pattern)){var tmp="/("+arg+"=)([^&]*)/gi";return tmp=url.replace(eval(tmp),replaceText),tmp}return url.match("[?]")?url+"&"+replaceText:url+"?"+replaceText},sum1:function(e,t,a){var i=e*t?e*t:0;return this.sellAmount=i,i=i.toFixed(__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a.amountFixedTo),this.$set(this.model.childList[a],"sellAmount",i),i},audit:function(){var e=this,t=this.formData.id;this.$confirm("确认审核吗?","提示",{type:"warning"}).then(function(){e.$api.returnMaterielAPI.auditStatusChange({inHeadId:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail()):e.$message({message:t.msg,type:"error"})})})},disAudit:function(){var e=this,t=this.formData.id;this.$confirm("确认反审核吗?","提示",{type:"warning"}).then(function(){e.$api.returnMaterielAPI.reverseAuditChange({inHeadId:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail()):e.$message({message:t.msg,type:"error"})})})},getUser:function(e){e&&(this.formData.operatorName=e.name,this.formData.operator=e.id,this.formData.deptName=e.deptName,this.formData.deptId=e.deptId)},getOperator:function(e){e&&(this.formData.operatorName=e.name,this.formData.operator=e.id)},getProductionFeeding:function(e){var t=this;console.log(e),e&&e.forEach(function(e){t.$set(e,"availableCount",e.count),t.$set(e,"subQuoteCount",e.subQuoteCount?e.subQuoteCount:1),t.$set(e,"count",e.convCoefficient?parseFloat((e.subQuoteCount*e.convCoefficient).toFixed(e.quantityAccuracy)):0),t.$set(e,"sellUnitPrice",e.unitPrice?e.unitPrice:0),t.$set(e,"sellAmount",0),t.$set(e,"materielSerialNo",e.materielSerialNo?e.materielSerialNo:""),t.$set(e,"materielName",e.materielName?e.materielName:""),t.$set(e,"materielId",e.materielId),t.$set(e,"sourceId",e.itemId),t.$set(e,"thisSourceTypeName",e.thisSourceTypeName?e.thisSourceTypeName:""),t.$set(e,"thisSourceType",e.thisSourceType?e.thisSourceType:""),t.$set(e,"code",e.outCode?e.outCode:""),t.$set(e,"onlyId",e.id+"_"+Date.now()),delete e.id,t.model.childList.push(e)})},removePart:function(){var e=this;if(this.chooseParts){var t=[];this.chooseParts.forEach(function(a){t.push(a.id);var i=e.model.childList.findIndex(function(e){if(e.onlyId==a.onlyId&&e.id==a.id)return!0});e.model.childList.splice(i,1),e.itemIds=t})}},handlePartChange:function(e){this.chooseParts=e,console.log(this.chooseParts),this.setBtn(e)},setBtn:function(e){var t=!0,a=!0;e.length>0?(a=!1,1==e.length&&(t=!1)):(t=!0,a=!0),this.btnDelDisabled=a,this.btnOtherDisabled=t},print:function(){document.getElementById("print_content").style.display="block",this.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(this.printList)),this.$nextTick(function(){var e=document.getElementById("print_content").innerHTML;return document.body.innerHTML="打印"+e+"",window.print(),window.location.reload(),!1})},getSummaries:function(e){for(var t=e.columns,a=e.data,i=0,o=0;o1)for(var n=0;n0&&this.subsetAll.forEach(function(e){t.push(e)}),this.$emit("change",t),this.innerVisible=!1},resetFields:function(){this.$refs.form&&this.$refs.form.resetFields()}}},r={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],attrs:{center:"",title:"导入关联单据",visible:e.innerVisible,width:"900px"},on:{"update:visible":function(t){e.innerVisible=t}}},[a("div",[a("el-form",{attrs:{inline:""}},[a("el-form-item",{attrs:{label:"源单类型"}},[a("el-select",{attrs:{size:"small"},model:{value:e.sourceTypeId,callback:function(t){e.sourceTypeId=t},expression:"sourceTypeId"}},e._l(e.deviceType,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"物料名称"}},[a("el-input",{attrs:{placeholder:"请输入物料名称",clearable:"",size:"small"},model:{value:e.searchData_Subset.materielName,callback:function(t){e.$set(e.searchData_Subset,"materielName",t)},expression:"searchData_Subset.materielName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"单据时间"}},[a("el-date-picker",{attrs:{type:"datetimerange",format:"yyyy-MM-dd HH:mm:ss","value-format":"yyyy-MM-dd HH:mm:ss","range-separator":"—","start-placeholder":"开始时间","end-placeholder":"结束时间"},model:{value:e.time,callback:function(t){e.time=t},expression:"time"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.searchSubset()}}},[e._v("查询")])],1)],1)],1),e._v(" "),a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.dialogLoading,expression:"dialogLoading"}],ref:"tb",attrs:{"row-key":e.getRowKey,data:e.subsetList,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"row-click":e.clickRow,"selection-change":e.ckSubsetAll}},[a("el-table-column",{attrs:{type:"selection","reserve-selection":!0,width:"55",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"outTime",label:"单据时间",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"materielSerialNo",label:"物料代码",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"materielName",label:"物料名称",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"specification",label:"规格型号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"unitPrice",label:"单价",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"amount",label:"金额",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"batch",label:"批号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"outCode",label:"单据编号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"unitUomName",label:"主计量单位",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"count",label:"领用数量(主单位)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"quoteCount",label:"可执行数量(主单位)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"supportUomName",label:"辅助单位",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"outCount",label:"领用数量(辅助单位)",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"subQuoteCount",label:"可执行数量(辅助单位)",align:"center","show-overflow-tooltip":""}})],1)],1),e._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":e.searchData_Subset.pageno,"page-sizes":[5,10,20],"page-size":e.searchData_Subset.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:e.subsetTotal},on:{"update:currentPage":function(t){return e.$set(e.searchData_Subset,"pageno",t)},"update:current-page":function(t){return e.$set(e.searchData_Subset,"pageno",t)},"size-change":e.subsetSizeChange,"current-change":e.subsetCurrentChange}})],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",size:"small",loading:e.loading},on:{click:function(t){return e.submit()}}},[e._v("确定")]),e._v(" "),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){e.innerVisible=!1}}},[e._v(e._s(e.config.cancelText))])],1)])},staticRenderFns:[]},s=a("VU/8")(o,r,!1,null,null,null);t.a=s.exports},sDE2:function(e,t){}});