Browse Source

优化上传PDF文件控件为上传PDF、JPG、PNG文件控件,以及相关功能整改

Rockery 3 years ago
parent
commit
bdb4fe34d1

+ 38 - 27
src/components/RocFormItemImgPdfUpload/index.vue

@@ -3,7 +3,7 @@
  * @Author: Rockery
  * @Date: 2022-02-28 11:31:41
  * @LastEditors: Rockery
- * @LastEditTime: 2022-02-28 16:19:11
+ * @LastEditTime: 2022-02-28 17:11:13
  * @FilePath: \party_construct_web\src\components\RocFormItemImgPdfUpload\index.vue
  * @Copyright: Copyright (c) 2016~2021 Rockery(1113269755@qq.com)
 -->
@@ -15,7 +15,7 @@
       class="rocformitemimgpdfupload-editmode"
     >
       <div class="rocformitemimgpdfupload-editmode-view" @click="handleViewPageCheckClick">查看</div>
-      <div class="rocformitemimgpdfupload-editmode-update" @click="handleUpdatePdfFileClick">更新</div>
+      <div v-if="isUpdate" class="rocformitemimgpdfupload-editmode-update" @click="handleUpdateImgPdfFileClick">更新</div>
       <div class="rocformitemimgpdfupload-editmode-download" @click="handleViewPageDownloadClick">下载</div>
     </div>
 
@@ -23,7 +23,8 @@
       v-else
       :key="imgPdfFileUploadKey"
       v-model="currentValue"
-      upload-file-title="本人简历(包括学历"
+      :is-disabled="isDisabled"
+      :upload-file-title="formItemLabel"
     ></roc-img-pdf-file-upload>
 
     <roc-vue-img-dialog
@@ -40,26 +41,26 @@
       :pdf-url="viewPdfFileObj.filePath"
     ></roc-vue-pdf-dialog>
 
-    <!-- 更新 PDF 文件对话框 -->
+    <!-- 更新文件对话框 -->
     <el-dialog
-      :title="updatePdfFileDialogObj.title"
-      :visible.sync="updatePdfFileDialogObj.visible"
+      :title="updateImgPdfFileDialogObj.title"
+      :visible.sync="updateImgPdfFileDialogObj.visible"
       width="600px"
     >
       <div class="updatepartydevelop-updatepdffiledialog">
         <roc-img-pdf-file-upload
-          :key="updatePdfFileDialogObj.key"
-          v-model="updatePdfFileDialogObj.fieldValue"
-          :upload-file-title="updatePdfFileDialogObj.title"
+          :key="updateImgPdfFileDialogObj.key"
+          v-model="updateImgPdfFileDialogObj.fieldValue"
+          :upload-file-title="updateImgPdfFileDialogObj.title"
         ></roc-img-pdf-file-upload>
       </div>
 
       <div slot="footer" class="dialog-footer">
-        <el-button type="rocpartyprimaryplainbtn" @click="handleUpdatePdfFileCancelClick">取 消</el-button>
+        <el-button type="rocpartyprimaryplainbtn" @click="handleUpdateImgPdfFileCancelClick">取 消</el-button>
         <el-button
           type="rocpartyprimarybtn"
-          :disabled="!updatePdfFileDialogObj.fieldValue || updatePdfFileDialogObj.fieldValue === 'ROCPDFUPLOADSELECT'"
-          @click="handleUpdatePdfFileSubmitClick"
+          :disabled="!updateImgPdfFileDialogObj.fieldValue || updateImgPdfFileDialogObj.fieldValue === 'ROCPDFUPLOADSELECT'"
+          @click="handleUpdateImgPdfFileSubmitClick"
         >确 定</el-button>
       </div>
     </el-dialog>
