shop_mer_admin/mer/js/chunk-6f437dd1.ed85dcab.js

1 line
4.9 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6f437dd1"],{"70d7":function(t,e,a){},"7b74":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox"},[a("div",{staticClass:"selCard"},[a("el-form",{ref:"searchForm",attrs:{model:t.tableFrom,size:"small","label-width":"85px",inline:""},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-form-item",{attrs:{label:"模板名称:",prop:"name"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入模板名称",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(e)}},model:{value:t.tableFrom.name,callback:function(e){t.$set(t.tableFrom,"name",e)},expression:"tableFrom.name"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.getList(1)}}},[t._v("搜索")]),t._v(" "),a("el-button",{attrs:{size:"small"},on:{click:function(e){return t.searchReset()}}},[t._v("重置")])],1)],1)],1),t._v(" "),a("el-card",{staticClass:"mt14"},[a("el-button",{staticClass:"mb20",attrs:{size:"small",type:"primary"},on:{click:t.add}},[t._v("添加运费模板")]),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.tableData.data,size:"small","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"shipping_template_id",label:"ID","min-width":"60"}}),t._v(" "),a("el-table-column",{attrs:{prop:"name",label:"模板名称","min-width":"150"}}),t._v(" "),a("el-table-column",{attrs:{label:"计费方式","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("span",[t._v(t._s(t._f("typeFilter")(n.type)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"指定包邮","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("span",[t._v(t._s(t._f("statusFilter")(n.appoint)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"指定区域不配送","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("span",[t._v(t._s(t._f("statusFilter")(n.undelivery)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"sort",label:"排序","min-width":"100"}}),t._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间","min-width":"150"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"150",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[0==e.row.is_default?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.setDefault(e.row.shipping_template_id)}}},[t._v("设为默认")]):t._e(),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.onEdit(e.row.shipping_template_id)}}},[t._v("编辑")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.handleDelete(e.row.shipping_template_id,e.$index)}}},[t._v("删除")])]}}])})],1),t._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{background:"","page-size":t.tableFrom.limit,"current-page":t.tableFrom.page,layout:"total, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1)],1)},i=[],l=a("8a9d"),s={name:"ShippingTemplates",filters:{statusFilter:function(t){var e={1:"自定义",2:"开启",0:"关闭"};return e[t]},typeFilter:function(t){var e={0:"按件数",1:"按重量",2:"按体积"};return e[t]}},data:function(){return{dialogVisible:!1,tableFrom:{page:1,limit:20,name:""},tableData:{data:[],total:0},listLoading:!0,componentKey:0}},mounted:function(){this.getList()},methods:{searchReset:function(){this.$refs.searchForm.resetFields(),this.getList(1)},add:function(){var t=this;this.$modalTemplates(0,(function(){t.getList()}))},getList:function(){var t=this;this.listLoading=!0,Object(l["e"])(this.tableFrom).then((function(e){t.tableData.data=e.data.list,t.tableData.total=e.data.count,t.listLoading=!1})).catch((function(e){t.listLoading=!1,t.$message.error(e.message)}))},pageChange:function(t){this.tableFrom.page=t,this.getList()},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList()},onEdit:function(t){var e=this;this.$modalTemplates(t,(function(){e.getList()}),this.componentKey+=1)},setDefault:function(t){var e=this;this.$modalSure("将该模板设为默认模板").then((function(){Object(l["f"])(t).then((function(t){var a=t.message;e.$message.success(a),e.getList()})).catch((function(t){var a=t.message;e.$message.error(a)}))}))},handleDelete:function(t,e){var a=this;this.$modalSure("删除该模板").then((function(){Object(l["c"])(t).then((function(t){var n=t.message;a.$message.success(n),a.tableData.data.splice(e,1)})).catch((function(t){var e=t.message;a.$message.error(e)}))}))}}},r=s,o=(a("ea11"),a("2877")),c=Object(o["a"])(r,n,i,!1,null,"22655379",null);e["default"]=c.exports},ea11:function(t,e,a){"use strict";a("70d7")}}]);