Commit b3cdd002a336718632da6c4341d7cdbe48c5d165

Authored by 谭毅彬
1 parent 8c517ce3

盘点问题修正

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/views/system/stocktaking/modules/CycleCountDetailModal.vue
... ... @@ -232,7 +232,7 @@ export default {
232 232 },
233 233 onSelectChange(selectedRowKeys, selectionRows) {
234 234 this.selectedRowKeys = selectedRowKeys;
235   - // 解决翻页后 selectionRows 没记录上一页数据的问题
  235 + // 解决翻页后 selectionRows 没记录上一页的问题
236 236 if (selectedRowKeys.length === selectionRows.length) {
237 237 this.selectionRows = selectionRows;
238 238 } else {
... ... @@ -241,17 +241,8 @@ export default {
241 241 ))
242 242 }
243 243 this.selectedTable.dataSource = this.selectionRows;
244   - this.selectedRowIds = selectionRows.map(x => x.id)
245   - this.getDetailDataSource()
246   - },
247   - handleDetailTableChange(pagination, filters, sorter) {
248   - //分页、排序、筛选变化时触发
249   - if (Object.keys(sorter).length > 0) {
250   - this.isorter.column = sorter.field;
251   - this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
252   - }
253   - this.detailIpagination = pagination;
254   - this.getDetailDataSource(this.detailIpagination.current);
  244 + this.selectedRowIds = this.selectionRows.map(x => x.id)
  245 + this.loadDetailDataSource(1)
255 246 },
256 247 customRowFn(record) {
257 248 return {
... ... @@ -263,7 +254,7 @@ export default {
263 254 this.selectedRowKeys.push(key)
264 255 this.selectedTable.dataSource.push(record)
265 256 this.selectedRowIds.push(record.id)
266   - this.getDetailDataSource();
  257 + this.loadDetailDataSource(1);
267 258 } else {
268 259 this.handleDeleteSelected(record, index)
269 260 }
... ... @@ -275,16 +266,24 @@ export default {
275 266 this.selectedRowKeys.splice(this.selectedRowKeys.indexOf(record[this.rowKey]), 1)
276 267 this.selectedRowIds.splice(this.selectedRowIds.indexOf(record.id), 1)
277 268 this.selectedTable.dataSource.splice(this.selectedTable.dataSource.indexOf(record), 1)
278   - this.getDetailDataSource();
  269 + this.loadDetailDataSource(1);
279 270 },
280   - getDetailDataSource(current) {
281   - this.loading = true;
282   - if (current == undefined) {
283   - this.detailIpagination.current = 1;
  271 + handleDetailTableChange(pagination, filters, sorter) {
  272 + if (Object.keys(sorter).length > 0) {
  273 + this.isorter.column = sorter.field;
  274 + this.isorter.order = "ascend" === sorter.order ? "asc" : "desc"
284 275 }
  276 + this.detailIpagination = pagination;
  277 + this.loadDetailDataSource();
  278 + },
  279 + loadDetailDataSource(pageCurrent) {
  280 + if (pageCurrent && typeof pageCurrent == 'number') {
  281 + this.detailIpagination.current = pageCurrent;
  282 + }
  283 + this.loading = true;
285 284 let params = {
286 285 inventoryHeaderIds: this.selectedRowIds.join(","),
287   - pageNo: this.detailIpagination.current,
  286 + pageNo: this.detailIpagination.current,
288 287 pageSize: this.detailIpagination.pageSize
289 288 }
290 289 getAction(this.url.pageByMainIds, params).then((res) => {
... ...