|
|
@@ -1,27 +1,21 @@
|
|
|
<template>
|
|
|
<el-row class="el-row-container" v-loading="loading">
|
|
|
- <el-col
|
|
|
- :span="24"
|
|
|
- style="padding: 16px; height: 100%"
|
|
|
- >
|
|
|
+ <el-col :span="24" style="padding: 16px; height: 100%">
|
|
|
<el-card style="height: 100%; overflow-y: auto">
|
|
|
<el-col :span="24" class="elrow-main__col-top">
|
|
|
- <div>
|
|
|
- <el-select
|
|
|
- placeholder="行政区域(全国)"
|
|
|
- >
|
|
|
+ <div style="display:flex">
|
|
|
+ <select-tree
|
|
|
+ :placeholder="'行政区域(全国)'"
|
|
|
+ style="width:50%"
|
|
|
+ :treeData="treeData"
|
|
|
+ @handlerClick="handlerClick"
|
|
|
+ :checkVal="cusareaName"
|
|
|
+ ></select-tree>
|
|
|
+ <el-select style="margin:0 20px;width: 50%" placeholder="全部" v-model="priceConfigVal" @change="handleChange">
|
|
|
+ <el-option v-for="(item, index) in priceConfigList" :key="index" :label="item.label" :value="item.value">
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
- <el-select
|
|
|
- style="margin:0 20px"
|
|
|
- placeholder="全部"
|
|
|
- >
|
|
|
- </el-select>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- @click="handleSearch"
|
|
|
- >查询</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" size="small" @click="handleSearch">查询</el-button>
|
|
|
</div>
|
|
|
<!-- <div class="top-left">
|
|
|
<el-button
|
|
|
@@ -33,133 +27,212 @@
|
|
|
></div> -->
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="elrow-main__col-bottom">
|
|
|
- <img v-if="imgUrl" :src="imgUrl" />
|
|
|
- <b-table
|
|
|
- ref="tableRef"
|
|
|
+ <b-table ref="tableRef"
|
|
|
+ border
|
|
|
:args="{ 'highlight-current-row': true }"
|
|
|
- :data="loadData"
|
|
|
+ :data="loadData"
|
|
|
:columns="columns"
|
|
|
- isShowIndex
|
|
|
- :showPagination="loadData.length"
|
|
|
- >
|
|
|
- <template #styleImg="scope">
|
|
|
- <el-image
|
|
|
- :src="scope.row.imgPreview"
|
|
|
- :preview-src-list="[scope.row.imgPreview]"
|
|
|
- slot="error"
|
|
|
- class="image-slot"
|
|
|
- style="width: 100px; height: 50px"
|
|
|
- >
|
|
|
- <div slot="error" class="image-slot"></div>
|
|
|
- </el-image>
|
|
|
+ isShowIndex>
|
|
|
+ <template #priceconfigWaterchargingtype="scope">
|
|
|
+ {{ scope.row.priceconfigWaterchargingtype == 1 ? '是': '否'}}
|
|
|
</template>
|
|
|
- <template #codeNo="scope">
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- :underline="false"
|
|
|
- @click="goDetail(scope.row)"
|
|
|
- >{{ scope.row.traceCodeApplyConcat }}</el-link
|
|
|
- >
|
|
|
+ <template #waterPriceName="scope">
|
|
|
+ <span v-if="scope.row.priceconfigWaterchargingtype == 1">
|
|
|
+ <div v-for="(item, index) in scope.row.waterPriceSteps" :key="index" class="pricestepNum">
|
|
|
+ {{
|
|
|
+ item.pricestepNum == '0' ? '第1阶梯' : item.pricestepNum == '1' ? '第2阶梯' : '第3阶梯'
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <div class="pricestepNum">
|
|
|
+ 恒定水价
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
</template>
|
|
|
- <template #useNumber="scope">
|
|
|
- {{ scope.row.useNumber + '/' + scope.row.totalNumber }}
|
|
|
+ <template #priceYield="scope">
|
|
|
+ <span v-if="scope.row.priceconfigWaterchargingtype == 1">
|
|
|
+ <div v-for="(item, index) in scope.row.waterPriceSteps" :key="index" class="pricestepNum">
|
|
|
+ {{ item.pricestepUsagemin + ' - ' + item.pricestepUsagemax }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <div class="pricestepNum">
|
|
|
+ -
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
</template>
|
|
|
- <template #finishGoodName="scope">
|
|
|
- {{ scope.row.finishGoodName&&scope.row.finishgoodNo?scope.row.finishGoodName + '-' + scope.row.finishgoodNo:'' }}
|
|
|
+ <template #averageWaterPrice="scope">
|
|
|
+ <span v-if="scope.row.priceconfigWaterchargingtype == 1">
|
|
|
+ <div v-for="(item, index) in scope.row.waterPriceSteps" :key="index" class="pricestepNum">
|
|
|
+ {{ item.pricestepUnitprice }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <div class="pricestepNum">
|
|
|
+ {{ scope.row.priceconfigWaterunitprice }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template #stepPriceOrNot="scope">
|
|
|
+ {{ scope.row.priceconfigElectricitychargingtype == 1 ? '是' : '否' }}
|
|
|
+ </template>
|
|
|
+ <template #elecPriceName="scope">
|
|
|
+ <span v-if="scope.row.priceconfigElectricitychargingtype == 1">
|
|
|
+ <div v-for="(item, index) in scope.row.elecPriceSteps" :key="index" class="pricestepNum">
|
|
|
+ {{
|
|
|
+ item.pricestepNum == '0' ? '第1阶梯' : item.pricestepNum == '1' ? '第2阶梯': '第3阶梯'
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <div class="pricestepNum">
|
|
|
+ 恒定电价
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template #elecPriceSteps="scope">
|
|
|
+ <span v-if="scope.row.priceconfigElectricitychargingtype == 1">
|
|
|
+ <div v-for="(item, index) in scope.row.elecPriceSteps" :key="index" class="pricestepNum">
|
|
|
+ {{ item.pricestepUsagemin + ' - ' + item.pricestepUsagemax }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <div class="pricestepNum">
|
|
|
+ -
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template #averageElecPriceSteps="scope">
|
|
|
+ <span v-if="scope.row.priceconfigElectricitychargingtype == 1">
|
|
|
+ <div v-for="(item, index) in scope.row.elecPriceSteps" :key="index" class="pricestepNum">
|
|
|
+ {{ item.pricestepUnitprice }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <div class="pricestepNum">
|
|
|
+ {{ scope.row.priceconfigElectricityunitprice }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
</template>
|
|
|
-
|
|
|
<template #operate="scope">
|
|
|
- <el-link
|
|
|
- size="small"
|
|
|
- :underline="false"
|
|
|
- type="primary"
|
|
|
- style="margin-right: 10px"
|
|
|
- @click="editAssociation(scope.row)"
|
|
|
- >修改</el-link
|
|
|
- >
|
|
|
- <el-link
|
|
|
- size="small"
|
|
|
- :underline="false"
|
|
|
- type="danger"
|
|
|
- style="margin-right: 10px"
|
|
|
- @click="download(scope.row)"
|
|
|
- >删除</el-link
|
|
|
- >
|
|
|
+ <el-link size="small" :underline="false" type="primary" style="margin-right: 10px"
|
|
|
+ @click="editAssociation(scope.row)">修改</el-link>
|
|
|
+ <el-link size="small" :underline="false" type="danger" style="margin-right: 10px"
|
|
|
+ @click="deleteHandler(scope.row)">删除</el-link>
|
|
|
</template>
|
|
|
</b-table>
|
|
|
</el-col>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
- <set-annual-water-right :visible.sync="associationManageShow"/>
|
|
|
+ <set-annual-water-right
|
|
|
+ :visible.sync="associationManageShow"
|
|
|
+ :editRow="editRow"
|
|
|
+ @clearEdit="handlerClearEdit"
|
|
|
+ />
|
|
|
</el-row>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { Message } from 'element-ui';
|
|
|
+import SelectTree from '@/components/SelectTree';
|
|
|
import BTable from '@/components/Table/index.vue';
|
|
|
-import { assign, omit } from 'lodash-es';
|
|
|
+import { Waterchargingtype, Electricitychargingtype } from './status'
|
|
|
import setAnnualWaterRight from './components/setAnnualWaterRight.vue'
|
|
|
+import { getPriceList, deletePrice } from '@/api/price/index.js'
|
|
|
+import { getTree } from '@/api/tree.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'waterElectricityPriceSetting',
|
|
|
- components: { BTable,setAnnualWaterRight },
|
|
|
+ components: { BTable, setAnnualWaterRight, SelectTree },
|
|
|
data() {
|
|
|
return {
|
|
|
- dateValue:"",
|
|
|
- imgUrl: '',
|
|
|
- baseImageUrl: process.env.VUE_APP_BASE_RESOURCE_PREFIX,
|
|
|
form: {
|
|
|
productName: ''
|
|
|
},
|
|
|
+ areaId: '',
|
|
|
loading: false,
|
|
|
associationManageShow: false,
|
|
|
+ priceConfigVal: '',
|
|
|
+ priceconfigWaterchargingtype: '',
|
|
|
+ priceconfigElectricitychargingtype: '',
|
|
|
+ editRow: {
|
|
|
+ cusareaName: ''
|
|
|
+ },
|
|
|
+ treeData: [],
|
|
|
+ cusareaName: '',
|
|
|
+ priceConfigList: [
|
|
|
+ {
|
|
|
+ value: '',
|
|
|
+ label: '全部',
|
|
|
+ type: 'all'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '0',
|
|
|
+ label: '恒定水价',
|
|
|
+ type: Waterchargingtype
|
|
|
+ }, {
|
|
|
+ value: '1',
|
|
|
+ label: '阶梯水价',
|
|
|
+ type: Waterchargingtype
|
|
|
+ }, {
|
|
|
+ value: '2',
|
|
|
+ label: '恒定电价',
|
|
|
+ type: Electricitychargingtype
|
|
|
+ }, {
|
|
|
+ value: '3',
|
|
|
+ label: '阶梯电价',
|
|
|
+ type: Electricitychargingtype
|
|
|
+ },
|
|
|
+ ],
|
|
|
columns: [
|
|
|
{
|
|
|
label: '行政区',
|
|
|
- prop: 'person',
|
|
|
+ prop: 'cusareaName',
|
|
|
customRender: '',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
label: '是否阶梯水价',
|
|
|
- prop: 'area',
|
|
|
- customRender: '',
|
|
|
+ prop: 'priceconfigWaterchargingtype',
|
|
|
+ customRender: 'priceconfigWaterchargingtype',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
label: '水价名称',
|
|
|
- prop: 'name',
|
|
|
- customRender: '',
|
|
|
+ prop: 'waterPriceSteps',
|
|
|
+ customRender: 'waterPriceName',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
label: '水量(吨)',
|
|
|
- prop: 'phone',
|
|
|
- customRender: '',
|
|
|
+ prop: 'waterPriceSteps',
|
|
|
+ customRender: 'priceYield',
|
|
|
align: 'center'
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: '水价(元/吨)',
|
|
|
- prop: 'phone',
|
|
|
- customRender: '',
|
|
|
+ prop: 'waterPriceSteps',
|
|
|
+ customRender: 'averageWaterPrice',
|
|
|
align: 'center'
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: '是否阶梯电价',
|
|
|
- prop: 'phone',
|
|
|
- customRender: '',
|
|
|
+ prop: 'priceconfigElectricitychargingtype',
|
|
|
+ customRender: 'stepPriceOrNot',
|
|
|
align: 'center'
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: '电价名称',
|
|
|
- prop: 'phone',
|
|
|
- customRender: '',
|
|
|
+ prop: 'elecPriceSteps',
|
|
|
+ customRender: 'elecPriceName',
|
|
|
align: 'center'
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: '电量(度)',
|
|
|
- prop: 'phone',
|
|
|
- customRender: '',
|
|
|
+ prop: 'elecPriceSteps',
|
|
|
+ customRender: 'elecPriceSteps',
|
|
|
align: 'center'
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: '电价(元/度)',
|
|
|
- prop: 'phone',
|
|
|
- customRender: '',
|
|
|
+ prop: 'elecPriceSteps',
|
|
|
+ customRender: 'averageElecPriceSteps',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
@@ -170,44 +243,67 @@ export default {
|
|
|
]
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ mounted() {
|
|
|
+ this.getWaterrightList()
|
|
|
+ },
|
|
|
methods: {
|
|
|
- editAssociation() {
|
|
|
+ editAssociation(row) {
|
|
|
+ this.editRow = row
|
|
|
this.associationManageShow = true
|
|
|
},
|
|
|
- loadData(parameter) {
|
|
|
- const queryform = this.form;
|
|
|
- const payload = omit(assign({}, parameter, queryform, {orderByColumn:'tarcecodeapplyCreateddate',isAsc:'desc'}), []);
|
|
|
- return this.getTableData(payload);
|
|
|
+ async getWaterrightList() {
|
|
|
+ if (!this.areaId) {
|
|
|
+ const res = await getTree()
|
|
|
+ this.treeData = res?.data
|
|
|
+ this.treeData.unshift({
|
|
|
+ cusareaId: '',
|
|
|
+ cusareaName: '行政区域(全国)'
|
|
|
+ })
|
|
|
+ this.areaId = this.treeData[0].cusareaId
|
|
|
+ }
|
|
|
},
|
|
|
- getTableData(payload) {
|
|
|
- return Promise.resolve({
|
|
|
- data: [{
|
|
|
- person:"王大虎",
|
|
|
- area: '2016-05-02',
|
|
|
- name: '王小虎',
|
|
|
- phone: 1588888888,
|
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
|
|
- }, {
|
|
|
- person:"王大虎",
|
|
|
- area: '2016-05-04',
|
|
|
- name: '王小虎',
|
|
|
- phone: 1588888888,
|
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
|
|
- }, {
|
|
|
- person:"王大虎",
|
|
|
- area: '2016-05-01',
|
|
|
- name: '王小虎',
|
|
|
- phone: 1588888888,
|
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
|
|
- }, {
|
|
|
- person:"王大虎",
|
|
|
- area: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- phone: 1588888888,
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }]
|
|
|
- })
|
|
|
+ handlerClick(value) {
|
|
|
+ this.areaId = value?.cusareaId
|
|
|
+ },
|
|
|
+ handlerClearEdit() {
|
|
|
+ this.editRow = {
|
|
|
+ cusareaName: ''
|
|
|
+ }
|
|
|
+ this.handleSearch()
|
|
|
+ },
|
|
|
+ handleChange(value) {
|
|
|
+ switch (value) {
|
|
|
+ case '0':
|
|
|
+ this.priceconfigWaterchargingtype = 0
|
|
|
+ this.priceconfigElectricitychargingtype = ''
|
|
|
+ break
|
|
|
+ case '1':
|
|
|
+ this.priceconfigWaterchargingtype = 1
|
|
|
+ this.priceconfigElectricitychargingtype = ''
|
|
|
+ break
|
|
|
+ case '2':
|
|
|
+ this.priceconfigWaterchargingtype = ''
|
|
|
+ this.priceconfigElectricitychargingtype = 0
|
|
|
+ break
|
|
|
+ case '3':
|
|
|
+ this.priceconfigWaterchargingtype = ''
|
|
|
+ this.priceconfigElectricitychargingtype = 1
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ this.priceconfigWaterchargingtype = ''
|
|
|
+ this.priceconfigElectricitychargingtype = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ loadData() {
|
|
|
+ return this.getTableData();
|
|
|
+ },
|
|
|
+ getTableData() {
|
|
|
+ const params = {
|
|
|
+ areaId: this.areaId,
|
|
|
+ priceconfigWaterchargingtype: this.priceconfigWaterchargingtype,
|
|
|
+ priceconfigElectricitychargingtype: this.priceconfigElectricitychargingtype
|
|
|
+ }
|
|
|
+ return getPriceList(params)
|
|
|
},
|
|
|
handleSearch() {
|
|
|
this.$refs.tableRef.refresh(true);
|
|
|
@@ -215,15 +311,35 @@ export default {
|
|
|
goDetail(row) {
|
|
|
this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
|
|
|
},
|
|
|
- download(row) {
|
|
|
+ deleteHandler(row) {
|
|
|
+ const { priceconfigId } = row
|
|
|
+ this.$modal
|
|
|
+ .confirm(`是否确认删除`)
|
|
|
+ .then(() => {
|
|
|
+ deletePrice({
|
|
|
+ priceconfigIds: priceconfigId
|
|
|
+ }).then(() => {
|
|
|
+ Message({ message: "删除成功", type: 'success' });
|
|
|
+ this.handleSearch()
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.el-row-container{
|
|
|
- height: 100%;
|
|
|
+.pricestepNum{
|
|
|
+ border-bottom: 1px solid #EBEEF5;
|
|
|
+}
|
|
|
+::v-deep .el-table__row{
|
|
|
+ .el-table__cell{
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ .cell{
|
|
|
+ padding: 0;
|
|
|
+ line-height:44px;
|
|
|
+ }
|
|
|
}
|
|
|
.elrow-main__col-top {
|
|
|
display: flex;
|