Files
PropertyDeployment/resources/Web/MicroCommunityMallWeb/html/js/chunk-28adf4e6.f70d7afe.js
Anfioo adfd019d2d 江门
1
2026-02-01 15:37:55 +08:00

2 lines
9.2 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-28adf4e6","chunk-fcd760a4"],{"39a6":function(t,e,o){"use strict";o.r(e);var r=function(){var t=this,e=t._self._c;return e("div",[e("el-row",{attrs:{gutter:20}},[e("el-col",{staticClass:"padding-r-0",attrs:{span:4}},[e("admin-shop",{on:{"shop-change":t.handleShopChange}})],1),e("el-col",{attrs:{span:20}},[e("el-card",{staticClass:"box-card"},[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v(t._s(t.$t("adminProduct.queryCondition")))])]),e("div",{},[e("el-form",{staticClass:"flex justify-start",attrs:{inline:!0,model:t.adminProductInfo.conditions}},[e("el-form-item",[e("el-input",{staticClass:"filter-item",attrs:{placeholder:t.$t("adminProduct.inputProductName")},model:{value:t.adminProductInfo.conditions.prodName,callback:function(e){t.$set(t.adminProductInfo.conditions,"prodName",e)},expression:"adminProductInfo.conditions.prodName"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t._queryProductMethod()}}},[t._v(t._s(t.$t("adminProduct.query")))])],1)],1)],1)]),e("el-card",{staticClass:"margin-top-sm"},[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v(t._s(t.$t("adminProduct.onShelfProducts")))])]),e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.adminProductInfo.products,border:""}},[e("el-table-column",{attrs:{prop:"productId",label:t.$t("adminProduct.productId"),align:"center"}}),e("el-table-column",{attrs:{label:t.$t("adminProduct.productImage"),align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){return[e("img",{staticStyle:{width:"60px",height:"60px","border-radius":"5px"},attrs:{src:t.row.coverPhoto}})]}}])}),e("el-table-column",{attrs:{prop:"categoryName",label:t.$t("adminProduct.productGroup"),align:"center"}}),e("el-table-column",{attrs:{prop:"prodName",label:t.$t("adminProduct.productName"),align:"center"}}),e("el-table-column",{attrs:{prop:"sales",label:t.$t("adminProduct.sales"),align:"center"}}),e("el-table-column",{attrs:{prop:"stock",label:t.$t("adminProduct.stock"),align:"center"}}),e("el-table-column",{attrs:{prop:"defaultSpecValue.price",label:t.$t("adminProduct.price"),align:"center"}}),e("el-table-column",{attrs:{prop:"sort",label:t.$t("adminProduct.sort"),align:"center"}}),e("el-table-column",{attrs:{prop:"stateName",label:t.$t("adminProduct.status"),align:"center"}}),e("el-table-column",{attrs:{prop:"createTime",label:t.$t("adminProduct.shelfTime"),align:"center"}}),e("el-table-column",{attrs:{label:t.$t("adminProduct.operation"),align:"right",width:"180"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t._viewProductDetail(o.row)}}},[t._v(t._s(t.$t("adminProduct.view")))]),e("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t._openDeleteProductModel(o.row)}}},[t._v(t._s(t.$t("adminProduct.delete")))])]}}])})],1),e("el-pagination",{staticClass:"pagination",attrs:{"current-page":t.currentPage,"page-size":t.pageSize,layout:"total, prev, pager, next, jumper",total:t.total},on:{"current-change":t.handleCurrentChange}})],1)],1)],1),e("delete-product",{ref:"deleteProduct"}),e("view-qrcode",{ref:"qrcodeDialog"})],1)},n=[],s=o("7323"),a=o("b775");function i(t){return new Promise((e,o)=>{Object(a["a"])({url:"/product.queryAdminProduct",method:"get",params:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}var c=o("c962"),d=o("455c"),l=o("4fb4"),u={name:"AdminProduct",components:{AdminShop:c["default"],DeleteProduct:d["a"],ViewQrcode:l["a"]},data(){return{shopId:"",adminProductInfo:{products:[],total:0,records:1,moreCondition:!1,productId:"",conditions:{categoryId:"",state:"2002",prodName:"",keyword:"",barCode:"",shopId:""},productCategorys:[]},currentPage:1,pageSize:10,total:0}},created(){this.shopId=Object(s["f"])(),console.log(this.adminProductInfo.moreCondition),this._listAdminProducts(1,10)},methods:{handleShopChange(t){this.adminProductInfo.conditions.shopId=t.shopId,this._listAdminProducts(1,10)},async _listAdminProducts(t,e){this.adminProductInfo.conditions.page=t,this.adminProductInfo.conditions.row=e;try{const t=await i(this.adminProductInfo.conditions);this.adminProductInfo.total=t.total,this.adminProductInfo.records=t.records,this.adminProductInfo.products=t.data,this.total=t.records}catch(o){console.error("请求失败:",o)}},_openDeleteProductModel(t){this.$refs.deleteProduct.open(t)},_queryProductMethod(){this._listAdminProducts(1,10)},_viewProductDetail(t){const e={qrcodeName:t.prodName,qrCodeUrl:t.pageUrl,remark:"手机扫码查看商品"};this.$refs.qrcodeDialog.open(e)},handleCurrentChange(t){this._listAdminProducts(t,10)}}},h=u,m=(o("7db3"),o("2877")),p=Object(m["a"])(h,r,n,!1,null,"42eac27a",null);e["default"]=p.exports},"430d":function(t,e,o){},"455c":function(t,e,o){"use strict";var r=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:t.$t("deleteProduct.confirmOperation")+"!",visible:t.dialogVisible,width:"30%","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("div",{attrs:{align:"center"}},[e("span",[t._v(t._s(t.$t("deleteProduct.confirmDeleteProduct")))])]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:t.closeDeleteProductModel}},[t._v(t._s(t.$t("deleteProduct.cancel")))]),e("el-button",{attrs:{type:"primary"},on:{click:t.deleteProduct}},[t._v(t._s(t.$t("deleteProduct.confirmDelete")))])],1)])},n=[],s=o("b775");function a(t){return new Promise((e,o)=>{Object(s["a"])({url:"/product.deleteProduct",method:"post",data:t}).then(t=>{const o=t.data;e(o)}).catch(t=>{o(t)})})}var i={name:"DeleteProduct",data(){return{dialogVisible:!1,deleteProductInfo:{}}},methods:{open(t){this.deleteProductInfo=t,this.dialogVisible=!0},handleClose(t){this.closeDeleteProductModel(),t()},async deleteProduct(){try{const t=await a(this.deleteProductInfo);0===t.code?(this.$message.success(t.msg),this.dialogVisible=!1,this.$emit("product-deleted")):this.$message.error(t.msg)}catch(t){console.error("删除商品失败:",t),this.$message.error("删除商品失败")}},closeDeleteProductModel(){this.dialogVisible=!1}}},c=i,d=(o("57dc"),o("2877")),l=Object(d["a"])(c,r,n,!1,null,"8c735c08",null);e["a"]=l.exports},"4fb4":function(t,e,o){"use strict";var r=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:t.form.qrcodeName,visible:t.visible,width:"400px"},on:{"update:visible":function(e){t.visible=e},close:t.handleClose}},[e("div",{staticClass:"text-center"},[e("div",{staticStyle:{width:"200px",height:"200px",margin:"0 auto"},attrs:{id:"qrcode"}}),e("p",{staticStyle:{margin:"15px 0","font-size":"16px","font-weight":"bold"}},[t._v(" "+t._s(t.form.qrcodeName)+" ")]),e("p",{staticStyle:{color:"#999"}},[t._v(" "+t._s(t.form.remark)+" ")])]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.visible=!1}}},[t._v(" "+t._s(t.$t("common.close"))+" ")])],1)])},n=[],s=o("d044"),a=o.n(s),i={name:"ViewQrcode",data(){return{visible:!1,form:{qrcodeName:"",qrCodeUrl:"",remark:""},qrcode:null}},methods:{open(t){this.visible=!0,this.form={...t},this.$nextTick(()=>{this.generateQRCode()})},handleClose(){this.qrcode&&(this.qrcode.clear(),document.getElementById("qrcode").innerHTML=""),this.form={qrcodeName:"",qrCodeUrl:"",remark:""}},generateQRCode(){this.qrcode&&(this.qrcode.clear(),document.getElementById("qrcode").innerHTML=""),this.form.qrCodeUrl&&(this.qrcode=new a.a(document.getElementById("qrcode"),{text:this.form.qrCodeUrl,width:200,height:200,colorDark:"#000000",colorLight:"#ffffff",correctLevel:a.a.CorrectLevel.L}))}},beforeDestroy(){this.qrcode&&this.qrcode.clear()}},c=i,d=(o("5cbf"),o("2877")),l=Object(d["a"])(c,r,n,!1,null,"b2ac6c9c",null);e["a"]=l.exports},"57dc":function(t,e,o){"use strict";o("cd4f")},"5cbf":function(t,e,o){"use strict";o("430d")},"5d1e":function(t,e,o){},"7db3":function(t,e,o){"use strict";o("5d1e")},9418:function(t,e,o){"use strict";o("cd80")},c962:function(t,e,o){"use strict";o.r(e);var r=function(){var t=this,e=t._self._c;return e("el-card",{staticClass:"list-selector"},[e("ul",{staticClass:"list-selector-list"},["Y"==t.showAll?e("li",{class:{selected:""===t.adminShopInfo.shopId},on:{click:function(e){return t.swatchAdminShopId({shopId:"",shopName:"全部"})}}},[t._v(" "+t._s(t.$t("common.all"))+" ")]):t._e(),t._l(t.adminShopInfo.shops,(function(o,r){return e("li",{key:r,class:{selected:t.adminShopInfo.shopId===o.shopId},on:{click:function(e){return t.swatchAdminShopId(o)}}},[t._v(" "+t._s(o.shopName)+" ")])}))],2)])},n=[],s=o("7323"),a={name:"AdminShop",data(){return{adminShopInfo:{shops:[],shopId:""}}},props:{showAll:{type:String,default:"Y"}},created(){this._listAdminShops()},methods:{async _listAdminShops(){try{const t=await Object(s["k"])({page:1,row:100});this.adminShopInfo.shops=t.data,"N"==this.showAll&&this.adminShopInfo.shops.length>0&&this.swatchAdminShopId(this.adminShopInfo.shops[0])}catch(t){console.error("获取店铺列表失败:",t)}},swatchAdminShopId(t){this.adminShopInfo.shopId=t.shopId,this.$emit("shop-change",t)}}},i=a,c=(o("9418"),o("2877")),d=Object(c["a"])(i,r,n,!1,null,"177c0c26",null);e["default"]=d.exports},cd4f:function(t,e,o){},cd80:function(t,e,o){}}]);
//# sourceMappingURL=chunk-28adf4e6.f70d7afe.js.map