linyanfei 3 år sedan
förälder
incheckning
322a505c33

+ 10 - 0
shanXiPlatform/src/api/branchoff/index.js

@@ -29,6 +29,7 @@ export function  getpointll(homeType , depotId) {
29 29
     method: 'get'
30 30
   })
31 31
 }
32
+//异常粮情省图的table
32 33
 export function  getyclq( data  ) {
33 34
   return request({              
34 35
     url: `/csc-szls-business/grainConditionRecord/authority/getGrainErrorCount`,
@@ -36,6 +37,15 @@ export function  getyclq( data  ) {
36 37
     data : data
37 38
   })
38 39
 }
40
+//异常粮情库图的table
41
+export function  getyclqk( data  ) {
42
+  return request({              
43
+    url: `/csc-szls-business/grainConditionRecord/authority/getGrainErrorHouseList`,
44
+    method: 'post',
45
+    data : data
46
+  })
47
+}
48
+
39 49
 //异常粮情折线图
40 50
 export function  getzxt( depotId) {
41 51
   return request({

+ 36 - 10
shanXiPlatform/src/api/grainCheck/index.js

@@ -11,14 +11,22 @@ export function getNewGrainInfo(data) {
11 11
   }
12 12
 
13 13
 //  获取最全粮情信息
14
-export function getAllPages(data) {
14
+/* export function getAllPages(data) {
15 15
     return request({
16 16
       url: `csc-szls-business/grainConditionRecord/authority/getPage`,
17 17
       method: 'post',
18 18
       data
19
+
19 20
     })
20
-  }
21
+  } */
22
+  export function getAllPages(params) {
23
+    return request({
24
+      url: `csc-szls-business/grainConditionRecord/authority/getPage`,
25
+      method: 'get',
26
+      params
21 27
 
28
+    })
29
+  }
22 30
 // 新增时初始化页面数据
23 31
 export function getAddInfo(data) {
24 32
   return request({
@@ -38,11 +46,11 @@ export function addInfo(data) {
38 46
 }
39 47
 
40 48
   //查询
41
-export function queryGrainInfo(data) {
49
+export function queryGrainInfo(params) {
42 50
   return request({
43 51
     url: `csc-szls-business/grainConditionRecord/authority/getPage`,
44
-    method: 'post',
45
-    data
52
+    method: 'get',
53
+    params
46 54
   })
47 55
 }
48 56
 
@@ -51,7 +59,7 @@ export function queryGrainInfo(data) {
51 59
 //删除
52 60
 export function deleteGrainInfo(id) {
53 61
   return request({
54
-    url: `csc-szls-business/grainConditionRecord/authority_button/deleteById/${id}`,
62
+    url: `csc-szls-business/grainConditionRecord/authority/deleteById/${id}`,
55 63
     method: 'delete',
56 64
     // id
57 65
   })
@@ -60,6 +68,7 @@ export function deleteGrainInfo(id) {
60 68
 //修改
61 69
 export function editGrainInfo(data) {
62 70
   return request({
71
+    // url: `csc-szls-business/grainConditionRecord/authority_button/update`,
63 72
     url: `csc-szls-business/grainConditionRecord/authority_button/update`,
64 73
     method: 'post',
65 74
     data
@@ -69,11 +78,12 @@ export function editGrainInfo(data) {
69 78
 //查看
70 79
 export function checkGrainInfo(id) {
71 80
   return request({
72
-    url: `csc-szls-business/grainConditionRecord/authority/getById/${id}`,
81
+    url: `csc-szls-business/grainRecordChild/authority/getById/${id}`,
73 82
     method: 'get'
74 83
   })
75 84
 }
76 85
 
86
+
77 87
 //处理待办项
78 88
 export function haveDone(id,auditState) {
79 89
   return request({
@@ -88,7 +98,23 @@ export function haveDone1(userId,type,depotId,houseId,auditState) {
88 98
     method: 'get'
89 99
   })
90 100
 }
91
-//
101
+
102
+// 重构 --- 字典表查询(根据parentId查询)
103
+export function getGrainItems(parentId) {
104
+  return request({
105
+    // url: `/csc-szls-system-manage/basicsEnum/authority/getEnumAll`,
106
+    url: `/csc-szls-system-manage/basicsEnum/authority/getOnlyChildData/${parentId}`,
107
+    method: 'get',
108
+  })
109
+}
110
+
111
+//查询所有字典项 /basicsEnum/authority/getEnumAll
112
+export function getGrainAll() {
113
+  return request({
114
+     url: `/csc-szls-system-manage/basicsEnum/authority/getEnumAll`,
115
+    method: 'get',
116
+  })
117
+}
92 118
 //获取当前时间
93 119
 export function getDateTimeNow(){
94 120
   var time = new Date();
@@ -97,9 +123,9 @@ export function getDateTimeNow(){
97 123
 
98 124
   var hour = ("0" + time.getHours()).slice(-2)
99 125
   var minute = ("0" + time.getMinutes()).slice(-2)
100
-  // var second = ("0" + time.getSeconds()).slice(-2)
126
+  var second = ("0" + time.getSeconds()).slice(-2)
101 127
 
102
-  var today = time.getFullYear() + "-" + (month) + "-" + (day) + " " + (hour) + ":" + (minute)
128
+  var today = time.getFullYear() + "-" + (month) + "-" + (day) + " " + (hour) + ":" + (minute)+ ":" + (second)
103 129
   return today
104 130
 }
105 131
 

+ 10 - 10
shanXiPlatform/src/api/sendMessageSocket.js

@@ -21,7 +21,7 @@ export function newWebSocket(uId,isclear){
21 21
     }
22 22
     // 判断当前环境是否支持websocket
23 23
     if(!isclear){
24
-        console.log('开始连接websocket')
24
+        // console.log('开始连接websocket')
25 25
         window.websocketmessage = null;
26 26
         if(window.WebSocket){
27 27
             if(!window.websocketmessage){
@@ -33,7 +33,7 @@ export function newWebSocket(uId,isclear){
33 33
             console.log("not support websocket");
34 34
         }
35 35
     }
36
- 
36
+
37 37
     // 连接成功建立的回调方法
38 38
     window.websocketmessage.onopen = function(e){
39 39
         heartCheck.reset().start();   // 成功建立连接后,重置心跳检测
@@ -41,7 +41,7 @@ export function newWebSocket(uId,isclear){
41 41
     }
42 42
     // 连接发生错误,连接错误时会继续尝试发起连接(尝试5次)
43 43
     window.websocketmessage.onerror = function() {
44
-        console.log("onerror连接发生错误")
44
+        // console.log("onerror连接发生错误")
45 45
         websocket_connected_count++;
46 46
         // if(websocket_connected_count <= 5){
47 47
         //     newWebSocket(uId)
@@ -79,22 +79,22 @@ export function newWebSocket(uId,isclear){
79 79
                     messageData: JSON.stringify(messageData)
80 80
                 })
81 81
             }
82
-            
82
+
83 83
             // console.log('mymy',store.state.messageData)
84 84
            //执行接收到消息的操作,一般是刷新UI
85 85
         }
86 86
     }
87
- 
87
+
88 88
     // 接受到服务端关闭连接时的回调方法
89 89
     window.websocketmessage.onclose = function(){
90
-        console.log("onclose断开连接");
91
-        console.log(window.websocketmessage)
90
+        // console.log("onclose断开连接");
91
+        // console.log(window.websocketmessage)
92 92
     }
93 93
     // 监听窗口事件,当窗口关闭时,主动断开websocket连接,防止连接没断开就关闭窗口,server端报错
94 94
     window.onbeforeunload = function(){
95 95
         window.websocketmessage.close();
96 96
     }
97
- 
97
+
98 98
     // 心跳检测, 每隔一段时间检测连接状态,如果处于连接中,就向server端主动发送消息,来重置server端与客户端的最大连接时间,如果已经断开了,发起重连。
99 99
     var heartCheck = {
100 100
         timeout: 56*60*1000,        // 56分钟发一次心跳,比server端设置的连接时间稍微小一点,在接近断开的情况下以通信的方式去重置连接时间。
@@ -112,7 +112,7 @@ export function newWebSocket(uId,isclear){
112 112
                     if(window.websocketmessage.readyState == 1){
113 113
                         // window.websocketmessage.send("ping");
114 114
                         console.log("心跳检测结果: 连接状态正常");
115
-                        heartCheck.reset().start();    
115
+                        heartCheck.reset().start();
116 116
                     }else{
117 117
                         console.log('getuser',getUser())
118 118
                         if(getUser()){
@@ -147,4 +147,4 @@ export function removeSession(id) {
147 147
       url: `/csc-szls-message/sysMessage/authority/removeSession/${id}`,
148 148
       method: 'get',
149 149
     })
150
-}
150
+}

+ 1 - 0
shanXiPlatform/src/layoutt/index.vue

@@ -42,6 +42,7 @@
42 42
       <span class="myspan">当前所在位置: 首页></span>
43 43
       <span class="myspan" v-if="this.$store.state.isshowLibrary && this.$route.query.midprovinceName == '山西省'">山西省></span>
44 44
       <span class="myspan" v-if="this.$store.state.isshowLibrary && this.$route.query.midprovinceName == ''">{{this.$store.state.depotName}}></span>
45
+      <span class="myspan" v-if="this.$store.state.isshowLibrary && this.$route.query.midprovinceName != '' && this.$route.query.midprovinceName != '山西省'">{{this.$route.query.midprovinceName}}></span>
45 46
       <breadcrumb id="breadcrumb-container" style="height:54px;line-height:54px; " class="breadcrumb-container" />
46 47
     </div>
47 48
     <app-main></app-main>

+ 8 - 0
shanXiPlatform/src/router/index.js

@@ -348,6 +348,14 @@ export const constantRoutes = [
348 348
         meta: { title: '异常粮情', icon: 'dashboard',isshowLibrary:true, affix: true },
349 349
       },
350 350
       {
351
+        path: 'cnyclqtable',
352
+        component: () => import('@/views/home/cnyclqtable'),
353
+        name: 'cnyclqtable',
354
+        hidden: true,
355
+        meta: { title: '粮情检查', icon: 'dashboard',isshowLibrary:true, affix: true },
356
+      },
357
+      
358
+      {
351 359
         path: 'gzjftable',
352 360
         component: () => import('@/views/home/gzjftable'),
353 361
         name: 'gzjftable',

+ 206 - 0
shanXiPlatform/src/views/home/cnyclqtable.vue

@@ -0,0 +1,206 @@
1
+<template>
2
+    <div class="global">
3
+        <div class="contentContainerGg">
4
+            <div class="container">
5
+                <el-form :inline="true">
6
+                    <el-form-item label="时间:">
7
+                        <el-date-picker @change="timechange" id="getWeek" v-model="datetime" type="week" format="yyyy年WW周" placeholder="选择周">
8
+                        </el-date-picker>
9
+                    </el-form-item>
10
+                    <el-form-item>
11
+                        <el-button icon="el-icon-search" type="success" plain @click="getList()">
12
+                            查询</el-button>
13
+                    </el-form-item>
14
+                </el-form>
15
+                <el-table border :data="tableList" highlight-current-row style="width:100%" :header-cell-style="{background:'#f8f8f8'}">
16
+                    <el-table-column property="depotName" label="时间" align="center">
17
+                        <template slot-scope="scope">
18
+                            {{ scope.row.yearJoinWeek}}
19
+                        </template>
20
+                    </el-table-column>
21
+                    <el-table-column property="depotName" label="仓房" align="center">
22
+                        <template slot-scope="scope">
23
+                            <span style="color:green;" @click="houseclick(scope.$index, scope.row)"> {{ hourseDic[scope.row.houseId] }}</span>
24
+                        </template>
25
+                    </el-table-column>
26
+                    <el-table-column property="depotName" label="所属公司" align="center">
27
+                        <template slot-scope="scope">
28
+                            {{ depotDic[scope.row.depotId] }}
29
+                        </template>
30
+                    </el-table-column>
31
+                    <el-table-column label="粮情异常情况" align="center">
32
+                        <template slot-scope="scope">
33
+                            <p style="height:45px;line-height:45px;margin:0;padding-top:7px;">
34
+                                <span class='colorspano' v-if="scope.row.grainError == '191'"></span>
35
+                                <span class='colorspant' v-if="scope.row.grainError != '191'"></span>
36
+                            </p>
37
+                        </template>
38
+                    </el-table-column>
39
+                    <el-table-column property="operation" label="操作" align="center">
40
+                        <template slot-scope="scope">
41
+                            <el-button size="mini" type="detailbtn" @click="detailbtn(scope.$index, scope.row )">详情</el-button>
42
+                        </template>
43
+                    </el-table-column>
44
+                </el-table>
45
+                <div class="pagination-container">
46
+                    <el-pagination class="right" background :current-page.sync="listQuery.page" :page-size="listQuery.limit" :page-sizes="[10,20,30,40]" :total="total" @size-change="sizeChange" @current-change="pageChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
47
+                </div>
48
+            </div>
49
+        </div>
50
+    </div>
51
+</template>
52
+<script>
53
+import { getcf } from "@/api/organizationalStructureManagement/index.js"
54
+import { getyclqk } from "@/api/branchoff/index.js"
55
+export default {
56
+    data() {
57
+        return {
58
+            datetime: "",
59
+            // 列表数据
60
+            tableList: [],
61
+            // 分页
62
+            total: 0,
63
+            listLoading: true,
64
+            listQuery: {
65
+                page: 1,
66
+                limit: 10
67
+            },
68
+            roleList: [],
69
+            depotDic: [],
70
+            checkYear: "",
71
+            checkYearWeek: "",
72
+            condition: {}
73
+        }
74
+    },
75
+    created() {
76
+        this.condition = {
77
+            depotId: this.$route.query.depotId
78
+        }
79
+        this.getList()
80
+        this.depotDic = JSON.parse(localStorage.getItem("deportDic"))
81
+        this.hourseDic = JSON.parse(localStorage.getItem("hourseDic"))
82
+    },
83
+    methods: {
84
+        houseclick(index, row) {
85
+            this.$store.commit({
86
+                type: "changeDepotId",
87
+                depotId: row.depotId
88
+            })
89
+            this.$store.commit({
90
+                type: "changeHouseId",
91
+                houseId: row.houseId
92
+            })
93
+            this.$store.commit({
94
+                type: "changeHouseName",
95
+                houseName: this.hourseDic[row.houseId]
96
+            })
97
+            this.$store.commit({
98
+                type: "changeDepotName",
99
+                depotName: this.depotDic[row.depotId]
100
+            })
101
+            this.$router.push("/countQuality/warehouseInformation")
102
+        },
103
+        timechange() {
104
+            this.$nextTick(() => {
105
+                let week = document.querySelector("#getWeek").value
106
+                if (week == "") {
107
+                    this.condition = {
108
+                        depotId: this.$route.query.depotId
109
+                    }
110
+                    return
111
+                }
112
+                console.log(week, "weekweek")
113
+                this.checkYear = week.slice(0, 4)
114
+                this.checkYearWeek = week.slice(5, 7)
115
+                this.condition = {
116
+                    depotId: this.$route.query.depotId,
117
+                    checkYear: this.checkYear,
118
+                    checkYearWeek: this.checkYearWeek
119
+                }
120
+            })
121
+        },
122
+        getList() {
123
+            var condition = JSON.stringify(this.condition)
124
+            let data = {
125
+                condition: condition,
126
+                pageIndex: this.listQuery.page,
127
+                pageSize: this.listQuery.limit
128
+            }
129
+            getyclqk(data)
130
+                .then(res => {
131
+                    if (res.code == 200) {
132
+                        this.tableList = res.data.records
133
+                        this.listQuery.limit = res.data.size
134
+                        this.total = res.data.total
135
+                    } else {
136
+                        this.$message({
137
+                            type: "error",
138
+                            message: res.msg
139
+                        })
140
+                    }
141
+                })
142
+                .catch(err => {
143
+                    console.log(err)
144
+                })
145
+        },
146
+        sizeChange(v) {
147
+            this.listQuery.limit = v
148
+            this.getList()
149
+        },
150
+        pageChange(v) {
151
+            this.listQuery.page = v
152
+            this.getList()
153
+        },
154
+        detailbtn(index, row) {
155
+            this.$store.commit({
156
+                type: "changeDepotId",
157
+                depotId: row.depotId
158
+            })
159
+            this.$store.commit({
160
+                type: "changeHouseId",
161
+                houseId: row.houseId
162
+            })
163
+            this.$store.commit({
164
+                type: "changeHouseName",
165
+                houseName: this.hourseDic[row.houseId]
166
+            })
167
+            this.$store.commit({
168
+                type: "changeDepotName",
169
+                depotName: this.depotDic[row.depotId]
170
+            })
171
+            this.$router.push({
172
+                name: "AllGrain"
173
+            })
174
+        }
175
+    }
176
+}
177
+</script>
178
+<style lang="scss" scoped>
179
+.top {
180
+    height: 40px;
181
+    line-height: 40px;
182
+    border-bottom: 1px solid #ccc;
183
+}
184
+.container {
185
+    padding: 10px;
186
+}
187
+.pagination-container {
188
+    margin-top: 10px;
189
+    margin-right: 20px;
190
+    text-align: right;
191
+}
192
+.colorspano {
193
+    width: 140px;
194
+    height: 30px;
195
+    background-color: #199856;
196
+    display: inline-block;
197
+    border-radius: 5px;
198
+}
199
+.colorspant {
200
+    width: 140px;
201
+    height: 30px;
202
+    background-color: #ffff00;
203
+    display: inline-block;
204
+    border-radius: 5px;
205
+}
206
+</style>

+ 1 - 1
shanXiPlatform/src/views/home/storageStatusTable.vue

@@ -97,4 +97,4 @@ export default {
97 97
     margin-right: 20px;
98 98
     text-align: right;
99 99
 }
100
-</style>
100
+</style>

+ 28 - 30
shanXiPlatform/src/views/home/yclqtable.vue

@@ -13,32 +13,18 @@
13 13
                     </el-form-item>
14 14
                 </el-form>
15 15
                 <el-table border :data="tableList" highlight-current-row style="width:100%" :header-cell-style="{background:'#f8f8f8'}">
16
-                    <!-- <el-table-column prop="operationTime" label="时间" align="center" /> -->
17 16
                     <el-table-column property="depotName" label="时间" align="center">
18 17
                         <template slot-scope="scope">
19
-                            {{ scope.row.checkYear }}年 {{ scope.row.checkYearWeek}}周
18
+                            {{ scope.row.yearJoinWeek}}
20 19
                         </template>
21 20
                     </el-table-column>
22
-                    <el-table-column v-if="this.$route.query.isshow" property="depotName" label="仓房" align="center">
21
+                    <el-table-column property="depotName" label="公司" align="center">
23 22
                         <template slot-scope="scope">
24
-                            <span style="color:green;" > {{ scope.row.depotId }}</span>
23
+                            {{ depotDic[scope.row.depotId] }}
25 24
                         </template>
26 25
                     </el-table-column>
27
-                    <el-table-column  property="depotName" label="公司" align="center">
28
-                        <template slot-scope="scope" >
29
-                             {{ depotDic[scope.row.depotId] }} 
30
-                        </template>
31
-                    </el-table-column>
32
-                    <el-table-column v-if="this.$route.query.isshow" label="粮情异常情况" align="center">
33
-                        <template slot-scope="scope">
34
-                            <p style="height:45px;line-height:45px;margin:0;padding-top:7px;">
35
-                                <span class='colorspano' v-if="scope.row.grainError == '191'"></span>
36
-                                <span class='colorspant' v-if="scope.row.grainError != '191'"></span>
37
-                            </p>
38
-                        </template>
39
-                    </el-table-column>
40
-                    <el-table-column v-if="!this.$route.query.isshow" prop="grainVarieties" label="仓房数量(个)" align="center" />
41
-                    <el-table-column v-if="!this.$route.query.isshow" prop="warehouseStatus" label="粮情异常仓房数量(个)" align="center" />
26
+                    <el-table-column  prop="houseCount" label="仓房数量(个)" align="center" />
27
+                    <el-table-column  prop="grainErrorCount" label="粮情异常仓房数量(个)" align="center" />
42 28
                     <el-table-column property="operation" label="操作" align="center">
43 29
                         <template slot-scope="scope">
44 30
                             <el-button size="mini" type="detailbtn" @click="detailbtn(scope.$index, scope.row)">详情</el-button>
@@ -69,10 +55,16 @@ export default {
69 55
                 limit: 10
70 56
             },
71 57
             roleList: [],
72
-            depotDic: []
58
+            depotDic: [],
59
+            checkYear: "",
60
+            checkYearWeek: "",
61
+            condition: {}
73 62
         }
74 63
     },
75 64
     created() {
65
+        this.condition = {
66
+            depotId: this.$route.query.depotId
67
+        }
76 68
         this.getList()
77 69
         this.depotDic = JSON.parse(localStorage.getItem("deportDic"))
78 70
     },
@@ -80,18 +72,24 @@ export default {
80 72
         timechange() {
81 73
             this.$nextTick(() => {
82 74
                 let week = document.querySelector("#getWeek").value
75
+                if (week == "") {
76
+                    this.condition = {
77
+                        depotId: this.$route.query.depotId
78
+                    }
79
+                    return
80
+                }
81
+                console.log(week, "weekweek")
83 82
                 this.checkYear = week.slice(0, 4)
84 83
                 this.checkYearWeek = week.slice(5, 7)
84
+                this.condition = {
85
+                    depotId: this.$route.query.depotId,
86
+                    checkYear: this.checkYear,
87
+                    checkYearWeek: this.checkYearWeek
88
+                }
85 89
             })
86 90
         },
87 91
         getList() {
88
-            var condition = {
89
-                // depotId: this.$store.state.depotId,
90
-                depotId: this.$route.query.depotId,
91
-                checkYear: this.checkYear,
92
-                checkYearWeek: this.checkYearWeek
93
-            }
94
-            condition = JSON.stringify(condition)
92
+            var condition = JSON.stringify(this.condition)
95 93
             let data = {
96 94
                 condition: condition,
97 95
                 pageIndex: this.listQuery.page,
@@ -124,10 +122,10 @@ export default {
124 122
         },
125 123
         detailbtn(index, row) {
126 124
             this.$router.push({
127
-                name: "AllGrain",
125
+                name: "cnyclqtable",
128 126
                 query: {
129
-                    // depotId: row.depotId,
130
-                    // midprovinceName: this.$route.query.midprovinceName
127
+                    depotId: row.depotId,
128
+                    midprovinceName: this.depotDic[row.depotId]
131 129
                 }
132 130
             })
133 131
         }

+ 4 - 4
shanXiPlatform/src/views/login/index.vue

@@ -236,7 +236,7 @@ export default {
236 236
                   res.data.tokenInfo.access_token
237 237
                 setToken(Authorization)
238 238
                 setUser(res.data.user)
239
-                
239
+
240 240
                 this.getDeportDic()
241 241
                 this.getHourseDic()
242 242
                 this.getPersonDic()
@@ -444,7 +444,7 @@ export default {
444 444
     // }
445 445
 
446 446
     getpermission(homeType){
447
-     
447
+
448 448
       var userInfo= JSON.parse(localStorage.getItem("userInfo"));
449 449
       console.log(userInfo,"当前用户信息")
450 450
       var params={
@@ -453,10 +453,10 @@ export default {
453 453
       sidebarPermission(params)
454 454
       .then(res=>{
455 455
         if(res.code == 200){
456
-         
456
+
457 457
              var permissions = res.data;
458 458
              console.log(permissions,"当前用户权限。。。。。。")
459
-            
459
+
460 460
             localStorage.setItem("permission",JSON.stringify(permissions));
461 461
              if (homeType === 1) {
462 462
                   // 跳转分公司首页

+ 91 - 33
shanXiPlatform/src/views/reservesManagement/grainCheck/allGrain/index.vue

@@ -37,14 +37,21 @@
37 37
           ><div class="grid-content bg-purple">
38 38
             <div class="top_select">
39 39
               <span class="demonstration"> 检查类型: </span>
40
-              <el-select v-model="check_person" placeholder="请选择">
41
-                <el-option
40
+              <el-select v-model="kind" placeholder="请选择">
41
+                <!-- <el-option
42 42
                   v-for="item in options"
43 43
                   :key="item.value"
44 44
                   :label="item.label"
45 45
                   :value="item.label"
46 46
                 >
47
-                </el-option>
47
+                </el-option> -->
48
+                <el-option
49
+              v-for="item in grainKind"
50
+              :key="item.enumId"
51
+              :label="item.enumName"
52
+              :value="item.enumId"
53
+            >
54
+            </el-option>
48 55
               </el-select>
49 56
             </div>
50 57
           </div>
@@ -88,8 +95,25 @@
88 95
           :index="indexMethod"
89 96
         >
90 97
         </el-table-column>
91
-        <el-table-column prop="checkTime" label="记录时间" align="center" />
92
-        <el-table-column prop="checkPerson" label="检查类型" align="center" />
98
+        <el-table-column prop="operationTime" label="记录时间" align="center" >
99
+           <template slot-scope="scope">
100
+            <span>{{
101
+              scope.row.operationTime == null
102
+                ? scope.row.operationTime
103
+                : scope.row.operationTime.slice(0, 16)
104
+            }}</span>
105
+          </template>
106
+        </el-table-column>
107
+
108
+        <el-table-column prop="enumId" label="检查类型" align="center">
109
+          <template slot-scope="scope">
110
+            <p v-for="item in grainKind" :key="item.enumId">
111
+              <span v-if="scope.row.enumId == item.enumId">{{
112
+                item.enumName
113
+              }}</span>
114
+            </p>
115
+          </template>
116
+        </el-table-column>
93 117
         <el-table-column
94 118
           prop="anomalousStatus"
95 119
           label="有无异常"
@@ -97,8 +121,8 @@
97 121
           width="100px"
98 122
         >
99 123
           <template slot-scope="scope">
100
-            <div class="yellow" v-if="scope.row.anomalousStatus == '1'"></div>
101
-            <div class="green" v-if="scope.row.anomalousStatus !== '1'"></div>
124
+            <div class="yellow" v-if="scope.row.anomalousStatus === 1"></div>
125
+            <div class="green" v-if="scope.row.anomalousStatus !== 1"></div>
102 126
           </template>
103 127
         </el-table-column>
104 128
         <el-table-column prop="recordStatus" label="状态" align="center">
@@ -111,13 +135,13 @@
111 135
             ></div>
112 136
             <p
113 137
               v-if="scope.row.recordStatus == 1"
114
-              style="height:45px;line-height:45px;margin:0 ; padding-top:7px;"
138
+
115 139
             >
116 140
               <span>已完成</span>
117 141
             </p>
118 142
             <p
119 143
               v-if="scope.row.recordStatus == 0"
120
-              style="height:45px;line-height:45px;margin:0 ; padding-top:7px;"
144
+
121 145
             >
122 146
               <span>进行中</span>
123 147
             </p>
@@ -145,7 +169,7 @@
145 169
               size="mini"
146 170
               @click="handleCheck(1, scope.$index, scope.row)"
147 171
               v-if="
148
-                scope.row.checkPerson == '保管员每周检查粮情' &&
172
+                scope.row.enumId == 19 &&
149 173
                   $tools.IsPermission(134)
150 174
               "
151 175
               type="detailbtn"
@@ -158,7 +182,7 @@
158 182
               type="editbtn"
159 183
               @click="handleEdit(3, scope.$index, scope.row)"
160 184
               v-if="
161
-                scope.row.checkPerson == '保管员每周检查粮情' &&
185
+                scope.row.enumId == 19 &&
162 186
                   scope.row.recordStatus == 0 &&
163 187
                   $tools.IsPermission(135)
164 188
               "
@@ -168,13 +192,13 @@
168 192
               size="mini"
169 193
               type="dangerbtn"
170 194
               v-if="
171
-                (scope.row.checkPerson == '保管员每周检查粮情' &&
195
+                (scope.row.enumId == 19 &&
172 196
                   $tools.IsPermission(332)) ||
173
-                  (scope.row.checkPerson == '主管科长每2周检查粮情' &&
197
+                  (scope.row.enumId == 20 &&
174 198
                     $tools.IsPermission(333)) ||
175
-                  (scope.row.checkPerson == '分管副总每月检查粮情' &&
199
+                  (scope.row.enumId == 21 &&
176 200
                     $tools.IsPermission(334)) ||
177
-                  (scope.row.checkPerson == '总经理每季检查粮情' &&
201
+                  (scope.row.enumId == 22 &&
178 202
                     $tools.IsPermission(335))
179 203
               "
180 204
               @click="handleDelete(scope.$index, scope.row)"
@@ -207,7 +231,8 @@ import {
207 231
   checkGrainInfo,
208 232
   deleteGrainInfo,
209 233
   editGrainInfo,
210
-  getDateTimeNow
234
+  getDateTimeNow,
235
+  getGrainItems
211 236
 } from "@/api/grainCheck/index"
212 237
 export default {
213 238
   // components: { Pagination },
@@ -219,6 +244,8 @@ export default {
219 244
       data2: [],
220 245
       depotId: this.$store.state.depotId,
221 246
       houseId: this.$store.state.houseId,
247
+      grainKind: [], //粮情检查类别
248
+
222 249
       // select 选项数据
223 250
       options: [
224 251
         {
@@ -238,7 +265,7 @@ export default {
238 265
           label: "总经理每季检查粮情"
239 266
         }
240 267
       ],
241
-      check_person: "",
268
+      kind:'',
242 269
       value2: "",
243 270
       type: "", //判断是否从更多纪录跳转过来
244 271
       // 分页
@@ -255,15 +282,17 @@ export default {
255 282
   mounted() {
256 283
     this.activeName = this.$route.name
257 284
     let routeParams = this.$route.query
258
-    // console.log(routeParams,'routerouteParams')
259
-    console.log(routeParams.type, "type")
260
-    console.log(this.data2, "this.data2")
285
+    console.log(routeParams,'routerouteParams')
286
+    // console.log(routeParams.type, "type")
287
+    // console.log(this.data2, "this.data2")
261 288
     this.type = routeParams.type
289
+    this.getGrainList() //进入页面先拿到粮情类型字典表
262 290
     if (this.type == "" || this.type == null || this.type == undefined) {
263 291
       this.getList()
264 292
     } else if (this.type == 5) {
265
-      console.log(routeParams.data.checkPerson, "routeParams.data.checkPerson")
266
-      this.check_person = routeParams.data.checkPerson
293
+      // console.log(routeParams.data.enumId,'enumId')
294
+      this.kind = routeParams.data.enumId
295
+
267 296
       this.handleQuery()
268 297
     }
269 298
   },
@@ -280,6 +309,18 @@ export default {
280 309
     }
281 310
   },
282 311
   methods: {
312
+    // 获取粮情字典项
313
+    getGrainList() {
314
+      const parentId = 18 //粮情检查类型parentId
315
+      getGrainItems(parentId)
316
+        .then(res => {
317
+          console.log(res, "res字典粮情检查类型")
318
+          this.grainKind = res.data
319
+        })
320
+        .catch(err => {
321
+          console.log(err)
322
+        })
323
+    },
283 324
     // 获取数据
284 325
     getList() {
285 326
       let condition = {
@@ -287,13 +328,13 @@ export default {
287 328
         depotId: this.depotId
288 329
       }
289 330
       let data = {
290
-        condition: JSON.stringify(condition),
331
+        Condition: JSON.stringify(condition),
291 332
         pageIndex: this.listQuery.page,
292 333
         pageSize: this.listQuery.limit
293 334
       }
294 335
       getAllPages(data)
295 336
         .then(res => {
296
-          console.log(res)
337
+          console.log(res,'全部粮情信息')
297 338
           if (res.code == 200) {
298 339
             console.log(res, "res.data.records")
299 340
             this.data2 = res.data.records
@@ -301,6 +342,7 @@ export default {
301 342
             this.listQuery.limit = res.data.size
302 343
             this.total = res.data.total
303 344
             // console.log(this.listQuery, "分页信息")
345
+            console.log(this.data2,'this.data2.....')
304 346
           }
305 347
         })
306 348
         .catch(err => {
@@ -309,7 +351,7 @@ export default {
309 351
     },
310 352
     // 查询
311 353
     handleQuery() {
312
-      let condition = {
354
+      /* let condition = {
313 355
         check_person: this.check_person,
314 356
         // check_person: "科长每两周检查粮情",
315 357
         check_start_time: this.value2[0],
@@ -324,9 +366,22 @@ export default {
324 366
         pageSize: this.listQuery.limit,
325 367
 
326 368
         condition: JSON.stringify(condition)
369
+      } */
370
+      let condition = {
371
+        houseId: this.houseId,
372
+        depotId: this.depotId,
373
+        startTime: this.value2[0],
374
+        endTime: this.value2[1],
375
+        enumId: this.kind
376
+      }
377
+      let data8 = {
378
+        pageIndex: this.listQuery.page,
379
+        pageSize: this.listQuery.limit,
380
+        condition: JSON.stringify(condition)
327 381
       }
328
-      console.log(data3,'data3')
329
-      queryGrainInfo(data3)
382
+
383
+      console.log(data8,'data----')
384
+      queryGrainInfo(data8)
330 385
         .then(res => {
331 386
           this.data2 = res.data.records
332 387
           this.total = res.data.total
@@ -354,8 +409,8 @@ export default {
354 409
     },
355 410
     // 删除
356 411
     handleDelete(a, b) {
357
-      console.log(b.id)
358
-      // this.allGrainData.splice(a, 1)
412
+/*       console.log(a,'a')
413
+      // console.log(b.id,'b') */
359 414
 
360 415
       this.$confirm("确定删除该项记录?", "提示", {
361 416
         confirmButtonClass: "el-button--success is-plain",
@@ -366,22 +421,25 @@ export default {
366 421
         let id = b.id
367 422
         deleteGrainInfo(id)
368 423
           .then(res => {
369
-            console.log(res)
424
+            if(res.code == 200){
425
+              console.log(res,'res')
370 426
             this.$message({
371 427
               message: "恭喜你,删除成功了!",
372 428
               type: "success"
373 429
             })
374 430
             this.getList()
431
+            }
432
+
375 433
           })
376 434
           .catch(err => {
377
-            console.log(err)
435
+            console.log(err,'err信息')
378 436
           })
379 437
       })
380 438
     },
381 439
     // 修改
382 440
     handleEdit(type, index, row) {
383 441
       // console.log(row, "row")
384
-      row.checkTime = getDateTimeNow
442
+      row.checkTime = getDateTimeNow()
385 443
       // console.log(row.checkTime,'row.checktime')
386 444
       this.$router.push({
387 445
         path: "/grainCheck/addNewGrain",
@@ -398,7 +456,7 @@ export default {
398 456
     //清空
399 457
     clear() {
400 458
       this.value2 = ""
401
-      this.check_person = ""
459
+      this.kind = ""
402 460
       this.handleQuery() // 清空选项同时查询数据回显
403 461
     },
404 462
     handleClick(tab, event) {

+ 464 - 197
shanXiPlatform/src/views/reservesManagement/grainCheck/newGrain/addNewGrain.vue

@@ -5,8 +5,8 @@
5 5
         <span>粮情检测类型:</span>
6 6
         <span>{{ checkPerson }}</span>
7 7
       </div>
8
-
9
-      <div class="table">
8
+      <!-- 2新增3修改 -->
9
+      <div class="table" v-show="type == 2 || type == 3">
10 10
         <el-table
11 11
           border
12 12
           :header-cell-style="{ background: '#f8f8f8' }"
@@ -23,53 +23,110 @@
23 23
             label="序号"
24 24
             width="50px"
25 25
           />
26
+          <el-table-column prop="createDate" label="检查时间" align="center">
27
+            <template slot-scope="scope">
28
+              <span>{{
29
+                scope.row.createDate == null
30
+                  ? scope.row.createDate
31
+                  : scope.row.createDate.slice(0, 16)
32
+              }}</span>
33
+            </template>
34
+          </el-table-column>
26 35
           <el-table-column
27
-            prop="createTime"
28
-            label="检查时间"
36
+            prop="fieldValue"
37
+            label="检查项对应名称"
29 38
             align="center"
30
-          /><el-table-column
39
+            v-if="false"
40
+          />
41
+          <el-table-column prop="enumName" label="检查项" align="center" />
42
+          <el-table-column prop="enumOrder" label="选项" align="center">
43
+            <template slot-scope="scope">
44
+              <el-radio-group
45
+                v-model="scope.row.enumOrder"
46
+                @change.native="showClick(scope.$index, scope.row)"
47
+                :disabled="isDetail"
48
+              >
49
+                <el-radio label="1">是</el-radio>
50
+                <el-radio label="0">否</el-radio>
51
+                <el-link
52
+                  :underline="false"
53
+                  class="spike"
54
+                  id="spike"
55
+                  v-if="
56
+                    scope.row.enumOrder == 1 &&
57
+                      scope.row.enumName.indexOf('异常') != -1
58
+                  "
59
+                  @click="showHandler(scope.row)"
60
+                >
61
+                  {{ scope.row.enumName + "  >>" }}
62
+                </el-link>
63
+              </el-radio-group>
64
+            </template>
65
+          </el-table-column>
66
+        </el-table>
67
+      </div>
68
+      <!-- 1查看 -->
69
+      <div class="table" v-show="type == 1">
70
+        <el-table
71
+          border
72
+          :header-cell-style="{ background: '#f8f8f8' }"
73
+          ref="orderTable"
74
+          highlight-current-row
75
+          :data="tbdata"
76
+          height="631"
77
+          row-key="index"
78
+          @current-change="handleCurrentChange"
79
+        >
80
+          <el-table-column
81
+            type="index"
82
+            align="center"
83
+            label="序号"
84
+            width="50px"
85
+          />
86
+          <el-table-column prop="createDate" label="检查时间" align="center">
87
+            <template slot-scope="scope">
88
+              <span>{{
89
+                scope.row.createDate == null
90
+                  ? scope.row.createDate
91
+                  : scope.row.createDate.slice(0, 16)
92
+              }}</span>
93
+            </template>
94
+          </el-table-column>
95
+          <el-table-column
31 96
             prop="fieldValue"
32 97
             label="检查项对应名称"
33 98
             align="center"
34 99
             v-if="false"
35 100
           />
36
-          <el-table-column prop="fieldDetail" label="检查项" align="center" />
37
-          <el-table-column prop="whether" label="选项" align="center">
101
+          <el-table-column prop="enumName" label="检查项" align="center" />
102
+          <el-table-column prop="enumOrder" label="选项" align="center">
38 103
             <template slot-scope="scope">
39 104
               <el-radio-group
40
-                v-model="scope.row.whether.radio"
105
+                v-model="scope.row.enumOrder"
41 106
                 @change.native="showClick(scope.$index, scope.row)"
42 107
                 :disabled="isDetail"
43 108
               >
44
-                <el-radio label="1">{{ scope.row.whether.status1 }}</el-radio>
45
-                <el-radio label="0">{{ scope.row.whether.status2 }}</el-radio>
46
-                <!--                 <div v-if="type == '2' ">
47
-                  <el-button>新增显示</el-button>
48
-                </div> -->
49
-                <!-- <div v-if="type == '1' || type == '3'"> -->
109
+                <el-radio label="1">是</el-radio>
110
+                <el-radio label="0">否</el-radio>
50 111
                 <el-link
51 112
                   :underline="false"
52 113
                   class="spike"
53 114
                   id="spike"
54 115
                   v-if="
55
-                    scope.row.whether.radio == 1 &&
56
-                      scope.row.fieldDetail.indexOf('异常') != -1
116
+                    scope.row.enumOrder == 1 &&
117
+                      scope.row.enumName.indexOf('异常') != -1
57 118
                   "
58 119
                   @click="showHandler(scope.row)"
59 120
                 >
60
-                  {{ scope.row.fieldDetail + "  >>" }}
121
+                  {{ scope.row.enumName + "  >>" }}
61 122
                 </el-link>
62
-                <!-- </div> -->
63
-
64
-                <!-- <el-button   v-if='scope.row.whether.radio ==1 && scope.row.fieldDetail.indexOf("异常") != -1'>{{scope.row.fieldDetail + '  >>'}}</el-button> -->
65 123
               </el-radio-group>
66 124
             </template>
67 125
           </el-table-column>
68 126
         </el-table>
69 127
       </div>
70
-
71 128
       <div class="btns">
72
-        <el-button type="cancel" @click="cancel()"> 返回 </el-button>
129
+        <el-button type="cancel" @click="back()"> 返回 </el-button>
73 130
 
74 131
         <el-button
75 132
           type="savebtn"
@@ -87,10 +144,6 @@
87 144
           @click="saveInfo"
88 145
           >保存</el-button
89 146
         >
90
-
91
-        <!--       <div v-if='type="1" || type="3"'>
92
-
93
-      </div> -->
94 147
       </div>
95 148
 
96 149
       <!-- 新增虫害异常 -->
@@ -126,7 +179,7 @@
126 179
           </el-form-item>
127 180
         </el-form>
128 181
         <div slot="footer" class="dialog-footer">
129
-          <el-button @click="dialogFormVisible = false" type="cancel"
182
+          <el-button @click="cancel('abnormalPest')" type="cancel"
130 183
             >取 消</el-button
131 184
           >
132 185
           <el-button type="savebtn" @click="saveFormData()">确 定</el-button>
@@ -147,7 +200,7 @@
147 200
           ></el-input>
148 201
         </el-form>
149 202
         <div slot="footer" class="dialog-footer">
150
-          <el-button @click="dialogFormVisible1 = false" type="cancel"
203
+          <el-button @click="cancel('abnormalWater')" type="cancel"
151 204
             >取 消</el-button
152 205
           >
153 206
           <el-button type="savebtn" @click="dialogFormVisible1 = false"
@@ -171,7 +224,7 @@
171 224
           </el-form-item>
172 225
         </el-form>
173 226
         <div slot="footer" class="dialog-footer">
174
-          <el-button @click="dialogFormVisible2 = false" type="cancel"
227
+          <el-button @click="cancel('abnormalGrain')" type="cancel"
175 228
             >取 消</el-button
176 229
           >
177 230
           <el-button type="savebtn" @click="saveForm">确 定</el-button>
@@ -190,7 +243,8 @@ import {
190 243
   addInfo,
191 244
   getDateTimeNow,
192 245
   haveDone, //处理待办
193
-  haveDone1
246
+  haveDone1,
247
+  getGrainItems
194 248
 } from "@/api/grainCheck/index"
195 249
 export default {
196 250
   name: "AddNewGrain",
@@ -217,7 +271,7 @@ export default {
217 271
         pestDensity: "", // 虫害密度
218 272
         occurArea: "", //发生面积
219 273
         occurPosition: "", // 发生部位
220
-        pestType: " ", // 虫害种类
274
+        pestType: "", // 虫害种类
221 275
         abnormalGrain: "", // 粮情异常描述
222 276
         abnormalWater: "" // 水分检测异常描述
223 277
       },
@@ -230,8 +284,9 @@ export default {
230 284
       // 每行id
231 285
       id: "",
232 286
       // 按钮类型
233
-      type: "",
287
+      type: "", // 2:新增 1:查看 3:修改
234 288
       show: "true", //查看时不显示改为false
289
+      isExist: false, //点击选项时判断是否存在该项数据,存在更新,不存在新增
235 290
       // 检查类型
236 291
       checkPerson: "",
237 292
       data2: {}, //待办传参过来的数据
@@ -261,27 +316,52 @@ export default {
261 316
           // pestOccurArea: "",
262 317
           pestType: ""
263 318
         }
319
+      },
320
+      // 重构后的新增数据模板
321
+      data5: {
322
+        grainConditionRecord: {
323
+          anomalousStatus: 0, //异常状态(0无异常,1有异常)
324
+          checkPerson: 0, //检查人
325
+          checkYear: 0, //检查年份(用于粮情异常等,做年统计)
326
+          checkYearWeek: 0, //检查所在年第几周
327
+          depotId: 0, //库id
328
+          enumId: 0, //检查类型
329
+          enumOrder: 0, //用于同公共枚举同步顺序
330
+          houseId: 0, //仓房id
331
+          id: 0, //粮情检测记录id
332
+          operationTime: "", //检查(操作)时间
333
+          recordStatus: 0, //记录状态(0进行中,1完成)
334
+          grainError: null, //粮情异常,值为对应的enumId
335
+          insectPestError: null, //虫害异常 值为对应的enumId
336
+          wetCheckError: null //水分检测异常 值为对应的enumId
337
+        },
338
+        grainConditionRecordChildren: [
339
+          /* {
340
+            anomalousStatus: 0, //是否异常_选项(0:否,1:是)
341
+            enumId: 0, //检查类型
342
+            id: 0, //粮情检查新增检查项
343
+            operationTime: "string", //操作时间
344
+            parentId: 0 //关联主表id(检查人id-保管员或总经理等)
345
+          } */
346
+        ]
264 347
       }
265 348
     }
266 349
   },
267
-  /*   created(){
268
-     this.$nextTick(() => {
269
-
270
-    if (this.$route.query.type == '1') {
271
-      this.reast()
272
-      this.pageTitle = '查看'
273
-      this.isDetail = true
274
-      this.detailInfo()
275
-    }
276
-  }, */
277 350
 
278 351
   mounted() {
279 352
     // 初始化的时候把参数拼接到要传输的数据里
280 353
     let routeParams = this.$route.query
281
-    /*     console.log(routeParams,'routeParams')
282
-    console.log(this.$store.state.depotId,'this.$store.state.depotId') */
354
+    // console.log(routeParams, "routeParams")
355
+    // console.log(this.$store.state.depotId, "this.$store.state.depotId")
283 356
     this.userInfo = JSON.parse(localStorage.getItem("userInfo"))
284 357
     this.uid = this.userInfo.uid
358
+
359
+    if (routeParams.type == 3) {
360
+      this.data5.grainConditionRecord = routeParams.data
361
+    }
362
+
363
+    this.data5.grainConditionRecord.checkPerson = this.userInfo.uid
364
+    this.data5.grainConditionRecord.enumId = routeParams.data.enumId
285 365
     // console.log(this.$route.query.daibanObj,'this.$route.query.daibanObj')
286 366
     //待办数据
287 367
     this.data2 = this.$route.query.daibanObj
@@ -291,17 +371,14 @@ export default {
291 371
     this.id = routeParams.data.id
292 372
     // console.log(this.id,'this.id')
293 373
     this.type = routeParams.type
294
-    this.checkPerson = routeParams.data.checkPerson
295
-    this.data = routeParams
296
-    this.describe = JSON.parse(routeParams.data.checkDescribe)
297
-    this.data3.checkTime = routeParams.data.checkTime
298
-    this.data3.checkPerson = routeParams.data.checkPerson
299
-    this.data3.recordStatus = routeParams.data.recordStatus
300
-    this.data3.anomalousStatus = routeParams.data.anomalousStatus
374
+    // console.log(this.type, "this.type....")
375
+    // this.checkPerson = routeParams.data.checkPerson
376
+    // this.data = routeParams
377
+    // this.describe = JSON.parse(routeParams.data.checkDescribe)
301 378
 
302 379
     // 获取用户的库id和仓房id
303 380
     let userinfo = JSON.parse(localStorage.getItem("userInfo"))
304
-    console.log(userinfo, "userinfo............")
381
+    // console.log(userinfo, "userinfo............")
305 382
     // this.depot_id = this.$store.state.depotId
306 383
     // this.house_id = userinfo.houseId
307 384
     // console.log(routeParams.data,'routeParams.data')
@@ -309,144 +386,196 @@ export default {
309 386
       this.show = false
310 387
     } else if (this.type == 3) {
311 388
       if (Object.getOwnPropertyNames(this.describe).length - 1 == 14) {
312
-        console.log(Object.getOwnPropertyNames(this.describe).length, "0.0.0.")
389
+        // console.log(Object.getOwnPropertyNames(this.describe).length, "0.0.0.")
313 390
         this.flag = true
314 391
       }
315 392
     }
316
-    /* if(this.type !==2 && Object.getOwnPropertyNames(this.describe).length-1 ==14){
317
-      // console.log('this.flag')
318
-      this.flag = true
319
-    } */
393
+
320 394
     // 新增初始化数据
321 395
     this.getinfo()
322 396
   },
323 397
 
324 398
   methods: {
325 399
     showHandler(val) {
326
-      // console.log(val,'val...')
327
-      if (val.fieldValue == "pest_abnormal") {
400
+      // console.log(val, "val...")
401
+      if (val.enumId == 189) {
328 402
         this.dialogFormVisible = true
329
-      } else if (val.fieldValue == "water_abnormal") {
403
+      } else if (val.enumId == 190) {
330 404
         this.dialogFormVisible1 = true
331
-      } else if (val.fieldValue == "grain_abnormal") {
405
+      } else if (val.enumId == 191) {
332 406
         this.dialogFormVisible2 = true
333 407
       }
334 408
     },
335 409
     getinfo() {
336 410
       // 目前只有一页,在前端写死了请求参数
337 411
       // 在内部判断是新增修改还是查看
338
-      let condition = {
339
-        table_name: "grain_condition_record",
340
-        field_name: "check_list"
341
-      }
342
-      let data1 = {
343
-        pageIndex: 1,
344
-        pageSize: 30,
345
-        condition: JSON.stringify(condition)
346
-      }
347
-      // console.log(this.type,'type...')
348
-      if (this.type == "2") {
349
-        getAddInfo(data1)
412
+
413
+      // console.log(this.type, "type...")
414
+      if (this.type == 2) {
415
+        // console.log("新增页面初始化")
416
+        getGrainItems(19)
350 417
           .then(res => {
351
-            //新增初始化
352
-            this.tbdata = res.data.records
353
-            this.depot_id = this.$store.state.depotId
354
-            /*           console.log(this.$store.state.houseId,'this.$store.state.houseId')
355
-          console.log(this.$store.state.depotId,'this.$store.state.depotId')
356
-          console.log(this.data2,'this.data2')
357
-          console.log(this.userInfo.depotId,'this.userInfo.depotId') */
418
+            if (res.code == 200) {
419
+              // console.log(res, "res字典19")
420
+              this.tbdata = res.data
421
+              // 新增时把检查项数据给保存下来
422
+              this.data5.grainConditionRecordChildren = JSON.parse(
423
+                JSON.stringify(res.data)
424
+              )
425
+              this.data5.grainConditionRecordChildren.map(item => {
426
+                item.id = null
427
+                delete item.delFlag
428
+                delete item.parentId
429
+                delete item.remark
430
+                delete item.enumName
431
+                delete item.enumOrder
432
+                delete item.createDate
433
+              })
434
+              // console.log(this.tbdata, "tbdata.......")
435
+              // console.log(
436
+              //   this.data5.grainConditionRecordChildren,
437
+              //   " this.data5.grainConditionRecordChildren......."
438
+              // )
439
+            }
358 440
           })
359 441
           .catch(err => {
360 442
             console.log(err)
361 443
           })
362 444
       } else if (this.type == "1") {
363 445
         //查看
364
-        this.isDetail = true
365
-        getAddInfo(data1)
446
+        // 检查项初始化
447
+        getGrainItems(19)
366 448
           .then(res => {
367
-            // console.log(res)
368
-            this.tbdata = res.data.records
369
-            // console.log("产看修改初始化")
370 449
             if (res.code == 200) {
371
-              // 如果成功,就再次调用查看接口
450
+              this.tbdata = res.data
451
+              // this.data5.grainConditionRecordChildren = JSON.parse(JSON.stringify(res.data))
452
+              // console.log(this.tbdata, "tbdata.......")
453
+              //获取查看数据
372 454
               checkGrainInfo(this.id)
373 455
                 .then(res => {
374
-                  this.describe = JSON.parse(res.data.checkDescribe)
375
-                  //如果有异常项,就把异常项的值赋值给form数据源
376
-                  this.form.pestDensity = this.data.data.grainAbnormalDescribe.pestDensity
377
-                  this.form.occurArea = this.data.data.grainAbnormalDescribe.occurArea
378
-                  this.form.occurPosition = this.data.data.grainAbnormalDescribe.occurPosition
379
-                  this.form.pestType = this.data.data.grainAbnormalDescribe.pestType
380
-                  this.form.abnormalGrain = this.data.data.grainAbnormalDescribe.abnormalGrain
381
-                  this.form.abnormalWater = this.data.data.grainAbnormalDescribe.abnormalWater
382
-
383
-                  /* 遍历this.describe的key跟初始化时的每一项的fieldValue匹配,
384
-            匹配成功则把时间跟choose赋值给数据源tbdata */
456
+                  if (res.code == 200) {
457
+                    // console.log(res, "获取查看数据")
385 458
 
386
-                  for (const key in this.describe) {
387 459
                     for (let i = 0; i < this.tbdata.length; i++) {
388
-                      if (key == this.tbdata[i].fieldValue) {
389
-                        this.tbdata[i].createTime = this.describe[key].time
390
-                        this.tbdata[i].whether.radio = this.describe[key].choose
460
+                      for (let j = 0; j < res.data.length; j++) {
461
+                        if (this.tbdata[i].enumId == res.data[j].enumId) {
462
+                          // console.log(this.tbdata.indexOf(this.tbdata[i]),"this.tbdata[i]的index" )
463
+                          // console.log( res.data.indexOf(res.data[j]),"res.data.indexOf(res.data[j])")
464
+                          // var itemIndex = this.tbdata.indexOf(this.tbdata[i])
465
+                          if (
466
+                            this.tbdata[i].enumId == 189 ||
467
+                            this.tbdata[i].enumId == 190 ||
468
+                            this.tbdata[i].enumId == 191
469
+                          ) {
470
+                            // console.log(this.tbdata[i].enumName)
471
+                            this.tbdata[i].createDate =
472
+                              res.data[j].operationTime
473
+                            this.tbdata[i].enumOrder = String(
474
+                              res.data[j].anomalousStatus
475
+                            )
476
+                            //如果有异常项,就把异常项的值赋值给form数据源
477
+
478
+                            if (res.data[j].anomalousStatus == 1) {
479
+                              this.form = JSON.parse(res.data[j].errorDescribed)
480
+                              // console.log(this.form, "this.form")
481
+                              // console.log(
482
+                              //   res.data[j].errorDescribed,
483
+                              //   "res.data[j].errorDescribed"
484
+                              // )
485
+                            }
486
+                          } else {
487
+                            this.tbdata[i].createDate =
488
+                              res.data[j].operationTime
489
+                            this.tbdata[i].enumOrder = String(
490
+                              res.data[j].anomalousStatus
491
+                            )
492
+                          }
493
+                        }
391 494
                       }
392 495
                     }
393
-                    // if(key ==this.)
394 496
                   }
395 497
                 })
396 498
                 .catch(err => {
397
-                  console.log(err)
499
+                  console.log(err, "获取查看数据失败信息")
398 500
                 })
399 501
             }
400 502
           })
401 503
           .catch(err => {
402 504
             console.log(err)
403 505
           })
506
+        this.isDetail = true
404 507
       } else if (this.type == "3") {
405 508
         //修改
406
-        getAddInfo(data1)
509
+        // 检查项初始化
510
+        getGrainItems(19)
407 511
           .then(res => {
408
-            // console.log(res,'修改接口获取到的数据')
409
-            this.tbdata = res.data.records
410
-            // console.log("产看修改初始化")
411 512
             if (res.code == 200) {
412
-              // 如果成功,就再次调用查看接口
513
+              // console.log(res, "res修改数据")
514
+              this.tbdata = res.data
515
+              // console.log(this.tbdata, "tbdata.......")
516
+              //获取数据
413 517
               checkGrainInfo(this.id)
414 518
                 .then(res => {
415
-                  console.log(res.data, "修改查看res")
416
-                  this.data3 = res.data
417
-                  // this.data3.checkDescribe = JSON.parse(res.data.checkDescribe)
418
-                  this.describe = JSON.parse(res.data.checkDescribe)
419
-                  this.data3.checkDescribe = this.describe
420
-
421
-                  //如果有异常项,就把异常项的值赋值给form数据源
422
-                  this.form.pestDensity = this.data.data.grainAbnormalDescribe.pestDensity
423
-                  this.form.occurArea = this.data.data.grainAbnormalDescribe.occurArea
424
-                  this.form.occurPosition = this.data.data.grainAbnormalDescribe.occurPosition
425
-                  this.form.pestType = this.data.data.grainAbnormalDescribe.pestType
426
-                  this.form.abnormalGrain = this.data.data.grainAbnormalDescribe.abnormalGrain
427
-                  this.form.abnormalWater = this.data.data.grainAbnormalDescribe.abnormalWater
428
-                  // console.log(this.form,'this.form............')
429
-                  /* 遍历this.describe的key跟初始化时的每一项的fieldValue匹配,
430
-            匹配成功则把时间跟choose赋值给数据源tbdata */
519
+                  if (res.code == 200) {
520
+                    // console.log(res, "获取修改数据")
521
+                    /*  res.data.forEach(item =>{
522
+                delete item.parentId
523
+              }) */
524
+                    // this.data5.grainConditionRecordChildren = JSON.parse(JSON.stringify(res.data))
431 525
 
432
-                  for (const key in this.describe) {
526
+                    this.data5.grainConditionRecordChildren = res.data
433 527
                     for (let i = 0; i < this.tbdata.length; i++) {
434
-                      if (key == this.tbdata[i].fieldValue) {
435
-                        this.tbdata[i].createTime = this.describe[key].time
436
-                        this.tbdata[i].whether.radio = this.describe[key].choose
528
+                      for (let j = 0; j < res.data.length; j++) {
529
+                        if (this.tbdata[i].enumId == res.data[j].enumId) {
530
+                          if (
531
+                            this.tbdata[i].enumId == 189 ||
532
+                            this.tbdata[i].enumId == 190 ||
533
+                            this.tbdata[i].enumId == 191
534
+                          ) {
535
+                            // console.log(this.tbdata[i].enumName)
536
+                            this.tbdata[i].createDate =
537
+                              res.data[j].operationTime
538
+                            this.tbdata[i].enumOrder = String(
539
+                              res.data[j].anomalousStatus
540
+                            )
541
+                            //如果有异常项,就把异常项的值赋值给form数据源
542
+                            if (res.data[j].anomalousStatus == 1) {
543
+                              this.form = JSON.parse(res.data[j].errorDescribed)
544
+                              // console.log(this.form, "this.form")
545
+                              // console.log(
546
+                              //   res.data[j].errorDescribed,
547
+                              //   "res.data[j].errorDescribed"
548
+                              // )
549
+                            }
550
+
551
+                            //  this.data5.grainConditionRecordChildren.push(res.data[i])
552
+                          } else {
553
+                            this.tbdata[i].createDate =
554
+                              res.data[j].operationTime
555
+                            // this.tbdata[i].enumOrder = res.data[j].anomalousStatus
556
+                            this.tbdata[i].enumOrder = String(
557
+                              res.data[j].anomalousStatus
558
+                            )
559
+                            // this.data5.grainConditionRecordChildren.push(res.data[i])
560
+                          }
561
+                        }
437 562
                       }
438 563
                     }
439
-                    // if(key ==this.)
564
+                    // console.log(
565
+                    //   this.data5.grainConditionRecordChildren,
566
+                    //   "this.data5.grainConditionRecordChildren"
567
+                    // )
440 568
                   }
441 569
                 })
442 570
                 .catch(err => {
443
-                  console.log(err)
571
+                  console.log(err, "获取查看数据失败信息")
444 572
                 })
445 573
             }
446 574
           })
447 575
           .catch(err => {
448 576
             console.log(err)
449 577
           })
578
+        // this.isDetail = true
450 579
       }
451 580
     },
452 581
 
@@ -466,87 +595,167 @@ export default {
466 595
     handleCurrentChange() {},
467 596
     // 通过判断单选按钮的选择,弹出异常表单
468 597
     showClick(index, val) {
469
-      console.log(this.tbdata,'this.tbdata')
470
-      console.log(index,'-index',val,'--val....')
598
+      this.isExist = false
599
+      // console.log(this.tbdata, "this.tbdata000...")
600
+      // var arr = this.tbdata
601
+      // console.log(index, "-index", val, "--val....")
602
+      // console.log(
603
+      //   this.data5.grainConditionRecordChildren,
604
+      //   "this.data5.grainConditionRecordChildren"
605
+      // )
471 606
       let time = getDateTimeNow()
472
-      this.tbdata[index].createTime = time
473
-      // 动态的把当前检查项作为对象名称保存到checkDescribe
474
-      this.data3.checkDescribe[this.tbdata[index].fieldValue] = {
475
-        choose: this.tbdata[index].whether.radio,
476
-        time: this.tbdata[index].createTime
477
-      }
478
-     if (
479
-          this.tbdata[6].fieldValue == "pest_abnormal"  && this.tbdata[6].whether.radio == 1 ||
480
-          this.tbdata[7].fieldValue == "water_abnormal" && this.tbdata[7].whether.radio == 1 ||
481
-          this.tbdata[8].fieldValue == "grain_abnormal" && this.tbdata[8].whether.radio == 1
482
-        ) {
483
-          this.data3.anomalousStatus = 1
484
-          console.log(this.data3.anomalousStatus,'异常触发')
485
-        }else if(
486
-          (this.tbdata[6].fieldValue == "pest_abnormal"  && this.tbdata[6].whether.radio == 0) &&
487
-          (this.tbdata[7].fieldValue == "water_abnormal" && this.tbdata[7].whether.radio == 0) &&
488
-          (this.tbdata[8].fieldValue == "grain_abnormal" && this.tbdata[8].whether.radio == 0)
489
-        ){
490
-          this.data3.anomalousStatus = 0
491
-          console.log(this.data3.anomalousStatus,'this.data3.anomalousStatus')
607
+      // 重构--时间字段名称改变
608
+      this.tbdata[index].createDate = time
609
+      // 动态的把当前检查项作为对象名称保存到grainConditionRecordChildren
610
+      // this.data5.grainConditionRecordChildren
492 611
 
612
+      // 判断当前数组长度是否为0,若为0 则直接新增数据,否则进行遍历看当前是否存在
613
+      // console.log(this.data5.grainConditionRecordChildren.length, "length...")
614
+      if (this.data5.grainConditionRecordChildren.length == 0) {
615
+        // console.log("此时数组为空,可以直接新增")
616
+        this.data5.grainConditionRecordChildren.push({
617
+          anomalousStatus: Number(val.enumOrder), //是否异常_选项(0:否,1:是)
618
+          enumId: val.enumId,
619
+          id: val.id,
620
+          operationTime: val.createDate
621
+        })
622
+      } else {
623
+        // 数组不为空时遍历数组,判断数组中是否已存在该项数据
624
+        // console.log("判断数据是否已存在")
625
+        for (const i in this.data5.grainConditionRecordChildren) {
626
+          // console.log(i, "i")
627
+          if (this.data5.grainConditionRecordChildren[i].enumId == val.enumId) {
628
+            // 数组中存在该项数据,则更新该数据
629
+            this.data5.grainConditionRecordChildren[i].anomalousStatus = Number(
630
+              val.enumOrder
631
+            )
632
+            this.data5.grainConditionRecordChildren[i].operationTime =
633
+              val.createDate
634
+            // this.data5.grainConditionRecordChildren[i].anomalousStatus = Number(val.enumOrder)
635
+            this.isExist = true
636
+            // console.log(this.isExist, "this.isExist")
637
+            break
638
+          }
493 639
         }
640
+        /* console.log(this.isExist, "isexist")
641
+        if (!this.isExist) {
642
+          console.log("数组中无此元素,可以新增")
643
+          this.data5.grainConditionRecordChildren.push({
644
+            anomalousStatus: Number(val.enumOrder), //是否异常_选项(0:否,1:是)
645
+            enumId: val.enumId,
646
+            id: val.id,
647
+            operationTime: val.createDate
648
+          })
649
+        } */
650
+      }
494 651
 
495
-      // console.log(this.data3.checkDescribe,'this.data3.checkDescribe....')
496
-      let len = Object.getOwnPropertyNames(this.data3.checkDescribe).length - 1
652
+      // console.log(
653
+      //   this.data5.grainConditionRecordChildren,
654
+      //   "this.data5.grainConditionRecordChildren....."
655
+      // )
656
+      // console.log(this.data5,'this.data5------')
657
+      // enumId: 189(虫害异常)、190(水分检测异常)、191(异常粮情)
658
+      var count = 0
659
+      this.data5.grainConditionRecordChildren.forEach(item => {
660
+        if (item.anomalousStatus != undefined) {
661
+          count += 1
662
+          // console.log(count,'count')
663
+        }
664
+      })
665
+      // let len = this.data5.grainConditionRecordChildren.length
497 666
       // console.log(len,'len............')
498
-      //判断map对象的长度,改变暂存按钮的状态
499
-      if (len < 14) {
667
+      //判断数组的长度,改变暂存按钮的状态
668
+      if (count < 14) {
500 669
         this.flag = false
501
-        this.data3.recordStatus = 0
670
+        this.data5.grainConditionRecord.recordStatus = 0
671
+        // this.data3.recordStatus = 0
502 672
       } else {
503 673
         this.flag = true
504
-        this.data3.recordStatus = 1
674
+        this.data5.grainConditionRecord.recordStatus = 1
675
+        // this.data3.recordStatus = 1
505 676
       }
506 677
       // console.log(val.whether.radio)
507 678
       // 通过判断radio值是否为1,控制异常项弹出框 (单选框1:是 0:否)
508
-      if (val.whether.radio == 1) {
509
-        if (val.fieldValue == "pest_abnormal") {
510
-          this.dialogFormVisible = true
511
-        }
512
-        if (val.fieldValue == "water_abnormal") {
513
-          this.dialogFormVisible1 = true
514
-        }
515
-        if (val.fieldValue == "grain_abnormal") {
516
-          // console.log("进了粮情异常表单")
517
-          this.dialogFormVisible2 = true
518
-        }
519
-
679
+      if (val.enumId == 189 && val.enumOrder == 1) {
680
+        // console.log('触发虫害异常')
681
+        this.dialogFormVisible = true
682
+      }
683
+      if (val.enumId == 190 && val.enumOrder == 1) {
684
+        // console.log('触发水分异常')
685
+        this.dialogFormVisible1 = true
686
+      }
687
+      if (val.enumId == 191 && val.enumOrder == 1) {
688
+        // console.log('触发粮情异常')
689
+        this.dialogFormVisible2 = true
520 690
       }
691
+
521 692
       //判断异常项是否被选中是,选中则改变异常状态
522 693
     },
523 694
     // 暂存或者保存
524 695
     saveInfo() {
525
-      this.data3.grainAbnormalDescribe = this.form
526
-      this.data3.checkTime = getDateTimeNow()
696
+      // this.data3.grainAbnormalDescribe = this.form
697
+      // this.data3.checkTime = getDateTimeNow()
698
+      this.data5.grainConditionRecord.operationTime = getDateTimeNow()
699
+      /* this.data5.grainConditionRecord.depotId = this.depot_id
700
+       this.data5.grainConditionRecord.houseId = this.house_id */
527 701
       // console.log(this.data3.checkTime,'this.data3.checkTime')
528 702
       this.loading = true
529 703
       if (this.type == "2") {
530
-        this.data3.depotId = this.depot_id
531
-        this.data3.houseId = this.house_id
532
-        console.log(this.house_id, "house_id")
533
-        console.log(this.data3.houseId, "this.data3.houseId...")
534
-        this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
704
+        this.data5.grainConditionRecord.depotId = this.depot_id
705
+        this.data5.grainConditionRecord.houseId = this.house_id
706
+        // console.log(this.house_id, "house_id")
707
+        // console.log(this.data3.houseId, "this.data3.houseId...")
708
+        // this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
709
+        // 如果有异常项,则分别给异常项赋值对应的字典表id
710
+        this.data5.grainConditionRecordChildren.forEach(ele => {
711
+          if (ele.enumId == 189 && ele.anomalousStatus == 1) {
712
+            this.data5.grainConditionRecord.insectPestError = ele.enumId
713
+          } else if (ele.enumId == 190 && ele.anomalousStatus == 1) {
714
+            this.data5.grainConditionRecord.wetCheckError = ele.enumId
715
+          } else if (ele.enumId == 191 && ele.anomalousStatus == 1) {
716
+            this.data5.grainConditionRecord.grainError = ele.enumId
717
+          }
718
+          //  判断异常项是否被选中 '是'
719
+          if (
720
+            (ele.enumId == 189 && ele.anomalousStatus == 1) ||
721
+            (ele.enumId == 190 && ele.anomalousStatus == 1) ||
722
+            (ele.enumId == 191 && ele.anomalousStatus == 1)
723
+          ) {
724
+            ele.errorDescribed = JSON.stringify(this.form)
725
+            // console.log(ele,'ele.............')
726
+            if (
727
+              this.data5.grainConditionRecord.anomalousStatus == 0 ||
728
+              this.data5.grainConditionRecord.anomalousStatus == null
729
+            ) {
730
+              this.data5.grainConditionRecord.anomalousStatus = 1
731
+              // console.log(
732
+              //   this.data5.grainConditionRecord.anomalousStatus,
733
+              //   "触发异常"
734
+              // )
735
+            }
736
+          } /* else if(this.data5.grainConditionRecord.anomalousStatus == 1){
737
+          this.data5.grainConditionRecord.anomalousStatus = 0
738
+          console.log(this.data5.grainConditionRecord.anomalousStatus,'异常解除')
739
+        } */
740
+        })
741
+        console.log(JSON.parse(JSON.stringify(this.data5)), "this.data5----")
535 742
 
536
-        addInfo(this.data3)
743
+        addInfo(JSON.parse(JSON.stringify(this.data5)))
537 744
           .then(res => {
538
-            console.log(this.data3, "this.data3")
539
-            console.log(res,'res222111...')
540
-            console.log('新增成功........')
745
+            // console.log(this.data3, "this.data3")
746
+            // console.log(res, "res222111...")
747
+
748
+            if (res.code == 200) {
749
+              // console.log(res,'res=200')
750
+              // console.log("新增成功........")
541 751
               this.loading = false
542 752
               this.$message({
543
-              message: "新增成功!",
544
-              type: "success"
545
-            })
546
-            this.$router.push({
547
-              path: "/reservesManagement/grainCheck/newGrain"
548
-            })
549
-            if (res.code == 200) {
753
+                message: "新增成功!",
754
+                type: "success"
755
+              })
756
+              this.$router.push({
757
+                path: "/reservesManagement/grainCheck/newGrain"
758
+              })
550 759
 
551 760
               if (!(JSON.stringify(this.data2) == {})) {
552 761
                 if (
@@ -557,14 +766,14 @@ export default {
557 766
                   //当选项全部被选中后调用接口
558 767
                   let auditState = 4 //4 是已完成
559 768
                   //判断是否切换仓房,或者仓房发生改变
560
-                  console.log(this.house_id,this.data2.houseId,'houseId')
769
+                  // console.log(this.house_id, this.data2.houseId, "houseId")
561 770
                   if (this.house_id == this.data2.houseId) {
562 771
                     haveDone(this.data2.id, auditState)
563 772
                       .then(res => {
564 773
                         console.log(res, "res.......")
565 774
                       })
566 775
                       .catch(err => {
567
-                        console.log(err)
776
+                        console.log(err, "654213")
568 777
                       })
569 778
                   } else {
570 779
                     let userId = this.uid
@@ -589,18 +798,54 @@ export default {
589 798
                   }
590 799
                 }
591 800
               }
592
-
593 801
             }
594
-
595 802
           })
596 803
           .catch(err => {
597 804
             this.loading = false
598
-            console.log(err, "获取不到仓房houseId")
805
+            console.log(err, "新增错误信息")
599 806
           })
600 807
       } else if (this.type == "1" || this.type == "3") {
601
-        this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
602
-        // console.log(this.data3,'xiugai hou 的data3')
603
-        editGrainInfo(this.data3)
808
+        // this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
809
+        this.data5.grainConditionRecord.depotId = this.depot_id
810
+        this.data5.grainConditionRecord.houseId = this.house_id
811
+        // console.log(this.house_id, "house_id")
812
+        // console.log(this.data3.houseId, "this.data3.houseId...")
813
+        // this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
814
+        // 如果有异常项,则分别给异常项赋值对应的字典表id
815
+        this.data5.grainConditionRecordChildren.forEach(ele => {
816
+          if (ele.enumId == 189 && ele.anomalousStatus == 1) {
817
+            this.data5.grainConditionRecord.insectPestError = ele.enumId
818
+          } else if (ele.enumId == 190 && ele.anomalousStatus == 1) {
819
+            this.data5.grainConditionRecord.wetCheckError = ele.enumId
820
+          } else if (ele.enumId == 191 && ele.anomalousStatus == 1) {
821
+            this.data5.grainConditionRecord.grainError = ele.enumId
822
+          }
823
+          //  判断异常项是否被选中 '是'
824
+          if (
825
+            (ele.enumId == 189 && ele.anomalousStatus == 1) ||
826
+            (ele.enumId == 190 && ele.anomalousStatus == 1) ||
827
+            (ele.enumId == 191 && ele.anomalousStatus == 1)
828
+          ) {
829
+            ele.errorDescribed = JSON.stringify(this.form)
830
+            // console.log(ele,'ele.............')
831
+            if (
832
+              this.data5.grainConditionRecord.anomalousStatus == 0 ||
833
+              this.data5.grainConditionRecord.anomalousStatus == null
834
+            ) {
835
+              this.data5.grainConditionRecord.anomalousStatus = 1
836
+              // console.log(
837
+              //   this.data5.grainConditionRecord.anomalousStatus,
838
+              //   "触发异常"
839
+              // )
840
+            }
841
+          } /* else if(this.data5.grainConditionRecord.anomalousStatus == 1){
842
+          this.data5.grainConditionRecord.anomalousStatus = 0
843
+          console.log(this.data5.grainConditionRecord.anomalousStatus,'异常解除')
844
+        } */
845
+        })
846
+        console.log(JSON.parse(JSON.stringify(this.data5)), "this.data5----")
847
+        console.log(this.data5, "xiugai hou 的data5")
848
+        editGrainInfo(this.data5)
604 849
           .then(res => {
605 850
             this.loading = true
606 851
             // console.log(res,'修改后的数据...')
@@ -622,7 +867,29 @@ export default {
622 867
       }
623 868
     },
624 869
     // 取消按钮
625
-    cancel() {
870
+    cancel(a) {
871
+      if (a == "abnormalPest") {
872
+        // 虫害异常
873
+        /*  console.log(this.form.pestDensity,'pestDensity')
874
+        console.log(this.form.occurPosition,'occurPosition')
875
+        console.log(this.form.occurArea,'occurArea')
876
+        console.log(this.form.pestType,'pestType') */
877
+
878
+        this.dialogFormVisible = false
879
+      } else if (a == "abnormalWater") {
880
+        // 水分检测异常
881
+        // console.log(this.form.abnormalWater,'abnormalWater')
882
+
883
+        this.dialogFormVisible1 = false
884
+      } else if (a == "abnormalGrain") {
885
+        // 粮情异常
886
+        // console.log(this.form.abnormalGrain,'abnormalGrain')
887
+
888
+        this.dialogFormVisible2 = false
889
+      }
890
+    },
891
+    // 返回按钮
892
+    back() {
626 893
       // 判断一下是从最新粮情进的新增还是从全部粮情的查看修改进来的
627 894
       if (this.type == "2") {
628 895
         this.$router.push({

+ 256 - 101
shanXiPlatform/src/views/reservesManagement/grainCheck/newGrain/index.vue

@@ -15,9 +15,31 @@
15 15
           width="50px"
16 16
           sortable
17 17
         />
18
-        <el-table-column prop="checkPerson" label="检查类型" align="center" />
19
-        <el-table-column prop="checkTime" label="最后记录时间" align="center" />
20
-        <el-table-column prop="recordStatus" label="状态" align="center">
18
+        <el-table-column prop="enumId" label="检查类型" align="center">
19
+          <template slot-scope="scope">
20
+            <p v-for="item in grainKind" :key="item.enumId">
21
+              <span v-if="scope.row.enumId == item.enumId">{{
22
+                item.enumName
23
+              }}
24
+              </span>
25
+            </p>
26
+          </template>
27
+        </el-table-column>
28
+        <!-- operationTime -->
29
+        <el-table-column
30
+          prop="operationTime"
31
+          label="最后记录时间"
32
+          align="center"
33
+        >
34
+          <template slot-scope="scope">
35
+            <span>{{
36
+              scope.row.operationTime == null
37
+                ? scope.row.operationTime
38
+                : scope.row.operationTime.slice(0, 16)
39
+            }}</span>
40
+          </template>
41
+        </el-table-column>
42
+        <el-table-column prop="recordStatus" label="状态" align="center"  width="100">
21 43
           <template slot-scope="scope">
22 44
             <!-- <div disable-transitions>
23 45
               {{
@@ -28,9 +50,7 @@
28 50
             </div> -->
29 51
             <div
30 52
               disable-transitions
31
-              v-if="
32
-                scope.row.recordStatus == '' || scope.row.recordStatus == null
33
-              "
53
+              v-if="scope.row.recordStatus == null"
34 54
             ></div>
35 55
             <!--  <div
36 56
               class="yellow"
@@ -42,22 +62,16 @@
42 62
             <!-- <div class="green" disable-transitions v-if="scope.row.recordStatus == '1'">
43 63
               已完成
44 64
             </div> -->
45
-            <p
46
-              v-if="scope.row.recordStatus == '1'"
47
-              style="height:45px;line-height:45px;margin:0 ; padding-top:7px;"
48
-            >
65
+            <p v-if="scope.row.recordStatus == '1'">
49 66
               <span>已完成</span>
50 67
             </p>
51
-            <p
52
-              v-if="scope.row.recordStatus == '0'"
53
-              style="height:45px;line-height:45px;margin:0 ; padding-top:7px;"
54
-            >
68
+            <p v-if="scope.row.recordStatus == '0'">
55 69
               <span>进行中</span>
56 70
             </p>
57 71
           </template>
58 72
         </el-table-column>
59 73
         <!-- :formatter="formatterColumn" -->
60
-        <!-- <el-table-column prop="anomalousStatus" label="有无异常" align="center">
74
+        <el-table-column prop="anomalousStatus" label="有无异常" align="center" width="120">
61 75
           <template slot-scope="scope">
62 76
             <div
63 77
               disable-transitions
@@ -67,22 +81,32 @@
67 81
               "
68 82
             ></div>
69 83
             <div disable-transitions v-if="scope.row.anomalousStatus == '0'">
70
-              无
84
+              <!-- 无 -->
85
+              <span class="colorspano"></span>
71 86
             </div>
72 87
             <div disable-transitions v-if="scope.row.anomalousStatus == '1'">
73
-              有
88
+              <!-- 有 -->
89
+              <span class="colorspant"></span>
74 90
             </div>
75 91
           </template>
76 92
         </el-table-column>
77
-         <el-table-column prop="checkList" label="异常项" align="center" >
93
+        <el-table-column prop="checkList" label="异常项" align="center"  width="250">
78 94
           <template slot-scope="scope">
79
-            <div
80
-
81
-              disable-transitions
82
-              >{{ scope.row.waterAbnormal== '1'?'水分检测异常': '' }} {{ scope.row.grainAbnormal== '1'?'粮情异常': ''}} {{scope.row.pestAbnormal == '1'?'虫害异常': ''}} </div
83
-            >
95
+            <div disable-transitions>
96
+              <p class="anomalousItem" v-for="item in checkItems" :key="item.enumId">
97
+              <span v-show="scope.row.insectPestError == item.enumId">
98
+                {{item.enumName}}
99
+              </span>
100
+              <span v-show="scope.row.grainError == item.enumId">
101
+                {{item.enumName}}
102
+              </span>
103
+              <span v-show="scope.row.wetCheckError == item.enumId">
104
+                 {{item.enumName}}
105
+              </span>
106
+            </p>
107
+            </div>
84 108
           </template>
85
-        </el-table-column> -->
109
+        </el-table-column>
86 110
         <el-table-column
87 111
           prop="operation"
88 112
           label="操作"
@@ -96,10 +120,10 @@
96 120
               style="border:1px solid seagreen;color:seagreen"
97 121
               @click="add(2, scope.$index, scope.row)"
98 122
               v-if="
99
-                (scope.row.checkPerson == '保管员每周检查粮情' && $tools.IsPermission(131)) ||
100
-                (scope.row.checkPerson == '主管科长每2周检查粮情' && $tools.IsPermission(206)) ||
101
-                (scope.row.checkPerson == '分管副总每月检查粮情' && $tools.IsPermission(207)) ||
102
-                (scope.row.checkPerson == '总经理每季检查粮情' && $tools.IsPermission(208))
123
+                (scope.row.enumId == 19 && $tools.IsPermission(131)) ||
124
+                  (scope.row.enumId == 20 && $tools.IsPermission(206)) ||
125
+                  (scope.row.enumId == 21 && $tools.IsPermission(207)) ||
126
+                  (scope.row.enumId == 22 && $tools.IsPermission(208))
103 127
               "
104 128
               :disabled="flag"
105 129
               >新增</el-button
@@ -126,7 +150,9 @@ import {
126 150
   addInfo,
127 151
   getDateTimeNow,
128 152
   haveDone,
129
-  haveDone1
153
+  haveDone1,
154
+  getGrainItems,
155
+  getGrainAll
130 156
 } from "@/api/grainCheck/index"
131 157
 export default {
132 158
   name: "NewGrain",
@@ -136,6 +162,7 @@ export default {
136 162
       userInfo: "",
137 163
       role: "", //用户角色
138 164
       uid: "",
165
+      depotDic:'',
139 166
       //库id
140 167
       depotId: "",
141 168
       // 仓房id
@@ -143,45 +170,66 @@ export default {
143 170
       // 最新粮情数据
144 171
       abnormalItems: [],
145 172
       data: [],
146
-      sortData: [],
147
-      data2: {},
148
-      // back:'',
149
-      //待办跳转过来改变其他的选项的新增按钮不能点击
150
-      flag: false,
151
-      /*   newGrainData: [
173
+      sortData: [
152 174
         {
153
-          checkPerson: "保管员每周检查粮情",
154
-          checkTime: "",
155
-          recordStatus: "",
156
-          anomalousStatus: "",
157
-          checkList: "",
158
-          id: 1
175
+          id: null,
176
+          enumId: 22,
177
+          operationTime: null,
178
+          recordStatus: null,
179
+          anomalousStatus: null,
180
+          checkPerson: null,
181
+          houseId: null,
182
+          depotId: null,
183
+          checkYear: null,
184
+          checkYearWeek: null,
185
+          enumOrder: null
159 186
         },
160 187
         {
161
-          checkPerson: "主管科长每两周检查粮情",
162
-          checkTime: "",
163
-          recordStatus: "",
164
-          anomalousStatus: "",
165
-          checkList: "",
166
-          id: 2
188
+          id: null,
189
+          enumId: 21,
190
+          operationTime: null,
191
+          recordStatus: null,
192
+          anomalousStatus: null,
193
+          checkPerson: null,
194
+          houseId: null,
195
+          depotId: null,
196
+          checkYear: null,
197
+          checkYearWeek: null,
198
+          enumOrder: null
167 199
         },
168 200
         {
169
-          checkPerson: "分管副总每月检查粮情",
170
-          checkTime: "",
171
-          recordStatus: "",
172
-          anomalousStatus: "",
173
-          checkList: "",
174
-          id: 3
201
+          id: null,
202
+          enumId: 19,
203
+          operationTime: null,
204
+          recordStatus: null,
205
+          anomalousStatus: null,
206
+          checkPerson: null,
207
+          houseId: null,
208
+          depotId: null,
209
+          checkYear: null,
210
+          checkYearWeek: null,
211
+          enumOrder: null
175 212
         },
176 213
         {
177
-          checkPerson: "总经理每季检查粮情",
178
-          checkTime: "",
179
-          recordStatus: "",
180
-          anomalousStatus: "",
181
-          checkList: "",
182
-          id: 4
214
+          id: 11,
215
+          enumId: 20,
216
+          operationTime: "2021-03-01 13:55:01",
217
+          recordStatus: 1,
218
+          anomalousStatus: 0,
219
+          checkPerson: 1,
220
+          houseId: 94,
221
+          depotId: 2,
222
+          checkYear: 2021,
223
+          checkYearWeek: 10,
224
+          enumOrder: 0
183 225
         }
184
-      ], */
226
+      ],
227
+      data2: {},
228
+      grainKind: [], //粮情检查类别
229
+      checkItems:[],// 保管员检查项
230
+      // back:'',
231
+      //待办跳转过来改变其他的选项的新增按钮不能点击
232
+      flag: false,
185 233
       tindex: "",
186 234
       // 先自定义后台接收数据的模板然后拼接
187 235
       data3: {
@@ -194,6 +242,7 @@ export default {
194 242
         recordStatus: "",
195 243
         anomalousStatus: "",
196 244
         ready: "",
245
+
197 246
         grainAbnormalDescribe: {
198 247
           abnormalGrain: "",
199 248
           abnormalWater: "",
@@ -203,6 +252,36 @@ export default {
203 252
           pestType: ""
204 253
         }
205 254
       },
255
+
256
+      // 重构后的新增数据模板
257
+      data5: {
258
+        grainConditionRecord: {
259
+          anomalousStatus: 0, //异常状态(0无异常,1有异常)
260
+          checkPerson: null, //检查人
261
+          // checkYear: 0,//检查年份(用于粮情异常等,做年统计)
262
+          // checkYearWeek: 0,//检查所在年第几周
263
+          depotId: null, //库id
264
+          enumId: null, //检查类型
265
+          enumOrder: 0, //用于同公共枚举同步顺序
266
+          houseId: null, //仓房id
267
+          id: null, //粮情检测记录id
268
+          operationTime: "string", //检查(操作)时间
269
+          recordStatus: 0, //记录状态(0进行中,1完成)
270
+          grainError:null, //粮情异常,值为对应的enumId
271
+          insectPestError:null, //虫害异常 值为对应的enumId
272
+          wetCheckError:null, //水分检测异常 值为对应的enumId
273
+
274
+        },
275
+        grainConditionRecordChildren: [
276
+          // {
277
+          //   anomalousStatus: 0, //是否异常_选项(0:否,1:是)
278
+          //   enumId: null, //检查类型
279
+          //   id: null, //粮情检查新增检查项
280
+          //   operationTime: "string", //操作时间
281
+          //   parentId: null //关联主表id(检查人id-保管员或总经理等)
282
+          // }
283
+        ]
284
+      },
206 285
       //如果是从待办进入的粮情,则把路由带的参数赋值给data4
207 286
       data4: {}
208 287
     }
@@ -211,12 +290,11 @@ export default {
211 290
     // console.log(decodeURIComponent(JSON.parse(this.$route.query)))
212 291
     // console.log(this.$route.query,'this.$route.query........')
213 292
     this.userInfo = JSON.parse(localStorage.getItem("userInfo"))
293
+
214 294
     console.log(this.userInfo.roleName, "this.userInfo.roleName00000000")
215
-    /* switch(this.userInfo.roleName){
216
-      case 0:
217
-        role = ''
218
-    } */
295
+    this.data5.grainConditionRecord.checkPerson = this.userInfo.uid
219 296
     this.uid = this.userInfo.uid
297
+    // 此处是从待办跳转到本页面时传递过来的参数,用data2收集保存
220 298
     this.data2 = this.$route.query
221 299
     // console.log(this.houseId,'本页面仓房号')
222 300
 
@@ -233,11 +311,12 @@ export default {
233 311
       } */
234 312
     }
235 313
     // this.id = this.$route.query.id
236
-
237 314
     this.activeName = this.$route.name
238 315
     // this.houseId = this.$store.state.houseId;
239 316
     this.depotId = this.$store.state.depotId
240 317
     // this.depotId=houseData.parentCode;
318
+    this.getGrainList()
319
+
241 320
     this.getList()
242 321
   },
243 322
   computed: {
@@ -253,22 +332,56 @@ export default {
253 332
     }
254 333
   },
255 334
   methods: {
335
+    // 获取粮情字典项
336
+    getGrainList() {
337
+      const parentId = 18 //粮情检查类型parentId
338
+      getGrainItems(parentId)
339
+        .then(res => {
340
+          console.log(res, "res字典粮情检查类型")
341
+          this.grainKind = res.data
342
+        })
343
+        .catch(err => {
344
+          console.log(err)
345
+        })
346
+      // 保管员检查类型下的检查项字典表
347
+       getGrainItems(19)
348
+          .then(res => {
349
+            if (res.code == 200) {
350
+              console.log(res, "保管员检查项字典")
351
+              this.checkItems = res.data
352
+              console.log(this.checkItems, "checkItems.......")
353
+            }
354
+          })
355
+          .catch(err => {
356
+            console.log(err)
357
+          })
358
+    },
256 359
     //获取最新粮情
257 360
     getList() {
258 361
       // let userinfo =JSON.parse(localStorage.getItem("userInfo"))
259 362
       // console.log(JSON.parse(userinfo),'userInfo')
260
-      // console.log(userinfo.depotId)
363
+      // console.log(userinfo.depotId,'userinfo.depotId')
261 364
       // console.log('121111........')
262
-      let condition = {
263
-        houseId: /* (this.houseId ==null || this.houseId ==undefined)?  */ this.houseId ,
264
-        depotId: this.depotId
265
-      }
365
+      // let condition = {
366
+      //   houseId: /* (this.houseId ==null || this.houseId ==undefined)?  */ this.houseId ,
367
+      //   depotId: this.depotId
368
+      // }
266 369
       // console.log(JSON.stringify(condition),'1111')
370
+      // let data = {
371
+
372
+      //   condition: JSON.stringify(condition)
373
+      // }
267 374
       let data = {
268
-        /* pageIndex: 1,
269
-        pageSize: 10, */
270
-        condition: JSON.stringify(condition)
375
+        depotId:
376
+          this.depotId !== null || this.depotId !== undefined
377
+            ? this.depotId
378
+            : this.userInfo.depotId,
379
+        houseId:
380
+          this.houseId !== null || this.houseId !== undefined
381
+            ? this.houseId
382
+            : 94
271 383
       }
384
+      console.log(data, "data")
272 385
       getNewGrainInfo(data)
273 386
         .then(res => {
274 387
           console.log(res.data, "res000")
@@ -283,22 +396,24 @@ export default {
283 396
     sort() {
284 397
       var sortdata = this.data
285 398
       // 如果sortData是空的,使用splice进行排序,不准确
286
-      this.sortData = [0, 0, 0, 0]
399
+      // this.sortData = [0, 0, 0, 0]
400
+
401
+      console.log(this.sortData,'sortData.......')
287 402
       if (sortdata.length !== 0) {
288 403
         for (let i = 0; i < sortdata.length; i++) {
289
-          if (sortdata[i].checkPerson == "总经理每季检查粮情") {
404
+          if (sortdata[i].enumId == 22) {
290 405
             console.log(sortdata[i], "总经理 ")
291 406
             this.sortData.splice(0, 1, sortdata[i])
292 407
           }
293
-          if (sortdata[i].checkPerson == "分管副总每月检查粮情") {
408
+          if (sortdata[i].enumId == 21) {
294 409
             console.log(this.data[i], "分管副总")
295 410
             this.sortData.splice(1, 1, sortdata[i])
296 411
           }
297
-          if (sortdata[i].checkPerson === "主管科长每2周检查粮情") {
412
+          if (sortdata[i].enumId === 20) {
298 413
             console.log(this.data[i], "主管科长")
299 414
             this.sortData.splice(2, 1, sortdata[i])
300 415
           }
301
-          if (sortdata[i].checkPerson == "保管员每周检查粮情") {
416
+          if (sortdata[i].enumId == 19) {
302 417
             console.log(this.data[i], "保管员")
303 418
             this.sortData.splice(3, 1, sortdata[i])
304 419
           }
@@ -318,16 +433,24 @@ export default {
318 433
       }
319 434
     },
320 435
     // 除保管员外弹窗
321
-    open(val) {
436
+    open(val,index) {
322 437
       // console.log(this.$route.query, "保管员外的角色")
438
+      console.log(val, "val...")
439
+      console.log(index,'index')
440
+      this.data5.grainConditionRecord.depotId = this.depotId
441
+      this.data5.grainConditionRecord.houseId = this.houseId
442
+      this.data5.grainConditionRecord.enumId = val.enumId
443
+      console.log(val.enumId, "当前角色信息id")
444
+      console.log(this.grainKind, "角色类别字典")
445
+      var item = this.grainKind.find(item => item.enumId == val.enumId)
446
+      console.log(item.enumName, "item")
447
+      console.log(item,'item数据')
323 448
 
324
-      val.depotId = this.depotId
325
-      val.houseId = this.houseId
326
-      // console.log(val, "当前角色信息")
327 449
       // console.log(this.data2,'this.data2..........')
328 450
       const h = this.$createElement
329 451
       this.$msgbox({
330
-        title: "新增" + val.checkPerson,
452
+        // title: "新增" + val.checkPerson,
453
+        title: "新增" + item.enumName,
331 454
         /* message: h('p', null, [
332 455
             h('span', null, '内容可以是 '),
333 456
             h('i', { style: 'color: teal' }, 'VNode')
@@ -341,8 +464,16 @@ export default {
341 464
           if (action === "confirm") {
342 465
             instance.confirmButtonLoading = true
343 466
             // instance.type = success
344
-            val.recordStatus = 1
345
-            val.checkTime = getDateTimeNow()
467
+            this.data5.grainConditionRecord.recordStatus = 1
468
+            // operationTime
469
+            this.data5.grainConditionRecord.operationTime = getDateTimeNow()
470
+            console.log(this.sortData,'sortData')
471
+            console.log(this.sortData[index],'sortData[index]')
472
+            // 临时修改对应项的操作时间,造成数据实时更新的假象,实际更新需要重新刷新
473
+            this.sortData[index].operationTime = getDateTimeNow()
474
+            this.sortData[index].recordStatus = 1
475
+            this.sortData[index].anomalousStatus = 0
476
+
346 477
             instance.confirmButtonText = "新增中..."
347 478
             setTimeout(() => {
348 479
               done()
@@ -355,9 +486,14 @@ export default {
355 486
           }
356 487
         }
357 488
       }).then(action => {
358
-        addInfo(val)
489
+        // 此处新增参数应该改为data5模板
490
+        console.log(this.data5, "this.data5...")
491
+        addInfo(this.data5)
359 492
           .then(res => {
493
+            console.log(res, "res增")
360 494
             if (res.code == 200) {
495
+              // this.sortData.operationTime = this.data5.grainConditionRecord.operationTime
496
+
361 497
               console.log(this.houseId, "this.houseId")
362 498
               console.log(this.data2.houseId, "this.data2.houseId")
363 499
               let auditState = 4 //4 是已完成
@@ -384,15 +520,20 @@ export default {
384 520
                   })
385 521
               }
386 522
               console.log(res, "新增成功")
523
+              this.$message({
524
+                type: "success",
525
+                message: "新增成功"
526
+              })
527
+            } else {
528
+              this.$message({
529
+                type: "err",
530
+                message: res.msg
531
+              })
387 532
             }
388 533
           })
389 534
           .catch(err => {
390 535
             console.log(err)
391 536
           })
392
-        this.$message({
393
-          type: "success",
394
-          message: "新增成功 "
395
-        })
396 537
       })
397 538
     },
398 539
     // 新增按钮
@@ -405,8 +546,10 @@ export default {
405 546
       if (Object.keys(this.data2).length === 0) {
406 547
         //query为空是正常操作
407 548
         // console.log(id,'query为空')
408
-        if (row.checkPerson == "保管员每周检查粮情") {
409
-          row.checkTime = getDateTimeNow()
549
+        // if (row.checkPerson == "保管员每周检查粮情") {
550
+        if (row.enumId == 19) {
551
+          // operationTime
552
+          row.operationTime = getDateTimeNow()
410 553
           // console.log(row.checkTime,'time')
411 554
           // console.log(this.data2,' back: this.data2')
412 555
           this.$router.push({
@@ -414,8 +557,8 @@ export default {
414 557
             query: { type: type, pid: row.id, data: row }
415 558
           })
416 559
         } else {
417
-          // console.log("科长,副总,总经理")
418
-          this.open(row)
560
+          console.log(row, "科长,副总,总经理")
561
+          this.open(row,index)
419 562
         }
420 563
       } else if (Object.keys(this.data2).length !== 0) {
421 564
         //query不为空是从待办跳过来的
@@ -423,12 +566,14 @@ export default {
423 566
         // console.log(this.data2, "query 不 为空 ")
424 567
         // console.log(this.data2.workName, "query.workName............")
425 568
         // console.log(this.data2,'this.data2...')
426
-        if (row.checkPerson == "保管员每周检查粮情") {
569
+        if (row.enumId == 19) {
570
+          // 19是保管员
427 571
           // console.log(this.data2.workName,'this.data2.workName')
428 572
           // console.log(row.checkPerson,'row.checkPerson')
429 573
           if (this.data2.workName == "保管员每周粮情检查") {
430 574
             //保管员待办
431
-            row.checkTime = getDateTimeNow()
575
+            // operationTime
576
+            row.operationTime = getDateTimeNow()
432 577
             this.$router.push({
433 578
               path: "/grainCheck/addNewGrain",
434 579
               query: {
@@ -440,7 +585,7 @@ export default {
440 585
             })
441 586
           }
442 587
           // console.log('保管员')
443
-          /*         console.log(row, "row....")
588
+          /*
444 589
         console.log(this.data, "data111") */
445 590
           /*  row.checkTime = getDateTimeNow()
446 591
           // console.log(row.checkTime,'time')
@@ -450,7 +595,7 @@ export default {
450 595
           }) */
451 596
         } else {
452 597
           // console.log("科长,副总,总经理")
453
-          this.open(row)
598
+          this.open(row,index)
454 599
         }
455 600
       }
456 601
       // console.log(row,'111000')
@@ -505,7 +650,7 @@ export default {
505 650
   font-size: 13px;
506 651
 }
507 652
 .colorspano {
508
-  width: 140px;
653
+  width: 100px;
509 654
   height: 30px;
510 655
   background-color: #199856;
511 656
   display: inline-block;
@@ -514,7 +659,7 @@ export default {
514 659
   line-height: 30px;
515 660
 }
516 661
 .colorspant {
517
-  width: 140px;
662
+  width: 100px;
518 663
   height: 30px;
519 664
   background-color: #ffff00;
520 665
   display: inline-block;
@@ -523,10 +668,20 @@ export default {
523 668
   line-height: 30px;
524 669
 }
525 670
 .colorspanr {
526
-  width: 140px;
671
+  width: 100px;
527 672
   height: 30px;
528 673
   background-color: #ff9933;
529 674
   display: inline-block;
530 675
   border-radius: 5px;
531 676
 }
677
+.anomalousItem{
678
+  display: inline-block;
679
+  word-break: keep-all;
680
+  white-space: nowrap;
681
+  font-size: 12px;
682
+  font-weight: 800;
683
+  span {
684
+    padding-right: 5px;
685
+  }
686
+}
532 687
 </style>

+ 5 - 5
shanXiPlatform/src/views/systemManagement/userManagement/approverManagement/index.vue

@@ -59,9 +59,9 @@ export default {
59 59
             //库id
60 60
             depotId: 1,
61 61
             roleArr: [],
62
-            //33--主管科长   35---分管副总经理   34---总经理  54--分公司主管
62
+            //33--主管科长   35---分管副总经理   34---总经理  37--分公司主管
63 63
             //角色id
64
-            rolesId: "33,34,35,54",
64
+            rolesId: "33,34,35,37",
65 65
             //初始化审批人下拉选
66 66
             approverSelect: [],
67 67
             // 表格数据初始化
@@ -539,7 +539,7 @@ export default {
539 539
                             } else if (
540 540
                                 item.title.indexOf("分公司主管处室") != -1
541 541
                             ) {
542
-                                this.$set(item, "approverSelect", res.data[54])
542
+                                this.$set(item, "approverSelect", res.data[37])
543 543
                             }
544 544
                         })
545 545
                     }
@@ -553,9 +553,9 @@ export default {
553 553
             if (this.type == "tf") {
554 554
                 this.tableData = this.meVentilation
555 555
             } else if (this.type == "xzjh") {
556
-                this.tableData = this.fumigation
556
+                // this.tableData = this.fumigation
557 557
             } else if (this.type == "xzsq") {
558
-                this.tableData = this.fumigation1
558
+                // this.tableData = this.fumigation1
559 559
             } else if (this.type == "yjcg") {
560 560
                 this.tableData = this.drugPurchase
561 561
             } else if (this.type == "yjly") {