yxk_pc_mdh/gyhl/static/js/36.66e3157f073146161509.js

1 line
31 KiB
JavaScript

webpackJsonp([36],{"06wI":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i("X6CZ"),s={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"sys-box plan-box"},[i("div",{staticClass:"sys-operate"},[i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.back()}}},[e._v(e._s(e.config.cancelText))]),e._v(" "),178!=e.auditStatus&&e.editId?e._e():i("el-button",{directives:[{name:"has",rawName:"v-has",value:"purchase:purchase_inStock:save",expression:"'purchase:purchase_inStock:save'"}],attrs:{type:"primary",disabled:e.isDisabled},on:{click:e.save}},[e._v("保存")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.new_save}},[e._v("新增")]),e._v(" "),e.editId&&178==e.auditStatus?i("el-button",{directives:[{name:"has",rawName:"v-has",value:"purchase:purchase_inStock:audit",expression:"'purchase:purchase_inStock:audit'"}],attrs:{type:"primary"},on:{click:function(t){return e.auditStatusChange()}}},[e._v("审核")]):e.editId&&179==e.auditStatus?i("el-button",{directives:[{name:"has",rawName:"v-has",value:"purchase:purchase_inStock:reverseAudit",expression:"'purchase:purchase_inStock:reverseAudit'"}],attrs:{type:"primary"},on:{click:function(t){return e.reverseAuditChange()}}},[e._v("反审核")]):e._e()],1),e._v(" "),i("div",{staticClass:"sys-form"},[i("el-form",{ref:"form",attrs:{"label-width":"120px",model:e.formData,rules:e.ruleForm}},[i("div",{staticClass:"flex"},[i("el-form-item",{staticClass:"form-inline",attrs:{label:"供应商名称",prop:"supplierName"}},[i("btn-input",{attrs:{valueText:e.formData.supplierName,valueId:e.formData.supplierName,chooseVisible:e.chooseSupplierVisible,showBtn:179!=e.auditStatus||!e.editId&&0==e.model.childList.length||0==e.model.childList.length},on:{"update:valueText":function(t){return e.$set(e.formData,"supplierName",t)},"update:value-text":function(t){return e.$set(e.formData,"supplierName",t)},"update:valueId":function(t){return e.$set(e.formData,"supplierName",t)},"update:value-id":function(t){return e.$set(e.formData,"supplierName",t)},"update:chooseVisible":function(t){e.chooseSupplierVisible=t},"update:choose-visible":function(t){e.chooseSupplierVisible=t}}})],1),e._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{prop:"buyerName",label:"采购员"}},[i("el-input",{attrs:{disabled:""},model:{value:e.formData.buyerName,callback:function(t){e.$set(e.formData,"buyerName",t)},expression:"formData.buyerName"}})],1),e._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{prop:"deptName",label:"采购部门"}},[i("el-input",{attrs:{disabled:""},model:{value:e.formData.deptName,callback:function(t){e.$set(e.formData,"deptName",t)},expression:"formData.deptName"}})],1),e._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"通知时间",prop:"noticeDate"}},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{disabled:!(178==e.auditStatus||!e.editId),type:"date",placeholder:"选择通知日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd"},model:{value:e.formData.noticeDate,callback:function(t){e.$set(e.formData,"noticeDate",t)},expression:"formData.noticeDate"}})],1),e._v(" "),i("el-form-item")],1)]),e._v(" "),i("el-divider",{attrs:{"content-position":"left"}},[e._v("关联单据")]),e._v(" "),i("el-form",{ref:"formChild",attrs:{rules:e.model.rules,model:e.model}},[i("el-form-item",{staticClass:"childlist",attrs:{prop:"childList"}},[178!=e.auditStatus&&e.editId?e._e():i("div",{staticClass:"sys-operate",staticStyle:{"margin-bottom":"10px"}},[i("el-button",{attrs:{type:"primary",disabled:179==e.auditStatus},on:{click:e.ChooseImportShow}},[e._v("导入采购订单")]),e._v(" "),i("el-button",{attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.removePart()}}},[e._v("删除")])],1),e._v(" "),i("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}},[i("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{prop:"materielSerialNo",label:"物料代码",align:"center","show-overflow-tooltip":"","label-class-name":"required_head"}}),e._v(" "),i("el-table-column",{attrs:{prop:"materielName",label:"物料名称",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"specification",align:"center","show-overflow-tooltip":"",label:"规格型号"}}),e._v(" "),i("el-table-column",{attrs:{prop:"unitUomName",align:"center",label:"主计量单位","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"count",align:"center",label:"主单位数量","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"supportUomName",align:"center",label:"辅助单位","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"convCoefficient",align:"center",label:"换算系数"}}),e._v(" "),i("el-table-column",{attrs:{prop:"receivingCount",align:"center",width:"180",label:"收料数量","label-class-name":"required_head"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-form-item",{class:t.row.error_count?"error_count":""},[i("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,disabled:!(178===e.auditStatus||!e.editId),size:"small",precision:e.config.countFixedTo,"controls-position":"right"},on:{change:function(i){return e.changeCount2(t.row)}},model:{value:t.row.receivingCount,callback:function(i){e.$set(t.row,"receivingCount",i)},expression:"scope.row.receivingCount"}})],1)]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"unitPrice",align:"center",width:"180",label:"含税单价(元)"}}),e._v(" "),i("el-table-column",{attrs:{align:"center",label:"含税金额(元)",prop:"amount",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",[e._v(e._s(e.setPriceAll(t.row.receivingCount,t.row.unitPrice)))])]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"contractTypeName",align:"center",label:"源单类型",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.contractTypeName?i("div",[e._v(e._s(t.row.sourceTypeName))]):i("div")]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"contractCode",align:"center","show-overflow-tooltipalign":"",label:"源单单号"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",{staticStyle:{color:"#3a8ee6"},on:{click:function(i){return e.goToLink(t.row)}}},[e._v(e._s(t.row.contractCode))])]}}])})],1)],1),e._v(" "),i("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[i("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"请简要填写备注内容",disabled:!(178==e.auditStatus||!e.editId)},model:{value:e.formData.remarks,callback:function(t){e.$set(e.formData,"remarks",t)},expression:"formData.remarks"}})],1)],1),e._v(" "),e.editId?i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:5}},[e._v("制单人:"+e._s(e.headDetail.createByName))]),e._v(" "),i("el-col",{attrs:{span:7}},[e._v("制单时间:"+e._s(e.headDetail.createTime))]),e._v(" "),179==e.initiate_auditStatus?i("el-col",{attrs:{span:5}},[e._v("审核人:"+e._s(e.headDetail.auditorName))]):e._e(),e._v(" "),179==e.initiate_auditStatus?i("el-col",{attrs:{span:7}},[e._v("审核时间:"+e._s(e.headDetail.auditTime))]):e._e()],1):e._e()],1),e._v(" "),i("dialogImportPurchaseNotice",{attrs:{visible:e.ChooseImport,supplierId:e.formData.supplierId,supplierName:e.formData.supplierName},on:{"update:visible":function(t){e.ChooseImport=t},change:e.getImport}}),e._v(" "),i("dialogChooseSingleUser",{attrs:{visible:e.chooseUserVisible},on:{"update:visible":function(t){e.chooseUserVisible=t},change:e.getUser}}),e._v(" "),i("dialogChooseSingleSupplier",{attrs:{visible:e.chooseSupplierVisible,dataForm:e.formData},on:{"update:visible":function(t){e.chooseSupplierVisible=t},change:e.getSupplier}})],1)},staticRenderFns:[]};var o=function(e){i("Wbgk"),i("SkUC")},r=i("VU/8")(a.a,s,!1,o,"data-v-53e97bac",null);t.default=r.exports},"7KwA":function(e,t,i){"use strict";var a=i("GKmE"),s={name:"dialogChooseFeedingItem",props:{id:{type:String,default:""},supplierId:{},supplierName:{},visible:{type:Boolean,default:!1},enableMultiFeeding:{type:Boolean,default:!1}},watch:{visible:function(e,t){e!==t&&(e&&this.getList(),this.innerVisible=e,this.$nextTick(function(){this.$refs.tb.clearSelection()}))},innerVisible:function(e,t){e!==t&&this.$emit("update:visible",e)}},data:function(){return{sourceTypeList:[{name:"采购订单",id:1}],sourceTypeId:1,subsetList:[],subsetAll:[],subsetTotal:0,searchData_Subset:{pageno:1,pagesize:5,name:"",auditSign:179},callBackData:[],innerVisible:this.visible,loading:!1,dialogLoading:!1,feedingList:[],addVisible:!1}},mounted:function(){},computed:{},methods:{getRowKey:function(e){return e.contractItemId+"_"+e.materielId},clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},getList:function(){var e=this;this.supplierId&&(this.searchData_Subset.supplierId=this.supplierId),this.dialogLoading=!0,this.searchData_Subset.createTime0?(this.searchData_Subset.createStartTime=Object(a.b)(this.searchData_Subset.createTime0[0]),this.searchData_Subset.createEndTime=Object(a.b)(this.searchData_Subset.createTime0[1])):(this.searchData_Subset.createStartTime="",this.searchData_Subset.createEndTime=""),this.$api.gylPurchaseAPI.purchaseContractListForNotice(this.searchData_Subset).then(function(t){e.dialogLoading=!1,0===t.code&&(e.subsetList=t.data?t.data.datas:[],console.log("========subsetList:"+e.subsetList),e.subsetTotal=t.data?t.data.totalRows:0)})},searchSubset:function(){this.searchData_Subset.pageno=1,this.getList()},ckSubsetAll:function(e){this.subsetAll=e},subsetSizeChange:function(e){this.searchData_Subset.pagesize=e,this.getList()},subsetCurrentChange:function(e){this.searchData_Subset.pageno=e,this.getList()},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()}}},o={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],attrs:{center:"",title:"导入采购订单",visible:e.innerVisible,width:"1000px"},on:{"update:visible":function(t){e.innerVisible=t}}},[i("div",[i("el-form",{attrs:{inline:""}},[i("el-form-item",{staticClass:"form-inline",attrs:{label:"源单类型",clearable:""}},[i("el-select",{staticStyle:{width:"150px"},attrs:{clearable:"",placeholder:"请选择"},model:{value:e.sourceTypeId,callback:function(t){e.sourceTypeId=t},expression:"sourceTypeId"}},e._l(e.sourceTypeList,function(e){return i("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),i("el-form-item",{attrs:{label:""}},[i("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"供应商模糊查询",clearable:"",disabled:""},model:{value:e.searchData_Subset.supplierName,callback:function(t){e.$set(e.searchData_Subset,"supplierName",t)},expression:"searchData_Subset.supplierName"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"单据时间"}},[i("el-date-picker",{staticStyle:{width:"220px"},attrs:{type:"daterange",format:"yyyy-MM-dd","range-separator":"—","start-placeholder":"开始时间","end-placeholder":"结束时间"},model:{value:e.searchData_Subset.createTime0,callback:function(t){e.$set(e.searchData_Subset,"createTime0",t)},expression:"searchData_Subset.createTime0"}})],1),e._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary"},on:{click:e.searchSubset}},[e._v("查询")])],1)],1)],1),e._v(" "),i("div",{staticClass:"sys-table"},[i("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}},[i("el-table-column",{attrs:{type:"selection","reserve-selection":!0,width:"55",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{prop:"createTime","show-overflow-tooltip":"",label:"单据时间",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{prop:"contractCode",label:"单据编号",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"supplierContractCode",label:"供应商合同编号",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"supplierName",label:"供应商",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"materielSerialNo",label:"物料代码",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"materielName",label:"物料名称",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"specification",label:"规格型号",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"unitUomName",label:"主计量单位",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"count",label:"数量(主单位)",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"supportUomName",label:"辅助单位",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"buyCount",label:"数量(辅助单位)",align:"center","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{prop:"executableCount",label:"可执行数量(辅助单位)",align:"center","show-overflow-tooltip":""}})],1)],1),e._v(" "),i("div",{staticClass:"sys-pagination"},[i("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(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:function(t){return e.submit()}}},[e._v("确定")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){e.innerVisible=!1}}},[e._v("关闭")])],1)])},staticRenderFns:[]},r=i("VU/8")(s,o,!1,null,null,null);t.a=r.exports},SkUC:function(e,t){},Wbgk:function(e,t){},X6CZ: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_core_js_object_assign__=__webpack_require__("woOf"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_assign___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_assign__),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray__=__webpack_require__("d7EF"),__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray__),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise__=__webpack_require__("//Fk"),__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise__),__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends__=__webpack_require__("Dd8w"),__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends__),__WEBPACK_IMPORTED_MODULE_5__utils_tools_js__=__webpack_require__("GKmE"),__WEBPACK_IMPORTED_MODULE_6__components_btnInput_vue__=__webpack_require__("ysqt"),__WEBPACK_IMPORTED_MODULE_7_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleUser__=__webpack_require__("3MlD"),__WEBPACK_IMPORTED_MODULE_9__components_System_dialogChooseSingleSuppliers__=__webpack_require__("FnMF"),__WEBPACK_IMPORTED_MODULE_10__components_System_dialogChooseSingleLocation__=__webpack_require__("tiiE"),__WEBPACK_IMPORTED_MODULE_11__components_System_dialogChooseParts_vue__=__webpack_require__("CdUU"),__WEBPACK_IMPORTED_MODULE_12__inStock_printPurchaseInstock_vue__=__webpack_require__("rGv2"),__WEBPACK_IMPORTED_MODULE_13__notice_dialogImportPurchaseNotice__=__webpack_require__("7KwA"),__WEBPACK_IMPORTED_MODULE_14__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_15_js_cookie__=__webpack_require__("lbHh"),__WEBPACK_IMPORTED_MODULE_15_js_cookie___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_js_cookie__);__webpack_exports__.a={inject:["reload"],components:{btnInput:__WEBPACK_IMPORTED_MODULE_6__components_btnInput_vue__.a,dialogChooseSingleLocation:__WEBPACK_IMPORTED_MODULE_10__components_System_dialogChooseSingleLocation__.a,dialogChooseParts:__WEBPACK_IMPORTED_MODULE_11__components_System_dialogChooseParts_vue__.a,dialogChooseSingleUser:__WEBPACK_IMPORTED_MODULE_8__components_System_dialogChooseSingleUser__.a,dialogChooseSingleSupplier:__WEBPACK_IMPORTED_MODULE_9__components_System_dialogChooseSingleSuppliers__.a,printPurchaseInstock:__WEBPACK_IMPORTED_MODULE_12__inStock_printPurchaseInstock_vue__.a,dialogImportPurchaseNotice:__WEBPACK_IMPORTED_MODULE_13__notice_dialogImportPurchaseNotice__.a},data:function(){return{userInfo:"",config:__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a,editId:"",auditStatus:"",initiate_auditStatus:"",itemIds:[],formData:{noticeDate:Object(__WEBPACK_IMPORTED_MODULE_5__utils_tools_js__.c)(),supplierName:"",supplierId:""},fac_type_list:[],fac_location_list:[],warehouseRow:"",ChooseImport:!1,isDisabled:!1,ruleForm:{supplierName:[{required:!0,message:"请选择供应商",trigger:"change"}],noticeDate:[{required:!0,message:"请选择入库时间",trigger:"change"}]},model:{childList:[]},ChooseMaterielVisible:!1,chooseUserVisible:!1,chooseSupplierVisible:!1,ChooseLocationVisible:!1,btnDelDisabled:!0,headDetail:{},printTotal:{count:"",amount:""},printList:[],Detail:{supplierName:"",inOutTime:"",inheadCode:"",createByName:"",createTime:"",auditorName:"",auditTime:""},printForm:[{title:"物料代码",prop_:"serialNo"},{title:"物料名称",prop_:"materielName"},{title:"规格型号",prop_:"specification"},{title:"单位",prop_:"unitUomName"},{title:"批号",prop_:"batch"},{title:"数量",prop_:"count"},{title:"单价",prop_:"unitPrice"},{title:"金额",prop_:"amount"},{title:"仓库",prop_:"warehouseName"},{title:"仓位",prop_:"warehLocationName"}]}},computed:__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_7_vuex__.c)({tagNavList:"tagNav/getOpenedPageList",userInfo:"user/getUserInfo"})),mounted:function(){this.userInfo=JSON.parse(__WEBPACK_IMPORTED_MODULE_15_js_cookie___default.a.get("userInfo")),this.editId=this.$route.query.id,this.editId?this.getDetail():(this.$set(this.formData,"operatorName",this.userInfo.name),this.$set(this.formData,"buyer",this.userInfo.userId),this.$set(this.formData,"buyerName",this.userInfo.name),this.$set(this.formData,"operator",this.userInfo.userId),this.$set(this.formData,"deptName",this.userInfo.deptName)),this.$route.query.dataForm&&(this.formData=JSON.parse(this.$route.query.dataForm)),this.initialize()},methods:__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_7_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{changeCount:function(e){if(e.error_count){for(var t=0,i=0;i<this.model.childList.length;i++)e.error_count&&e.sourceId==this.model.childList[i].sourceId&&(t=parseFloat(t)+parseFloat(this.model.childList[i].count));parseFloat(e.sourceCount)>=t&&this.model.childList.forEach(function(t){t.sourceId==e.sourceId&&delete t.error_count})}},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/purchase/purchase_notice_index",query:{t:Date.now()}})},initialize:function(){var e=this,t=[this.$api.gylInventoryAPI.facilityList({pageno:1,pagesize:1e3,auditSign:179}),this.$api.gylInventoryAPI.facilityLocationList({pageno:1,pagesize:1e3})];__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise___default.a.all(t).then(function(t){var i=__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_slicedToArray___default()(t,2),a=i[0],s=i[1];0===a.code&&(e.fac_type_list=a.data.datas,e.set_defaultFacility()),0===s.code&&(e.fac_location_list=s.data.datas)}).catch(function(e){console.log(e)})},ChooseImportShow:function(){this.formData.supplierName?this.ChooseImport=!0:this.$message({message:"请先选择供应商",type:"warning"})},getUser:function(e){e?(this.$set(this.formData,"operatorName",e.name),this.$set(this.formData,"operator",e.id),this.$set(this.formData,"deptName",e.deptName)):(this.$set(this.formData,"operatorName",""),this.$set(this.formData,"operator",""),this.$set(this.formData,"deptId",""))},getSupplier:function(e){e?(this.$set(this.formData,"supplierId",e.id),this.$set(this.formData,"supplierName",e.name),this.model.childList=[]):(this.$set(this.formData,"supplierId",""),this.$set(this.formData,"supplierName",""))},getSummaries:function(e){for(var t=e.columns,i=e.data,a=0,s=0;s<i.length;s++)a+=i[s].count;this.printTotal.count=a.toFixed(__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a.countFixedTo);for(var o=0,r=0;r<i.length;r++)o+i[r].receivingCount&&o+i[r].unitPrice&&(o+=i[r].receivingCount*i[r].unitPrice);this.printTotal.amount=o.toFixed(__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a.amountFixedTo);for(var n=[],l=0,_=0;_<i.length;_++)i[_].receivingCount&&i[_].unitPrice&&(l+=i[_].receivingCount*i[_].unitPrice);return t.forEach(function(e,t){if(0!==t)if(5===t||8===t||10===t)if(10!==t){var a=i.map(function(t){return Number(t[e.property])});a.every(function(e){return isNaN(e)})?n[t]="":n[t]=a.reduce(function(e,t){var i=Number(t);return isNaN(i)?e:e+t},0)}else n[t]=l.toFixed(__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a.amountFixedTo);else n[t]="";else n[t]="合计"}),n},setPriceAll:function(e,t){return e&&t?(parseFloat(e)*parseFloat(t)).toFixed(3):0},getImport:function(e){var t=this;e&&(console.log("=====val:"+e),e.forEach(function(e){console.log("=====p:"+e),t.$set(e,"isLot",e.isLot),t.$set(e,"count",0),t.$set(e,"unitPrice",e.taxUnitPrice?e.taxUnitPrice:0),t.$set(e,"materielName",e.materielName),t.$set(e,"serialNo",e.materielSerialNo),t.$set(e,"materielSerialNo",e.materielSerialNo),t.$set(e,"materielId",e.materielId),t.$set(e,"onlyId",e.id+"_"+Math.random()),t.$set(e,"contractItemId",e.contractItemId),t.$set(e,"contractId",e.id),t.$set(e,"contractCode",e.contractCode),t.$set(e,"receivingCount",0),t.$set(e,"amount",0),t.$set(e,"convCoefficient",e.convCoefficient),t.$set(e,"supportUomName",e.supportUomName),t.$set(e,"supportUom",e.supportUom),t.$set(e,"unitUom",e.contractCode),t.$set(e,"unitUomName",e.contractCode),t.$set(e,"contractTypeName",e.thisSourceTypeName),t.$set(e,"executableCount",e.executableCount?e.executableCount:0),delete e.id,t.model.childList.push(e),console.log("=====childList:"+e)}))},getDetail:function(){var e=this;this.$api.gylPurchaseAPI.purchaseNoticeDetail({id:this.editId}).then(function(t){0===t.code?(e.formData=__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_assign___default()({},t.notice),e.auditStatus=e.formData.auditSign,e.initiate_auditStatus=e.formData.auditSign,e.model.childList=t.noticeItem,e.model.childList.forEach(function(t){e.$set(t,"onlyId",t.materielId+"_"+Math.random()),e.$set(t,"serialNo",t.serialno),e.$set(t,"materielName",t.materielName),e.$set(t,"unitUomName",t.unitUomName)}),console.log(e.model.childList),e.$set(e.formData,"supplierName",t.notice.supplierName),e.set_defaultFacility(),e.$set(e.headDetail,"createByName",t.notice.createByName),e.$set(e.headDetail,"createTime",t.notice.createTime),e.$set(e.headDetail,"auditorName",t.notice.auditorName),e.$set(e.headDetail,"auditTime",t.notice.auditTime)):e.$message({message:t.msg,type:"error"})})},set_defaultFacility:function(e,t){var i=this;this.fac_type_list.length>0&&this.printList.length>0&&this.printList.forEach(function(e){i.fac_type_list.forEach(function(t){e.id==t.id&&i.$set(e,"warehouseName",t.name)})})},auditStatusChange:function(){var e=this;this.$confirm("确定审核吗?","提示",{type:"warning"}).then(function(){e.$api.gylPurchaseAPI.purchaseNoticeAudit({id:e.editId}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail()):e.$message({message:t.msg?t.msg:"操作失败,请重试",type:"error"})})}).catch(function(){e.$message({type:"info",message:"已取消"})})},reverseAuditChange:function(){var e=this;this.$confirm("确定反审核吗?","提示",{type:"warning"}).then(function(){e.$api.gylPurchaseAPI.purchaseNoticeReverseAudit({id:e.editId}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail()):e.$message({message:t.msg?t.msg:"操作失败,请重试",type:"error"})})}).catch(function(){e.$message({type:"info",message:"已取消"})})},save:function(){var e=this,t=void 0;this.$refs.formChild.validate(function(e,i){t=e});var i=!0;if(this.model.childList.forEach(function(e){console.log("item:"+e),console.log("item.receivingCount:"+e.receivingCoun),e.receivingCount<=0&&(i=!1)}),i){var a=[];console.log(this.model.childList),this.model.childList.forEach(function(t){var i={materielId:t.materielId,noticeId:t.noticeId,contractId:t.contractId,contractItemId:t.contractItemId,receivingCount:t.receivingCount?t.receivingCount:0,count:t.count?t.count:0,inCount:t.executableCount?t.executableCount:0,supportUom:t.supportUom,convCoefficient:t.convCoefficient,contractTypeName:t.contractTypeName,unitPrice:t.unitPrice?t.unitPrice:0,amount:e.setPriceAll(t.receivingCount,t.unitPrice)};t.id&&(i.id=t.id),a.push(i)});var s={supplierId:this.formData.supplierId?this.formData.supplierId:"",buyer:this.formData.buyer?this.formData.buyer:"",deptId:this.formData.deptId?this.formData.deptId:"",noticeDate:this.formData.noticeDate?this.formData.noticeDate:"",bodyItem:__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(a),itemIds:this.itemIds,uploadAttachments:"",remarks:this.formData.remarks?this.formData.remarks:""};this.editId&&(s.id=this.editId),this.$refs.form.validate(function(i){if(!i)return!1;0!=a.length?t?e.isDisabled||(e.isDisabled=!0,e.$api.gylPurchaseAPI.purchaseNoticeAddAndChange(s).then(function(t){e.isDisabled=!1,0===t.code?(e.editId?e.getDetail():(e.editId=t.id,window.location.href=e.changeURLArg("id",t.id)),e.$message({message:t.msg,type:"success"})):(t.code,e.$message({message:t.msg,type:"error"}))})):e.$message({message:"有必填项未填写",type:"warning"}):e.$message({message:"请选择通知明细",type:"warning"})})}else this.$message({message:"收料数量必须大于0",type:"warning"})},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},new_save:function(){this.formData={inOutTime:Object(__WEBPACK_IMPORTED_MODULE_5__utils_tools_js__.c)()},this.$set(this.formData,"operatorName",this.userInfo.name),this.$set(this.formData,"operator",this.userInfo.userId),this.auditStatus="",this.initiate_auditStatus="",this.model.childList=[],this.itemIds=[],this.headDetail={},this.purchaseType=1,this.editId&&(this.editId=void 0),this.$refs.form.resetFields()},removePart:function(){var e=this;this.chooseParts&&this.chooseParts.forEach(function(t){var i=e.model.childList.findIndex(function(i){if(i.onlyId==t.onlyId)return i.id&&e.itemIds.push(i.id),!0});e.model.childList.splice(i,1)})},setBtn:function(e){var t=!0;t=!(e.length>0),this.btnDelDisabled=t},handlePartChange:function(e){this.chooseParts=e,this.setBtn(e)},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="<html><head><title>打印</title></head><body>"+e+"</body></html>",window.print(),window.location.reload(),!1})},changeCount2:function(e){isNaN(e.convCoefficient)||isNaN(e.receivingCount)?e.count=0:e.count=parseFloat((parseFloat(e.convCoefficient)*parseFloat(e.receivingCount)).toFixed(__WEBPACK_IMPORTED_MODULE_14__utils_config_js__.a.countFixedTo)),this.changeCount(e)},goToLink:function(e){this.$router.push({path:"/purchase/purchase_contract_add",query:{id:e.queryId,t:Date.now()}})}}),watch:{purchaseType:function(e){this.editId||(this.model.childList=[],this.itemIds=[])},model:{handler:function(e,t){var i=this;console.log(e),e.childList.forEach(function(e){void 0!=e.warehouse&&""!=e.warehouse||(i.$set(e,"warehLocationName",""),i.$set(e,"warehLocation",""))})},deep:!0}}}},rGv2:function(e,t,i){"use strict";var a=i("2QJe"),s=(i("TExn"),i("bzuE")),o={name:"",props:{printDetail:{type:Object,default:{}},printList:{type:Array,default:[]},printForm:{type:Array,default:[]},printTotal:{type:Object,default:{}},printDirection:{type:Number,default:1}},data:function(){return{config:s.a,pageHeight:"",pageWidth:""}},component:{},mounted:function(){0===this.printDirection?(this.pageHeight=this.config.printHeightDirection0,this.pageWidth=this.config.printWidthDirection0):1===this.printDirection?(this.pageHeight=this.config.printHeightDirection1,this.pageWidth=this.config.printWidthDirection1):2===this.printDirection&&(this.pageHeight=this.config.printHeightDirection2,this.pageWidth=this.config.printWidthDirection2)},methods:{},watch:{printList:{handler:function(e,t){Object(a.a)(e,this.printForm,this.printTotal,this.printDirection)},deep:!0}}},r={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"print_content",style:{width:e.pageWidth+"px"}},[i("div",{staticClass:"print_top"},[i("div",{staticClass:"head_out"},[i("h1",{staticStyle:{"text-align":"center"}},[e._v("采购入库单")]),e._v(" "),e.printDetail?i("div",{staticClass:"head1"},[i("div",{staticClass:"head1_left"},[i("div",[e._v("供应商:"+e._s(e.printDetail.supplierName))]),e._v(" "),i("div",[e._v("单据编号:"+e._s(e.printDetail.inheadCode))])]),e._v(" "),i("div",{staticClass:"head1_right"},[i("div",[e._v("入库日期:"+e._s(e.printDetail.inOutTime))])])]):e._e()]),e._v(" "),i("div",{staticClass:"table_content"})]),e._v(" "),i("div",{staticClass:"footer_out"},[i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:8}},[e._v("制单人:"+e._s(e.printDetail.createByName))]),e._v(" "),i("el-col",{attrs:{span:8}},[e._v("制单时间:"+e._s(e.printDetail.createTimePrint))]),e._v(" "),i("el-col",{attrs:{span:5}},[e._v("保管员:")])],1)],1)])},staticRenderFns:[]},n=i("VU/8")(o,r,!1,null,null,null);t.a=n.exports}});