fix: 项目电价合同 功能

This commit is contained in:
nieli 2023-01-17 11:41:16 +08:00
parent 15d172fbee
commit e10cfb4fae
5 changed files with 172 additions and 24 deletions

View File

@ -14,11 +14,11 @@ port= 9988
// 陈志荣 本地 // 陈志荣 本地
//target = http://192.168.18.140:8899 //target = http://192.168.18.140:8899
// 黄明 本地 // 黄明 本地
// target = http://192.168.18.134:8899 target = http://192.168.18.134:8899
//target = http://192.168.18.139:8899 //target = http://192.168.18.139:8899
// target = http://192.168.18.136:8899 // target = http://192.168.18.136:8899
// 测试端 // 测试端
target = http://192.168.10.241:32024 // target = http://192.168.10.241:32024
// 开发端 // 开发端
// target = http://192.168.10.241:30646 // target = http://192.168.10.241:30646

View File

@ -20,7 +20,7 @@ export function getContract(contractId) {
// 新增电价合同 // 新增电价合同
export function addContract(data) { export function addContract(data) {
return request({ return request({
url: '/iot/contract/addContract', url: '/iot/contract',
method: 'post', method: 'post',
data: data data: data
}) })
@ -51,3 +51,59 @@ export function exportContract(query) {
params: query params: query
}) })
} }
//////////////////////
// 查询电价合同列表
export function listUserContract(query) {
return request({
url: '/iot/userContract/list',
method: 'get',
params: query
})
}
// 查询电价合同详细
export function getUserContract(contractId) {
return request({
url: '/iot/userContract/' + contractId,
method: 'get'
})
}
// 新增电价合同
export function addUserContract(data) {
return request({
url: '/iot/userContract',
method: 'post',
data: data
})
}
// 修改电价合同
export function updateUserContract(data) {
return request({
url: '/iot/userContract',
method: 'put',
data: data
})
}
// 删除电价合同
export function delUserContract(contractId) {
return request({
url: '/iot/userContract/' + contractId,
method: 'delete'
})
}
// 导出电价合同
export function exportUserContract(query) {
return request({
url: '/iot/userContract/export',
method: 'get',
params: query
})
}

View File

@ -201,7 +201,7 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-form-item label="电价合同:"> <el-form-item label="电价合同:">
<e-dialog-table-input <e-dialog-table-input
:table="selectPriceTable" :table="selectPriceTable"
:refurbishFun="listContract" :refurbishFun="listContract"
@ -212,7 +212,7 @@
psize="small" psize="small"
@change="handleProiceDialogEvent" @change="handleProiceDialogEvent"
/> />
</el-form-item> --> </el-form-item>
<el-form-item label="行政区划" prop="regionalismId"> <el-form-item label="行政区划" prop="regionalismId">
<!-- <el-input v-model="form.regionalismId" placeholder="请输入行政区划代码" /> --> <!-- <el-input v-model="form.regionalismId" placeholder="请输入行政区划代码" /> -->

View File

