Merge remote-tracking branch 'origin/pet' into pet
						commit
						980aa64706
					
				|  | @ -33,25 +33,46 @@ | |||
|             <el-form-item :rules="form.IS_NORMAL =='1' ?formRule.RECTIFICATIONTIME:[{required: false}]" label="整改时间" prop="RECTIFICATIONTIME"> | ||||
|               <el-date-picker v-model="form.RECTIFICATIONTIME" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="选择日期" /> | ||||
|             </el-form-item> | ||||
|             <!--            <el-form-item :rules="[{required: true}]" label="整改后图片" label-width="100px">--> | ||||
|             <!--              <el-upload--> | ||||
|             <!--                ref="zhenggaiupload"--> | ||||
|             <!--                :class="{hide:hideUpload}"--> | ||||
|             <!--                :file-list="rectify_files"--> | ||||
|             <!--                :on-remove="handleRemove"--> | ||||
|             <!--                :on-change="handleChangeIMG"--> | ||||
|             <!--                :limit="4"--> | ||||
|             <!--                :on-preview="handlePictureCardPreview"--> | ||||
|             <!--                :before-upload="beforeFileUpload"--> | ||||
|             <!--                :auto-upload="false"--> | ||||
|             <!--                class="avatar-uploader"--> | ||||
|             <!--                action="#"--> | ||||
|             <!--                accept=".jpg,.jpeg,.png"--> | ||||
|             <!--                list-type="picture-card">--> | ||||
|             <!--                <i class="el-icon-plus" />--> | ||||
|             <!--              </el-upload>--> | ||||
|             <!--              <el-dialog :visible.sync="dialogImageVisible">--> | ||||
|             <!--                <img :src="dialogImageUrl" width="100%" alt="">--> | ||||
|             <!--              </el-dialog>--> | ||||
|             <!--            </el-form-item>--> | ||||
|             <el-form-item :rules="[{required: true}]" label="整改后图片" label-width="100px"> | ||||
|               <el-upload | ||||
|                 ref="zhenggaiupload" | ||||
|                 :class="{hide:hideUpload}" | ||||
|                 :on-remove="handleRemove" | ||||
|                 :on-change="handleChangeIMG" | ||||
|                 :limit="4" | ||||
|                 :on-preview="handlePictureCardPreview" | ||||
|                 :before-upload="beforeFileUpload" | ||||
|                 :auto-upload="false" | ||||
|                 class="avatar-uploader" | ||||
|                 action="#" | ||||
|                 accept=".jpg,.jpeg,.png" | ||||
|                 list-type="picture-card"> | ||||
|                 <i class="el-icon-plus" /> | ||||
|               </el-upload> | ||||
|               <el-dialog :visible.sync="dialogImageVisible"> | ||||
|                 <img :src="dialogImageUrl" width="100%" alt=""> | ||||
|               </el-dialog> | ||||
|               <div class="parentBox"> | ||||
|                 <el-upload | ||||
|                   :class="{hideShow: hideUpload}" | ||||
|                   :multiple="true" | ||||
|                   :on-exceed="onExceed" | ||||
|                   :on-remove="handleRemove" | ||||
|                   :limit="limit" | ||||
|                   :before-upload="beforeUpload" | ||||
|                   :http-request="uploadFiles" | ||||
|                   :on-preview="handlePictureCardPreview" | ||||
|                   action="" | ||||
|                   list-type="picture-card"> | ||||
|                   <i class="el-icon-plus"/> | ||||
|                 </el-upload> | ||||
|                 <el-dialog :visible.sync="dialogVisible"> | ||||
|                   <img :src="imgUrl" width="100%"> | ||||
|                 </el-dialog> | ||||
|               </div> | ||||
|             </el-form-item> | ||||
|             <div v-if="pd.ISCONFIRM=='0'"> | ||||
|               <div class="form-flex"> | ||||
|  | @ -194,11 +215,13 @@ export default { | |||
|         INVESTMENT_FUNDS: '', // 投入资金 | ||||
|         RECTIFICATIONTIME: ''// 整改时间 | ||||
|       }, | ||||
|       imgUrl: '', | ||||
|       rectify_files: [], | ||||
|       hideUpload: false, // 整改照片 | ||||
|       dialogImageVisible: false, // 放大照片的显示和隐藏 | ||||
|       dialogImageUrl: '', // 照片的地址 | ||||
|       scheme_files: [], // 整改方案图片 | ||||
|       temporaryFilePath: [], | ||||
|       formRule: { | ||||
|         RECTIFICATIONDEPT: [{ required: true, message: '请选择整改部门', trigger: 'blur' }], | ||||
|         RECTIFICATIONOR: [{ required: true, message: '请选择整改人', trigger: 'blur' }], | ||||
|  | @ -252,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', | ||||
|  | @ -414,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' | ||||
|  | @ -541,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( | ||||
|  | @ -603,6 +682,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 +764,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' | ||||
|     } | ||||
|  |  | |||
|  | @ -350,7 +350,7 @@ export default { | |||
|           }) | ||||
|           this.listLoading = false | ||||
|           this.varList = [] | ||||
|           this.listQuery.page = 1 | ||||
|           // this.listQuery.page = 1 | ||||
|           this.getList() | ||||
|         }).catch((e) => { | ||||
|           this.listLoading = false | ||||
|  | @ -379,7 +379,7 @@ export default { | |||
|           }) | ||||
|           this.listLoading = false | ||||
|           this.varList = [] | ||||
|           this.listQuery.page = 1 | ||||
|           // this.listQuery.page = 1 | ||||
|           this.getList() | ||||
|         }).catch((e) => { | ||||
|           this.listLoading = false | ||||
|  |  | |||
|  | @ -27,20 +27,23 @@ | |||
|             <el-col :span="8"> | ||||
|               <el-form-item label="企业监督部门" class="is-required" prop="DEPARTMENT_ID"> | ||||
|                 <Treeselect | ||||
|                   v-if="updateSuperviseValue" | ||||
|                   :multiple="true" | ||||
|                   :flat="true" | ||||
|                   :default-expand-level="1" | ||||
|                   :options="treeDataDept" | ||||
|                   :normalizer="normalizer2" | ||||
|                   :normalizer="normalizer" | ||||
|                   v-model="form.DEPARTMENT_ID" | ||||
|                   placeholder="请选择部门" | ||||
|                   no-options-text="暂无数据" | ||||
|                   no-children-text="暂无数据" | ||||
|                   style="width: 100%;" | ||||
|                   @select="handleSuperviseSelect" | ||||
|                   @deselect="handleSuperviseRemove" | ||||
| 
 | ||||
|                 /> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
| 
 | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item prop="COMPETENT_DEPT_ID" label="企业主管部门:"> | ||||
|                 <SelectTree | ||||
|  | @ -261,6 +264,7 @@ export default { | |||
|   data() { | ||||
|     return { | ||||
|       updateValue: true, | ||||
|       updateSuperviseValue: true, | ||||
|       selectUsers: [], // 防止报错,参数无用 | ||||
|       chooseUserList: [], | ||||
|       punishThePerson: [], | ||||
|  | @ -1205,8 +1209,51 @@ export default { | |||
|       }).catch((e) => { | ||||
|       }) | ||||
|     }, | ||||
|     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 | ||||
|       }) | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue