This commit is contained in:
wang710356044
2021-11-18 16:41:08 +08:00
parent f58090ad06
commit 5ad38c0b1d
15 changed files with 945 additions and 372 deletions

View File

@@ -45,7 +45,8 @@
<template #billName="{ text, record }">
<div class="editable-cell">
<div v-if="editableData[record.drinkingWaterBillId]" class="editable-cell-input-wrapper">
<a-input v-model:value="editableData[record.drinkingWaterBillId].billName" @pressEnter="save(record)" />
<a-input v-model:value="editableData[record.drinkingWaterBillId].billName"
@pressEnter="save(record)" />
<check-outlined class="editable-cell-icon-check" @click="save(record)" />
</div>
<div v-else class="editable-cell-text-wrapper">
@@ -57,7 +58,7 @@
<template #reportTime="{ text, record }">
<div class="editable-cell">
<div v-if="editableData[record.drinkingWaterBillId]" class="editable-cell-input-wrapper">
<a-date-picker v-model:value="editableData[record.drinkingWaterBillId].reportTime"></a-date-picker>
<a-date-picker v-model:value="editableData[record.drinkingWaterBillId].reportTime " @pressEnter="save(record)"></a-date-picker>
<!-- <a-input v-model:value="editableData[record.drinkingWaterBillId].reportTime" @pressEnter="save(record)" /> -->
<check-outlined class="editable-cell-icon-check" @click="save(record)" />
</div>
@@ -77,7 +78,8 @@
<template #action="{ record }">
<a-space>
<a-button @click="detail(record)" shape="round" size="small">查看</a-button>
<span v-hasPermi="['ecology:sound:verify']">
<!-- <span v-hasPermi="['ecology:sound:verify']"> -->
<span>
<a-popconfirm v-if="record.checked != 1" :title="`审核通过后将无法修改,确认?`" ok-text="Yes" cancel-text="No"
@confirm="verify(record,1)">
<a-button type="primary" shape="round" size="small">审核</a-button>
@@ -191,14 +193,14 @@
text
}) => this.$util.toDateString(text)
},
{
title: '导入时间',
dataIndex: 'createTime',
sorter: true,
customRender: ({
text
}) => this.$util.toDateString(text)
},
// {
// title: '最后更新时间',
// dataIndex: 'updateTime',
// sorter: true,
// customRender: ({
// text
// }) => this.$util.toDateString(text)
// },
{
title: '审核状态',
dataIndex: 'checked',
@@ -206,13 +208,13 @@
slots: {
customRender: 'checked',
},
},
{
title: '创建人',
dataIndex: 'userName',
dataIndex: 'userId',
sorter: true,
customRender: ({ text }) => (text == 1 ? "admin" : ""),
},
// {
// title: '更新时间',
@@ -233,7 +235,10 @@
}
],
// 表格搜索条件
where: {},
where: {
// sort: "createTime",
// order: "desc"
},
reportTimeScope: [],
// 表格选中数据
selectionList: [],
@@ -270,8 +275,7 @@
},
edit(record) {
this.editableData[record.drinkingWaterBillId] = _.cloneDeep(record);
this.editableData[record.drinkingWaterBillId].reportTime = moment(this.editableData[record.drinkingWaterBillId]
.reportTime)
this.editableData[record.drinkingWaterBillId].reportTime = moment(this.editableData[record.drinkingWaterBillId].reportTime);
},
verify(record,checked) {
const hide = this.$message.loading('请求中..', 0);
@@ -298,11 +302,17 @@
})
},
save(record) {
let {
drinkingWaterBillId,
billName,
reportTime
reportTime,
regionLevel,
createTime,
checked,
waterSourceType,
drinkingWaterType,
userId
} = this.editableData[record.drinkingWaterBillId];
if (!drinkingWaterBillId || !reportTime) {
this.$message.error('请填写完整信息再提交')
@@ -314,12 +324,18 @@
updateDrinkingWaterBill({
drinkingWaterBillId,
billName,
reportTime
reportTime,
regionLevel,
createTime,
checked,
waterSourceType,
drinkingWaterType,
userId
}).then(res => {
if (res.data.code == 0) {
this.$message.success(res.data.msg);
record.billName = billName;
record.reportTime = reportTime
record.reportTime = reportTime;
} else {
this.$message.error(res.data.msg);
}