Prechádzať zdrojové kódy

调整项目报告审核接口,展示形式

Lijy 3 rokov pred
rodič
commit
31bf941272

+ 26 - 13
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -218,7 +218,7 @@
                         <template slot-scope="scope">
                             <div>
                                 <el-button type="warning" size="mini" v-if="scope.row.membdateList.length < 2 && scope.row.flg" @click="undoCli(scope.row, 0)">撤销</el-button>
-                                <el-button size="mini" v-if="scope.row.membdateList.length >= 2 && scope.row.flg" @click="detailsClick(scope.row)">详情</el-button>
+                                <el-button size="mini" v-if="scope.row.membdateList.length >= 2 && scope.row.flg" @click="detailsClick(scope.row, scope.$index)">详情</el-button>
                             </div>
                         </template>
                     </el-table-column>
@@ -243,7 +243,7 @@
             </div>
             <div slot="footer" class="dialog-footer">
                 <el-button  @click="undoFormDialog = false" >取消</el-button>
-                <el-button type="primary" @click="clickCancel()">确定</el-button>
+                <el-button type="primary" @click="clickCancel()" :loading="undoFormLoading">确定</el-button>
             </div>
         </el-dialog>
         <!-- 审核记录详情列表 -->
@@ -260,7 +260,9 @@
                     <el-table-column prop="date" label="操作" width="80">
                         <template slot-scope="scope">
                             <div>
-                                <el-button type="warning" size="mini" @click="undoCli(scope.row, 1)">撤销</el-button>
+                                <el-button type="warning" size="mini" @click="undoCli(scope.row, 1)" v-if="scope.row.state == 1">撤销</el-button>
+                                <!-- <div >{{scope.row.state == 2 ? '已驳回' : '已撤销'}}</div> -->
+                                <el-link type="info" v-else :underline="false">{{scope.row.state == 2 ? '已驳回' : '已撤销'}}</el-link>
                             </div>
                         </template>
                     </el-table-column>
@@ -315,12 +317,15 @@
                 pageIndexList: 1,
                 pageSizeList: 20,
                 undoForm: {
-                    reason: '',
-                    userId: '',
-                    createDate: ''
+                    // reason: '',
+                    // userId: '',
+                    // createDate: ''
                 },
                 undoFormDialog: false,
                 detailsDialog: false,
+                idx: 0, // 详情索引
+                detailsList: [],
+                undoFormLoading: false
             };
         },
         filters: {
@@ -331,14 +336,17 @@
             }
         },
         methods: {
-            detailsClick(item) {
+            detailsClick(item, i) {
                 this.detailsDialog = true
                 this.detailsList = item.membdateList
+                this.idx = i
             },
             // 审核记录撤销点击确定
             clickCancel() {
+                this.undoFormLoading = true
                 this.http.post('/report/denyHisReport', this.undoForm,
                 res => {
+                    this.undoFormLoading = false
                     if (res.code == "ok") {
                         this.$message({
                             message: '撤销成功',
@@ -354,6 +362,7 @@
                     }
                 },
                 error => {
+                    this.undoFormLoading = false
                     this.$message({
                         message: error,
                         type: "error"
@@ -363,13 +372,16 @@
             undoCli(item, i) {
                 console.log(item)
                 this.undoFormDialog = true
+                this.undoForm = {}
                 this.undoForm.reason = ''
-                this.undoForm.userId = item.userId
-                if(i == 0) {    
-                    this.undoForm.createDate = item.indate.split(' ')[0]
-                } else {
-                    this.undoForm.createDate = item.createDate
-                }
+                this.undoForm.hisId = item.id
+                this.ioss = i
+                // if(i == 0) {    
+                //     this.undoForm.createDate = item.indate.split(' ')[0]
+                //     this.undoForm.userId = item.userId
+                // } else {
+                //     this.undoForm.hisId = item.id
+                // }
             },
             // 获取审核记录
             recordList() {
@@ -387,6 +399,7 @@
                         }
                         this.recordLists = res.data.records
                         this.totals = res.data.total
+                        this.detailsList = this.recordLists[this.idx].membdateList
                     } else {
                         this.$message({
                             message: res.msg,