WangHan
2025-04-03 a1b85ef72062ca80db35546e4216dd564f3e0f57
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3e45d87d","chunk-e12d3f04","chunk-e3350e26","chunk-92e5b0d0","chunk-2d0e66d0"],{2528:function(t,e,r){"use strict";r("f146")},"271c":function(t,e,r){"use strict";r.r(e);var n=r("6f7e"),o=r("2f62"),a=r("ac29"),i=r("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 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 c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return(e=d(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(t){var e=p(t,"string");return"symbol"==s(e)?e:e+""}function p(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=s(n))return n;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?n["LongToDateTime"](t):"-"}},methods:{handleExport:function(t,e,r){var n=this,o=this.$loading({lock:!0,text:"导出中,请稍候...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});a[t](r).then((function(t){console.log(t),Object(i["a"])(t),n.$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)}}}},"433d":function(t,e,r){"use strict";var n=r("c559"),o={ftpUrl:n["a"].ftpUrl,apiBaseURL:n["a"].apiBaseURL};e["a"]=o},5688:function(t,e,r){"use strict";r.d(e,"i",(function(){return o})),r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return i})),r.d(e,"c",(function(){return s})),r.d(e,"f",(function(){return l})),r.d(e,"h",(function(){return c})),r.d(e,"e",(function(){return u})),r.d(e,"d",(function(){return d})),r.d(e,"g",(function(){return p}));var n=r("b775");function o(t){return Object(n["a"])({url:"/pc/base/warehouse/select/tenant_warehouse",method:"get",params:t})}function a(t){return Object(n["a"])({url:"/pc/base/goods/template/query/goodsTemplate",method:"get",params:t})}function i(t){return Object(n["a"])({url:"/pc/base/goods/models/query/goodsModel",method:"get",params:t})}function s(t){return Object(n["a"])({url:"/pc/whForm/procure/add",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/pc/whForm/procure/edit",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/pc/whForm/procure/list",method:"get",params:t})}function u(t){return Object(n["a"])({url:"/pc/whForm/procure/detail",method:"get",params:t})}function d(t){return Object(n["a"])({url:"/pc/whForm/procure/del",method:"delete",params:t})}function p(t){return Object(n["a"])({url:"/pc/whForm/procure/income",method:"post",params:t})}},"6b6f":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:t.setting.title+"采购入库",width:"800px",loading:t.loading},on:{close:t.close}},[r("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"}},[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:"warehouseId"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择",clearable:""},model:{value:t.formData.warehouseId,callback:function(e){t.$set(t.formData,"warehouseId",e)},expression:"formData.warehouseId"}},t._l(t.warehouses,(function(t){return r("el-option",{key:t.id,attrs:{label:t.warehouseName,value:t.id}})})),1)],1)],1),t._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"采购时间",prop:"procureTime"}},[r("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.procureTime,callback:function(e){t.$set(t.formData,"procureTime",e)},expression:"formData.procureTime"}})],1)],1)],1),t._v(" "),r("el-row",{staticClass:"headerHeight",attrs:{gutter:24}},[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"采购类型",prop:"buyType"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:t.formData.buyType,callback:function(e){t.$set(t.formData,"buyType",e)},expression:"formData.buyType"}},t._l(t.buyTypeOptions,(function(t){return r("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],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:{values:t.fileList,settings:t.uploadSettings},on:{"on-change":t.uploadChange}})],1)],1)],1),t._v(" "),t._l(t.formData.procureGoods,(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:"procureGoods."+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:"procureGoods."+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)],1),t._v(" "),r("el-row",{attrs:{gutter:24}},[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"规格型号",prop:"procureGoods."+n+".modelsIds",rules:{required:!0,message:"请选择规格型号",trigger:"change"}}},[r("el-select",{staticStyle:{width:"100%"},attrs:{multiple:"",clearable:"",placeholder:e.baseGoodsTemplateId?"请选择规格型号":"请先选择物品名称",disabled:!e.baseGoodsTemplateId},on:{change:function(e){return t.modelChange(e,n)},"remove-tag":function(e){return t.modelRemoveTag(e,n)},clear:function(e){return t.modelRemoveTag(-1,n)}},model:{value:e.modelsIds,callback:function(r){t.$set(e,"modelsIds",r)},expression:"goodsItem.modelsIds"}},t._l(e.modelsOptions,(function(t){return r("el-option",{key:t.id,attrs:{label:t.modelName,value:t.id}})})),1)],1)],1),t._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"供货商",prop:"supplier"}},[r("el-input",{attrs:{clearable:"",maxlength:"20","show-word-limit":""},model:{value:e.supplier,callback:function(r){t.$set(e,"supplier",r)},expression:"goodsItem.supplier"}})],1)],1)],1),t._v(" "),r("el-table",{attrs:{data:e.models,stripe:!0}},[r("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(" "),r("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(" "),r("el-table-column",{attrs:{prop:"priceYuan",label:"单价(元)",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{"label-width":"0",prop:"procureGoods["+n+"].models["+e.$index+"].priceYuan",rules:t.rules.priceYuan}},[r("el-input",{attrs:{type:"number"},on:{change:function(r){return t.priceChange(r,n,e.$index)}},model:{value:e.row.priceYuan,callback:function(r){t.$set(e.row,"priceYuan",t._n(r))},expression:"scope.row.priceYuan"}})],1)]}}],null,!0)}),t._v(" "),r("el-table-column",{attrs:{prop:"counts",label:"采购数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{"label-width":"0",prop:"procureGoods["+n+"].models["+e.$index+"].counts",rules:t.rules.counts}},[r("el-input",{model:{value:e.row.counts,callback:function(r){t.$set(e.row,"counts",t._n(r))},expression:"scope.row.counts"}})],1)]}}],null,!0)})],1),t._v(" "),r("div",{staticClass:"btn-group"},[t.formData.procureGoods.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.procureGoods.length-1==n?r("el-button",{attrs:{name:"新增物品",type:"primary",plain:"",size:"mini"},on:{click:t.addGoods}},[t._v("新增物品\n          ")]):t._e()],1)],1)}))],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)],1)},o=[],a=r("5688"),i=r("c56b"),s=r("f6e8"),l=r("f76d"),c=r("decf"),u=r("dee4"),d=r("ed08"),p=r("2f62"),f=r("6f7e");function m(t){return m="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},m(t)}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 r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?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 r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}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={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=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 u(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,i=Object.create(a.prototype),s=new E(n||[]);return o(i,"_invoke",{value:C(t,r,s)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var p="suspendedStart",f="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(N([])));x&&x!==r&&n.call(x,i)&&(S=x);var I=w.prototype=b.prototype=Object.create(S);function D(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(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"==m(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(u).then((function(t){c.value=t,i(c)}),(function(t){return r("throw",t,i,s)}))}s(l.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 C(e,r,n){var o=p;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(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var c=d(e,r,n);if("normal"===c.type){if(o=n.done?h:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=h,n.method="throw",n.arg=c.arg)}}}function T(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,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}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 E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[i];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(m(e)+" is not iterable")}return y.prototype=w,o(I,"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(I),t},e.awrap=function(t){return{__await:t}},D(j.prototype),c(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new j(u(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},D(I),c(I,l,"Generator"),c(I,i,(function(){return this})),c(I,"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=N,E.prototype={constructor:E,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 s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.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=n.call(i,"catchLoc"),c=n.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 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 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 r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),v}},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:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function S(t,e,r,n,o,a,i){try{var s=t[a](i),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,o)}function O(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){S(a,n,o,i,s,"next",t)}function s(t){S(a,n,o,i,s,"throw",t)}i(void 0)}))}}function x(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?x(Object(r),!0).forEach((function(e){D(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e,r){return(e=j(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j(t){var e=C(t,"string");return"symbol"==m(e)?e:e+""}function C(t,e){if("object"!=m(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var T={components:{MyButton:s["a"],winMd:l["a"],upload:c["a"]},props:{setting:{type:Object,default:function(){}}},data:function(){var t=this,e=function(e,r,n){if(!r)return n(new Error("请选择"));var o=t.formData.procureGoods.filter((function(t){return t.baseGoodsTemplateId==r}));if(!o||1!=o.length)return n(new Error("已选过此物品"));n()},r=function(e,r,n){return r?0==r?(t.$message.warning("数字值不能为0"),n(new Error("数字值不能为0"))):void n():n(new Error("请输入"))},n=function(e,r,n){return r?Number.isInteger(r)?0==r?(t.$message.warning("数字值不能为0"),n(new Error("数字值不能为0"))):void n():(t.$message.warning("请输入数字值"),n(new Error("请输入数字值"))):n(new Error("请输入"))};return{loading:!0,buyTypeOptions:[{label:"集采",value:"1"},{label:"自采",value:"2"}],fileList:[],warehouses:[],categoryOptions:[],modelList:[],formData:{procureDoc:"",warehouseId:"",procureTime:f["formatDate"](new Date,"yyyyMMddhhmmss"),buyType:"2",procureGoods:[]},goodsItem:{baseCategoryIds:"",baseCategoryId:"",baseGoodsTemplateId:"",goodsTemplateName:"",supplier:"",sort:"",goodsOptions:[],modelsOptions:[],models:[],modelsIds:[]},modelsItem:{baseGoodsModelsId:"",priceYuan:null,price:null,counts:null,unit:null},rules:{warehouseId:[{required:!0,message:"请选择",trigger:"change"}],procureTime:[{required:!0,message:"请选择",trigger:"change"}],buyType:[{required:!0,message:"请选择",trigger:"change"}],procureDoc:[{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"}],priceYuan:[{validator:r,trigger:"blur"}],counts:[{validator:n,trigger:"blur"}]},uploadSettings:{title:"上传",max:20,num:10,tip:"",uploadUrl:Object(u["d"])(),multiple:!0}}},computed:I({},Object(p["b"])(["userInfo"])),created:function(){this.init()},methods:{init:function(){var t=O(_().mark((function t(){var e,r,n=this;return _().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.getWarehouseList();case 2:return t.next=4,this.getgoodsTemplate();case 4:return t.next=6,this.getgoodsModel();case 6:return t.next=8,Object(i["b"])();case 8:if(e=t.sent,this.categoryOptions=this.removeEmptyChildren(e),!this.setting.id){t.next=19;break}return t.next=13,Object(a["e"])({id:this.setting.id});case 13:r=t.sent,this.formData=Object.assign(this.formData,r),this.formData.procureDoc&&(this.fileList=JSON.parse(this.formData.procureDoc)),this.$set(this.formData,"buyType",this.formData.buyType.toString()),this.formData.procureTime=this.formData.procureTime.toString(),this.formData.procureGoods.map(function(){var t=O(_().mark((function t(e,r){return _().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.baseCategoryIds=Object(d["a"])(n.categoryOptions,e.baseCategoryId),n.$set(n.formData.procureGoods[r],"modelsIds",e.models.map((function(t){return t.baseGoodsModelsId}))),t.next=4,n.getgoodsTemplate(e.baseCategoryId,r);case 4:return t.next=6,n.getgoodsModel(e.baseGoodsTemplateId,r);case 6:return t.next=8,e.models.forEach((function(t,e){n.$set(n.formData.procureGoods[r].models[e],"priceYuan",t.price/100)}));case 8:return t.abrupt("return",e);case 9:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}());case 19:this.loading=!1;case 20:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),getWarehouseList: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["i"])({agencyId:this.userInfo.tenantId}).then((function(t){e.warehouses=t,!e.setting.id&&t.length&&e.formData.procureGoods.push(JSON.parse(JSON.stringify(e.goodsItem))),e.warehouses.length&&!e.formData.warehouseId&&(e.formData.warehouseId=e.warehouses[0].id)})).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(){var t=O(_().mark((function t(e,r){var n=this;return _().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(a["b"])({agencyId:this.userInfo.tenantId,categoryId:e||""}).then((function(t){r||0==r?n.$set(n.formData.procureGoods[r],"goodsOptions",t):n.goodsTemplatelAll=t}));case 2:case"end":return t.stop()}}),t,this)})));function e(e,r){return t.apply(this,arguments)}return e}(),getgoodsModel:function(){var t=O(_().mark((function t(e,r){var n=this;return _().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(a["a"])({goodsTemplatesId:e||""}).then((function(t){r||0==r?n.$set(n.formData.procureGoods[r],"modelsOptions",t):n.goodsModelAll=t}));case 2:case"end":return t.stop()}}),t)})));function e(e,r){return t.apply(this,arguments)}return e}(),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.procureGoods[e].goodsOptions=[],this.formData.procureGoods[e].baseGoodsTemplateId="",this.formData.procureGoods[e].goodsTemplateName="",this.formData.procureGoods[e].modelsOptions=[],this.formData.procureGoods[e].modelsIds=[],this.formData.procureGoods[e].models=[],this.getgoodsTemplate(t,e)},goodsTemplateChange:function(t,e){this.formData.procureGoods[e].modelsOptions=[],this.formData.procureGoods[e].modelsIds=[],this.formData.procureGoods[e].models=[],this.formData.procureGoods[e].goodsTemplateName=this.getGoodsTemplateName(t),this.getgoodsModel(t,e)},modelChange:function(t,e){var r=this,n=g(this.formData.procureGoods[e].models),o=JSON.stringify(n);t.forEach((function(t){if(-1==o.indexOf(t)){var e=r.goodsModelAll.find((function(e){return e.id==t}));n.push(I(I({},r.modelsItem),{},{baseGoodsModelsId:t,unit:e.unit}))}})),this.formData.procureGoods[e].models=n},modelRemoveTag:function(t,e){if(-1!==t){var r=this.formData.procureGoods[e].models,n=r.findIndex((function(e){return e.baseGoodsModelsId==t}));this.formData.procureGoods[e].models.splice(n,1)}else this.formData.procureGoods[e].models=[]},priceChange:function(t,e,r){this.formData.procureGoods[e].models[r].price=100*t},uploadChange:function(){var t=this.$refs.uploadRef.fileList;this.formData.procureDoc=JSON.stringify(t)},addGoods:function(){this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem)))},removeGoods:function(t){this.formData.procureGoods.splice(t,1)},handleSubmit:function(){var t=this;this.$refs["ruleForm"].validate((function(e){if(e){if(t.loading)return;t.loading=!0,t.setting.id?Object(a["f"])(t.formData).then((function(e){t.$message.success("保存成功!"),t.close(),t.$emit("search")})).catch((function(e){t.loading=!1,t.$message.error("保存失败")})):Object(a["c"])(t.formData).then((function(e){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:"",procureTime:"",procureGoods:[]},this.$emit("close")}}},k=T,G=(r("e3fa"),r("2877")),E=Object(G["a"])(k,n,o,!1,null,"55130d7a",null);e["default"]=E.exports},"6ccf":function(t,e,r){},"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),i=e.slice(10,12),s=e.slice(12,14),l=r+"-"+n+"-"+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(),r=e.slice(0,4),n=e.slice(4,6),o=e.slice(6,8),a=r+"-"+n+"-"+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 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(i){return"-"}}function l(){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"),i=t.getSeconds().toString().padStart(2,"0");return"".concat(e,"-").concat(r,"-").concat(n," ").concat(o,":").concat(a,":").concat(i)}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 u(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,i=30*o,s=(new Date).getTime(),l=s-e;if(!(l<0)){var c=l/r,u=l/n,d=l/o,p=l/a,f=l/i,m="";if(f>=1&&f<=3)m=" "+parseInt(f)+"月前";else if(p>=1&&p<=3)m=" "+parseInt(p)+"周前";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<=r)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}}}r.r(e),r.d(e,"DateToLong",(function(){return n})),r.d(e,"LongToDateTime",(function(){return a})),r.d(e,"LongToDate",(function(){return i})),r.d(e,"formatDate",(function(){return s})),r.d(e,"formattedDate",(function(){return l})),r.d(e,"formattedDateDuan",(function(){return c})),r.d(e,"timeago",(function(){return u}))},9960:function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.dialogShow?r("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}},[r("el-row",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{"element-loading-text":"数据导入中"}},[r("el-col",{attrs:{span:24}},[r("el-form",[null!=t.templateSettings.templateUrl?r("el-form-item",{attrs:{label:"下载模板:",prop:"lon"}},[r("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(" "),r("el-form-item",{attrs:{label:"选取文件:",prop:"lon"}},[r("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}},[r("el-button",{attrs:{size:"small",type:"primary"}},[t._v(t._s(t.fileSettings.title))]),t._v(" "),r("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(" "),r("el-form-item",{attrs:{label:"导入数据:",prop:"lon"}},[r("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=r("5f87"),i=r("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 r=t.size/1024<this.fileSettings.max;return r||this.$message.error("上传文件大小不能超过 "+this.fileSettings.max+"kb!"),e&&r},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,r){var n=this;this.fileSettings.onSuccess&&(this.loading=!0,this.fileSettings.onSuccess(t,(function(){n.loading=!1,n.importSetting.dialogShow=!1})))}}},l=s,c=r("2877"),u=Object(c["a"])(l,n,o,!1,null,null,null);e["default"]=u.exports},"9f17":function(t,e,r){"use strict";r("6ccf")},ac29:function(t,e,r){"use strict";r.r(e),r.d(e,"outputExport",(function(){return o})),r.d(e,"procureExport",(function(){return a})),r.d(e,"transferExport",(function(){return i})),r.d(e,"inventoryExport",(function(){return s})),r.d(e,"scrappedExport",(function(){return l})),r.d(e,"deptScrappedExport",(function(){return c}));var n=r("b775");function o(t){return Object(n["a"])({url:"/pc/l/wh/form/output/list/export",method:"get",params:t})}function a(t){return Object(n["a"])({url:"/pc/whForm/procure/list/export",method:"get",params:t})}function i(t){return Object(n["a"])({url:"/pc/l/wh/form/transfer/list/export",method:"get",params:t})}function s(t){return Object(n["a"])({url:"/pc/l/wh/form/inventory/list/export",method:"get",params:t})}function l(t){return Object(n["a"])({url:"/pc/l/wh/form/scrapped/list/export",method:"get",params:t})}function c(t){return Object(n["a"])({url:"/pc/l/wh/form/scrapped/deptList/export",method:"get",params:t})}},b59f: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("div",{staticClass:"app-container stock-container"},[r("el-container",[r("el-card",{staticClass:"box-card",staticStyle:{width:"100%"},attrs:{shadow:"never"}},[r("div",{staticClass:"filter-container"},[r("my-search",{ref:"searchBar",attrs:{items:t.items},on:{search:t.fifterForm}})],1),t._v(" "),r("el-row",{staticStyle:{"margin-top":"15px"}},[r("el-col",[r("div",{staticClass:"table-tool-bar",staticStyle:{"margin-bottom":"15px"}},[r("my-button",{attrs:{name:"新增",site:"tools",size:"medium"},on:{click:t.handleAdd}}),t._v(" "),r("my-button",{attrs:{name:"导入",site:"tools",size:"medium"},on:{click:function(e){return t.openImport()}}})],1),t._v(" "),r("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-bottom":"15px"}},[r("div",{style:{"overflow-y":"auto",height:"calc(100vh - 352px)"}},[t.list.length?r("el-row",{staticClass:"card",attrs:{gutter:5}},t._l(t.list,(function(e,n){return r("el-col",{key:n,staticClass:"cm-item"},[r("el-card",{staticClass:"card-data"},[r("div",{staticClass:"card-container"},[r("div",{staticClass:"card-header"},[r("div",{staticClass:"card-header-left"},[r("span",[t._v("入库单号:")]),t._v(" "),r("span",{staticClass:"value"},[t._v(t._s(e.businessFormCode))]),t._v(" "),r("div",{staticClass:"states",class:1==e.states?"":"states-success"},[t._v("\n                              "+t._s(1==e.states?"待入库":"已入库")+"\n                            ")])]),t._v(" "),r("div",{staticClass:"card-header-right"},[1==e.states?[r("el-button",{attrs:{name:"编辑",site:"form",type:"success",size:"mini"},on:{click:function(r){return t.handleEdit(e)}}},[t._v("编辑")]),t._v(" "),r("el-button",{attrs:{name:"入库",site:"form",type:"primary",size:"mini"},on:{click:function(r){return t.handleIncome(e)}}},[t._v("入库")]),t._v(" "),r("el-button",{attrs:{name:"删除",site:"form",type:"danger",size:"mini"},on:{click:function(r){return t.del(e)}}},[t._v("删除")])]:t._e(),t._v(" "),1!=e.states?[r("el-button",{attrs:{site:"form",type:"success",size:"mini"},on:{click:function(r){return t.handleExport("procureExport","采购入库单-"+e.businessFormCode,{id:e.id})}}},[t._v("导出入库单")])]:t._e(),t._v(" "),r("el-button",{attrs:{name:"查看详情",site:"form",type:"info",size:"mini"},on:{click:function(r){return t.handleDetail(e)}}},[t._v("查看详情")])],2)]),t._v(" "),r("div",{staticClass:"one-hed"},[r("div",{staticClass:"box"},[r("span",{staticClass:"span-two"},[t._v("机构:")]),t._v(t._s(e.agencyName))]),t._v(" "),r("div",{staticClass:"box"},[r("span",{staticClass:"span-two"},[t._v("操作人:")]),t._v(t._s(e.buyerName))]),t._v(" "),r("div",{staticClass:"box"},[r("span",{staticClass:"span-two"},[t._v("采购时间:")]),t._v(t._s(t._f("formatTime")(e.procureTime))+"\n                          ")]),t._v(" "),r("div",{staticClass:"box"},[r("span",{staticClass:"span-two"},[t._v("入库时间:")]),t._v(t._s(t._f("formatTime")(e.incomeTime))+"\n                          ")])]),t._v(" "),r("div",{staticClass:"card-end"},t._l(e.fromProcureTemplateInfoList,(function(e,n){return r("div",{key:n,staticClass:"item"},[r("div",{staticClass:"name"},[t._v(t._s(e.goodsTemplateName))]),t._v(" "),r("div",{staticClass:"value-box"},[r("div",{staticClass:"value-box-item"},[r("span",{staticClass:"label"},[t._v("数量:")]),t._v(" "),r("span",{staticClass:"value"},[t._v(t._s(e.count))]),t._v(" "),r("span",{staticClass:"unit"},[t._v(t._s(e.unit))])])])])})),0)])])],1)})),1):r("el-empty",{attrs:{description:"暂无数据"}})],1)]),t._v(" "),r("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.editSetting.show?r("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?r("detail",{ref:"detailRef",attrs:{setting:t.detailSetting},on:{close:function(e){t.detailSetting.show=!1}}}):t._e(),t._v(" "),r("my-import",{attrs:{"import-setting":t.importSetting,"dialog-show":t.importSetting.dialogShow,"dialog-title":t.importSetting.dialogTitle}})],1)},o=[],a=r("5688"),i=r("f6e8"),s=r("433d"),l=r("9960"),c=r("6b6f"),u=r("bee9"),d=r("dee4"),p=r("271c");function f(t){return f="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},f(t)}function m(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 g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function h(t,e,r){return(e=v(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t){var e=b(t,"string");return"symbol"==f(e)?e:e+""}function b(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var y={name:"index",mixins:[p["default"]],components:{MyButton:i["a"],myImport:l["default"],edit:c["default"],detail:u["default"]},data:function(){return{loading:!1,adddialog:!1,list:[],items:[{type:"text",dataIndex:"businessFormCode",label:"入库单号",placeholder:"请输入",defaultValue:""},{type:"cascader",dataIndex:"agencyId",label:"机构",placeholder:"请选择",optionsConfig:{url:"/pc/fin/sys/tenant/select/tree_fin_tenant",props:null},cascader:[{key:"goodsTemplateId",queryKey:"agencyId"}],defaultValue:"",options:[]},{type:"select",dataIndex:"goodsTemplateId",label:"物品名称",placeholder:"请输入",defaultValue:"",options:[],optionsConfig:{label:"goodsName",value:"id",url:s["a"].apiBaseURL+"/pc/base/goods/template/query/goodsTemplate"}},{type:"text",dataIndex:"createName",label:"创建人",placeholder:"请输入",defaultValue:""},{type:"select",dataIndex:"states",label:"状态",placeholder:"请选择",defaultValue:"",options:[{label:"全部",value:""},{label:"待入库",value:"1"},{label:"已入库",value:"2"}]},{type:"date-picker",dataIndex:"startTime",label:"入库时间",defaultValue:""},{type:"date-picker",dataIndex:"endTime",label:"至",defaultValue:""}],treeDataList:[],importSetting:{dialogTitle:"导入",dialogShow:!1,fileSettings:{data:{},uploadUrl:Object(d["b"])()+"/pc/whForm/procure/import",accept:".xls",type:"text",loading:!0},templateSettings:{templateName:"导入模板.xls",templateUrl:s["a"].apiBaseURL+"/pc/fin/sys/tenant/getImportTemplate?type=procure"},onSuccess:null}}},created:function(){this.fetchData()},methods:{fetchData:function(){var t=this;this.loading=!0,Object(a["h"])(g({pageNum:this.pageNum,pageSize:this.pageSize},this.filterFrom)).then((function(e){t.list=e.datas,t.total=e.totalRows,t.loading=!1}))},importOrg:function(){var t=this;this.importSetting.dialogShow=!0,this.importSetting.onSuccess=function(e,r){1===e.code?(t.$message.success(e.msg),t.search(1)):t.$message.warning(e.msg),r()}},handleIncome:function(t){var e=this;this.$confirm("您确定 单号:".concat(t.businessFormCode,"  入库吗?"),"采购入库",{beforeClose:function(r,n,o){"confirm"==r?(n.confirmButtonLoading=!0,n.confirmButtonText="执行中...",Object(a["g"])({id:t.id}).then((function(t){e.$message.success("入库成功!"),o(),n.confirmButtonLoading=!1,e.search()})).catch((function(){o()}))):o()}})},del:function(t){var e=this;this.$modal.confirm('是否确认删除入库单号为"'+t.businessFormCode+'"的数据吗?').then((function(){Object(a["d"])({id:t.id}).then((function(t){e.$message.success("删除成功!"),e.search()})).catch((function(){}))}))},openImport:function(){this.importOrg()}}},w=y,_=(r("2528"),r("2877")),S=Object(_["a"])(w,n,o,!1,null,"4fbf0352",null);e["default"]=S.exports},bee9: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-detail",attrs:{title:t.setting.title,width:"800px",loading:t.loading},on:{close:t.close}},[r("el-row",{attrs:{gutter:20}},[r("el-col",{attrs:{span:8}},[r("span",[t._v("入库单号:")]),t._v(" "),r("span",[t._v(t._s(t.detail.businessFormCode))])]),t._v(" "),r("el-col",{attrs:{span:8}},[r("span",[t._v("入库仓库:")]),t._v(" "),r("span",[t._v(t._s(t.detail.warehouseName))])]),t._v(" "),r("el-col",{attrs:{span:8}},[r("span",[t._v("所属机构:")]),t._v(" "),r("span",[t._v(t._s(t.detail.agencyName))])])],1),t._v(" "),r("el-row",{staticStyle:{"margin-top":"20px"},attrs:{gutter:20}},[r("el-col",{attrs:{span:8}},[r("span",[t._v("状态:")]),t._v(" "),r("span",[t._v(t._s(1==t.detail.states?"待入库":"已入库"))])]),t._v(" "),r("el-col",{attrs:{span:8}},[r("span",[t._v("创建人:")]),t._v(" "),r("span",[t._v(t._s(t.detail.buyerName))])]),t._v(" "),r("el-col",{attrs:{span:8}},[r("span",[t._v("入库时间:")]),t._v(" "),r("span",[t._v(t._s(t._f("formatTime")(t.detail.incomeTime)))])])],1),t._v(" "),r("el-row",{staticStyle:{"margin-top":"20px"},attrs:{gutter:20}},[r("el-col",{staticClass:"img-row",attrs:{span:12}},[r("span",[t._v("采购类型:")]),t._v(" "),r("span",[t._v(t._s(1==t.detail.buyType?"集采":"自采"))])])],1),t._v(" "),r("el-row",{staticStyle:{"margin-top":"20px"},attrs:{gutter:20}},[r("el-col",{staticClass:"img-row",attrs:{span:24}},[r("span",[t._v("采购手续照片:")]),t._v(" "),t._l(t.fileList,(function(e,n){return r("div",{key:n,staticClass:"img-box",on:{click:function(r){return t.handlePreview(e)}}},[r("img",{staticClass:"img",attrs:{src:t.getUrl(e.path),alt:""}})])}))],2)],1),t._v(" "),t._l(t.detail.procureGoods,(function(e,n){return r("div",{key:n,staticClass:"goods-card"},[r("el-row",{attrs:{gutter:20}},[r("el-col",{attrs:{span:8}},[r("span",[t._v("物品分类:")]),t._v(" "),r("span",[t._v(t._s(e.baseCategoryName))])]),t._v(" "),r("el-col",{attrs:{span:8}},[r("span",[t._v("物品名称:")]),t._v(" "),r("span",[t._v(t._s(e.goodsTemplateName))])]),t._v(" "),r("el-col",{attrs:{span:8}},[r("span",[t._v("供货商:")]),t._v(" "),r("span",[t._v(t._s(e.supplier))])])],1),t._v(" "),r("el-table",{staticStyle:{"margin-top":"20px"},attrs:{data:e.models,stripe:!0}},[r("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(" "),r("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(" "),r("el-table-column",{attrs:{prop:"price",label:"单价",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n          "+t._s(t._f("formatPrice")(e.row.price))+"\n        ")]}}],null,!0)}),t._v(" "),r("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(" "),r("el-table-column",{attrs:{prop:"counts",label:"金额",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n          "+t._s(t._f("formatPrice")(e.row.price*e.row.counts))+"\n        ")]}}],null,!0)})],1)],1)})),t._v(" "),r("div",{staticStyle:{display:"none"},attrs:{id:"uploadPreviewImages"}},t._l(t.fileList,(function(e,n){return r("span",{key:n},[t.checkImg(e.name)?r("img",{staticClass:"v-img",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.getUrl(e.path),alt:e.name}}):t._e()])})),0)],2)},o=[],a=r("5688"),i=r("f76d"),s=r("6f7e"),l=r("dee4"),c=r("c82c"),u=r.n(c),d=(r("0808"),null),p={components:{winMd:i["a"]},props:{setting:{type:Object,default:function(){}}},data:function(){return{loading:!0,fileList:[],detail:{baseCategoryName:"",businessFormCode:"",goodsTemplateName:"",procureDoc:"",agencyId:"",agencyName:"",states:"",createName:"",time:"",procureGoods:[{},{}],fileKey:Math.random()}}},filters:{formatTime:function(t){return t?s["LongToDateTime"](t):"-"},formatPrice:function(t){return t/100}},created:function(){var t=this;Object(a["e"])({id:this.setting.id}).then((function(e){t.loading=!1,t.detail=e,t.fileList=t.detail.procureDoc?JSON.parse(t.detail.procureDoc):[],t.$nextTick((function(){t.initPreviewImg()}))}))},methods:{initPreviewImg:function(){null!=d&&d.destroy();var t=document.querySelector("#uploadPreviewImages");d=new u.a(t,{})},handlePreview:function(t){if(!this.checkImg(t.name))return!1;for(var e=0,r=0;r<this.fileList.length;r++){var n=this.fileList[r];if(this.checkImg(n.name)){if(t.id==n.id)break;e++}}d.view(e)},checkImg:function(t){var e=t.substring(t.lastIndexOf("."),t.length),r=[".jpg",".jpeg",".png",".bmp"];return!(r.indexOf(e)<0)},getUrl:function(t){return"http://"==t.substr(0,7).toLowerCase()||"https://"==t.substr(0,8).toLowerCase()?t:Object(l["c"])()+t},close:function(){this.$emit("close")}}},f=p,m=(r("9f17"),r("2877")),g=Object(m["a"])(f,n,o,!1,null,"9d632596",null);e["default"]=g.exports},c56b:function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return i}));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 i(t){return Object(n["a"])({url:"/pc/base/category/detail",method:"get",params:t})}},d4df:function(t,e,r){},e3fa:function(t,e,r){"use strict";r("d4df")},f146:function(t,e,r){}}]);