@@ -111,6 +112,16 @@ export default {
     imgPdfFileUploadKey: {
       type: String,
       default: ''
+    },
+    // 是否进行更新操作
+    isUpdate: {
+      type: Boolean,
+      default: false
+    },
+    // 是否禁用
+    isDisabled: {
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -125,7 +136,7 @@ export default {
         fileName: ''
       },
       imgDialogVisible: false,
-      updatePdfFileDialogObj: {
+      updateImgPdfFileDialogObj: {
         title: '',
         visible: false,
         field: '',
@@ -170,7 +181,7 @@ export default {
   },
   methods: {
     /**
-     * 编辑模式PDF文件查看按钮事件
+     * 编辑模式文件查看按钮事件
      */
     handleViewPageCheckClick() {
       if (!this.currentValue) return;
@@ -204,15 +215,15 @@ export default {
       }
     },
     /**
-     * 更新PDF文件按钮事件
+     * 更新文件按钮事件
      */
-    handleUpdatePdfFileClick() {
+    handleUpdateImgPdfFileClick() {
 
       // 判断必需参数是否有值
       if (!this.currentFormItemValue || !this.formItemField || !this.formItemLabel) return;
 
       // 组装更新对话框数据
-      this.updatePdfFileDialogObj = {
+      this.updateImgPdfFileDialogObj = {
         title: `更新${this.formItemLabel}信息`,
         visible: true,
         field: this.formItemField,
@@ -221,21 +232,21 @@ export default {
       };
     },
     /**
-     * 更新PDF文件对话框的确定按钮事件
+     * 更新文件对话框的确定按钮事件
      */
-    handleUpdatePdfFileSubmitClick() {
-      this.currentValue = this.updatePdfFileDialogObj.fieldValue;
+    handleUpdateImgPdfFileSubmitClick() {
+      this.currentValue = this.updateImgPdfFileDialogObj.fieldValue;
       this.$alert(`已确定更新${this.formItemLabel}文件,待进行保存操作!`, '提示消息', { type: 'success' });
-      this.updatePdfFileDialogObj.visible = false;
+      this.updateImgPdfFileDialogObj.visible = false;
     },
     /**
-     * 更新PDF文件对话框的取消按钮事件
+     * 更新文件对话框的取消按钮事件
      */
-    handleUpdatePdfFileCancelClick() {
-      this.updatePdfFileDialogObj.visible = false;
+    handleUpdateImgPdfFileCancelClick() {
+      this.updateImgPdfFileDialogObj.visible = false;
       this.$nextTick(() => {
-        this.updatePdfFileDialogObj = {
-          ...this.updatePdfFileDialogObj,
+        this.updateImgPdfFileDialogObj = {
+          ...this.updateImgPdfFileDialogObj,
           field: '',
           fieldValue: '',
           key: ''
@@ -243,7 +254,7 @@ export default {
       });
     },
     /**
-     * 编辑模式PDF文件下载按钮事件
+     * 编辑模式文件下载按钮事件
      */
     handleViewPageDownloadClick() {
       if (!this.currentValue) return;

+ 2 - 2
src/components/RocImgPdfFileUpload/index.vue

@@ -3,7 +3,7 @@
  * @Author: Rockery
  * @Date: 2021-12-20 09:16:41
  * @LastEditors: Rockery
- * @LastEditTime: 2022-02-28 11:22:46
+ * @LastEditTime: 2022-02-28 16:50:05
  * @FilePath: \party_construct_web\src\components\RocImgPdfFileUpload\index.vue
  * @Copyright: Copyright (c) 2016~2021 Rockery(1113269755@qq.com)
 -->
@@ -194,7 +194,7 @@ export default {
 
       this.$emit('input', response?.data?.url);
       this.isUploadSuccess = true;
-      this.$alert(`PDF${this.fileTitle}上传成功!`, '上传结果', { dangerouslyUseHTMLString: true, type: 'success' });
+      this.$alert(`${this.fileTitle}上传成功!`, '上传结果', { dangerouslyUseHTMLString: true, type: 'success' });
     },
     /**
      * PDF、JPG、PNG文件状态改变

+ 67 - 118
src/components/UpdatePartyDevelop/index.vue

@@ -3,7 +3,7 @@
  * @Author: Rockery
  * @Date: 2021-12-15 17:54:05
  * @LastEditors: Rockery
- * @LastEditTime: 2022-02-18 16:39:57
+ * @LastEditTime: 2022-02-28 17:52:23
  * @FilePath: \party_construct_web\src\components\UpdatePartyDevelop\index.vue
  * @Copyright: Copyright (c) 2016~2021 Rockery(1113269755@qq.com)
 -->
@@ -203,54 +203,32 @@
               <!-- 本人简历(包括学历) -->
               <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
                 <el-form-item label="本人简历(包括学历):" prop="resume">
-                  <div
-                    v-if="(currentOperateType === 'EDIT') && viewFullPartyInfoObj.resume"
-                    class="updatepartydevelop-viewuploadpdffile"
-                  >
-                    <div
-                      @click="handleViewPageCheckClick(formObj.formModel.resume, '党建管理-录入数据-0-本人简历(包括学历)')"
-                    >查看</div>
-                    <div
-                      class="updatepartydevelop-viewuploadpdffile-update"
-                      @click="handleUpdatePdfFileClick(formObj.formModel.resume, 'resume','更新本人简历(包括学历)信息')"
-                    >更新</div>
-                    <div
-                      @click="handleViewPageDownloadClick(formObj.formModel.resume, '党建管理-录入数据-0-本人简历(包括学历)')"
-                    >下载</div>
-                  </div>
-                  <roc-pdf-file-upload
-                    v-else
+                  <roc-form-item-img-pdf-upload
                     key="ROCPDFFILEUPLOADMYRESUMEKEY"
                     v-model="formObj.formModel.resume"
-                    upload-file-title="本人简历(包括学历"
-                  ></roc-pdf-file-upload>
+                    :operateType="currentOperateType"
+                    :form-item-value="viewFullPartyInfoObj.resume"
+                    :is-update="true"
+                    form-item-label="本人简历(包括学历)"
+                    form-item-field="resume"
+                    form-item-desc="党建管理-录入数据-0-本人简历(包括学历)"
+                  ></roc-form-item-img-pdf-upload>
                 </el-form-item>
               </el-col>
 
               <!-- 其他情况 -->
               <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
                 <el-form-item label="其他情况:" prop="other">
-                  <div
-                    v-if="(currentOperateType === 'EDIT') && viewFullPartyInfoObj.other"
-                    class="updatepartydevelop-viewuploadpdffile"
-                  >
-                    <div
-                      @click="handleViewPageCheckClick(formObj.formModel.other, '党建管理-录入数据-0-其他情况')"
-                    >查看</div>
-                    <div
-                      class="updatepartydevelop-viewuploadpdffile-update"
-                      @click="handleUpdatePdfFileClick(formObj.formModel.other, 'other','更新其他情况信息')"
-                    >更新</div>
-                    <div
-                      @click="handleViewPageDownloadClick(formObj.formModel.other, '党建管理-录入数据-0-其他情况')"
-                    >下载</div>
-                  </div>
-                  <roc-pdf-file-upload
-                    v-else
+                  <roc-form-item-img-pdf-upload
                     key="ROCPDFFILEUPLOADOTHERKEY"
                     v-model="formObj.formModel.other"
-                    upload-file-title="其他情况"
-                  ></roc-pdf-file-upload>
+                    :operateType="currentOperateType"
+                    :form-item-value="viewFullPartyInfoObj.other"
+                    :is-update="true"
+                    form-item-label="其他情况"
+                    form-item-field="other"
+                    form-item-desc="党建管理-录入数据-0-其他情况"
+                  ></roc-form-item-img-pdf-upload>
                 </el-form-item>
               </el-col>
 
@@ -382,24 +360,16 @@
                                             prop="addPartyPageFile"
                                             label-width="96px"
                                           >
-                                            <div
-                                              v-if="(currentOperateType === 'EDIT') && viewFullPartyInfoObj.addPartyPageFile"
-                                              class="updatepartydevelop-viewuploadpdffile"
-                                            >
-                                              <div
-                                                @click="handleViewPageCheckClick(formObj.formModel.addPartyPageFile, '党建管理-录入数据-1-入党申请书')"
-                                              >查看</div>
-                                              <div
-                                                @click="handleViewPageDownloadClick(formObj.formModel.addPartyPageFile, '党建管理-录入数据-1-入党申请书')"
-                                              >下载</div>
-                                            </div>
-                                            <roc-pdf-file-upload
-                                              v-else
+                                            <roc-form-item-img-pdf-upload
                                               key="ROCPDFFILEUPLOADAPPLICATIONKEY"
                                               v-model="formObj.formModel.addPartyPageFile"
+                                              :operateType="currentOperateType"
+                                              :form-item-value="viewFullPartyInfoObj.addPartyPageFile"
                                               :is-disabled="getEleIsDisabled(disabledDataObj['addPartyPageFile'])"
-                                              upload-file-title="入党申请书"
-                                            ></roc-pdf-file-upload>
+                                              form-item-label="入党申请书"
+                                              form-item-field="addPartyPageFile"
+                                              form-item-desc="党建管理-录入数据-1-入党申请书"
+                                            ></roc-form-item-img-pdf-upload>
                                           </el-form-item>
                                         </el-col>
                                       </el-row>
@@ -453,24 +423,16 @@
                                             prop="talkPageFile"
                                             label-width="96px"
                                           >
-                                            <div
-                                              v-if="(currentOperateType === 'EDIT') && viewFullPartyInfoObj.talkPageFile"
-                                              class="updatepartydevelop-viewuploadpdffile"
-                                            >
-                                              <div
-                                                @click="handleViewPageCheckClick(formObj.formModel.talkPageFile, '党建管理-录入数据-2-谈话记录')"
-                                              >查看</div>
-                                              <div
-                                                @click="handleViewPageDownloadClick(formObj.formModel.talkPageFile, '党建管理-录入数据-2-谈话记录')"
-                                              >下载</div>
-                                            </div>
-                                            <roc-pdf-file-upload
-                                              v-else
+                                            <roc-form-item-img-pdf-upload
                                               key="ROCPDFFILEUPLOADCHATHISTORYKEY"
                                               v-model="formObj.formModel.talkPageFile"
+                                              :operateType="currentOperateType"
+                                              :form-item-value="viewFullPartyInfoObj.talkPageFile"
                                               :is-disabled="getEleIsDisabled(disabledDataObj['talkPageFile'])"
-                                              upload-file-title="谈话记录"
-                                            ></roc-pdf-file-upload>
+                                              form-item-label="谈话记录"
+                                              form-item-field="talkPageFile"
+                                              form-item-desc="党建管理-录入数据-2-谈话记录"
+                                            ></roc-form-item-img-pdf-upload>
                                           </el-form-item>
                                         </el-col>
                                       </el-row>
@@ -504,24 +466,16 @@
                                             prop="cardOrRegisterBookFile"
                                             label-width="116px"
                                           >
-                                            <div
-                                              v-if="(currentOperateType === 'EDIT') && viewFullPartyInfoObj.cardOrRegisterBookFile"
-                                              class="updatepartydevelop-viewuploadpdffile"
-                                            >
-                                              <div
-                                                @click="handleViewPageCheckClick(formObj.formModel.cardOrRegisterBookFile, '党建管理-录入数据-3-身份证或户口本')"
-                                              >查看</div>
-                                              <div
-                                                @click="handleViewPageDownloadClick(formObj.formModel.cardOrRegisterBookFile, '党建管理-录入数据-3-身份证或户口本')"
-                                              >下载</div>
-                                            </div>
-                                            <roc-pdf-file-upload
-                                              v-else
+                                            <roc-form-item-img-pdf-upload
                                               key="ROCPDFFILEUPLOADIDENTITYINFOKEY"
                                               v-model="formObj.formModel.cardOrRegisterBookFile"
+                                              :operateType="currentOperateType"
+                                              :form-item-value="viewFullPartyInfoObj.cardOrRegisterBookFile"
                                               :is-disabled="getEleIsDisabled(disabledDataObj['cardOrRegisterBookFile'])"
-                                              upload-file-title="身份证或户口本"
-                                            ></roc-pdf-file-upload>
+                                              form-item-label="身份证或户口本"
+                                              form-item-field="cardOrRegisterBookFile"
+                                              form-item-desc="党建管理-录入数据-3-身份证或户口本"
+                                            ></roc-form-item-img-pdf-upload>
                                           </el-form-item>
                                         </el-col>
                                       </el-row>
@@ -619,24 +573,16 @@
                                             prop="referrePageFile"
                                             label-width="171px"
                                           >
-                                            <div
-                                              v-if="(currentOperateType === 'EDIT') && viewFullPartyInfoObj.referrePageFile"
-                                              class="updatepartydevelop-viewuploadpdffile"
-                                            >
-                                              <div
-                                                @click="handleViewPageCheckClick(formObj.formModel.referrePageFile, '党建管理-录入数据-4-推荐入党积极分子登记表')"
-                                              >查看</div>
-                                              <div
-                                                @click="handleViewPageDownloadClick(formObj.formModel.referrePageFile, '党建管理-录入数据-4-推荐入党积极分子登记表')"
-                                              >下载</div>
-                                            </div>
-                                            <roc-pdf-file-upload
-                                              v-else
-                                              key="ROCPDFFILEUPLOADACTIVISTSREGISTKEY"
+                                            <roc-form-item-img-pdf-upload
+                                              key="ROCPDFFILEUPLOADIDENTITYINFOKEY"
                                               v-model="formObj.formModel.referrePageFile"
+                                              :operateType="currentOperateType"
+                                              :form-item-value="viewFullPartyInfoObj.referrePageFile"
                                               :is-disabled="getEleIsDisabled(disabledDataObj['referrePageFile'])"
-                                              upload-file-title="推荐入党积极分子登记表"
-                                            ></roc-pdf-file-upload>
+                                              form-item-label="推荐入党积极分子登记表"
+                                              form-item-field="referrePageFile"
+                                              form-item-desc="党建管理-录入数据-4-推荐入党积极分子登记表"
+                                            ></roc-form-item-img-pdf-upload>
                                           </el-form-item>
                                         </el-col>
                                       </el-row>
@@ -707,24 +653,16 @@
                                             prop="branchPartyMeetingFile"
                                             label-width="256px"
                                           >
-                                            <div
-                                              v-if="(currentOperateType === 'EDIT') && viewFullPartyInfoObj.branchPartyMeetingFile"
-                                              class="updatepartydevelop-viewuploadpdffile"
-                                            >
-                                              <div
-                                                @click="handleViewPageCheckClick(formObj.formModel.branchPartyMeetingFile, '党建管理-录入数据-5-确定为入党积极分子的支委会会议记录')"
-                                              >查看</div>
-                                              <div
-                                                @click="handleViewPageDownloadClick(formObj.formModel.branchPartyMeetingFile, '党建管理-录入数据-5-确定为入党积极分子的支委会会议记录')"
-                                              >下载</div>
-                                            </div>
-                                            <roc-pdf-file-upload
-                                              v-else
+                                            <roc-form-item-img-pdf-upload
                                               key="ROCPDFFILEUPLOADIDENTIFYPARTYACTIVISTSKEY"
                                               v-model="formObj.formModel.branchPartyMeetingFile"
+                                              :operateType="currentOperateType"
+                                              :form-item-value="viewFullPartyInfoObj.branchPartyMeetingFile"
                                               :is-disabled="getEleIsDisabled(disabledDataObj['branchPartyMeetingFile'])"
-                                              upload-file-title="确定为入党积极分子的支委会会议记录"
-                                            ></roc-pdf-file-upload>
+                                              form-item-label="确定为入党积极分子的支委会会议记录"
+                                              form-item-field="branchPartyMeetingFile"
+                                              form-item-desc="党建管理-录入数据-5-确定为入党积极分子的支委会会议记录"
+                                            ></roc-form-item-img-pdf-upload>
                                           </el-form-item>
                                         </el-col>
 
@@ -3149,6 +3087,12 @@
         class="mr20"
         @click="handlePageCloseClick"
       >取 消</el-button>
+      <!-- <el-button
+        v-if="(currentOperateType === 'EDIT') && (currentIsOld === 1)"
+        type="rocpartyprimaryplainbtn"
+        class="mr20"
+        @click="handleCheckProcessDataIntegrityClick"
+      >检查过程与资料完整性</el-button>-->
       <el-popover placement="top" trigger="hover" title="温馨提示" width="100">
         <p>已填内容保存以后不能再修改,不符合要求的数据不保存!</p>
         <el-button
@@ -3187,7 +3131,7 @@
         <el-button type="rocpartyprimaryplainbtn" @click="handleUpdatePdfFileCancelClick">取 消</el-button>
         <el-button
           type="rocpartyprimarybtn"
-          :disabled="!updatePdfFileDialogObj.fieldValue"
+          :disabled="!updatePdfFileDialogObj.fieldValue || updatePdfFileDialogObj.fieldValue === 'ROCPDFUPLOADSELECT'"
           @click="handleUpdatePdfFileSubmitClick"
         >确 定</el-button>
       </div>
@@ -3211,7 +3155,7 @@
         <el-button type="rocpartyprimaryplainbtn" @click="handleUpdateImgFileCancelClick">取 消</el-button>
         <el-button
           type="rocpartyprimarybtn"
-          :disabled="!updateImgFileDialogObj.fieldValue"
+          :disabled="!updateImgFileDialogObj.fieldValue || updateImgFileDialogObj.fieldValue === 'ROCPDFUPLOADSELECT'"
           @click="handleUpdateImgFileSubmitClick"
         >确 定</el-button>
       </div>
@@ -3249,7 +3193,9 @@ export default {
   components: {
     'roc-pdf-file-upload': () => import('@/components/RocPdfFileUpload'),
     'roc-img-file-upload': () => import('@/components/RocImgFileUpload'),
-    'roc-vue-pdf-dialog': () => import('@/components/RocVuePdfDialog')
+    'roc-vue-pdf-dialog': () => import('@/components/RocVuePdfDialog'),
+    'roc-img-pdf-file-upload': () => import('@/components/RocImgPdfFileUpload'),
+    'roc-form-item-img-pdf-upload': () => import('@/components/RocFormItemImgPdfUpload')
   },
   props: {
     // 操作类型
@@ -3712,6 +3658,7 @@ export default {
               publicTime1Range,
               ...reqData
             } = this.formObj.formModel;
+            console.log('this.formObj.formModel===', this.formObj.formModel);
 
             // 籍贯数据
             (placeList?.length > 0) && (basicInfoReq.place = placeList.join(','));
@@ -3740,6 +3687,8 @@ export default {
               ...basicInfoReq
             };
 
+            console.log('basicInfoReq===', basicInfoReq);
+
             // 直接录入正式党员信息
             if (this.currentIsOld === 1) {
               basicInfoReq.type = 4;