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.134:8899
target = http://192.168.18.134:8899
//target = http://192.168.18.139: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

View File

@ -20,7 +20,7 @@ export function getContract(contractId) {
// 新增电价合同
export function addContract(data) {
return request({
url: '/iot/contract/addContract',
url: '/iot/contract',
method: 'post',
data: data
})
@ -51,3 +51,59 @@ export function exportContract(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-row>
<!-- <el-form-item label="电价合同:">
<el-form-item label="电价合同:">
<e-dialog-table-input
:table="selectPriceTable"
:refurbishFun="listContract"
@ -212,7 +212,7 @@
psize="small"
@change="handleProiceDialogEvent"
/>
</el-form-item> -->
</el-form-item>
<el-form-item label="行政区划" prop="regionalismId">
<!-- <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>
</template>
<script >
@ -113,11 +200,14 @@ export default {
},
},
watch: {
infoData(val) {
if (val) {
//this.getContractById();
}
},
infoData: {
handler: function(val, oldVal) {
if (val) {
this.getContractById()
}
},
deep: true
}
},
data() {
return {
@ -126,7 +216,7 @@ export default {
};
},
created() {
// this.getContractById()
this.getContractById()
},
methods: {
//
@ -138,10 +228,12 @@ export default {
},
getContractById() {
if (!this.infoData.contractId && this.infoData.contractId !== 0) {
this.contrctInfo = {};
return;
}
getContract(this.infoData.contractId).then((response) => {
this.contrctInfo = response.data;
this.$forceUpdate();
});
},
},

View File

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