2 lines
9.5 KiB
JavaScript
2 lines
9.5 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-67882a40"],{4689:function(e,t,o){"use strict";o.r(t);var a=function(){var e=this,t=e._self._c;return t("div",[t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("查询条件")])]),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6}},[t("el-input",{attrs:{placeholder:"请输入商品名称",clearable:""},model:{value:e.recommendGoodsManageInfo.conditions.prodName,callback:function(t){e.$set(e.recommendGoodsManageInfo.conditions,"prodName",t)},expression:"recommendGoodsManageInfo.conditions.prodName"}})],1),t("el-col",{attrs:{span:6}},[t("el-input",{attrs:{placeholder:"请输入商品ID",clearable:""},model:{value:e.recommendGoodsManageInfo.conditions.productId,callback:function(t){e.$set(e.recommendGoodsManageInfo.conditions,"productId",t)},expression:"recommendGoodsManageInfo.conditions.productId"}})],1),t("el-col",{attrs:{span:6}},[t("el-input",{attrs:{placeholder:"请输入产品条形码",clearable:""},model:{value:e.recommendGoodsManageInfo.conditions.barCode,callback:function(t){e.$set(e.recommendGoodsManageInfo.conditions,"barCode",t)},expression:"recommendGoodsManageInfo.conditions.barCode"}})],1),t("el-col",{attrs:{span:6}},[t("el-button",{attrs:{type:"primary"},on:{click:e._queryProductMethod}},[t("i",{staticClass:"el-icon-search"}),e._v(" 查询 ")])],1)],1)],1)],1)],1),t("el-row",{staticStyle:{"margin-top":"20px"}},[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("推荐商品")]),t("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"small"},on:{click:e.openChooseLabelProductModel}},[t("i",{staticClass:"el-icon-search"}),e._v(" 选择商品 ")])],1),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.recommendGoodsManageInfo.products,border:""}},[t("el-table-column",{attrs:{prop:"productId",label:"商品ID",align:"center"}}),t("el-table-column",{attrs:{label:"商品图片",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[t("el-image",{staticStyle:{width:"60px",height:"60px","border-radius":"5px"},attrs:{src:e.row.coverPhoto,fit:"cover"}})]}}])}),t("el-table-column",{attrs:{prop:"prodName",label:"商品名称",align:"center"}}),t("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center"}}),t("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(o){return[t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.openDeleteLabelProductModel(o.row)}}},[e._v("删除")])]}}])})],1),t("el-pagination",{staticStyle:{"margin-top":"20px","text-align":"right"},attrs:{"current-page":e.currentPage,"page-size":e.pageSize,layout:"total, prev, pager, next, jumper",total:e.recommendGoodsManageInfo.total},on:{"current-change":e.handleCurrentChange}})],1)],1)],1),t("choose-label-product",{ref:"chooseLabelProduct",on:{chooseLabelProduct:e.handleChooseLabelProduct}}),t("delete-label-product",{ref:"deleteLabelProduct",on:{listProduct:e.handleListProduct}})],1)},r=[],l=o("b775");function s(e){return new Promise((t,o)=>{Object(l["a"])({url:"/product.queryProductLabel",method:"get",params:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function n(e){return new Promise((t,o)=>{Object(l["a"])({url:"/product.queryProduct",method:"get",params:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function c(e){return new Promise((t,o)=>{Object(l["a"])({url:"/product.saveProductLabel",method:"post",data:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function i(e){return new Promise((t,o)=>{Object(l["a"])({url:"/product.deleteProductLabel",method:"post",data:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}var d=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"选择商品",visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.searchForm}},[t("el-form-item",{attrs:{label:"商品名称"}},[t("el-input",{attrs:{placeholder:"商品名称"},model:{value:e.searchForm.prodName,callback:function(t){e.$set(e.searchForm,"prodName",t)},expression:"searchForm.prodName"}})],1),t("el-form-item",{attrs:{label:"商品ID"}},[t("el-input",{attrs:{placeholder:"商品ID"},model:{value:e.searchForm.productId,callback:function(t){e.$set(e.searchForm,"productId",t)},expression:"searchForm.productId"}})],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.onSearch}},[e._v("查询")])],1)],1),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:""},on:{"selection-change":e.handleSelectionChange}},[t("el-table-column",{attrs:{type:"selection",width:"55"}}),t("el-table-column",{attrs:{prop:"productId",label:"商品ID",align:"center"}}),t("el-table-column",{attrs:{label:"商品图片",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[t("el-image",{staticStyle:{width:"60px",height:"60px"},attrs:{src:e.row.coverPhoto,fit:"cover"}})]}}])}),t("el-table-column",{attrs:{prop:"prodName",label:"商品名称",align:"center"}}),t("el-table-column",{attrs:{prop:"price",label:"价格",align:"center"}})],1),t("el-pagination",{staticStyle:{"margin-top":"20px"},attrs:{"current-page":e.currentPage,"page-size":e.pageSize,layout:"total, prev, pager, next, jumper",total:e.total},on:{"current-change":e.handleCurrentChange}}),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleConfirm}},[e._v("确 定")])],1)],1)},u=[],h={name:"ChooseLabelProduct",data(){return{dialogVisible:!1,searchForm:{prodName:"",productId:"",labelCd:""},tableData:[],multipleSelection:[],currentPage:1,pageSize:10,total:0}},methods:{open(e){this.searchForm.labelCd=e.labelCd,this.dialogVisible=!0,this.getProductList()},async getProductList(){try{const e=await n({...this.searchForm,page:this.currentPage,row:this.pageSize,hasProduct:"N"});this.tableData=e.data,this.total=e.total}catch(e){console.error("获取商品列表失败:",e)}},onSearch(){this.currentPage=1,this.getProductList()},handleSelectionChange(e){this.multipleSelection=e},handleCurrentChange(e){this.currentPage=e,this.getProductList()},handleConfirm(){0!==this.multipleSelection.length?(this.$emit("chooseLabelProduct",this.multipleSelection[0]),this.dialogVisible=!1):this.$message.warning("请至少选择一条数据")},handleClose(){this.searchForm.prodName="",this.searchForm.productId="",this.multipleSelection=[]}}},p=h,m=o("2877"),g=Object(m["a"])(p,d,u,!1,null,null,null),b=g.exports,f=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"删除推荐商品",visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("div",{staticStyle:{"text-align":"center"}},[t("p",[e._v("确定要删除该推荐商品吗?")])]),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleConfirm}},[e._v("确 定")])],1)])},P=[],C={name:"DeleteLabelProduct",data(){return{dialogVisible:!1,currentProduct:null}},methods:{open(e){this.currentProduct=e,this.dialogVisible=!0},async handleConfirm(){if(this.currentProduct)try{const e=await i({productId:this.currentProduct.productId,labelCd:"8800012001"});0===e.code?(this.$message.success("删除成功"),this.$emit("listProduct")):this.$message.error(e.msg)}catch(e){console.error("删除商品标签失败:",e),this.$message.error("删除商品标签失败")}finally{this.dialogVisible=!1}}}},y=C,I=Object(m["a"])(y,f,P,!1,null,null,null),v=I.exports,w={name:"RecommendGoodsManage",components:{ChooseLabelProduct:b,DeleteLabelProduct:v},data(){return{recommendGoodsManageInfo:{products:[],total:0,records:1,moreCondition:!1,productId:"",conditions:{prodName:"",productId:"",barCode:"",labelCd:"8800012001",hasProduct:"Y",page:1,row:10}},currentPage:1,pageSize:10}},created(){this._listProducts(this.currentPage,this.pageSize)},methods:{async _listProducts(e,t){this.recommendGoodsManageInfo.conditions.page=e,this.recommendGoodsManageInfo.conditions.row=t;try{const t=await s(this.recommendGoodsManageInfo.conditions);this.recommendGoodsManageInfo.total=t.total,this.recommendGoodsManageInfo.records=t.records,this.recommendGoodsManageInfo.products=t.data,this.currentPage=e}catch(o){console.error("获取商品列表失败:",o)}},async _saveProductLabel(e){const t={productId:e.productId,storeId:e.storeId,labelCd:"8800012001"};try{const e=await c(t);0===e.code?(this.$message.success(e.msg),this._listProducts(this.currentPage,this.pageSize)):this.$message.error(e.msg)}catch(o){console.error("保存商品标签失败:",o),this.$message.error("保存商品标签失败")}},_queryProductMethod(){this._listProducts(1,this.pageSize)},handleCurrentChange(e){this._listProducts(e,this.pageSize)},openChooseLabelProductModel(){this.$refs.chooseLabelProduct.open({labelCd:"8800012001"})},openDeleteLabelProductModel(e){this.$refs.deleteLabelProduct.open(e)},handleChooseLabelProduct(e){this._saveProductLabel(e)},handleListProduct(){this._listProducts(this.currentPage,this.pageSize)}}},S=w,_=(o("cfe9"),Object(m["a"])(S,a,r,!1,null,"ff038712",null));t["default"]=_.exports},cfe9:function(e,t,o){"use strict";o("e347")},e347:function(e,t,o){}}]);
|
|
//# sourceMappingURL=chunk-67882a40.fb74fa3c.js.map
|