2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3ff0c9ce"],{"20bf":function(t,e,r){"use strict";r("770d")},"48be":function(t,e,r){},"4f83":function(t,e,r){},"770d":function(t,e,r){},"9e71":function(t,e,r){"use strict";r("48be")},edd1:function(t,e,r){"use strict";r("4f83")},f7b3:function(t,e,r){"use strict";r.r(e);var a=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("el-card",{staticClass:"list-selector"},[e("ul",{staticClass:"list-selector-list"},[e("li",{class:{selected:""===t.mainCategoryProductInfo.conditions.mainCategoryId},on:{click:function(e){return t.swatchMainCategory({mainCategoryId:"",categoryName:"全部"})}}},[t._v(" "+t._s(t.$t("common.all"))+" ")]),t._l(t.mainCategoryProductInfo.mainCategorys,(function(r,a){return e("li",{key:a,class:{selected:t.mainCategoryProductInfo.conditions.mainCategoryId==r.mainCategoryId},on:{click:function(e){return t.swatchMainCategory(r)}}},[t._v(" "+t._s(r.categoryName)+" ")])}))],2)])],1),e("el-col",{attrs:{span:20}},[e("el-card",{staticClass:"box-card"},[e("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v(t._s(t.$t("mainCategoryProduct.queryCondition")))])]),e("el-form",{staticClass:"demo-form-inline text-left",attrs:{inline:!0}},[e("el-form-item",[e("el-input",{attrs:{placeholder:t.$t("mainCategoryProduct.inputName")},model:{value:t.mainCategoryProductInfo.conditions.productName,callback:function(e){t.$set(t.mainCategoryProductInfo.conditions,"productName",e)},expression:"mainCategoryProductInfo.conditions.productName"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t._queryMainCategoryProductMethod()}}},[t._v(" "+t._s(t.$t("mainCategoryProduct.query"))+" ")])],1)],1)],1),e("el-card",{staticClass:"margin-top-sm"},[e("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v(t._s(t.$t("mainCategoryProduct.specialProduct")))]),e("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"small"},on:{click:function(e){return t._openAddMainCategoryProductModal()}}},[t._v(" "+t._s(t.$t("mainCategoryProduct.add"))+" ")])],1),e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.mainCategoryProductInfo.mainCategoryProducts}},[e("el-table-column",{attrs:{prop:"categoryName",label:t.$t("mainCategoryProduct.category"),align:"center"}}),e("el-table-column",{attrs:{prop:"productId",label:t.$t("mainCategoryProduct.code"),align:"center"}}),e("el-table-column",{attrs:{prop:"productName",label:t.$t("mainCategoryProduct.name"),align:"center"}}),e("el-table-column",{attrs:{prop:"startTime",label:t.$t("mainCategoryProduct.startTime"),align:"center"}}),e("el-table-column",{attrs:{prop:"endTime",label:t.$t("mainCategoryProduct.endTime"),align:"center"}}),e("el-table-column",{attrs:{prop:"seq",label:t.$t("mainCategoryProduct.sort"),align:"center"}}),e("el-table-column",{attrs:{label:t.$t("mainCategoryProduct.operation"),align:"center"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t._openEditMainCategoryProductModel(r.row)}}},[t._v(" "+t._s(t.$t("mainCategoryProduct.edit"))+" ")]),e("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t._openDeleteMainCategoryProductModel(r.row)}}},[t._v(" "+t._s(t.$t("mainCategoryProduct.delete"))+" ")])]}}])})],1),e("el-pagination",{attrs:{"current-page":t.mainCategoryProductInfo.conditions.page,"page-size":t.mainCategoryProductInfo.conditions.row,layout:"total, prev, pager, next",total:t.mainCategoryProductInfo.total},on:{"current-change":t.handleCurrentChange}})],1)],1)],1),e("add-main-category-product",{ref:"addMainCategoryProduct",on:{refresh:t._listMainCategoryProducts}}),e("edit-main-category-product",{ref:"editMainCategoryProduct",on:{refresh:t._listMainCategoryProducts}}),e("delete-main-category-product",{ref:"deleteMainCategoryProduct",on:{refresh:t._listMainCategoryProducts}})],1)},o=[],i=r("b775");function s(t){return new Promise((e,r)=>{Object(i["a"])({url:"/productCategory.queryMainCategoryProduct",method:"get",params:t}).then(t=>{const r=t.data;e(r)}).catch(t=>{r(t)})})}function n(t){return new Promise((e,r)=>{Object(i["a"])({url:"/productCategory.queryMainCategory",method:"get",params:t}).then(t=>{const r=t.data;e(r)}).catch(t=>{r(t)})})}function c(t){return new Promise((e,r)=>{Object(i["a"])({url:"/productCategory.saveMainCategoryProduct",method:"post",data:t}).then(t=>{const r=t.data;e(r)}).catch(t=>{r(t)})})}function d(t){return new Promise((e,r)=>{Object(i["a"])({url:"/productCategory.updateMainCategoryProduct",method:"post",data:t}).then(t=>{const r=t.data;e(r)}).catch(t=>{r(t)})})}function l(t){return new Promise((e,r)=>{Object(i["a"])({url:"/productCategory.deleteMainCategoryProduct",method:"post",data:t}).then(t=>{const r=t.data;e(r)}).catch(t=>{r(t)})})}var u=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:t.$t("mainCategoryProduct.add"),visible:t.dialogVisible,width:"70%"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.handleClose}},[e("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:t.$t("mainCategoryProduct.category"),prop:"mainCategoryId"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:t.$t("mainCategoryProduct.selectCategory")},model:{value:t.form.mainCategoryId,callback:function(e){t.$set(t.form,"mainCategoryId",e)},expression:"form.mainCategoryId"}},t._l(t.mainCategoryOptions,(function(t){return e("el-option",{key:t.mainCategoryId,attrs:{label:t.categoryName,value:t.mainCategoryId}})})),1)],1),e("el-form-item",{attrs:{label:t.$t("mainCategoryProduct.productCode"),prop:"productId"}},[e("el-input",{attrs:{placeholder:t.$t("mainCategoryProduct.inputProductCode")},model:{value:t.form.productId,callback:function(e){t.$set(t.form,"productId",e)},expression:"form.productId"}}),e("p",{staticClass:"form-tip"},[t._v(t._s(t.$t("mainCategoryProduct.productCodeTip")))])],1),e("el-form-item",{attrs:{label:t.$t("mainCategoryProduct.startTime"),prop:"startTime"}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:t.$t("mainCategoryProduct.selectStartTime"),"value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.form.startTime,callback:function(e){t.$set(t.form,"startTime",e)},expression:"form.startTime"}})],1),e("el-form-item",{attrs:{label:t.$t("mainCategoryProduct.endTime"),prop:"endTime"}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:t.$t("mainCategoryProduct.selectEndTime"),"value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.form.endTime,callback:function(e){t.$set(t.form,"endTime",e)},expression:"form.endTime"}})],1),e("el-form-item",{attrs:{label:t.$t("mainCategoryProduct.sort"),prop:"seq"}},[e("el-input",{attrs:{placeholder:t.$t("mainCategoryProduct.inputSort")},model:{value:t.form.seq,callback:function(e){t.$set(t.form,"seq",e)},expression:"form.seq"}})],1)],1),e("span",{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.submitForm}},[t._v(t._s(t.$t("common.save")))])],1)],1)},m=[],g={name:"AddMainCategoryProduct",data(){return{dialogVisible:!1,mainCategoryOptions:[],form:{mainCategoryId:"",productId:"",startTime:"",endTime:"",seq:""},rules:{mainCategoryId:[{required:!0,message:this.$t("mainCategoryProduct.categoryRequired"),trigger:"blur"}],productId:[{required:!0,message:this.$t("mainCategoryProduct.productCodeRequired"),trigger:"blur"},{max:30,message:this.$t("mainCategoryProduct.productCodeMaxLength"),trigger:"blur"}],startTime:[{required:!0,message:this.$t("mainCategoryProduct.startTimeRequired"),trigger:"blur"}],endTime:[{required:!0,message:this.$t("mainCategoryProduct.endTimeRequired"),trigger:"blur"}],seq:[{required:!0,message:this.$t("mainCategoryProduct.sortRequired"),trigger:"blur"},{pattern:/^\d+$/,message:this.$t("mainCategoryProduct.sortMustNumber"),trigger:"blur"}]}}},methods:{open(){this.dialogVisible=!0,this.getMainCategoryList()},async getMainCategoryList(){try{const t=await n({page:1,row:100});this.mainCategoryOptions=t.data}catch(t){console.error("获取分类列表失败:",t)}},submitForm(){this.$refs.form.validate(async t=>{if(t)try{await c(this.form),this.$message.success(this.$t("mainCategoryProduct.addSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(e){console.error("添加失败:",e)}})},handleClose(){this.$refs.form.resetFields()}}},y=g,f=(r("9e71"),r("2877")),C=Object(f["a"])(y,u,m,!1,null,"73ff28d8",null),p=C.exports,h=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:t.$t("mainCategoryProduct.edit"),visible:t.dialogVisible,width:"70%"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.handleClose}},[e("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:t.$t("mainCategoryProduct.startTime"),prop:"startTime"}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:t.$t("mainCategoryProduct.selectStartTime"),"value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.form.startTime,callback:function(e){t.$set(t.form,"startTime",e)},expression:"form.startTime"}})],1),e("el-form-item",{attrs:{label:t.$t("mainCategoryProduct.endTime"),prop:"endTime"}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:t.$t("mainCategoryProduct.selectEndTime"),"value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.form.endTime,callback:function(e){t.$set(t.form,"endTime",e)},expression:"form.endTime"}})],1),e("el-form-item",{attrs:{label:t.$t("mainCategoryProduct.sort"),prop:"seq"}},[e("el-input",{attrs:{placeholder:t.$t("mainCategoryProduct.inputSort")},model:{value:t.form.seq,callback:function(e){t.$set(t.form,"seq",e)},expression:"form.seq"}})],1)],1),e("span",{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.submitForm}},[t._v(t._s(t.$t("common.save")))])],1)],1)},P=[],b={name:"EditMainCategoryProduct",data(){return{dialogVisible:!1,form:{mcProductId:"",startTime:"",endTime:"",seq:""},rules:{startTime:[{required:!0,message:this.$t("mainCategoryProduct.startTimeRequired"),trigger:"blur"}],endTime:[{required:!0,message:this.$t("mainCategoryProduct.endTimeRequired"),trigger:"blur"}],seq:[{required:!0,message:this.$t("mainCategoryProduct.sortRequired"),trigger:"blur"},{pattern:/^\d+$/,message:this.$t("mainCategoryProduct.sortMustNumber"),trigger:"blur"}],mcProductId:[{required:!0,message:this.$t("mainCategoryProduct.idRequired"),trigger:"blur"}]}}},methods:{open(t){this.form=Object.assign({},t),this.dialogVisible=!0},submitForm(){this.$refs.form.validate(async t=>{if(t)try{await d(this.form),this.$message.success(this.$t("mainCategoryProduct.editSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(e){console.error("修改失败:",e)}})},handleClose(){this.$refs.form.resetFields()}}},$=b,_=Object(f["a"])($,h,P,!1,null,null,null),M=_.exports,v=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:t.$t("mainCategoryProduct.confirmOperation"),visible:t.dialogVisible,width:"30%"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.handleClose}},[e("div",{staticClass:"text-center"},[e("p",[t._v(t._s(t.$t("mainCategoryProduct.confirmDeleteProduct")))])]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v(t._s(t.$t("mainCategoryProduct.cancel")))]),e("el-button",{attrs:{type:"primary"},on:{click:t.confirmDelete}},[t._v(t._s(t.$t("mainCategoryProduct.confirmDelete")))])],1)])},I=[],T={name:"DeleteMainCategoryProduct",data(){return{dialogVisible:!1,deleteData:{}}},methods:{open(t){this.deleteData=Object.assign({},t),this.dialogVisible=!0},async confirmDelete(){try{await l(this.deleteData),this.$message.success(this.$t("mainCategoryProduct.deleteSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(t){console.error("删除失败:",t)}},handleClose(){this.deleteData={}}}},w=T,q=(r("edd1"),Object(f["a"])(w,v,I,!1,null,"60f98f00",null)),k=q.exports,x={name:"MainCategoryProduct",components:{AddMainCategoryProduct:p,EditMainCategoryProduct:M,DeleteMainCategoryProduct:k},data(){return{mainCategoryProductInfo:{mainCategoryProducts:[],total:0,records:1,moreCondition:!1,mcProductId:"",mainCategorys:[],conditions:{page:1,row:10,mainCategoryId:"",productId:"",productName:"",state:""}}}},created(){this._listMainCategoryProducts(),this._listMainCategorys()},methods:{handleCurrentChange(t){this.mainCategoryProductInfo.conditions.page=t,this._listMainCategoryProducts()},async _listMainCategoryProducts(){try{const t=await s(this.mainCategoryProductInfo.conditions);this.mainCategoryProductInfo.total=t.total,this.mainCategoryProductInfo.records=t.records,this.mainCategoryProductInfo.mainCategoryProducts=t.data}catch(t){console.error("请求失败:",t)}},async _listMainCategorys(){try{const t=await n({page:1,row:100});this.mainCategoryProductInfo.mainCategorys=t.data}catch(t){console.error("请求失败:",t)}},_openAddMainCategoryProductModal(){this.$refs.addMainCategoryProduct.open()},_openEditMainCategoryProductModel(t){this.$refs.editMainCategoryProduct.open(t)},_openDeleteMainCategoryProductModel(t){this.$refs.deleteMainCategoryProduct.open(t)},_queryMainCategoryProductMethod(){this.mainCategoryProductInfo.conditions.page=1,this._listMainCategoryProducts()},swatchMainCategory(t){this.mainCategoryProductInfo.conditions.mainCategoryId=t.mainCategoryId,this._listMainCategoryProducts()}}},V=x,O=(r("20bf"),Object(f["a"])(V,a,o,!1,null,"c1fc61ba",null));e["default"]=O.exports}}]);
|
|
//# sourceMappingURL=chunk-3ff0c9ce.483cd77b.js.map
|