yxk_pc_mdh/gyhl/static/js/57.a93ec63f2c286ff3ad60.js

1 line
38 KiB
JavaScript

webpackJsonp([57],{"+4uZ":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__printDelivery__=__webpack_require__("jdvv"),__WEBPACK_IMPORTED_MODULE_3__components_btnInput_vue__=__webpack_require__("ysqt"),__WEBPACK_IMPORTED_MODULE_4_js_cookie__=__webpack_require__("lbHh"),__WEBPACK_IMPORTED_MODULE_4_js_cookie___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_js_cookie__),__WEBPACK_IMPORTED_MODULE_5_vuex__=__webpack_require__("NYxO"),__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleClient__=__webpack_require__("iGlD"),__WEBPACK_IMPORTED_MODULE_7__components_Dialog_dialogDnChooseContract__=__webpack_require__("/lKY"),__WEBPACK_IMPORTED_MODULE_8__components_Dialog_dialogChooseSingleStock__=__webpack_require__("rfXi"),__WEBPACK_IMPORTED_MODULE_9__utils_config_js__=__webpack_require__("bzuE"),__WEBPACK_IMPORTED_MODULE_10__api_deliveryNoteAPI__=__webpack_require__("e99b"),__WEBPACK_IMPORTED_MODULE_11__components_System_upload__=__webpack_require__("veZ4"),__WEBPACK_IMPORTED_MODULE_12__utils_tools__=__webpack_require__("GKmE"),__WEBPACK_IMPORTED_MODULE_13__components_DetailApproveFlow__=__webpack_require__("EB+w"),__WEBPACK_IMPORTED_MODULE_14__components_DetailPages_approDrawer__=__webpack_require__("AVXS");__webpack_exports__.a={inject:["reload"],components:{approDrawer:__WEBPACK_IMPORTED_MODULE_14__components_DetailPages_approDrawer__.a,DetailApproveFlow:__WEBPACK_IMPORTED_MODULE_13__components_DetailApproveFlow__.a,btnInput:__WEBPACK_IMPORTED_MODULE_3__components_btnInput_vue__.a,printDelivery:__WEBPACK_IMPORTED_MODULE_2__printDelivery__.a,dialogChooseContract:__WEBPACK_IMPORTED_MODULE_7__components_Dialog_dialogDnChooseContract__.a,DialogChooseSingleClientr:__WEBPACK_IMPORTED_MODULE_6__components_System_dialogChooseSingleClient__.a,dialogChooseSingleStock:__WEBPACK_IMPORTED_MODULE_8__components_Dialog_dialogChooseSingleStock__.a,upload:__WEBPACK_IMPORTED_MODULE_11__components_System_upload__.a},data:function(){return{drawer:!1,printDirection:1,printTypeList:[],progressList:[],submitParam:{type:11},approveFlow:[],formData:{deliveryCode:"",operator:"",noteTime:"",clientName:"",clientId:"",salesUserName:"",salesUser:"",deptName:"",deptId:"",projectId:"",projectName:"",transportCosts:0,linkName:"",linkPhone:"",harvestAddress:"",trackingNumber:"",logisticsCompany:""},auditStatus:0,config:__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a,userInfo:{},transportOptions:[],itemIds:[],deliveryNoteId:"",showUpload:!0,uploadAttachment:[],contentAssocList:"",availableCount:0,totalCount:0,model:{rules:{deliveryCount:{required:!0,message:"出库数量必填",trigger:"change"}},childList:[]},btnOtherDisabled:!0,btnDelDisabled:!1,chooseClientVisible:!1,ChooseStockVisible:!1,ChooseSalesOutStockVisible:!1,loading:!1,isDisabled:!1,materielId:"",currentIndex:"",ruleForm:{clientName:[{required:!0,message:"请选择客户",trigger:"change"}],salesUserName:[{required:!0,message:"请选择销售员",trigger:"change"}],deptName:[{required:!0,message:"请选择销售部门",trigger:"change"}],noteTime:[{required:!0,message:"请选择通知时间",trigger:"change"}]},printTotal:{deliveryCount:""},printList:[],printDetail:{clientName:"",noteTime:"",outCode:""},printForm:[{title:"物料代码",prop_:"serialno"},{title:"物料名称",prop_:"productName"},{title:"规格型号",prop_:"model"},{title:"单位",prop_:"unitName"},{title:"批号",prop_:"batch"},{title:"数量",prop_:"deliveryCount"},{title:"仓库",prop_:"facName"},{title:"库位",prop_:"locationName"}],isApprove:!1,approveButtons:[{key:0,btnName:"同意",click:"agree",type:"primary",disabled:!1},{key:1,btnName:"否决",click:"turnDownTask",type:"primary",disabled:!1},{key:2,btnName:"回退",click:"rollbackTask",type:"primary",disabled:!1},{key:3,btnName:"转派",click:"redeployTask",type:"primary",disabled:!1},{key:4,btnName:"关闭",click:"close",type:"primary",disabled:!1}]}},mounted:function(){if(this.userInfo=JSON.parse(__WEBPACK_IMPORTED_MODULE_4_js_cookie___default.a.get("userInfo")),this.initData(),this.getPrintTypeList(),this.$route.query.id)this.formData.id=this.$route.query.id,this.deliveryNoteId=this.$route.query.id,this.getDetail();else{var e=new Date;this.$set(this.formData,"noteTime",e.getFullYear()+"-"+this.settime(e.getMonth()+1)+"-"+this.settime(e.getDate()))}this.$route.query.isApprove&&(this.isApprove=!0,this.instanceId=this.$route.query.instanceId,this.submitParam.taskId=this.$route.query.taskId,console.log(this.submitParam)),this.$route.query.dataForm&&(this.formData=JSON.parse(this.$route.query.dataForm))},watch:{deliveryNoteId:{handler:function(e,t){this.btnDelDisabled=""!==e&&void 0!==e}},formData:{handler:function(e,t){""===e.clientId&&(this.formData.salesUser="",this.formData.salesUserName="",this.formData.deptName="",this.formData.deptId=""),""===e.salesUser&&(this.formData.deptName="",this.formData.deptId="")},deep:!0}},methods:__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({},Object(__WEBPACK_IMPORTED_MODULE_5_vuex__.d)({removeTagNav:"tagNav/removeTagNav"}),{btnClick:function(e,t){console.log("按钮调试"),console.log(e),"agree"==e?this.agree(t):"turnDownTask"==e?this.turnDownTask(t):"rollbackTask"==e?this.rollbackTask(t):"redeployTask"==e?this.redeployTask(t):(e="close")&&(this.drawer=!1)},agree:function(e){var t=this;console.log("tongyi___________"),this.submitParam.remark=e,this.$api.sendBeanApi.completeTask(this.submitParam).then(function(e){t.drawer=!1,0==e.code?(t.$message({message:e.msg,type:"success"}),t.back()):t.$message({message:e.msg,type:"error"})}).catch(function(e){t.drawer=!1,t.$message({message:"请求异常",type:"error"})})},turnDownTask:function(e){var t=this;this.submitParam.remark=e,this.$api.sendBeanApi.turnDownTask(this.submitParam).then(function(e){0==e.code?(t.$message({message:e.msg,type:"success"}),t.back()):t.$message({message:e.msg,type:"error"})}).catch(function(e){t.$message({message:"请求异常",type:"error"})})},rollbackTask:function(e){var t=this;this.submitParam.remark=e,this.$api.scmApproveAPI.findRollBackUser({instanceId:this.instanceId}).then(function(e){0===e.code?t.$confirm("此操作将回退到:"+e.data.applicantName+", 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.submitParam.userId=e.data.applicant,t.$api.sendBeanApi.rollbackTask(t.submitParam).then(function(e){0==e.code?(t.$message({message:e.msg,type:"success"}),t.back()):t.$message({message:e.msg,type:"error"})}).catch(function(e){t.$message({message:"请求异常",type:"error"})})}):t.$message.error(e.msg)}).catch()},redeployTask:function(e){this.submitParam.remark=e,this.chooseApproveUserVisible=!0},auditOpen:function(){var e=this;this.drawer=!0,this.$api.scmApproveAPI.findApproveRecords(this.instanceId).then(function(t){e.approveFlow=t.data,e.approveFlow.forEach(function(e){e.name=e.applicantName.substring(0,1),e.content=e.description,1==e.approveState?(e.showIcon=!0,e.showIcon1=!1):2==e.approveState?(e.showIcon=!1,e.showIcon1=!0):3==e.approveState?(e.showIcon=!0,e.showIcon1=!1):4==e.approveState?(e.showIcon=!0,e.showIcon1=!1):5==e.approveState&&(e.showIcon=!0,e.showIcon1=!1)})}).catch()},getPrintTypeList:function(){var e=this;this.$api.dictAPI.getDictsByType("print_type").then(function(t){0===t.code&&(e.printTypeList=t.datas)}).catch(function(e){})},initData:function(){var e=this;this.$api.processAPI.processTypeList({type:"transport_way"}).then(function(t){e.transportOptions=t.datas})},getProject:function(e){console.log(e),e?(this.formData.projectId=e.id,this.formData.projectName=e.name):(this.formData.projectId="",this.formData.projectName="")},changeCount:function(e){if(e.error_count){for(var t=0,a=0;a<this.model.childList.length;a++)e.error_count&&e.sourceId===this.model.childList[a].sourceId&&(t=parseFloat(t)+parseFloat(this.model.childList[a].deliveryCount));parseFloat(e.sourceCount)>=t&&this.model.childList.forEach(function(t){t.sourceId===e.sourceId&&delete t.error_count})}},settime:function(e){return 1===e.toString().length?"0"+e.toString():e},getDetail:function(){var e=this,t=this;this.loading=!0,this.$nextTick().then(function(){__WEBPACK_IMPORTED_MODULE_10__api_deliveryNoteAPI__.a.getDetail({id:e.formData.id}).then(function(a){if(e.loading=!1,0===a.headInfo.approveState?t.$set(t.formData,"auditStatus",0):t.$set(t.formData,"auditStatus",a.headInfo.approveState?a.headInfo.approveState:""),t.auditStatus=e.formData.auditStatus,t.$set(t.formData,"clientName",a.headInfo.clientName?a.headInfo.clientName:""),t.$set(t.formData,"clientId",a.headInfo.clientId?a.headInfo.clientId:""),t.$set(t.formData,"salesUserName",a.headInfo.salesUserName?a.headInfo.salesUserName:""),t.$set(t.formData,"salesUser",a.headInfo.salesUser?a.headInfo.salesUser:""),t.$set(t.formData,"deptName",a.headInfo.deptName?a.headInfo.deptName:""),t.$set(t.formData,"deptId",a.headInfo.deptId?a.headInfo.deptId:""),t.$set(t.formData,"operator",a.headInfo.operator?a.headInfo.operator:""),t.$set(t.formData,"noteTime",a.headInfo.noteTime?a.headInfo.noteTime:""),t.$set(t.formData,"remarks",a.headInfo.remarks?a.headInfo.remarks:""),t.$set(t.formData,"projectId",a.headInfo.projectId?a.headInfo.projectId:""),t.$set(t.formData,"projectName",a.headInfo.projectName?a.headInfo.projectName:""),t.$set(t.formData,"linkName",a.headInfo.linkName?a.headInfo.linkName:""),t.$set(t.formData,"linkPhone",a.headInfo.linkPhone?a.headInfo.linkPhone:""),t.$set(t.formData,"harvestAddress",a.headInfo.harvestAddress?a.headInfo.harvestAddress:""),t.$set(t.formData,"trackingNumber",a.headInfo.trackingNumber?a.headInfo.trackingNumber:""),t.$set(t.formData,"logisticsCompany",a.headInfo.logisticsCompany?a.headInfo.logisticsCompany:""),t.$set(t.formData,"transportCosts",a.headInfo.transportCosts?a.headInfo.transportCosts:""),t.$set(t.formData,"transportWay",a.headInfo.transportWay?a.headInfo.transportWay:""),t.$set(t.formData,"createUserName",a.headInfo.createUserName?a.headInfo.createUserName:""),t.$set(t.formData,"createTime",a.headInfo.createTime?a.headInfo.createTime:""),t.$set(t.formData,"approveStateName",a.headInfo.approveStateName?a.headInfo.approveStateName:""),t.$set(t.formData,"deliveryCode",a.headInfo.deliveryCode?a.headInfo.deliveryCode:""),0!==e.auditStatus&&(e.progressList=a.progressList),t.model.childList=a.bodyInfo,t.model.childList.forEach(function(t){e.$set(t,"btnName","已查询"),e.$set(t,"onlyId",t.materielId+"_"+Math.random()),t.serialno=t.materielSerialNo?t.materielSerialNo:"",t.productName=t.materielName?t.materielName:"",t.model=t.specification?t.specification:"",t.unitName=t.unitUomName?t.unitUomName:"",t.sellUnitPrice=t.sellUnitPrice?t.sellUnitPrice:0,t.sellAmount=t.sellAmount?t.sellAmount:0,t.facilityName=t.facName?t.facName:"",t.facilityLocationName=t.locationName?t.locationName:"",t.materielId=t.materielId?t.materielId:"",t.stockId=t.stockId?t.stockId:"",t.thisSourceTypeName=t.sourceTypeName?t.sourceTypeName:"",t.code=t.sourceCode?t.sourceCode:"",t.sourceId=t.sourceId?t.sourceId:"",t.sourceType=t.sourceType?t.sourceType:""}),e.printDetail.clientName=a.headInfo.clientName,e.printDetail.outCode=a.headInfo.deliveryCode,e.printDetail.noteTime=/\d{4}-\d{1,2}-\d{1,2}/g.exec(a.headInfo.noteTime)[0],e.printDetail.createByNamePrint=a.headInfo.createUserName,e.printDetail.createTimePrint=Object(__WEBPACK_IMPORTED_MODULE_12__utils_tools__.i)(a.headInfo.createTime,"{y}-{m}-{d}"),e.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(e.model.childList)),console.log(t.auditStatus),a.uploadAttachment&&a.uploadAttachment.length>0)for(var o=0;o<a.uploadAttachment.length;o++){var i={fileName:a.uploadAttachment[o].fileName,filePath:a.uploadAttachment[o].filePath};e.uploadAttachment.push(i)}})})},clear:function(){this.showUpload=!1,this.$route.query.id&&(this.formData.id=void 0,this.deliveryNoteId=void 0),this.auditStatus=0,this.model.childList=[],this.uploadAttachment=[],this.formData={},this.itemIds=[],this.$refs.form.resetFields();var e=new Date;this.$set(this.formData,"noteTime",e.getFullYear()+"-"+this.settime(e.getMonth()+1)+"-"+this.settime(e.getDate())),this.showUpload=!0},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/sales/deliveryNote",query:{t:Date.now()}}),this.clear()},save:function(e){var t=this,a=void 0;this.$refs.formChild.validate(function(e,t){a=e}),this.$refs[e].validate(function(e){if(e){if(0===t.model.childList.length)return void t.$message({message:"请选择关联单据",type:"warning"});if(!a)return void t.$message({message:"有必填项未填写",type:"warning"});var o=!0;if(t.model.childList.forEach(function(e){e.deliveryCountSupport<=0&&(o=!1)}),!o)return void t.$message({message:"出库数量必须大于0",type:"warning"});var i=!0;if(t.model.childList.forEach(function(e){e.stockId||(i=!1)}),i){if(t.isDisabled)return;t.isDisabled=!0;var r=[];if(t.model.childList.forEach(function(e){var a={id:e.id,stockId:e.stockId,materielId:e.materielId,deliveryCount:e.deliveryCount.toFixed(e.quantityAccuracy),deliveryCountSupport:e.deliveryCountSupport?e.deliveryCountSupport.toFixed(e.quantityAccuracy):0,supportUom:e.supportUom,convCoefficient:e.convCoefficient,sellUnitPrice:e.sellUnitPrice.toFixed(e.priceAccuracy),sellAmount:e.sellAmount,sourceId:e.sourceId,sourceType:e.sourceType,sourceCode:e.code,remarks:e.remarks?e.remarks:""};e.batch&&""!==e.batch&&(a.batch=e.batch),r.push(a),t.formData.bodyItem=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(r)}),null!=t.uploadAttachment&&t.uploadAttachment.length>0){var s=[];t.uploadAttachment.forEach(function(e){var t={fileName:e.fileName,filePath:e.filePath};s.push(t)}),t.contentAssocList=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(s),console.log(t.contentAssocList)}var n={id:t.formData.id,clientId:t.formData.clientId,salesUser:t.formData.salesUser,deptId:t.formData.deptId,noteTime:t.formData.noteTime,operator:t.formData.operator,remarks:t.formData.remarks,bodyItem:t.formData.bodyItem,itemIds:t.itemIds?t.itemIds:[],projectId:t.formData.projectId?t.formData.projectId:"",linkName:t.formData.linkName?t.formData.linkName:"",linkPhone:t.formData.linkPhone?t.formData.linkPhone:"",harvestAddress:t.formData.harvestAddress?t.formData.harvestAddress:"",transportWay:t.formData.transportWay,transportCosts:t.formData.transportCosts?t.formData.transportCosts:0,logisticsCompany:t.formData.logisticsCompany?t.formData.logisticsCompany:"",trackingNumber:t.formData.trackingNumber?t.formData.trackingNumber:"",deliveryCode:t.formData.deliveryCode,auditStatus:t.formData.auditStatus,uploadAttachment:t.contentAssocList};__WEBPACK_IMPORTED_MODULE_10__api_deliveryNoteAPI__.a.saveHandle(n).then(function(e){t.isDisabled=!1,0===e.code?(t.$message.success(e.msg),t.formData.id||(t.deliveryNoteId=e.id,window.location.href=t.changeURLArg("id",e.id))):500===e.code&&e.data?(t.$message.error(e.msg),t.model.childList.forEach(function(a){a.sourceId&&a.sourceId===e.data.sourceId&&(t.$set(a,"error_count",!0),t.$set(a,"sourceCount",e.data.sourceCount))})):t.$message.error(e.msg)}).catch(function(e){t.$message.error("请求失败!")})}else t.$message.error("请先查询库存!")}})},submit:function(e){var t=this,a=void 0;this.$refs.formChild.validate(function(e,t){a=e}),this.$refs[e].validate(function(e){if(e){if(0===t.model.childList.length)return void t.$message({message:"请选择关联单据",type:"warning"});if(!a)return void t.$message({message:"有必填项未填写",type:"warning"});var o=!0;if(t.model.childList.forEach(function(e){e.deliveryCountSupport<=0&&(o=!1)}),!o)return void t.$message({message:"出库数量必须大于0",type:"warning"});var i=!0;if(t.model.childList.forEach(function(e){e.stockId||(i=!1)}),i){if(t.isDisabled)return;t.isDisabled=!0;var r=[];if(t.model.childList.forEach(function(e){var a={id:e.id,stockId:e.stockId,materielId:e.materielId,deliveryCount:e.deliveryCount.toFixed(e.quantityAccuracy),deliveryCountSupport:e.deliveryCountSupport?e.deliveryCountSupport.toFixed(e.quantityAccuracy):0,supportUom:e.supportUom,convCoefficient:e.convCoefficient,sellUnitPrice:e.sellUnitPrice.toFixed(e.priceAccuracy),sellAmount:e.sellAmount,sourceId:e.sourceId,sourceType:e.sourceType,sourceCode:e.code,remarks:e.remarks?e.remarks:""};e.batch&&""!==e.batch&&(a.batch=e.batch),r.push(a),t.formData.bodyItem=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(r)}),null!=t.uploadAttachment&&t.uploadAttachment.length>0){var s=[];t.uploadAttachment.forEach(function(e){var t={fileName:e.fileName,filePath:e.filePath};s.push(t)}),t.contentAssocList=__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(s),console.log(t.contentAssocList)}var n={id:t.formData.id,clientId:t.formData.clientId,salesUser:t.formData.salesUser,deptId:t.formData.deptId,noteTime:t.formData.noteTime,operator:t.formData.operator,remarks:t.formData.remarks,bodyItem:t.formData.bodyItem,itemIds:t.itemIds?t.itemIds:[],projectId:t.formData.projectId?t.formData.projectId:"",linkName:t.formData.linkName?t.formData.linkName:"",linkPhone:t.formData.linkPhone?t.formData.linkPhone:"",harvestAddress:t.formData.harvestAddress?t.formData.harvestAddress:"",transportWay:t.formData.transportWay,transportCosts:t.formData.transportCosts?t.formData.transportCosts:0,logisticsCompany:t.formData.logisticsCompany?t.formData.logisticsCompany:"",trackingNumber:t.formData.trackingNumber?t.formData.trackingNumber:"",deliveryCode:t.formData.deliveryCode,auditStatus:t.formData.auditStatus,uploadAttachment:t.contentAssocList};__WEBPACK_IMPORTED_MODULE_10__api_deliveryNoteAPI__.a.submitForm(n).then(function(e){t.isDisabled=!1,0===e.code?t.$message.success(e.msg):(500===e.code&&e.data,t.$message.error(e.msg))}).catch(function(e){t.$message.error("请求失败!")})}else t.$message.error("请先查询库存!")}})},changeURLArg:function changeURLArg(arg,arg_val){var url=window.location.href,pattern=arg+"=([^&]*)",replaceText=arg+"="+arg_val;if(url.match(pattern)){var tmp="/("+arg+"=)([^&]*)/gi";return tmp=url.replace(eval(tmp),replaceText),tmp}return url.match("[?]")?url+"&"+replaceText:url+"?"+replaceText},sum1:function(e,t,a){var o=e*t?e*t:0;return this.sellAmount=o,o=o.toFixed(__WEBPACK_IMPORTED_MODULE_9__utils_config_js__.a.amountFixedTo),this.$set(this.model.childList[a],"sellAmount",o),o},audit:function(){var e=this,t=this.formData.id;this.$confirm("确认审核吗?","提示",{type:"warning"}).then(function(){__WEBPACK_IMPORTED_MODULE_10__api_deliveryNoteAPI__.a.audit({id: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(){__WEBPACK_IMPORTED_MODULE_10__api_deliveryNoteAPI__.a.reverseAudit({id:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail()):e.$message({message:t.msg,type:"error"})})})},getClientr:function(e){e&&(this.formData.clientName=e.client_name,this.formData.clientId=e.id,this.formData.salesUserName=e.belongSalesmanName?e.belongSalesmanName:this.userInfo.name,this.formData.salesUser=e.belongSalesman?e.belongSalesman:this.userInfo.userId,this.formData.deptName=e.belongDeptName?e.belongDeptName:this.userInfo.deptName,this.formData.deptId=e.belongDept?e.belongDept:this.userInfo.deptId,this.formData.linkName=e.linkman_name?e.linkman_name:"",this.formData.linkPhone=e.linkman_phone?e.linkman_phone:"",this.formData.harvestAddress=e.harvestAddress?e.harvestAddress:"")},ChooseImportShow:function(){this.formData.clientId?this.ChooseSalesOutStockVisible=!0:this.$message({message:"请先选择客户",type:"warning"})},getSalesOutStock:function(e){var t=this;e&&e.forEach(function(e){t.formData.projectName=e.projectName?e.projectName:"",t.formData.projectId=e.projectId?e.projectId:"",t.$set(e,"btnName","查询"),t.$set(e,"availableCount",e.count?e.count:0),t.$set(e,"deliveryCountSupport",e.subQuoteCount?e.subQuoteCount:0),t.$set(e,"deliveryCount",e.convCoefficient?parseFloat((e.subQuoteCount*e.convCoefficient).toFixed(e.quantityAccuracy)):0),t.$set(e,"sellUnitPrice",e.taxUnitPrice?e.taxUnitPrice:0),e.sellAmount=e.taxAmount?e.taxAmount:0,t.$set(e,"materielId",e.materielId),t.$set(e,"sourceId",e.id),t.$set(e,"sourceType",e.thisSourceType),t.$set(e,"onlyId",e.id+"_"+Math.random()),delete e.id,t.model.childList.push(e)})},removePart:function(){var e=this;if(this.chooseParts){var t=[];this.chooseParts.forEach(function(a){t.push(a.id);var o=e.model.childList.findIndex(function(e){if(e.onlyId===a.onlyId&&e.id===a.id)return!0});e.model.childList.splice(o,1),e.itemIds=t})}},handlePartChange:function(e){this.chooseParts=e,this.setBtn(e)},setBtn:function(e){var t=!0,a=!0;e.length>0?(a=!1,1===e.length&&(t=!1)):(t=!0,a=!0),this.btnDelDisabled=a,this.btnOtherDisabled=t},copy:function(){var e=this;JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(this.chooseParts)).forEach(function(t){console.log(t),e.$set(t,"deliveryCount",0),e.$set(t,"deliveryCountSupport",0),e.$set(t,"sellUnitPrice",t.sellUnitPrice),e.$set(t,"btnName","查询"),delete t.id,delete t.batch,delete t.facName,delete t.locationName,e.model.childList.push(t)})},print:function(){document.getElementById("print_content").style.display="block",this.printList=JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(this.printList)),this.$nextTick(function(){var e=document.getElementById("print_content").innerHTML;return document.body.innerHTML="<html><head><title>打印</title></head><body>"+e+"</body></html>",window.print(),window.location.reload(),!1})},printNew:function(e){var t=void 0;10184===e.id?(this.printDirection=0,t="<style>@page{size: 794px 1123px;}</style></body></html>"):10185===e.id?(this.printDirection=1,t="<style>@page{size: 794px 562px;}</style></body></html>"):10186===e.id&&(this.printDirection=2,t="<style>@page{size: 794px 475px;}</style></body></html>"),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><style>@page:right{@bottom-left {content: 'ces'}}</style></head><body>"+e+t,window.print(),window.location.reload(),!1})},getSummaries:function(e){for(var t=e.columns,a=e.data,o=0,i=0;i<a.length;i++)o+=a[i].deliveryCount;this.printTotal.deliveryCount=o;for(var r=[],s=0;s<a.length;s++)a[s].deliveryCountSupport&&a[s].sellUnitPrice&&a[s].deliveryCountSupport*a[s].sellUnitPrice;return t.forEach(function(e,t){if(0!==t)if(6===t||9===t||11===t)if(11!==t){var o=a.map(function(t){return Number(t[e.property])});o.every(function(e){return isNaN(e)})?r[t]="":r[t]=o.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0)}else{for(var i=0,s=0;s<a.length;s++)a[s].sellAmount&&(i+=Number(a[s].sellAmount));r[t]=i}else r[t]="";else r[t]="合计"}),r},openDetails:function(e){this.ChooseStockVisible=!0,console.log(e),this.materielId=e.row.materielId,this.currentIndex=e.$index},getStock:function(e){console.log(e),e&&(this.$set(this.model.childList[this.currentIndex],"btnName","已查询"),this.$set(this.model.childList[this.currentIndex],"stockId",e.id),this.$set(this.model.childList[this.currentIndex],"batch",e.batch),this.$set(this.model.childList[this.currentIndex],"facName",e.facilityName),this.$set(this.model.childList[this.currentIndex],"locationName",e.facilityLocationName),this.$set(this.model.childList[this.currentIndex],"availableCount",e.availableCount))},changeCount2:function(e){var t=e.row,a=e.$index;isNaN(t.convCoefficient)||isNaN(t.deliveryCountSupport)?t.deliveryCount=0:t.deliveryCount=parseFloat((parseFloat(t.convCoefficient)*parseFloat(t.deliveryCountSupport)).toFixed(t.quantityAccuracy)),t.sellAmount=this.sum1(t.deliveryCountSupport,t.sellUnitPrice,a),this.changeCount(t)},goToLink:function(e){this.$router.push({path:"/sales/salesContract_add",query:{id:e,t:Date.now()}})}})}},"7Di3":function(e,t){},jdvv:function(e,t,a){"use strict";var o=a("2QJe"),i=(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:Number,default:1}},data:function(){return{pageHeight:"",pageWidth:"",config:i.a}},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)},watch:{printList:{handler:function(e,t){Object(o.a)(e,this.printForm,this.printTotal,this.printDirection)},deep:!0}}},s={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.clientName))]),e._v(" "),a("div",{staticClass:"head2_item"},[e._v("送货日期:"+e._s(e.printDetail.noteTime))]),e._v(" "),a("div",{staticClass:"head2_item"},[e._v("单据编号:"+e._s(e.printDetail.outCode))])]):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.createByNamePrint))]),e._v(" "),a("el-col",{attrs:{span:7}},[e._v("日期:"+e._s(e.printDetail.createTimePrint))])],1)],1)])},staticRenderFns:[]},n=a("VU/8")(r,s,!1,null,null,null);t.a=n.exports},"l+N5":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a("+4uZ"),i={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(" "),0===e.auditStatus||2===e.auditStatus?a("el-button",{directives:[{name:"has",rawName:"v-has",value:"sales:deliveryNote:save",expression:"'sales:deliveryNote:save'"}],attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.save("form")}}},[e._v("暂存")]):e._e(),e._v(" "),0===e.auditStatus||2===e.auditStatus?a("el-button",{directives:[{name:"has",rawName:"v-has",value:"sales:salesStock:audit",expression:"'sales:salesStock:audit'"}],attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.submit("form")}}},[e._v("提交审批")]):e._e(),e._v(" "),e.isApprove?a("div",{staticClass:"audit-box",on:{click:e.auditOpen}},[e._v("审批")]):e._e(),e._v(" "),a("el-dropdown",{staticStyle:{"margin-left":"10px","margin-right":"10px"},on:{command:e.printNew}},[a("el-button",{attrs:{type:"primary"}},[e._v("\n 打印"),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.printTypeList,function(t,o){return a("el-dropdown-item",{key:o,attrs:{command:t}},[e._v(e._s(t.name)+"\n ")])}),1)],1)],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:"客户名称",prop:"clientName"}},[a("btn-input",{attrs:{valueText:e.formData.clientName,valueId:e.formData.clientId,chooseVisible:e.chooseClientVisible,showBtn:179!==e.auditStatus&&e.model.childList.length<=0},on:{"update:valueText":function(t){return e.$set(e.formData,"clientName",t)},"update:value-text":function(t){return e.$set(e.formData,"clientName",t)},"update:valueId":function(t){return e.$set(e.formData,"clientId",t)},"update:value-id":function(t){return e.$set(e.formData,"clientId",t)},"update:chooseVisible":function(t){e.chooseClientVisible=t},"update:choose-visible":function(t){e.chooseClientVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"销售员",prop:"salesUserName"}},[a("el-input",{attrs:{readonly:""},model:{value:e.formData.salesUserName,callback:function(t){e.$set(e.formData,"salesUserName",t)},expression:"formData.salesUserName"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"销售部门",prop:"deptName"}},[a("el-input",{attrs:{readonly:""},model:{value:e.formData.deptName,callback:function(t){e.$set(e.formData,"deptName",t)},expression:"formData.deptName"}})],1)],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"项目信息"}},[a("el-input",{attrs:{readonly:""},model:{value:e.formData.projectName,callback:function(t){e.$set(e.formData,"projectName",t)},expression:"formData.projectName"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"联系人"}},[a("el-input",{attrs:{disabled:179===e.auditStatus},model:{value:e.formData.linkName,callback:function(t){e.$set(e.formData,"linkName",t)},expression:"formData.linkName"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"联系电话"}},[a("el-input",{attrs:{disabled:179===e.auditStatus},model:{value:e.formData.linkPhone,callback:function(t){e.$set(e.formData,"linkPhone",t)},expression:"formData.linkPhone"}})],1)],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"收货地址"}},[a("el-input",{attrs:{disabled:179===e.auditStatus},model:{value:e.formData.harvestAddress,callback:function(t){e.$set(e.formData,"harvestAddress",t)},expression:"formData.harvestAddress"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"运输方式"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择",value:""},model:{value:e.formData.transportWay,callback:function(t){e.$set(e.formData,"transportWay",t)},expression:"formData.transportWay"}},e._l(e.transportOptions,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"物流单号"}},[a("el-input",{attrs:{disabled:179===e.auditStatus},model:{value:e.formData.trackingNumber,callback:function(t){e.$set(e.formData,"trackingNumber",t)},expression:"formData.trackingNumber"}})],1)],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"物流公司"}},[a("el-input",{attrs:{disabled:179===e.auditStatus},model:{value:e.formData.logisticsCompany,callback:function(t){e.$set(e.formData,"logisticsCompany",t)},expression:"formData.logisticsCompany"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"运输费用"}},[a("el-input-number",{staticStyle:{width:"100%"},attrs:{min:0,label:"描述文字",size:"small",disabled:179===e.auditStatus},model:{value:e.formData.transportCosts,callback:function(t){e.$set(e.formData,"transportCosts",t)},expression:"formData.transportCosts"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"通知时间",prop:"noteTime"}},[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.noteTime,callback:function(t){e.$set(e.formData,"noteTime",t)},expression:"formData.noteTime"}})],1)],1),e._v(" "),a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"通知单号",prop:"deliveryCode"}},[a("el-input",{attrs:{readonly:"",placeholder:"通知单号自动生成"},model:{value:e.formData.deliveryCode,callback:function(t){e.$set(e.formData,"deliveryCode",t)},expression:"formData.deliveryCode"}})],1)],1)]),e._v(" "),a("el-divider",{attrs:{"content-position":"left"}},[a("div",[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:e.ChooseImportShow}},[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("删除")]):e._e(),e._v(" "),179!==e.auditStatus?a("el-button",{attrs:{type:"primary",disabled:e.btnOtherDisabled},on:{click:e.copy}},[e._v("复制行")]):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:{align:"center",label:"库存查询"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-link",{attrs:{type:"primary"},on:{click:function(a){return a.stopPropagation(),e.openDetails(t)}}},[e._v(e._s(t.row.btnName))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"materielSerialNo",label:"物料代码",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"materielName",label:"物料名称",align:"center","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"specification",align:"center","show-overflow-tooltip":"",label:"规格型号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"unitUomName",align:"center","show-overflow-tooltip":"",label:"主计量单位"}}),e._v(" "),a("el-table-column",{attrs:{prop:"deliveryCount",align:"center",label:"主单位数量","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"supportUomName",align:"center",label:"辅助单位","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"convCoefficient",align:"center",label:"换算系数"}}),e._v(" "),a("el-table-column",{attrs:{prop:"deliveryCountSupport",align:"center",width:"180",label:"出库数量","label-class-name":"required_head"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{class:t.row.error_count?"error_count":"",attrs:{prop:"childList."+t.$index+".deliveryCount",rules:e.model.rules.deliveryCount}},[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)}},model:{value:t.row.deliveryCountSupport,callback:function(a){e.$set(t.row,"deliveryCountSupport",a)},expression:"scope.row.deliveryCountSupport"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"sellUnitPrice",align:"center",width:"180",label:"销售单价(元)","label-class-name":"required_head"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",width:"140",label:"销售金额(元)",prop:"sellAmount"}}),e._v(" "),a("el-table-column",{attrs:{prop:"batch",width:"120",align:"center",label:"批号","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"facName",width:"120",align:"center",label:"仓库","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"locationName",width:"120",align:"center",label:"仓位","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"thisSourceTypeName",align:"center",label:"源单类型",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.thisSourceTypeName?a("div",[e._v(e._s(t.row.thisSourceTypeName))]):a("div")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"code","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.queryId)}}},[e._v(e._s(t.row.code))])]}}])})],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),e._v(" "),a("el-form-item",{staticClass:"remarkstyle",attrs:{label:"附件"}},[e.showUpload?a("upload",{attrs:{title:"",label_width:"0",attachment:e.uploadAttachment},on:{"update:attachment":function(t){e.uploadAttachment=t}}}):e._e()],1),e._v(" "),e.progressList&&e.progressList.length?a("el-form-item",{attrs:{label:"审批流程"}},[a("DetailApproveFlow",{attrs:{tableList:e.progressList}})],1):e._e()],1),e._v(" "),e.deliveryNoteId?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.approveStateName))])],1):e._e()],1),e._v(" "),a("approDrawer",{attrs:{buttons:e.approveButtons,drawer:e.drawer,activities:e.approveFlow},on:{btnClick:e.btnClick}}),e._v(" "),a("DialogChooseSingleClientr",{attrs:{visible:e.chooseClientVisible,dataForm:e.formData},on:{"update:visible":function(t){e.chooseClientVisible=t},change:e.getClientr}}),e._v(" "),a("dialogChooseContract",{attrs:{visible:e.ChooseSalesOutStockVisible,clientName:e.formData.clientName,clientId:e.formData.clientId},on:{"update:visible":function(t){e.ChooseSalesOutStockVisible=t},change:e.getSalesOutStock}}),e._v(" "),a("dialogChooseSingleStock",{attrs:{visible:e.ChooseStockVisible,materielId:e.materielId},on:{"update:visible":function(t){e.ChooseStockVisible=t},change:e.getStock}}),e._v(" "),a("div",{staticStyle:{margin:"0 auto",display:"none"},attrs:{id:"print_content"}},[a("printDelivery",{attrs:{printDetail:e.printDetail,printList:e.printList,printForm:e.printForm,printTotal:e.printTotal,printDirection:e.printDirection}})],1)],1)},staticRenderFns:[]};var r=function(e){a("qijW"),a("7Di3")},s=a("VU/8")(o.a,i,!1,r,"data-v-14db78ba",null);t.default=s.exports},qijW:function(e,t){}});