Ver código fonte

提交批量撤销的代码

Lijy 8 meses atrás
pai
commit
e92c2a61d9

+ 54 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -346,7 +346,7 @@
 
         
         <!-- 审核记录弹窗 -->
-        <el-dialog :title="$t('Auditrecords')" :visible.sync="recordDialogVisible" width="1000px" :before-close="handleClose">
+        <el-dialog :title="$t('Auditrecords')" :visible.sync="recordDialogVisible" width="1200px" :before-close="handleClose">
             <div style="height: 430px">
                 <el-table :data="recordLists" style="width: 100%" height="400">
                     <el-table-column prop="userName" :label="$t('other.operator')" width="120">
@@ -359,7 +359,6 @@
                             </div>
                         </template>
                     </el-table-column>
-                    
                     <el-table-column prop="indate" :label="$t('AuditTime')" width="240"></el-table-column>
                     <el-table-column prop="result" :label="$t('Reviewtheresults')" width="120" show-overflow-tooltip></el-table-column>
                     <el-table-column prop="date" :label="$t('EmployeeDate')">
@@ -409,7 +408,7 @@
                         </template>
                     </el-table-column>
                     <el-table-column prop="projectName" :label="$t('other.project')" width="200" show-overflow-tooltip></el-table-column>
-                    <el-table-column prop="date" :label="$t('operation')" width="100">
+                    <el-table-column prop="date" :label="$t('operation')" width="180">
                         <template slot-scope="scope">
                             <div>
                                 <template v-if="scope.row.membdateList.length < 2 && scope.row.flg">
@@ -417,6 +416,7 @@
                                     <el-link type="info" v-else :underline="false">{{scope.row.membdateList[0].state == 2 ? $t('state.rejected') : $t('state.undone')}}</el-link>
                                 </template>
                                 <el-button size="mini" v-if="scope.row.membdateList.length >= 2 && scope.row.flg" @click="detailsClick(scope.row, scope.$index)">{{ $t('details') }}</el-button>
+                                <el-button size="mini" v-if="scope.row.membdateList.length >= 2 && scope.row.flg" @click="batchRevokeClick(scope.row, scope.$index)">批量撤销</el-button>
                             </div>
                         </template>
                     </el-table-column>
@@ -444,6 +444,16 @@
                 <el-button type="primary" @click="clickCancel()" :loading="undoFormLoading">{{ $t('btn.determine') }}</el-button>
             </div>
         </el-dialog>
+        <!-- 审核记录批量撤销 -->
+        <el-dialog :title="$t('defaultText.pleaseEnterTheReason')"  v-if="undoBathFormDialog" :visible.sync="undoBathFormDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
+            <div>
+                <el-input type="textarea" v-model="undoBathForm.reason" rows="2" :placeholder="$t('yourdecisiontorevoke')" />
+            </div>
+            <div slot="footer" class="dialog-footer">
+                <el-button  @click="undoBathFormDialog = false" >{{ $t('btn.cancel') }}</el-button>
+                <el-button type="primary" @click="clickBathCancel()" :loading="undoBathFormLoading">{{ $t('btn.determine') }}</el-button>
+            </div>
+        </el-dialog>
         <!-- 审核记录详情列表 -->
         <el-dialog :title="$t('Auditrecords')"  v-if="detailsDialog" :visible.sync="detailsDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
             <div>
@@ -575,7 +585,12 @@
                     reviewTableIndex: 1,
                     reviewTableSize: +(localStorage.getItem("reviewTableSize") || '50'),
                 },
-                listBackup: []
+                listBackup: [],
+                undoBathFormDialog: false,
+                undoBathForm: {
+                    reason: ''
+                },
+                undoBathFormLoading: false
             };
         },
         filters: {
@@ -586,6 +601,41 @@
             }
         },
         methods: {
+            batchRevokeClick(row, index) {
+                console.log(row, index, '<===== 点击了撤销')
+                this.undoBathForm = {
+                    reason: '',
+                    reportAuditLogId: row.id
+                }
+                this.undoBathFormDialog = true
+            },
+            clickBathCancel() {
+                this.undoBathFormLoading = true
+                this.http.post('/report/batchDenyHisReport', this.undoBathForm,
+                res => {
+                    this.undoBathFormLoading = false
+                    if (res.code == "ok") {
+                        this.$message({
+                            message: this.$t('Revocationofsuccess'),
+                            type: "success"
+                        });
+                        this.undoBathFormDialog = false
+                        this.recordList()
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.undoBathFormLoading = false
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
             viewOneReport(r) {
                 this.http.post("/report/getAuditWorkflowList", {reportId:r.id},
                     res => {