WangHan
2025-04-03 a1b85ef72062ca80db35546e4216dd564f3e0f57
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-306c626c"],{"433d":function(t,e,r){"use strict";var n=r("c559"),o={ftpUrl:n["a"].ftpUrl,apiBaseURL:n["a"].apiBaseURL};e["a"]=o},"4bbc":function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return s}));var n=r("b775");function o(t){return Object(n["a"])({url:"/pc/l/wh/using/form/back/add",method:"post",data:t})}function a(t){return Object(n["a"])({url:"/pc/l/wh/using/form/back/list",method:"get",params:t})}function s(t){return Object(n["a"])({url:"/pc/l/wh/using/form/back/detail",method:"get",params:t})}},"6afd":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("win-md",{staticClass:"stock-edit",attrs:{title:"物品退回",width:"900px",loading:t.loading},on:{close:t.close}},[r("el-form",{ref:"ruleForm",staticClass:"form",attrs:{model:t.formData,rules:t.rules,"label-width":"120px"}},[r("div",{staticClass:"main-w"},[r("el-row",{staticClass:"headerHeight",attrs:{gutter:24}},[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"部门",prop:"departmentId"}},[r("el-select",{ref:"department",staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"请选择"},model:{value:t.formData.departmentId,callback:function(e){t.$set(t.formData,"departmentId",e)},expression:"formData.departmentId"}},t._l(t.departmentOptions,(function(t){return r("el-option",{key:t.id,attrs:{label:t.name,value:t.id,clearable:""}})})),1)],1)],1),t._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"退回人",prop:"operatorName"}},[r("el-input",{attrs:{disabled:""},model:{value:t.formData.operatorName,callback:function(e){t.$set(t.formData,"operatorName",e)},expression:"formData.operatorName"}})],1)],1),t._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"退回时间",prop:"dealTime"}},[r("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",value:"yyyy-MM-dd HH:mm:ss","value-format":"yyyyMMddHHmmss",placeholder:"请选择日期"},model:{value:t.formData.dealTime,callback:function(e){t.$set(t.formData,"dealTime",e)},expression:"formData.dealTime"}})],1)],1)],1),t._v(" "),r("el-row",{staticClass:"headerHeight",attrs:{gutter:24}},[r("el-col",{attrs:{span:24}},[r("el-form-item",{attrs:{label:"退回审批手续",prop:"procureDoc"}},[r("upload",{ref:"uploadRef",attrs:{settings:t.uploadSettings},on:{"on-change":t.uploadChange}})],1)],1)],1),t._v(" "),t._l(t.formData.goods,(function(e,n){return r("div",{key:n,staticClass:"goods-card"},[r("el-row",{attrs:{gutter:24}},[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"物品分类",prop:"goods."+n+".baseCategoryId",rules:{required:!0,message:"请选择物品分类",trigger:"change"}}},[r("el-cascader",{staticStyle:{width:"100%"},attrs:{options:t.categoryOptions,props:{value:"id",emitPath:!1},"show-all-levels":!1,filterable:"",clearable:""},on:{change:function(e){return t.categoryChange(e,n)}},model:{value:e.baseCategoryId,callback:function(r){t.$set(e,"baseCategoryId",r)},expression:"goodsItem.baseCategoryId"}})],1)],1),t._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"物品名称",prop:"goods."+n+".baseGoodsTemplateId",rules:t.rules.baseGoodsTemplateId}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.baseCategoryId?"请选择物品":"请先选择物品分类",filterable:"",clearable:"",disabled:!e.baseCategoryId},on:{change:function(e){return t.goodsTemplateChange(e,n)}},model:{value:e.baseGoodsTemplateId,callback:function(r){t.$set(e,"baseGoodsTemplateId",r)},expression:"goodsItem.baseGoodsTemplateId"}},t._l(e.goodsOptions,(function(t){return r("el-option",{key:t.id,attrs:{label:t.goodsName,value:t.id}})})),1)],1)],1),t._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"选择分发单",prop:"goods."+n+".businessFormCode",rules:t.rules.businessFormCode}},[r("div",{on:{click:function(e){return t.showFenFa(n)}}},[r("el-input",{staticClass:"cursor-p",attrs:{placeholder:"请选择分发单",readonly:"",placeholder:e.baseGoodsTemplateId?"请选择分发单":"请先选择物品",disabled:!e.baseGoodsTemplateId,"suffix-icon":"el-icon-arrow-down"},model:{value:e.businessFormCode,callback:function(r){t.$set(e,"businessFormCode",r)},expression:"goodsItem.businessFormCode"}})],1)])],1)],1),t._v(" "),t._l(e.models,(function(e,o){return r("div",{key:o,staticClass:"card3"},[r("el-row",{staticStyle:{height:"50px"},attrs:{gutter:24,type:"flex",align:"middle"}},[r("el-col",{attrs:{span:12}},[r("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{label:"规格型号:",prop:"baseGoodsModelsId"}},[t._v("\n                "+t._s(e[0].modelName)+"\n              ")])],1),t._v(" "),r("el-col",{attrs:{span:6}},[r("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{label:"单位:",prop:"baseGoodsModelsId","label-width":"80"}},[t._v("\n                "+t._s(e[0].unit)+"\n              ")])],1),t._v(" "),r("el-col",{attrs:{span:6}},[r("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{label:"物品类别:",prop:"baseGoodsModelsId","label-width":"80"}},[t._v("\n                "+t._s(e[0].classification)+"\n              ")])],1)],1),t._v(" "),r("el-table",{attrs:{data:e,stripe:!0}},[e[0].nowUserName?r("el-table-column",{attrs:{prop:"price",label:"使用人",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n                "+t._s(e.row.nowUserName)+"\n              ")]}}],null,!0)}):t._e(),t._v(" "),r("el-table-column",{attrs:{prop:"price",label:"分发数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n                "+t._s(e.row.goodsNum)+"\n              ")]}}],null,!0)}),t._v(" "),r("el-table-column",{attrs:{prop:"price",label:"可退数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n                "+t._s(e.row.userUseCount)+"\n              ")]}}],null,!0)}),t._v(" "),r("el-table-column",{attrs:{prop:"counts",label:"退回数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;e.$index;return[r("el-form-item",{attrs:{"label-width":"0",prop:"goods."+n+".models."+o+".counts",rules:[{validator:t.checkCounts,counts:a.counts,userUseCount:a.userUseCount,trigger:["blur","change"]}]}},[r("el-input",{attrs:{clearable:"",type:"number"},model:{value:a.counts,callback:function(e){t.$set(a,"counts",t._n(e))},expression:"row.counts"}})],1)]}}],null,!0)})],1)],1)})),t._v(" "),r("div",{staticClass:"btn-group"},[t.formData.goods.length>1?r("el-button",{attrs:{name:"移除",type:"danger",plain:"",size:"mini"},on:{click:function(e){return t.removeGoods(n)}}},[t._v("移除\n          ")]):t._e(),t._v(" "),t.formData.goods.length-1==n?r("el-button",{attrs:{name:"新增物品",type:"primary",plain:"",size:"mini"},on:{click:t.addGoods}},[t._v("新增物品\n          ")]):t._e()],1)],2)}))],2)]),t._v(" "),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer",align:"center"},slot:"footer"},[r("my-button",{attrs:{name:"取消",site:"form"},on:{click:t.close}}),t._v(" "),r("my-button",{attrs:{name:"保存",site:"form"},on:{click:t.handleSubmit}})],1),t._v(" "),t.fenfaSetting.show?r("win-md",{attrs:{title:"选择分发单",width:"800px"},on:{close:function(e){t.fenfaSetting.show=!1}}},[r("el-table",{attrs:{data:t.fenfaData,"highlight-current-row":"",height:"407"},on:{"current-change":t.handleCurrentChange}},[r("el-table-column",{attrs:{label:"分发单号",prop:"businessFormCode",align:"left"}}),t._v(" "),r("el-table-column",{attrs:{label:"物品名称",prop:"baseGoodsTemplateName",align:"left"}}),t._v(" "),r("el-table-column",{attrs:{label:"分发数量",prop:"totalCount",align:"center"}}),t._v(" "),r("el-table-column",{attrs:{label:"剩余数量",prop:"useCount",align:"center"}}),t._v(" "),r("el-table-column",{attrs:{label:"分发时间",prop:"inTime",width:"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[t._v("\n          "+t._s(t.DateFormatter.LongToDateTime(r.inTime))+"\n        ")]}}],null,!1,1576381030)})],1),t._v(" "),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer",align:"center"},slot:"footer"},[r("my-button",{attrs:{name:"取消",site:"form"},on:{click:function(e){t.fenfaSetting.show=!1,t.fenfaSetting.baseGoodsTemplateId=null,t.curFenfa=null,t.fenfaData=[]}}}),t._v(" "),r("el-button",{attrs:{type:"primary",size:"medium"},on:{click:t.handleConfirm}},[t._v("确定")])],1)],1):t._e()],1)},o=[],a=r("8eb74"),s=r("6ec5"),i=r("c56b"),u=r("f6e8"),c=r("f76d"),l=r("e694"),d=r("decf"),f=r("dee4"),p=r("2f62"),m=r("6f7e"),g=r("6f82"),h=r("4bbc");function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function y(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */y=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,s=Object.create(a.prototype),i=new L(n||[]);return o(s,"_invoke",{value:T(t,r,i)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",p="suspendedYield",m="executing",g="completed",h={};function v(){}function w(){}function O(){}var I={};c(I,s,(function(){return this}));var D=Object.getPrototypeOf,S=D&&D(D(E([])));S&&S!==r&&n.call(S,s)&&(I=S);var _=O.prototype=v.prototype=Object.create(I);function j(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,a,s,i){var u=d(t[o],t,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==b(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,s,i)}),(function(t){r("throw",t,s,i)})):e.resolve(l).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,i)}))}i(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function T(e,r,n){var o=f;return function(a,s){if(o===m)throw Error("Generator is already running");if(o===g){if("throw"===a)throw s;return{value:t,done:!0}}for(n.method=a,n.arg=s;;){var i=n.delegate;if(i){var u=C(i,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=d(e,r,n);if("normal"===c.type){if(o=n.done?g:p,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var a=d(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,h;var s=a.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function G(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(b(e)+" is not iterable")}return w.prototype=O,o(_,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:w,configurable:!0}),w.displayName=c(O,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,c(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},j(x.prototype),c(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var s=new x(l(t,r,n,o),a);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},j(_),c(_,u,"Generator"),c(_,s,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(G),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return i.type="throw",i.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],i=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=t,s.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;G(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}function v(t,e,r,n,o,a,s){try{var i=t[a](s),u=i.value}catch(t){return void r(t)}i.done?e(u):Promise.resolve(u).then(n,o)}function w(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function s(t){v(a,n,o,s,i,"next",t)}function i(t){v(a,n,o,s,i,"throw",t)}s(void 0)}))}}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){D(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e,r){return(e=S(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S(t){var e=_(t,"string");return"symbol"==b(e)?e:e+""}function _(t,e){if("object"!=b(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var j={components:{MyButton:u["a"],winMd:c["a"],winSm:l["a"],upload:d["a"]},props:{setting:{type:Object,default:function(){}}},data:function(){return{checkCounts:function(t,e,r){return t.counts?Number.isInteger(t.counts)?t.counts<1?r(new Error("数字值必须大于0")):t.counts>t.userUseCount?r(new Error("退回数量不能大于在用数量")):void r():r(new Error("请输入数字值")):r(new Error("请输入退回数量"))},DateFormatter:m,loading:!0,departmentOptions:[],categoryOptions:[],modelList:[],fenfaSetting:{show:!1,goodsIdx:null,baseGoodsTemplateId:null,id:""},curFenfa:null,fenfaData:[],formData:{departmentId:"",dealTime:m["formatDate"](new Date,"yyyyMMddhhmmss"),procureDoc:"",goods:[]},goodsItem:{businessFormCode:"",transBusinessId:"",baseCategoryId:"",baseGoodsTemplateId:"",goodsTemplateName:"",goodsOptions:[],models:[]},modelsItem:{baseGoodsModelsId:"",worehouseCount:0,counts:null,unit:null},rules:{departmentId:[{required:!0,message:"请选择部门",trigger:"change"}],dealTime:[{required:!0,message:"请选择",trigger:"change"}],procureDoc:[{required:!0,message:"请上传",trigger:"change"}],baseCategoryId:[{required:!0,message:"请选择",trigger:"change"}],baseGoodsTemplateId:[{required:!0,message:"请选择物品",trigger:"change"}],businessFormCode:[{required:!0,message:"请选择分发单",trigger:"change"}],counts:[{required:!0,message:"请输入",trigger:"change"}],reason:[{required:!0,message:"请选择",trigger:"change"}]},uploadSettings:{title:"上传",max:20,num:10,tip:"",uploadUrl:Object(f["d"])(),multiple:!0,disabled:!1}}},computed:I({},Object(p["b"])(["userInfo"])),created:function(){this.init()},methods:{init:function(){var t=w(y().mark((function t(){var e;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.getdeptmentList();case 2:return t.next=4,Object(i["b"])();case 4:e=t.sent,this.categoryOptions=this.removeEmptyChildren(e),this.getgoodsTemplate(),this.formData.departmentId=this.userInfo.sysDeptId,this.formData.operatorName=this.userInfo.userName,this.loading=!1;case 10:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),getdeptmentList:function(){var t=w(y().mark((function t(){var e=this;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(a["d"])({tenantId:this.userInfo.tenantId}).then((function(t){e.departmentOptions=t,e.formData.goods.push(JSON.parse(JSON.stringify(e.goodsItem)))})).catch((function(t){console.log("err",t)}));case 2:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),removeEmptyChildren:function(t){var e=this;return t.forEach((function(t){t.children&&t.children.length?e.removeEmptyChildren(t.children):delete t.children})),t},getgoodsTemplate:function(t,e){var r=this;Object(s["n"])({categoryId:t||""}).then((function(t){e||0==e?r.$set(r.formData.goods[e],"goodsOptions",t):r.goodsTemplatelAll=t}))},getGoodsTemplateName:function(t){var e=this.goodsTemplatelAll.find((function(e){return e.id==t}));if(e)return e.goodsName},getGoodsModelsName:function(t){var e=this.goodsModelAll.find((function(e){return e.id==t}));if(e)return e.modelName},categoryChange:function(t,e){this.formData.goods[e].goodsOptions=[],this.formData.goods[e].baseGoodsTemplateId="",this.formData.goods[e].goodsTemplateName="",this.formData.goods[e].models=[],this.getgoodsTemplate(t,e)},goodsTemplateChange:function(t,e){this.formData.goods[e].models=[],this.formData.goods[e].businessFormCode="",this.formData.goods[e].goodsTemplateName=this.getGoodsTemplateName(t)},showFenFa:function(t){var e=this;this.loading=!0,Object(g["a"])({departmentId:this.formData.departmentId,baseGoodsTemplateId:this.formData.goods[t].baseGoodsTemplateId}).then((function(r){e.loading=!1,r&&0!==r.length?(e.fenfaSetting.show=!0,e.fenfaSetting.baseGoodsTemplateId=e.formData.goods[t].baseGoodsTemplateId,e.fenfaSetting.goodsIdx=t,e.fenfaData=r):e.$message.error("未查询到需要退回的分发单")})).catch((function(t){e.loading=!1}))},uploadChange:function(){var t=this.$refs.uploadRef.fileList;this.formData.procureDoc=JSON.stringify(t)},addGoods:function(){this.formData.goods.push(JSON.parse(JSON.stringify(this.goodsItem)))},removeGoods:function(t){this.formData.goods.splice(t,1)},handleCurrentChange:function(t){this.curFenfa=t},handleConfirm:function(){var t=this;if(this.curFenfa){var e=this.formData.goods.findIndex((function(e){return e.businessFormCode==t.curFenfa.businessFormCode})),r=this.formData.goods.findIndex((function(e){return e.baseGoodsTemplateId==t.fenfaSetting.baseGoodsTemplateId}));-1===r||r===this.fenfaSetting.goodsIdx||-1===e||e===this.fenfaSetting.goodsIdx?Object(g["b"])({transBusinessId:this.curFenfa.transBusinessId,baseGoodsTemplateId:this.fenfaSetting.baseGoodsTemplateId}).then((function(e){if(e){var r=[];for(var n in e){var o=e[n];o.map((function(t){t.counts=null})),r.push(o)}t.formData.goods[t.fenfaSetting.goodsIdx].models=r,t.formData.goods[t.fenfaSetting.goodsIdx].businessFormCode=t.curFenfa.businessFormCode,t.formData.goods[t.fenfaSetting.goodsIdx].transBusinessId=t.curFenfa.transBusinessId}t.fenfaSetting.show=!1})):this.$message.error("同一个物品不能选择相同的分发单")}else this.$message.error("请选择分发单")},handleSubmit:function(){var t=this;this.$refs["ruleForm"].validate((function(e){if(e){var r=JSON.parse(JSON.stringify(t.formData));if(r.goods.map((function(t){delete t.goodsOptions;var e=[];t.models.map((function(t){t.map((function(t){t.counts&&t.counts>0&&e.push(t)}))})),t.models=e})),r.goods=r.goods.filter((function(t){return t.models.length>0})),0===r.goods.length)return void t.$message.error("请至少填写一个退回物品");if(t.loading)return;t.loading=!0,Object(h["a"])(r).then((function(e){t.loading=!1,t.$message.success("保存成功!"),t.close(),t.$emit("search")})).catch((function(e){t.loading=!1,t.$message.error("保存失败")}))}else t.$message.error("校验未通过,请检查。")}))},close:function(){this.formData={warehouseId:"",dealTime:"",goods:[]},this.$emit("close")}}},x=j,T=(r("ee78"),r("2877")),C=Object(T["a"])(x,n,o,!1,null,"30eed26a",null);e["default"]=C.exports},"6ec5":function(t,e,r){"use strict";r.d(e,"l",(function(){return a})),r.d(e,"a",(function(){return s})),r.d(e,"g",(function(){return i})),r.d(e,"c",(function(){return u})),r.d(e,"j",(function(){return c})),r.d(e,"f",(function(){return l})),r.d(e,"d",(function(){return d})),r.d(e,"e",(function(){return f})),r.d(e,"p",(function(){return p})),r.d(e,"n",(function(){return m})),r.d(e,"m",(function(){return g})),r.d(e,"k",(function(){return h})),r.d(e,"s",(function(){return b})),r.d(e,"r",(function(){return y})),r.d(e,"q",(function(){return v})),r.d(e,"o",(function(){return w})),r.d(e,"b",(function(){return O})),r.d(e,"i",(function(){return I})),r.d(e,"h",(function(){return D}));var n=r("b775"),o=r("433d");function a(t){return n["a"].get(o["a"].apiBaseURL+"/pc/fin/sys/tenant/select/tree_fin_tenant",{params:t})}function s(t){return Object(n["a"])({url:"/pc/base/category/add",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/pc/base/category/edit",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/pc/base/warehouse/add",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/pc/base/warehouse/edit",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/pc/base/warehouse/del",method:"delete",data:t})}function d(){return Object(n["a"])({url:"/pc/base/goods/template/select/classificationCode",method:"get"})}function f(t){return Object(n["a"])({url:"/pc/base/category/del",method:"delete",data:t})}function p(t){return Object(n["a"])({url:"/pc/base/warehouse/select/tenant_warehouse",method:"get",params:t})}function m(t){return Object(n["a"])({url:"/pc/base/goods/template/query/goodsTemplate",method:"get",params:t})}function g(t){return Object(n["a"])({url:"/pc/base/goods/models/query/goodsModel",method:"get",params:t})}function h(t){return n["a"].get(o["a"].apiBaseURL+"/pc/base/category/select/tree",{params:t})}function b(t){return Object(n["a"])({url:"/pc/base/warehouse/select/number",method:"get",params:t})}function y(t){return Object(n["a"])({url:"/pc/base/warehouse/select/in/warehouse/num",method:"get",params:t})}function v(t){return Object(n["a"])({url:"/pc/fin/sys/tenant/user/query/user",method:"get",params:t})}function w(t){return Object(n["a"])({url:"/pc/base/goods/models/queryGoodsModelInfo",method:"get",params:t})}function O(t){return Object(n["a"])({url:"/pc/fin/sys/tenant/add",method:"post",data:t})}function I(t){return Object(n["a"])({url:"/pc/fin/sys/tenant/edit",method:"post",data:t})}function D(t){return Object(n["a"])({url:"/pc/fin/sys/tenant/editState",method:"post",data:t})}},"6f7e":function(t,e,r){"use strict";function n(t){if(null==t||void 0==t||""==t||"null"==t||"undefined"==t)return!0;var e=t.toString().replace(/\s/g,"").replace(/-/g,"").replace(/:/g,"");return e}function o(t){return("00"+t).substr(t.length)}function a(t){if(null==t||void 0==t||""==t||"null"==t||"undefined"==t)return!0;var e=t.toString(),r=e.slice(0,4),n=e.slice(4,6),o=e.slice(6,8),a=e.slice(8,10),s=e.slice(10,12),i=e.slice(12,14),u=r+"-"+n+"-"+o+" "+a+":"+s+":"+i;return u}function s(t){if(null==t||void 0==t||""==t||"null"==t||"undefined"==t)return!0;var e=t.toString(),r=e.slice(0,4),n=e.slice(4,6),o=e.slice(6,8),a=r+"-"+n+"-"+o;return a}function i(t,e){try{t instanceof Date||(t=new Date(t)),void 0!=e&&""!=e||(e="yyyy-MM-dd hh:mm:ss"),/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));var r={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds()};for(var n in r)if(new RegExp("(".concat(n,")")).test(e)){var a=r[n]+"";e=e.replace(RegExp.$1,1===RegExp.$1.length?a:o(a))}return e}catch(s){return"-"}}function u(){var t=new Date,e=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),n=t.getDate().toString().padStart(2,"0"),o=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0"),s=t.getSeconds().toString().padStart(2,"0");return"".concat(e,"-").concat(r,"-").concat(n," ").concat(o,":").concat(a,":").concat(s)}function c(){var t=new Date,e=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),n=t.getDate().toString().padStart(2,"0");return"".concat(e,"-").concat(r,"-").concat(n)}function l(t){if(t){t instanceof Date||(t=new Date(t.replace(/-/g,"/")));var e=t.getTime(),r=6e4,n=60*r,o=24*n,a=7*o,s=30*o,i=(new Date).getTime(),u=i-e;if(!(u<0)){var c=u/r,l=u/n,d=u/o,f=u/a,p=u/s,m="";if(p>=1&&p<=3)m=" "+parseInt(p)+"月前";else if(f>=1&&f<=3)m=" "+parseInt(f)+"周前";else if(d>=1&&d<=6)m=" "+parseInt(d)+"天前";else if(l>=1&&l<=23)m=" "+parseInt(l)+"小时前";else if(c>=1&&c<=59)m=" "+parseInt(c)+"分钟前";else if(u>=0&&u<=r)m="刚刚";else{var g=new Date;g.setTime(e);var h=g.getFullYear(),b=g.getMonth()+1<10?"0"+(g.getMonth()+1):g.getMonth()+1,y=g.getDate()<10?"0"+g.getDate():g.getDate();g.getHours()<10?g.getHours():g.getHours(),g.getMinutes()<10?g.getMinutes():g.getMinutes(),g.getSeconds()<10?g.getSeconds():g.getSeconds();m=h+"-"+b+"-"+y}return m}}}r.r(e),r.d(e,"DateToLong",(function(){return n})),r.d(e,"LongToDateTime",(function(){return a})),r.d(e,"LongToDate",(function(){return s})),r.d(e,"formatDate",(function(){return i})),r.d(e,"formattedDate",(function(){return u})),r.d(e,"formattedDateDuan",(function(){return c})),r.d(e,"timeago",(function(){return l}))},"6f82":function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return s})),r.d(e,"e",(function(){return i})),r.d(e,"d",(function(){return u}));var n=r("b775");function o(t){return Object(n["a"])({url:"/pc/warehouse/procureModel/getFfOrderByGoodsIdAndDept",method:"get",params:t})}function a(t){return Object(n["a"])({url:"/pc/warehouse/procureModel/getGoodsUseInfoByFfOrderAndGoodId",method:"get",params:t})}function s(t){return Object(n["a"])({url:"/pc/l/wh/form/scrapped/deptAdd",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/pc/l/wh/form/scrapped/deptList",method:"get",params:t})}function u(t){return Object(n["a"])({url:"/pc/l/wh/form/scrapped/deptDetail",method:"get",params:t})}},"8eb74":function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return s})),r.d(e,"d",(function(){return i}));var n=r("b775");function o(t){return Object(n["a"])({url:"/pc/fin/sys/tenant/department/add",method:"post",data:t})}function a(t){return Object(n["a"])({url:"/pc/fin/sys/tenant/department/edit",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/pc/fin/sys/tenant/department/detail",method:"get",params:t})}function i(t){return Object(n["a"])({url:"/pc/fin/sys/tenant/department/list/all",method:"get",params:t})}},ba51:function(t,e,r){},c56b:function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return s}));var n=r("b775"),o=r("433d");function a(t){return n["a"].get(o["a"].apiBaseURL+"/pc/base/category/select/tree",{params:t})}function s(t){return Object(n["a"])({url:"/pc/base/category/detail",method:"get",params:t})}},ee78:function(t,e,r){"use strict";r("ba51")}}]);