2024-09-05 09:27:56 +08:00

1 line
98 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["n"],{"0c19":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"account area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入账户名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入账户编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number\t"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[e.$lib.getUserRoot(e.store.root,"base","add")?[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"账户名称",align:"center",width:"220px"}}),t("el-table-column",{attrs:{prop:"number",label:"账户编号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"frameData.name",label:"所属组织",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"extension.money",label:"账户余额",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息 ",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"190px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"base","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del(a.row.id)}}},[e._v("删除")])]:e._e()],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"详情",width:"420px"},on:{"update:visible":function(t){e.dialog=t}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"账户名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入账户名称",clearable:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"账户编号",prop:"number"}},[t("el-input",{attrs:{placeholder:"请输入账户编号",clearable:""},model:{value:e.form.number,callback:function(t){e.$set(e.form,"number",t)},expression:"form.number"}})],1),t("el-form-item",{attrs:{label:"所属组织",prop:"frame"}},[t("nodTree",{attrs:{treeData:e.store.frame,placeholder:"请选择所属组织"},model:{value:e.form.frame,callback:function(t){e.$set(e.form,"frame",t)},expression:"form.frame"}})],1),t("el-form-item",{attrs:{label:"余额日期",prop:"time"}},[t("el-date-picker",{attrs:{placeholder:"请输入余额日期",clearable:"",type:"date"},model:{value:e.form.time,callback:function(t){e.$set(e.form,"time",t)},expression:"form.time"}})],1),t("el-form-item",{attrs:{label:"期初余额",prop:"initial"}},[t("el-input",{attrs:{placeholder:"请输入期初余额",clearable:""},model:{value:e.form.initial,callback:function(t){e.$set(e.form,"initial",t)},expression:"form.initial"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog=!1}}},[e._v("取消")]),0==e.form.id||e.$lib.getUserRoot(e.store.root,"base","edit")?[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])]:e._e()],2)],1)],1)},s=[],o=(a("d9e2"),a("23f7")),l={name:"Account",components:{NodTree:o["a"]},data:function(){var e=this;return{searchFrom:{name:"",number:"",data:""},tableData:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:!1,form:{id:0,name:"",number:"",frame:null,time:"",initial:0,data:""},rules:{name:{required:!0,message:"请输入账户名称",trigger:"blur"},number:{required:!0,message:"请输入账户编号",trigger:"blur"},frame:{required:!0,message:"请选择所属组织",trigger:"change"},time:{required:!0,message:"请选择余额日期",trigger:"change"},initial:[{required:!0,message:"请输入期初余额",trigger:"blur"},{validator:function(t,a,r){e.$lib.validate("numerical",a)?r():r(new Error("期初余额不正确"))},trigger:"blur"}]}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("account/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.form=Object.assign({},this.$options.data().form),e>0?this.$axios.post("account/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.dialog=!0},save:function(){var e=this;this.$refs["form"].validate((function(t){t&&e.$axios.post("account/save",e.form).then((function(t){"success"==t.state?(e.record(0),e.dialog=!1,e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("account/del",{id:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},n=l,i=(a("80ad"),a("2877")),c=Object(i["a"])(n,r,s,!1,null,"627a7dd8",null);t["default"]=c.exports},"0cff":function(e,t,a){"use strict";a("d437")},"21fd":function(e,t,a){},"23f7":function(e,t,a){"use strict";var r=function(){var e=this,t=e._self._c;return t("el-popover",{ref:"nodTree",staticClass:"nodTree"},[t("el-input",{attrs:{slot:"reference",placeholder:e.placeholder,readonly:""},nativeOn:{keydown:function(t){return e.inputEvent.apply(null,arguments)}},slot:"reference",model:{value:e.label,callback:function(t){e.label=t},expression:"label"}},[t("template",{slot:"suffix"},[t("i",{class:["el-input__icon",""!=e.label?"el-icon-circle-close":"el-icon-arrow-down"],on:{click:function(t){return t.stopPropagation(),e.delModel.apply(null,arguments)}}})])],2),t("el-tree",{ref:"tree",attrs:{data:e.treeData,props:e.treeProps,"node-key":e.treeKey,"current-node-key":e.checked,"show-checkbox":e.checkbox,"check-strictly":e.checkStrictly,"default-checked-keys":e.checkeds,"default-expanded-keys":e.expanded,"highlight-current":!0},on:{check:e.setTree,"node-click":e.setTree}})],1)},s=[],o=a("b85c"),l=(a("7db0"),a("a15b"),a("14d9"),a("b0c0"),a("d3b7"),{name:"NodTree",props:{value:{required:!0},treeData:{required:!0,type:Array},treeKey:{default:"id"},treeProps:{default:function(){return{label:"name",children:"sub"}}},placeholder:{default:"请点击选择数据"},checkStrictly:{default:!1}},data:function(){return{label:"",checked:null,checkeds:[],expanded:[],checkbox:!1}},created:function(){this.init()},computed:{flatTree:function(){var e=this.$lib.flatten(this.treeData);return e}},watch:{value:{handler:function(e){this.checkbox?this.$lib.comparison(e,this.checkeds)&&(this.checkeds=e,this.$refs.tree.setCheckedKeys(e,!0)):e!=this.checked&&(this.checked=e,this.$refs.tree.setCurrentKey(e))},deep:!0},checked:function(){this.setInput()},checkeds:{handler:function(){this.setInput()},deep:!0}},methods:{init:function(){var e=this;if(null!=this.value){Array.isArray(this.value)?(this.checkbox=!0,this.checkeds=this.value):(this.checkbox=!1,this.checked=this.value);var t,a=Object(o["a"])(this.checkbox?this.checkeds:[this.checked]);try{var r=function(){var a=t.value,r=e.flatTree.find((function(e){return e.id==a}));void 0!=r&&r.hasOwnProperty("pid")&&e.expanded.push(r.pid)};for(a.s();!(t=a.n()).done;)r()}catch(s){a.e(s)}finally{a.f()}}},setInput:function(){var e,t=this,a=[],r=Object(o["a"])(this.checkbox?this.checkeds:[this.checked]);try{var s=function(){var r=e.value,s=t.flatTree.find((function(e){return e.id==r}));void 0==s||a.push(s.name)};for(r.s();!(e=r.n()).done;)s()}catch(l){r.e(l)}finally{r.f()}this.label=a.join(",")},setTree:function(e){this.checkbox?(this.checkeds=this.$refs.tree.getCheckedKeys(),this.$emit("input",this.checkeds)):(this.checked=e.id,this.$emit("input",this.checked),this.$refs["nodTree"].showPopper=!1)},delModel:function(){this.label="",this.checkbox?(this.checkeds=[],this.$refs.tree.setCheckedKeys([])):(this.checked=null,this.$refs.tree.setCurrentKey(null)),this.$emit("input",this.checkbox?[]:null),this.$refs["nodTree"].showPopper=!1},inputEvent:function(e){this.$refs["nodTree"].showPopper&&27==e.keyCode&&e.stopPropagation()}}}),n=l,i=(a("d683"),a("2877")),c=Object(i["a"])(n,r,s,!1,null,"9f20837e",null);t["a"]=c.exports},"3ff7":function(e,t,a){},"51cb":function(e,t,a){"use strict";a("620b")},5549:function(e,t,a){"use strict";a("b0c0");var r=function(){var e=this,t=e._self._c;return t("el-dropdown",{staticClass:"nodUpload",attrs:{"split-button":"",placement:"bottom-start"}},[t("el-upload",{attrs:{action:e.action,headers:{Token:e.$store.state.token},"show-file-list":!1,"on-success":e.uploadSuccess}},[t("i",{staticClass:"text el-icon-upload"},[e._v(" 点击上传")])]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e.files.length>0?[e._l(e.files,(function(a,r){return[t("li",[t("el-row",[t("el-col",{attrs:{span:22}},[t("p",{staticClass:"file",on:{click:function(t){return e.preview(a)}}},[e._v(e._s(a.name))])]),t("el-col",{attrs:{span:2}},[t("i",{staticClass:"el-icon-delete",on:{click:function(t){return e.remove(r)}}})])],1)],1)]}))]:[t("li",{staticClass:"empty"},[e._v("暂无文件信息")])]],2)],1)},s=[],o=(a("99af"),a("14d9"),a("a434"),{name:"NodUpload",props:{value:{required:!0,type:Array},action:{required:!0}},data:function(){return{files:[]}},created:function(){this.files=[].concat(this.value)},watch:{value:{handler:function(e){this.$lib.comparison(e,this.files)||(this.files=[].concat(e))},deep:!0}},methods:{uploadSuccess:function(e,t){"success"==e.state?(this.files.push({name:t.name,url:e.info}),this.incident(),this.$message({type:"success",message:"[ "+t.name+" ] 上传成功!"})):"error"==e.state?this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info}):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},remove:function(e){this.files.splice(e,1),this.incident()},incident:function(){this.$emit("input",this.files),this.$emit("change",this.files)},preview:function(e){this.$message({type:"success",message:"[ "+e.name+" ] 下载请求中..."}),setTimeout((function(){window.open(e.url)}),1e3)}}}),l=o,n=(a("fbb4"),a("2877")),i=Object(n["a"])(l,r,s,!1,null,"7b62d576",null);t["a"]=i.exports},"577a":function(e,t,a){"use strict";a("e563")},"5fb4":function(e,t,a){"use strict";var r=function(){var e=this,t=e._self._c;return e.fields.length>0?t("draggable",{staticClass:"fieldForm",attrs:{list:e.fields,disabled:!e.drag,tag:"div"},on:{choose:e.dragChoose,end:e.dragEnd}},[e._l(e.fields,(function(a,r){return[t("el-form-item",{key:r,attrs:{label:a.label,prop:e.prefix+a.prop,rules:a.rules}},["text"==a.type?[t("el-input",{attrs:{type:"text",placeholder:a.placeholder},model:{value:e.source[a.model],callback:function(t){e.$set(e.source,a.model,t)},expression:"source[field.model]"}})]:e._e(),"time"==a.type?[t("el-date-picker",{attrs:{type:"date",placeholder:a.placeholder,"value-format":"yyyy-MM-dd"},model:{value:e.source[a.model],callback:function(t){e.$set(e.source,a.model,t)},expression:"source[field.model]"}})]:e._e(),"textarea"==a.type?[t("el-input",{attrs:{type:"textarea",placeholder:a.placeholder},model:{value:e.source[a.model],callback:function(t){e.$set(e.source,a.model,t)},expression:"source[field.model]"}})]:e._e(),"select"==a.type?[t("el-select",{attrs:{placeholder:a.placeholder,clearable:""},model:{value:e.source[a.model],callback:function(t){e.$set(e.source,a.model,t)},expression:"source[field.model]"}},e._l(a.options,(function(e){return t("el-option",{key:e,attrs:{label:e,value:e}})})),1)]:e._e(),"checkbox"==a.type?[t("el-checkbox-group",{model:{value:e.source[a.model],callback:function(t){e.$set(e.source,a.model,t)},expression:"source[field.model]"}},e._l(a.checkboxs,(function(e){return t("el-checkbox",{key:e,attrs:{label:e}})})),1)]:e._e(),"upload"==a.type?[t("NodUpload",{attrs:{action:e.$base.web+"service/fieldUpload"},model:{value:e.source[a.model],callback:function(t){e.$set(e.source,a.model,t)},expression:"source[field.model]"}})]:e._e()],2)]}))],2):e._e()},s=[],o=a("b85c"),l=a("b76a"),n=a.n(l),i=a("5549"),c={name:"FieldForm",components:{draggable:n.a,NodUpload:i["a"]},props:{value:{required:!0,type:Object},prefix:{default:""},rule:{required:!0},drag:{default:!1}},data:function(){return{source:{},fields:[]}},computed:{store:function(){return this.$store.state}},watch:{value:{handler:function(e){this.$lib.comparison(e,this.source)||this.init()},deep:!0},source:{handler:function(e){this.$emit("input",this.$lib.extend(!0,{},this.source))},deep:!0}},created:function(){Array.isArray(this.rule)?(this.fields=this.rule,this.init()):this.store.fields.hasOwnProperty(this.rule)&&(this.fields=this.store.fields[this.rule],this.init())},methods:{init:function(){var e,t={},a={},r=Object(o["a"])(this.fields);try{for(r.s();!(e=r.n()).done;){var s=e.value;t[s.model]=s.value,this.value.hasOwnProperty(s.model)&&!this.$lib.VariableEqual(s.value,this.value[s.model])&&(a[s.model]=s.value)}}catch(l){r.e(l)}finally{r.f()}this.source=this.$lib.extend(!0,{},t,this.value,a)},dragChoose:function(e){this.$emit("dragChoose",e.oldIndex)},dragEnd:function(e){this.$emit("dragEnd",e.newIndex)}}},u=c,m=a("2877"),d=Object(m["a"])(u,r,s,!1,null,null,null);t["a"]=d.exports},"61af":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"warehouse area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入仓库名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入仓库编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number\t"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入联系人员",clearable:""},model:{value:e.searchFrom.contacts,callback:function(t){e.$set(e.searchFrom,"contacts",t)},expression:"searchFrom.contacts"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入联系电话",clearable:""},model:{value:e.searchFrom.tel,callback:function(t){e.$set(e.searchFrom,"tel",t)},expression:"searchFrom.tel"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入仓库地址",clearable:""},model:{value:e.searchFrom.add,callback:function(t){e.$set(e.searchFrom,"add",t)},expression:"searchFrom.add"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[e.$lib.getUserRoot(e.store.root,"base","add")?[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"仓库名称",align:"center",width:"220px"}}),t("el-table-column",{attrs:{prop:"number",label:"仓库编号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"frameData.name",label:"所属组织",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息 ",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"190px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"base","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del(a.row.id)}}},[e._v("删除")])]:e._e()],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"详情",width:"420px"},on:{"update:visible":function(t){e.dialog=t}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"仓库名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入仓库名称",clearable:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"仓库编号",prop:"number"}},[t("el-input",{attrs:{placeholder:"请输入仓库编号",clearable:""},model:{value:e.form.number,callback:function(t){e.$set(e.form,"number",t)},expression:"form.number"}})],1),t("el-form-item",{attrs:{label:"所属组织",prop:"frame"}},[t("nodTree",{attrs:{treeData:e.store.frame,placeholder:"请选择所属组织"},model:{value:e.form.frame,callback:function(t){e.$set(e.form,"frame",t)},expression:"form.frame"}})],1),t("el-form-item",{attrs:{label:"联系人员"}},[t("el-input",{attrs:{placeholder:"请输入联系人员",clearable:""},model:{value:e.form.contacts,callback:function(t){e.$set(e.form,"contacts",t)},expression:"form.contacts"}})],1),t("el-form-item",{attrs:{label:"联系电话"}},[t("el-input",{attrs:{placeholder:"请输入联系电话",clearable:""},model:{value:e.form.tel,callback:function(t){e.$set(e.form,"tel",t)},expression:"form.tel"}})],1),t("el-form-item",{attrs:{label:"仓库地址"}},[t("el-input",{attrs:{placeholder:"请输入仓库地址",clearable:""},model:{value:e.form.add,callback:function(t){e.$set(e.form,"add",t)},expression:"form.add"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog=!1}}},[e._v("取消")]),0==e.form.id||e.$lib.getUserRoot(e.store.root,"base","edit")?[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])]:e._e()],2)],1)],1)},s=[],o=a("23f7"),l={name:"Warehouse",components:{NodTree:o["a"]},data:function(){return{searchFrom:{name:"",number:"",contacts:"",tel:"",add:"",data:""},tableData:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:!1,form:{id:0,name:"",number:"",frame:null,contacts:"",tel:"",add:"",data:""},rules:{name:{required:!0,message:"请输入仓库名称",trigger:"blur"},number:{required:!0,message:"请输入仓库编号",trigger:"blur"},frame:{required:!0,message:"请选择所属组织",trigger:"change"}}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("warehouse/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.form=Object.assign({},this.$options.data().form),e>0?this.$axios.post("warehouse/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.dialog=!0},save:function(){var e=this;this.$refs["form"].validate((function(t){t&&e.$axios.post("warehouse/save",e.form).then((function(t){"success"==t.state?(e.record(0),e.dialog=!1,e.$lib.updateStore(e),e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}))},del:function(e){var t=this;this.$confirm("您确定要删除该数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("warehouse/del",{id:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},n=l,i=(a("51cb"),a("2877")),c=Object(i["a"])(n,r,s,!1,null,"2e36f542",null);t["default"]=c.exports},"620b":function(e,t,a){},"631a":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"supplier area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入供应商名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入供应商编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择供应商类别",clearable:""},model:{value:e.searchFrom.category,callback:function(t){e.$set(e.searchFrom,"category",t)},expression:"searchFrom.category"}},[e._l(e.store.sys.srCategory,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入联系人员",clearable:""},model:{value:e.searchFrom.contacts,callback:function(t){e.$set(e.searchFrom,"contacts",t)},expression:"searchFrom.contacts"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入联系电话",clearable:""},model:{value:e.searchFrom.tel,callback:function(t){e.$set(e.searchFrom,"tel",t)},expression:"searchFrom.tel"}})],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择所属用户",action:"service/userRecord",scene:"user"},model:{value:e.searchFrom.user,callback:function(t){e.$set(e.searchFrom,"user",t)},expression:"searchFrom.user"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[0!=e.tableSelection.length?[e.$lib.getUserRoot(e.store.root,"base","del")?[t("el-button",{attrs:{type:"info"},on:{click:function(t){return e.del(e.tableSelection)}}},[e._v("删除")])]:e._e()]:e._e(),e.$lib.getUserRoot(e.store.root,"base","add")?[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")])]:e._e(),e.$lib.getUserRoot(e.store.root,"base","batch")?[t("el-button",{on:{click:function(t){e.batch.dialog=!0}}},[e._v("批量")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""},on:{"selection-change":e.selectionChange}},[t("el-table-column",{attrs:{type:"selection",align:"center",width:"39px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"name",label:"供应商名称",align:"center",width:"260px"}}),t("el-table-column",{attrs:{prop:"number",label:"供应商编号",align:"center",width:"180px"}}),t("el-table-column",{attrs:{prop:"category",label:"供应商类别",align:"center",width:"180px"}}),t("el-table-column",{attrs:{prop:"balance",label:"应付款余额",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"frameData.name",label:"所属组织",align:"center",width:"180px"}}),t("el-table-column",{attrs:{prop:"userData.name",label:"所属用户",align:"center",width:"180px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息 ",align:"center","min-width":"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"200px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"base","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del([a.row.id])}}},[e._v("删除")])]:e._e()],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.dialog.show,title:"详情",width:"700px"},on:{"update:visible":function(t){return e.$set(e.dialog,"show",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog.show?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"96px",inline:!0}},[t("el-tabs",{model:{value:e.dialog.active,callback:function(t){e.$set(e.dialog,"active",t)},expression:"dialog.active"}},[t("el-tab-pane",{attrs:{label:"基础资料",name:"base"}},[t("el-form-item",{attrs:{label:"供应商名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入供应商名称",clearable:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"供应商编号",prop:"number"}},[t("el-input",{attrs:{placeholder:"请输入供应商编号",clearable:""},model:{value:e.form.number,callback:function(t){e.$set(e.form,"number",t)},expression:"form.number"}})],1),t("el-form-item",{attrs:{label:"所属组织",prop:"frame"}},[t("nodTree",{attrs:{treeData:e.store.frame,placeholder:"请选择所属组织"},model:{value:e.form.frame,callback:function(t){e.$set(e.form,"frame",t)},expression:"form.frame"}})],1),t("el-form-item",{attrs:{label:"所属用户",prop:"user"}},[t("nodList",{attrs:{placeholder:"请选择所属用户",action:"service/userRecord",scene:"user"},model:{value:e.form.user,callback:function(t){e.$set(e.form,"user",t)},expression:"form.user"}})],1),t("el-form-item",{attrs:{label:"供应商类别"}},[t("el-select",{attrs:{placeholder:"请选择供应商类别"},model:{value:e.form.category,callback:function(t){e.$set(e.form,"category",t)},expression:"form.category"}},[e._l(e.store.sys.srCategory,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",{attrs:{label:"增值税税率",prop:"rate"}},[t("el-input",{attrs:{placeholder:"请输入增值税税率",clearable:""},model:{value:e.form.rate,callback:function(t){e.$set(e.form,"rate",t)},expression:"form.rate"}},[t("template",{slot:"suffix"},[e._v("%")])],2)],1),t("el-form-item",{attrs:{label:"开户银行"}},[t("el-input",{attrs:{placeholder:"请输入开户银行",clearable:""},model:{value:e.form.bank,callback:function(t){e.$set(e.form,"bank",t)},expression:"form.bank"}})],1),t("el-form-item",{attrs:{label:"银行账号"}},[t("el-input",{attrs:{placeholder:"请输入银行账号",clearable:""},model:{value:e.form.account,callback:function(t){e.$set(e.form,"account",t)},expression:"form.account"}})],1),t("el-form-item",{attrs:{label:"纳税号码"}},[t("el-input",{attrs:{placeholder:"请输入纳税人识别号",clearable:""},model:{value:e.form.tax,callback:function(t){e.$set(e.form,"tax",t)},expression:"form.tax"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1),t("el-tab-pane",{attrs:{label:"联系资料",name:"contacts"}},[t("el-table",{attrs:{data:e.form.contacts,height:"200px",border:""}},[t("el-table-column",{attrs:{label:"主联系人",align:"center","min-width":"90px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",[e._v(e._s(a.row.main?"是":"否"))])]}}],null,!1,295310561)}),t("el-table-column",{attrs:{prop:"name",label:"联系人员",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"tel",label:"联系号码",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"add",label:"联系地址",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息",align:"center","min-width":"120px"}}),t("el-table-column",{attrs:{prop:"set",align:"center",width:"160px",fixed:"right"},scopedSlots:e._u([{key:"header",fn:function(a){return[t("span",{staticStyle:{"margin-right":"3px"}},[e._v("相关操作")]),t("i",{staticClass:"el-icon-circle-plus-outline",on:{click:function(t){return e.setContacts(-1)}}})]}},{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.setContacts(a.$index)}}},[e._v("详情")]),t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.delContacts(a.$index)}}},[e._v("删除")])],1)]}}],null,!1,2576455115)})],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.contacts.dialog,title:"联系资料",width:"360px","append-to-body":!0},on:{"update:visible":function(t){return e.$set(e.contacts,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.contacts.dialog?[t("el-form",{ref:"contactsForm",attrs:{model:e.contacts.form,rules:e.contacts.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"主联系人"}},[t("el-switch",{model:{value:e.contacts.form.main,callback:function(t){e.$set(e.contacts.form,"main",t)},expression:"contacts.form.main"}})],1),t("el-form-item",{attrs:{label:"联系人员",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入联系人员"},model:{value:e.contacts.form.name,callback:function(t){e.$set(e.contacts.form,"name",t)},expression:"contacts.form.name"}})],1),t("el-form-item",{attrs:{label:"联系号码",prop:"tel"}},[t("el-input",{attrs:{placeholder:"请输入联系号码"},model:{value:e.contacts.form.tel,callback:function(t){e.$set(e.contacts.form,"tel",t)},expression:"contacts.form.tel"}})],1),t("el-form-item",{attrs:{label:"联系地址"}},[t("el-input",{attrs:{placeholder:"请输入联系地址"},model:{value:e.contacts.form.add,callback:function(t){e.$set(e.contacts.form,"add",t)},expression:"contacts.form.add"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息"},model:{value:e.contacts.form.data,callback:function(t){e.$set(e.contacts.form,"data",t)},expression:"contacts.form.data"}})],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.contacts.dialog=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.saveContacts}},[e._v("保存")])],1)],1)],1),e.store.fields.hasOwnProperty(e.$route.name)?[t("el-tab-pane",{attrs:{label:"扩展信息",name:"more"}},[t("FieldForm",{attrs:{rule:"supplier",prefix:"more."},model:{value:e.form.more,callback:function(t){e.$set(e.form,"more",t)},expression:"form.more"}})],1)]:e._e()],2)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog.show=!1}}},[e._v("取消")]),0==e.form.id||e.$lib.getUserRoot(e.store.root,"base","edit")?[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])]:e._e()],2)],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.batch.dialog,title:"批量",width:"420px"},on:{"update:visible":function(t){return e.$set(e.batch,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.batch.dialog?[t("el-tabs",{model:{value:e.batch.active,callback:function(t){e.$set(e.batch,"active",t)},expression:"batch.active"}},[t("el-tab-pane",{attrs:{label:"导入数据",name:"import"}},[t("ul",{staticClass:"importTip"},[t("li",[e._v("1.该功能适用于批量导入数据。")]),t("li",[e._v("2.您需要下载数据模板后使用Excel录入数据。")]),t("li",[e._v("3.录入数据时,请勿修改首行数据标题以及排序。")]),t("li",[e._v("4.请查阅使用文档获取字段格式内容以及相关导入须知。")]),t("li",[e._v("5.点击下方上传模板,选择您编辑好的模板文件即可。")])]),t("el-divider"),t("el-row",{staticStyle:{"text-align":"center"}},[t("el-col",{attrs:{span:12}},[t("el-button",{attrs:{type:"info"},on:{click:e.downTemplate}},[e._v("下载模板")])],1),t("el-col",{attrs:{span:12}},[t("el-upload",{attrs:{action:e.$base.web+"supplier/import",headers:{Token:e.$store.state.token},"show-file-list":!1,"on-success":e.importCall}},[t("el-button",{attrs:{type:"primary"}},[e._v("上传模板")])],1)],1)],1)],1),t("el-tab-pane",{attrs:{label:"导出数据",name:"export"}},[t("div",{staticClass:"exportItem",on:{click:e.exports}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("导出数据")])])])],1)]:e._e()],2)],1)],1)},s=[],o=a("b85c"),l=(a("d9e2"),a("14d9"),a("a434"),a("23f7")),n=a("a447"),i=a("5fb4"),c={name:"Supplier",components:{NodTree:l["a"],NodList:n["a"],FieldForm:i["a"]},data:function(){var e=this;return{searchFrom:{name:"",number:"",category:"",contacts:"",tel:"",user:null,data:""},tableData:[],tableSelection:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:{show:!1,active:"base"},form:{id:0,name:"",number:"",frame:null,user:null,category:"常规类别",rate:0,bank:"",account:"",tax:"",data:"",contacts:[],more:{}},rules:{name:{required:!0,message:"请输入供应商名称",trigger:"blur"},number:{required:!0,message:"请输入供应商编号",trigger:"blur"},frame:{required:!0,message:"请选择所属组织",trigger:"change"},user:{required:!0,message:"请选择所属用户",trigger:"change"},rate:[{required:!0,message:"请输入增值税税率",trigger:"blur"},{validator:function(t,a,r){e.$lib.validate("percentage",a)?r():r(new Error("增值税税率不正确"))},trigger:"blur"}]},contacts:{index:-1,dialog:!1,form:{main:!0,name:"",tel:"",add:"",data:""},rules:{name:{required:!0,message:"请输入联系人员",trigger:"blur"},tel:{required:!0,message:"请输入联系号码",trigger:"blur"}}},batch:{dialog:!1,active:"import"}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("supplier/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.form=this.$lib.extend(!0,{},this.$options.data().form),e>0?this.$axios.post("supplier/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog.show=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):(this.form.frame=this.store.user.frame,this.form.user=this.store.user.id,this.dialog.show=!0)},save:function(){var e=this;this.$refs["form"].validate((function(t){t?e.$axios.post("supplier/save",e.form).then((function(t){"success"==t.state?(e.record(0),e.dialog.show=!1,e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):e.$message({type:"warning",message:"表单验证错误,请检查并修正!"})}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("supplier/del",{parm:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},setContacts:function(e){this.contacts.form=-1==e?Object.assign({},this.$options.data().contacts.form):Object.assign({},this.form.contacts[e]),this.contacts.index=e,this.contacts.dialog=!0},saveContacts:function(){var e=this;this.$refs["contactsForm"].validate((function(t){if(t){if(0==e.form.contacts.length)e.contacts.form.main=!0;else if(1==e.contacts.form.main)for(var a in e.form.contacts)e.form.contacts[a].main=!1;e.contacts.index>-1?e.form.contacts.splice(e.contacts.index,1,e.contacts.form):e.form.contacts.push(e.contacts.form),e.$message({type:"success",message:"更新联系资料成功,保存后生效!"}),e.contacts.dialog=!1}}))},delContacts:function(e){var t=this.form.contacts[e].main;this.form.contacts.splice(e,1),1==t&&this.form.contacts.length>0&&(this.form.contacts[0].main=!0),this.$message({type:"success",message:"删除联系资料成功,保存后生效!"})},downTemplate:function(){var e=this;this.$message({type:"success",message:"[ 数据模板 ] 下载请求中..."}),setTimeout((function(){window.open(e.store.base.cdnSite+"/erp/batch/供应商导入模板.xlsx")}),1e3)},importCall:function(e,t,a){"success"==e.state?(this.$lib.updateStore(this),this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:e.info})):"error"==e.state?this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info}):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},exports:function(){var e=this;if(0==this.tableSelection.length)this.$message({type:"warning",message:"未选择导出数据内容!"});else{this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm({parm:this.tableSelection},!0);setTimeout((function(){window.open(e.$base.web+"supplier/exports?"+t)}),1e3)}},selectionChange:function(e){var t,a=[],r=Object(o["a"])(e);try{for(r.s();!(t=r.n()).done;){var s=t.value;a.push(s.id)}}catch(l){r.e(l)}finally{r.f()}this.tableSelection=a},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},u=c,m=(a("a049"),a("2877")),d=Object(m["a"])(u,r,s,!1,null,"51a93eda",null);t["default"]=d.exports},"7e02":function(e,t,a){},"80ad":function(e,t,a){"use strict";a("7e02")},a049:function(e,t,a){"use strict";a("3ff7")},a447:function(e,t,a){"use strict";a("b0c0");var r=function(){var e=this,t=e._self._c;return t("el-popover",{ref:"nodList",staticClass:"nodList",attrs:{disabled:e.disabled}},[t("template",{slot:"reference"},[t("el-input",{ref:"label",attrs:{placeholder:e.placeholder,tabindex:"-1",disabled:e.disabled,readonly:""},nativeOn:{keydown:function(t){return e.inputEvent.apply(null,arguments)}},model:{value:e.label,callback:function(t){e.label=t},expression:"label"}},[t("template",{slot:"suffix"},[t("i",{class:["el-input__icon",""==e.label?"el-icon-arrow-down":"el-icon-circle-close"],on:{click:function(t){return t.stopPropagation(),e.delModel.apply(null,arguments)}}})])],2)],1),t("div",{staticClass:"selectBox"},[t("el-input",{ref:"search",attrs:{placeholder:"F1 输入内容回车搜索","prefix-icon":"el-icon-search",size:"mini",tagkey:"search"},nativeOn:{keydown:function(t){return t.stopPropagation(),e.searchEvent.apply(null,arguments)}},model:{value:e.query,callback:function(t){e.query=t},expression:"query"}}),e.optionList.length>0?[t("ul",{staticClass:"list"},[e._l(e.optionList,(function(a,r){return[t("li",{class:[{selected:a.id==e.value},{foucs:r==e.foucs}],on:{click:function(t){return e.setOption(a)}}},[e._v(e._s(a.name))])]}))],2)]:[t("p",{staticClass:"emptyList"},[e._v("未查询到数据")])],t("div",{staticClass:"operate"},[t("el-pagination",{attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,layout:"prev,next,total",background:""},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"current-change":function(t){return e.record(0)}}})],1)],2)],2)},s=[],o=(a("7db0"),a("d3b7"),a("ac1f"),a("841c"),{name:"NodList",props:{value:{required:!0},action:{required:!0},scene:{required:!0},parm:{default:function(){return{}}},disabled:{default:!1},placeholder:{default:"请点击选择数据"}},data:function(){return{id:null,label:"",query:"",optionList:[],foucs:0,page:{current:1,total:0,size:6}}},created:function(){this.record(1),this.get()},watch:{value:function(e,t){e==t||this.get()}},methods:{init:function(){this.id=null,this.label="",this.query="",this.page={current:1,total:0,size:6},this.record(1),this.$emit("input",null),this.$emit("change",null)},record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({},this.parm,{page:this.page.current,limit:this.page.size,query:this.query});this.$axios.post(this.action,a).then((function(e){"success"==e.state?(t.optionList=e.info,t.page.total=e.count,t.optionList.length>0&&"search"==document.activeElement.getAttribute("tagkey")&&(t.foucs=0,t.$refs.label.focus())):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},get:function(){var e=this;if(null!=this.value&&!this.$lib.validate("empty",this.value)){var t=this.optionList.find((function(t){return t.id==e.value}));void 0==t?this.$axios.post("service/getScene",{id:this.value,scene:this.scene}).then((function(t){"success"==t.state?null==t.info?e.$message({type:"warning",message:"[ NodList ]指定数据查询结果为空!"}):e.setOption(t.info):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.setOption(t)}},setOption:function(e){e.id!=this.id&&(this.id=e.id,this.label=e.name,this.$emit("input",e.id),this.$emit("change",e)),this.$refs["nodList"].showPopper=!1},delModel:function(){this.id=null,this.label="",this.$emit("input",null),this.$emit("change",null),this.$refs["nodList"].showPopper=!1},switchState:function(){this.$refs.label.focus(),this.$refs["nodList"].showPopper=!this.$refs["nodList"].showPopper},inputEvent:function(e){var t=e.keyCode;this.$refs["nodList"].showPopper?13==t?this.setOption(this.optionList[this.foucs]):27==t?e.stopPropagation():38==t?this.optionList.hasOwnProperty(this.foucs-1)&&this.foucs--:40==t?this.optionList.hasOwnProperty(this.foucs+1)&&this.foucs++:112==t&&(this.$refs.search.focus(),e.preventDefault(),e.stopPropagation()):13==t&&(this.$refs["nodList"].showPopper=!0),46==t&&this.delModel()},searchEvent:function(e){var t=e.keyCode;13==t?this.record(1):27==t?(this.$refs.label.focus(),this.$refs["nodList"].showPopper=!1):112==t&&e.preventDefault()}}}),l=o,n=(a("bdbf"),a("2877")),i=Object(n["a"])(l,r,s,!1,null,"404ad2bf",null);t["a"]=i.exports},bdbf:function(e,t,a){"use strict";a("c54b")},c08a:function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"customer area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入客户名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入客户编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择客户类别",clearable:""},model:{value:e.searchFrom.category,callback:function(t){e.$set(e.searchFrom,"category",t)},expression:"searchFrom.category"}},[e._l(e.store.sys.crCategory,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择客户等级",clearable:""},model:{value:e.searchFrom.grade,callback:function(t){e.$set(e.searchFrom,"grade",t)},expression:"searchFrom.grade"}},[e._l(e.store.sys.crGrade,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入联系人员",clearable:""},model:{value:e.searchFrom.contacts,callback:function(t){e.$set(e.searchFrom,"contacts",t)},expression:"searchFrom.contacts"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入联系电话",clearable:""},model:{value:e.searchFrom.tel,callback:function(t){e.$set(e.searchFrom,"tel",t)},expression:"searchFrom.tel"}})],1),t("el-form-item",[t("nodList",{attrs:{placeholder:"请选择所属用户",action:"service/userRecord",scene:"user"},model:{value:e.searchFrom.user,callback:function(t){e.$set(e.searchFrom,"user",t)},expression:"searchFrom.user"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[0!=e.tableSelection.length?[e.$lib.getUserRoot(e.store.root,"base","del")?[t("el-button",{attrs:{type:"info"},on:{click:function(t){return e.del(e.tableSelection)}}},[e._v("删除")])]:e._e()]:e._e(),e.$lib.getUserRoot(e.store.root,"base","add")?[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")])]:e._e(),e.$lib.getUserRoot(e.store.root,"base","batch")?[t("el-button",{on:{click:function(t){e.batch.dialog=!0}}},[e._v("批量")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""},on:{"selection-change":e.selectionChange}},[t("el-table-column",{attrs:{type:"selection",align:"center",width:"39px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"name",label:"客户名称",align:"center",width:"260px"}}),t("el-table-column",{attrs:{prop:"number",label:"客户编号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"category",label:"客户类别",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"grade",label:"客户等级",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"balance",label:"应收款余额",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"integral",label:"客户积分",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"frameData.name",label:"所属组织",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"userData.name",label:"所属用户",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息 ",align:"center","min-width":"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"200px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"base","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del([a.row.id])}}},[e._v("删除")])]:e._e()],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.dialog.show,title:"详情",width:"700px"},on:{"update:visible":function(t){return e.$set(e.dialog,"show",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog.show?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"96px",inline:!0}},[t("el-tabs",{model:{value:e.dialog.active,callback:function(t){e.$set(e.dialog,"active",t)},expression:"dialog.active"}},[t("el-tab-pane",{attrs:{label:"基础资料",name:"base"}},[t("el-form-item",{attrs:{label:"客户名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入客户名称",clearable:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"客户编号",prop:"number"}},[t("el-input",{attrs:{placeholder:"请输入客户编号",clearable:""},model:{value:e.form.number,callback:function(t){e.$set(e.form,"number",t)},expression:"form.number"}})],1),t("el-form-item",{attrs:{label:"所属组织",prop:"frame"}},[t("nodTree",{attrs:{treeData:e.store.frame,placeholder:"请选择所属组织"},model:{value:e.form.frame,callback:function(t){e.$set(e.form,"frame",t)},expression:"form.frame"}})],1),t("el-form-item",{attrs:{label:"所属用户",prop:"user"}},[t("nodList",{attrs:{placeholder:"请选择所属用户",action:"service/userRecord",scene:"user"},model:{value:e.form.user,callback:function(t){e.$set(e.form,"user",t)},expression:"form.user"}})],1),t("el-form-item",{attrs:{label:"客户类别"}},[t("el-select",{attrs:{placeholder:"请选择客户类别"},model:{value:e.form.category,callback:function(t){e.$set(e.form,"category",t)},expression:"form.category"}},[e._l(e.store.sys.crCategory,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",{attrs:{label:"客户等级"}},[t("el-select",{attrs:{placeholder:"请选择客户等级"},model:{value:e.form.grade,callback:function(t){e.$set(e.form,"grade",t)},expression:"form.grade"}},[e._l(e.store.sys.crGrade,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",{attrs:{label:"开户银行"}},[t("el-input",{attrs:{placeholder:"请输入开户银行",clearable:""},model:{value:e.form.bank,callback:function(t){e.$set(e.form,"bank",t)},expression:"form.bank"}})],1),t("el-form-item",{attrs:{label:"银行账号"}},[t("el-input",{attrs:{placeholder:"请输入银行账号",clearable:""},model:{value:e.form.account,callback:function(t){e.$set(e.form,"account",t)},expression:"form.account"}})],1),t("el-form-item",{attrs:{label:"纳税号码"}},[t("el-input",{attrs:{placeholder:"请输入纳税人识别号",clearable:""},model:{value:e.form.tax,callback:function(t){e.$set(e.form,"tax",t)},expression:"form.tax"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1),t("el-tab-pane",{attrs:{label:"联系资料",name:"contacts"}},[t("el-table",{attrs:{data:e.form.contacts,height:"200px",border:""}},[t("el-table-column",{attrs:{label:"主联系人",align:"center","min-width":"90px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",[e._v(e._s(a.row.main?"是":"否"))])]}}],null,!1,295310561)}),t("el-table-column",{attrs:{prop:"name",label:"联系人员",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"tel",label:"联系号码",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"add",label:"联系地址",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息",align:"center","min-width":"120px"}}),t("el-table-column",{attrs:{prop:"set",align:"center",width:"160px",fixed:"right"},scopedSlots:e._u([{key:"header",fn:function(a){return[t("span",{staticStyle:{"margin-right":"3px"}},[e._v("相关操作")]),t("i",{staticClass:"el-icon-circle-plus-outline",on:{click:function(t){return e.setContacts(-1)}}})]}},{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.setContacts(a.$index)}}},[e._v("详情")]),t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.delContacts(a.$index)}}},[e._v("删除")])],1)]}}],null,!1,2576455115)})],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.contacts.dialog,title:"联系资料",width:"360px","append-to-body":!0},on:{"update:visible":function(t){return e.$set(e.contacts,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.contacts.dialog?[t("el-form",{ref:"contactsForm",attrs:{model:e.contacts.form,rules:e.contacts.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"主联系人"}},[t("el-switch",{model:{value:e.contacts.form.main,callback:function(t){e.$set(e.contacts.form,"main",t)},expression:"contacts.form.main"}})],1),t("el-form-item",{attrs:{label:"联系人员",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入联系人员"},model:{value:e.contacts.form.name,callback:function(t){e.$set(e.contacts.form,"name",t)},expression:"contacts.form.name"}})],1),t("el-form-item",{attrs:{label:"联系号码",prop:"tel"}},[t("el-input",{attrs:{placeholder:"请输入联系号码"},model:{value:e.contacts.form.tel,callback:function(t){e.$set(e.contacts.form,"tel",t)},expression:"contacts.form.tel"}})],1),t("el-form-item",{attrs:{label:"联系地址"}},[t("el-input",{attrs:{placeholder:"请输入联系地址"},model:{value:e.contacts.form.add,callback:function(t){e.$set(e.contacts.form,"add",t)},expression:"contacts.form.add"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息"},model:{value:e.contacts.form.data,callback:function(t){e.$set(e.contacts.form,"data",t)},expression:"contacts.form.data"}})],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.contacts.dialog=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.saveContacts}},[e._v("保存")])],1)],1)],1),e.store.fields.hasOwnProperty(e.$route.name)?[t("el-tab-pane",{attrs:{label:"扩展信息",name:"more"}},[t("FieldForm",{attrs:{rule:"customer",prefix:"more."},model:{value:e.form.more,callback:function(t){e.$set(e.form,"more",t)},expression:"form.more"}})],1)]:e._e()],2)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog.show=!1}}},[e._v("取消")]),0==e.form.id||e.$lib.getUserRoot(e.store.root,"base","edit")?[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])]:e._e()],2)],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.batch.dialog,title:"批量",width:"420px"},on:{"update:visible":function(t){return e.$set(e.batch,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.batch.dialog?[t("el-tabs",{model:{value:e.batch.active,callback:function(t){e.$set(e.batch,"active",t)},expression:"batch.active"}},[t("el-tab-pane",{attrs:{label:"导入数据",name:"import"}},[t("ul",{staticClass:"importTip"},[t("li",[e._v("1.该功能适用于批量导入数据。")]),t("li",[e._v("2.您需要下载数据模板后使用Excel录入数据。")]),t("li",[e._v("3.录入数据时,请勿修改首行数据标题以及排序。")]),t("li",[e._v("4.请查阅使用文档获取字段格式内容以及相关导入须知。")]),t("li",[e._v("5.点击下方上传模板,选择您编辑好的模板文件即可。")])]),t("el-divider"),t("el-row",{staticStyle:{"text-align":"center"}},[t("el-col",{attrs:{span:12}},[t("el-button",{attrs:{type:"info"},on:{click:e.downTemplate}},[e._v("下载模板")])],1),t("el-col",{attrs:{span:12}},[t("el-upload",{attrs:{action:e.$base.web+"customer/import",headers:{Token:e.$store.state.token},"show-file-list":!1,"on-success":e.importCall}},[t("el-button",{attrs:{type:"primary"}},[e._v("上传模板")])],1)],1)],1)],1),t("el-tab-pane",{attrs:{label:"导出数据",name:"export"}},[t("div",{staticClass:"exportItem",on:{click:e.exports}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("导出数据")])])])],1)]:e._e()],2)],1)],1)},s=[],o=a("b85c"),l=(a("14d9"),a("a434"),a("23f7")),n=a("a447"),i=a("5fb4"),c={name:"Customer",components:{NodTree:l["a"],NodList:n["a"],FieldForm:i["a"]},data:function(){return{searchFrom:{name:"",number:"",category:"",grade:"",contacts:"",tel:"",user:null,data:""},tableData:[],tableSelection:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:{show:!1,active:"base"},form:{id:0,name:"",number:"",frame:null,user:null,category:"常规类别",grade:"常规等级",bank:"",account:"",tax:"",data:"",contacts:[],more:{}},rules:{name:{required:!0,message:"请输入客户名称",trigger:"blur"},number:{required:!0,message:"请输入客户编号",trigger:"blur"},frame:{required:!0,message:"请选择所属组织",trigger:"change"},user:{required:!0,message:"请选择所属用户",trigger:"change"}},contacts:{index:-1,dialog:!1,form:{main:!0,name:"",tel:"",add:"",data:""},rules:{name:{required:!0,message:"请输入联系人员",trigger:"blur"},tel:{required:!0,message:"请输入联系号码",trigger:"blur"}}},batch:{dialog:!1,active:"import"}}},created:function(){this.record(1)},computed:{store:function(){return this.$store.state}},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("customer/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.form=this.$lib.extend(!0,{},this.$options.data().form),e>0?this.$axios.post("customer/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog.show=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):(this.form.frame=this.store.user.frame,this.form.user=this.store.user.id,this.dialog.show=!0)},save:function(){var e=this;this.$refs["form"].validate((function(t){t?e.$axios.post("customer/save",e.form).then((function(t){"success"==t.state?(e.record(0),e.dialog.show=!1,e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):e.$message({type:"warning",message:"表单验证错误,请检查并修正!"})}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("customer/del",{parm:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},setContacts:function(e){this.contacts.form=-1==e?Object.assign({},this.$options.data().contacts.form):Object.assign({},this.form.contacts[e]),this.contacts.index=e,this.contacts.dialog=!0},saveContacts:function(){var e=this;this.$refs["contactsForm"].validate((function(t){if(t){if(0==e.form.contacts.length)e.contacts.form.main=!0;else if(1==e.contacts.form.main)for(var a in e.form.contacts)e.form.contacts[a].main=!1;e.contacts.index>-1?e.form.contacts.splice(e.contacts.index,1,e.contacts.form):e.form.contacts.push(e.contacts.form),e.$message({type:"success",message:"更新联系资料成功,保存后生效!"}),e.contacts.dialog=!1}}))},delContacts:function(e){var t=this.form.contacts[e].main;this.form.contacts.splice(e,1),1==t&&this.form.contacts.length>0&&(this.form.contacts[0].main=!0),this.$message({type:"success",message:"删除联系资料成功,保存后生效!"})},downTemplate:function(){var e=this;this.$message({type:"success",message:"[ 数据模板 ] 下载请求中..."}),setTimeout((function(){window.open(e.store.base.cdnSite+"/erp/batch/客户导入模板.xlsx")}),1e3)},importCall:function(e,t,a){"success"==e.state?(this.$lib.updateStore(this),this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:e.info})):"error"==e.state?this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info}):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},exports:function(){var e=this;if(0==this.tableSelection.length)this.$message({type:"warning",message:"未选择导出数据内容!"});else{this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm({parm:this.tableSelection},!0);setTimeout((function(){window.open(e.$base.web+"customer/exports?"+t)}),1e3)}},selectionChange:function(e){var t,a=[],r=Object(o["a"])(e);try{for(r.s();!(t=r.n()).done;){var s=t.value;a.push(s.id)}}catch(l){r.e(l)}finally{r.f()}this.tableSelection=a},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},u=c,m=(a("0cff"),a("2877")),d=Object(m["a"])(u,r,s,!1,null,"49dd7a2c",null);t["default"]=d.exports},c54b:function(e,t,a){},d297:function(e,t,a){},d437:function(e,t,a){},d683:function(e,t,a){"use strict";a("d297")},d805:function(e,t,a){"use strict";a.r(t);a("4de4"),a("d81d"),a("b0c0"),a("d3b7");var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"goods area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品编号",clearable:""},model:{value:e.searchFrom.number,callback:function(t){e.$set(e.searchFrom,"number",t)},expression:"searchFrom.number"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品型号",clearable:""},model:{value:e.searchFrom.spec,callback:function(t){e.$set(e.searchFrom,"spec",t)},expression:"searchFrom.spec"}})],1),t("el-form-item",[t("nodTree",{attrs:{treeData:e.store.category,placeholder:"请选择商品类别"},model:{value:e.searchFrom.category,callback:function(t){e.$set(e.searchFrom,"category",t)},expression:"searchFrom.category"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择商品品牌",clearable:""},model:{value:e.searchFrom.brand,callback:function(t){e.$set(e.searchFrom,"brand",t)},expression:"searchFrom.brand"}},[e._l(e.store.sys.brand,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入商品条码",clearable:""},model:{value:e.searchFrom.code,callback:function(t){e.$set(e.searchFrom,"code",t)},expression:"searchFrom.code"}})],1),t("el-form-item",[t("el-select",{attrs:{placeholder:"请选择商品类型",clearable:""},model:{value:e.searchFrom.type,callback:function(t){e.$set(e.searchFrom,"type",t)},expression:"searchFrom.type"}},[t("el-option",{attrs:{label:"常规商品",value:1}}),t("el-option",{attrs:{label:"服务商品",value:2}})],1)],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.searchFrom.data,callback:function(t){e.$set(e.searchFrom,"data",t)},expression:"searchFrom.data"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[0!=e.tableSelection.length?[e.$lib.getUserRoot(e.store.root,"base","del")?[t("el-button",{attrs:{type:"info"},on:{click:function(t){return e.del(e.tableSelection)}}},[e._v("删除")])]:e._e()]:e._e(),e.$lib.getUserRoot(e.store.root,"base","add")?[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")])]:e._e(),e.$lib.getUserRoot(e.store.root,"base","batch")?[t("el-button",{on:{click:function(t){e.batch.dialog=!0}}},[e._v("批量")])]:e._e(),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],2)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""},on:{"selection-change":e.selectionChange}},[t("el-table-column",{attrs:{type:"selection",align:"center",width:"39px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"name",label:"商品名称",align:"center",width:"220px"}}),t("el-table-column",{attrs:{prop:"number",label:"商品编号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"spec",label:"规格型号",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"categoryData.name",label:"商品分类",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"brand",label:"商品品牌",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.unit",label:"商品单位",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"code",label:"商品条码",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"extension.type",label:"商品类型",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息 ",align:"center","min-width":"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"180px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(a.row.id)}}},[e._v("详情")]),e.$lib.getUserRoot(e.store.root,"base","del")?[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del([a.row.id])}}},[e._v("删除")])]:e._e()],2)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.dialog.show,title:"详情",width:"970px"},on:{"update:visible":function(t){return e.$set(e.dialog,"show",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog.show?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px",inline:!0}},[t("el-tabs",{model:{value:e.dialog.active,callback:function(t){e.$set(e.dialog,"active",t)},expression:"dialog.active"}},[t("el-tab-pane",{attrs:{label:"基础信息",name:"base"}},[t("el-form-item",{attrs:{label:"商品名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"商品编号",prop:"number"}},[t("el-input",{attrs:{placeholder:"请输入商品编号",clearable:""},model:{value:e.form.number,callback:function(t){e.$set(e.form,"number",t)},expression:"form.number"}})],1),t("el-form-item",{attrs:{label:"商品型号"}},[t("el-input",{attrs:{placeholder:"请输入商品型号",clearable:""},model:{value:e.form.spec,callback:function(t){e.$set(e.form,"spec",t)},expression:"form.spec"}})],1),t("el-form-item",{attrs:{label:"商品类别",prop:"category"}},[t("template",{slot:"label"},[t("span",{on:{click:function(t){return e.switchPage("category")}}},[e._v("商品类别")])]),t("nodTree",{attrs:{treeData:e.store.category,placeholder:"请选择商品类别"},model:{value:e.form.category,callback:function(t){e.$set(e.form,"category",t)},expression:"form.category"}})],2),t("el-form-item",{attrs:{label:"商品品牌"}},[t("template",{slot:"label"},[t("span",{on:{click:function(t){return e.switchPage("sys")}}},[e._v("商品品牌")])]),t("el-select",{attrs:{placeholder:"请选择商品品牌",clearable:"",filterable:""},model:{value:e.form.brand,callback:function(t){e.$set(e.form,"brand",t)},expression:"form.brand"}},[e._l(e.store.sys.brand,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]}))],2)],2),t("el-form-item",{attrs:{label:"商品单位",prop:"unit"}},[t("template",{slot:"label"},[t("span",{on:{click:function(t){return e.switchPage("sys")}}},[e._v("商品单位")])]),t("el-select",{attrs:{placeholder:"请选择商品单位",clearable:""},on:{change:e.unitChange},model:{value:e.form.unit,callback:function(t){e.$set(e.form,"unit",t)},expression:"form.unit"}},[e._l(e.store.sys.unit,(function(e){return[t("el-option",{attrs:{label:e,value:e}})]})),t("el-option",{attrs:{label:"多单位",value:"-1"}})],2)],2),t("el-form-item",{attrs:{label:"采购价格",prop:"buy"}},[t("el-input",{attrs:{placeholder:"请输入采购价格",clearable:""},model:{value:e.form.buy,callback:function(t){e.$set(e.form,"buy",t)},expression:"form.buy"}})],1),t("el-form-item",{attrs:{label:"销售价格",prop:"sell"}},[t("el-input",{attrs:{placeholder:"请输入销售价格",clearable:""},model:{value:e.form.sell,callback:function(t){e.$set(e.form,"sell",t)},expression:"form.sell"}})],1),t("el-form-item",{attrs:{label:"商品条码"}},[t("template",{slot:"label"},[t("span",{on:{click:function(t){return e.switchPage("code")}}},[e._v("商品条码")])]),t("el-input",{attrs:{placeholder:"请输入商品条码",clearable:""},model:{value:e.form.code,callback:function(t){e.$set(e.form,"code",t)},expression:"form.code"}})],2),t("el-form-item",{attrs:{label:"商品货位"}},[t("el-input",{attrs:{placeholder:"请输入商品货位",clearable:""},model:{value:e.form.location,callback:function(t){e.$set(e.form,"location",t)},expression:"form.location"}})],1),t("el-form-item",{attrs:{label:"库存阈值",prop:"stock"}},[t("el-input",{attrs:{placeholder:"请输入库存阈值",clearable:""},model:{value:e.form.stock,callback:function(t){e.$set(e.form,"stock",t)},expression:"form.stock"}})],1),t("el-form-item",{attrs:{label:"商品类型"}},[t("el-select",{attrs:{placeholder:"请选择商品类型"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[t("el-option",{attrs:{label:"常规商品",value:0}}),t("el-option",{attrs:{label:"服务商品",value:1}})],1)],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1),t("el-tab-pane",{attrs:{label:"辅助属性",name:"attr"}},[t("el-table",{staticStyle:{"margin-bottom":"12px"},attrs:{data:e.dialog.attribute,size:"mini",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"属性名称",width:"90px"}}),t("el-table-column",{attrs:{label:"属性内容","min-width":"240px"},scopedSlots:e._u([{key:"default",fn:function(a){return[e._l(a.row.info,(function(a,r){return[t("el-checkbox",{staticClass:"attrNode",on:{change:e.AttrChange},model:{value:e.dialog.attrChecked["n"+e.$lib.charUnique(a.name)].checked,callback:function(t){e.$set(e.dialog.attrChecked["n"+e.$lib.charUnique(a.name)],"checked",t)},expression:"dialog.attrChecked['n'+$lib.charUnique(row.name)].checked"}},[e._v(e._s(a.name))])]}))]}}],null,!1,1254247095)})],1),t("el-table",{staticClass:"gridTable",attrs:{data:e.form.attr,size:"mini",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"属性名称",align:"center","min-width":"100px"}}),t("el-table-column",{attrs:{align:"center",width:"100px"},scopedSlots:e._u([{key:"header",fn:function(a){return[t("span",[e._v("采购价格 "),t("i",{staticClass:"el-icon-sort",on:{click:function(t){return e.attrFill("buy")}}})])]}},{key:"default",fn:function(a){return[t("input",{directives:[{name:"model",rawName:"v-model",value:a.row.buy,expression:"scope.row.buy"}],attrs:{type:"text",placeholder:"采购价格"},domProps:{value:a.row.buy},on:{input:function(t){t.target.composing||e.$set(a.row,"buy",t.target.value)}}})]}}],null,!1,1495458239)}),t("el-table-column",{attrs:{align:"center",width:"100px"},scopedSlots:e._u([{key:"header",fn:function(a){return[t("span",[e._v("销售价格 "),t("i",{staticClass:"el-icon-sort",on:{click:function(t){return e.attrFill("sell")}}})])]}},{key:"default",fn:function(a){return[t("input",{directives:[{name:"model",rawName:"v-model",value:a.row.sell,expression:"scope.row.sell"}],attrs:{type:"text",placeholder:"销售价格"},domProps:{value:a.row.sell},on:{input:function(t){t.target.composing||e.$set(a.row,"sell",t.target.value)}}})]}}],null,!1,635615111)}),t("el-table-column",{attrs:{align:"center",width:"120px"},scopedSlots:e._u([{key:"header",fn:function(a){return[t("span",[e._v("条形码 "),t("i",{staticClass:"el-icon-sort",on:{click:function(t){return e.attrFill("code")}}})])]}},{key:"default",fn:function(a){return[t("input",{directives:[{name:"model",rawName:"v-model",value:a.row.code,expression:"scope.row.code"}],attrs:{type:"text",placeholder:"条形码"},domProps:{value:a.row.code},on:{input:function(t){t.target.composing||e.$set(a.row,"code",t.target.value)}}})]}}],null,!1,909810332)})],1)],1),t("el-tab-pane",{staticClass:"dispose formItemInitial",attrs:{label:"属性配置",name:"dispose"}},[t("el-collapse",{on:{change:e.disposeChange},model:{value:e.dialog.disposeActive,callback:function(t){e.$set(e.dialog,"disposeActive",t)},expression:"dialog.disposeActive"}},["-1"==e.form.unit?[t("el-collapse-item",{attrs:{title:"多单位配置",name:"units"}},[t("el-table",{staticClass:"gridTable",attrs:{data:e.form.units,size:"mini",border:""}},[t("el-table-column",{attrs:{label:"单位名称",align:"center","min-width":"120px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("input",{directives:[{name:"model",rawName:"v-model",value:a.row.name,expression:"scope.row.name"}],attrs:{type:"text",placeholder:"单位名称"},domProps:{value:a.row.name},on:{input:[function(t){t.target.composing||e.$set(a.row,"name",t.target.value)},function(t){return e.unitNameChange(a.$index)}]}})]}}],null,!1,761378190)}),t("el-table-column",{attrs:{label:"单位数量",align:"center",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("input",{directives:[{name:"model",rawName:"v-model",value:a.row.nums,expression:"scope.row.nums"}],attrs:{type:"text",placeholder:"单位数量"},domProps:{value:a.row.nums},on:{input:function(t){t.target.composing||e.$set(a.row,"nums",t.target.value)}}})]}}],null,!1,2266464793)}),t("el-table-column",{attrs:{label:"关联单位",align:"center",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(a){return[0==a.$index?[t("input",{directives:[{name:"model",rawName:"v-model",value:a.row.source,expression:"scope.row.source"}],attrs:{type:"text",placeholder:"基本单位"},domProps:{value:a.row.source},on:{input:function(t){t.target.composing||e.$set(a.row,"source",t.target.value)}}})]:[t("span",[e._v(e._s(a.row.source))])]]}}],null,!1,663899289)}),t("el-table-column",{attrs:{label:"折扣率 (%)",align:"center",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("input",{directives:[{name:"model",rawName:"v-model",value:a.row.discount,expression:"scope.row.discount"}],attrs:{type:"text",placeholder:"折扣率"},domProps:{value:a.row.discount},on:{input:function(t){t.target.composing||e.$set(a.row,"discount",t.target.value)}}})]}}],null,!1,4030941282)}),t("el-table-column",{attrs:{align:"center",width:"120px"},scopedSlots:e._u([{key:"header",fn:function(a){return[t("span",[e._v("相关操作")]),e._v(" "),t("i",{staticClass:"el-icon-circle-plus-outline",on:{click:e.addUnit}})]}},{key:"default",fn:function(a){return[t("i",{staticClass:"el-icon-delete",on:{click:function(t){return e.delUnit(a.$index)}}})]}}],null,!1,3550798777)})],1)],1)]:e._e(),t("el-collapse-item",{attrs:{title:"折扣策略",name:"strategy"}},[t("el-table",{staticClass:"gridTable",attrs:{data:e.form.strategy,size:"mini",border:""}},[t("el-table-column",{attrs:{label:"客户等级",align:"center",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("select",{directives:[{name:"model",rawName:"v-model",value:a.row.grade,expression:"scope.row.grade"}],on:{change:function(t){var r=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(a.row,"grade",t.target.multiple?r:r[0])}}},[e._l(e.store.sys.crGrade,(function(a){return[t("option",{domProps:{value:a}},[e._v(e._s(a))])]}))],2)]}}],null,!1,870277383)}),t("el-table-column",{attrs:{label:"折扣率 (%)",align:"center",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("input",{directives:[{name:"model",rawName:"v-model",value:a.row.discount,expression:"scope.row.discount"}],attrs:{type:"text",placeholder:"折扣策略"},domProps:{value:a.row.discount},on:{input:function(t){t.target.composing||e.$set(a.row,"discount",t.target.value)}}})]}}],null,!1,2486975830)}),t("el-table-column",{attrs:{label:"备注信息",align:"center","min-width":"120px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("input",{directives:[{name:"model",rawName:"v-model",value:a.row.data,expression:"scope.row.data"}],attrs:{type:"text",placeholder:"备注信息"},domProps:{value:a.row.data},on:{input:function(t){t.target.composing||e.$set(a.row,"data",t.target.value)}}})]}}],null,!1,3474743647)}),t("el-table-column",{attrs:{align:"center",width:"120px"},scopedSlots:e._u([{key:"header",fn:function(a){return[t("span",[e._v("相关操作")]),e._v(" "),t("i",{staticClass:"el-icon-circle-plus-outline",on:{click:e.addStrategy}})]}},{key:"default",fn:function(a){return[t("i",{staticClass:"el-icon-delete",on:{click:function(t){return e.delStrategy(a.$index)}}})]}}],null,!1,2999324633)})],1)],1),t("el-collapse-item",{staticClass:"collapseSwitch collapseContentHide",attrs:{name:"serial"}},[t("template",{slot:"title"},[t("span",[e._v("序列商品")]),t("el-switch",{attrs:{disabled:!0},model:{value:e.form.serial,callback:function(t){e.$set(e.form,"serial",t)},expression:"form.serial"}})],1)],2),t("el-collapse-item",{staticClass:"collapseSwitch",attrs:{name:"batch"}},[t("template",{slot:"title"},[t("span",[e._v("批次商品")]),e._v(" "),t("el-switch",{attrs:{disabled:!0},model:{value:e.form.batch,callback:function(t){e.$set(e.form,"batch",t)},expression:"form.batch"}})],1),t("el-form-item",{attrs:{label:"有效期"}},[t("el-switch",{on:{change:e.validityChange},model:{value:e.form.validity,callback:function(t){e.$set(e.form,"validity",t)},expression:"form.validity"}})],1),t("el-form-item",{attrs:{label:"保质期",prop:"protect"}},[t("el-input",{attrs:{placeholder:"请输入保质期",disabled:!e.form.validity,clearable:""},model:{value:e.form.protect,callback:function(t){e.$set(e.form,"protect",t)},expression:"form.protect"}},[t("template",{slot:"suffix"},[e._v("天")])],2)],1),t("el-form-item",{attrs:{label:"预警阀值",prop:"threshold"}},[t("el-input",{attrs:{placeholder:"请输入预警阀值",disabled:!e.form.validity,clearable:""},model:{value:e.form.threshold,callback:function(t){e.$set(e.form,"threshold",t)},expression:"form.threshold"}},[t("template",{slot:"suffix"},[e._v("天")])],2)],1)],2)],2)],1),t("el-tab-pane",{staticClass:"formItemInitial",attrs:{label:"图文详情",name:"details"}},[t("el-form-item",{attrs:{label:"商品图像"}},[t("el-upload",{attrs:{action:e.$base.web+"goods/upload",headers:{Token:e.$store.state.token},"list-type":"picture-card",limit:3,"file-list":e.form.imgs,"on-success":e.uploadSuccess,"on-remove":e.uploadRemove,"on-preview":e.uploadPreview,"on-exceed":e.uploadExceed}},[t("i",{staticClass:"el-icon-plus"})])],1),t("el-form-item",{staticClass:"editorBox",attrs:{label:"图文详情"}},[t("NodEditor",{model:{value:e.form.details,callback:function(t){e.$set(e.form,"details",t)},expression:"form.details"}})],1)],1),e.store.fields.hasOwnProperty(e.$route.name)?[t("el-tab-pane",{staticClass:"formItemInitial",attrs:{label:"扩展信息",name:"more"}},[t("FieldForm",{attrs:{rule:"goods",prefix:"more."},model:{value:e.form.more,callback:function(t){e.$set(e.form,"more",t)},expression:"form.more"}})],1)]:e._e()],2)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog.show=!1}}},[e._v("取消")]),0==e.form.id||e.$lib.getUserRoot(e.store.root,"base","edit")?[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])]:e._e()],2)],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],staticClass:"tabsDialog",attrs:{visible:e.batch.dialog,title:"批量",width:"420px"},on:{"update:visible":function(t){return e.$set(e.batch,"dialog",t)}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.batch.dialog?[t("el-tabs",{model:{value:e.batch.active,callback:function(t){e.$set(e.batch,"active",t)},expression:"batch.active"}},[t("el-tab-pane",{attrs:{label:"导入数据",name:"import"}},[t("ul",{staticClass:"importTip"},[t("li",[e._v("1.该功能适用于批量导入数据。")]),t("li",[e._v("2.您需要下载数据模板后使用Excel录入数据。")]),t("li",[e._v("3.录入数据时,请勿修改首行数据标题以及排序。")]),t("li",[e._v("4.请查阅使用文档获取字段格式内容以及相关导入须知。")]),t("li",[e._v("5.点击下方上传模板,选择您编辑好的模板文件即可。")])]),t("el-divider"),t("el-row",{staticStyle:{"text-align":"center"}},[t("el-col",{attrs:{span:12}},[t("el-button",{attrs:{type:"info"},on:{click:e.downTemplate}},[e._v("下载模板")])],1),t("el-col",{attrs:{span:12}},[t("el-upload",{attrs:{action:e.$base.web+"goods/import",headers:{Token:e.$store.state.token},"show-file-list":!1,"on-success":e.importCall}},[t("el-button",{attrs:{type:"primary"}},[e._v("上传模板")])],1)],1)],1)],1),t("el-tab-pane",{attrs:{label:"导出数据",name:"export"}},[t("div",{staticClass:"exportItem",on:{click:e.exports}},[t("i",{staticClass:"el-icon-download"}),t("p",[e._v("导出数据")])])])],1)]:e._e()],2)],1)],1)},s=[],o=a("b85c"),l=(a("d9e2"),a("c740"),a("14d9"),a("13d5"),a("a434"),a("07ac"),a("159b"),a("23f7")),n=a("a447"),i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"nodEditor"},[t("div",{ref:"editor"})])},c=[],u=a("6fad"),m=a.n(u),d={name:"NodEditor",props:{value:{required:!0},height:{default:360},placeholder:{default:"请输入内容..."}},data:function(){return{editor:null,html:""}},computed:{store:function(){return this.$store.state}},watch:{value:function(e){e!=this.html&&this.editor.txt.html(e)}},methods:{init:function(){var e=this;this.editor=new m.a(this.$refs.editor),this.editor.config.height=this.height,this.editor.config.placeholder=this.placeholder,this.editor.config.onchange=function(t){e.html=t,e.$emit("input",t)},this.editor.config.withCredentials=!0,this.editor.config.uploadFileName="images[]",this.editor.config.uploadImgServer=this.$base.web+"service/editorUpload",this.editor.config.uploadImgHeaders={Token:this.store.token},this.editor.config.uploadImgHooks={customInsert:function(e,t){if("success"==t.state){var a,r=Object(o["a"])(t.info);try{for(r.s();!(a=r.n()).done;){var s=a.value;e(s)}}catch(l){r.e(l)}finally{r.f()}}else"error"==t.state?alert(t.info):alert("[ ERROR ] 服务器响应超时!")}},this.editor.create(),this.editor.txt.html(this.value)}},mounted:function(){this.init()},beforeDestroy:function(){this.editor.destroy(),this.editor=null}},p=d,f=a("2877"),h=Object(f["a"])(p,i,c,!1,null,null,null),g=h.exports,b=a("5fb4"),v={name:"Goods",components:{NodTree:l["a"],NodList:n["a"],NodEditor:g,FieldForm:b["a"]},data:function(){var e=this;return{searchFrom:{name:"",number:"",spec:"",category:null,brand:"",code:"",type:"",data:""},tableData:[],tableSelection:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:{show:!1,active:"base",attribute:[],attrChecked:{},disposeActive:[]},form:{id:0,name:"",number:"",spec:"",category:null,brand:"",unit:"",buy:"",sell:"",code:"",location:"",stock:30,type:0,data:"",imgs:[],details:"",units:[],strategy:[],serial:!1,batch:!1,validity:!1,protect:0,threshold:0,more:{},attr:[]},rules:{name:{required:!0,message:"请输入商品名称",trigger:"blur"},number:{required:!0,message:"请输入商品编号",trigger:"blur"},category:{required:!0,message:"请选择商品类别",trigger:"change"},unit:{required:!0,message:"请选择商品单位",trigger:"blur"},buy:[{required:!0,message:"请输入采购价格",trigger:"blur"},{validator:function(t,a,r){e.$lib.synValidate("money",a)?r():r(new Error("采购价格不正确"))},trigger:"blur"}],sell:[{required:!0,message:"请输入销售价格",trigger:"blur"},{validator:function(t,a,r){e.$lib.synValidate("money",a)?r():r(new Error("销售价格不正确"))},trigger:"blur"}],stock:[{required:!0,message:"请输入库存阈值",trigger:"blur"},{validator:function(t,a,r){e.$lib.synValidate("nums",a)?r():r(new Error("库存阈值不正确"))},trigger:"blur"}],protect:[{required:!0,message:"请输入批次商品 - 保质期",trigger:"blur"},{validator:function(t,a,r){e.$lib.validate("number",a)?r():r(new Error("批次商品 - 保质期不正确"))},trigger:"blur"}],threshold:[{required:!0,message:"请输入批次商品 - 预警阀值",trigger:"blur"},{validator:function(t,a,r){e.$lib.validate("number",a)?r():r(new Error("批次商品 - 预警阀值不正确"))},trigger:"blur"}]},batch:{dialog:!1,active:"import"}}},created:function(){this.getBase(),this.record(1)},computed:{store:function(){return this.$store.state}},methods:{getBase:function(){var e=this;this.$axios.post("attribute/select").then((function(t){if("success"==t.state){var a=t.info;e.dialog.attribute=t.info;var r={};for(var s in a){var l,n=Object(o["a"])(a[s].info);try{for(n.s();!(l=n.n()).done;){var i=l.value;r["n"+e.$lib.charUnique(i["name"])]={name:i["name"],group:s,checked:!1}}}catch(c){n.e(c)}finally{n.f()}}e.$set(e.dialog,"attrChecked",r)}else"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},record:function(e){var t=this;0==e||(this.page.current=e);var a=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("goods/record",a).then((function(e){"success"==e.state?(t.tableData=e.info,t.page.total=e.count,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;for(var a in this.form=this.$lib.extend(!0,{},this.$options.data().form),this.dialog.attrChecked)this.dialog.attrChecked[a].checked=!1;this.dialog.disposeActive=[],e>0?this.$axios.post("goods/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,e.info.attr.forEach((function(e){e.name.split("|").forEach((function(e){t.dialog.attrChecked["n"+t.$lib.charUnique(e)].checked=!0}))})),"-1"==e.info.unit&&t.dialog.disposeActive.push("units"),e.info.strategy.length>0&&t.dialog.disposeActive.push("strategy"),1==e.info.serial&&t.dialog.disposeActive.push("serial"),1==e.info.batch&&t.dialog.disposeActive.push("batch"),t.dialog.show=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.dialog.show=!0},save:function(){var e=this;this.$refs["form"].validate((function(t){if(t){if(e.form.attr.length>0){var a,r=Object(o["a"])(e.form.attr);try{for(r.s();!(a=r.n()).done;){var s=a.value;if(!e.$lib.synValidate("money",s.buy))return e.$message({type:"warning",message:"辅助属性[ "+s.name+" ]采购价格不正确!"}),!1;if(!e.$lib.synValidate("money",s.sell))return e.$message({type:"warning",message:"辅助属性[ "+s.name+" ]销售价格不正确!"}),!1}}catch(u){r.e(u)}finally{r.f()}}if(0==e.form.type){if(-1==e.form.unit){if(0==e.form.units.length)return e.$message({type:"warning",message:"[ 属性配置 - 多单位配置 ]不可为空!"}),!1;for(var l=[e.form.units[0].source],n=0;n<e.form.units.length;n++){if(e.$lib.validate("empty",e.form.units[n].source))return e.$message({type:"warning",message:"多单位配置 - 第"+(n+1)+"行基本单位不可为空!"}),!1;if(e.$lib.validate("empty",e.form.units[n].name))return e.$message({type:"warning",message:"多单位配置 - 第"+(n+1)+"行单位名称不可为空!"}),!1;if(0==e.form.units[n].nums||!e.$lib.synValidate("nums",e.form.units[n].nums))return e.$message({type:"warning",message:"多单位配置 - 第"+(n+1)+"行单位数量不正确!"}),!1;if(!e.$lib.validate("percentage",e.form.units[n].discount))return e.$message({type:"warning",message:"多单位配置 - 第"+(n+1)+"行折扣率不正确!"}),!1;l.push(e.form.units[n].name)}if(e.$lib.distinct(l).length!=e.form.units.length+1)return e.$message({type:"warning",message:"多单位配置 - 单位名称不可重复!"}),!1}if(e.form.strategy.length>0){for(var i=[],c=0;c<e.form.strategy.length;c++){if(!e.$lib.validate("percentage",e.form.strategy[c].discount))return e.$message({type:"warning",message:"折扣策略 - 第"+(c+1)+"行折扣率不正确!"}),!1;i.push(e.form.strategy[c].grade)}if(e.form.strategy.length!=e.$lib.distinct(i).length)return e.$message({type:"warning",message:"折扣策略 - 客户等级不可重复!"}),!1}if(e.form.validity){if(e.$lib.validate("empty",e.form.protect))return e.$message({type:"warning",message:"批次商品 - 保质期不可为空!"}),!1;if(e.$lib.validate("empty",e.form.threshold))return e.$message({type:"warning",message:"批次商品 - 预警阀值不可为空!"}),!1;if(e.form.threshold-0>e.form.protect-0)return e.$message({type:"warning",message:"批次商品 - 预警阀值不可大于保质期!"}),!1}}else{if("-1"==e.form.unit)return e.$message({type:"warning",message:"服务商品不可启用多单位!"}),!1;if(e.form.serial)return e.$message({type:"warning",message:"服务商品不可启用序列商品!"}),!1;if(e.form.batch)return e.$message({type:"warning",message:"服务商品不可启用批次商品!"}),!1}e.$axios.post("goods/save",e.form).then((function(t){"success"==t.state?(e.record(0),e.dialog.show=!1,e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}else e.$message({type:"warning",message:"表单验证错误,请检查并修正!"})}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("goods/del",{parm:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},unitChange:function(e){"-1"!=e&&(this.form.units=[])},AttrChange:function(){this.form.attr=[];var e={};for(var t in this.dialog.attrChecked)if(this.dialog.attrChecked[t].checked){var a=this.dialog.attrChecked[t].group;e.hasOwnProperty(a)?e[a].push(this.dialog.attrChecked[t].name):e[a]=[this.dialog.attrChecked[t].name]}if(Object.values(e).length>0){var r,s=Object.values(e).reduce((function(e,t){var a=[];return e.forEach((function(e){t.forEach((function(t){a.push(e+"|"+t)}))})),a})),l=Object(o["a"])(s);try{for(l.s();!(r=l.n()).done;){var n=r.value;this.form.attr.push({name:n,buy:"",sell:"",code:""})}}catch(i){l.e(i)}finally{l.f()}}},attrFill:function(e){for(var t in this.form.attr)this.form.attr[t][e]=this.form[e]},disposeChange:function(){this.form.batch=-1!=this.dialog.disposeActive.indexOf("batch"),this.form.serial=-1!=this.dialog.disposeActive.indexOf("serial"),this.form.batch||(this.form.validity=!1,this.form.protect=0,this.form.threshold=0)},addUnit:function(){0==this.form.units.length?this.form.units.push({name:"",nums:"",source:"",discount:"0"}):this.form.units.push({name:"",nums:"",source:this.form.units[this.form.units.length-1].name,discount:"0"})},delUnit:function(e){this.form.units.splice(e,this.form.units.length-e)},unitNameChange:function(e){this.form.units.hasOwnProperty(e+1)&&(this.form.units[e+1].source=this.form.units[e].name)},addStrategy:function(){this.form.strategy.push({grade:"常规等级",discount:"0",data:""})},delStrategy:function(e){this.form.strategy.splice(e,1)},validityChange:function(){this.form.validity||(this.form.protect=0,this.form.threshold=0)},uploadSuccess:function(e,t,a){"success"==e.state?this.form.imgs.push({name:t.name,url:e.info}):"error"==e.state?(a.splice(a.findIndex((function(e){return e.uid==t.uid})),1),this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info})):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},uploadRemove:function(e,t){this.form.imgs.splice(this.form.imgs.findIndex((function(t){return t.uid==e.uid})),1)},uploadPreview:function(e){this.$message({type:"success",message:"[ "+e.name+" ] 下载请求中..."}),setTimeout((function(){window.open(e.url)}),1e3)},uploadExceed:function(e,t){this.$message({type:"warning",message:"商品图像最多上传3张!"})},downTemplate:function(){var e=this;this.$message({type:"success",message:"[ 数据模板 ] 下载请求中..."}),setTimeout((function(){window.open(e.store.base.cdnSite+"/erp/batch/商品导入模板.xlsx")}),1e3)},importCall:function(e,t,a){"success"==e.state?(this.$lib.updateStore(this),this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:e.info})):"error"==e.state?this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info}):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},exports:function(){var e=this;if(0==this.tableSelection.length)this.$message({type:"warning",message:"未选择导出数据内容!"});else{this.$message({type:"success",message:"[ 导出数据 ] 请求中..."});var t=this.$lib.objToParm({parm:this.tableSelection},!0);setTimeout((function(){window.open(e.$base.web+"goods/exports?"+t)}),1e3)}},selectionChange:function(e){var t,a=[],r=Object(o["a"])(e);try{for(r.s();!(t=r.n()).done;){var s=t.value;a.push(s.id)}}catch(l){r.e(l)}finally{r.f()}this.tableSelection=a},switchPage:function(e){this.$bus.emit("switchPage",e,!0)},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},$=v,y=(a("577a"),Object(f["a"])($,r,s,!1,null,"00511560",null));t["default"]=y.exports},e563:function(e,t,a){},fbb4:function(e,t,a){"use strict";a("21fd")}}]);