Parcourir la source

feat(data-fill): 添加一键重签功能

duy il y a 1 mois
Parent
commit
200d26909c
2 fichiers modifiés avec 73 ajouts et 2 suppressions
  1. 7 1
      src/api/modules/data-fill/query.js
  2. 66 1
      src/views/data-fill/query.vue

+ 7 - 1
src/api/modules/data-fill/query.js

@@ -155,7 +155,13 @@ export default {
             data: form,
         })
     },
-    
+    async reSigningEVisa1(form) {
+        return HcApi({
+            url: '/api/blade-business/task/reSigningEVisa1',
+            method: 'post',
+            data: form,
+        })
+    },
     async reSigningEVisaStatus0(form) {
         return HcApi({
             url: '/api/blade-business/task/reSigningEVisaStatus0',

+ 66 - 1
src/views/data-fill/query.vue

@@ -111,6 +111,7 @@
                             </el-button>
                         </HcTooltip>
                         <el-button :disabled="tableCheckedKeys.length <= 0" :loading="signLoading" hc-btn type="primary" @click="resignClick">  <HcIcon name="repeat" />re-sign</el-button>
+                        <el-button :disabled="tableCheckedKeys.length <= 0" :loading="signLoading" hc-btn type="warning" @click="resignClick1">  <HcIcon name="repeat" />一键重签</el-button>
                         <HcTooltip keys="save_agin">
                             <el-button
                                 :disabled="tableCheckedKeys.length <= 0" :loading="saveAginLoading" hc-btn
@@ -304,7 +305,20 @@
                 </el-radio-group>
             </div>
         </hc-new-dialog>
-
+        <!-- 一键重签弹窗1 -->
+        <hc-new-dialog v-model="resignModal1" title="一键重签" widths="38rem" :loading="signLoading1" @close="cancelresign1" @save="signClick1">
+            <div>
+                <el-radio-group v-model="resignModalRadio1">
+                    <el-radio :value="0">全部电签</el-radio>
+                    <el-radio :value="1" :disabled="tableCheckedKeys.length > 1">部分电签</el-radio>
+                </el-radio-group>
+            </div>
+            <div v-if="resignModalRadio1 === 1">
+                <el-checkbox-group v-model="checkTaskUserIds">
+                    <el-checkbox v-for="item in tableCheckedKeys[0].waitingUserList" :key="item.id" :label="item.waitingUserName" :value="item.id" />
+                </el-checkbox-group>
+            </div>
+        </hc-new-dialog>
         <!-- 重置文件题名弹窗 -->
         <hc-new-dialog v-model="resignTitleModal" title="重置题名" widths="38rem" :loading="resignTitleSaveLoad" @save="resignTitleSave">
             <div>
@@ -1372,6 +1386,57 @@ const getWbsNodeTypeApi = async () => {
     }
     nodeTypeData.value = newArr
 }
+//一键重签1
+const resignModal1 = ref(false)
+const resignModalRadio1 = ref(0)
+const resignClick1 = ()=>{
+     const rows = tableCheckedKeys.value
+    if (rows.length <= 0) {
+        window.$message?.warning('勾选错误!只能操作待审批和已审批数据')
+        return
+    }
+    console.log(tableCheckedKeys.value, 'tableCheckedKeys.value')
+    
+
+    resignModal1.value = true
+}
+const signLoading1 = ref(false)
+const cancelresign1 = ()=>{
+    resignModalRadio1.value = 0
+    resignModal1.value = false
+}
+
+const signClick1 = async () => {
+    const rows = tableCheckedKeys.value
+    //获取任务id
+    const taskIds = arrToKey(rows, 'taskId')
+    const idsArr = taskIds.split(',')
+    let isCan = idsArr.some(ele=>!ele)
+  
+    if (isCan) {
+        window.$message?.warning('参数异常,暂不支持该操作')
+        return
+    }
+    //发起请求
+    signLoading1.value = true
+    const { error, code, msg } = await queryApi.reSigningEVisa1({
+        userIds: checkTaskUserIds.value,
+        taskIds: taskIds,
+      
+   
+    })
+    //处理数据
+    signLoading1.value = false
+
+    if (!error && code === 200) {
+        window.$message?.success(msg ?? '提交成功,请请耐心等待重签,可继续操作其它的功能。')
+        getTableData().then()
+    } else {
+        window.$message?.error(msg ?? '操作失败')
+    }
+    resignModal.value = false
+}
+const checkTaskUserIds = ref([])
 </script>
 
 <style lang="scss" scoped>