2 lines
9.8 KiB
JavaScript
2 lines
9.8 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-60d30ca6"],{"3ed6":function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"animated fadeInRight ecommerce"},[t("el-card",{staticClass:"ibox"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("div",[e._v(e._s(e.$t("resourceStoreType.queryCondition")))])]),t("div",{},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6}},[t("el-input",{attrs:{placeholder:e.$t("resourceStoreType.typeNamePlaceholder"),clearable:""},model:{value:e.resourceStoreTypeManageInfo.conditions.name,callback:function(t){e.$set(e.resourceStoreTypeManageInfo.conditions,"name",t)},expression:"resourceStoreTypeManageInfo.conditions.name"}})],1),t("el-col",{attrs:{span:6}},[t("el-button",{attrs:{type:"primary"},on:{click:e._queryResourceStoreTypeMethod}},[t("i",{staticClass:"el-icon-search"}),e._v(" "+e._s(e.$t("common.query"))+" ")])],1)],1)],1)]),t("el-card",{staticClass:"ibox"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("div",[e._v(e._s(e.$t("resourceStoreType.goodsType")))]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e._openAddResourceStoreTypeModal}},[t("i",{staticClass:"el-icon-plus"}),e._v(" "+e._s(e.$t("common.add"))+" ")])],1),t("div",{},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.resourceStoreTypeManageInfo.resourceStoreTypes,border:""}},[t("el-table-column",{attrs:{prop:"rstId",label:e.$t("resourceStoreType.typeId"),align:"center"}}),t("el-table-column",{attrs:{prop:"name",label:e.$t("resourceStoreType.typeName"),align:"center"}}),t("el-table-column",{attrs:{prop:"description",label:e.$t("resourceStoreType.typeDesc"),align:"center"}}),t("el-table-column",{attrs:{prop:"createTime",label:e.$t("resourceStoreType.createTime"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("common.operation"),align:"center",width:"200"},scopedSlots:e._u([{key:"default",fn:function(r){return[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e._openEditResourceStoreTypeModel(r.row)}}},[e._v(" "+e._s(e.$t("common.edit"))+" ")]),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e._openDeleteResourceStoreTypeModel(r.row)}}},[e._v(" "+e._s(e.$t("common.delete"))+" ")])]}}])})],1),t("el-pagination",{attrs:{"current-page":e.currentPage,"page-size":e.pageSize,layout:"total, prev, pager, next",total:e.resourceStoreTypeManageInfo.total},on:{"current-change":e.handleCurrentChange}})],1)]),t("add-resource-store-type",{ref:"addResourceStoreType",on:{refresh:e._queryResourceStoreTypeMethod}}),t("delete-resource-store-type",{ref:"deleteResourceStoreType",on:{refresh:e._queryResourceStoreTypeMethod}}),t("edit-resource-store-type",{ref:"editResourceStoreType",on:{refresh:e._queryResourceStoreTypeMethod}})],1)},s=[],a=r("b775");function i(e){return new Promise((t,r)=>{Object(a["a"])({url:"/resourceStoreType.listResourceStoreTypes",method:"get",params:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function n(e){return new Promise((t,r)=>{Object(a["a"])({url:"/resourceStoreType.saveResourceStoreType",method:"post",data:e}).then(e=>{const o=e.data;0===o.code?t(o):r(o.msg)}).catch(e=>{r(e)})})}function c(e){return new Promise((t,r)=>{Object(a["a"])({url:"/resourceStoreType.updateResourceStoreType",method:"post",data:e}).then(e=>{const o=e.data;0===o.code?t(o):r(o.msg)}).catch(e=>{r(e)})})}function l(e){return new Promise((t,r)=>{Object(a["a"])({url:"/resourceStoreType.deleteResourceStoreType",method:"post",data:e}).then(e=>{const o=e.data;0===o.code?t(o):r(o.msg)}).catch(e=>{r(e)})})}var u=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("resourceStoreType.addType"),visible:e.dialogVisible,width:"50%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("resourceStoreType.typeName"),prop:"name"}},[t("el-input",{attrs:{placeholder:e.$t("resourceStoreType.typeNamePlaceholder")},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:e.$t("resourceStoreType.typeDesc"),prop:"description"}},[t("el-input",{attrs:{type:"textarea",placeholder:e.$t("resourceStoreType.typeDescPlaceholder"),rows:4},model:{value:e.form.description,callback:function(t){e.$set(e.form,"description",t)},expression:"form.description"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v(e._s(e.$t("common.confirm")))])],1)],1)},p=[],d=r("7323"),m={name:"AddResourceStoreType",data(){return{dialogVisible:!1,form:{name:"",description:""},rules:{name:[{required:!0,message:this.$t("resourceStoreType.typeNameRequired"),trigger:"blur"}],description:[{max:200,message:this.$t("resourceStoreType.typeDescMaxLength"),trigger:"blur"}]}}},methods:{open(){this.dialogVisible=!0},handleClose(){this.$refs.form.resetFields()},handleSubmit(){this.$refs.form.validate(async e=>{if(e)try{const e={...this.form,shopId:Object(d["f"])()};await n(e),this.$message.success(this.$t("common.submitSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(t){console.error("添加失败:",t)}})}}},h=m,y=r("2877"),f=Object(y["a"])(h,u,p,!1,null,null,null),g=f.exports,S=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("common.deleteConfirm"),visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("p",[e._v(e._s(e.$t("resourceStoreType.deleteConfirmText")))]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleConfirm}},[e._v(e._s(e.$t("common.confirm")))])],1)])},b=[],T={name:"DeleteResourceStoreType",data(){return{dialogVisible:!1,currentRow:null}},methods:{open(e){this.currentRow=e,this.dialogVisible=!0},async handleConfirm(){try{await l({rstId:this.currentRow.rstId}),this.$message.success(this.$t("common.submitSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(e){this.$message.error(e),console.error("删除失败:",e)}}}},$=T,_=Object(y["a"])($,S,b,!1,null,null,null),v=_.exports,R=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("resourceStoreType.editType"),visible:e.dialogVisible,width:"50%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("resourceStoreType.typeName"),prop:"name"}},[t("el-input",{attrs:{placeholder:e.$t("resourceStoreType.typeNamePlaceholder")},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:e.$t("resourceStoreType.typeDesc"),prop:"description"}},[t("el-input",{attrs:{type:"textarea",placeholder:e.$t("resourceStoreType.typeDescPlaceholder"),rows:4},model:{value:e.form.description,callback:function(t){e.$set(e.form,"description",t)},expression:"form.description"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v(e._s(e.$t("common.confirm")))])],1)],1)},w=[],M={name:"EditResourceStoreType",data(){return{dialogVisible:!1,form:{rstId:"",name:"",description:""},rules:{name:[{required:!0,message:this.$t("resourceStoreType.typeNameRequired"),trigger:"blur"}],description:[{max:200,message:this.$t("resourceStoreType.typeDescMaxLength"),trigger:"blur"}]}}},methods:{open(e){this.form={rstId:e.rstId,name:e.name,description:e.description},this.dialogVisible=!0},handleClose(){this.$refs.form.resetFields()},handleSubmit(){this.$refs.form.validate(async e=>{if(e)try{const e={...this.form,shopId:Object(d["f"])()};await c(e),this.$message.success(this.$t("common.submitSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(t){this.$message.error(t),console.error("修改失败:",t)}})}}},I=M,x=Object(y["a"])(I,R,w,!1,null,null,null),C=x.exports,k={name:"ResourceStoreTypeManage",components:{AddResourceStoreType:g,DeleteResourceStoreType:v,EditResourceStoreType:C},data(){return{currentPage:1,pageSize:10,resourceStoreTypeManageInfo:{resourceStoreTypes:[],total:0,records:1,conditions:{rstId:"",name:"",description:"",shopId:""}}}},created(){this._listResourceStoreTypes(this.currentPage,this.pageSize)},methods:{handleCurrentChange(e){this.currentPage=e,this._listResourceStoreTypes(this.currentPage,this.pageSize)},async _listResourceStoreTypes(e,t){this.resourceStoreTypeManageInfo.conditions.page=e,this.resourceStoreTypeManageInfo.conditions.row=t,this.resourceStoreTypeManageInfo.conditions.shopId=Object(d["f"])();try{const e=await i(this.resourceStoreTypeManageInfo.conditions);this.resourceStoreTypeManageInfo.total=e.total,this.resourceStoreTypeManageInfo.records=e.records,this.resourceStoreTypeManageInfo.resourceStoreTypes=e.data}catch(r){console.error("请求失败:",r)}},_queryResourceStoreTypeMethod(){this.currentPage=1,this._listResourceStoreTypes(this.currentPage,this.pageSize)},_openAddResourceStoreTypeModal(){this.$refs.addResourceStoreType.open()},_openDeleteResourceStoreTypeModel(e){this.$refs.deleteResourceStoreType.open(e)},_openEditResourceStoreTypeModel(e){this.$refs.editResourceStoreType.open(e)}}},V=k,P=(r("c0f1"),Object(y["a"])(V,o,s,!1,null,"91d66c12",null));t["default"]=P.exports},"7aa0":function(e,t,r){},c0f1:function(e,t,r){"use strict";r("7aa0")}}]);
|
|
//# sourceMappingURL=chunk-60d30ca6.940c5344.js.map
|