1 line
27 KiB
JavaScript
1 line
27 KiB
JavaScript
webpackJsonp([51],{"5VJO":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("Hsi+"),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:otherStock:save",expression:"'warehouse:otherStock: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:otherStock:audit",expression:"'warehouse:otherStock:audit'"}],attrs:{type:"primary"},on:{click: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:otherStock:disAudit",expression:"'warehouse:otherStock: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":"120px","inline-message":!0,model:e.formData,rules:e.ruleForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"供应商"}},[a("btn-input",{attrs:{valueText:e.formData.sourceCompanyName,valueId:e.formData.sourceCompany,chooseVisible:e.chooseSupplierVisible,showBtn:179!=e.auditStatus},on:{"update:valueText":function(t){return e.$set(e.formData,"sourceCompanyName",t)},"update:value-text":function(t){return e.$set(e.formData,"sourceCompanyName",t)},"update:valueId":function(t){return e.$set(e.formData,"sourceCompany",t)},"update:value-id":function(t){return e.$set(e.formData,"sourceCompany",t)},"update:chooseVisible":function(t){e.chooseSupplierVisible=t},"update:choose-visible":function(t){e.chooseSupplierVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"入库时间",prop:"inTime"}},[a("el-date-picker",{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)],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"}},[179!=e.auditStatus?a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.chooseMaterielVisible=!0}}},[e._v("新增")]):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||1===t.row.isInventory},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||1===t.row.isInventory},on:{change:function(a){return e.changeCount2(t.row,!0)}},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||1===t.row.isInventory},on:{change:function(a){return e.changeCount2(t.row,!1)}},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:"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:"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.otherStockId||1!=t.row.isLot||t.row.isInventory),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:"unitPrice",align:"center",width:"180",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.priceAccuracy,"controls-position":"right",disabled:179==e.auditStatus},model:{value:t.row.unitPrice,callback:function(a){e.$set(t.row,"unitPrice",a)},expression:"scope.row.unitPrice"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"入库金额(元)",prop:"amount",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e.sum1(t.row.subQuoteCount,t.row.unitPrice,t.$index))+"\n ")]}}])})],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.otherStockId?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,isAdd:!0},on:{"update:visible":function(t){e.ChooseLocationVisible=t},change:e.getLocation}}),e._v(" "),a("dialogChooseParts",{attrs:{visible:e.chooseMaterielVisible},on:{"update:visible":function(t){e.chooseMaterielVisible=t},change:e.getMateriel}}),e._v(" "),a("dialogChooseSingleSupplier",{attrs:{visible:e.chooseSupplierVisible},on:{"update:visible":function(t){e.chooseSupplierVisible=t},change:e.getSupplier}}),e._v(" "),a("div",{staticStyle:{margin:"0 auto",display:"none"},attrs:{id:"print_content"}},[a("printOtherStock",{attrs:{printDetail:e.printDetail,printList:e.printList,printForm:e.printForm,printTotal:e.printTotal,printDirection:!0}})],1)],1)},staticRenderFns:[]};var r=function(e){a("KSob"),a("OrK9")},n=a("VU/8")(i.a,o,!1,r,"data-v-7c7c6fd7",null);t.default=n.exports},"Hsi+":function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__=__webpack_require__("bOdI"),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__),__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__components_System_dialogChooseSingleLocation__=__webpack_require__("tiiE"),__WEBPACK_IMPORTED_MODULE_4__components_btnInput_vue__=__webpack_require__("ysqt"),__WEBPACK_IMPORTED_MODULE_5__components_Dialog_dialogChooseParts_vue__=__webpack_require__("5zN6"),__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleSuppliers__=__webpack_require__("FnMF"),__WEBPACK_IMPORTED_MODULE_7__warehouse_otherStock_printOtherStock_vue__=__webpack_require__("UtlJ"),__WEBPACK_IMPORTED_MODULE_8_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_9__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_10__components_UnitSelect__=__webpack_require__("Sd19"),__WEBPACK_IMPORTED_MODULE_11__utils_tools__=__webpack_require__("GKmE"),_extends2;__webpack_exports__.a={components:{btnInput:__WEBPACK_IMPORTED_MODULE_4__components_btnInput_vue__.a,printOtherStock:__WEBPACK_IMPORTED_MODULE_7__warehouse_otherStock_printOtherStock_vue__.a,dialogChooseSingleSupplier:__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleSuppliers__.a,dialogChooseParts:__WEBPACK_IMPORTED_MODULE_5__components_Dialog_dialogChooseParts_vue__.a,dialogChooseSingleLocation:__WEBPACK_IMPORTED_MODULE_3__components_System_dialogChooseSingleLocation__.a,unitSelect:__WEBPACK_IMPORTED_MODULE_10__components_UnitSelect__.a},data:function(){return{formData:{},auditStatus:"",otherStockId:"",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_9__utils_config_js__.a,btnDisabled:!0,isDisabled:!1,btnDelDisabled:!1,chooseMaterielVisible:!1,chooseSupplierVisible:!1,ChooseLocationVisible:!1,loading:!1,ruleForm:{inTime:[{required:!0,message:"请选择入库时间",trigger:"change"}]},printTotal:{count:"",subQuoteCount:""},printList:[],printDetail:{sourceCompanyName:"",inOutTime:"",inheadCode:""},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.otherStockId=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:{otherStockId:{handler:function(e,t){this.btnDelDisabled=""!=e&&void 0!=e}},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_8_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)},sum1:function(e,t,a){if(!t||!e)return 0;var i=e*t;return i=i.toFixed(__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a.amountFixedTo),this.$set(this.model.childList[a],"amount",i),i},getDetail:function(){var e=this,t=this;this.loading=!0,this.$nextTick().then(function(){e.$api.otherStockAPI.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,"sourceCompanyName",a.data.deatilOfhead.sourceCompanyName?a.data.deatilOfhead.sourceCompanyName:""),t.$set(t.formData,"sourceCompany",a.data.deatilOfhead.sourceCompany?a.data.deatilOfhead.sourceCompany:""),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.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.unitPrice=e.unitPrice?e.unitPrice:0,e.amount=e.amount?e.amount:0,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.sourceCompanyName=a.data.deatilOfhead.sourceCompanyName,e.printDetail.createByName=e.formData.createUserName,e.printDetail.createTimePrint=Object(__WEBPACK_IMPORTED_MODULE_11__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_11__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_1_babel_runtime_core_js_json_stringify___default()(e.model.childList))})})},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.count<=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.unitPrice.toFixed(e.priceAccuracy),amount:e.amount};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.otherStockAPI.saveAndChange({id:t.formData.id,sourceCompany:t.formData.sourceCompany,inOutTime:t.formData.inTime,remarks:t.formData.remarks?t.formData.remarks:"",bodyDetail:t.formData.item,itemIds:t.itemIds}).then(function(e){t.isDisabled=!0,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.toFixed(e.priceAccuracy),amount:e.amount};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.otherStockAPI.saveAndChange({sourceCompany:t.formData.sourceCompany,inOutTime:t.formData.inTime,remarks:t.formData.remarks?t.formData.remarks:"",bodyDetail:t.formData.item}).then(function(e){t.isDisabled=!0,0===e.code?(t.$message({message:e.msg,type:"success"}),t.otherStockId=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/otherStock",query:{t:Date.now()}}),this.clear()},clear:function(){this.$route.query.id&&(this.formData.id=void 0,this.otherStockId=void 0),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.otherStockAPI.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.otherStockAPI.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)},getSupplier:function(e){e?(this.$set(this.formData,"sourceCompany",e.id),this.$set(this.formData,"sourceCompanyName",e.name)):(this.$set(this.formData,"sourceCompany",""),this.$set(this.formData,"sourceCompanyName",""))},setBtn:function(e){var t=!0;t=!(e.length>0),this.btnDelDisabled=t},getMateriel:function(e){var t=this;console.log(e),e&&e.forEach(function(e){t.$set(e,"subQuoteCount",1),t.$set(e,"count",e.convCoefficient),t.$set(e,"serialno",e.serialNo?e.serialNo:""),t.$set(e,"materielName",e.name?e.name:""),t.$set(e,"unitName",e.unitUomName?e.unitUomName:""),t.$set(e,"unitPrice",e.salePrice?e.salePrice:0),t.$set(e,"amount",0),t.$set(e,"materielId",e.id),t.$set(e,"batch",""),t.$set(e,"warehouse",e.defaultFacilityId?e.defaultFacilityId:""),t.$set(e,"warehLocation",e.defaultLocationId?e.defaultLocationId:""),t.$set(e,"warehLocationName",e.defaultLocationName?e.defaultLocationName:""),t.$set(e,"onlyId",e.id+"_"+Math.random()),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.id==a.id)return!0});e.model.childList.splice(i,1),e.itemIds=t})}}},__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_extends2,"handlePartChange",function(e){this.chooseParts=e,this.setBtn(e)}),__WEBPACK_IMPORTED_MODULE_0_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)})}),__WEBPACK_IMPORTED_MODULE_0_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_0_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;for(var r=0,n=0;n<a.length;n++)r+=a[n].subQuoteCount;this.printTotal.subQuoteCount=r;var s=0,l=0;if(a.length>1)for(var u=0;u<a.length;u++)u<a.length-1&&(s=a[u].subQuoteCount*a[u].unitPrice?a[u].subQuoteCount*a[u].unitPrice+a[u+1].subQuoteCount*a[u+1].unitPrice:0,l=a[u].subQuoteCount*a[u].sellUnitPrice?a[u].subQuoteCount*a[u].sellUnitPrice+a[u+1].subQuoteCount*a[u+1].sellUnitPrice:0);else 1==a.length&&(s=a[0].subQuoteCount*a[0].unitPrice?a[0].subQuoteCount*a[0].unitPrice:0,l=a[0].subQuoteCount*a[0].sellUnitPrice?a[0].subQuoteCount*a[0].sellUnitPrice:0);this.printTotal.amount=s,this.printTotal.sellAmount=l;for(var _=[],c=0,d=0;d<a.length;d++)a[d].subQuoteCount&&a[d].unitPrice&&(c+=a[d].subQuoteCount*a[d].unitPrice);return t.forEach(function(e,t){if(0!==t)if(5===t||8===t||13===t)if(13!==t){var i=a.map(function(t){return Number(t[e.property])});i.every(function(e){return isNaN(e)})?_[t]="":_[t]=i.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0)}else _[t]=c.toFixed(__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a.amountFixedTo);else _[t]="";else _[t]="合计"}),_}),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_extends2,"changeCount2",function(e,t){t&&this.$message({message:"你已改变系数,库存可能会出现主辅单位数量和系数冲突,请确认后再修改!",type:"warning",duration:4e3}),isNaN(e.convCoefficient)||isNaN(e.subQuoteCount)?e.count=0:e.count=parseFloat((parseFloat(e.convCoefficient)*parseFloat(e.subQuoteCount)).toFixed(e.quantityAccuracy))}),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_extends2,"getValue",function(e){this.model.childList[e.index].supportUom=e.value}),_extends2))}},KSob:function(e,t){},OrK9:function(e,t){},UtlJ: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.sourceCompanyName))]),e._v(" "),a("div",{staticClass:"head2_item"},[e._v("入库日期:"+e._s(e.printDetail.inOutTime))]),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:8}},[e._v("制单人:"+e._s(e.printDetail.createByName))]),e._v(" "),a("el-col",{attrs:{span:8}},[e._v("制单时间:"+e._s(e.printDetail.createTimePrint))]),e._v(" "),a("el-col",{attrs:{span:5}},[e._v("保管员:")])],1)],1)])},staticRenderFns:[]},s=a("VU/8")(r,n,!1,null,null,null);t.a=s.exports}}); |