yxk_pc_mdh/gyhl/static/js/54.cbf51bf1f63177f827a8.js

1 line
19 KiB
JavaScript

webpackJsonp([54],{"2Fw0":function(t,e){},"6Qfm":function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__=__webpack_require__("mvHQ"),__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__=__webpack_require__("Dd8w"),__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__),__WEBPACK_IMPORTED_MODULE_2__warehouse_otherStockOut_printOtherStockOut_vue__=__webpack_require__("GpsL"),__WEBPACK_IMPORTED_MODULE_3_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_4__components_System_dialogChooseSingleClient__=__webpack_require__("iGlD"),__WEBPACK_IMPORTED_MODULE_5__components_Dialog_dialogChooseSingleStock__=__webpack_require__("rfXi"),__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseParts_vue__=__webpack_require__("CdUU"),__WEBPACK_IMPORTED_MODULE_7__utils_config_js__=__webpack_require__("bzuE");__webpack_exports__.a={inject:["reload"],components:{DialogChooseSingleClientr:__WEBPACK_IMPORTED_MODULE_4__components_System_dialogChooseSingleClient__.a,printOtherStockOut:__WEBPACK_IMPORTED_MODULE_2__warehouse_otherStockOut_printOtherStockOut_vue__.a,dialogChooseSingleStock:__WEBPACK_IMPORTED_MODULE_5__components_Dialog_dialogChooseSingleStock__.a,dialogChooseParts:__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseParts_vue__.a},data:function(){return{formData:{outTime:"",clientName:"",clientId:""},planId:"",inHeadId:"",auditStatus:"",config:__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a,itemIds:[],lossStockId:"",availableCount:0,totalCount:0,childList:[],btnOtherDisabled:!0,btnDelDisabled:!1,chooseOperatorVisible:!1,ChooseMaterielVisible:!1,chooseClientrVisible:!1,ChooseStockVisible:!1,ChooseSalesOutStockVisible:!1,chooseUserVisible:!1,loading:!1,materielId:"",currentIndex:"",ruleForm:{outTime:[{required:!0,message:"请选择出库时间",trigger:"change"}]},printTotal:{count:"",amount:""},printList:[],printDetail:{clientName:"",outTime:"",outCode:""},printForm:[{title:"物料代码",prop_:"materielSerialNo"},{title:"物料名称",prop_:"materielName"},{title:"规格型号",prop_:"specification"},{title:"单位",prop_:"unitUomName"},{title:"批号",prop_:"batch"},{title:"数量",prop_:"count"},{title:"单价",prop_:"unitPrice"},{title:"金额",prop_:"amount"},{title:"仓库",prop_:"facName"},{title:"库位",prop_:"locationName"}]}},mounted:function(){var t=new Date;this.$set(this.formData,"outTime",t.getFullYear()+"-"+this.settime(t.getMonth()+1)+"-"+this.settime(t.getDate())),this.$route.query.id?(this.formData.id=this.$route.query.id,this.lossStockId=this.$route.query.id,this.getDetail()):(this.planId=this.$route.query.planId,console.log(this.planId),this.getDetail1())},watch:{lossStockId:{handler:function(t,e){this.btnDelDisabled=""!=t&&void 0!=t}}},methods:__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_3_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{settime:function(t){return 1==t.toString().length?"0"+t.toString():t},getDetail1:function(){var t=this,e=this;this.loading=!0,this.$nextTick().then(function(){console.log(e.planId),t.$api.inventoryAPI.buildLossStock({planId:e.planId}).then(function(i){console.log(i),t.loading=!1,0==i.code?(e.childList=i.BodyData,e.childList.forEach(function(t){e.$set(t,"sourceId",t.itemId),e.$set(t,"thisSourceType",t.documentTypeId),e.$set(t,"code",t.code),e.$set(t,"thisSourceTypeName",t.documentTypeName)})):t.$message({message:i.msg,type:"error"})})})},getDetail:function(){var t=this,e=this;this.loading=!0,this.$nextTick().then(function(){t.$api.otherStockOutAPI.getDetail({id:t.lossStockId}).then(function(i){t.loading=!1,e.formData.id=i.stockOut.id,e.$set(e.formData,"auditStatus",i.stockOut.auditSign?i.stockOut.auditSign:""),e.auditStatus=t.formData.auditStatus,e.$set(e.formData,"outTime",i.stockOut.outTime?i.stockOut.outTime:""),e.$set(e.formData,"remarks",i.stockOut.remarks?i.stockOut.remarks:""),e.$set(e.formData,"createUserName",i.stockOut.createUserName?i.stockOut.createUserName:""),e.$set(e.formData,"createTime",i.stockOut.createTime?i.stockOut.createTime:""),e.$set(e.formData,"auditTime",i.stockOut.auditTime?i.stockOut.auditTime:""),e.$set(e.formData,"auditorName",i.stockOut.auditorName?i.stockOut.auditorName:""),e.childList=i.stockOutItem,e.childList.forEach(function(t){t.serialno=t.serialno?t.serialno:"",t.materielName=t.materielName?t.materielName:"",t.profitLoss=t.count?t.count:0,t.profitLossSupport=t.subQuoteCount?t.subQuoteCount:0,t.materielId=t.materielId?t.materielId:"",t.unitName=t.unitUomName?t.unitUomName:"",t.warehouseName=t.facName?t.facName:"",t.warehLocationName=t.locationName?t.locationName:"",t.materielPrice=t.unitPrice?t.unitPrice:0,t.proAmount=t.amount?t.amount:0,t.newId=t.id?t.id:"",t.stockId=t.stockId?t.stockId:"",t.thisSourceTypeName=t.sourceTypeName?t.sourceTypeName:"",t.sourceId=t.sourceId?t.sourceId:"",t.thisSourceType=t.sourceType?t.sourceType:"",t.code=t.sourceCode?t.sourceCode:""}),t.printDetail.clientName=i.stockOut.clientName,t.printDetail.outTime=i.stockOut.outTime,t.printDetail.outCode=i.stockOut.outCode,t.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(t.childList))})})},clear:function(){this.$route.query.id&&(this.formData.id=void 0,this.lossStockId=void 0),this.auditStatus="",this.childList=[],this.formData={},this.itemIds=[],this.$refs.form.resetFields()},save:function(t){var e=this;this.$refs[t].validate(function(t){if(t){if(0==e.childList.length)return void e.$message({message:"没有盘亏数据,无法再次生成",type:"warning"});if(e.formData.id){var i=[];e.childList.forEach(function(t){console.log(t);var o={id:t.newId,stockId:t.stockId,materielId:t.materielId,count:t.profitLoss.toFixed(__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a.countFixedTo),outCount:t.profitLossSupport.toFixed(__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a.countFixedTo),supportUom:t.supportUom,convCoefficient:t.convCoefficient,unitPrice:t.materielPrice.toFixed(__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a.priceFixedTo),amount:t.proAmount,sourceId:t.sourceId,sourceType:t.thisSourceType,sourceCode:t.code};t.batch&&""!=t.batch&&(o.batch=t.batch),i.push(o),e.formData.item=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(i)}),e.$api.otherStockOutAPI.edit({id:e.formData.id,outTime:e.formData.outTime,remarks:e.formData.remarks,item:e.formData.item,itemIds:e.itemIds}).then(function(t){0===t.code?e.$message({message:t.msg,type:"success"}):e.$message({message:t.msg,type:"error"})})}else{var o=[];e.childList.forEach(function(t){console.log(t);var i={stockId:t.stockId,materielId:t.materielId,count:t.profitLoss.toFixed(__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a.countFixedTo),outCount:t.profitLossSupport.toFixed(__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a.countFixedTo),supportUom:t.supportUom,convCoefficient:t.convCoefficient,unitPrice:t.materielPrice?t.materielPrice.toFixed(__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a.priceFixedTo):0,amount:t.proAmount?t.proAmount:0,sourceId:t.sourceId,sourceType:t.thisSourceType,sourceCode:t.code};t.batch&&""!=t.batch&&(i.batch=t.batch),o.push(i),e.formData.item=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(o)}),e.$api.otherStockOutAPI.add({outTime:e.formData.outTime,remarks:e.formData.remarks,item:e.formData.item}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.lossStockId=t.id,e.getDetail(),console.log(e.lossStockId),window.location.href=e.changeURLArg("id",t.id)):e.$message({message:t.msg,type:"error"})})}}})},changeURLArg:function changeURLArg(arg,arg_val){var url=window.location.href,pattern=arg+"=([^&]*)",replaceText=arg+"="+arg_val;if(url.match(pattern)){var tmp="/("+arg+"=)([^&]*)/gi";return tmp=url.replace(eval(tmp),replaceText),tmp}return url.match("[?]")?url+"&"+replaceText:url+"?"+replaceText},sum1:function(t,e,i){if(0!=e&&0!=t){var o=t*e;return this.sellAmount=o,o=o.toFixed(__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a.amountFixedTo),this.$set(this.childList[i],"sellAmount",o),o}},sum2:function(t,e,i){if(0!=e&&0!=t){var o=t*e;return this.sellAmount=o,o=o.toFixed(__WEBPACK_IMPORTED_MODULE_7__utils_config_js__.a.amountFixedTo),this.$set(this.childList[i],"amount",o),o}},audit:function(){var t=this,e=this.lossStockId;this.$confirm("确认审核吗?","提示",{type:"warning"}).then(function(){t.$api.otherStockOutAPI.audit({id:e}).then(function(e){0===e.code?(t.$message({message:e.msg,type:"success"}),t.$router.push({path:"/warehouse/inventory",query:{t:Date.now()}})):t.$message({message:e.msg,type:"error"})})})},disAudit:function(){var t=this,e=this.formData.id;this.$confirm("确认反审核吗?","提示",{type:"warning"}).then(function(){t.$api.otherStockOutAPI.reverseAudit({id:e}).then(function(e){0===e.code?(t.$message({message:e.msg,type:"success"}),t.getDetail()):t.$message({message:e.msg,type:"error"})})})},getUser:function(t){t&&(this.formData.salesUserName=t.name,this.formData.salesUser=t.id,this.formData.deptName=t.deptName,this.formData.deptId=t.deptId)},getClientr:function(t){t&&(this.formData.clientName=t.client_name,this.formData.clientId=t.id)},getOperator:function(t){t&&(this.formData.operatorName=t.name,this.formData.operator=t.id)},getMateriel:function(t){var e=this;t&&t.forEach(function(t){e.$set(t,"count",1),e.$set(t,"sellUnitPrice",0),e.$set(t,"materielSerialNo",t.serialNo?t.serialNo:""),e.$set(t,"materielName",t.name?t.name:""),e.$set(t,"materielId",t.id),e.childList.push(t)})},removePart:function(){var t=this;if(this.chooseParts){var e=[];this.chooseParts.forEach(function(i){e.push(i.id);var o=t.childList.findIndex(function(t){if(t.id==i.id)return!0});t.childList.splice(o,1),t.itemIds=e})}},handlePartChange:function(t){this.chooseParts=t,console.log(this.chooseParts),this.setBtn(t)},setBtn:function(t){var e=!0,i=!0;t.length>0?(i=!1,1==t.length&&(e=!1)):(e=!0,i=!0),this.btnDelDisabled=i,this.btnOtherDisabled=e},copy:function(){var t=this;console.log(this.chooseParts),JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(this.chooseParts)).forEach(function(e){console.log(e),t.$set(e,"count",1),t.$set(e,"sellUnitPrice",0),delete e.id,delete e.batch,delete e.unitPrice,delete e.facName,delete e.locationName,delete e.availableCount,t.childList.push(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 t=document.getElementById("print_content").innerHTML;return document.body.innerHTML="<html><head><title>打印</title></head><body>"+t+"</body></html>",window.print(),window.location.reload(),!1})},getSummaries:function(t){for(var e=t.columns,i=t.data,o=0,a=0;a<i.length;a++)o+=i[a].count;this.printTotal.count=o;var s=0,r=0;if(i.length>1)for(var n=0;n<i.length;n++)n<i.length-1&&(s=i[n].count*i[n].unitPrice+i[n+1].count*i[n+1].unitPrice,r=i[n].count*i[n].sellUnitPrice+i[n+1].count*i[n+1].sellUnitPrice);else 1==i.length&&(s=i[0].count*i[0].unitPrice,r=i[0].count*i[0].sellUnitPrice);this.printTotal.amount=s,this.printTotal.sellAmount=r;for(var l=[],c=0;c<i.length;c++)i[c].count&&i[c].sellUnitPrice&&i[c].count*i[c].sellUnitPrice;return e.forEach(function(t,e){if(0!==e)if(3===e||5===e||7===e){var o=i.map(function(e){return Number(e[t.property])});o.every(function(t){return isNaN(t)})?l[e]="":l[e]=o.reduce(function(t,e){var i=Number(e);return isNaN(i)?t:t+e},0)}else l[e]="";else l[e]="合计"}),l},openDetails:function(t){this.ChooseStockVisible=!0,console.log(t),console.log(t.row.materielId),console.log(t.$index),this.materielId=t.row.materielId,this.currentIndex=t.$index},getStock:function(t){console.log(t),t&&(this.$set(this.childList[this.currentIndex],"stockId",t.id),this.$set(this.childList[this.currentIndex],"batch",t.batch),this.$set(this.childList[this.currentIndex],"sellUnitPrice",t.unitPrice),this.$set(this.childList[this.currentIndex],"facName",t.facilityName),this.$set(this.childList[this.currentIndex],"locationName",t.facilityLocationName),this.$set(this.childList[this.currentIndex],"availableCount",t.availableCount))}})}},EaGR:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i("6Qfm"),a={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"sys-box plan-box"},[i("div",{staticClass:"sys-operate"},[i("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:inventory:saveLoss",expression:"'warehouse:inventory:saveLoss'"}],attrs:{type:"primary"},on:{click:function(e){return t.save("form")}}},[t._v("保存")]),t._v(" "),t.btnDelDisabled?i("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:inventory:auditLoss",expression:"'warehouse:inventory:auditLoss'"}],attrs:{type:"primary"},on:{click:t.audit}},[t._v("审核")]):t._e()],1),t._v(" "),i("div",{staticClass:"sys-form"},[i("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"form",attrs:{"label-width":"120px","inline-message":!0,model:t.formData,rules:t.ruleForm}},[i("div",{staticClass:"flex"},[i("el-form-item",{staticClass:"dialog-form-inline",attrs:{label:"出库时间",prop:"outTime"}},[i("el-date-picker",{staticStyle:{width:"194px"},attrs:{type:"date",format:"yyyy-MM-dd","range-separator":"—",placeholder:"选择日期","value-format":"yyyy-MM-dd",clearable:"",disabled:179==t.auditStatus},model:{value:t.formData.outTime,callback:function(e){t.$set(t.formData,"outTime",e)},expression:"formData.outTime"}})],1)],1)]),t._v(" "),i("el-form",[i("el-form-item",{staticClass:"childlist",attrs:{prop:"childList"}},[i("el-table",{attrs:{data:t.childList,"show-summary":"","summary-method":t.getSummaries,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:""}},[i("el-table-column",{attrs:{prop:"materielName",label:"物料名称",align:"center","show-overflow-tooltip":""}}),t._v(" "),i("el-table-column",{attrs:{prop:"specification",align:"center","show-overflow-tooltip":"",label:"规格型号"}}),t._v(" "),i("el-table-column",{attrs:{prop:"unitName",align:"center","show-overflow-tooltip":"",label:"主计量单位"}}),t._v(" "),i("el-table-column",{attrs:{prop:"profitLoss",align:"center",width:"120",label:"出库数量(主单位)"}}),t._v(" "),i("el-table-column",{attrs:{prop:"supportUomName",align:"center","show-overflow-tooltip":"",label:"辅助单位"}}),t._v(" "),i("el-table-column",{attrs:{prop:"profitLossSupport",align:"center",width:"120",label:"出库数量(辅助单位)"}}),t._v(" "),i("el-table-column",{attrs:{prop:"materielPrice",align:"center",width:"120",label:"单价(元)"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"出库金额(元)",prop:"proAmount"}}),t._v(" "),i("el-table-column",{attrs:{prop:"batch",width:"120",align:"center",label:"批次","show-overflow-tooltip":""}}),t._v(" "),i("el-table-column",{attrs:{prop:"warehouseName",width:"120",align:"center",label:"仓库","show-overflow-tooltip":""}}),t._v(" "),i("el-table-column",{attrs:{prop:"warehLocationName",width:"120",align:"center",label:"仓位","show-overflow-tooltip":""}}),t._v(" "),i("el-table-column",{attrs:{prop:"thisSourceTypeName",align:"center",label:"源单类型",width:"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.thisSourceTypeName?i("div",{staticStyle:{color:"#3a8ee6"}},[t._v(t._s(e.row.thisSourceTypeName))]):i("div",{staticStyle:{color:"#3a8ee6"}})]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"code","show-overflow-tooltipalign":"",label:"源单单号"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("div",{staticStyle:{color:"#3a8ee6"}},[t._v(t._s(e.row.code))])]}}])})],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[i("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"请简要填写备注内容",disabled:179==t.auditStatus},model:{value:t.formData.remarks,callback:function(e){t.$set(t.formData,"remarks",e)},expression:"formData.remarks"}})],1)],1),t._v(" "),t.lossStockId?i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:5}},[t._v("制单人:"+t._s(t.formData.createUserName))]),t._v(" "),i("el-col",{attrs:{span:7}},[t._v("制单时间:"+t._s(t.formData.createTime))]),t._v(" "),i("el-col",{attrs:{span:5}},[t._v("审核人:"+t._s(t.formData.auditorName))]),t._v(" "),i("el-col",{attrs:{span:7}},[t._v("审核时间:"+t._s(t.formData.auditTime))])],1):t._e()],1),t._v(" "),i("DialogChooseSingleClientr",{attrs:{visible:t.chooseClientrVisible},on:{"update:visible":function(e){t.chooseClientrVisible=e},change:t.getClientr}}),t._v(" "),i("dialogChooseSingleStock",{attrs:{visible:t.ChooseStockVisible,materielId:t.materielId},on:{"update:visible":function(e){t.ChooseStockVisible=e},change:t.getStock}}),t._v(" "),i("dialogChooseParts",{attrs:{visible:t.ChooseMaterielVisible},on:{"update:visible":function(e){t.ChooseMaterielVisible=e},change:t.getMateriel}}),t._v(" "),i("div",{staticStyle:{margin:"0 auto",display:"none"},attrs:{id:"print_content"}},[i("printOtherStockOut",{attrs:{printDetail:t.printDetail,printList:t.printList,printForm:t.printForm,printTotal:t.printTotal,printDirection:!0}})],1)],1)},staticRenderFns:[]};var s=function(t){i("dLWG"),i("2Fw0")},r=i("VU/8")(o.a,a,!1,s,"data-v-cfe2bf02",null);e.default=r.exports},GpsL:function(t,e,i){"use strict";var o=i("S8x/"),a=(i("TExn"),i("bzuE")),s={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:a.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(t,e){Object(o.a)(t,this.printForm,this.printTotal,this.printDirection)},deep:!0}}},r={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"print_content",style:{width:t.pageWidth+"px"}},[i("div",{staticClass:"print_top"},[i("div",{staticClass:"head_out"},[i("h1",{staticStyle:{"text-align":"center"}},[t._v("其他出库单")]),t._v(" "),t.printDetail?i("div",{staticClass:"head2"},[i("div",{staticClass:"head2_item"},[t._v("客户:"+t._s(t.printDetail.clientName))]),t._v(" "),i("div",{staticClass:"head2_item"},[t._v("出库日期:"+t._s(t.printDetail.outTime))]),t._v(" "),i("div",{staticClass:"head2_item"},[t._v("单据编号:"+t._s(t.printDetail.outCode))])]):t._e()]),t._v(" "),i("div",{staticClass:"table_content"})]),t._v(" "),i("div",{staticClass:"footer_out"},[i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:8}},[t._v("制单人:"+t._s(t.printDetail.createByName))]),t._v(" "),i("el-col",{attrs:{span:8}},[t._v("制单时间:"+t._s(t.printDetail.createTimePrint))]),t._v(" "),i("el-col",{attrs:{span:5}},[t._v("保管员:")])],1)],1)])},staticRenderFns:[]},n=i("VU/8")(s,r,!1,null,null,null);e.a=n.exports},dLWG:function(t,e){}});