2 lines
17 KiB
JavaScript
2 lines
17 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4245aec9"],{"3d23":function(e,t,i){"use strict";i.r(t);var o=function(){var e=this,t=e._self._c;return t("div",[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("查询条件")])]),t("el-form",{staticClass:"flex justify-start",attrs:{inline:!0,model:e.conditions}},[t("el-form-item",[t("el-form-item",[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择费用大类"},model:{value:e.conditions.feeTypeCd,callback:function(t){e.$set(e.conditions,"feeTypeCd",t)},expression:"conditions.feeTypeCd"}},e._l(e.feeTypes,(function(e){return t("el-option",{key:e.feeTypeCd,attrs:{label:e.typeName,value:e.feeTypeCd}})})),1)],1)],1),t("el-form-item",[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入费用名称"},model:{value:e.conditions.feeName,callback:function(t){e.$set(e.conditions,"feeName",t)},expression:"conditions.feeName"}})],1)],1),t("el-form-item",[t("el-form-item",[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择是否默认费用"},model:{value:e.conditions.isDefault,callback:function(t){e.$set(e.conditions,"isDefault",t)},expression:"conditions.isDefault"}},e._l(e.isDefaults,(function(e){return t("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1),t("el-form-item",[t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e._queryHousekeepingFeeConfigMethod}},[t("i",{staticClass:"el-icon-search"}),e._v("查询 ")]),t("el-button",{on:{click:e._resetHousekeepingFeeConfigMethod}},[t("i",{staticClass:"el-icon-refresh"}),e._v("重置 ")])],1)],1)],1)],1),t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("费用标准")]),t("div",{staticStyle:{float:"right"}},[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e._openAddHousekeepingFeeConfigModal}},[t("i",{staticClass:"el-icon-plus"}),e._v("添加 ")]),""!=e.configId?t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e._openListHousekeepingFeeConfigModal}},[t("i",{staticClass:"el-icon-back"}),e._v("返回 ")]):e._e()],1)]),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.housekeepingFeeConfigs,border:""}},[t("el-table-column",{attrs:{prop:"feeName",label:"费用名称",align:"center"}}),t("el-table-column",{attrs:{prop:"feeBigTypeName",label:"费用大类",align:"center"}}),t("el-table-column",{attrs:{prop:"computingFormula",label:"计算公式",align:"center"},scopedSlots:e._u([{key:"default",fn:function(i){return["1001"==i.row.computingFormula?t("span",[e._v("面积*单价")]):"2002"==i.row.computingFormula?t("span",[e._v("固定费用")]):"3003"==i.row.computingFormula?t("span",[e._v("费用面议")]):e._e()]}}])}),t("el-table-column",{attrs:{prop:"feePrice",label:"单价",align:"center"}}),t("el-table-column",{attrs:{prop:"startTime",label:"开始时间",align:"center"}}),t("el-table-column",{attrs:{prop:"endTime",label:"结束时间",align:"center"}}),t("el-table-column",{attrs:{prop:"isDefault",label:"默认费用",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s("F"==t.row.isDefault?"是":"否")+" ")]}}])}),t("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e._openEditHousekeepingFeeConfigModel(i.row)}}},[e._v(" 修改 ")]),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e._openDeleteHousekeepingFeeConfigModel(i.row)}}},[e._v(" 删除 ")])]}}])})],1),t("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,50],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1),t("add-housekeeping-fee-config",{ref:"addHousekeepingFeeConfig",on:{refresh:e._listHousekeepingFeeConfigs}}),t("edit-housekeeping-fee-config",{ref:"editHousekeepingFeeConfig",on:{refresh:e._listHousekeepingFeeConfigs}}),t("delete-housekeeping-fee-config",{ref:"deleteHousekeepingFeeConfig",on:{refresh:e._listHousekeepingFeeConfigs}})],1)},s=[],a=i("b775");function l(e){return new Promise((t,i)=>{Object(a["a"])({url:"/housekeepingFeeConfig/queryHousekeepingFeeConfig",method:"get",params:e}).then(e=>{const i=e.data;t(i)}).catch(e=>{i(e)})})}function r(e){return new Promise((t,i)=>{Object(a["a"])({url:"/housekeepingFeeConfig/saveHousekeepingFeeConfig",method:"post",data:e}).then(e=>{const o=e.data;0===o.code?t(o):i(o.msg)}).catch(e=>{i(e)})})}function n(e){return new Promise((t,i)=>{Object(a["a"])({url:"/housekeepingFeeConfig/updateHousekeepingFeeConfig",method:"post",data:e}).then(e=>{const o=e.data;0===o.code?t(o):i(o.msg)}).catch(e=>{i(e)})})}function c(e){return new Promise((t,i)=>{Object(a["a"])({url:"/housekeepingFeeConfig/deleteHousekeepingFeeConfig",method:"post",data:e}).then(e=>{const o=e.data;0===o.code?t(o):i(o.msg)}).catch(e=>{i(e)})})}function f(e){return new Promise((t,i)=>{Object(a["a"])({url:"/housekeepingFeeType/queryHousekeepingFeeType",method:"get",params:e}).then(e=>{const o=e.data;0===o.code?t(o):i(o.msg)}).catch(e=>{i(e)})})}var u=i("7323"),m=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"添加费用标准",visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:"费用名称",prop:"feeName"}},[t("el-input",{attrs:{placeholder:"必填,请填写费用名称"},model:{value:e.form.feeName,callback:function(t){e.$set(e.form,"feeName",t)},expression:"form.feeName"}})],1),t("el-form-item",{attrs:{label:"费用类型",prop:"feeTypeCd"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请填写费用类型"},model:{value:e.form.feeTypeCd,callback:function(t){e.$set(e.form,"feeTypeCd",t)},expression:"form.feeTypeCd"}},e._l(e.feeTypes,(function(e){return t("el-option",{key:e.feeTypeCd,attrs:{label:e.typeName,value:e.feeTypeCd}})})),1)],1),t("el-form-item",{attrs:{label:"计算公式",prop:"computingFormula"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择计算公式"},on:{change:e.handleFormulaChange},model:{value:e.form.computingFormula,callback:function(t){e.$set(e.form,"computingFormula",t)},expression:"form.computingFormula"}},[t("el-option",{attrs:{value:"2002",label:"固定费用"}}),t("el-option",{attrs:{value:"3003",label:"费用面议"}})],1)],1),"2002"===e.form.computingFormula?t("el-form-item",{attrs:{label:"单价",prop:"feePrice"}},[t("el-input",{attrs:{placeholder:"必填,请填写单价"},model:{value:e.form.feePrice,callback:function(t){e.$set(e.form,"feePrice",t)},expression:"form.feePrice"}})],1):e._e(),t("el-form-item",{attrs:{label:"开始时间",prop:"startTime"}},[t("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:"必填,请填写开始时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.form.startTime,callback:function(t){e.$set(e.form,"startTime",t)},expression:"form.startTime"}})],1),t("el-form-item",{attrs:{label:"结束时间",prop:"endTime"}},[t("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:"必填,请填写结束时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.form.endTime,callback:function(t){e.$set(e.form,"endTime",t)},expression:"form.endTime"}})],1),t("el-form-item",{attrs:{label:"默认费用",prop:"isDefault"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择"},model:{value:e.form.isDefault,callback:function(t){e.$set(e.form,"isDefault",t)},expression:"form.isDefault"}},[t("el-option",{attrs:{value:"F",label:"是"}}),t("el-option",{attrs:{value:"T",label:"否"}})],1)],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("保 存")])],1)],1)},p=[],d={name:"AddHousekeepingFeeConfig",data(){return{feeTypes:[],dialogVisible:!1,form:{feeName:"",feeTypeCd:"",computingFormula:"",feePrice:"",startTime:"",endTime:"",isDefault:"",shopId:""},rules:{feeName:[{required:!0,message:"费用名称不能为空",trigger:"blur"},{max:128,message:"费用名称太长",trigger:"blur"}],feeTypeCd:[{required:!0,message:"费用类型不能为空",trigger:"change"}],computingFormula:[{required:!0,message:"计算公式不能为空",trigger:"change"}],feePrice:[{required:!0,message:"单价不能为空",trigger:"blur"}],startTime:[{required:!0,message:"开始时间不能为空",trigger:"change"}],endTime:[{required:!0,message:"结束时间不能为空",trigger:"change"}],isDefault:[{required:!0,message:"是否默认费用不能为空",trigger:"change"}]}}},methods:{open(){this.dialogVisible=!0,this.form.shopId=Object(u["f"])(),this._listHousekeepingFeeTypes()},handleClose(){this.$refs.form.resetFields()},handleFormulaChange(e){"2002"!==e&&(this.form.feePrice="0")},async _listHousekeepingFeeTypes(){try{const e={page:1,row:50,shopId:Object(u["f"])()},t=await f(e);this.feeTypes=t.data}catch(e){console.error("获取费用类型失败:",e)}},handleSubmit(){this.$refs.form.validate(async e=>{if(e)if("2002"!==this.form.computingFormula||this.form.feePrice)try{await r(this.form),this.$message.success("添加成功"),this.dialogVisible=!1,this.$emit("refresh")}catch(t){this.$message.error(t),console.error("添加失败:",t)}else this.$message.warning("请填写单价")})}}},g=d,h=i("2877"),b=Object(h["a"])(g,m,p,!1,null,null,null),y=b.exports,k=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"修改费用标准",visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:"费用名称",prop:"feeName"}},[t("el-input",{attrs:{placeholder:"必填,请填写费用名称"},model:{value:e.form.feeName,callback:function(t){e.$set(e.form,"feeName",t)},expression:"form.feeName"}})],1),t("el-form-item",{attrs:{label:"费用类型",prop:"feeTypeCd"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请填写费用类型"},model:{value:e.form.feeTypeCd,callback:function(t){e.$set(e.form,"feeTypeCd",t)},expression:"form.feeTypeCd"}},e._l(e.feeTypes,(function(e){return t("el-option",{key:e.feeTypeCd,attrs:{label:e.typeName,value:e.feeTypeCd}})})),1)],1),t("el-form-item",{attrs:{label:"计算公式",prop:"computingFormula"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择计算公式"},on:{change:e.handleFormulaChange},model:{value:e.form.computingFormula,callback:function(t){e.$set(e.form,"computingFormula",t)},expression:"form.computingFormula"}},[t("el-option",{attrs:{value:"2002",label:"固定费用"}}),t("el-option",{attrs:{value:"3003",label:"费用面议"}})],1)],1),"2002"===e.form.computingFormula?t("el-form-item",{attrs:{label:"单价",prop:"feePrice"}},[t("el-input",{attrs:{placeholder:"必填,请填写单价"},model:{value:e.form.feePrice,callback:function(t){e.$set(e.form,"feePrice",t)},expression:"form.feePrice"}})],1):e._e(),t("el-form-item",{attrs:{label:"开始时间",prop:"startTime"}},[t("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:"必填,请填写开始时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.form.startTime,callback:function(t){e.$set(e.form,"startTime",t)},expression:"form.startTime"}})],1),t("el-form-item",{attrs:{label:"结束时间",prop:"endTime"}},[t("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:"必填,请填写结束时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.form.endTime,callback:function(t){e.$set(e.form,"endTime",t)},expression:"form.endTime"}})],1),t("el-form-item",{attrs:{label:"默认费用",prop:"isDefault"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择"},model:{value:e.form.isDefault,callback:function(t){e.$set(e.form,"isDefault",t)},expression:"form.isDefault"}},[t("el-option",{attrs:{value:"F",label:"是"}}),t("el-option",{attrs:{value:"T",label:"否"}})],1)],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("保 存")])],1)],1)},C=[],F={name:"EditHousekeepingFeeConfig",data(){return{feeTypes:[],dialogVisible:!1,form:{configId:"",feeName:"",feeTypeCd:"",computingFormula:"",feePrice:"",startTime:"",endTime:"",isDefault:"",shopId:""},rules:{feeName:[{required:!0,message:"费用名称不能为空",trigger:"blur"},{max:128,message:"费用名称太长",trigger:"blur"}],feeTypeCd:[{required:!0,message:"费用类型不能为空",trigger:"change"}],computingFormula:[{required:!0,message:"计算公式不能为空",trigger:"change"}],feePrice:[{required:!0,message:"单价不能为空",trigger:"blur"}],startTime:[{required:!0,message:"开始时间不能为空",trigger:"change"}],endTime:[{required:!0,message:"结束时间不能为空",trigger:"change"}],isDefault:[{required:!0,message:"是否默认费用不能为空",trigger:"change"}],configId:[{required:!0,message:"标准ID不能为空",trigger:"blur"}]}}},methods:{open(e){this.form={...e,shopId:Object(u["f"])()},this.dialogVisible=!0,this._listHousekeepingFeeTypes()},handleClose(){this.$refs.form.resetFields()},handleFormulaChange(e){"2002"!==e&&(this.form.feePrice="0")},async _listHousekeepingFeeTypes(){try{const e={page:1,row:50,shopId:Object(u["f"])()},t=await f(e);this.feeTypes=t.data}catch(e){console.error("获取费用类型失败:",e)}},handleSubmit(){this.$refs.form.validate(async e=>{if(e)if("2002"!==this.form.computingFormula||this.form.feePrice)try{await n(this.form),this.$message.success("修改成功"),this.dialogVisible=!1,this.$emit("refresh")}catch(t){this.$message.error(t),console.error("修改失败:",t)}else this.$message.warning("请填写单价")})}}},v=F,T=Object(h["a"])(v,k,C,!1,null,null,null),_=T.exports,w=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"删除确认",visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("div",{staticStyle:{"text-align":"center","margin-bottom":"20px"}},[t("p",[e._v("确定删除费用标准?")])]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("点错了")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleConfirm}},[e._v("确认删除")])],1)])},H=[],$={name:"DeleteHousekeepingFeeConfig",data(){return{dialogVisible:!1,currentRow:null}},methods:{open(e){this.currentRow=e,this.dialogVisible=!0},handleClose(){this.currentRow=null},async handleConfirm(){try{const e={...this.currentRow,shopId:Object(u["f"])()};await c(e),this.$message.success("删除成功"),this.dialogVisible=!1,this.$emit("refresh")}catch(e){this.$message.error(e),console.error("删除失败:",e)}}}},x=$,D=Object(h["a"])(x,w,H,!1,null,null,null),S=D.exports,P={name:"HousekeepingFeeConfigManage",components:{AddHousekeepingFeeConfig:y,EditHousekeepingFeeConfig:_,DeleteHousekeepingFeeConfig:S},data(){return{housekeepingFeeConfigs:[],feeTypes:[],isDefaults:[],conditions:{feeName:"",isDefault:"",feeTypeCd:"",startTime:"",endTime:"",shopId:""},configId:"",currentPage:1,pageSize:10,total:0}},created(){this.configId=this.$route.query.configId||"",this.conditions.configId=this.configId,console.log(this.conditions.configId),this._listHousekeepingFeeConfigs(),this._listHousekeepingFeeTypes(),this._getDictData()},methods:{async _listHousekeepingFeeConfigs(){try{const e={...this.conditions,page:this.currentPage,row:this.pageSize},t=await l(e);this.housekeepingFeeConfigs=t.data,this.total=t.total}catch(e){console.error("获取费用标准列表失败:",e)}},async _listHousekeepingFeeTypes(){try{const e={page:1,row:50,shopId:this.conditions.shopId},t=await f(e);this.feeTypes=t.data}catch(e){console.error("获取费用类型失败:",e)}},async _getDictData(){try{const{data:e}=await Object(u["e"])("housekeeping_fee_config","is_default");this.isDefaults=e}catch(e){console.error("获取字典数据失败:",e)}},_queryHousekeepingFeeConfigMethod(){this.currentPage=1,this._listHousekeepingFeeConfigs()},_resetHousekeepingFeeConfigMethod(){this.conditions={feeName:"",isDefault:"",feeTypeCd:"",startTime:"",endTime:"",shopId:this.conditions.shopId},this._listHousekeepingFeeConfigs()},_openAddHousekeepingFeeConfigModal(){this.$refs.addHousekeepingFeeConfig.open()},_openEditHousekeepingFeeConfigModel(e){this.$refs.editHousekeepingFeeConfig.open(e)},_openDeleteHousekeepingFeeConfigModel(e){this.$refs.deleteHousekeepingFeeConfig.open(e)},_openListHousekeepingFeeConfigModal(){this.$router.push("/pages/housekeeping/housekeepingResourceManage")},handleSizeChange(e){this.pageSize=e,this._listHousekeepingFeeConfigs()},handleCurrentChange(e){this.currentPage=e,this._listHousekeepingFeeConfigs()}}},I=P,M=(i("751e"),Object(h["a"])(I,o,s,!1,null,"5fe15fd4",null));t["default"]=M.exports},"751e":function(e,t,i){"use strict";i("c21f")},c21f:function(e,t,i){}}]);
|
|
//# sourceMappingURL=chunk-4245aec9.78c0fa55.js.map
|