|
|
@@ -26,6 +26,7 @@
|
|
|
v-model="scope.row.orderNum"
|
|
|
size="mini"
|
|
|
style="width: 60px"
|
|
|
+ :disabled="isView"
|
|
|
@blur="handleSortChange(scope.row)"
|
|
|
></el-input>
|
|
|
</template>
|
|
|
@@ -75,6 +76,13 @@
|
|
|
import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
|
|
|
import LegalDialog from '@/views/costAudit/baseInfo/catalogManage/legalDialog.vue'
|
|
|
import { dictMixin } from '@/mixins/useDict'
|
|
|
+ import {
|
|
|
+ // 资料清单相关API
|
|
|
+ getDocumentCatalog,
|
|
|
+ addDocumentCatalog,
|
|
|
+ updateDocumentCatalog,
|
|
|
+ deleteDocumentCatalog,
|
|
|
+ } from '@/api/catalogManage'
|
|
|
export default {
|
|
|
components: {
|
|
|
CostAuditTable,
|
|
|
@@ -236,24 +244,14 @@
|
|
|
page: currentPage,
|
|
|
size: pageSize,
|
|
|
}
|
|
|
- getCostProjectMaterialPageList(params)
|
|
|
- .then((res) => {
|
|
|
- if (res && res.value && res.value.value) {
|
|
|
- this.materialList = Array.isArray(res.value.value.records)
|
|
|
- ? res.value.value.records
|
|
|
- : []
|
|
|
- this.pagination.total = Number(res.value.value.total) || 0
|
|
|
- } else {
|
|
|
- this.materialList = []
|
|
|
- this.pagination.total = 0
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- console.error('加载材料数据失败:', error)
|
|
|
- // 错误时清空数据避免显示异常
|
|
|
- this.materialList = []
|
|
|
- this.pagination.total = 0
|
|
|
- })
|
|
|
+ getDocumentCatalog({
|
|
|
+ catalogId: this.project.catalogId,
|
|
|
+ pageNum: currentPage,
|
|
|
+ pageSize: pageSize,
|
|
|
+ }).then((res) => {
|
|
|
+ this.materialList = res.value.records
|
|
|
+ this.pagination.total = res.value.total
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 排序变更
|
|
|
@@ -261,9 +259,8 @@
|
|
|
// 排序逻辑
|
|
|
let data = {
|
|
|
...row,
|
|
|
- projectId: this.project.projectId,
|
|
|
}
|
|
|
- updateCostProjectMaterial(data)
|
|
|
+ updateDocumentCatalog(data)
|
|
|
.then((res) => {
|
|
|
this.$message.success('修改成功')
|
|
|
this.loadMaterialData()
|
|
|
@@ -279,7 +276,7 @@
|
|
|
formatRequired: '',
|
|
|
templateId: '',
|
|
|
surveyTemplateName: '',
|
|
|
- orderNum: 1,
|
|
|
+ orderNum: this.materialList.length + 1,
|
|
|
isRequired: '0',
|
|
|
}
|
|
|
this.materialDialogVisible = true
|
|
|
@@ -307,7 +304,7 @@
|
|
|
)
|
|
|
.then(() => {
|
|
|
try {
|
|
|
- deleteCostProjectMaterial(row.id).then((res) => {
|
|
|
+ deleteDocumentCatalog(row.id).then((res) => {
|
|
|
this.$message.success('删除成功')
|
|
|
this.loadMaterialData()
|
|
|
})
|
|
|
@@ -324,18 +321,32 @@
|
|
|
handleMaterialSubmit(formData) {
|
|
|
let data = {
|
|
|
...formData,
|
|
|
- projectId: this.project.projectId,
|
|
|
+ catalogId: this.project.catalogId,
|
|
|
+ // projectId: this.project.projectId,
|
|
|
+ }
|
|
|
+ if (formData.id) {
|
|
|
+ updateDocumentCatalog(data)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ this.$refs.legalDialog.setSubmitting(false)
|
|
|
+ this.materialDialogVisible = false
|
|
|
+ this.loadMaterialData()
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$refs.legalDialog.setSubmitting(false)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ addDocumentCatalog(data)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success('添加成功')
|
|
|
+ this.$refs.legalDialog.setSubmitting(false)
|
|
|
+ this.materialDialogVisible = false
|
|
|
+ this.loadMaterialData()
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$refs.legalDialog.setSubmitting(false)
|
|
|
+ })
|
|
|
}
|
|
|
- updateCostProjectMaterial(data)
|
|
|
- .then((res) => {
|
|
|
- this.$message.success('保存成功')
|
|
|
- this.$refs.legalDialog.setSubmitting(false)
|
|
|
- this.materialDialogVisible = false
|
|
|
- this.loadMaterialData()
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$refs.legalDialog.setSubmitting(false)
|
|
|
- })
|
|
|
},
|
|
|
handleLegalSubmit() {},
|
|
|
handleMaterialCancel() {
|