diff --git a/src/api/enterpriseLibrary/technical/technical.js b/src/api/enterpriseLibrary/technical/technical.js index 36fc235..7875abc 100644 --- a/src/api/enterpriseLibrary/technical/technical.js +++ b/src/api/enterpriseLibrary/technical/technical.js @@ -1,45 +1,83 @@ import request from '@/utils/request' -// 人员库->查询列表 -export function listAPI(params) { +// 技术方案库->查询类别列表 +export function typeListAPI(params) { return request({ - url: '/smartBid/mainDatabase/personnel/getList', + url: '/smartBid/mainDatabase/technical/getTypeList', method: 'GET', params }) } -/* 人员库->新增人员库 */ +/* 技术方案库->新增技术方案类别库 */ +export function addTypeDataAPI(data) { + return request({ + url: '/smartBid/mainDatabase/technical/addTypeData', + method: 'POST', + data + }) +} + +/* 技术方案库->修改技术方案类别库 */ +export function editTypeDataAPI(data) { + return request({ + url: '/smartBid/mainDatabase/technical/editTypeData', + method: 'POST', + data + }) +} + +/* 技术方案库->删除技术方案类别库 */ +export function delTypeDataAPI(data) { + return request({ + url: '/smartBid/mainDatabase/technical/delTypeData', + method: 'POST', + data + }) +} + + + +// 技术方案库->查询列表 +export function listAPI(params) { + return request({ + url: '/smartBid/mainDatabase/technical/getDataList', + method: 'GET', + params + }) +} + +/* 技术方案库->新增技术方案库 */ export function addDataAPI(data) { return request({ - url: '/smartBid/mainDatabase/personnel/addData', + url: '/smartBid/mainDatabase/technical/addData', method: 'POST', data }) } -/* 人员库->修改人员库 */ +/* 技术方案库->修改技术方案库 */ export function editDataAPI(data) { return request({ - url: '/smartBid/mainDatabase/personnel/editData', + url: '/smartBid/mainDatabase/technical/editData', method: 'POST', data }) } -/* 人员库->删除人员库 */ +/* 技术方案库->删除技术方案库 */ export function delDataAPI(data) { return request({ - url: '/smartBid/mainDatabase/personnel/delData', + url: '/smartBid/mainDatabase/technical/delData', method: 'POST', data }) } -/* 人员库->查询详情 */ +/* 技术方案库->查询详情 */ export function getDetailDataAPI(params) { return request({ - url: '/smartBid/mainDatabase/personnel/getDetailData', + url: '/smartBid/mainDatabase/technical/detailData', method: 'GET', params }) diff --git a/src/api/enterpriseLibrary/tool/tool.js b/src/api/enterpriseLibrary/tool/tool.js new file mode 100644 index 0000000..a2b4e8a --- /dev/null +++ b/src/api/enterpriseLibrary/tool/tool.js @@ -0,0 +1,46 @@ +import request from '@/utils/request' + +// 工器具库->查询列表 +export function listAPI(params) { + return request({ + url: '/smartBid/mainDatabase/tool/getList', + method: 'GET', + params + }) +} + +/* 工器具库->新增工器具 */ +export function addDataAPI(data) { + return request({ + url: '/smartBid/mainDatabase/tool/addData', + method: 'POST', + data + }) +} + +/* 工器具库->修改工器具 */ +export function editDataAPI(data) { + return request({ + url: '/smartBid/mainDatabase/tool/editData', + method: 'POST', + data + }) +} + +/* 工器具库->删除工器具 */ +export function delDataAPI(data) { + return request({ + url: '/smartBid/mainDatabase/tool/delData', + method: 'POST', + data + }) +} + +/* 工器具库->查询详情 */ +export function getDetailDataAPI(params) { + return request({ + url: '/smartBid/mainDatabase/tool/getDetailData', + method: 'GET', + params + }) +} \ No newline at end of file diff --git a/src/components/TableModel2/index.vue b/src/components/TableModel2/index.vue index e09bebb..31ca6e2 100644 --- a/src/components/TableModel2/index.vue +++ b/src/components/TableModel2/index.vue @@ -271,7 +271,7 @@ export default { // 操作列最小宽度 dynamicWidth: 0, // 操作列固定宽度,防止列数过少导致过宽 - handleColWidth: 260, + handleColWidth: 200, // 自增id idCount: 1, // 日期查询条件 字段名称 diff --git a/src/router/index.js b/src/router/index.js index 0bb2521..49cca71 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -312,7 +312,7 @@ export const dynamicRoutes = [ { path: 'index', component: () => import('@/views/enterpriseLibrary/technical/components/TechnicalForm'), - name: 'TechnicalAdd', + name: 'TechnicalEdit', meta: { title: '修改方案', activeMenu: '/enterpriseLibrary/enterprise', noCache: true } } ] @@ -325,8 +325,8 @@ export const dynamicRoutes = [ children: [ { path: 'index', - component: () => import('@/views/enterpriseLibrary/technical/components/TechnicalForm'), - name: 'TechnicalAdd', + component: () => import('@/views/enterpriseLibrary/technical/components/TechnicalDetail'), + name: 'TechnicalDetail', meta: { title: '方案详情', activeMenu: '/enterpriseLibrary/enterprise', noCache: true } } ] diff --git a/src/views/common/UploadMoreFile.vue b/src/views/common/UploadMoreFile.vue index 380691c..cfce0d6 100644 --- a/src/views/common/UploadMoreFile.vue +++ b/src/views/common/UploadMoreFile.vue @@ -3,7 +3,7 @@ + :auto-upload="autoUpload" :http-request="customUpload" :disabled="disabled">
@@ -59,6 +59,10 @@ export default { type: String, default: '', }, + disabled: { + type: Boolean, + default: false, + }, }, data() { return { diff --git a/src/views/enterpriseLibrary/technical/components/LeftType.vue b/src/views/enterpriseLibrary/technical/components/LeftType.vue index d0e0581..920a22f 100644 --- a/src/views/enterpriseLibrary/technical/components/LeftType.vue +++ b/src/views/enterpriseLibrary/technical/components/LeftType.vue @@ -4,8 +4,9 @@ + 添加
-
+
{{ item.technicalSolutionName }} @@ -27,6 +28,7 @@ + + \ No newline at end of file diff --git a/src/views/enterpriseLibrary/technical/components/TechnicalForm.vue b/src/views/enterpriseLibrary/technical/components/TechnicalForm.vue index bcff310..2ab5a42 100644 --- a/src/views/enterpriseLibrary/technical/components/TechnicalForm.vue +++ b/src/views/enterpriseLibrary/technical/components/TechnicalForm.vue @@ -14,11 +14,11 @@ - + - +
@@ -30,7 +30,7 @@ import { encryptWithSM4,decryptWithSM4 } from '@/utils/sm' import BasicInfo from './child/BasicInfo.vue' import FileInfo from './child/FileInfo.vue' import GlobalUploadAnimation from '@/views/common/GlobalUploadAnimation.vue' -import { addDataAPI, editDataAPI, getDetailDataAPI } from '@/api/enterpriseLibrary/enterprise/enterprise' +import { addDataAPI, editDataAPI, getDetailDataAPI } from '@/api/enterpriseLibrary/technical/technical' export default { name: 'TechnicalForm', @@ -42,6 +42,9 @@ export default { data() { return { enterpriseId: decryptWithSM4(this.$route.query.enterpriseId), + technicalSolutionTypeId: decryptWithSM4(this.$route.query.technicalSolutionTypeId), + technicalSolutionId: decryptWithSM4(this.$route.query.technicalSolutionId), + type: decryptWithSM4(this.$route.query.type), showUploadAnimation: false, showSaveAnimation: false, // 新增:保存动画状态 uploadQueue: 0, // 上传队列计数器 @@ -68,7 +71,8 @@ export default { // 获取详情 async getDetail() { if (this.type === 'edit') { - const res = await getDetailDataAPI({ enterpriseId: this.enterpriseId }) + const res = await getDetailDataAPI({ technicalSolutionTypeId: this.technicalSolutionTypeId, + technicalSolutionId: this.technicalSolutionId,type:'edit' }) console.log('res:', res); this.detailData = res.data; } @@ -85,45 +89,39 @@ export default { try { // 并行校验所有表单 - const [basicInfoData, legalPersonData, accountData] = await Promise.all([ + const [basicInfoData, fileInfoData] = await Promise.all([ this.$refs.basicInfo.validate(), - this.$refs.legalPerson.validate(), - this.$refs.accountOpeningCertificate.validate() + this.$refs.fileInfo.validate() ]) // 所有校验通过,组装完整数据 let formData = { ...basicInfoData, - ...legalPersonData, - ...accountData, + ...fileInfoData, allFiles: [ - ...basicInfoData.fileList.map(file => JSON.parse(JSON.stringify(file))), - ...legalPersonData.fileList.map(file => JSON.parse(JSON.stringify(file))), - ...legalPersonData.fileList2.map(file => JSON.parse(JSON.stringify(file))), - ...accountData.fileList.map(file => JSON.parse(JSON.stringify(file))) + ...fileInfoData.fileList.map(file => JSON.parse(JSON.stringify(file))), ], delFiles: [ - ...basicInfoData.delFileList, - ...legalPersonData.delFileList, - ...accountData.delFileList + ...fileInfoData.delFileList ] } - console.log('所有表单校验通过,完整数据:', formData) - let allFiles = formData.allFiles.map(file => { return file?.response?.fileRes ? { ...file.response.fileRes, } : null; }).filter(item => item !== null); formData.files = allFiles; + formData.natureConstruction = formData.natureConstruction.join(','); + formData.enterpriseId = this.enterpriseId; + formData.technicalSolutionTypeId = this.technicalSolutionTypeId; // 删除不必要的属性 delete formData.fileList; delete formData.delFileList; delete formData.allFiles; - delete formData.fileList2; + console.log('所有表单校验通过,完整数据:', formData) // 保存请求 - const res = await this.saveEnterprise(formData) + const res = await this.saveData(formData) console.log('res:', res); if (res.code === 200) { this.$message.success('保存成功') @@ -140,7 +138,7 @@ export default { } }, // 保存接口 - async saveEnterprise(formData) { + async saveData(formData) { return new Promise((resolve, reject) => { if (this.type === 'add') { // 新增 addDataAPI(formData).then(res => { @@ -149,7 +147,7 @@ export default { reject(error) }) } else { // 修改 - formData.enterpriseId = this.enterpriseId; + formData.technicalSolutionId = this.technicalSolutionId; editDataAPI(formData).then(res => { resolve(res) }).catch(error => { diff --git a/src/views/enterpriseLibrary/technical/components/TypeForm.vue b/src/views/enterpriseLibrary/technical/components/TypeForm.vue index 958006e..ed1f375 100644 --- a/src/views/enterpriseLibrary/technical/components/TypeForm.vue +++ b/src/views/enterpriseLibrary/technical/components/TypeForm.vue @@ -19,7 +19,10 @@ + + \ No newline at end of file diff --git a/src/views/enterpriseLibrary/technical/components/child/FileInfo.vue b/src/views/enterpriseLibrary/technical/components/child/FileInfo.vue index 8b34a7d..c7adecf 100644 --- a/src/views/enterpriseLibrary/technical/components/child/FileInfo.vue +++ b/src/views/enterpriseLibrary/technical/components/child/FileInfo.vue @@ -9,7 +9,7 @@ + :fileUploadRule="fileUploadRule" :limitUploadNum="limitUploadNum" :disabled="disabled" />
@@ -26,7 +26,8 @@ const defaultParams = { fields_json: '', suffix: 'technical_solution_database' }, - limitUploadNum: 5 + limitUploadNum: 5, + disabled: false }; import UploadMoreFile from '@/views/common/UploadMoreFile.vue' export default { @@ -47,6 +48,7 @@ export default { maxFileTips: defaultParams.maxFileTips, fileUploadRule: defaultParams.fileUploadRule, limitUploadNum: defaultParams.limitUploadNum, + disabled: defaultParams.disabled, form: { fileList: [], delFileList: [] @@ -58,6 +60,18 @@ export default { } } }, + watch: { + detailData:{ + handler(newVal) { + if(Object.keys(newVal).length > 0){ + this.limitUploadNum = 1; + this.disabled = true; + this.setFormData(newVal) + } + }, + immediate: true + } + }, created() { }, methods: { @@ -89,7 +103,22 @@ export default { } }, setFormData() { + const fileList = this.getFileList(); + this.form = { + fileList: fileList, + delFileList: [] + } }, + getFileList(){ + return this.detailData.resourceFileVoList.map(item => { + return { + name: item.fileName, + filePath: item.filePath, + lsFilePath:item.lsFilePath, + fileType:item.fileType + }; + }); + } }, } diff --git a/src/views/enterpriseLibrary/technical/components/child/FileInfoDetail.vue b/src/views/enterpriseLibrary/technical/components/child/FileInfoDetail.vue new file mode 100644 index 0000000..1364c2f --- /dev/null +++ b/src/views/enterpriseLibrary/technical/components/child/FileInfoDetail.vue @@ -0,0 +1,85 @@ + + + + + \ No newline at end of file diff --git a/src/views/enterpriseLibrary/technical/components/config.js b/src/views/enterpriseLibrary/technical/components/config.js index 0ab0951..bd305e9 100644 --- a/src/views/enterpriseLibrary/technical/components/config.js +++ b/src/views/enterpriseLibrary/technical/components/config.js @@ -33,10 +33,10 @@ export const formLabel = [ ] export const columnsList = [ - { t_props: 'userName', t_label: '方案名称' }, - { t_props: 'nickName', t_label: '建设性质' }, - { t_props: 'phonenumberDes', t_label: '结构形式' }, - { t_props: 'phonenumberDes', t_label: '基础形式' }, - { t_props: 'phonenumberDes', t_label: '文件状态' }, - { t_slot: 'deptName', t_label: '创建时间' }, + { t_props: 'technicalName',t_width: 350, t_label: '方案名称' }, + { t_props: 'natureConstruction', t_label: '建设性质' }, + { t_props: 'structuralForm', t_label: '结构形式' }, + { t_props: 'basicForm', t_label: '基础形式' }, + { t_slot: 'technicalSolutionState', t_label: '文件状态' }, + { t_props: 'createTime',t_width: 180, t_label: '创建时间' }, ] \ No newline at end of file diff --git a/src/views/enterpriseLibrary/technical/index.vue b/src/views/enterpriseLibrary/technical/index.vue index 9623b4f..9a71ad4 100644 --- a/src/views/enterpriseLibrary/technical/index.vue +++ b/src/views/enterpriseLibrary/technical/index.vue @@ -8,12 +8,12 @@
- + - - + @@ -34,7 +34,7 @@ export default { }, data() { return { - activeCategory: 'dev', + activeCategory: null, enterpriseId: decryptWithSM4(this.$route.query.enterpriseId), } }, @@ -81,6 +81,7 @@ export default { \ No newline at end of file