You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
6.5 KiB
1 line
6.5 KiB
5 months ago
|
webpackJsonp([107],{"3v7X":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),s=a("exGp"),i=a.n(s),o=a("PJh5"),l=a.n(o),c={data:function(){return{statusOptions:[],loading:!1,searchForm:{page:1,limit:10,name:"",carte:0},tableData:[],total:0}},activated:function(){var e=this;return i()(n.a.mark(function t(){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.goodsCarteListCall();case 2:e.getTableDataList();case 3:case"end":return t.stop()}},t,e)}))()},methods:{resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},goodsCarteListCall:function(){var e=this;return i()(n.a.mark(function t(){var a,r,s;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.mall.goodsCarteList();case 2:if(a=t.sent,r=a.code,s=a.data,200===r){t.next=7;break}return t.abrupt("return");case 7:e.statusOptions=s,e.statusOptions.unshift({id:0,name:"全部"});case 9:case"end":return t.stop()}},t,e)}))()},getTableDataList:function(e){var t=this;return i()(n.a.mark(function a(){var r,s,i,o;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.tableData=[],t.loading=!0,r=t.searchForm,a.next=6,t.$api.mall.goodsList(r);case 6:if(s=a.sent,i=s.code,o=s.data,t.loading=!1,200===i){a.next=12;break}return a.abrupt("return");case 12:t.tableData=o.data,t.total=o.total;case 14:case"end":return a.stop()}},a,t)}))()},confirmDel:function(e,t){var a=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){a.updateItem(e,t)}).catch(function(){})},updateItem:function(e,t){var a=this;return i()(n.a.mark(function r(){return n.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.mall.goodsStatus({id:e,status:t}).then(function(e){if(200===e.code)a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1===t&&(a.searchForm.page=a.searchForm.page<Math.ceil((a.total-1)/a.searchForm.limit)?a.searchForm.page:Math.ceil((a.total-1)/a.searchForm.limit),a.getTableDataList());else{if(-1===t)return;a.getTableDataList()}});case 1:case"end":return r.stop()}},r,a)}))()}},filters:{handleTime:function(e,t){return 1===t?l()(1e3*e).format("YYYY-MM-DD"):2===t?l()(1e3*e).format("HH:mm:ss"):l()(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-custom"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-top-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-add",expression:"`${$route.name}-add`"}],attrs:{size:"medium",type:"primary",icon:"el-icon-plus"},on:{click:function(t){return e.$router.push("/mall/edit")}}},[e._v(e._s(e.$t("menu.MallGoodAdd")))])],1),e._v(" "),a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"分类",prop:"carte"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.getTableDataList(1)}},model:{value:e.searchForm.carte,callback:function(t){e.$set(e.searchForm,"carte",t)},expression:"searchForm.carte"}},e._l(e.statusOptions,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"商品名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入商品名称"},model:{value:e.searchForm.name,callback:function(t){e.$set(e.searchForm,"name",t)},expression:"searchForm.name"}})],1),e._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(
|