update 自定义比对;资料中心

This commit is contained in:
赵霄
2023-10-27 18:03:26 +08:00
parent cf44116037
commit 4b8ec3112c
8 changed files with 337 additions and 304 deletions
@@ -41,7 +41,8 @@
<script>
import JTable from '../../../../components/jero/JTable'
import { deleteCustomComparisonStandard } from '../../../../api/documentToolApi'
import { deleteCustomComparisonStandard, getCustomComparisonStandardList } from '../../../../api/documentToolApi'
import { StandardSource } from '../../../../enums/commonEnums'
export default {
name: 'StandardListDrawer',
@@ -106,13 +107,15 @@ export default {
clickEvent: 'handleDelete'
// has: 'enterpriseStandardLibrary:plan:delete'
}
]
],
infoId: null // 自定义比对数据的id
}
},
methods: {
open () {
open (id) {
this.visible = true
this.$emit('delete', 'GB/T 38698.2-2023')
this.infoId = id
this.loadData(1)
},
handleCancel () {
this.visible = false
@@ -146,7 +149,11 @@ export default {
content: this.$t('areYouSure'),
onOk: () => {
this.confirmLoading = true
deleteCustomComparisonStandard({ id }).then(res => {
const params = {
infoId: this.infoId,
standardId: id
}
deleteCustomComparisonStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
@@ -194,6 +201,31 @@ export default {
this.$openPageNewSheet({
path, query
})
},
loadData (arg) {
if (arg) {
this.ipagination.current = 1
}
this.confirmLoading = true
const params = {
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize,
id: this.infoId
}
getCustomComparisonStandardList(params).then(res => {
if (res.success) {
this.dataSource = res.result.records || res.result
if (res.result.total) {
this.ipagination.total = res.result.total
} else {
this.ipagination.total = 0
}
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}
}
}