Ver Fonte

提交批量撤销的代码

Lijy há 7 meses atrás
pai
commit
6590f64765

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

@@ -424,7 +424,8 @@
                                     <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>
+                                <!-- <el-button size="mini" v-if="scope.row.membdateList.length >= 2 && scope.row.flg" @click="batchRevokeClick(scope.row, scope.$index)">批量撤销</el-button> -->
+                                <el-button size="mini" v-if="scope.row.membdateList.length >= 2 && scope.row.flg" @click="showBatchRevocationVisable(scope.row, scope.$index)">批量撤销</el-button>
                             </div>
                         </template>
                     </el-table-column>
@@ -505,6 +506,38 @@
                 <el-button type="primary" @click="approveinfun()" v-else>{{ $t('btn.determine') }}</el-button>
             </div>
         </el-dialog>
+
+        <!-- 批量撤销 -->
+        <el-dialog title="提示" :visible.sync="batchRevocationVisable" width="800px" :before-close="handleClose">
+        <div>
+            <el-table :data="batchRevocationList" style="width: 100%">
+                <el-table-column prop="userName" :label="$t('EmployeeDate')">
+                    <template slot-scope="scope">
+                        <div>
+                            <span v-if="user.userNameNeedTranslate == '1'">
+                                <TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText>
+                            </span>
+                            <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.userName}}</span>
+                            <!-- {{scope.row.userName}} -->
+                            /{{scope.row.createDate}}
+                        </div>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="date" :label="$t('operation')" width="80">
+                    <template slot-scope="scope">
+                        <div>
+                            <el-button type="warning" size="mini" @click="batchRevokeClick(scope.row)" v-if="scope.row.state == 1">{{ $t('btn.undo') }}</el-button>
+                            <!-- <div >{{scope.row.state == 2 ? '已驳回' : '已撤销'}}</div> -->
+                            <el-link type="info" v-else :underline="false">{{scope.row.state == 2 ? $t('state.rejected') : $t('state.undone')}}</el-link>
+                        </div>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="batchRevocationVisable = false">关闭</el-button>
+        </span>
+      </el-dialog>
     </div>
 </template>
 
@@ -599,7 +632,10 @@
                 undoBathForm: {
                     reason: ''
                 },
-                undoBathFormLoading: false
+                undoBathFormLoading: false,
+                batchRevocationList: [],
+                batchRevocationVisable: false,
+                batchRevocationListIndex: 0,
             };
         },
         filters: {
@@ -610,6 +646,12 @@
             }
         },
         methods: {
+            showBatchRevocationVisable(row, index) {
+                console.log(row, '<===== 点击当前撤销')
+                this.batchRevocationList = row.membdateList || []
+                this.batchRevocationListIndex = index
+                this.batchRevocationVisable = true
+            },
             batchRevokeClick(row, index) {
                 this.undoBathForm = {
                     reason: '',
@@ -617,6 +659,10 @@
                 }
                 this.undoBathFormDialog = true
             },
+            reassignValue(list) {
+                console.log(list[this.batchRevocationListIndex].membdateList || [])
+                this.batchRevocationList = list[this.batchRevocationListIndex].membdateList || []
+            },
             exportListByState() {
                 let url = '/report/exportListByState';
                 this.exportLoading = true;
@@ -648,7 +694,11 @@
             },
             clickBathCancel() {
                 this.undoBathFormLoading = true
-                this.http.post('/report/batchDenyHisReport', this.undoBathForm,
+                // this.http.post('/report/batchDenyHisReport', this.undoBathForm,
+                this.http.post('/report/denyHisReport', {
+                    reason: this.undoBathForm.reason,
+                    hisId: this.undoBathForm.reportAuditLogId
+                },
                 res => {
                     this.undoBathFormLoading = false
                     if (res.code == "ok") {
@@ -779,7 +829,7 @@
                         if(this.recordLists.length != 0){
                             this.detailsList = this.recordLists[this.idx].membdateList
                         }
-                        
+                        this.reassignValue(res.data.records)
                     } else {
                         this.$message({
                             message: res.msg,