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 lines
11 KiB
1 lines
11 KiB
webpackJsonp([73],{"0Ynn":function(e,t){},r4CE:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("mvHQ"),n=a.n(r),i=a("Xxa5"),s=a.n(i),o=a("exGp"),l=a.n(o),c=a("PJh5"),u=a.n(c),d={data:function(){return{loading:!1,pagePermission:[],base_city:[],searchForm:{page:1,limit:10,name:""},tableData:[],total:0,subForm:{id:0,city_id:"",distance_free:"",distance_price:"",start_distance:"",start_price:"",invented_distance:""},subFormRules:{city_id:{required:!0,type:"number",message:"请选择城市",trigger:"blur"},start_distance:{required:!0,validator:this.$reg.isFloatNum,trigger:"blur"},start_price:{required:!0,validator:this.$reg.isMoney,trigger:"blur"},distance_price:{required:!0,validator:this.$reg.isMoney,trigger:"blur"},invented_distance:{required:!0,validator:this.$reg.isPercent,trigger:"blur"}},showDialog:!1}},created:function(){var e=this;return l()(s.a.mark(function t(){return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.pagePermission=e.$route.meta.pagePermission.filter(function(t){return t.title===e.$route.name})[0].auth,t.next=3,e.getCityList();case 3:e.getTableDataList();case 4:case"end":return t.stop()}},t,e)}))()},methods:{getCityList:function(){var e=this;return l()(s.a.mark(function t(){var a,r,n;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.subForm.city_id=[],t.next=3,e.$api.system.citySelect();case 3:if(a=t.sent,r=a.code,n=a.data,200===r){t.next=8;break}return t.abrupt("return");case 8:e.base_city=n;case 9:case"end":return t.stop()}},t,e)}))()},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},toChange:function(e){var t=this;return l()(s.a.mark(function a(){return s.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:t.searchForm.status=e,t.getTableDataList(1);case 2:case"end":return a.stop()}},a,t)}))()},getTableDataList:function(e){var t=this;return l()(s.a.mark(function a(){var r,n,i;return s.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.tableData=[],t.loading=!0,a.next=5,t.$api.system.getCarConfigList(t.searchForm);case 5:if(r=a.sent,n=r.code,i=r.data,t.loading=!1,200===n){a.next=11;break}return a.abrupt("return");case 11:t.tableData=i.data,t.total=i.total;case 13:case"end":return a.stop()}},a,t)}))()},toShowDialog:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l()(s.a.mark(function a(){var r,i;return s.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:for(i in r=JSON.parse(n()(t)),e.subForm)e.subForm[i]=r[i];e.showDialog=!0;case 3:case"end":return a.stop()}},a,e)}))()},updateItem:function(e,t){var a=this;return l()(s.a.mark(function r(){var n,i;return s.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:n=-1===t?{id:e}:{id:e,status:t},i=-1===t?"getCarConfigDel":"getCarConfigUpdate",a.$api.system[i](n).then(function(e){if(200===e.code){if(a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1!==t)return;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 3:case"end":return r.stop()}},r,a)}))()},confirmDel:function(e){var t=this;this.$confirm("删除之后,该城市的车费默认使用全局车费设置,确认删除吗?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)})},submitForm:function(){var e=this;this.$refs.subForm.validate(function(t){if(t){var a=JSON.parse(n()(e.subForm)),r=a.id?"getCarConfigUpdate":"getCarConfigAdd";e.$api.system[r](a).then(function(t){200===t.code&&(e.$message.success(e.$t("tips.successSub")),e.showDialog=!1,e.getTableDataList())})}})}},filters:{handleTime:function(e,t){return 1===t?u()(1e3*e).format("YYYY-MM-DD"):2===t?u()(1e3*e).format("HH:mm:ss"):u()(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},m={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-system-transaction"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("lb-tips",[e._v("\n 未单独设置车费的城市,将使用默认的全局设置车费模式,如果有单独设置城市车费,则全局模式失效\n ")]),e._v(" "),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:{type:"primary",icon:"el-icon-plus"},on:{click:e.toShowDialog}},[e._v(e._s(e.$t("menu.SystemCarFeeCityAdd")))])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"city_name",label:"城市","min-width":"120"}}),e._v(" "),a("el-table-column",{attrs:{label:"起步距离",prop:"start_distance","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.start_distance+" km")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"起步价",prop:"start_price","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.start_price+" 元")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"里程计价",prop:"distance_price","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.distance_price+" 元/km")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"",prop:"invented_distance","min-width":"120"},scopedSlots:e._u([{key:"header",fn:function(t){return[a("div",{staticStyle:{"margin-top":"7px"}},[e._v("\n 虚拟里程\n "),a("lb-tool-tips",{attrs:{padding:"11"}},[e._v("虚拟里程用于\n 距离计算短、车费计算少的情况可在后台增加一部分虚拟里程,减少"+e._s(e.$t("action.attendantName"))+"损失\n "),a("div",{staticClass:"mt-sm"},[e._v("\n 用户端显示的距离=实际距离+实际距离*虚拟里程百分比\n ")])])],1)]}},{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.invented_distance+" %")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"是否上架"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{disabled:!e.pagePermission.includes("edit"),"active-value":1,"inactive-value":0},on:{change:function(a){return e.updateItem(t.row.id,t.row.status)}},model:{value:t.row.status,callback:function(a){e.$set(t.row,"status",a)},expression:"scope.row.status"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-edit",expression:"`${$route.name}-edit`"}],attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return e.toShowDialog(t.row)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-delete",expression:"`${$route.name}-delete`"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return e.confirmDel(t.row.id)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}}),e._v(" "),a("el-dialog",{attrs:{title:e.$t(e.subForm.id?"menu.SystemCarFeeCityEdit":"menu.SystemCarFeeCityAdd"),visible:e.showDialog,width:"550px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[a("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"120px"},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"城市",prop:"city_id"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:e.subForm.city_id,callback:function(t){e.$set(e.subForm,"city_id",t)},expression:"subForm.city_id"}},e._l(e.base_city,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"起步距离",prop:"start_distance"}},[a("el-input",{attrs:{placeholder:"请输入起步距离"},model:{value:e.subForm.start_distance,callback:function(t){e.$set(e.subForm,"start_distance",t)},expression:"subForm.start_distance"}},[a("template",{slot:"append"},[e._v("km")])],2)],1),e._v(" "),a("el-form-item",{attrs:{label:"起步价",prop:"start_price"}},[a("el-input",{attrs:{placeholder:"请输入起步价"},model:{value:e.subForm.start_price,callback:function(t){e.$set(e.subForm,"start_price",t)},expression:"subForm.start_price"}},[a("template",{slot:"append"},[e._v("元")])],2)],1),e._v(" "),a("el-form-item",{attrs:{label:"里程计价",prop:"distance_price"}},[a("el-input",{attrs:{placeholder:"请输入里程计价"},model:{value:e.subForm.distance_price,callback:function(t){e.$set(e.subForm,"distance_price",t)},expression:"subForm.distance_price"}},[a("template",{slot:"append"},[e._v("元/km")])],2)],1),e._v(" "),a("el-form-item",{attrs:{label:"虚拟里程",prop:"invented_distance"}},[a("el-input",{attrs:{placeholder:"请输入虚拟里程"},model:{value:e.subForm.invented_distance,callback:function(t){e.$set(e.subForm,"invented_distance",t)},expression:"subForm.invented_distance"}},[a("template",{slot:"append"},[e._v("%")])],2),e._v(" "),a("lb-tool-tips",[e._v("虚拟里程用于 距离计算短、车费计算少\n 的情况可在后台增加一部分虚拟里程,减少"+e._s(e.$t("action.attendantName"))+"损失\n "),a("div",{staticClass:"mt-sm"},[e._v("\n 用户端显示的距离=实际距离+实际距离*虚拟里程百分比\n ")])])],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")])],1)],1)],1)],1)},staticRenderFns:[]};var p=a("VU/8")(d,m,!1,function(e){a("0Ynn")},"data-v-43fa997c",null);t.default=p.exports}}); |