bug 78400

This commit is contained in:
赵霄
2023-11-10 19:53:11 +08:00
parent 8e69213678
commit 999ed11182
2 changed files with 21 additions and 8 deletions
@@ -9,7 +9,7 @@
:maskClosable="false"
class="custom-drawer-style">
<div class="custom-drawer-style-scroll">
<div class="custom-drawer-style-scroll" :class="{'no-btn-body': isDetail}">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<!--清单名称-->
@@ -126,7 +126,7 @@
</a-spin>
</div>
<div class="custom-drawer-style-bottom-btn">
<div class="custom-drawer-style-bottom-btn" v-if="!isDetail">
<a-button @click="handleSaveForm(true)" type="primary" style="margin-bottom: 0;" :loading="confirmLoading">
{{ $t('preservation') }}
</a-button>
@@ -217,7 +217,8 @@ export default {
standardList: [], // 标准的列表
specialtyItemList: [], // 特点的列表(三级表头)
isFirstOpenComparison: true, // 第一次打开在线比对
countryTreeData: [] // 涉及国家数据
countryTreeData: [], // 涉及国家数据
maintainItemList: [] // 维护项列表
}
},
watch: {
@@ -326,7 +327,6 @@ export default {
*/
reloadData () {
this.getFormData()
this.initTableData()
},
async reloadTableHasResult () {
await this.initTableData()
@@ -402,6 +402,7 @@ export default {
// 处理表格数据
// 把比对项的数据放在里面,对比项取proertyVal为显示字段,其余属性用数据本身的
this.maintainItemList = result.ranksMap.对比项 || []
const maintainItemList = result.ranksMap.对比项 || []
// 有多少对比项决定了有多少行数据
this.dataSource = maintainItemList.map(maintainData => {
@@ -428,6 +429,10 @@ export default {
* @param id
*/
handleDeleteSpecialty ({ id }) {
if (this.specialtyItemList.length <= `1`) {
this.$message.warning(this.$t('docTool.customComparison.reserveAnItem'))
return
}
this.confirmLoading = true
deleteSpecialtyItem({ id }).then(res => {
if (res.success) {
@@ -445,6 +450,10 @@ export default {
* @param record
*/
handleDeleteMaintainItem (record) {
if (this.maintainItemList.length <= `1`) {
this.$message.warning(this.$t('docTool.customComparison.reserveAnItem'))
return
}
this.confirmLoading = true
const parmas = { id: record.maintainData.id }
deleteMaintainItem(parmas).then(res => {
@@ -532,7 +541,7 @@ export default {
*/
getFormData () {
this.confirmLoading = true
getFormDataById({ id: this.modal.id }).then(res => {
getFormDataById({ id: this.modal.id }).then(async res => {
if (res.success) {
this.modal = Object.assign(this.modal, res.result || {})
// 处理关联国家的回显
@@ -549,6 +558,7 @@ export default {
this.$nextTick(() => {
this.form.setFieldsValue(this.modal)
})
await this.initTableData()
} else {
this.$message.warning(res.message)
}
@@ -584,7 +594,6 @@ export default {
*/
initTableData () {
return new Promise(resolve => {
this.confirmLoading = true
getTableData({ infoId: this.modal.id }).then(res => {
if (res.success) {
// 平铺一些数据
@@ -595,7 +604,6 @@ export default {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
resolve()
})
})
@@ -698,4 +706,8 @@ export default {
float: right;
margin-top: 4px;
}
.no-btn-body {
height: 100%;
}
</style>