1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7ed96634"],{1:function(e,t){},a250:function(e,t,a){},a5d9:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",staticClass:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"68px"}},[a("el-form-item",{attrs:{label:"位置名称",prop:"parentId"}},[a("treeselect",{attrs:{options:e.locationOption,placeholder:"选择位置"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.parentId,callback:function(t){e.$set(e.queryParams,"parentId",t)},expression:"queryParams.parentId"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),a("el-row",{staticClass:"mb8",attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["asset:location:add"],expression:"['asset:location:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["asset:location:edit"],expression:"['asset:location:edit']"}],attrs:{type:"success",plain:"",icon:"el-icon-edit",size:"mini",disabled:e.single},on:{click:e.handleUpdate}},[e._v("修改")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["asset:location:remove"],expression:"['asset:location:remove']"}],attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:e.multiple},on:{click:e.handleDelete}},[e._v("删除")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["asset:location:export"],expression:"['asset:location:export']"}],attrs:{type:"warning",plain:"",icon:"el-icon-download",size:"mini"},on:{click:e.handleExport}},[e._v("导出")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["asset:location:export"],expression:"['asset:location:export']"}],attrs:{type:"warning",plain:"",icon:"el-icon-download",size:"mini",disabled:e.multiple},on:{click:e.handleDownload}},[e._v("下载")])],1),a("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.locationList,"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),a("el-table-column",{attrs:{label:"名称",align:"left",prop:"name",width:"300"}}),a("el-table-column",{attrs:{label:"二维码",align:"center",prop:"number"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("image-preview",{attrs:{src:e.getCode(t.row.number),width:80,height:80}})]}}])}),a("el-table-column",{attrs:{label:"位置编码",align:"center",prop:"number"}}),a("el-table-column",{attrs:{label:"上级位置",align:"center",prop:"parentId"}}),a("el-table-column",{attrs:{label:"位置标签",align:"center",prop:"label"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===e.getLevel(t.row.sequence)?a("el-tag",[e._v(e._s(t.row.label))]):e._e(),2===e.getLevel(t.row.sequence)?a("el-tag",{attrs:{type:"success"}},[e._v(e._s(t.row.label))]):e._e(),3===e.getLevel(t.row.sequence)?a("el-tag",{attrs:{type:"warning"}},[e._v(e._s(t.row.label))]):e._e(),4===e.getLevel(t.row.sequence)?a("el-tag",{attrs:{type:"danger"}},[e._v(e._s(t.row.label))]):e._e(),e.getLevel(t.row.sequence)>4?a("el-tag",{attrs:{type:"info"}},[e._v(e._s(t.row.label))]):e._e()]}}])}),a("el-table-column",{attrs:{label:"备注",align:"center",prop:"remark"}}),a("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["asset:location:edit"],expression:"['asset:location:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(a){return e.handleUpdate(t.row)}}},[e._v("修改")]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["asset:location:add"],expression:"['asset:location:add']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(a){return e.handleAdd(t.row)}}},[e._v("新增")]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["asset:location:remove"],expression:"['asset:location:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),a("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"位置编号"}},[a("el-input",{attrs:{placeholder:"请输入位置编号",disabled:""},model:{value:e.form.number,callback:function(t){e.$set(e.form,"number",t)},expression:"form.number"}})],1),a("el-form-item",{attrs:{label:"名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"上级位置",prop:"parentId"}},[a("treeselect",{attrs:{options:e.locationOption,placeholder:"选择上级位置"},model:{value:e.form.parentId,callback:function(t){e.$set(e.form,"parentId",t)},expression:"form.parentId"}})],1),a("el-form-item",{attrs:{label:"位置标签",prop:"label"}},[a("el-input",{attrs:{placeholder:"请输入位置标签"},model:{value:e.form.label,callback:function(t){e.$set(e.form,"label",t)},expression:"form.label"}})],1),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{placeholder:"请输入备注"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),a("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},r=[],o=a("5530"),i=(a("d81d"),a("a9e3"),a("ffc9")),l=a("ca17"),s=a.n(l),c=(a("542c"),{name:"Location",components:{Treeselect:s.a},data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,arr:[],locationList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,number:null,name:null,parentId:null,label:null},form:{},rules:{name:[{required:!0,message:"位置名称不能为空",trigger:"blur"}],createBy:[{required:!0,message:"创建人不能为空",trigger:"blur"}],createTime:[{required:!0,message:"创建时间不能为空",trigger:"blur"}],updateTime:[{required:!0,message:"最后修改时间不能为空",trigger:"blur"}]},locationOption:[]}},created:function(){this.getList()},methods:{getList:function(){var e=this;this.loading=!0,Object(i["e"])(this.queryParams).then((function(t){e.locationList=t.rows,e.total=t.total,e.loading=!1})),this.getTreeSelect()},getTreeSelect:function(){var e=this;Object(i["f"])().then((function(t){e.locationOption=t.data}))},getLevel:function(e){return e.split(",").length},getCode:function(e){return Object(i["d"])(e,Math.random())},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:null,number:null,name:null,parentId:0,label:null,remark:null,createBy:null,createTime:null,updateBy:null,updateTime:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(e){this.reset(),e.id?this.form.parentId=e.id:this.queryParams.parentId&&(this.form.parentId=Number(this.queryParams.parentId)),this.open=!0,this.title="添加所属位置"},handleUpdate:function(e){var t=this;this.reset();var a=e.id||this.ids;Object(i["c"])(a).then((function(e){t.form=e.data,t.open=!0,t.title="修改所属位置"}))},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.id?Object(i["g"])(e.form).then((function(t){e.$modal.msgSuccess("修改成功"),e.open=!1,e.getList()})):Object(i["a"])(e.form).then((function(t){e.$modal.msgSuccess("新增成功"),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,a=e.id||this.ids;this.$modal.confirm('是否确认删除所属位置编号为"'+a+'"的数据项?').then((function(){return Object(i["b"])(a)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleDownload:function(){this.download("/asset/location/download/code/"+this.ids,{},"location_".concat((new Date).getTime(),".zip"))},handleExport:function(){this.download("asset/location/export",Object(o["a"])({},this.queryParams),"location_".concat((new Date).getTime(),".xlsx"))}}}),u=c,d=(a("cc3f"),a("2877")),m=Object(d["a"])(u,n,r,!1,null,"b3f4f47c",null);t["default"]=m.exports},cc3f:function(e,t,a){"use strict";a("a250")},ffc9:function(e,t,a){"use strict";a.d(t,"c",(function(){return r})),a.d(t,"e",(function(){return o})),a.d(t,"f",(function(){return i})),a.d(t,"a",(function(){return l})),a.d(t,"g",(function(){return s})),a.d(t,"b",(function(){return c})),a.d(t,"d",(function(){return u}));a("99af");var n=a("b775");a("4328");function r(e){return Object(n["a"])({url:"/asset/location/"+e,method:"get"})}function o(e){return Object(n["a"])({url:"/asset/location/tree",method:"post",data:e})}function i(e){return Object(n["a"])({url:"/asset/location/treeSelect",method:"get",data:{params:{id:e}}})}function l(e){return Object(n["a"])({url:"/asset/location",method:"post",data:e})}function s(e){return Object(n["a"])({url:"/asset/location",method:"put",data:e})}function c(e){return Object(n["a"])({url:"/asset/location/"+e,method:"delete"})}function u(e,t){return"/asset/location/code/".concat(e,"?v=").concat(t)}}}]);
|