|
@@ -1,80 +1,45 @@
|
|
|
<template>
|
|
|
- <div class="main">
|
|
|
- <div class="search">
|
|
|
- <el-input
|
|
|
- placeholder="输入费用名称"
|
|
|
- class="search-input"
|
|
|
- clearable
|
|
|
- v-model="mixins_query.chargeName"
|
|
|
- ></el-input>
|
|
|
- <el-select
|
|
|
- v-model="mixins_query.communityId"
|
|
|
- placeholder="所属社区"
|
|
|
- clearable
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in communityArr"
|
|
|
- :key="index"
|
|
|
- :label="item.communityName"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- <el-select
|
|
|
- v-model="mixins_query.chargeType"
|
|
|
- placeholder="费用类型"
|
|
|
- clearable
|
|
|
- >
|
|
|
- <el-option
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- v-for="(item, index) in $publicArray.chargeType()"
|
|
|
- :key="index"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="search-btn"
|
|
|
- @click="mixins_search"
|
|
|
- icon="el-icon-search"
|
|
|
- >查询 </el-button>
|
|
|
- <div class="search-icon">
|
|
|
- <el-tooltip
|
|
|
- class="item"
|
|
|
- effect="light"
|
|
|
- placement="bottom"
|
|
|
- content="新增"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="zoniot_font zoniot-icon-tianjia2"
|
|
|
- @click="addOrEdit('add')"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="roles-wrap">
|
|
|
- <zz-table
|
|
|
- :cols="cols"
|
|
|
- :settings="{ showIndex: true, stripe: true }"
|
|
|
- :loading="mixins_onQuery"
|
|
|
- :data="mixins_list"
|
|
|
- :pageset="mixins_pageset"
|
|
|
- @page-change="pageChange"
|
|
|
- >
|
|
|
- <template
|
|
|
- slot-scope="scope"
|
|
|
- slot="chargeMode"
|
|
|
- >
|
|
|
- <span v-if="scope.row.chargeMode === 1">固定收费 </span>
|
|
|
- <span v-if="scope.row.chargeMode === 2">价格*面积收费</span>
|
|
|
- <span v-if="scope.row.chargeMode === 3">阶梯计费 </span>
|
|
|
- <span v-if="scope.row.chargeMode === 4">单价*用量</span>
|
|
|
- </template>
|
|
|
- <template
|
|
|
- slot-scope="scope"
|
|
|
- slot="chargePrice"
|
|
|
- >
|
|
|
- <div v-if="!!scope.row.chargePrice">{{ scope.row.chargePrice }}</div>
|
|
|
- <!-- <template v-else>
|
|
|
+ <div class="main">
|
|
|
+ <div class="search">
|
|
|
+ <el-input placeholder="输入费用名称" class="search-input" clearable v-model="mixins_query.chargeName"></el-input>
|
|
|
+ <el-select v-model="mixins_query.communityId" placeholder="所属社区" clearable>
|
|
|
+ <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="mixins_query.chargeType" placeholder="费用类型" clearable>
|
|
|
+ <el-option
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ v-for="(item, index) in $publicArray.chargeType()"
|
|
|
+ :key="index"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
|
|
|
+ <div class="search-icon">
|
|
|
+ <el-tooltip class="item" effect="light" placement="bottom" content="新增">
|
|
|
+ <i class="zoniot_font zoniot-icon-tianjia2" @click="addOrEdit('add')"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="roles-wrap">
|
|
|
+ <zz-table
|
|
|
+ :cols="cols"
|
|
|
+ :settings="{ showIndex: true, stripe: true }"
|
|
|
+ :loading="mixins_onQuery"
|
|
|
+ :data="mixins_list"
|
|
|
+ :pageset="mixins_pageset"
|
|
|
+ @page-change="pageChange"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope" slot="chargeMode">
|
|
|
+ <span v-if="scope.row.chargeMode === 1">固定收费 </span>
|
|
|
+ <span v-if="scope.row.chargeMode === 2">价格*面积收费</span>
|
|
|
+ <span v-if="scope.row.chargeMode === 3">阶梯计费 </span>
|
|
|
+ <span v-if="scope.row.chargeMode === 4">
|
|
|
+ {{ scope.row.chargeType != 11 ? '单价*用量' : '数量/面积收费' }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="chargePrice">
|
|
|
+ <div v-if="!!scope.row.chargePrice">{{ scope.row.chargePrice }}</div>
|
|
|
+ <!-- <template v-else>
|
|
|
<div v-for="(item, index) in JSON.parse(scope.row.chargePriceLadder)" :key="index">
|
|
|
<div>
|
|
|
<span v-if="item.ladder === 1">一 阶价格:{{ item.price }}</span>
|
|
@@ -86,203 +51,182 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template> -->
|
|
|
- </template>
|
|
|
+ </template>
|
|
|
|
|
|
- <template
|
|
|
- slot-scope="scope"
|
|
|
- slot="opt"
|
|
|
- >
|
|
|
- <div class="opt">
|
|
|
- <el-tooltip
|
|
|
- class="item"
|
|
|
- effect="light"
|
|
|
- placement="bottom"
|
|
|
- :content="scope.row.chargeStatus === 1 ? '禁用' : '启用'"
|
|
|
- >
|
|
|
- <i
|
|
|
- v-if="scope.row.chargeStatus === 1"
|
|
|
- class="zoniot_font zoniot-icon-qiyong1"
|
|
|
- @click="enabledStatus(scope.row)"
|
|
|
- ></i>
|
|
|
- <i
|
|
|
- v-else
|
|
|
- class="zoniot_font zoniot-icon-jinyong1"
|
|
|
- @click="enabledStatus(scope.row)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- effect="light"
|
|
|
- placement="bottom"
|
|
|
- content="编辑"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="zoniot_font zoniot-icon-bianji"
|
|
|
- @click="addOrEdit('edit', scope.row)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- effect="light"
|
|
|
- placement="bottom"
|
|
|
- content="删除"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="zoniot_font zoniot-icon-shanchu redText"
|
|
|
- @click="deluserbyidFn(scope.row.id)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </zz-table>
|
|
|
+ <template slot-scope="scope" slot="opt">
|
|
|
+ <div class="opt">
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="light"
|
|
|
+ placement="bottom"
|
|
|
+ :content="scope.row.chargeStatus === 1 ? '禁用' : '启用'"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ v-if="scope.row.chargeStatus === 1"
|
|
|
+ class="zoniot_font zoniot-icon-qiyong1"
|
|
|
+ @click="enabledStatus(scope.row)"
|
|
|
+ ></i>
|
|
|
+ <i v-else class="zoniot_font zoniot-icon-jinyong1" @click="enabledStatus(scope.row)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="light" placement="bottom" content="编辑">
|
|
|
+ <i class="zoniot_font zoniot-icon-bianji" @click="addOrEdit('edit', scope.row)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="light" placement="bottom" content="删除">
|
|
|
+ <i class="zoniot_font zoniot-icon-shanchu redText" @click="deluserbyidFn(scope.row.id)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </zz-table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import list from '@utils/list.js';
|
|
|
const sunm = ['一', '二', '三', '四', '五'];
|
|
|
export default {
|
|
|
- mixins: [list],
|
|
|
- name: 'billingRules',
|
|
|
- data () {
|
|
|
- var _this = this;
|
|
|
- return {
|
|
|
- cols: [
|
|
|
- {
|
|
|
- label: '社区名称',
|
|
|
- prop: 'communityName'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '费用名称',
|
|
|
- prop: 'chargeName'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '费用类型',
|
|
|
- prop: 'chargeType',
|
|
|
- format (val) {
|
|
|
- return _this.$publicArray.chargeTypeName(val);
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '计费方式',
|
|
|
- prop: 'chargeMode',
|
|
|
- slot: 'chargeMode'
|
|
|
+ mixins: [list],
|
|
|
+ name: 'billingRules',
|
|
|
+ data() {
|
|
|
+ var _this = this;
|
|
|
+ return {
|
|
|
+ cols: [
|
|
|
+ {
|
|
|
+ label: '社区名称',
|
|
|
+ prop: 'communityName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '费用名称',
|
|
|
+ prop: 'chargeName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '费用类型',
|
|
|
+ prop: 'chargeType',
|
|
|
+ format(val) {
|
|
|
+ return _this.$publicArray.chargeTypeName(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '计费方式',
|
|
|
+ prop: 'chargeMode',
|
|
|
+ slot: 'chargeMode'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '价格(元)',
|
|
|
+ prop: 'chargePrice',
|
|
|
+ slot: 'chargePrice'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '计费周期',
|
|
|
+ prop: 'chargeCycle',
|
|
|
+ format(val) {
|
|
|
+ if (val) {
|
|
|
+ return val + '个月';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'chargeStatus',
|
|
|
+ format(val) {
|
|
|
+ if (val == '1') {
|
|
|
+ return '启用';
|
|
|
+ } else if (val == '2') {
|
|
|
+ return '禁用';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '操作',
|
|
|
+ width: '120',
|
|
|
+ slot: 'opt'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ productOptions: [],
|
|
|
+ communityArr: [],
|
|
|
+ mixins_post: 'get'
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getorgTree();
|
|
|
+ this.mixins_dataUrl = '/sc-charge/scChargeStrategy/page';
|
|
|
+ this.mixins_query = {};
|
|
|
+ this.mixins_search();
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getProductOptions();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getorgTree() {
|
|
|
+ this.$http
|
|
|
+ .get('/sc-community/assets/community/list')
|
|
|
+ .then((data) => {
|
|
|
+ this.communityArr = data.data;
|
|
|
+ this.$store.commit('setAreaSelect', data.data);
|
|
|
+ })
|
|
|
+
|
|
|
+ .catch(function () {});
|
|
|
},
|
|
|
- {
|
|
|
- label: '价格(元)',
|
|
|
- prop: 'chargePrice',
|
|
|
- slot: 'chargePrice'
|
|
|
+ deluserbyidFn(id) {
|
|
|
+ const h = this.$createElement;
|
|
|
+ this.$msgBox(`删除`, '删除后将无法恢复,请问是否继续?')
|
|
|
+ .then(() => {
|
|
|
+ this.$http.postForm('/sc-charge/scChargeStrategy/delete', { id: id }).then(({ status, data, msg }) => {
|
|
|
+ if (0 === status) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ });
|
|
|
+ this.mixins_search();
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
- {
|
|
|
- label: '计费周期',
|
|
|
- prop: 'chargeCycle',
|
|
|
- format (val) {
|
|
|
- if (val) {
|
|
|
- return val + '个月';
|
|
|
+ enabledStatus(rowinfo) {
|
|
|
+ let status = 1;
|
|
|
+ if (rowinfo.chargeStatus === 1) {
|
|
|
+ status = 2;
|
|
|
}
|
|
|
- }
|
|
|
+ this.$http.postForm(`/sc-charge/scChargeStrategy/enabled`, { id: rowinfo.id, chargeStatus: status }).then(({ status, msg }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ this.$message.success(msg);
|
|
|
+ this.mixins_search();
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- {
|
|
|
- label: '状态',
|
|
|
- prop: 'chargeStatus',
|
|
|
- format (val) {
|
|
|
- if (val == '1') {
|
|
|
- return '启用';
|
|
|
- } else if (val == '2') {
|
|
|
- return '禁用';
|
|
|
- }
|
|
|
- }
|
|
|
+ addOrEdit(todo, data = {}) {
|
|
|
+ new Promise((resolve) => {
|
|
|
+ let title = '新增收费项目';
|
|
|
+ if (todo == 'add') {
|
|
|
+ } else {
|
|
|
+ title = '修改收费项目';
|
|
|
+ }
|
|
|
+ this.$store.dispatch('addPopup', {
|
|
|
+ url: '/payService/billingRules/stepPage/newAdd.vue',
|
|
|
+ width: '550px',
|
|
|
+ height: '600px',
|
|
|
+ props: {
|
|
|
+ data,
|
|
|
+ todo,
|
|
|
+ productOptions: this.productOptions,
|
|
|
+ callback: resolve
|
|
|
+ },
|
|
|
+ title: title
|
|
|
+ });
|
|
|
+ }).then(() => {
|
|
|
+ this.mixins_search();
|
|
|
+ });
|
|
|
},
|
|
|
- {
|
|
|
- label: '操作',
|
|
|
- width: '120',
|
|
|
- slot: 'opt'
|
|
|
+ getProductOptions() {
|
|
|
+ this.$http.postForm('/sc-community/devicetype/selectList', { name: '' }).then((data) => {
|
|
|
+ this.productOptions = data;
|
|
|
+ });
|
|
|
}
|
|
|
- ],
|
|
|
- productOptions: [],
|
|
|
- communityArr: [],
|
|
|
- mixins_post: 'get'
|
|
|
- };
|
|
|
- },
|
|
|
- created () {
|
|
|
- this.getorgTree();
|
|
|
- this.mixins_dataUrl = '/sc-charge/scChargeStrategy/page';
|
|
|
- this.mixins_query = {};
|
|
|
- this.mixins_search();
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- this.getProductOptions();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getorgTree () {
|
|
|
- this.$http
|
|
|
- .get('/sc-community/assets/community/list')
|
|
|
- .then((data) => {
|
|
|
- this.communityArr = data.data;
|
|
|
- this.$store.commit('setAreaSelect', data.data);
|
|
|
- })
|
|
|
-
|
|
|
- .catch(function () { });
|
|
|
- },
|
|
|
- deluserbyidFn (id) {
|
|
|
- const h = this.$createElement;
|
|
|
- this.$msgBox(`删除`, '删除后将无法恢复,请问是否继续?')
|
|
|
- .then(() => {
|
|
|
- this.$http.postForm('/sc-charge/scChargeStrategy/delete', { id: id }).then(({ status, data, msg }) => {
|
|
|
- if (0 === status) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
- this.mixins_search();
|
|
|
- } else {
|
|
|
- this.$message.error(msg);
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => { });
|
|
|
- },
|
|
|
- enabledStatus (rowinfo) {
|
|
|
- let status = 1;
|
|
|
- if (rowinfo.chargeStatus === 1) {
|
|
|
- status = 2;
|
|
|
- }
|
|
|
- this.$http.postForm(`/sc-charge/scChargeStrategy/enabled`, { id: rowinfo.id, chargeStatus: status }).then(({ status, msg }) => {
|
|
|
- if (status == 0) {
|
|
|
- this.$message.success(msg);
|
|
|
- this.mixins_search();
|
|
|
- } else {
|
|
|
- this.$message.error(msg);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- addOrEdit (todo, data = {}) {
|
|
|
- new Promise((resolve) => {
|
|
|
- let title = '新增收费项目';
|
|
|
- if (todo == 'add') {
|
|
|
- } else {
|
|
|
- title = '修改收费项目';
|
|
|
- }
|
|
|
- this.$store.dispatch('addPopup', {
|
|
|
- url: '/payService/billingRules/stepPage/newAdd.vue',
|
|
|
- width: '550px',
|
|
|
- height: '600px',
|
|
|
- props: {
|
|
|
- data,
|
|
|
- todo,
|
|
|
- productOptions: this.productOptions,
|
|
|
- callback: resolve
|
|
|
- },
|
|
|
- title: title
|
|
|
- });
|
|
|
- }).then(() => {
|
|
|
- this.mixins_search();
|
|
|
- });
|
|
|
- },
|
|
|
- getProductOptions () {
|
|
|
- this.$http.postForm('/sc-community/devicetype/selectList', { name: '' }).then((data) => {
|
|
|
- this.productOptions = data;
|
|
|
- });
|
|
|
}
|
|
|
- }
|
|
|
};
|
|
|
</script>
|