Commit d69d36ed932e81327d60a0fc4b21686b4d5b067a
1 parent
fd6ea416
fix: 修复前端控制台报错
Showing
1 changed file
with
94 additions
and
103 deletions
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
@@ -23,17 +23,19 @@ | @@ -23,17 +23,19 @@ | ||
23 | <div class="table-operator"> | 23 | <div class="table-operator"> |
24 | <a-button v-has="'cycleCountHeader:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> | 24 | <a-button v-has="'cycleCountHeader:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> |
25 | <a-button v-has="'cycleCountHeader:export'" type="primary" icon="download" @click="handleExportXls('盘点主表')">导出</a-button> | 25 | <a-button v-has="'cycleCountHeader:export'" type="primary" icon="download" @click="handleExportXls('盘点主表')">导出</a-button> |
26 | - <a-upload v-has="'cycleCountHeader:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | 26 | + <a-upload v-has="'cycleCountHeader:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" |
27 | + :action="importExcelUrl" @change="handleImportExcel"> | ||
27 | <a-button type="primary" icon="import">导入</a-button> | 28 | <a-button type="primary" icon="import">导入</a-button> |
28 | </a-upload> | 29 | </a-upload> |
29 | <a-dropdown v-if="selectedRowKeys.length > 0"> | 30 | <a-dropdown v-if="selectedRowKeys.length > 0"> |
30 | <a-menu slot="overlay"> | 31 | <a-menu slot="overlay"> |
31 | <a-menu-item key="1" @click="batchDel"> | 32 | <a-menu-item key="1" @click="batchDel"> |
32 | - <a-icon type="delete"/> 删除 | 33 | + <a-icon type="delete" /> |
34 | + 删除 | ||
33 | </a-menu-item> | 35 | </a-menu-item> |
34 | </a-menu> | 36 | </a-menu> |
35 | <a-button style="margin-left: 8px"> 批量操作 | 37 | <a-button style="margin-left: 8px"> 批量操作 |
36 | - <a-icon type="down"/> | 38 | + <a-icon type="down" /> |
37 | </a-button> | 39 | </a-button> |
38 | </a-dropdown> | 40 | </a-dropdown> |
39 | </div> | 41 | </div> |
@@ -60,13 +62,13 @@ | @@ -60,13 +62,13 @@ | ||
60 | class="j-table-force-nowrap" | 62 | class="j-table-force-nowrap" |
61 | @change="handleTableChange"> | 63 | @change="handleTableChange"> |
62 | <!-- 内嵌table区域 begin --> | 64 | <!-- 内嵌table区域 begin --> |
63 | -<!-- <template slot="expandedRowRender" slot-scope="record">--> | ||
64 | -<!-- <a-tabs tabPosition="top">--> | ||
65 | -<!-- <a-tab-pane tab="盘点明细" key="cycleCountDetailId" forceRender>--> | ||
66 | -<!-- <cycle-count-detail-list :record="record" :isLoad="true"/>--> | ||
67 | -<!-- </a-tab-pane>--> | ||
68 | -<!-- </a-tabs>--> | ||
69 | -<!-- </template>--> | 65 | + <!-- <template slot="expandedRowRender" slot-scope="record">--> |
66 | + <!-- <a-tabs tabPosition="top">--> | ||
67 | + <!-- <a-tab-pane tab="盘点明细" key="cycleCountDetailId" forceRender>--> | ||
68 | + <!-- <cycle-count-detail-list :record="record" :isLoad="true"/>--> | ||
69 | + <!-- </a-tab-pane>--> | ||
70 | + <!-- </a-tabs>--> | ||
71 | + <!-- </template>--> | ||
70 | <!-- 内嵌table区域 end --> | 72 | <!-- 内嵌table区域 end --> |
71 | <span slot="companyCode" slot-scope="companyCode"> | 73 | <span slot="companyCode" slot-scope="companyCode"> |
72 | <a-tag :key="companyCode" color=blue> | 74 | <a-tag :key="companyCode" color=blue> |
@@ -88,9 +90,9 @@ | @@ -88,9 +90,9 @@ | ||
88 | 90 | ||
89 | <span slot="action" slot-scope="text, record"> | 91 | <span slot="action" slot-scope="text, record"> |
90 | <a v-if="record.statusCyc === 1" @click="cycleCountDetailAdd(record)">新增</a> | 92 | <a v-if="record.statusCyc === 1" @click="cycleCountDetailAdd(record)">新增</a> |
91 | - <a-divider type="vertical" v-if="record.statusCyc !== 100"/> | 93 | + <a-divider type="vertical" v-if="record.statusCyc !== 100" /> |
92 | <a-dropdown> | 94 | <a-dropdown> |
93 | - <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> | 95 | + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
94 | <a-menu slot="overlay"> | 96 | <a-menu slot="overlay"> |
95 | <a-menu-item v-has="'cycleCountHeader:edit'"> | 97 | <a-menu-item v-has="'cycleCountHeader:edit'"> |
96 | <a v-if="record.statusCyc === 1" @click="handleEdit(record)">编辑</a> | 98 | <a v-if="record.statusCyc === 1" @click="handleEdit(record)">编辑</a> |
@@ -106,7 +108,6 @@ | @@ -106,7 +108,6 @@ | ||
106 | </a-menu> | 108 | </a-menu> |
107 | </a-dropdown> | 109 | </a-dropdown> |
108 | </span> | 110 | </span> |
109 | - | ||
110 | </a-table> | 111 | </a-table> |
111 | </div> | 112 | </div> |
112 | 113 | ||
@@ -116,20 +117,20 @@ | @@ -116,20 +117,20 @@ | ||
116 | </a-tab-pane> | 117 | </a-tab-pane> |
117 | </a-tabs> | 118 | </a-tabs> |
118 | <cycle-count-header-modal ref="modalForm" @ok="modalFormOk"></cycle-count-header-modal> | 119 | <cycle-count-header-modal ref="modalForm" @ok="modalFormOk"></cycle-count-header-modal> |
119 | - <cycle-count-detail-modal ref="detailModalForm" @ok="detailModalFormOk"/> | 120 | + <cycle-count-detail-modal ref="detailModalForm" @ok="detailModalFormOk" /> |
120 | </a-card> | 121 | </a-card> |
121 | </template> | 122 | </template> |
122 | 123 | ||
123 | <script> | 124 | <script> |
124 | 125 | ||
125 | import '@/assets/less/TableExpand.less' | 126 | import '@/assets/less/TableExpand.less' |
126 | -import {mixinDevice} from '@/utils/mixin' | ||
127 | -import {JeecgListMixin} from '@/mixins/JeecgListMixin' | ||
128 | -import {getCompanyList, getCountTypeList} from '@/api/api' | 127 | +import { mixinDevice } from '@/utils/mixin' |
128 | +import { JeecgListMixin } from '@/mixins/JeecgListMixin' | ||
129 | +import { getCompanyList, getCountTypeList } from '@/api/api' | ||
129 | import CycleCountHeaderModal from './modules/CycleCountHeaderModal' | 130 | import CycleCountHeaderModal from './modules/CycleCountHeaderModal' |
130 | -import CycleCountDetailList from "./CycleCountDetailList"; | ||
131 | -import Utils from "../../../components/jeecgbiz/JButtonBizComponent/util.js" | ||
132 | -import CycleCountDetailModal from "./modules/CycleCountDetailModal"; | 131 | +import CycleCountDetailList from './CycleCountDetailList' |
132 | +import Utils from '@/components/jeecgbiz/JButtonBizComponent/util.js' | ||
133 | +import CycleCountDetailModal from './modules/CycleCountDetailModal' | ||
133 | 134 | ||
134 | export default { | 135 | export default { |
135 | name: 'CycleCountHeaderList', | 136 | name: 'CycleCountHeaderList', |
@@ -137,158 +138,148 @@ export default { | @@ -137,158 +138,148 @@ export default { | ||
137 | components: { | 138 | components: { |
138 | CycleCountDetailModal, | 139 | CycleCountDetailModal, |
139 | CycleCountHeaderModal, | 140 | CycleCountHeaderModal, |
140 | - CycleCountDetailList, | 141 | + CycleCountDetailList |
141 | }, | 142 | }, |
142 | data() { | 143 | data() { |
143 | return { | 144 | return { |
144 | - // 选择用户查询条件配置 | ||
145 | - selectUserQueryConfig: [ | ||
146 | - {key: 'locationCode', label: '库位'}, | ||
147 | - ], | ||
148 | description: '盘点主表管理页面', | 145 | description: '盘点主表管理页面', |
149 | companyList: [], | 146 | companyList: [], |
150 | - CountTypeList: [], | 147 | + countTypeList: [], |
151 | // 表头 | 148 | // 表头 |
152 | columns: [ | 149 | columns: [ |
153 | { | 150 | { |
154 | title: 'ID', | 151 | title: 'ID', |
155 | - dataIndex: '', | ||
156 | - key: 'rowIndex', | 152 | + dataIndex: 'id', |
157 | width: 60, | 153 | width: 60, |
158 | - align: "center", | ||
159 | - customRender: function (t, r, index) { | ||
160 | - return parseInt(index) + 1; | ||
161 | - } | 154 | + align: 'center' |
155 | + /* key: 'rowIndex', | ||
156 | + customRender: function(t, r, index) { | ||
157 | + return parseInt(index) + 1 | ||
158 | + }*/ | ||
162 | }, | 159 | }, |
163 | { | 160 | { |
164 | title: '盘点单编码', | 161 | title: '盘点单编码', |
165 | - align: "center", | 162 | + align: 'center', |
166 | dataIndex: 'code' | 163 | dataIndex: 'code' |
167 | }, | 164 | }, |
168 | { | 165 | { |
169 | title: '货主编码', | 166 | title: '货主编码', |
170 | - align: "center", | 167 | + align: 'center', |
171 | dataIndex: 'companyCode', | 168 | dataIndex: 'companyCode', |
172 | key: 'companyCode', | 169 | key: 'companyCode', |
173 | - scopedSlots: {customRender: 'companyCode'} | 170 | + scopedSlots: { customRender: 'companyCode' } |
174 | }, | 171 | }, |
175 | { | 172 | { |
176 | title: '总货位数', | 173 | title: '总货位数', |
177 | - align: "center", | 174 | + align: 'center', |
178 | dataIndex: 'totalLocs' | 175 | dataIndex: 'totalLocs' |
179 | }, | 176 | }, |
180 | { | 177 | { |
181 | title: '总物料数', | 178 | title: '总物料数', |
182 | - align: "center", | 179 | + align: 'center', |
183 | dataIndex: 'totalItems' | 180 | dataIndex: 'totalItems' |
184 | }, | 181 | }, |
185 | { | 182 | { |
186 | title: '盘点类型', | 183 | title: '盘点类型', |
187 | - align: "center", | 184 | + align: 'center', |
188 | dataIndex: 'countType', | 185 | dataIndex: 'countType', |
189 | key: 'countType', | 186 | key: 'countType', |
190 | - scopedSlots: {customRender: 'countType'} | 187 | + scopedSlots: { customRender: 'countType' } |
191 | }, | 188 | }, |
192 | { | 189 | { |
193 | title: '盘点主单状态', | 190 | title: '盘点主单状态', |
194 | - align: "center", | 191 | + align: 'center', |
195 | dataIndex: 'statusCyc_dictText', | 192 | dataIndex: 'statusCyc_dictText', |
196 | - scopedSlots: {customRender: 'statusCyc_dictText'} | 193 | + scopedSlots: { customRender: 'statusCyc_dictText' } |
197 | }, | 194 | }, |
198 | { | 195 | { |
199 | title: '指定盘点人员', | 196 | title: '指定盘点人员', |
200 | - align: "center", | 197 | + align: 'center', |
201 | dataIndex: 'stocktakingAs' | 198 | dataIndex: 'stocktakingAs' |
202 | }, | 199 | }, |
203 | { | 200 | { |
204 | title: '实际盘点人员', | 201 | title: '实际盘点人员', |
205 | - align: "center", | 202 | + align: 'center', |
206 | dataIndex: 'stocktakingAc' | 203 | dataIndex: 'stocktakingAc' |
207 | }, | 204 | }, |
208 | { | 205 | { |
209 | title: '是否有效', | 206 | title: '是否有效', |
210 | - align: "center", | 207 | + align: 'center', |
211 | dataIndex: 'enable_dictText' | 208 | dataIndex: 'enable_dictText' |
212 | }, | 209 | }, |
213 | { | 210 | { |
214 | title: '备注', | 211 | title: '备注', |
215 | - align: "center", | 212 | + align: 'center', |
216 | dataIndex: 'remark' | 213 | dataIndex: 'remark' |
217 | }, | 214 | }, |
218 | { | 215 | { |
219 | title: '操作', | 216 | title: '操作', |
220 | dataIndex: 'action', | 217 | dataIndex: 'action', |
221 | - align: "center", | ||
222 | - // fixed:"right", | 218 | + align: 'center', |
223 | width: 147, | 219 | width: 147, |
224 | - scopedSlots: {customRender: 'action'} | 220 | + scopedSlots: { customRender: 'action' } |
225 | } | 221 | } |
226 | ], | 222 | ], |
227 | url: { | 223 | url: { |
228 | - list: "/cycleCountHeader/cycleCountHeader/list", | ||
229 | - delete: "/cycleCountHeader/cycleCountHeader/delete", | ||
230 | - deleteBatch: "/cycleCountHeader/cycleCountHeader/deleteBatch", | ||
231 | - exportXlsUrl: "/cycleCountHeader/cycleCountHeader/exportXls", | ||
232 | - importExcelUrl: "cycleCountHeader/cycleCountHeader/importExcel", | 224 | + list: '/cycleCountHeader/cycleCountHeader/list', |
225 | + delete: '/cycleCountHeader/cycleCountHeader/delete', | ||
226 | + deleteBatch: '/cycleCountHeader/cycleCountHeader/deleteBatch', | ||
227 | + exportXlsUrl: '/cycleCountHeader/cycleCountHeader/exportXls', | ||
228 | + importExcelUrl: 'cycleCountHeader/cycleCountHeader/importExcel' | ||
233 | }, | 229 | }, |
234 | - dictOptions: { | ||
235 | - status: [], | ||
236 | - }, | ||
237 | - superFieldList: [], | 230 | + superFieldList: [] |
238 | } | 231 | } |
239 | }, | 232 | }, |
240 | created() { | 233 | created() { |
241 | - this.getSuperFieldList(); | ||
242 | - this.loadFrom(); | 234 | + this.getSuperFieldList() |
235 | + this.loadFrom() | ||
243 | }, | 236 | }, |
244 | mounted() { | 237 | mounted() { |
245 | - let that = this; | 238 | + let that = this |
246 | Utils.$on('refreshCycleCountHeader', () => { | 239 | Utils.$on('refreshCycleCountHeader', () => { |
247 | that.loadData() | 240 | that.loadData() |
248 | }) | 241 | }) |
249 | }, | 242 | }, |
250 | computed: { | 243 | computed: { |
251 | - importExcelUrl: function () { | ||
252 | - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | ||
253 | - }, | 244 | + importExcelUrl: function() { |
245 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` | ||
246 | + } | ||
254 | }, | 247 | }, |
255 | methods: { | 248 | methods: { |
256 | initDictConfig() { | 249 | initDictConfig() { |
257 | }, | 250 | }, |
258 | getSuperFieldList() { | 251 | getSuperFieldList() { |
259 | - let fieldList = []; | ||
260 | - fieldList.push({type: 'string', value: 'code', text: '盘点主表编号', dictCode: ''}) | ||
261 | - fieldList.push({type: 'string', value: 'companyCode', text: '货主编码', dictCode: ''}) | ||
262 | - fieldList.push({type: 'string', value: 'countType', text: '盘点类型', dictCode: ''}) | ||
263 | - fieldList.push({type: 'int', value: 'statusCyc', text: '盘点状态', dictCode: 'cycleCount_status'}) | ||
264 | - fieldList.push({type: 'string', value: 'remark', text: '备注', dictCode: ''}) | ||
265 | - fieldList.push({type: 'int', value: 'totalLocs', text: '总货位数', dictCode: ''}) | ||
266 | - fieldList.push({type: 'int', value: 'totalItems', text: '总物料数', dictCode: ''}) | ||
267 | - fieldList.push({type: 'string', value: 'stocktakingAs', text: '指定盘点人员', dictCode: ''}) | ||
268 | - fieldList.push({type: 'string', value: 'stocktakingAc', text: '实际盘点人员', dictCode: ''}) | ||
269 | - fieldList.push({type: 'int', value: 'enable', text: '是否有效', dictCode: 'valid_status'}) | ||
270 | - fieldList.push({type: 'datetime', value: 'uploadTime', text: '回传时间'}) | ||
271 | - fieldList.push({type: 'int', value: 'uploadStatus', text: '回传状态', dictCode: 'valid_status'}) | ||
272 | - fieldList.push({type: 'string', value: 'closedBy', text: '关闭人', dictCode: ''}) | 252 | + let fieldList = [] |
253 | + fieldList.push({ type: 'string', value: 'code', text: '盘点主表编号', dictCode: '' }) | ||
254 | + fieldList.push({ type: 'string', value: 'companyCode', text: '货主编码', dictCode: '' }) | ||
255 | + fieldList.push({ type: 'string', value: 'countType', text: '盘点类型', dictCode: '' }) | ||
256 | + fieldList.push({ type: 'int', value: 'statusCyc', text: '盘点状态', dictCode: 'cycleCount_status' }) | ||
257 | + fieldList.push({ type: 'string', value: 'remark', text: '备注', dictCode: '' }) | ||
258 | + fieldList.push({ type: 'int', value: 'totalLocs', text: '总货位数', dictCode: '' }) | ||
259 | + fieldList.push({ type: 'int', value: 'totalItems', text: '总物料数', dictCode: '' }) | ||
260 | + fieldList.push({ type: 'string', value: 'stocktakingAs', text: '指定盘点人员', dictCode: '' }) | ||
261 | + fieldList.push({ type: 'string', value: 'stocktakingAc', text: '实际盘点人员', dictCode: '' }) | ||
262 | + fieldList.push({ type: 'int', value: 'enable', text: '是否有效', dictCode: 'valid_status' }) | ||
263 | + fieldList.push({ type: 'datetime', value: 'uploadTime', text: '回传时间' }) | ||
264 | + fieldList.push({ type: 'int', value: 'uploadStatus', text: '回传状态', dictCode: 'valid_status' }) | ||
265 | + fieldList.push({ type: 'string', value: 'closedBy', text: '关闭人', dictCode: '' }) | ||
273 | this.superFieldList = fieldList | 266 | this.superFieldList = fieldList |
274 | }, | 267 | }, |
275 | onClearSelected() { | 268 | onClearSelected() { |
276 | - this.selectedRowKeys = []; | ||
277 | - this.selectionRows = []; | ||
278 | - this.selectedMainId = '' | 269 | + this.selectedRowKeys = [] |
270 | + this.selectionRows = [] | ||
279 | }, | 271 | }, |
280 | onSelectChange(selectedRowKeys, selectionRows) { | 272 | onSelectChange(selectedRowKeys, selectionRows) { |
281 | - this.selectedMainId = selectedRowKeys[0].toString(); | ||
282 | - this.selectedRowKeys = selectedRowKeys; | ||
283 | - this.selectionRows = selectionRows; | ||
284 | - this.$refs.CycleCountDetailList.loadDatas(this.selectedRowKeys[0]); | 273 | + this.selectedRowKeys = selectedRowKeys |
274 | + this.selectionRows = selectionRows | ||
275 | + this.$refs.CycleCountDetailList.loadDatas(this.selectedRowKeys[0]) | ||
285 | }, | 276 | }, |
286 | - clickThenSelect(record,index) { | 277 | + clickThenSelect(record, index) { |
287 | return { | 278 | return { |
288 | on: { | 279 | on: { |
289 | click: () => { | 280 | click: () => { |
290 | - this.selectIndex=index | ||
291 | - this.onSelectChange(record.id.toString().split(","), [record]); | 281 | + this.selectIndex = index |
282 | + this.onSelectChange([record.id], [record]) | ||
292 | } | 283 | } |
293 | } | 284 | } |
294 | } | 285 | } |
@@ -301,12 +292,12 @@ export default { | @@ -301,12 +292,12 @@ export default { | ||
301 | if (res.success) { | 292 | if (res.success) { |
302 | this.companyList = res.result | 293 | this.companyList = res.result |
303 | } | 294 | } |
304 | - }); | 295 | + }) |
305 | getCountTypeList().then((res) => { | 296 | getCountTypeList().then((res) => { |
306 | if (res.success) { | 297 | if (res.success) { |
307 | - this.CountTypeList = res.result | 298 | + this.countTypeList = res.result |
308 | } | 299 | } |
309 | - }); | 300 | + }) |
310 | }, | 301 | }, |
311 | solutionCompany(value) { | 302 | solutionCompany(value) { |
312 | let actions = [] | 303 | let actions = [] |
@@ -320,21 +311,21 @@ export default { | @@ -320,21 +311,21 @@ export default { | ||
320 | }, | 311 | }, |
321 | solutionCountType(value) { | 312 | solutionCountType(value) { |
322 | let actions = [] | 313 | let actions = [] |
323 | - Object.keys(this.CountTypeList).some((key) => { | ||
324 | - if (this.CountTypeList[key].code === ('' + value)) { | ||
325 | - actions.push(this.CountTypeList[key].name) | 314 | + Object.keys(this.countTypeList).some((key) => { |
315 | + if (this.countTypeList[key].code === ('' + value)) { | ||
316 | + actions.push(this.countTypeList[key].name) | ||
326 | return true | 317 | return true |
327 | } | 318 | } |
328 | }) | 319 | }) |
329 | return actions.join('') | 320 | return actions.join('') |
330 | }, | 321 | }, |
331 | - cycleCountDetailAdd(record){ | ||
332 | - this.$refs.detailModalForm.title = "库存"; | ||
333 | - this.$refs.detailModalForm.cycleCountHeader = record; | ||
334 | - this.$refs.detailModalForm.visible = true; | 322 | + cycleCountDetailAdd(record) { |
323 | + this.$refs.detailModalForm.title = '库存' | ||
324 | + this.$refs.detailModalForm.cycleCountHeader = record | ||
325 | + this.$refs.detailModalForm.visible = true | ||
335 | }, | 326 | }, |
336 | - detailModalFormOk(){ | ||
337 | - this.loadData(); | 327 | + detailModalFormOk() { |
328 | + this.loadData() | ||
338 | // this.searchQuery(); | 329 | // this.searchQuery(); |
339 | }, | 330 | }, |
340 | getStatusColor(status) { | 331 | getStatusColor(status) { |
@@ -343,8 +334,8 @@ export default { | @@ -343,8 +334,8 @@ export default { | ||
343 | '已登记': 'orange', | 334 | '已登记': 'orange', |
344 | '盘点完成': 'grey', | 335 | '盘点完成': 'grey', |
345 | default: 'blue' | 336 | default: 'blue' |
346 | - }; | ||
347 | - return colors[status] || colors.default; | 337 | + } |
338 | + return colors[status] || colors.default | ||
348 | }, | 339 | }, |
349 | getCountTypeColor(countType) { | 340 | getCountTypeColor(countType) { |
350 | const colors = { | 341 | const colors = { |
@@ -353,8 +344,8 @@ export default { | @@ -353,8 +344,8 @@ export default { | ||
353 | '明盘': 'cyan', | 344 | '明盘': 'cyan', |
354 | '暗盘': 'purple', | 345 | '暗盘': 'purple', |
355 | default: 'blue' | 346 | default: 'blue' |
356 | - }; | ||
357 | - return colors[countType] || colors.default; | 347 | + } |
348 | + return colors[countType] || colors.default | ||
358 | } | 349 | } |
359 | } | 350 | } |
360 | } | 351 | } |