From 6304bcfcebdc40c1e092fe13bdd8403a4728585a Mon Sep 17 00:00:00 2001 From: huangyuxuan Date: Sat, 14 Sep 2024 09:31:54 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[BUG=E4=BF=AE=E5=A4=8D](hyx=5F2024-9-11)=20?= =?UTF-8?q?=E9=87=8D=E7=82=B9=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E7=A8=8B=E4=BF=A1=E6=81=AF=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=BC=81=E4=B8=9A=E7=9B=91=E7=9D=A3=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=83=A8=E9=97=A8=E5=B0=86=E5=AD=90=E7=B1=BB?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E8=BF=9E=E5=90=8C=E5=8B=BE=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/corpInfo/user/components/list.vue | 2 +- .../hidden/rectify/components/change.vue | 37 ++++++++++++ .../outsourced/components/edit.vue | 58 ++++++++++++++++++- .../archive/components/accept.vue | 2 +- .../inspected/components/list.vue | 2 +- .../inspection/components/list.vue | 2 +- 6 files changed, 97 insertions(+), 6 deletions(-) diff --git a/src/views/corpInfo/user/components/list.vue b/src/views/corpInfo/user/components/list.vue index 90422c7..0509a79 100644 --- a/src/views/corpInfo/user/components/list.vue +++ b/src/views/corpInfo/user/components/list.vue @@ -798,7 +798,7 @@ export default { SHIFTDUTYTWO: this.SHIFTDUTYTWO, IS_HAZARDCONFIRMER: this.IS_HAZARDCONFIRMER, USER_ID: this.USER_ID, - ISPUSH:'2' + ISPUSH: '2' } ).then((data) => { this.listLoading = false diff --git a/src/views/hidden/rectify/components/change.vue b/src/views/hidden/rectify/components/change.vue index c80f0f7..28fd353 100644 --- a/src/views/hidden/rectify/components/change.vue +++ b/src/views/hidden/rectify/components/change.vue @@ -37,6 +37,7 @@ + 上传到服务器
@@ -199,6 +201,7 @@ export default { dialogImageVisible: false, // 放大照片的显示和隐藏 dialogImageUrl: '', // 照片的地址 scheme_files: [], // 整改方案图片 + temporaryFilePath: '', formRule: { RECTIFICATIONDEPT: [{ required: true, message: '请选择整改部门', trigger: 'blur' }], RECTIFICATIONOR: [{ required: true, message: '请选择整改人', trigger: 'blur' }], @@ -603,6 +606,7 @@ export default { } todata.append('FOREIGN_KEY', this.HIDDEN_ID) todata.append('TYPE', 8) + todata.append('temporaryFilePath', this.temporaryFilePath) upload( '/imgfiles/add', todata @@ -684,6 +688,39 @@ export default { this.scheme_files.push(file) } }, + submitUpload() { + var _this = this + this.$refs.zhenggaiupload.submit() + var todata = new FormData() + for (var i = 0; i < _this.rectify_files.length; i++) { + if (_this.rectify_files[i]) { + todata.append('FFILE', _this.rectify_files[i]) + } + } + console.log(todata) + upload( + '/mfolder/upLoadTemporary', + todata + ).then((data) => { + if (data.result == 'success') { + this.$message({ + message: '保存成功', + type: 'success' + }) + this.loading = false + this.temporaryFilePath = data.temporaryFilePath + } else { + this.$message({ + message: data.exception, + type: 'error' + }) + this.loading = false + } + }).catch((e) => { + this.listLoading = false + this.loading = false + }) + }, back() { this.$parent.activeName = 'List' } diff --git a/src/views/keyprojects/outsourced/components/edit.vue b/src/views/keyprojects/outsourced/components/edit.vue index bb39f05..7d1fbc6 100644 --- a/src/views/keyprojects/outsourced/components/edit.vue +++ b/src/views/keyprojects/outsourced/components/edit.vue @@ -27,20 +27,23 @@ - { }) }, + pullSelectedSuperviseNodes(selectedItems) { + if (selectedItems.nodes && selectedItems.nodes.length > 0) { + for (let i = 0; i < selectedItems.nodes.length; i++) { + if (!this.form.DEPARTMENT_ID.includes(selectedItems.nodes[i].id)) { + this.form.DEPARTMENT_ID.push(selectedItems.nodes[i].id) + } + this.pullSelectedSuperviseNodes(selectedItems.nodes[i]) + } + } + console.log('this.form.DEPARTMENT_ID====' + this.form.DEPARTMENT_ID) + }, + handleSuperviseSelect(selectedItems) { + // 选择父节点时同时勾选全部子节点 + if (!this.form.DEPARTMENT_ID.includes(selectedItems.id)) { + this.form.DEPARTMENT_ID.push(selectedItems.id) + } + this.pullSelectedSuperviseNodes(selectedItems) + this.onClickSupervise() + console.log('this.form.DEPARTMENT_ID==2==' + this.form.DEPARTMENT_ID) + }, + + // 将选中项的子节点全部移除 + removeSuperviseSelectedNodes(selectedItems) { + if (selectedItems.nodes && selectedItems.nodes.length > 0) { + for (let i = 0; i < selectedItems.nodes.length; i++) { + if (this.form.DEPARTMENT_ID.includes(selectedItems.nodes[i].id)) { + this.form.DEPARTMENT_ID.splice(this.form.DEPARTMENT_ID.indexOf(selectedItems.nodes[i].id), 1) + } + this.removeSuperviseSelectedNodes(selectedItems.nodes[i]) + } + } + }, + // 移除选中项时触发的事件 + handleSuperviseRemove(selectedItems) { + // 移除选中项时同时移除全部子节点 + if (this.form.DEPARTMENT_ID.includes(selectedItems.id)) { + this.form.DEPARTMENT_ID.splice(this.form.DEPARTMENT_ID.indexOf(selectedItems.id), 1) + } + this.removeSuperviseSelectedNodes(selectedItems) + this.onClickSupervise() + }, + // 将树节点的子节点全部添加到数组中 pullSelectedNodes(selectedItems) { + console.log(selectedItems) if (selectedItems.nodes && selectedItems.nodes.length > 0) { for (let i = 0; i < selectedItems.nodes.length; i++) { if (!this.form.INVOLVING_CORPS_DEPART_ID.includes(selectedItems.nodes[i].id)) { @@ -1215,6 +1262,7 @@ export default { this.pullSelectedNodes(selectedItems.nodes[i]) } } + console.info('this.form.INVOLVING_CORPS_DEPART_ID========' + this.form.INVOLVING_CORPS_DEPART_ID) }, // 选择项时触发的事件 handleSelect(selectedItems) { @@ -1250,6 +1298,12 @@ export default { this.$nextTick(() => { this.updateValue = true }) + }, + onClickSupervise() { + this.updateSuperviseValue = false + this.$nextTick(() => { + this.updateSuperviseValue = true + }) } } } diff --git a/src/views/safetyenvironmental/archive/components/accept.vue b/src/views/safetyenvironmental/archive/components/accept.vue index a2ec907..3ba16b5 100644 --- a/src/views/safetyenvironmental/archive/components/accept.vue +++ b/src/views/safetyenvironmental/archive/components/accept.vue @@ -595,7 +595,7 @@ export default { this.$refs.form.validate(valid => { if (valid) { requestFN( - '/safetyenvironmental/V2/finalcheck', + '/safetyenvironmental/finalcheck', { HIDDEN_ID: this.HIDDEN_ID, FINAL_CHECKDESCR: this.form.FINAL_CHECKDESCR, diff --git a/src/views/safetyenvironmental/inspected/components/list.vue b/src/views/safetyenvironmental/inspected/components/list.vue index a2dfef5..ee159b8 100644 --- a/src/views/safetyenvironmental/inspected/components/list.vue +++ b/src/views/safetyenvironmental/inspected/components/list.vue @@ -330,7 +330,7 @@ export default { hiddenCount(INSPECTION_ID) { this.listLoading = true requestFN( - '/safetyenvironmental/V2/hiddencount', + '/safetyenvironmental/hiddencount', { INSPECTION_ID: INSPECTION_ID } diff --git a/src/views/safetyenvironmental/inspection/components/list.vue b/src/views/safetyenvironmental/inspection/components/list.vue index 4389bb3..7d38400 100644 --- a/src/views/safetyenvironmental/inspection/components/list.vue +++ b/src/views/safetyenvironmental/inspection/components/list.vue @@ -471,7 +471,7 @@ export default { }).then(() => { this.listLoading = true requestFN( - '/safetyenvironmental/V2/hide', + '/safetyenvironmental/hide', { INSPECTION_ID: id, hide: '1' From 248ae576a1f82645c79ad257ba51cb02a6c3567e Mon Sep 17 00:00:00 2001 From: huangyuxuan Date: Wed, 18 Sep 2024 10:59:19 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[=E6=96=B0=E5=A2=9E=E6=B5=81=E7=A8=8B](hyx?= =?UTF-8?q?=5F2024-9-11)=20=20-=20=E6=96=B0=E5=A2=9E=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E7=AB=AF=E5=AE=89=E5=85=A8=E7=8E=AF=E4=BF=9D=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=90=8E=E4=B8=89=E7=AB=AF=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=20=20-=20=E9=9A=90=E6=82=A3=E6=95=B4=E6=94=B9=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=9B=BE=E7=89=87=E5=88=B0=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=96=B0=E4=B8=8A=E4=BC=A0=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hidden/rectify/components/change.vue | 130 ++++++++-- .../archive/components/info.vue | 2 +- .../inspection/components/add.vue | 241 +++++++++++++----- .../inspection/components/info.vue | 2 +- .../inspection/components/list.vue | 4 +- 5 files changed, 291 insertions(+), 88 deletions(-) diff --git a/src/views/hidden/rectify/components/change.vue b/src/views/hidden/rectify/components/change.vue index 28fd353..85c4268 100644 --- a/src/views/hidden/rectify/components/change.vue +++ b/src/views/hidden/rectify/components/change.vue @@ -33,28 +33,47 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - +
+ + + + + + +
- 上传到服务器
@@ -196,12 +215,13 @@ export default { INVESTMENT_FUNDS: '', // 投入资金 RECTIFICATIONTIME: ''// 整改时间 }, + imgUrl: '', rectify_files: [], hideUpload: false, // 整改照片 dialogImageVisible: false, // 放大照片的显示和隐藏 dialogImageUrl: '', // 照片的地址 scheme_files: [], // 整改方案图片 - temporaryFilePath: '', + temporaryFilePath: [], formRule: { RECTIFICATIONDEPT: [{ required: true, message: '请选择整改部门', trigger: 'blur' }], RECTIFICATIONOR: [{ required: true, message: '请选择整改人', trigger: 'blur' }], @@ -255,6 +275,53 @@ export default { this.getEditMyInfo() }, methods: { + uploadFiles(file) { + // 调用文件大小校验方法 + if (this.beforeUpload(file.file)) { + this.formData = new FormData() + this.formData.append('FFILE', file.file) + // 请求接口 + upload( + '/mfolder/upLoadTemporary', + this.formData + ).then((data) => { + if (data.result == 'success') { + this.$message({ + message: '保存成功', + type: 'success' + }) + this.loading = false + this.temporaryFilePath.push(data.temporaryFilePath) + console.info('this.temporaryFilePath========' + this.temporaryFilePath) + } else { + this.$message({ + message: data.exception, + type: 'error' + }) + this.loading = false + } + }).catch((e) => { + this.listLoading = false + this.loading = false + }) + } + }, + // 文件大小校验 + beforeUpload(file) { + if (file.size > 10 * 1024 * 1024) { + this.$message('文件过大,请上传小于10MB的文件〜') + return false + } + return true + }, + // 删除图片 + imageRemove() { + this.imgUrl = '' + this.$message({ + message: '删除图片成功', + type: 'success' + }) + }, getEditMyInfo: function() { requestFN( '/user/goEditMyInfo', @@ -417,7 +484,8 @@ export default { }, saveRectify() { // 正常整改 this.loading = true - if (this.$refs.zhenggaiupload.uploadFiles.length < 1) { + // if (this.$refs.zhenggaiupload.uploadFiles.length < 1) { + if (this.temporaryFilePath.length < 1) { this.$message({ message: '请上传整改后照片', type: 'error' @@ -544,16 +612,24 @@ export default { text: '加载中......', background: 'rgba(0,0,0,0.5)' }) - this.$refs.zhenggaiupload.submit() + // this.$refs.zhenggaiupload.submit() var todata = new FormData() - for (var i = 0; i < _this.rectify_files.length; i++) { - if (_this.rectify_files[i]) { - todata.append('FFILE', _this.rectify_files[i]) + for (var i = 0; i < _this.temporaryFilePath.length; i++) { + if (_this.temporaryFilePath[i]) { + todata.append('temporaryFilePath', _this.temporaryFilePath[i]) } } - if (!todata.get('FFILE')) { + if (!todata.get('temporaryFilePath')) { return } + // for (var i = 0; i < _this.rectify_files.length; i++) { + // if (_this.rectify_files[i]) { + // todata.append('FFILE', _this.rectify_files[i]) + // } + // } + // if (!todata.get('FFILE')) {f + // return + // } todata.append('FOREIGN_KEY', this.HIDDEN_ID) todata.append('TYPE', 4) upload( diff --git a/src/views/safetyenvironmental/archive/components/info.vue b/src/views/safetyenvironmental/archive/components/info.vue index cdc7b26..c0c30af 100644 --- a/src/views/safetyenvironmental/archive/components/info.vue +++ b/src/views/safetyenvironmental/archive/components/info.vue @@ -243,7 +243,7 @@ export default { getData() { return new Promise((resolve) => { requestFN( - '/safetyenvironmental/goShow', + '/safetyenvironmental/V2/goShow', { INSPECTION_ID: this.$parent.INSPECTION_ID } diff --git a/src/views/safetyenvironmental/inspection/components/add.vue b/src/views/safetyenvironmental/inspection/components/add.vue index 610d76d..c809ad0 100644 --- a/src/views/safetyenvironmental/inspection/components/add.vue +++ b/src/views/safetyenvironmental/inspection/components/add.vue @@ -13,16 +13,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -33,26 +33,46 @@ :props="defaultProps" v-model="form.INSPECTED_DEPARTMENT_ID" placeholder="请选择被检查单位" - style="width: 300px" /> + style="width: 300px"/> - + - + - + - + + children-name="nodes"/> - + - + - 检查人员 添加 - + 检查人员 + 添加 + +
@@ -95,26 +130,60 @@ - - + + - +
- 检查情况 添加 - + 检查情况 + 添加 + +
- - + +
- 发现问题 添加 + 发现问题 + 添加 +
@@ -125,11 +194,22 @@ @@ -145,9 +225,15 @@ - + - + - + - {{ hiddenPartType === 'select' ? '输入' : '选择' }} + placeholder="请选择"/> + {{ + hiddenPartType === 'select' ? '输入' : '选择' + }} + @@ -201,12 +294,12 @@ :canparent="false" children-name="nodes" style="width: 100%;" - placeholder="请选择" /> + placeholder="请选择"/> - + + @focus="chooseMap"/> + @focus="chooseMap"/> 位置定位 @@ -237,7 +330,7 @@ - + - + @@ -292,7 +385,7 @@ multiple accept=".jpg,.jpeg,.png" list-type="picture-card"> - + * 最多只能上传四张图片 @@ -304,13 +397,17 @@
-
+
- +
@@ -337,8 +434,17 @@ - - + + @@ -373,7 +479,7 @@