From 4b8ec3112ceebf13804a682a7866f84f3c42bf71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Fri, 27 Oct 2023 18:03:26 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=87=AA=E5=AE=9A=E4=B9=89=E6=AF=94?= =?UTF-8?q?=E5=AF=B9=EF=BC=9B=E8=B5=84=E6=96=99=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/documentToolApi.js | 22 +- .../askForAdvice/AskForAdviceList.vue | 58 +++ .../customComparison/CustomComparisonList.vue | 41 +- .../modules/CustomComparisonDrawer.vue | 433 +++++++----------- .../modules/StandardListDrawer.vue | 42 +- .../profileCenter/ProfileCenterList.vue | 4 +- .../modules/ProfileCenterModal.vue | 16 +- .../modules/ProfileCenterTreeModal.vue | 25 +- 8 files changed, 337 insertions(+), 304 deletions(-) create mode 100644 src/views/businessSupport/askForAdvice/AskForAdviceList.vue diff --git a/src/api/documentToolApi.js b/src/api/documentToolApi.js index 68b25d4c..8026a73f 100644 --- a/src/api/documentToolApi.js +++ b/src/api/documentToolApi.js @@ -75,15 +75,23 @@ const addComment = (params) => postAction('/compare/sarFileCompareResComment/add const getCommentList = (params) => getAction('/compare/sarFileCompareResComment/queryListByInfoId', params) // 自定义比对-标准列表 -const getCustomComparisonStandardList = (params) => getAction('', params) +const getCustomComparisonStandardList = (params) => getAction('/customCompare/lawsCustomCompareInfo/queryStandardByInfoId', params) // 自定义比对-标准列表-删除 -const deleteCustomComparisonStandard = (params) => postAction('', params) +const deleteCustomComparisonStandard = (params) => postAction('/customCompare/lawsCustomCompareInfo/delStandard', params) // 自定义比对-特点删除 const deleteSpecialtyItem = (params) => postAction('', params) // 自定义比对-比对项删除 const deleteMaintainItem = (params) => postAction('', params) // 自定义比对-表格单元格编辑 const editCell = (params) => postAction('', params) +// 自定义比对-保存表单数据 +const saveFormData = (params) => postAction('/customCompare/lawsCustomCompareInfo/save', params) +// 自定义比对-通过id获取表单数据 +const getFormDataById = (params) => getAction('/customCompare/lawsCustomCompareInfo/queryById', params) +// 自定义比对-保存标准 +const saveStandard = (params) => getAction('/customCompare/lawsCustomCompareInfo/saveStandard', params) +// 自定义比对-获取复杂表格数据 +const getTableData = (params) => getAction('/customCompare/lawsCustomCompareInfo/queryTableDetail', params) export { // 文档拆分 @@ -92,7 +100,7 @@ export { withdraw, previewDocSplit, importSplitResult, - + // 文档拆分-详情 getDocSplitTableHeader, getDocSplitSearch, @@ -112,7 +120,7 @@ export { editClauseTreeNode, copyClause, getInterpretationArticlesList, - + // 文档比对 withdrawPublication, getInitComparsionPageData, @@ -132,5 +140,9 @@ export { deleteCustomComparisonStandard, deleteSpecialtyItem, deleteMaintainItem, - editCell + editCell, + saveFormData, + getFormDataById, + saveStandard, + getTableData } diff --git a/src/views/businessSupport/askForAdvice/AskForAdviceList.vue b/src/views/businessSupport/askForAdvice/AskForAdviceList.vue new file mode 100644 index 00000000..95a71bfc --- /dev/null +++ b/src/views/businessSupport/askForAdvice/AskForAdviceList.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/src/views/documentTool/customComparison/CustomComparisonList.vue b/src/views/documentTool/customComparison/CustomComparisonList.vue index 2cb2cbd9..0ad38598 100644 --- a/src/views/documentTool/customComparison/CustomComparisonList.vue +++ b/src/views/documentTool/customComparison/CustomComparisonList.vue @@ -8,20 +8,20 @@ + v-model="queryParam.listName"> + v-model="queryParam.referenceStandard"> - - + - - + - + @@ -103,37 +105,37 @@ export default { { title: this.$t('docTool.customComparison.listName'), width: 200, - dataIndex: 'fileTypeLeft_dictText' + dataIndex: 'listName' }, // 涉及标准 { title: this.$t('docTool.customComparison.referenceStandard'), width: 200, - dataIndex: 'fileTypeLeft_dictText' + dataIndex: 'referenceStandard' }, // 涉及国家 { title: this.$t('docTool.customComparison.countriesInvolved'), width: 150, - dataIndex: 'fileTypeLeft_dictText' + dataIndex: 'referenceCountry_dictText' }, // 是否公开 { title: this.$t('docTool.customComparison.whetherToMakePublic'), width: 100, - dataIndex: 'fileTypeLeft_dictText' + dataIndex: 'isShow_dictText' }, // 比对时间 { title: this.$t('docTool.customComparison.comparisonTime'), width: 150, - dataIndex: 'fileTypeLeft_dictText' + dataIndex: 'createTime' }, // 操作人 { title: this.$t('docTool.customComparison.operator'), width: 150, - dataIndex: 'fileTypeLeft_dictText' + dataIndex: 'author' }, // 操作 { @@ -152,7 +154,7 @@ export default { // 编辑 { text: this.$t('edit'), - clickEvent: 'edit' + clickEvent: 'handleEdit' // has: 'documentComparison:edit' }, { // 删除 @@ -162,9 +164,9 @@ export default { } ], url: { - list: '' - }, - dataSource: [{ id: '1' }] + list: '/customCompare/lawsCustomCompareInfo/queryByPage', + delete: '/customCompare/lawsCustomCompareInfo/delById' + } } }, methods: { @@ -175,6 +177,11 @@ export default { this.countriesInvolvedOptions = res.result || [] } }) + }, + handleEdit ({ id }) { + this.$refs.modalForm.edit(id) + this.$refs.modalForm.title = this.$t('edit') + this.$refs.modalForm.disableSubmit = false } } } diff --git a/src/views/documentTool/customComparison/modules/CustomComparisonDrawer.vue b/src/views/documentTool/customComparison/modules/CustomComparisonDrawer.vue index 638ec0eb..763c88ca 100644 --- a/src/views/documentTool/customComparison/modules/CustomComparisonDrawer.vue +++ b/src/views/documentTool/customComparison/modules/CustomComparisonDrawer.vue @@ -17,19 +17,31 @@ + v-decorator="['listName', validatorRules.listName]" /> + v-decorator="['referenceStandard', validatorRules.referenceStandard]" + @change="handleStandardChange" /> + - - + + {{ $t('submit') }}
@@ -132,251 +145,16 @@ import StandardSelection from '../../../../components/selection/StandardSelectio import { downFile } from '../../../../api/manage' import StandardListDrawer from './StandardListDrawer' import ComparisonMaintainDrawer from './ComparisonMaintainDrawer' -import { deleteSpecialtyItem, deleteMaintainItem } from '../../../../api/documentToolApi' +import { + deleteSpecialtyItem, + deleteMaintainItem, + saveFormData, + getFormDataById, + saveStandard, + getTableData +} from '../../../../api/documentToolApi' import CustomComparisonCellDrawer from './CustomComparisonCellDrawer' - -const ApiData = { - 'countryMap': { - '': [ - { - 'id': 'QTGBP59D7AKHDLD2T4R6', - 'country': null, - 'standNum': 'GB 11212-121212', - 'standName': '1111', - 'standId': '63e289e4dda24f90a51e', - 'standType': 'INLAND', - 'compareBaseId': 'GGCD9DAEY3M7LMRPQ96C', - 'createTime': 1698136081000, - 'countries': null, - 'standState': null, - 'standStateShow': null - }, - { - 'id': 'UWARF4EQJLVNQ9A5J29H', - 'country': null, - 'standNum': 'GB 9999-2023', - 'standName': '商-测试标准', - 'standId': 'c427b19d88374476b71e', - 'standType': 'INLAND', - 'compareBaseId': 'GGCD9DAEY3M7LMRPQ96C', - 'createTime': 1698136081000, - 'countries': null, - 'standState': null, - 'standStateShow': null - } - ], - '欧盟': [ - { - 'id': 'XL438X5H5LRUMBE49FF5', - 'country': 'EU_C', - 'standNum': 'GB 7258-20XX', - 'standName': '机动车运行安全条件', - 'standId': '738414b579b84093b151', - 'standType': 'INLAND', - 'compareBaseId': 'GGCD9DAEY3M7LMRPQ96C', - 'createTime': 1698284537000, - 'countries': null, - 'standState': null, - 'standStateShow': null - } - ], - '中国,欧盟,非洲': [ - { - 'id': 'VHBUCSFG3BW6RMNUGRA5', - 'country': 'EU_C,S9BPTW2EPF,CN', - 'standNum': 'GB 15089-2001', - 'standName': '机动车辆及其挂车分类', - 'standId': '14516a9061b745fbad71', - 'standType': 'INLAND', - 'compareBaseId': 'GGCD9DAEY3M7LMRPQ96C', - 'createTime': 1698285956000, - 'countries': null, - 'standState': null, - 'standStateShow': null - } - ] - }, - 'ranksMap': { - 'ITEM': [ - { - 'id': 'a4363725b24d46e2b985', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'proertyVal': '适用范围', - 'validFlag': '0', - 'creationTime': '2023-10-24', - 'modifyTime': '2023-10-26', - 'proertyType': 'ITEM', - 'natureList': null, - 'compareItemList': null, - 'color': 'red', - 'result': 'sdfd ', - 'orderNum': null, - 'underOrderNum': null - }, - { - 'id': '2eb67bc13f294f649e04', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'proertyVal': '定义', - 'validFlag': '0', - 'creationTime': '2023-10-24', - 'modifyTime': '2023-10-26', - 'proertyType': 'ITEM', - 'natureList': null, - 'compareItemList': null, - 'color': '', - 'result': null, - 'orderNum': null, - 'underOrderNum': null - }, - { - 'id': '8e29f388af374eaeb607', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'proertyVal': '东方红发过火', - 'validFlag': '0', - 'creationTime': '2023-10-26', - 'modifyTime': '2023-10-26', - 'proertyType': 'ITEM', - 'natureList': null, - 'compareItemList': null, - 'color': '', - 'result': null, - 'orderNum': null, - 'underOrderNum': null - } - ], - 'NATURE': [ - { - 'id': 'c918fe1cc95c4d4c9776', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'proertyVal': '章节', - 'validFlag': '0', - 'creationTime': '2023-10-26', - 'modifyTime': '2023-10-26', - 'proertyType': 'NATURE', - 'natureList': null, - 'compareItemList': null, - 'color': '', - 'result': null, - 'orderNum': null, - 'underOrderNum': null - }, - { - 'id': '58d6c194ecc44c66b0a6', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'proertyVal': '法规内容', - 'validFlag': '0', - 'creationTime': '2023-10-26', - 'modifyTime': '2023-10-26', - 'proertyType': 'NATURE', - 'natureList': null, - 'compareItemList': null, - 'color': '', - 'result': null, - 'orderNum': null, - 'underOrderNum': null - }, - { - 'id': 'd89f153e6a3e4950b46c', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'proertyVal': '但是丰东股份冻干粉大概', - 'validFlag': '0', - 'creationTime': '2023-10-26', - 'modifyTime': '2023-10-26', - 'proertyType': 'NATURE', - 'natureList': null, - 'compareItemList': null, - 'color': '', - 'result': null, - 'orderNum': null, - 'underOrderNum': null - } - ] - }, - 'list': [ - { - 'validFlag': '0', - 'creationTime': '2023-10-25', - 'modifyTime': '2023-10-25', - 'formFile': null, - 'id': '3S49DS2MCRW2LLR85ANF', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'sarId': '63e289e4dda24f90a51e', - 'natureId': '6fd7471e1f364299b8fc', - 'itemId': '2eb67bc13f294f649e04', - 'formContent': 'uj', - 'sarNumber': 'GB 11212-121212', - 'sarRegion': '', - 'compareName': null, - 'natureName': null, - 'formFileList': [] - }, - { - 'validFlag': '0', - 'creationTime': '2023-10-24', - 'modifyTime': '2023-10-24', - 'formFile': null, - 'id': '5QZFJA8RJQ67MTXRLGN2', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'sarId': '63e289e4dda24f90a51e', - 'natureId': '6fd7471e1f364299b8fc', - 'itemId': 'a4363725b24d46e2b985', - 'formContent': 'xx', - 'sarNumber': 'GB 11212-121212', - 'sarRegion': '', - 'compareName': null, - 'natureName': null, - 'formFileList': [] - }, - { - 'validFlag': '0', - 'creationTime': '2023-10-26', - 'modifyTime': '2023-10-26', - 'formFile': ',ATT_FILE_10_UJZTNK3EV4YCCFHY3BC8', - 'id': 'B2M2LAASEGPP5QRX6PLF', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'sarId': '63e289e4dda24f90a51e', - 'natureId': 'f1e39a369b5748e8bd76', - 'itemId': 'a4363725b24d46e2b985', - 'formContent': null, - 'sarNumber': 'GB 11212-121212', - 'sarRegion': '', - 'compareName': null, - 'natureName': null, - 'formFileList': [ - { - 'id': 'ATT_FILE_10_UJZTNK3EV4YCCFHY3BC8', - 'fileName': 'UJZTNK3EV4YCCFHY3BC8.png', - 'oldFileName': '42391722989afbf0579b0876cad9707.png', - 'fileSuffix': 'png', - 'filePath': '/69/27/34/', - 'validFlag': 0, - 'creationTime': 1698284432000, - 'modifyTime': 1698284432000, - 'tableName': 'ATT_FILE_10', - 'resId': null, - 'downLoadUrl': null - } - ] - }, - { - 'validFlag': '0', - 'creationTime': '2023-10-26', - 'modifyTime': '2023-10-26', - 'formFile': null, - 'id': 'KKESX8FVKZXLRU74YRFG', - 'compareId': 'GGCD9DAEY3M7LMRPQ96C', - 'sarId': '63e289e4dda24f90a51e', - 'natureId': 'c918fe1cc95c4d4c9776', - 'itemId': 'a4363725b24d46e2b985', - 'formContent': '电饭锅地方会更好v才不会v才能帮你', - 'sarNumber': 'GB 11212-121212', - 'sarRegion': '', - 'compareName': null, - 'natureName': null, - 'formFileList': [] - } - ] -} +import { getFormDictTreeList } from '../../../../api/api' export default { name: 'CustomComparisonDrawer', @@ -401,18 +179,18 @@ export default { }, validatorRules: { // 清单名称 - title: { + listName: { rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardSelect.standardName') }], validateTrigger: 'blur' }, // 涉及标准 - serialNumber: { + referenceStandard: { rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('standardSelect.standardNumber') }], validateTrigger: 'change' }, - // 文本状态 - fileType: { - rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('docTool.comparison.textStatus') }], + // 涉及国家 + referenceCountry: { + rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('docTool.comparison.textStatus') }], validateTrigger: 'change' }, // 拆分结果文件 @@ -421,26 +199,48 @@ export default { validateTrigger: 'change' } }, - isStartComparison: true, // 是否发起比对,为是的时候显示下面的内容 - isEdit: true, // 是否在编辑状态里 + isStartComparison: false, // 是否发起比对,为是的时候显示下面的内容 + isEdit: false, // 是否在编辑状态里 standardList: [], // 标准的列表 - specialtyItemList: [] // 特点的列表(三级表头) + specialtyItemList: [], // 特点的列表(三级表头) + isFirstOpenComparison: true, // 第一次打开在线比对 + countryTreeData: [] // 涉及国家数据 } }, methods: { add () { this.visible = true - this.processData(ApiData) - this.processTableData(ApiData) + this.initDictConfig() }, - edit (record) { - this.modal = Object.assign({}, record) + edit (id) { + this.visible = true + this.initDictConfig() + this.modal = { id } + this.isFirstOpenComparison = false + this.getFormData() + this.initTableData() + }, + initDictConfig () { + // 涉及国家 + getFormDictTreeList({ dictId: '1706192138039345153' }).then(res => { + if (res.success) { + this.countryTreeData = res.result || [] + } + }) }, handleCancel () { this.close() }, close () { this.visible = false + this.form.resetFields() + this.modal = {} + this.isStartComparison = false + this.isEdit = false + this.standardList = [] + this.specialtyItemList = [] + this.columns = [] + this.dataSource = [] }, /** * 导出 @@ -492,7 +292,7 @@ export default { */ viewStandardList () { console.log(this.form.getFieldValue('serialNumber')) - this.$refs.standardListDrawer.open() + this.$refs.standardListDrawer.open(this.modal.id) }, /** * 删除标准 @@ -508,7 +308,7 @@ export default { * 重新加载表格数据 */ reloadTableData () { - + this.initTableData() }, /** * 对比维护 @@ -543,7 +343,7 @@ export default { const levelTwo = [] countryStandardList.forEach((standard, standardIndex) => { const objLevelTwo = { - title: standard.standNum, + title: standard.standardNumber, children: [], width: this.specialtyItemList.length * 200 || 400 } @@ -551,7 +351,7 @@ export default { if (this.specialtyItemList && this.specialtyItemList.length > 0) { this.specialtyItemList.forEach((specialtyItem, specialtyItemIndex) => { objLevelTwo.children.push({ - dataIndex: `${standard.standNum}-${specialtyItem.id}-label`, + dataIndex: `${standard.standardNumber}-${specialtyItem.id}-label`, slots: { title: 'specialtyItem' + standardIndex + specialtyItemIndex }, width: 200, scopedSlots: { customRender: 'cell' } @@ -640,7 +440,7 @@ export default { * 比对分析结果,在末尾加一列,如果已经有了,就隐藏这列 */ handleResult () { - if (this.columns[this.columns.length - 1].dataIndex === 'color') { + if (this.columns && this.columns.length > 0 && this.columns[this.columns.length - 1].dataIndex === 'result') { this.columns.splice(this.columns.length - 1, 1) } else { this.columns.push({ @@ -651,6 +451,104 @@ export default { scopedSlots: { customRender: 'resultCell' } }) } + }, + /** + * 保存表单内容 + * 清单名称、涉及国家、是否公开三个字段 + */ + handleSaveForm () { + this.form.validateFields((errors, values) => { + if (!errors) { + this.confirmLoading = true + const formData = Object.assign(this.modal, values) + saveFormData(formData).then(res => { + if (res.success) { + this.$message.success(res.message) + this.isFirstOpenComparison = false + this.reloadTableData() + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.confirmLoading = false + }) + } + }) + }, + /** + * 切换显隐下方表格,如果是首次显示,需要保存form表单 + */ + handleSwitchChange () { + if (this.isStartComparison && this.isFirstOpenComparison) { + this.handleSaveForm() + } + }, + /** + * 获取上方表单数据,修改了标准的信息也需要调用这个方法 + */ + getFormData () { + this.confirmLoading = true + getFormDataById({ id: this.modal.id }).then(res => { + if (res.success) { + this.modal = Object.assign(this.modal, res.result || {}) + // 处理关联国家的回显 + if (this.modal.referenceCountry) { + const referenceCountryArr = this.modal.referenceCountry.split(',') + this.modal.referenceCountry = referenceCountryArr.map(tt => { + return { + value: tt + } + }) + } else { + this.modal.referenceCountry = undefined + } + this.$nextTick(() => { + this.form.setFieldsValue(this.modal) + }) + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.confirmLoading = false + }) + }, + /** + * 修改了标准,调用标准检索保存接口,成功后再次获取表单数据和表格数据 + * @param value + */ + handleStandardChange (value) { + this.confirmLoading = true + const params = this.form.getFieldsValue() + params.standardNumber = value + saveStandard(params).then(res => { + if (res.success) { + this.$message.success(res.message) + this.getFormData() + this.reloadTableData() + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.confirmLoading = false + }) + }, + /** + * 获取表格数据 + */ + initTableData () { + this.confirmLoading = true + getTableData({ id: this.modal.id }).then(res => { + if (res.success) { + // 平铺一些数据 + this.processData(res.result || {}) + // 把数据处理成表格需要的样子 + this.processTableData(res.result || {}) + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.confirmLoading = false + }) } } } @@ -732,4 +630,9 @@ export default { color: @primary-color; } } + +.submit-btn { + float: right; + margin-top: 4px; +} \ No newline at end of file diff --git a/src/views/documentTool/customComparison/modules/StandardListDrawer.vue b/src/views/documentTool/customComparison/modules/StandardListDrawer.vue index 7e5ac7c2..2e2b2fb9 100644 --- a/src/views/documentTool/customComparison/modules/StandardListDrawer.vue +++ b/src/views/documentTool/customComparison/modules/StandardListDrawer.vue @@ -41,7 +41,8 @@