@ -90,6 +90,93 @@
<!-- ---- --> <!-- ---- -->
<div class="group-list-info" style="margin-top: 20px">
<div class="top">
<div class="top-label">
<svg-icon
icon-class="A_product1"
style="margin-right: 2px; height: 20px; width: 20px"
/>
<span
v-if="updateState === false"
style="margin: 0px 15px 0 10px; font-weight: 200; font-size: 14px"
>{{ contrctInfo.contractName }}</span
>
</div>
</div>
</div>
<div class="group-list-table">
<div class="table-row">
<div class="table-row-col">
<div class="title">合同ID</div>
<div class="content">
<span class="name">{{ contrctInfo.contractId }}</span>
<el-button
type="text"
size="small"
@click.stop="copyText(contrctInfo.contractId)"
>复制</el-button
>
</div>
</div>
<div class="table-row-col">
<div class="title">合同类型</div>
<div class="content">
<span class="group-id">{{ contrctInfo.contractTypeName }}</span>
</div>
</div>
<div class="table-row-col">
<div class="title">合同状态</div>
<div class="content">
<span class="group-id">{{
contrctInfo.status === "0" ? "启用" : "禁用"
}}</span>
</div>
</div>
</div>
<div class="table-row">
<div class="table-row-col">
<div class="title" style="height: 160px">合同规则</div>
<div class="content" style="overflow: auto">
<div
class="crat-warp"
v-for="item in contrctInfo.priceContractRuleList"
:key="item.ruleNum"
>
<div class="title-span">{{ item.ruleName }}</div>
<div
class="time-wrap"
v-if="contrctInfo.contractType === 'PEAK_VALLEY'"
>
<span class="time-title">时间:</span>
<div class="time-val">
<span style="color: #3300ff">{{ item.minTime }}</span>
<span>~</span>
<span style="color: #3300ff">{{ item.maxTime }}</span>
</div>
</div>
<div class="time-wrap" v-else>
<div class="vlue-warp">
<span>最小值:</span>
<span>{{ item.minVal }}</span>
</div>
<div class="vlue-warp" >
<span>最大值:</span>
<span :title="item.maxVal">{{ item.maxVal }}</span>
</div>
</div>
<div class="dj-wrap">
<span class="dj-title">单价:</span>
<span class="dj-value">{{ item.unitPrice }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</template> </template>
<script > <script >
@ -113,11 +200,14 @@ export default {
}, },
}, },
watch: { watch: {
infoData(val) { infoData: {
if (val) { handler: function(val, oldVal) {
//this.getContractById(); if (val) {
} this.getContractById()
}, }
},
deep: true
}
}, },
data() { data() {
return { return {
@ -126,7 +216,7 @@ export default {
}; };
}, },
created() { created() {
// this.getContractById() this.getContractById()
}, },
methods: { methods: {
// //
@ -138,10 +228,12 @@ export default {
}, },
getContractById() { getContractById() {
if (!this.infoData.contractId && this.infoData.contractId !== 0) { if (!this.infoData.contractId && this.infoData.contractId !== 0) {
this.contrctInfo = {};
return; return;
} }
getContract(this.infoData.contractId).then((response) => { getContract(this.infoData.contractId).then((response) => {
this.contrctInfo = response.data; this.contrctInfo = response.data;
this.$forceUpdate();
}); });
}, },
}, },

View File

@ -188,12 +188,12 @@
<script> <script>
import { import {
listContract, listUserContract,
getContract, getUserContract,
delContract, delUserContract,
addContract, addUserContract,
updateContract, updateUserContract,
exportContract exportUserContract
} from "@/api/iot/contract"; } from "@/api/iot/contract";
import TimePickerWrap from "./profile/timePicker"; import TimePickerWrap from "./profile/timePicker";
@ -361,7 +361,7 @@ export default {
/** 查询电价合同列表 */ /** 查询电价合同列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listContract(Object.assign(this.queryParams, { listUserContract(Object.assign(this.queryParams, {
projectId: this.sourceId projectId: this.sourceId
})).then(response => { })).then(response => {
this.contractList = response.rows; this.contractList = response.rows;
@ -423,7 +423,7 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const contractId = row.contractId || this.ids; const contractId = row.contractId || this.ids;
getContract(contractId).then(response => { getUserContract(contractId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.tempType = 'update' this.tempType = 'update'
@ -434,7 +434,7 @@ export default {
handleDestail(row) { handleDestail(row) {
this.reset(); this.reset();
const contractId = row.contractId || this.ids; const contractId = row.contractId || this.ids;
getContract(contractId).then(response => { getUserContract(contractId).then(response => {
this.form = response.data; this.form = response.data;
this.tempType = 'destail' this.tempType = 'destail'
this.open = true; this.open = true;
@ -446,7 +446,7 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.contractId != null) { if (this.form.contractId != null) {
updateContract(Object.assign(this.form, { updateUserContract(Object.assign(this.form, {
projectId: this.sourceId projectId: this.sourceId
})).then(response => { })).then(response => {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
@ -454,7 +454,7 @@ export default {
this.getList(); this.getList();
}); });
} else { } else {
addContract(Object.assign(this.form, { addUserContract(Object.assign(this.form, {
projectId: this.sourceId projectId: this.sourceId
})).then(response => { })).then(response => {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
@ -474,7 +474,7 @@ export default {
type: "warning" type: "warning"
}) })
.then(function() { .then(function() {
return delContract(contractIds); return delUserContract(contractIds);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
@ -490,7 +490,7 @@ export default {
type: "warning" type: "warning"
}) })
.then(function() { .then(function() {
return exportContract(queryParams); return exportUserContract(queryParams);
}) })
.then(response => { .then(response => {
this.download(response.msg); this.download(response.msg);