dqNK.717cebcf.js 7.3 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["dqNK"],{dqNK:function(e,t,i){"use strict";i.r(t);var n=i("QbLZ"),a=i.n(n),r=i("t3Un");var o={data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,total:0,priceList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,companyId:void 0,route:void 0,unitPrice:void 0,remark1:void 0,remark2:void 0,remark3:void 0,deleteFlag:void 0,gmtCreate:void 0,gmtUpdate:void 0,userId:void 0,adminId:void 0},form:{},rules:{deleteFlag:[{required:!0,message:"0:否(默认) 1:是不能为空",trigger:"blur"}]}}},created:function(){this.getList()},methods:{getList:function(){var e=this;this.loading=!0,function(e){return Object(r.a)({method:"get",params:a()({_gp:"admin.unimall.pincheRoutePrice",_mt:"list"},e)})}(this.queryParams).then(function(t){e.priceList=t.data.data.items,e.total=t.data.data.count,e.loading=!1})},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:void 0,companyId:void 0,route:void 0,unitPrice:void 0,remark1:void 0,remark2:void 0,remark3:void 0,deleteFlag:void 0,gmtCreate:void 0,gmtUpdate:void 0,userId:void 0,adminId:void 0},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map(function(e){return e.id}),this.single=1!=e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title="添加路线价格"},handleUpdate:function(e){var t=this;this.reset(),function(e){return Object(r.a)({method:"get",params:{_gp:"admin.unimall.pincheRoutePrice",_mt:"get",id:e}})}(e.id||this.ids.join(",")).then(function(e){t.form=e.data.data,t.open=!0,t.title="修改路线价格"})},submitForm:function(){var e=this;this.$refs.form.validate(function(t){t&&(void 0!=e.form.id?function(e){return Object(r.a)({method:"post",params:{_gp:"admin.unimall.pincheRoutePrice",_mt:"update",pincheRoutePrice:e}})}(e.form).then(function(t){t.data?(e.msgSuccess("修改成功"),e.open=!1,e.getList()):e.msgError(t.msg)}):function(e){return Object(r.a)({method:"post",params:{_gp:"admin.unimall.pincheRoutePrice",_mt:"add",pincheRoutePrice:e}})}(e.form).then(function(t){t.data?(e.msgSuccess("新增成功"),e.open=!1,e.getList()):e.msgError(t.msg)}))})},handleDelete:function(e){var t=this,i=e.id||this.ids.join(",");this.$confirm('是否确认删除路线价格编号为"'+i+'"的数据项?',"警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){return function(e){return Object(r.a)({method:"post",params:{_gp:"admin.unimall.pincheRoutePrice",_mt:"delete",id:e}})}(i)}).then(function(){t.getList(),t.msgSuccess("删除成功")}).catch(function(){})},handleExport:function(){var e=this,t=this.queryParams;this.$confirm("是否确认导出所有路线价格数据项?","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){return function(e){return Object(r.a)({method:"get",params:a()({_gp:"admin.unimall.pincheRoutePrice",_mt:"export"},e)})}(t)}).then(function(t){e.download(t.data.data)}).catch(function(){})}}},l=i("KHd+"),s=Object(l.a)(o,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-form",{ref:"queryForm",attrs:{model:e.queryParams,inline:!0,"label-width":"68px"}},[i("el-form-item",{attrs:{label:"路线",prop:"route"}},[i("el-input",{attrs:{placeholder:"请输入路线",clearable:"",size:"small"},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.handleQuery(t):null}},model:{value:e.queryParams.route,callback:function(t){e.$set(e.queryParams,"route",t)},expression:"queryParams.route"}})],1),e._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),e._v(" "),i("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),e._v(" "),i("el-row",{staticClass:"mb8",attrs:{gutter:10}},[i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["unimall:price:add"],expression:"['unimall:price:add']"}],attrs:{type:"primary",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),e._v(" "),i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["unimall:price:edit"],expression:"['unimall:price:edit']"}],attrs:{disabled:e.single,type:"success",icon:"el-icon-edit",size:"mini"},on:{click:e.handleUpdate}},[e._v("修改")])],1),e._v(" "),i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["unimall:price:remove"],expression:"['unimall:price:remove']"}],attrs:{disabled:e.multiple,type:"danger",icon:"el-icon-delete",size:"mini"},on:{click:e.handleDelete}},[e._v("删除")])],1)],1),e._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.priceList},on:{"selection-change":e.handleSelectionChange}},[i("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{label:"路线",align:"center",prop:"route"}}),e._v(" "),i("el-table-column",{attrs:{label:"单价",align:"center",prop:"unitPrice"}}),e._v(" "),i("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["unimall:price:edit"],expression:"['unimall:price:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(i){e.handleUpdate(t.row)}}},[e._v("修改")]),e._v(" "),i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["unimall:price:remove"],expression:"['unimall:price:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(i){e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),e._v(" "),i("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),e._v(" "),i("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px"},on:{"update:visible":function(t){e.open=t}}},[i("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[i("el-form-item",{attrs:{label:"路线",prop:"route"}},[i("el-input",{attrs:{placeholder:"请输入路线,例如:北京⇋上海"},model:{value:e.form.route,callback:function(t){e.$set(e.form,"route",t)},expression:"form.route"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"\n 单价(每公里)",prop:"unitPrice"}},[i("el-input",{attrs:{placeholder:"请输入金额"},model:{value:e.form.unitPrice,callback:function(t){e.$set(e.form,"unitPrice",t)},expression:"form.unitPrice"}})],1)],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),e._v(" "),i("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},[],!1,null,null,null);s.options.__file="index.vue";t.default=s.exports}}]);