|
@@ -3,7 +3,7 @@
|
3
|
3
|
<div class="system-table-search">
|
4
|
4
|
<div class="flex-h">
|
5
|
5
|
<div class="flex-item flex-h">
|
6
|
|
- <el-button size="mini" type="success" @click='addRecord'>新增</el-button>
|
|
6
|
+ <el-button size="mini" type="success" @click='addVisible = true'>新增</el-button>
|
7
|
7
|
</div>
|
8
|
8
|
<ul>
|
9
|
9
|
<li>
|
|
@@ -43,7 +43,7 @@
|
43
|
43
|
</el-table-column>
|
44
|
44
|
<el-table-column fixed='right' label="操作" width="300">
|
45
|
45
|
<template slot-scope="scope">
|
46
|
|
- <el-button size="mini" type="warning" @click="handleReport(scope.$index, scope.row)">导出Excel</el-button>
|
|
46
|
+ <el-button size="mini" type="warning" @click="handleReport(scope.row)">导出Excel</el-button>
|
47
|
47
|
</template>
|
48
|
48
|
</el-table-column>
|
49
|
49
|
</el-table>
|
|
@@ -113,14 +113,18 @@
|
113
|
113
|
import { createNamespacedHelpers, mapState } from 'vuex'
|
114
|
114
|
|
115
|
115
|
const { mapState: mapRecordState, mapActions: mapRecordActions } = createNamespacedHelpers('caserecord')
|
|
116
|
+const { mapState: mapOrdersState, mapActions: mapOrdersActions } = createNamespacedHelpers('goodsorder')
|
116
|
117
|
|
117
|
118
|
export default {
|
118
|
119
|
name: '',
|
119
|
120
|
data () {
|
120
|
121
|
return {
|
121
|
122
|
addVisible: false,
|
|
123
|
+ excelData: [],
|
122
|
124
|
detail: {
|
123
|
125
|
CaseId: '',
|
|
126
|
+ Month: '',
|
|
127
|
+ Num: 0,
|
124
|
128
|
},
|
125
|
129
|
postData: {
|
126
|
130
|
caseid: '',
|
|
@@ -137,37 +141,77 @@ export default {
|
137
|
141
|
...mapRecordState({
|
138
|
142
|
records: x => x.recordList,
|
139
|
143
|
}),
|
|
144
|
+ ...mapOrdersState({
|
|
145
|
+ orders: x => x.recordOrders,
|
|
146
|
+ }),
|
140
|
147
|
CaseId: {
|
141
|
148
|
get () {
|
142
|
|
- return this.caseid || this.defaultCaseId
|
|
149
|
+ return this.postData.caseid || this.defaultCaseId
|
143
|
150
|
},
|
144
|
151
|
set (val) {
|
145
|
|
- this.caseid = val
|
|
152
|
+ this.postData.caseid = val
|
146
|
153
|
}
|
147
|
|
- }
|
|
154
|
+ },
|
148
|
155
|
},
|
149
|
156
|
methods: {
|
150
|
157
|
...mapRecordActions([
|
151
|
158
|
'GetRecordList',
|
|
159
|
+ 'AddRecord',
|
|
160
|
+ ]),
|
|
161
|
+ ...mapOrdersActions([
|
|
162
|
+ 'GetOrdersByRecord',
|
152
|
163
|
]),
|
153
|
164
|
getCaseName (caseid) {
|
154
|
165
|
return ((this.cases.filter(x => x.CaseId === caseid) || [])[0] || {}).CaseName
|
155
|
166
|
},
|
156
|
|
- addRecord () {
|
157
|
|
- this.addVisible = true
|
158
|
|
- },
|
159
|
167
|
search () {
|
160
|
168
|
this.getList()
|
161
|
169
|
},
|
162
|
170
|
submit () {
|
|
171
|
+ if (this.detail.CaseId === '') {
|
|
172
|
+ this.$message({
|
|
173
|
+ type: 'error',
|
|
174
|
+ message: '请先选择对应案场!'
|
|
175
|
+ })
|
|
176
|
+ return
|
|
177
|
+ }
|
|
178
|
+ if (this.detail.Month === '') {
|
|
179
|
+ this.$message({
|
|
180
|
+ type: 'error',
|
|
181
|
+ message: '请先选择月份!'
|
|
182
|
+ })
|
|
183
|
+ return
|
|
184
|
+ }
|
|
185
|
+ if (this.detail.Num <= 0) {
|
|
186
|
+ this.$message({
|
|
187
|
+ type: 'error',
|
|
188
|
+ message: '请输入规定次数!'
|
|
189
|
+ })
|
|
190
|
+ return
|
|
191
|
+ }
|
|
192
|
+ this.AddRecord({...this.detail, callback: this.afterSave, Month: this.toolClass.dateFormat(this.detail.Month, 'yyyy-MM')})
|
|
193
|
+ },
|
|
194
|
+ afterSave () {
|
|
195
|
+ this.$message({
|
|
196
|
+ type: 'success',
|
|
197
|
+ message: '保存成功!'
|
|
198
|
+ })
|
|
199
|
+ this.addVisible = false
|
|
200
|
+ this.getList()
|
163
|
201
|
},
|
164
|
202
|
getList () {
|
165
|
|
- this.GetRecordList(this.postData)
|
|
203
|
+ this.GetRecordList({...this.postData, caseid: this.CaseId})
|
166
|
204
|
},
|
167
|
205
|
handleCurrentChange (val) { // 跳转到分页
|
168
|
206
|
this.postData.page = val
|
169
|
207
|
this.getList()
|
170
|
208
|
},
|
|
209
|
+ handleReport (row) {
|
|
210
|
+ this.GetOrdersByRecord({id: row.RecordId, callback: this.ordersExport})
|
|
211
|
+ },
|
|
212
|
+ },
|
|
213
|
+ mounted () {
|
|
214
|
+ this.getList()
|
171
|
215
|
}
|
172
|
216
|
}
|
173
|
217
|
</script>
|