2 lines
4.0 KiB
JavaScript
2 lines
4.0 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c2070"],{"490e":function(t,e,r){"use strict";r.r(e);var o=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:t.$t("productPriceRule.productPricing"),visible:t.dialogVisible,width:"80%"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.handleClose}},[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:8}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:t.$t("productPriceRule.selectProductCategory")},model:{value:t.updateProductPriceInfo.categoryId,callback:function(e){t.$set(t.updateProductPriceInfo,"categoryId",e)},expression:"updateProductPriceInfo.categoryId"}},t._l(t.updateProductPriceInfo.productCategorys,(function(t){return e("el-option",{key:t.categoryId,attrs:{label:t.categoryName,value:t.categoryId}})})),1)],1),e("el-col",{attrs:{span:16}},[e("el-input",{attrs:{placeholder:t.$t("productPriceRule.inputProductName")},model:{value:t.updateProductPriceInfo._currentProductName,callback:function(e){t.$set(t.updateProductPriceInfo,"_currentProductName",e)},expression:"updateProductPriceInfo._currentProductName"}},[e("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:t.queryProducts},slot:"append"})],1)],1)],1),e("el-table",{staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:t.updateProductPriceInfo.products},on:{"selection-change":t.handleSelectionChange}},[e("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e("el-table-column",{attrs:{prop:"prodName",label:t.$t("productPriceRule.productName"),align:"center"}}),e("el-table-column",{attrs:{prop:"categoryName",label:t.$t("productPriceRule.productCategory"),align:"center"}}),e("el-table-column",{attrs:{prop:"productId",label:t.$t("productPriceRule.productId"),align:"center"}})],1),e("el-pagination",{staticStyle:{"margin-top":"20px"},attrs:{"current-page":t.currentPage,"page-size":t.pageSize,layout:"total, prev, pager, next",total:t.total},on:{"current-change":t.handleCurrentChange}}),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v(t._s(t.$t("common.cancel")))]),e("el-button",{attrs:{type:"primary"},on:{click:t._updateProductPrice}},[t._v(t._s(t.$t("productPriceRule.pricing")))])],1)],1)},c=[],a=r("7323"),u=r("2084"),d={name:"UpdateProductPrice",data(){return{dialogVisible:!1,currentPage:1,pageSize:15,total:0,updateProductPriceInfo:{products:[],_currentProductName:"",productCategorys:[],categoryId:"",selectProducts:[],ruleId:""}}},created(){this._listProductCategorys()},methods:{open(t){this.updateProductPriceInfo.ruleId=t.ruleId,this.dialogVisible=!0,this._loadAllProductInfo()},handleClose(){this.resetForm()},resetForm(){this.updateProductPriceInfo={products:[],_currentProductName:"",categoryId:"",selectProducts:[],ruleId:""},this.currentPage=1},_listProductCategorys(){Object(u["d"])({page:1,row:50,shopId:Object(a["f"])()}).then(t=>{this.updateProductPriceInfo.productCategorys=t.data})},_loadAllProductInfo(){Object(u["c"])({page:this.currentPage,row:this.pageSize,name:this.updateProductPriceInfo._currentProductName,categoryId:this.updateProductPriceInfo.categoryId}).then(t=>{this.updateProductPriceInfo.products=t.data,this.total=t.records})},handleCurrentChange(t){this.currentPage=t,this._loadAllProductInfo()},handleSelectionChange(t){this.updateProductPriceInfo.selectProducts=t.map(t=>t.productId)},queryProducts(){this.currentPage=1,this._loadAllProductInfo()},_updateProductPrice(){0!==this.updateProductPriceInfo.selectProducts.length?Object(u["f"])({shopId:Object(a["f"])(),ruleId:this.updateProductPriceInfo.ruleId,productIds:this.updateProductPriceInfo.selectProducts.join(",")}).then(t=>{console.log(t),this.$message.success(this.$t("common.operateSuccess")),this.dialogVisible=!1,this.$emit("refresh")}):this.$message.warning(this.$t("productPriceRule.selectAtLeastOneProduct"))}}},l=d,i=r("2877"),n=Object(i["a"])(l,o,c,!1,null,null,null);e["default"]=n.exports}}]);
|
|
//# sourceMappingURL=chunk-2d0c2070.c9ce2af2.js.map
|