|
@@ -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>
|