From a591d01bb318ec0a41113c25b6c85f2ec9466c40 Mon Sep 17 00:00:00 2001
From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com>
Date: Tue, 30 Jul 2024 11:07:51 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=93=E7=AE=97=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../component/finishAndDetails.vue | 2 +
.../csotSettlement/component/finishTable.vue | 133 ++++++++++++------
2 files changed, 91 insertions(+), 44 deletions(-)
diff --git a/sgzb-ui/src/views/cost/csotSettlement/component/finishAndDetails.vue b/sgzb-ui/src/views/cost/csotSettlement/component/finishAndDetails.vue
index fab0c681..e08ec080 100644
--- a/sgzb-ui/src/views/cost/csotSettlement/component/finishAndDetails.vue
+++ b/sgzb-ui/src/views/cost/csotSettlement/component/finishAndDetails.vue
@@ -19,6 +19,7 @@
:totalPrice="settleTotalPrice_01"
:tableData="settleTableData_01"
@handelSaveSuccess="handelSaveSuccess"
+ v-if="settleTableData_01.length > 0"
/>
确认结算
-
+
+
-
-
-
- {{ row[t.t_prop] }}
-
-
+
+
- {{ row[t.t_prop] }}
+ {{ scope.row[t.t_prop] }}
@@ -134,15 +142,20 @@ export default {
data() {
return {
- isEdit: false,
- batchNum: 0,
- // tableDataList: [],
+ isEdit: false, // 是否编辑数据
+ batchNum: '', // 批量调整天数的数据源
+ activeIndex: '', // 调整天数输入框不合格时的 index 用来设置动态 class 增加一个红色边框
+ activeIndexTime: '', // 调整终结日期时的 index 用来设置动态 class 增加一个红色边框
}
},
methods: {
- // 编辑按钮
+ /** 编辑按钮 */
handleEdit() {
this.isEdit = !this.isEdit
+ if (!this.isEdit) {
+ this.batchNum = ''
+ this.$emit('handelSaveSuccess')
+ }
},
/** 调整天数 */
iptChange(val) {
@@ -161,40 +174,67 @@ export default {
const regex = /^-?\d+$/
let isNum = false
try {
- this.tableData.map((e) => {
+ // 1. 先循环列表数据 判断调整的天数是否符合要求
+ this.tableData.map((e, v) => {
+ console.log(e.endTime, '选择的时间')
+
+ if (!e.endTime) {
+ this.$message.error('请选择终结日期!')
+ this.activeIndexTime = v
+ this.$refs[`editTime_${v}`][0].focus()
+ isNum = true
+ throw new Error()
+ }
if (!regex.test(e.trimDay)) {
+ this.$message.error('请输入正整数和负整数或0!')
+ this.activeIndex = v
+ this.$refs[`editIpt_${v}`][0].focus()
isNum = true
throw new Error()
}
})
- } catch {}
- if (isNum) {
- this.$message.error('请输入正整数和负整数或0!')
- return
- }
+ if (isNum) return
- let saveParams = []
- this.tableData.map((e) => {
- const item = {
- agreementId: e.agreementId,
- typeId: e.typeId,
- trimDay: e.trimDay,
- maId: e.maId || '',
+ // 2. 组装保存时的参数
+ let saveParams = []
+ this.tableData.map((e) => {
+ const item = {
+ agreementId: e.agreementId, // 协议id
+ typeId: e.typeId, // 设备id
+ trimDay: e.trimDay, // 调整的天数
+ maId: e.maId || '',
+ }
+
+ saveParams.push(item)
+ })
+
+ // 3. 请求后台接口传递更改后的数据
+ const res = await editSaveApi(saveParams)
+
+ if (res.code == 200) {
+ this.$message.success('保存成功!')
+ this.activeIndex = ''
+ this.activeIndexTime = ''
+ this.batchNum = ''
+ this.isEdit = false
+ this.$emit('handelSaveSuccess')
}
-
- saveParams.push(item)
+ } catch {}
+ },
+ /** 单个列表确认结算 */
+ submitSell() {
+ this.$confirm(
+ '确定后则会生成财务报表,数据将不可修改,请确认检查无误',
+ '提示',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ },
+ ).then(() => {
+ console.log('确定,后续走确定逻辑')
})
-
- console.log(saveParams, '保存时的参数---')
-
- const res = await editSaveApi(saveParams)
-
- if (res.code == 200) {
- this.$message.success('保存成功!')
- this.isEdit = false
- this.$emit('handelSaveSuccess')
- }
},
},
}
@@ -254,4 +294,9 @@ export default {
line-height: 36px;
}
}
+::v-deep .active {
+ .el-input__inner:focus {
+ border-color: #f56c6c;
+ }
+}