2 lines
7.3 KiB
JavaScript
2 lines
7.3 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ad6d522c"],{"1b71":function(e,t,a){"use strict";a("21c4")},"21c4":function(e,t,a){},b4e7:function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e._self._c;return t("div",[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:3}},[t("el-card",{staticClass:"list-selector"},[t("ul",{staticClass:"list-selector-list"},[t("li",{class:{selected:""===e.productLabelManageInfo.conditions.labelCd},on:{click:function(t){return e.handleLabelSelect("")}}},[e._v(" 全部 ")]),e._l(e.productLabelManageInfo.labels,(function(a,o){return t("li",{key:o,class:{selected:e.productLabelManageInfo.conditions.labelCd===a.labelCd},on:{click:function(t){return e.handleLabelSelect(a.labelCd)}}},[e._v(" "+e._s(a.labelName)+" ")])}))],2)])],1),t("el-col",{attrs:{span:21}},[t("el-card",{staticClass:"ibox"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("div",[e._v(e._s(e.$t("productLabelManage.queryCondition")))])]),t("div",{},[t("el-form",{staticClass:"flex justify-start",attrs:{inline:!0,model:e.productLabelManageInfo.conditions}},[t("el-form-item",[t("el-form-item",[t("el-input",{attrs:{placeholder:e.$t("productLabelManage.inputProductName")},model:{value:e.productLabelManageInfo.conditions.prodName,callback:function(t){e.$set(e.productLabelManageInfo.conditions,"prodName",t)},expression:"productLabelManageInfo.conditions.prodName"}})],1)],1),t("el-form-item",[t("el-form-item",[t("el-input",{attrs:{placeholder:e.$t("productLabelManage.inputProductId")},model:{value:e.productLabelManageInfo.conditions.productId,callback:function(t){e.$set(e.productLabelManageInfo.conditions,"productId",t)},expression:"productLabelManageInfo.conditions.productId"}})],1)],1),t("el-form-item",[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e._queryLabelMethod()}}},[t("i",{staticClass:"el-icon-search"}),e._v(" "+e._s(e.$t("common.query"))+" ")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e._resetLabelMethod()}}},[t("i",{staticClass:"el-icon-refresh"}),e._v(" "+e._s(e.$t("common.reset"))+" ")])],1)],1)],1)]),t("el-card",{staticClass:"margin-top-sm"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("div",[e._v(e._s(e.$t("productLabelManage.labeledProducts")))])]),t("div",{},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.productLabelManageInfo.productLabels,border:""}},[t("el-table-column",{attrs:{prop:"labelName",label:e.$t("productLabelManage.labelName"),align:"center"}}),t("el-table-column",{attrs:{prop:"productId",label:e.$t("productLabelManage.productId"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("productLabelManage.productImage"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[t("img",{staticStyle:{width:"60px",height:"60px","border-radius":"5px"},attrs:{src:e.row.coverPhoto}})]}}])}),t("el-table-column",{attrs:{prop:"categoryName",label:e.$t("productLabelManage.productGroup"),align:"center"}}),t("el-table-column",{attrs:{prop:"prodName",label:e.$t("productLabelManage.productName"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("common.operation"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e._openDeleteLabelModel(a.row)}}},[e._v(" "+e._s(e.$t("common.delete"))+" ")])]}}])})],1),t("el-pagination",{attrs:{"current-page":e.productLabelManageInfo.conditions.page,"page-size":e.productLabelManageInfo.conditions.row,layout:"total, prev, pager, next",total:e.productLabelManageInfo.total},on:{"current-change":e.handleCurrentChange}})],1)])],1)],1),t("delete-product-label",{ref:"deleteProductLabel"})],1)},l=[],n=a("b775");function r(e){return new Promise((t,a)=>{Object(n["a"])({url:"/product.queryProductLabel",method:"get",params:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function c(e){return new Promise((t,a)=>{Object(n["a"])({url:"/label/queryLabel",method:"get",params:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function s(e){return new Promise((t,a)=>{Object(n["a"])({url:"/product.deleteProductLabel",method:"post",data:e,headers:{"Content-Type":"application/json"}}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}var d=a("7323"),i=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("productLabelManage.confirmOperation"),visible:e.dialogVisible,width:"30%","before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("div",{attrs:{align:"center"}},[t("p",[e._v(e._s(e.$t("productLabelManage.confirmRemoveLabel")))])]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDeleteProductLabelModel}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.deleteProductLabel}},[e._v(e._s(e.$t("common.confirm")))])],1)])},u=[],b={name:"DeleteProductLabel",data(){return{dialogVisible:!1,deleteProductLabelInfo:{}}},methods:{open(e){this.deleteProductLabelInfo={...e},this.dialogVisible=!0},handleClose(e){this.closeDeleteProductLabelModel(),e()},closeDeleteProductLabelModel(){this.dialogVisible=!1},async deleteProductLabel(){try{this.deleteProductLabelInfo.shopId=Object(d["f"])();const e=await s(this.deleteProductLabelInfo);0===e.code?(this.$message.success(this.$t("common.submitSuccess")),this.closeDeleteProductLabelModel(),this.$emit("refresh")):this.$message.error(e.msg)}catch(e){this.$message.error(this.$t("common.deleteFailed")),console.error("删除失败:",e)}}}},p=b,h=a("2877"),f=Object(h["a"])(p,i,u,!1,null,null,null),g=f.exports,m={name:"ProductLabelManage",components:{DeleteProductLabel:g},data(){return{productLabelManageInfo:{productLabels:[],labels:[],total:0,records:1,moreCondition:!1,productLabelId:"",conditions:{prodName:"",labelCd:"",productId:"",shopId:"",page:1,row:10}}}},created(){this.productLabelManageInfo.conditions.productId=this.$route.query.productId||"",this.productLabelManageInfo.conditions.shopId=Object(d["f"])(),this._listLabels(),this._listProductLabels(1,10),console.log(this.productLabelManageInfo.moreCondition)},methods:{handleCurrentChange(e){this._listProductLabels(e,this.productLabelManageInfo.conditions.row)},async _listProductLabels(e,t){this.productLabelManageInfo.conditions.page=e,this.productLabelManageInfo.conditions.row=t;try{const e=await r(this.productLabelManageInfo.conditions);this.productLabelManageInfo.total=e.total,this.productLabelManageInfo.records=e.records,this.productLabelManageInfo.productLabels=e.data}catch(a){console.error("请求失败:",a)}},async _listLabels(){try{const e=await c({page:1,row:100,shopId:Object(d["f"])()});this.productLabelManageInfo.labels=e.data}catch(e){console.error("请求失败:",e)}},_openDeleteLabelModel(e){this.$refs.deleteProductLabel.open(e)},_queryLabelMethod(){this._listProductLabels(1,this.productLabelManageInfo.conditions.row)},_resetLabelMethod(){this.productLabelManageInfo.conditions={prodName:"",labelCd:"",productId:"",shopId:Object(d["f"])(),page:1,row:10},this._listProductLabels(1,10)},handleLabelSelect(e){this.productLabelManageInfo.conditions.labelCd=e,this.productLabelManageInfo.conditions.page=1,this._listProductLabels(1,this.productLabelManageInfo.conditions.row)}}},L=m,M=(a("1b71"),Object(h["a"])(L,o,l,!1,null,"a91f34ea",null));t["default"]=M.exports}}]);
|
|
//# sourceMappingURL=chunk-ad6d522c.8e52549f.js.map
|