yxk_pc_mdh/gyhl/static/js/31.7cb84c9bf4e2d06b7ce0.js

1 line
35 KiB
JavaScript

webpackJsonp([31],{"+iJz":function(e,t,a){"use strict";var i=a("bzuE"),o={name:"dialogChooseSalesOutStock",props:{id:{type:String,default:""},visible:{type:Boolean,default:!1}},watch:{visible:function(e,t){e!==t&&(e&&this.initData(),this.innerVisible=e,this.$nextTick(function(){this.$refs.tb.clearSelection()}))},innerVisible:function(e,t){e!==t&&this.$emit("update:visible",e)},time:function(e){e?(this.searchData_Subset.startTime=e[0],this.searchData_Subset.endTime=e[1]):(this.searchData_Subset.startTime="",this.searchData_Subset.endTime="")}},data:function(){return{subsetList:[],subsetAll:[],subsetTotal:0,searchData_Subset:{pageno:1,pagesize:5,mark:"dialog",dialogType:1},time:"",createTime:"",callBackData:[],innerVisible:this.visible,loading:!1,dialogLoading:!1,sourceTypeId:188,deviceType:[{value:188,label:"生产计划"}],value:"sourceTypeName",deviceDept:[],addVisible:!1,config:i.a}},computed:{},methods:{getRowKey:function(e){return e.id+"_"+e.materielId},clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},initData:function(){this.searchSubset()},searchSubset:function(){var e=this;this.dialogLoading=!0,this.$api.produceStockAPI.list(this.searchData_Subset).then(function(t){e.dialogLoading=!1,0===t.code&&(console.log(t.data),e.subsetList=t.data?t.data.datas:[],e.subsetTotal=t.data?t.data.totalRows:0)})},ckSubsetAll:function(e){this.subsetAll=e,console.log(e)},subsetSizeChange:function(e){this.searchData_Subset.pagesize=e,this.searchSubset()},subsetCurrentChange:function(e){this.searchData_Subset.pageno=e,this.searchSubset()},submit:function(e){var t=[];this.subsetAll.length>0&&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:{filterable:"",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.value,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"物料名称"}},[a("el-input",{attrs:{placeholder:"请输入物料名称",clearable:"",size:"small"},model:{value:e.searchData_Subset.proName,callback:function(t){e.$set(e.searchData_Subset,"proName",t)},expression:"searchData_Subset.proName"}})],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:"planNo",label:"单据编号",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"createTime",label:"单据日期",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"materialSerialNo",label:"物料代码",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"materialName",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:"unitUomName",label:"主计量单位",align:"center","show-overflow-tooltip":""}}),e._v(" "),e._v('" label="辅助单位" align="center" show-overflow-tooltip>'),e._v(" "),a("el-table-column",{attrs:{prop:"planCount",label:"主计量单位数量",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"planCountSupport",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:"quoteCount",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:[]},n=a("VU/8")(o,r,!1,null,null,null);t.a=n.exports},"3LUx":function(e,t){},K6ip:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("KCij"),o={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box plan-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.back()}}},[e._v(e._s(e.config.cancelText))]),e._v(" "),179!=e.auditStatus?a("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:produceStock:save",expression:"'warehouse:produceStock:save'"}],attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.save("form")}}},[e._v("保存\n ")]):e._e(),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.clear}},[e._v("新增")]),e._v(" "),e.btnDelDisabled?a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.print()}}},[e._v("打印")]):e._e(),e._v(" "),e.btnDelDisabled&&178==e.auditStatus?a("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:produceStock:audit",expression:"'warehouse:produceStock:audit'"}],attrs:{type:"primary"},on:{click:function(t){return e.audit()}}},[e._v("审核\n ")]):e._e(),e._v(" "),e.btnDelDisabled&&179==e.auditStatus?a("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:produceStock:disAudit",expression:"'warehouse:produceStock:disAudit'"}],attrs:{type:"primary"},on:{click:e.disAudit}},[e._v("反审核\n ")]):e._e()],1),e._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"form",attrs:{"label-width":"100px","inline-message":!0,model:e.formData,rules:e.ruleForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"生产部门"}},[a("el-cascader",{attrs:{disabled:179==e.auditStatus,clearable:"",options:e.depOptions,props:{expandTrigger:"hover",label:"text",value:"id",checkStrictly:!0}},on:{change:e.handleChange},model:{value:e.selectDeptId,callback:function(t){e.selectDeptId=t},expression:"selectDeptId"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"入库时间",prop:"inTime"}},[a("el-date-picker",{staticStyle:{width:"80%"},attrs:{type:"date",format:"yyyy-MM-dd","range-separator":"—",placeholder:"选择日期","value-format":"yyyy-MM-dd",clearable:"",disabled:179===e.auditStatus},model:{value:e.formData.inTime,callback:function(t){e.$set(e.formData,"inTime",t)},expression:"formData.inTime"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"审核时是否生成倒冲领料单",prop:"isGenerateBackFlush","label-width":"180px"}},[a("el-checkbox",{attrs:{"true-label":e.trueLabel,"false-label":e.falseLabel,disabled:179===e.auditStatus},model:{value:e.formData.isGenerateBackFlush,callback:function(t){e.$set(e.formData,"isGenerateBackFlush",t)},expression:"formData.isGenerateBackFlush"}})],1)],1)]),e._v(" "),a("el-divider",{attrs:{"content-position":"left"}},[e._v("关联单据")]),e._v(" "),a("el-form",{ref:"formChild",attrs:{rules:e.model.rules,model:e.model}},[a("el-form-item",{staticClass:"childlist",attrs:{prop:"childList"}},[a("div",{staticClass:"sys-operate",staticStyle:{"margin-bottom":"10px"}},[e.btnDisabled&&179!=e.auditStatus?a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.ChooseProductionPlanVisible=!0}}},[e._v("\n 导入关联单据\n ")]):e._e(),e._v(" "),179!=e.auditStatus?a("el-button",{attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.removePart()}}},[e._v("删除\n ")]):e._e()],1),e._v(" "),a("el-table",{attrs:{data:e.model.childList,"show-summary":"","summary-method":e.getSummaries,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:""},on:{"selection-change":e.handlePartChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"serialno",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",align:"center","show-overflow-tooltip":"",label:"规格型号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"unitName",align:"center","show-overflow-tooltip":"",label:"主计量单位"}}),e._v(" "),a("el-table-column",{attrs:{prop:"count",align:"center",width:"180",label:"主单位数量","label-class-name":"required_head"}}),e._v(" "),a("el-table-column",{attrs:{prop:"supportUom",align:"center",width:"140","show-overflow-tooltip":"",label:"辅助单位"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("unitSelect",{attrs:{unitUom:t.row.supportUom,index:t.$index,disabled:179===e.auditStatus},on:{getValue:e.getValue}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"convCoefficient",align:"center",width:"140",label:"换算系数"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small",precision:t.row.quantityAccuracy,"controls-position":"right",disabled:179===e.auditStatus},on:{change:function(a){return e.changeCount2(t.row)}},model:{value:t.row.convCoefficient,callback:function(a){e.$set(t.row,"convCoefficient",a)},expression:"scope.row.convCoefficient"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"subQuoteCount",align:"center",width:"180",label:"入库数量","label-class-name":"required_head"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"childList."+t.$index+".count",rules:e.model.rules.count}},[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small",precision:t.row.quantityAccuracy,"controls-position":"right",disabled:179===e.auditStatus},on:{change:function(a){return e.changeCount2(t.row)}},model:{value:t.row.subQuoteCount,callback:function(a){e.$set(t.row,"subQuoteCount",a)},expression:"scope.row.subQuoteCount"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"batch",width:"120",align:"center",label:"批号","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{disabled:!!(178!=e.auditStatus&&e.produceStockId||1!=t.row.isLot),size:"small","controls-position":"right"},model:{value:t.row.batch,callback:function(a){e.$set(t.row,"batch",a)},expression:"scope.row.batch"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"warehouse",width:"120",align:"center",label:"仓库","show-overflow-tooltip":"","label-class-name":"required_head"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"childList."+t.$index+".warehouse",rules:e.model.rules.warehouse}},[a("el-select",{attrs:{clearable:"",placeholder:"仓库"},on:{change:function(a){return e.changeWarehouse(t.row)}},model:{value:t.row.warehouse,callback:function(a){e.$set(t.row,"warehouse",a)},expression:"scope.row.warehouse"}},e._l(e.fac_type_list,function(t){return a("el-option",{key:t.id,attrs:{disabled:179==e.auditStatus,label:t.name,value:t.id}})}),1)],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"warehLocationName",width:"120",align:"center",label:"仓位","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticStyle:{color:"#3a8ee6",cursor:"pointer"},on:{click:function(a){return e.chooseLocation(t.row,t.$index)}}},[e._v("\n "+e._s(t.row.warehLocationName)+"\n ")])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"unitPrice",align:"center",width:"140",label:"单价(元)"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"金额(元)",width:"140",prop:"amount"}}),e._v(" "),a("el-table-column",{attrs:{prop:"sourceTypeName",align:"center",label:"源单类型",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.sourceTypeName?a("div",{staticStyle:{color:"#3a8ee6"}},[e._v(e._s(t.row.sourceTypeName))]):a("div",{staticStyle:{color:"#3a8ee6"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"sourceCode","show-overflow-tooltipalign":"",label:"源单单号"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticStyle:{color:"#3a8ee6"},on:{click:function(a){return e.goToLink(t.sourceId)}}},[e._v(e._s(t.row.sourceCode))])]}}])})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[a("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"请简要填写备注内容",disabled:179==e.auditStatus},model:{value:e.formData.remarks,callback:function(t){e.$set(e.formData,"remarks",t)},expression:"formData.remarks"}})],1)],1),e._v(" "),e.produceStockId?a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:5}},[e._v("制单人:"+e._s(e.formData.createUserName))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("制单时间:"+e._s(e.formData.createTime))]),e._v(" "),a("el-col",{attrs:{span:5}},[e._v("审核人:"+e._s(e.formData.auditorName))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("审核时间:"+e._s(e.formData.auditTime))])],1):e._e()],1),e._v(" "),a("dialogChooseSingleLocation",{attrs:{warehouseId:e.warehouseRow.warehouse,visible:e.ChooseLocationVisible,dataForm:e.formData,childList:e.model.childList,childListIndex:e.childListIndex},on:{"update:visible":function(t){e.ChooseLocationVisible=t},change:e.getLocation}}),e._v(" "),a("dialogChooseProductionPlan",{attrs:{visible:e.ChooseProductionPlanVisible},on:{"update:visible":function(t){e.ChooseProductionPlanVisible=t},change:e.getProductionPlan}}),e._v(" "),a("div",{staticStyle:{margin:"0 auto",display:"none"},attrs:{id:"print_content"}},[a("printProductionPlan",{attrs:{printDetail:e.printDetail,printList:e.printList,printForm:e.printForm,printTotal:e.printTotal,printDirection:!0}})],1)],1)},staticRenderFns:[]};var r=function(e){a("3LUx"),a("Y9Xr")},n=a("VU/8")(i.a,o,!1,r,"data-v-60e21f6f",null);t.default=n.exports},KCij:function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator__=__webpack_require__("BO1k"),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator__),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify__=__webpack_require__("mvHQ"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify__),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends__=__webpack_require__("Dd8w"),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends__),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty__=__webpack_require__("bOdI"),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty__),__WEBPACK_IMPORTED_MODULE_4__components_System_dialogChooseSingleLocation__=__webpack_require__("tiiE"),__WEBPACK_IMPORTED_MODULE_5__warehouse_produceStock_printProductionPlan_vue__=__webpack_require__("Kzue"),__WEBPACK_IMPORTED_MODULE_6_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_7__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_8__components_Dialog_dialogChooseProductionPlan__=__webpack_require__("+iJz"),__WEBPACK_IMPORTED_MODULE_9__components_UnitSelect__=__webpack_require__("Sd19"),__WEBPACK_IMPORTED_MODULE_10__utils_tools__=__webpack_require__("GKmE"),_extends2;__webpack_exports__.a={components:{dialogChooseProductionPlan:__WEBPACK_IMPORTED_MODULE_8__components_Dialog_dialogChooseProductionPlan__.a,printProductionPlan:__WEBPACK_IMPORTED_MODULE_5__warehouse_produceStock_printProductionPlan_vue__.a,dialogChooseSingleLocation:__WEBPACK_IMPORTED_MODULE_4__components_System_dialogChooseSingleLocation__.a,unitSelect:__WEBPACK_IMPORTED_MODULE_9__components_UnitSelect__.a},data:function(){return{formData:{isGenerateBackFlush:0},trueLabel:1,falseLabel:0,auditStatus:"",produceStockId:"",selectDeptId:"",depOptions:[],itemIds:[],model:{rules:{count:{required:!0,message:"入库数量必填",trigger:"change"},warehouse:{required:!0,message:"仓库必填",trigger:"change"}},childList:[]},fac_type_list:[],fac_location_list:[],warehouseRow:"",config:__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a,btnDisabled:!0,isDisabled:!1,btnDelDisabled:!1,ChooseProductionPlanVisible:!1,ChooseLocationVisible:!1,loading:!1,ruleForm:{inTime:[{required:!0,message:"请选择入库时间",trigger:"change"}]},printTotal:{count:"",amount:""},printList:[],printDetail:{deptName:"",inTime:"",inheadCode:"",remarks:[],createByName:"",createTime:"",auditorName:"",auditTime:""},printForm:[{title:"物料代码",prop_:"serialno"},{title:"物料名称",prop_:"materielName"},{title:"规格型号",prop_:"specification"},{title:"主单位",prop_:"unitName"},{title:"辅助单位",prop_:"supportUomName"},{title:"批号",prop_:"batch"},{title:"入库数量",prop_:"count"},{title:"入库数量(辅助单位)",prop_:"subQuoteCount"},{title:"仓库",prop_:"warehouseName"},{title:"库位",prop_:"warehLocationName"}],childListIndex:-1}},mounted:function(){var e=this;if(this.initialize(),this.$route.query.id)this.formData.id=this.$route.query.id,this.produceStockId=this.$route.query.id,this.getDetail();else{var t=new Date;this.$set(this.formData,"inTime",t.getFullYear()+"-"+this.settime(t.getMonth()+1)+"-"+this.settime(t.getDate()))}this.$route.query.dataForm&&(this.formData=JSON.parse(this.$route.query.dataForm),this.$route.query.childList&&(this.$route.query.childList=JSON.parse(this.$route.query.childList),this.$route.query.childList.forEach(function(t){e.model.childList.push(t)})))},watch:__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default()({produceStockId:{handler:function(e,t){this.btnDelDisabled=""!=e&&void 0!=e}},formData:{handler:function(e,t){if(e)for(var a=e.remarks.split("\n"),i=0;i<a.length;i++)this.printDetail.remarks[i]=a[i]},deep:!0},model:{handler:function(e){e.childList.length>0?this.btnDisabled=!1:this.btnDisabled=!0}}},"model",{handler:function(e,t){e.childList.forEach(function(e){void 0!=e.warehouse&&""!=e.warehouse||(e.warehLocationName="",e.warehLocation="")})},deep:!0}),methods:__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_6_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),(_extends2={settime:function(e){return 1==e.toString().length?"0"+e.toString():e},changeWarehouse:function(e){this.$set(e,"warehLocationName","选择仓位"),this.$set(e,"warehLocation","")},chooseLocation:function(e,t){this.warehouseRow=e,this.childListIndex=t,this.ChooseLocationVisible=!0},getLocation:function(e){this.$set(this.warehouseRow,"warehLocation",e.id),this.$set(this.warehouseRow,"warehLocationName",e.name)},getDetail:function(){var e=this,t=this;this.loading=!0,this.$nextTick().then(function(){e.$api.produceStockAPI.getDtailOfOtherIn({inHeadIds:e.formData.id}).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,"inTime",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.$set(t.formData,"isGenerateBackFlush",a.data.deatilOfhead.isGenerateBackFlush?a.data.deatilOfhead.isGenerateBackFlush:0),t.model.childList=a.data.deatilOfBody,t.model.childList.forEach(function(e){e.serialno=e.serialno?e.serialno:"",e.materielName=e.proName?e.proName:"",e.specification=e.specification?e.specification:"",e.materielId=e.materielId?e.materielId:"",e.newId=e.id?e.id:"",e.sourceId=e.sourceId?e.sourceId:"",e.sourceType=e.sourceType?e.sourceType:""}),e.printDetail.deptName=a.data.deatilOfhead.deptName,e.printDetail.createByName=e.formData.createUserName,e.printDetail.createTimePrint=Object(__WEBPACK_IMPORTED_MODULE_10__utils_tools__.i)(e.formData.createTime,"{y}-{m}-{d}"),e.printDetail.auditTimePrint=Object(__WEBPACK_IMPORTED_MODULE_10__utils_tools__.i)(e.formData.auditTime,"{y}-{m}-{d}"),e.printDetail.auditorName=e.formData.auditorName,e.printDetail.inTime=/\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_1_babel_runtime_core_js_json_stringify___default()(e.model.childList)),console.log(e.printList),e.setDefaultDept()})})},handleChange:function(e){this.formData.deptId=e.length>=1?e[e.length-1]:"",this.selectDeptId=e},save:function(e){var t=this;this.$refs[e].validate(function(e){if(e){if(0==t.model.childList.length)return void t.$message({message:"请选择关联单据",type:"warning"});var a=void 0;if(t.$refs.formChild.validate(function(e,t){a=e}),!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"});var o=!0;if(t.model.childList.forEach(function(e){1!=e.isLot||e.batch||(o=!1)}),!o)return void t.$message({message:"有批次管理的一定要填写批次",type:"warning"});if(t.formData.id){var r=[];if(t.model.childList.forEach(function(e){console.log(e);var a={id:e.newId?e.newId:"",materielId:e.materielId,count:e.count.toFixed(e.quantityAccuracy),supportUom:e.supportUom,convCoefficient:e.convCoefficient,inCount:e.subQuoteCount.toFixed(e.quantityAccuracy),unitPrice:e.sellUnitPrice,amount:e.sellAmount,sourceType:e.sourceType?e.sourceType:"",sourceCode:e.sourceCode?e.sourceCode:"",sourceId:e.sourceId?e.sourceId:""};e.warehouse&&(a.warehouse=e.warehouse),e.warehLocation&&""!=e.warehLocation&&(a.warehLocation=e.warehLocation),e.batch&&""!=e.batch&&(a.batch=e.batch),r.push(a),t.formData.item=__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default()(r)}),t.isDisabled)return;t.isDisabled=!0,t.$api.produceStockAPI.saveAndChange({id:t.formData.id,isGenerateBackFlush:t.formData.isGenerateBackFlush?t.formData.isGenerateBackFlush:0,deptId:t.formData.deptId,inOutTime:t.formData.inTime,remarks:t.formData.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"}):t.$message({message:e.msg,type:"error"})})}else{var n=[];if(t.model.childList.forEach(function(e){console.log(e);var a={materielId:e.materielId,count:e.count.toFixed(e.quantityAccuracy),supportUom:e.supportUom,convCoefficient:e.convCoefficient,inCount:e.subQuoteCount.toFixed(e.quantityAccuracy),unitPrice:e.unitPrice,amount:e.amount,sourceType:e.sourceType?e.sourceType:"",sourceCode:e.sourceCode?e.sourceCode:"",sourceId:e.id?e.id:""};e.warehouse&&(a.warehouse=e.warehouse),e.warehLocation&&""!=e.warehLocation&&(a.warehLocation=e.warehLocation),e.batch&&""!=e.batch&&(a.batch=e.batch),n.push(a),t.formData.item=__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default()(n)}),t.isDisabled)return;t.isDisabled=!0,t.$api.produceStockAPI.saveAndChange({deptId:t.formData.deptId,isGenerateBackFlush:t.formData.isGenerateBackFlush?t.formData.isGenerateBackFlush:0,inOutTime:t.formData.inTime,remarks:t.formData.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.produceStockId=e.inHeadId,console.log(e.inHeadId),window.location.href=t.changeURLArg("id",e.inHeadId)):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},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/warehouse/produceStock",query:{t:Date.now()}}),this.clear()},clear:function(){this.$route.query.id&&(this.formData.id=void 0,this.produceStockId=void 0),this.selectDeptId="",this.auditStatus="",this.model.childList=[],this.formData={},this.itemIds=[],this.$refs.form.resetFields();var e=new Date;this.$set(this.formData,"inTime",e.getFullYear()+"-"+this.settime(e.getMonth()+1)+"-"+this.settime(e.getDate()))},audit:function(){var e=this,t=this.formData.id;this.$confirm("确认审核吗?","提示",{type:"warning"}).then(function(){e.$api.produceStockAPI.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.produceStockAPI.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"})})})},handlePartChange:function(e){this.chooseParts=e,this.setBtn(e)},setDefaultDept:function(){if(this.depOptions.length>0&&this.formData.deptId){var e=__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default()(this.formData.deptId),t=this.treeFindPath(this.depOptions,function(t){return t.id===e});this.selectDeptId=JSON.parse(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default()(t))}},treeFindPath:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)return[];var i=!0,o=!1,r=void 0;try{for(var n,s=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default()(e);!(i=(n=s.next()).done);i=!0){var l=n.value;if(a.push(l.id),t(l))return a;if(l.children){var c=this.treeFindPath(l.children,t,a);if(c.length)return c}a.pop()}}catch(e){o=!0,r=e}finally{try{!i&&s.return&&s.return()}finally{if(o)throw r}}return[]},setDeptList:function(e){var t=!0,a=!1,i=void 0;try{for(var o,r=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default()(e);!(t=(o=r.next()).done);t=!0){var n=o.value;n.hasChildren?this.setDeptList(n.children):n.children=void 0}}catch(e){a=!0,i=e}finally{try{!t&&r.return&&r.return()}finally{if(a)throw i}}},setBtn:function(e){var t=!0;t=!(e.length>0),this.btnDelDisabled=t},getProductionPlan:function(e){var t=this;console.log(e),e&&e.forEach(function(e){t.$set(e,"subQuoteCount",e.subQuoteCount?e.subQuoteCount:e.planCountSupport),t.$set(e,"convCoefficient",e.convCoefficient?e.convCoefficient:1),t.$set(e,"count",e.subQuoteCount*e.convCoefficient),t.$set(e,"serialno",e.materialSerialNo?e.materialSerialNo:""),t.$set(e,"materielName",e.materialName?e.materialName:""),t.$set(e,"unitName",e.unitUomName?e.unitUomName:""),t.$set(e,"unitPrice",e.unitPrice?e.unitPrice:0),t.$set(e,"amount",e.amount?e.amount:0),t.$set(e,"sourceId",e.id),t.$set(e,"materielId",e.materielId),t.$set(e,"batch",""),t.$set(e,"warehouse",""),t.$set(e,"warehLocation",""),t.$set(e,"warehLocationName",""),t.$set(e,"sourceTypeName",e.thisSourceTypeName?e.thisSourceTypeName:""),t.$set(e,"sourceType",e.thisSourceType?e.thisSourceType:""),t.$set(e,"sourceCode",e.planNo?e.planNo:""),t.$set(e,"onlyId",e.id+"_"+Math.random()),t.model.childList.push(e),t.availableCount=e.availableCount})},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.id==a.id)return!0});e.model.childList.splice(i,1),e.itemIds=t})}}},__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default()(_extends2,"handlePartChange",function(e){this.chooseParts=e,this.setBtn(e)}),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default()(_extends2,"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)}),this.$api.commonAPI.getDeptsTree().then(function(t){0===t.code&&(e.depOptions=t.data.children,e.setDefaultDept(),e.setDeptList(e.depOptions))}).catch(function(e){console.log(e)})}),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default()(_extends2,"print",function(){document.getElementById("print_content").style.display="block",this.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_json_stringify___default()(this.printList)),this.$nextTick(function(){var e=document.getElementById("print_content").innerHTML;return document.body.innerHTML="<html><head><title>打印</title></head><body>"+e+"</body></html>",window.print(),window.location.reload(),!1})}),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default()(_extends2,"getSummaries",function(e){for(var t=e.columns,a=e.data,i=0,o=0;o<a.length;o++)i+=a[o].count;this.printTotal.count=i;var r=0,n=0;if(a.length>1)for(var s=0;s<a.length;s++)s<a.length-1&&(r=a[s].subQuoteCount*a[s].unitPrice?a[s].subQuoteCount*a[s].unitPrice+a[s+1].subQuoteCount*a[s+1].unitPrice:0,n=a[s].subQuoteCount*a[s].sellUnitPrice?a[s].subQuoteCount*a[s].sellUnitPrice+a[s+1].subQuoteCount*a[s+1].sellUnitPrice:0);else 1==a.length&&(r=a[0].subQuoteCount*a[0].unitPrice?a[0].subQuoteCount*a[0].unitPrice:0,n=a[0].subQuoteCount*a[0].sellUnitPrice?a[0].subQuoteCount*a[0].sellUnitPrice:0);this.printTotal.amount=r,this.printTotal.sellAmount=n;for(var l=[],c=0;c<a.length;c++)a[c].subQuoteCount&&a[c].unitPrice&&a[c].subQuoteCount*a[c].unitPrice;return t.forEach(function(e,t){if(0!==t)if(5===t||8===t){var i=a.map(function(t){return Number(t[e.property])});i.every(function(e){return isNaN(e)})?l[t]="":l[t]=i.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0)}else l[t]="";else l[t]="合计"}),l}),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default()(_extends2,"changeCount2",function(e){isNaN(e.convCoefficient)||isNaN(e.subQuoteCount)?e.count=0:e.count=parseFloat((parseFloat(e.convCoefficient)*parseFloat(e.subQuoteCount)).toFixed(e.quantityAccuracy))}),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default()(_extends2,"getValue",function(e){this.model.childList[e.index].supportUom=e.value}),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_defineProperty___default()(_extends2,"goToLink",function(e){this.$router.push({path:"/planManagement/production_add",query:{id:e,t:Date.now()}})}),_extends2))}},Kzue:function(e,t,a){"use strict";var i=a("S8x/"),o=(a("TExn"),a("bzuE")),r={name:"",props:{printDetail:{type:Object,default:{}},printList:{type:Array,default:[]},printForm:{type:Array,default:[]},printTotal:{type:Object,default:{}},printDirection:{type:Boolean,default:!0}},data:function(){return{pageHeight:"",pageWidth:"",config:o.a}},component:{},mounted:function(){this.printDirection?(this.pageHeight=this.config.printHeightDirection0,this.pageWidth=this.config.printWidthDirection0):(this.pageHeight=this.config.printHeightDirection1,this.pageWidth=this.config.printWidthDirection1)},watch:{printList:{handler:function(e,t){Object(i.a)(e,this.printForm,this.printTotal,this.printDirection)},deep:!0}}},n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"print_content",style:{width:e.pageWidth+"px"}},[a("div",{staticClass:"print_top"},[a("div",{staticClass:"head_out"},[a("h1",{staticStyle:{"text-align":"center"}},[e._v("生产入库单")]),e._v(" "),e.printDetail?a("div",{staticClass:"head2"},[a("div",{staticClass:"head2_item"},[e._v("生产部门:"+e._s(e.printDetail.deptName))]),e._v(" "),a("div",{staticClass:"head2_item"},[e._v("入库日期:"+e._s(e.printDetail.inTime))]),e._v(" "),a("div",{staticClass:"head2_item"},[e._v("单据编号:"+e._s(e.printDetail.inheadCode))])]):e._e()]),e._v(" "),a("div",{staticClass:"table_content"})]),e._v(" "),a("div",{staticClass:"footer_out"},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:5}},[e._v("制单人:"+e._s(e.printDetail.createByName))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("制单时间:"+e._s(e.printDetail.createTimePrint))]),e._v(" "),a("el-col",{attrs:{span:5}},[e._v("保管员:"+e._s(e.printDetail.auditorName))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("日期:")])],1)],1)])},staticRenderFns:[]},s=a("VU/8")(r,n,!1,null,null,null);t.a=s.exports},Y9Xr:function(e,t){}});