(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-88bee8ea"],{"0264":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",{attrs:{title:t.setting.title,width:"800px",loading:t.loading},on:{close:t.close}},[r("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:t.formData,rules:t.rules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"物品名称",prop:"goodsName"}},[r("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入物品名称",clearable:"",maxlength:"20","show-word-limit":""},model:{value:t.formData.goodsName,callback:function(e){t.$set(t.formData,"goodsName",e)},expression:"formData.goodsName"}})],1),t._v(" "),r("el-form-item",{attrs:{label:"物品分类",prop:"categoryId"}},[r("el-cascader",{staticStyle:{width:"100%"},attrs:{clearable:"",filterable:"",placeholder:"请选择物品分类",options:t.categoryList,props:{emitPath:!1,value:"id"}},model:{value:t.formData.categoryId,callback:function(e){t.$set(t.formData,"categoryId",e)},expression:"formData.categoryId"}})],1),t._v(" "),t._l(t.formData.models,(function(e,n){return r("el-row",{attrs:{gutter:20}},[r("el-col",{attrs:{span:9}},[r("el-form-item",{attrs:{label:"规格型号",prop:"models."+n+".modelName",rules:t.rules.modelName}},[r("el-input",{staticStyle:{width:"100%"},attrs:{disabled:!!t.setting.id,placeholder:"请输入规格型号名称",clearable:"",maxlength:"20","show-word-limit":""},model:{value:e.modelName,callback:function(r){t.$set(e,"modelName",r)},expression:"m.modelName"}})],1)],1),t._v(" "),r("el-col",{attrs:{span:9}},[r("el-form-item",{attrs:{label:"单位",prop:"models."+n+".unit",rules:t.rules.unit}},[r("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入单位",clearable:"",maxlength:"20","show-word-limit":""},model:{value:e.unit,callback:function(r){t.$set(e,"unit",r)},expression:"m.unit"}})],1)],1),t._v(" "),r("el-col",{attrs:{span:6}},[t.formData.models.length>1?r("my-button",{key:"d"+n,attrs:{name:"删除",type:"danger"},on:{click:function(e){return t.delCode(n)}}}):t._e(),t._v(" "),n===t.formData.models.length-1?r("my-button",{key:"a"+n,attrs:{name:"新增型号",type:""},on:{click:t.addCode}}):t._e()],1)],1)})),t._v(" "),r("el-form-item",{attrs:{label:"状态",prop:"states"}},[r("el-radio-group",{model:{value:t.formData.states,callback:function(e){t.$set(t.formData,"states",e)},expression:"formData.states"}},[r("el-radio",{attrs:{label:1,border:""}},[t._v("启用")]),t._v(" "),r("el-radio",{attrs:{label:0,border:""}},[t._v("禁用")])],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.save}})],1)],1)},o=[],a=r("f76d"),i=r("f6e8"),c=r("f596"),u=r("c56b"),s=r("2f62");function l(t){return l="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},l(t)}function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */f=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",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,i=Object.create(a.prototype),c=new I(n||[]);return o(i,"_invoke",{value:N(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var m="suspendedStart",p="suspendedYield",g="executing",y="completed",v={};function b(){}function w(){}function O(){}var j={};s(j,i,(function(){return this}));var x=Object.getPrototypeOf,L=x&&x(x($([])));L&&L!==r&&n.call(L,i)&&(j=L);var _=O.prototype=b.prototype=Object.create(j);function k(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,a,i,c){var u=h(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function N(e,r,n){var o=m;return function(a,i){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=D(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?y:p,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function D(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,D(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=h(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 P(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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function $(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(l(e)+" is not iterable")}return w.prototype=O,o(_,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:w,configurable:!0}),w.displayName=s(O,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,s(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},k(E.prototype),s(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new E(d(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},k(_),s(_,u,"Generator"),s(_,i,(function(){return this})),s(_,"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=$,I.prototype={constructor:I,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(S),!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 c.type="throw",c.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],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)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),S(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;S(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:$(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function d(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){d(a,n,o,i,c,"next",t)}function c(t){d(a,n,o,i,c,"throw",t)}i(void 0)}))}}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 p(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){g(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 g(t,e,r){return(e=y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t){var e=v(t,"string");return"symbol"==l(e)?e:e+""}function v(t,e){if("object"!=l(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var b={components:{winMd:a["a"],myButton:i["a"]},props:{setting:{type:Object,default:function(){}}},data:function(){return{loading:!0,categoryList:[],checkAll:!1,checkedList:[],formData:{goodsName:"",states:1,summary:"",categoryId:null,agencyId:"",agencyName:"",models:[{modelName:"",unit:""}]},rules:{goodsName:[{required:!0,message:"请输入物品名称",trigger:"blur"}],categoryId:[{required:!0,message:"请选择物品分类",trigger:"blur"}],modelName:[{required:!0,message:"请输入规格名称",trigger:"blur"}],unit:[{required:!0,message:"请输入单位",trigger:"blur"}]}}},computed:p({},Object(s["b"])(["userInfo"])),created:function(){var t=h(f().mark((function t(){var e=this;return f().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!this.setting.id){t.next=3;break}return t.next=3,Object(c["f"])({id:this.setting.id}).then((function(t){e.formData=t,e.formData.agencyId||(e.formData.agencyId=e.userInfo.tenantId,e.formData.agencyName=e.userInfo.tenantName)}));case 3:return t.next=5,this.tree_List();case 5:this.loading=!1;case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),methods:{tree_List:function(){var t=h(f().mark((function t(){var e=this;return f().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(u["b"])().then((function(t){t&&(e.categoryList=t)}));case 2:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}(),addCode:function(){this.formData.models.push({modelName:"",unit:""})},delCode:function(t){this.formData.models.splice(t,1)},getEditInfo:function(t){},close:function(){this.$emit("close")},save:function(){var t=this;this.$refs.ruleForm.validate((function(e){if(e){var r=Object.assign({},t.formData);if(t.loading)return;t.loading=!0,t.setting.id?Object(c["e"])(r).then((function(e){t.loading=!1,e?(t.$message.success("保存成功!"),t.close(),t.$emit("search")):t.$message.error("保存失败")})):(r.orgId=t.setting.orgId,Object(c["a"])(r).then((function(e){t.loading=!1,e?(t.$message.success("保存成功!"),t.close(),t.$emit("search")):t.$message.error("保存失败")})))}else t.$message.error("校验未通过,请检查。")}))}}},w=b,O=r("2877"),j=Object(O["a"])(w,n,o,!1,null,null,null);e["default"]=j.exports},"433d":function(t,e,r){"use strict";var n=r("c559"),o={ftpUrl:n["a"].ftpUrl,apiBaseURL:n["a"].apiBaseURL};e["a"]=o},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})}},f596:function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"e",(function(){return i})),r.d(e,"f",(function(){return c})),r.d(e,"h",(function(){return u})),r.d(e,"b",(function(){return s})),r.d(e,"d",(function(){return l})),r.d(e,"g",(function(){return f}));var n=r("b775");function o(t){return Object(n["a"])({url:"/pc/base/goods/template/add",method:"post",data:t})}function a(t){return Object(n["a"])({url:"/pc/base/goods/template/del",method:"delete",data:t})}function i(t){return Object(n["a"])({url:"/pc/base/goods/template/edit",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/pc/base/goods/template/detail",method:"get",params:t})}function u(t){return Object(n["a"])({url:"/pc/base/goods/template/updStatus",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/pc/base/goods/models/add",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/pc/base/goods/models/del",method:"delete",data:t})}function f(t){return Object(n["a"])({url:"/pc/base/goods/models/updStatus",method:"post",data:t})}}}]);
|