zx/public/mer/js/chunk-1b6413b7.f3777c6d.js

1 line
3.7 KiB
JavaScript
Raw Normal View History

2024-07-02 15:32:59 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1b6413b7"],{"5c58":function(t,e,a){},c91c:function(t,e,a){"use strict";a("5c58")},d4f1: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,inline:"",size:"small","label-width":"60px"},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-form-item",{attrs:{label:"搜索:",prop:"value"}},[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(1)}},model:{value:t.tableFrom.value,callback:function(e){t.$set(t.tableFrom,"value",e)},expression:"tableFrom.value"}})],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 dataBox"},[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:"product_unit_id",label:"ID","min-width":"100"}}),t._v(" "),a("el-table-column",{attrs:{prop:"value",label:"单位名称","min-width":"180"}}),t._v(" "),a("el-table-column",{attrs:{prop:"sort",label:"排序","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.onEdit(e.row.product_unit_id)}}},[t._v("编辑")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.handleDelete(e.row.product_unit_id,e.$index)}}},[t._v("删除\n ")])]}}])})],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("c4c8"),s={name:"ProductUnit",data:function(){return{formDynamic:{template_name:"",template_value:[]},tableFrom:{page:1,limit:20},tableData:{data:[],total:0},listLoading:!0}},mounted:function(){this.getList()},methods:{searchReset:function(){this.$refs.searchForm.resetFields(),this.getList(1)},add:function(){var t=this;this.$modalForm(Object(l["Kb"])()).then((function(){return t.getList("")}))},getList:function(){var t=this;this.listLoading=!0,Object(l["Nb"])(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()},handleDelete:function(t,e){var a=this;this.$modalSure("确定删除该单位").then((function(){Object(l["Lb"])(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)}))}))},onEdit:function(t){var e=this;this.$modalForm(Object(l["Mb"])(t)).then((function(){return e.getList("")}))}}},r=s,o=(a("c91c"),a("2877")),c=Object(o["a"])(r,n,i,!1,null,"5f1503af",null);e["default"]=c.exports}}]);