Commit a94af4bc by 李伟康

```

fix(addHandover): 优化交付组件状态管理

- 将showAgree和agree状态从step-2.vue移至父组件addHandover.vue
- 修复步骤切换时agree状态未重置的问题
- 重构数据获取逻辑,统一状态管理
- 移除未使用的代码注释
```
1 parent e0dbc8f4
......@@ -37,9 +37,9 @@
</div>
</div>
<template #footerCustom>
<template v-if="step == 2 && step2Ref.showAgree">
<template v-if="step == 2 && showAgree">
<div class="agree-box">
<el-checkbox v-model="step2Ref.agree">我确认以上已上传的凭证真实有效,并知晓系统将同步变更拍卖平台上的交付人信息。</el-checkbox>
<el-checkbox v-model="agree">我确认以上已上传的凭证真实有效,并知晓系统将同步变更拍卖平台上的交付人信息。</el-checkbox>
</div>
</template>
</template>
......@@ -107,6 +107,13 @@ export default {
},
step2Ref () {
return this.$refs.step2
},
showAgree () {
const { tableData } = this
let flag = false
let len = tableData.findIndex(item => item.signCustodyStatus)
if (len != -1) flag = true
return flag
}
},
mounted () { },
......@@ -116,6 +123,7 @@ export default {
if (val) {
this.step = 1
this.loading = true
this.agree = false
this.$nextTick(() => {
this.step1Ref.init()
})
......@@ -141,7 +149,7 @@ export default {
loading: true,
tableData: [],
btnLoding: false,
viewKey: Date.now(),
agree: false
}
},
methods: {
......@@ -155,8 +163,6 @@ export default {
const { step } = this
if (step == 1) this.queryAssets()
if (step == 2) this.createStaffHandover()
// this.step = step + 1
// if (this.step == 2) this.$refs.step2.init()
},
async queryAssets () {
try {
......@@ -184,7 +190,8 @@ export default {
try {
this.btnLoding = true
const { formObj } = this.step1Ref,
{ showAgree, agree, filterArr } = this.step2Ref
{ filterArr } = this.step2Ref,
{ showAgree, agree } = this
let num = 0
const assets = filterArr()
let agreeFlag = false
......
......@@ -130,27 +130,16 @@ export default {
},
]
},
agree: false,
listData: [],
currentIndex: 0,
currentImgUrls: []
}
},
computed: {
showAgree () {
const { tableData } = this
let flag = false
let len = tableData.findIndex(item => item.signCustodyStatus)
if (len != -1) flag = true
return flag
}
},
watch: {
tableData: {
handler (val) {
this.imgViewerVisible = false
this.currentImgUrls = []
this.agree = false
this.listData = val || []
this.GlOssApi = new GlOssApi({
baseConfig
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!