WangHan
2025-04-03 a1b85ef72062ca80db35546e4216dd564f3e0f57
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5a0a1983","chunk-106818c5","chunk-22a71f38","chunk-4b0d1d89","chunk-92e5b0d0","chunk-2d0e66d0","chunk-2d0dd7e4"],{"0e548":function(t,e,n){"use strict";n("7025")},"271c":function(t,e,n){"use strict";n.r(e);var r=n("6f7e"),o=n("2f62"),a=n("ac29"),i=n("dee4");function s(t){return s="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},s(t)}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return(e=d(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d(t){var e=f(t,"string");return"symbol"==s(e)?e:e+""}function f(t,e){if("object"!=s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}e["default"]={data:function(){return{loading:!1,list:[],items:[],filterFrom:{},editSetting:{title:"",id:"",orgId:"",show:!1},uploadPageSetting:{title:"上传页面",id:"",orgId:"",show:!1},detailSetting:{title:"详情",id:"",show:!1},pageNum:1,pageSize:10,total:0}},computed:c(c({},Object(o["b"])(["userInfo"])),{},{clientHeight:function(){return document.documentElement.clientHeight}}),created:function(){},filters:{formatTime:function(t){return t?r["LongToDateTime"](t):"-"}},methods:{handleExport:function(t,e,n){var r=this,o=this.$loading({lock:!0,text:"导出中,请稍候...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});a[t](n).then((function(t){console.log(t),Object(i["a"])(t),r.$message.success("导出成功!"),o.close()})).catch((function(){o.close()}))},handleAdd:function(){this.editSetting.id=null,this.editSetting.info=null,this.editSetting.title="新增",this.editSetting.show=!0},handleEdit:function(t){this.editSetting.id=t.id,this.editSetting.info=null,this.editSetting.title="编辑",this.editSetting.show=!0},handleDetail:function(t){this.detailSetting.id=t.id,this.detailSetting.title="详情",this.detailSetting.show=!0},handleUploadPage:function(t){this.uploadPageSetting.id=t.id,this.uploadPageSetting.title="导入",this.uploadPageSetting.show=!0},handleSizeChange:function(t){this.pageSize=t,this.search({pageNum:1})},handleCurrentChange:function(t){this.pageNum=t,this.search()},search:function(t){t&&(this.pageNum=t),this.fetchData()},refreshData:function(){this.pageNum=1,this.pageSize=10,this.search()},fifterForm:function(t){this.filterFrom=Object.assign(this.filterFrom,t),this.search(1)}}}},2808:function(t,e,n){"use strict";n("84d8")},"31eb":function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("win-md",{staticClass:"stock-detail",attrs:{title:t.setting.title,width:"800px",loading:t.loading},on:{close:t.close}},[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:8}},[n("span",[t._v("调拨单号:")]),t._v(" "),n("span",[t._v(t._s(t.detail.businessFormCode))])]),t._v(" "),n("el-col",{attrs:{span:8}},[n("span",[t._v("调拨机构:")]),t._v(" "),n("span",[t._v(t._s(t.detail.outAgencyName))])]),t._v(" "),n("el-col",{attrs:{span:8}},[n("span",[t._v("接收机构:")]),t._v(" "),n("span",[t._v(t._s(t.detail.inAgencyName))])])],1),t._v(" "),n("el-row",{staticStyle:{"margin-top":"20px"},attrs:{gutter:20}},[n("el-col",{attrs:{span:8}},[n("span",[t._v("申请调拨时间:")]),t._v(" "),n("span",[t._v(t._s(t._f("formatTime")(t.detail.createTime)))])]),t._v(" "),n("el-col",{attrs:{span:8}},[n("span",[t._v("状态:")]),t._v(" "),n("span",[t._v(t._s(t.getStatesLabel(t.detail.states)))])]),t._v(" "),n("el-col",{attrs:{span:8}},[n("span",[t._v("调拨时间:")]),t._v(" "),n("span",[t._v(t._s(t._f("formatTime")(t.detail.outputTime)))])])],1),t._v(" "),t.fileList&&t.fileList.length?n("el-row",{staticStyle:{"margin-top":"20px"},attrs:{gutter:20}},[n("el-col",{staticClass:"img-row",attrs:{span:24}},[n("span",[t._v("调拨手续照片:")]),t._v(" "),t._l(t.fileList,(function(e,r){return n("div",{key:r,staticClass:"img-box",on:{click:function(n){return t.handlePreview(e)}}},[n("img",{staticClass:"img",attrs:{src:t.getUrl(e.path),alt:""}})])}))],2)],1):t._e(),t._v(" "),t._l(t.detail.formTransferGoods,(function(e,r){return n("div",{key:r,staticClass:"goods-card"},[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("span",[t._v("物品分类:")]),t._v(" "),n("span",[t._v(t._s(e.categoryName))])]),t._v(" "),n("el-col",{attrs:{span:12}},[n("span",[t._v("物品名称:")]),t._v(" "),n("span",[t._v(t._s(e.goodsName))])])],1),t._v(" "),n("el-table",{staticStyle:{"margin-top":"20px"},attrs:{data:e.models,stripe:!0}},[n("el-table-column",{attrs:{prop:"baseGoodsModelsName",label:"规格型号",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n          "+t._s(e.row.baseGoodsModelsName)+"\n        ")]}}],null,!0)}),t._v(" "),n("el-table-column",{attrs:{label:"单位",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n          "+t._s(e.row.unit)+"\n        ")]}}],null,!0)}),t._v(" "),n("el-table-column",{attrs:{prop:"counts",label:"调拨数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n          "+t._s(e.row.counts)+"\n        ")]}}],null,!0)}),t._v(" "),n("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.totalAmount)+"\n        ")]}}],null,!0)})],1)],1)})),t._v(" "),n("div",{staticStyle:{display:"none"},attrs:{id:"uploadPreviewImages"}},t._l(t.fileList,(function(e,r){return n("span",{key:r},[t.checkImg(e.name)?n("img",{staticClass:"v-img",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.getUrl(e.path),alt:e.name}}):t._e()])})),0)],2)},o=[],a=n("a083"),i=n("6f7e"),s=n("f76d"),l=n("822f"),c=n("dee4"),u=n("c82c"),d=n.n(u),f=(n("0808"),null),p={mixins:[l["default"]],components:{winMd:s["a"]},props:{setting:{type:Object,default:function(){}}},data:function(){return{loading:!0,detail:{},fileList:[]}},filters:{formatTime:function(t){return t?i["LongToDateTime"](t):"-"}},created:function(){var t=this;Object(a["e"])({id:this.setting.id}).then((function(e){t.detail=e,t.fileList=t.detail.procureDoc?JSON.parse(t.detail.procureDoc):[],t.loading=!1,t.$nextTick((function(){t.initPreviewImg()}))}))},methods:{initPreviewImg:function(){null!=f&&f.destroy();var t=document.querySelector("#uploadPreviewImages");f=new d.a(t,{})},handlePreview:function(t){if(!this.checkImg(t.name))return!1;for(var e=0,n=0;n<this.fileList.length;n++){var r=this.fileList[n];if(this.checkImg(r.name)){if(t.id==r.id)break;e++}}f.view(e)},checkImg:function(t){var e=t.substring(t.lastIndexOf("."),t.length),n=[".jpg",".jpeg",".png",".bmp"];return!(n.indexOf(e)<0)},getUrl:function(t){return"http://"==t.substr(0,7).toLowerCase()||"https://"==t.substr(0,8).toLowerCase()?t:Object(c["c"])()+t},close:function(){this.$emit("close")}}},m=p,g=(n("0e548"),n("2877")),h=Object(g["a"])(m,r,o,!1,null,"4e5be1fc",null);e["default"]=h.exports},4200:function(t,e,n){},"433d":function(t,e,n){"use strict";var r=n("c559"),o={ftpUrl:r["a"].ftpUrl,apiBaseURL:r["a"].apiBaseURL};e["a"]=o},"4f6e":function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("win-md",{staticClass:"stock-detail",attrs:{title:"上传调拨手续",width:"800px",loading:t.loading},on:{close:t.close}},[n("upload",{ref:"uploadRef",attrs:{values:t.fileList,settings:t.uploadSettings},on:{"on-change":t.uploadChange}}),t._v(" "),n("el-button",{staticStyle:{float:"right","margin-right":"50px","margin-top":"20px"},attrs:{name:"上传调拨手续",site:"form",type:"primary",size:"mini"},on:{click:function(e){return t.allocationProcedures()}}},[t._v("\n    上传调拨手续\n  ")])],1)},o=[],a=n("f76d"),i=n("6f7e"),s=n("dee4"),l=n("c82c"),c=n.n(l),u=(n("0808"),n("dcec")),d=n("decf"),f=n("a083"),p=null,m={computed:{de:function(){return u["a"]}},components:{winMd:a["a"],upload:d["a"]},props:{setting:{type:Object,default:function(){}}},data:function(){return{procureDoc:"",uploadSettings:{title:"上传",max:20,num:2,tip:"",uploadUrl:Object(s["d"])(),multiple:!0,disabled:!1},loading:!0,fileList:[],detail:{baseCategoryName:"",businessFormCode:"",goodsTemplateName:"",procureDoc:"",agencyId:"",agencyName:"",states:"",createName:"",time:"",procureGoods:[{},{}],fileKey:Math.random()}}},filters:{formatTime:function(t){return t?i["LongToDateTime"](t):"-"},formatPrice:function(t){return t/100}},created:function(){this.loading=!1,this.fileList=[]},methods:{initPreviewImg:function(){null!=p&&p.destroy();var t=document.querySelector("#uploadPreviewImages");p=new c.a(t,{})},handlePreview:function(t){if(!this.checkImg(t.name))return!1;for(var e=0,n=0;n<this.fileList.length;n++){var r=this.fileList[n];if(this.checkImg(r.name)){if(t.id==r.id)break;e++}}p.view(e)},checkImg:function(t){var e=t.substring(t.lastIndexOf("."),t.length),n=[".jpg",".jpeg",".png",".bmp"];return!(n.indexOf(e)<0)},getUrl:function(t){return"http://"==t.substr(0,7).toLowerCase()||"https://"==t.substr(0,8).toLowerCase()?t:Object(s["c"])()+t},close:function(){this.$emit("close")},uploadChange:function(){var t=this.$refs.uploadRef.fileList,e=JSON.stringify(t);console.log(e),this.procureDoc=e;var n=this.setting.id;console.log(n)},allocationProcedures:function(){var t=this,e=this.setting.id,n=this.procureDoc;null!=e&&""!==n?Object(f["f"])({idStr:e,procureDoc:n,type:"0"}).then((function(e){t.loading=!1,t.$message.success("保存成功!"),t.close(),t.$emit("search")})).catch((function(e){t.loading=!1,console.log("edit err",e),t.$message.error("保存失败")})):this.$message.error("请上传图片!")}}},g=m,h=(n("2808"),n("2877")),v=Object(h["a"])(g,r,o,!1,null,"1bcecb62",null);e["default"]=v.exports},5234:function(t,e,n){"use strict";n("e2f2")},"6ec5":function(t,e,n){"use strict";n.d(e,"l",(function(){return a})),n.d(e,"a",(function(){return i})),n.d(e,"g",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"j",(function(){return c})),n.d(e,"f",(function(){return u})),n.d(e,"d",(function(){return d})),n.d(e,"e",(function(){return f})),n.d(e,"p",(function(){return p})),n.d(e,"n",(function(){return m})),n.d(e,"m",(function(){return g})),n.d(e,"k",(function(){return h})),n.d(e,"s",(function(){return v})),n.d(e,"r",(function(){return b})),n.d(e,"q",(function(){return y})),n.d(e,"o",(function(){return w})),n.d(e,"b",(function(){return _})),n.d(e,"i",(function(){return S})),n.d(e,"h",(function(){return O}));var r=n("b775"),o=n("433d");function a(t){return r["a"].get(o["a"].apiBaseURL+"/pc/fin/sys/tenant/select/tree_fin_tenant",{params:t})}function i(t){return Object(r["a"])({url:"/pc/base/category/add",method:"post",data:t})}function s(t){return Object(r["a"])({url:"/pc/base/category/edit",method:"post",data:t})}function l(t){return Object(r["a"])({url:"/pc/base/warehouse/add",method:"post",data:t})}function c(t){return Object(r["a"])({url:"/pc/base/warehouse/edit",method:"post",data:t})}function u(t){return Object(r["a"])({url:"/pc/base/warehouse/del",method:"delete",data:t})}function d(){return Object(r["a"])({url:"/pc/base/goods/template/select/classificationCode",method:"get"})}function f(t){return Object(r["a"])({url:"/pc/base/category/del",method:"delete",data:t})}function p(t){return Object(r["a"])({url:"/pc/base/warehouse/select/tenant_warehouse",method:"get",params:t})}function m(t){return Object(r["a"])({url:"/pc/base/goods/template/query/goodsTemplate",method:"get",params:t})}function g(t){return Object(r["a"])({url:"/pc/base/goods/models/query/goodsModel",method:"get",params:t})}function h(t){return r["a"].get(o["a"].apiBaseURL+"/pc/base/category/select/tree",{params:t})}function v(t){return Object(r["a"])({url:"/pc/base/warehouse/select/number",method:"get",params:t})}function b(t){return Object(r["a"])({url:"/pc/base/warehouse/select/in/warehouse/num",method:"get",params:t})}function y(t){return Object(r["a"])({url:"/pc/fin/sys/tenant/user/query/user",method:"get",params:t})}function w(t){return Object(r["a"])({url:"/pc/base/goods/models/queryGoodsModelInfo",method:"get",params:t})}function _(t){return Object(r["a"])({url:"/pc/fin/sys/tenant/add",method:"post",data:t})}function S(t){return Object(r["a"])({url:"/pc/fin/sys/tenant/edit",method:"post",data:t})}function O(t){return Object(r["a"])({url:"/pc/fin/sys/tenant/editState",method:"post",data:t})}},"6f7e":function(t,e,n){"use strict";function r(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(),n=e.slice(0,4),r=e.slice(4,6),o=e.slice(6,8),a=e.slice(8,10),i=e.slice(10,12),s=e.slice(12,14),l=n+"-"+r+"-"+o+" "+a+":"+i+":"+s;return l}function i(t){if(null==t||void 0==t||""==t||"null"==t||"undefined"==t)return!0;var e=t.toString(),n=e.slice(0,4),r=e.slice(4,6),o=e.slice(6,8),a=n+"-"+r+"-"+o;return a}function s(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 n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds()};for(var r in n)if(new RegExp("(".concat(r,")")).test(e)){var a=n[r]+"";e=e.replace(RegExp.$1,1===RegExp.$1.length?a:o(a))}return e}catch(i){return"-"}}function l(){var t=new Date,e=t.getFullYear(),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0"),o=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0"),i=t.getSeconds().toString().padStart(2,"0");return"".concat(e,"-").concat(n,"-").concat(r," ").concat(o,":").concat(a,":").concat(i)}function c(){var t=new Date,e=t.getFullYear(),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0");return"".concat(e,"-").concat(n,"-").concat(r)}function u(t){if(t){t instanceof Date||(t=new Date(t.replace(/-/g,"/")));var e=t.getTime(),n=6e4,r=60*n,o=24*r,a=7*o,i=30*o,s=(new Date).getTime(),l=s-e;if(!(l<0)){var c=l/n,u=l/r,d=l/o,f=l/a,p=l/i,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(u>=1&&u<=23)m=" "+parseInt(u)+"小时前";else if(c>=1&&c<=59)m=" "+parseInt(c)+"分钟前";else if(l>=0&&l<=n)m="刚刚";else{var g=new Date;g.setTime(e);var h=g.getFullYear(),v=g.getMonth()+1<10?"0"+(g.getMonth()+1):g.getMonth()+1,b=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+"-"+v+"-"+b}return m}}}n.r(e),n.d(e,"DateToLong",(function(){return r})),n.d(e,"LongToDateTime",(function(){return a})),n.d(e,"LongToDate",(function(){return i})),n.d(e,"formatDate",(function(){return s})),n.d(e,"formattedDate",(function(){return l})),n.d(e,"formattedDateDuan",(function(){return c})),n.d(e,"timeago",(function(){return u}))},7025:function(t,e,n){},"822f":function(t,e,n){"use strict";n.r(e),e["default"]={data:function(){return{statesOptions:[{label:"全部",value:""},{label:"待出库",value:"0"},{label:"待接收",value:"1"},{label:"已接收",value:"2"},{label:"已撤销",value:"4"}]}},methods:{getStatesLabel:function(t){var e=this.statesOptions.find((function(e){return e.value==t}));return e?e.label:""}}}},"84d8":function(t,e,n){},9960:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.dialogShow?n("el-dialog",{attrs:{width:"40%",center:!0,"close-on-click-modal":!1,"close-on-press-escape":!1,title:t.dialogTitle,"before-close":t.beforeClose,modal:t.modal,visible:t.dialogShow}},[n("el-row",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{"element-loading-text":"数据导入中"}},[n("el-col",{attrs:{span:24}},[n("el-form",[null!=t.templateSettings.templateUrl?n("el-form-item",{attrs:{label:"下载模板:",prop:"lon"}},[n("a",{staticClass:"blue-txt",staticStyle:{color:"#409EFF"},attrs:{href:t.templateSettings.templateUrl,target:"_blank",rel:"noreferrer noopener"}},[t._v(t._s(t.templateSettings.templateName))])]):t._e(),t._v(" "),n("el-form-item",{attrs:{label:"选取文件:",prop:"lon"}},[n("el-upload",{ref:t.fileSettings.ref,staticClass:"upload-demo",attrs:{headers:t.headers,name:"file",data:t.fileSettings.data,action:t.fileSettings.uploadUrl,"before-upload":t.beforeAvatarUpload,"on-success":t.handleUploadSuccess,"on-change":t.file,multiple:t.fileSettings.multiple,limit:t.fileSettings.num,accept:t.fileSettings.accept,"auto-upload":t.fileSettings.autoUpload}},[n("el-button",{attrs:{size:"small",type:"primary"}},[t._v(t._s(t.fileSettings.title))]),t._v(" "),n("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("只能上传"+t._s(t.fileSettings.num)+"个格式为"+t._s(t.fileSettings.accept)+"的文件,且不超过"+t._s(t.fileSettings.max)+"kb")])],1)],1),t._v(" "),n("el-form-item",{attrs:{label:"导入数据:",prop:"lon"}},[n("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"small",type:"success"},on:{click:t.handleSubmit}},[t._v("开始导入")])],1)],1)],1)],1)],1):t._e()},o=[],a=n("5f87"),i=n("83d6"),s={props:{importSetting:{type:Object,default:function(){return{}}},dialogShow:{type:Boolean,default:!1},modal:{type:Boolean,default:!1},dialogTitle:{type:String,default:""}},data:function(){return{headers:{},loading:!1,fileSettings:{ref:"myFile",data:{},title:"点击上传",max:1024,num:1,accept:".xlsx",uploadUrl:"",type:"text",multiple:!1,disabled:!1,autoUpload:!1,onSuccess:null},isUpload:!1,templateSettings:{templateName:"模板下载",templateUrl:null}}},watch:{dialogShow:function(t){t&&(this.fileSettings=Object.assign(this.fileSettings,this.importSetting.fileSettings),this.templateSettings=Object.assign(this.templateSettings,this.importSetting.templateSettings),console.log(this.templateSettings),this.fileSettings.onSuccess=this.importSetting.onSuccess)}},mounted:function(){this.headers[i["sessionToken"]]=Object(a["a"])()},methods:{beforeClose:function(){var t=this;this.loading?this.$confirm("正在执行导入,确认关闭?").then((function(){t.importSetting.dialogShow=!1,t.loading=!1})).catch():this.importSetting.dialogShow=!1},beforeAvatarUpload:function(t){var e=this.fileSettings.accept.split(",").indexOf(t.name.substr(t.name.lastIndexOf("."),t.name.length).toLocaleString())>-1;e||this.$message.error("上传文件只能是 ".concat(this.fileSettings.accept," 格式!"));var n=t.size/1024<this.fileSettings.max;return n||this.$message.error("上传文件大小不能超过 "+this.fileSettings.max+"kb!"),e&&n},handleSubmit:function(){this.isUpload?this.$refs[this.fileSettings.ref].submit():this.$message.error("请上传文件")},file:function(t,e){t&&(this.isUpload=!0)},handleUploadSuccess:function(t,e,n){var r=this;this.fileSettings.onSuccess&&(this.loading=!0,this.fileSettings.onSuccess(t,(function(){r.loading=!1,r.importSetting.dialogShow=!1})))}}},l=s,c=n("2877"),u=Object(c["a"])(l,r,o,!1,null,null,null);e["default"]=u.exports},"9dae":function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("win-md",{staticClass:"stock-edit",attrs:{title:"调拨申请",width:"800px"},on:{close:t.close}},[n("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"ruleForm",staticClass:"form",attrs:{model:t.formData,rules:t.rules,"label-width":"120px"}},[n("div",{staticClass:"main-w"},[n("el-row",{staticClass:"headerHeight",attrs:{gutter:24}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"调拨机构",prop:"outAgencyId"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:t.formData.outAgencyId,callback:function(e){t.$set(t.formData,"outAgencyId",e)},expression:"formData.outAgencyId"}},t._l(t.agencyOptions,(function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)],1),t._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"调拨时间",clearable:"",prop:"createTime"}},[n("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",clearable:"",value:"yyyy-MM-dd HH:mm:ss","value-format":"yyyyMMddHHmmss",placeholder:"请选择日期"},model:{value:t.formData.createTime,callback:function(e){t.$set(t.formData,"createTime",e)},expression:"formData.createTime"}})],1)],1)],1),t._v(" "),n("el-row",{staticClass:"headerHeight",attrs:{gutter:24}},[n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"调拨手续",prop:"procureDoc"}},[n("upload",{ref:"uploadRef",attrs:{settings:t.uploadSettings},on:{"on-change":t.uploadChange}})],1)],1)],1),t._v(" "),t._l(t.formData.transferGoods,(function(e,r){return n("div",{key:r,staticClass:"goods-card"},[n("el-row",{attrs:{gutter:24}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"物品分类",prop:"transferGoods."+r+".baseCategoryId",rules:{required:!0,message:"请选择物品分类",trigger:"change"}}},[n("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,r)}},model:{value:e.baseCategoryId,callback:function(n){t.$set(e,"baseCategoryId",n)},expression:"goodsItem.baseCategoryId"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"物品名称",prop:"transferGoods."+r+".baseGoodsTemplateId",rules:t.rules.baseGoodsTemplateId}},[n("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.baseCategoryId?"请选择物品":"请先选择物品分类",filterable:"",clearable:"",disabled:!e.baseCategoryId},on:{change:function(e){return t.goodsTemplateChange(e,r)}},model:{value:e.baseGoodsTemplateId,callback:function(n){t.$set(e,"baseGoodsTemplateId",n)},expression:"goodsItem.baseGoodsTemplateId"}},t._l(e.goodsOptions,(function(t){return n("el-option",{key:t.id,attrs:{label:t.goodsName,value:t.id}})})),1)],1)],1)],1),t._v(" "),n("el-row",{attrs:{gutter:24}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"规格型号",prop:"transferGoods["+r+"].modelsIds",rules:{required:!0,message:"请选择",trigger:"change"}}},[n("el-select",{staticStyle:{width:"100%"},attrs:{multiple:"",clearable:"",placeholder:e.baseGoodsTemplateId?"请选择规格型号":"请先选择物品名称",disabled:!e.baseGoodsTemplateId},on:{change:function(e){return t.modelChange(e,r)},"remove-tag":function(e){return t.modelRemoveTag(e,r)},clear:function(e){return t.modelRemoveTag(-1,r)}},model:{value:e.modelsIds,callback:function(n){t.$set(e,"modelsIds",n)},expression:"goodsItem.modelsIds"}},t._l(e.modelsOptions,(function(t){return n("el-option",{key:t.id,attrs:{label:t.modelName,value:t.id}})})),1)],1)],1)],1),t._v(" "),n("el-table",{attrs:{data:e.models,stripe:!0}},[n("el-table-column",{attrs:{prop:"baseGoodsModelsId",label:"规格型号",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(t.getGoodsModelsName(e.row.baseGoodsModelsId))+"\n            ")]}}],null,!0)}),t._v(" "),n("el-table-column",{attrs:{label:"单位",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(e.row.unit)+"\n            ")]}}],null,!0)}),t._v(" "),n("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.worehouseCount)+"\n            ")]}}],null,!0)}),t._v(" "),n("el-table-column",{attrs:{prop:"counts",label:"申请数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{"label-width":"0",prop:"transferGoods["+r+"].models["+e.$index+"].counts",rules:t.rules.counts}},[n("el-input",{attrs:{placeholder:"请输入"},on:{change:function(n){return t.countsChange(n,r,e.$index)}},model:{value:e.row.counts,callback:function(n){t.$set(e.row,"counts",t._n(n))},expression:"scope.row.counts"}})],1)]}}],null,!0)})],1),t._v(" "),n("div",{staticClass:"btn-group"},[t.formData.transferGoods.length>1?n("el-button",{attrs:{name:"移除",type:"danger",plain:"",size:"mini"},on:{click:function(e){return t.removeGoods(r)}}},[t._v("移除")]):t._e(),t._v(" "),t.formData.transferGoods.length-1==r?n("el-button",{attrs:{name:"新增物品",type:"primary",plain:"",size:"mini"},on:{click:t.addGoods}},[t._v("新增物品")]):t._e()],1)],1)}))],2)]),t._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer",align:"center"},slot:"footer"},[n("my-button",{attrs:{name:"取消",site:"form"},on:{click:t.close}}),t._v(" "),n("my-button",{attrs:{name:"保存",site:"form"},on:{click:t.handleSubmit}})],1)],1)},o=[],a=n("a083"),i=n("6ec5"),s=n("f6e8"),l=n("f76d"),c=n("decf"),u=n("dee4"),d=n("2f62"),f=n("6f7e");function p(t){return p="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},p(t)}function m(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=v(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){s=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function g(t){return y(t)||b(t)||v(t)||h()}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t,e){if(t){if("string"==typeof t)return w(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(t,e):void 0}}function b(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function y(t){if(Array.isArray(t))return w(t)}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function _(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var a=e&&e.prototype instanceof b?e:b,i=Object.create(a.prototype),s=new G(r||[]);return o(i,"_invoke",{value:k(t,n,s)}),i}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var f="suspendedStart",m="suspendedYield",g="executing",h="completed",v={};function b(){}function y(){}function w(){}var S={};c(S,i,(function(){return this}));var O=Object.getPrototypeOf,x=O&&O(O(E([])));x&&x!==n&&r.call(x,i)&&(S=x);var j=w.prototype=b.prototype=Object.create(S);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function n(o,a,i,s){var l=d(t[o],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==p(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,i,s)}),(function(t){n("throw",t,i,s)})):e.resolve(u).then((function(t){c.value=t,i(c)}),(function(t){return n("throw",t,i,s)}))}s(l.arg)}var a;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,n,r){var o=f;return function(a,i){if(o===g)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(r.method=a,r.arg=i;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var c=d(e,n,r);if("normal"===c.type){if(o=r.done?h:m,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=h,r.method="throw",r.arg=c.arg)}}}function D(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=d(o,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function E(e){if(e||""===e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(p(e)+" is not iterable")}return y.prototype=w,o(j,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:y,configurable:!0}),y.displayName=c(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,c(t,l,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},C(I.prototype),c(I.prototype,s,(function(){return this})),e.AsyncIterator=I,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new I(u(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},C(j),c(j,l,"Generator"),c(j,i,(function(){return this})),c(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=E,G.prototype={constructor:G,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(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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 i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},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),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:E(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function S(t,e,n,r,o,a,i){try{var s=t[a](i),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,o)}function O(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){S(a,r,o,i,s,"next",t)}function s(t){S(a,r,o,i,s,"throw",t)}i(void 0)}))}}function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){C(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function C(t,e,n){return(e=I(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I(t){var e=k(t,"string");return"symbol"==p(e)?e:e+""}function k(t,e){if("object"!=p(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var D={components:{MyButton:s["a"],winMd:l["a"],upload:c["a"]},props:{setting:{type:Object,default:function(){}}},data:function(){var t=this,e=function(e,n,r){if(!n)return r(new Error("请选择"));var o=t.formData.transferGoods.filter((function(t){return t.baseGoodsTemplateId==n}));if(!o||1!=o.length)return r(new Error("已选过此物品"));r()};return{loading:!0,agencyOptions:[],categoryOptions:[],modelList:[],formData:{transferBusinessType:0,procureDoc:"",outAgencyId:"",createTime:f["formatDate"](new Date,"yyyyMMddhhmmss"),transferGoods:[]},goodsItem:{baseCategoryIds:"",baseCategoryId:"",baseGoodsTemplateId:"",goodsTemplateName:"",goodsOptions:[],modelsOptions:[],models:[],modelsIds:[]},modelsItem:{baseGoodsModelsId:"",worehouseCount:10,counts:null,unit:null},rules:{outAgencyId:[{required:!0,message:"请选择",trigger:"change"}],createTime:[{required:!0,message:"请选择",trigger:"change"}],baseCategoryIds:[{required:!0,message:"请选择",trigger:"change"}],baseGoodsTemplateId:[{required:!0,message:"请选择",trigger:"change"},{validator:e,trigger:["blur","change"]}],modelsIds:[{required:!0,message:"请选择",trigger:"change"}],counts:[{required:!0,message:"请输入",trigger:"change"},{type:"number",message:"数量必须为整数"}]},uploadSettings:{title:"上传",max:20,num:2,tip:"",uploadUrl:Object(u["d"])(),multiple:!0,disabled:!1}}},computed:j({},Object(d["b"])(["userInfo"])),created:function(){this.init()},methods:{init:function(){var t=O(_().mark((function t(){return _().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.handegetParentTenant();case 2:return t.next=4,this.getCategoryTree();case 4:this.loading=!1,this.getgoodsTemplate(),this.getgoodsModel();case 7:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),handegetParentTenant:function(){var t=O(_().mark((function t(){var e=this;return _().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(a["a"])().then((function(t){t.id!=e.userInfo.tenantId?(e.agencyOptions=[t],e.formData.outAgencyId=t.id,e.formData.transferGoods.push(JSON.parse(JSON.stringify(e.goodsItem)))):e.$message.warning("无上级机构")}));case 2:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}(),getCategoryTree:function(){var t=O(_().mark((function t(){var e;return _().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["k"])();case 2:e=t.sent,this.categoryOptions=this.removeEmptyChildren(e);case 4: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 n=this;Object(a["b"])({categoryId:t||"",agencyId:this.formData.outAgencyId}).then((function(t){e||0==e?n.$set(n.formData.transferGoods[e],"goodsOptions",t):n.goodsTemplatelAll=t}))},getgoodsModel:function(t,e){var n=this;Object(i["m"])({goodsTemplatesId:t||""}).then((function(t){e||0==e?n.$set(n.formData.transferGoods[e],"modelsOptions",t):n.goodsModelAll=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.transferGoods[e].goodsOptions=[],this.formData.transferGoods[e].baseGoodsTemplateId="",this.formData.transferGoods[e].goodsTemplateName="",this.formData.transferGoods[e].modelsOptions=[],this.formData.transferGoods[e].modelsIds=[],this.formData.transferGoods[e].models=[],this.getgoodsTemplate(t,e)},goodsTemplateChange:function(t,e){this.formData.transferGoods[e].modelsOptions=[],this.formData.transferGoods[e].modelsIds=[],this.formData.transferGoods[e].models=[],this.formData.transferGoods[e].goodsTemplateName=this.getGoodsTemplateName(t),this.getgoodsModel(t,e)},modelChange:function(){var t=O(_().mark((function t(e,n){var r,o,a,s,l,c=this;return _().wrap((function(t){while(1)switch(t.prev=t.next){case 0:r=g(this.formData.transferGoods[n].models),o=JSON.stringify(r),a=m(e),t.prev=3,l=_().mark((function t(){var e,n,a;return _().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e=s.value,-1!=o.indexOf(e)){t.next=7;break}return n=c.goodsModelAll.find((function(t){return t.id==e})),t.next=5,Object(i["r"])({baseGoodsModelsId:e,warehouseType:0,states:1,buyType:1,agencyId:c.formData.outAgencyId});case 5:a=t.sent,r.push(j(j({},c.modelsItem),{},{baseGoodsModelsId:e,unit:n.unit,worehouseCount:a}));case 7:case"end":return t.stop()}}),t)})),a.s();case 6:if((s=a.n()).done){t.next=10;break}return t.delegateYield(l(),"t0",8);case 8:t.next=6;break;case 10:t.next=15;break;case 12:t.prev=12,t.t1=t["catch"](3),a.e(t.t1);case 15:return t.prev=15,a.f(),t.finish(15);case 18:this.formData.transferGoods[n].models=r;case 19:case"end":return t.stop()}}),t,this,[[3,12,15,18]])})));function e(e,n){return t.apply(this,arguments)}return e}(),modelRemoveTag:function(t,e){if(-1!==t){var n=this.formData.transferGoods[e].models,r=n.findIndex((function(e){return e.baseGoodsModelsId==t}));this.formData.transferGoods[e].models.splice(r,1)}else this.formData.transferGoods[e].models=[]},uploadChange:function(t){var e=this.$refs.uploadRef.fileList;this.formData.procureDoc=JSON.stringify(e)},addGoods:function(){this.formData.transferGoods.push(JSON.parse(JSON.stringify(this.goodsItem)))},removeGoods:function(t){this.formData.transferGoods.splice(t,1)},countsChange:function(t,e,n){var r=this.formData.transferGoods[e].models[n],o=r.worehouseCount;0==t&&(this.$message.warning("数量不能为0"),r.counts=null),t>o&&(this.$message.warning("数量超过现有库存"),r.counts=o)},handleSubmit:function(){var t=this;this.$refs["ruleForm"].validate((function(e){if(e){if(t.loading)return;t.loading=!0,Object(a["d"])(t.formData).then((function(e){t.loading=!1,t.$message.success("保存成功!"),t.close(),t.$emit("search")})).catch((function(e){t.loading=!1,console.log("edit err",e),t.$message.error("保存失败")}))}else t.$message.error("校验未通过,请检查。")}))},close:function(){this.$emit("close")}}},T=D,P=(n("5234"),n("2877")),G=Object(P["a"])(T,r,o,!1,null,"3881f82a",null);e["default"]=G.exports},a083:function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"g",(function(){return i})),n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"e",(function(){return c})),n.d(e,"h",(function(){return u})),n.d(e,"c",(function(){return d})),n.d(e,"i",(function(){return f})),n.d(e,"k",(function(){return p})),n.d(e,"j",(function(){return m}));var r=n("b775");function o(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/add",method:"post",data:t})}function a(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/import",method:"post",data:t})}function i(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/list",method:"get",params:t})}function s(t){return Object(r["a"])({url:"/pc/fin/sys/tenant/get/parent/tenant",method:"get",params:t})}function l(t){return Object(r["a"])({url:"/pc/base/goods/template/query/warehouse/goods",method:"get",params:t})}function c(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/detail",method:"get",params:t})}function u(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/output",method:"post",params:t})}function d(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/income",method:"post",params:t})}function f(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/updStatus",method:"post",params:t})}function p(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/use/record",method:"get",params:t})}function m(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/useInfo/update",method:"POST",data:t})}},ab05:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container stock-container"},[n("el-container",[n("el-card",{staticClass:"box-card",staticStyle:{width:"100%"},attrs:{shadow:"never"}},[n("div",{staticClass:"filter-container"},[n("my-search",{ref:"searchBar",attrs:{items:t.items},on:{search:t.fifterForm}})],1),t._v(" "),n("el-row",{staticStyle:{"margin-top":"15px"}},[n("el-col",[n("div",{staticClass:"table-tool-bar",staticStyle:{"margin-bottom":"15px"}},[n("my-button",{attrs:{name:"调拨申请",icon:"el-icon-plus",site:"tools",size:"medium"},on:{click:t.handleAdd}})],1),t._v(" "),n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],style:{"overflow-y":"auto",height:"calc(100vh - 352px)"}},[t.list.length?n("el-row",{staticClass:"card",attrs:{gutter:5}},t._l(t.list,(function(e,r){return n("el-col",{key:r,staticClass:"cm-item"},[n("el-card",{staticClass:"card-data"},[n("div",{staticClass:"card-container"},[n("div",{staticClass:"card-header"},[n("div",{staticClass:"card-header-left"},[n("span",[t._v("调拨单号:")]),t._v(" "),n("span",{staticClass:"value"},[t._v(t._s(e.businessFormCode))]),t._v(" "),0==e.states&&null!=e.procureDoc?n("div",{staticClass:"states states-warning"},[t._v("待出库")]):t._e(),t._v(" "),0==e.states&&null==e.procureDoc?n("div",{staticClass:"states states-warning"},[t._v("待提交")]):t._e(),t._v(" "),1==e.states?n("div",{staticClass:"states states-warning"},[t._v("待接收")]):t._e(),t._v(" "),2==e.states?n("div",{staticClass:"states states-success"},[t._v("已接收")]):t._e(),t._v(" "),4==e.states?n("div",{staticClass:"states states-info"},[t._v("已撤销")]):t._e()]),t._v(" "),n("div",{staticClass:"card-header-right"},[1==e.states?n("el-button",{attrs:{site:"form",type:"success",size:"mini"},on:{click:function(n){return t.handleIncome(e)}}},[t._v("入库")]):t._e(),t._v(" "),0==e.states&&null==e.procureDoc?n("el-button",{attrs:{site:"form",type:"primary",size:"mini"},on:{click:function(n){return t.handleExport("transferExport","调拨单-"+e.businessFormCode,{id:e.id,type:0})}}},[t._v("下载\n                        ")]):t._e(),t._v(" "),0==e.states&&null==e.procureDoc?n("el-button",{attrs:{site:"form",type:"primary",size:"mini"},on:{click:function(n){return t.handleUploadPage(e)}}},[t._v("上传")]):t._e(),t._v(" "),0==e.states?n("el-button",{attrs:{site:"form",type:"danger",size:"mini"},on:{click:function(n){return t.handleRevoke(e)}}},[t._v("撤销")]):t._e(),t._v(" "),2==e.states?n("el-button",{attrs:{site:"form",type:"primary",size:"mini"},on:{click:function(n){return t.handleExport("transferExport","调拨入库单-"+e.businessFormCode,{id:e.id,type:1})}}},[t._v("导出调拨入库单")]):t._e(),t._v(" "),n("el-button",{attrs:{name:"查看详情",site:"form",type:"info",size:"mini"},on:{click:function(n){return t.handleDetail(e)}}},[t._v("查看详情")])],1)]),t._v(" "),n("div",{staticClass:"one-hed"},[n("div",{staticClass:"box"},[n("span",{staticClass:"span-two"},[t._v("接收机构:")]),t._v(t._s(e.inAgencyName))]),t._v(" "),n("div",{staticClass:"box"},[n("span",{staticClass:"span-two"},[t._v("申请人:")]),t._v(t._s(e.operatorName))]),t._v(" "),n("div",{staticClass:"box"},[n("span",{staticClass:"span-two"},[t._v("申请调拨时间:")]),t._v(t._s(t._f("formatTime")(e.createTime))+"\n                      ")]),t._v(" "),n("div",{staticClass:"box"},[n("span",{staticClass:"span-two"},[t._v("接收时间:")]),t._v(t._s(t._f("formatTime")(e.inTime)))])]),t._v(" "),n("div",{staticClass:"one-hed"},[n("div",{staticClass:"box"},[n("span",{staticClass:"span-two"},[t._v("调拨机构:")]),t._v(t._s(e.outAgencyName))]),t._v(" "),n("div",{staticClass:"box"},[n("span",{staticClass:"span-two"},[t._v("调拨人:")]),t._v(t._s(e.outOperatorName))]),t._v(" "),n("div",{staticClass:"box"},[n("span",{staticClass:"span-two"},[t._v("调拨时间:")]),t._v(t._s(t._f("formatTime")(e.outputTime))+"\n                      ")])]),t._v(" "),n("div",{staticClass:"card-end"},t._l(e.fromTransferTemplateInfoList,(function(e,r){return n("div",{key:r,staticClass:"item"},[n("div",{staticClass:"name"},[t._v(t._s(e.goodsName))]),t._v(" "),n("div",{staticClass:"value-box"},[n("div",{staticClass:"value-box-item"},[n("span",{staticClass:"label"},[t._v("数量:")]),t._v(" "),n("span",{staticClass:"value"},[t._v(t._s(e.count))]),t._v(" "),n("span",{staticClass:"unit"},[t._v(t._s(e.unit))])])])])})),0)])])],1)})),1):n("el-empty",{attrs:{description:"暂无数据"}})],1),t._v(" "),n("el-pagination",{attrs:{small:!1,"current-page":t.pageNum,"page-sizes":[5,10,20,50,100,200,300,400,500],"page-size":t.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)],1)],1),t._v(" "),t.uploadPageSetting.show?n("uploadPage",{ref:"uploadRef",attrs:{setting:t.uploadPageSetting},on:{close:function(e){t.uploadPageSetting.show=!1},search:t.refreshData}}):t._e(),t._v(" "),t.editSetting.show?n("edit",{ref:"editRef",attrs:{setting:t.editSetting},on:{close:function(e){t.editSetting.show=!1},search:t.refreshData}}):t._e(),t._v(" "),t.detailSetting.show?n("detail",{ref:"detailRef",attrs:{setting:t.detailSetting},on:{close:function(e){t.detailSetting.show=!1}}}):t._e()],1)},o=[],a=n("a083"),i=n("f6e8"),s=n("9960"),l=n("9dae"),c=n("31eb"),u=n("271c"),d=n("822f"),f=n("433d"),p=n("4f6e"),m=n("ac29"),g=n("dee4");function h(t){return h="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},h(t)}function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function y(t,e,n){return(e=w(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w(t){var e=_(t,"string");return"symbol"==h(e)?e:e+""}function _(t,e){if("object"!=h(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var S={name:"index",mixins:[u["default"],d["default"]],components:{MyButton:i["a"],myImport:s["default"],edit:l["default"],detail:c["default"],uploadPage:p["default"]},data:function(){return{loading:!1,list:[],items:[{type:"text",dataIndex:"businessFormCode",label:"调拨单号",placeholder:"请输入",defaultValue:""},{type:"select",dataIndex:"goodsTemplateId",label:"物品名称",placeholder:"请输入",defaultValue:"",options:[],optionsConfig:{label:"goodsName",value:"id",url:f["a"].apiBaseURL+"/pc/base/goods/template/query/goodsTemplate"}},{type:"select",dataIndex:"states",label:"状态",placeholder:"请选择",defaultValue:"",options:[]},{type:"date-picker",dataIndex:"createTimeStart",label:"申请时间",defaultValue:""},{type:"date-picker",dataIndex:"createTimeEnd",label:"至",defaultValue:""},{type:"date-picker",dataIndex:"startTime",label:"接收时间",defaultValue:""},{type:"date-picker",dataIndex:"endTime",label:"至",defaultValue:""}],filterFrom:{}}},created:function(){var t=this;this.filterFrom={inAgencyId:this.userInfo.tenantId},this.fetchData(),this.items.map((function(e){return"状态"==e.label&&(e.options=t.statesOptions),e}))},methods:{fetchData:function(){var t=this;this.loading=!0,Object(a["g"])(b({pageNum:this.pageNum,pageSize:this.pageSize},this.filterFrom)).then((function(e){t.list=e.datas,t.total=e.totalRows,t.loading=!1}))},handleIncome:function(t){var e=this;this.$confirm("您确定 单号:".concat(t.businessFormCode,"  接收入库吗?"),"接收入库",{beforeClose:function(n,r,o){"confirm"==n?(r.confirmButtonLoading=!0,r.confirmButtonText="执行中...",Object(a["c"])({id:t.id}).then((function(t){e.$message.success("接收入库成功!"),o(),r.confirmButtonLoading=!1,e.search(1)})).catch((function(){o()}))):o()}})},handleRevoke:function(t){var e=this;this.$confirm('您确定撤销单号为"'.concat(t.businessFormCode,'"  的数据吗?'),"撤销").then((function(){Object(a["i"])({id:t.id}).then((function(t){e.$message.success("撤销成功!"),e.search(1)}))}))},handleUploadPage:function(t){this.uploadPageSetting.id=t.id,this.uploadPageSetting.title="导入",this.uploadPageSetting.show=!0},handleExport:function(t,e,n){var r=this,o=this.$loading({lock:!0,text:"导出中,请稍候...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});m[t](n).then((function(t){console.log(t),Object(g["a"])(t),r.$message.success("导出成功!"),o.close()})).catch((function(){o.close()}))}}},O=S,x=(n("fe35"),n("2877")),j=Object(x["a"])(O,r,o,!1,null,"c637a10a",null);e["default"]=j.exports},ac29:function(t,e,n){"use strict";n.r(e),n.d(e,"outputExport",(function(){return o})),n.d(e,"procureExport",(function(){return a})),n.d(e,"transferExport",(function(){return i})),n.d(e,"inventoryExport",(function(){return s})),n.d(e,"scrappedExport",(function(){return l})),n.d(e,"deptScrappedExport",(function(){return c}));var r=n("b775");function o(t){return Object(r["a"])({url:"/pc/l/wh/form/output/list/export",method:"get",params:t})}function a(t){return Object(r["a"])({url:"/pc/whForm/procure/list/export",method:"get",params:t})}function i(t){return Object(r["a"])({url:"/pc/l/wh/form/transfer/list/export",method:"get",params:t})}function s(t){return Object(r["a"])({url:"/pc/l/wh/form/inventory/list/export",method:"get",params:t})}function l(t){return Object(r["a"])({url:"/pc/l/wh/form/scrapped/list/export",method:"get",params:t})}function c(t){return Object(r["a"])({url:"/pc/l/wh/form/scrapped/deptList/export",method:"get",params:t})}},e2f2:function(t,e,n){},fe35:function(t,e,n){"use strict";n("4200")}}]);