Commit cc6fd51c38428fa6cc5b98aaa7076dda2d9be671

Authored by 谭毅彬
1 parent 8640ccc9

盘点详情新增页重构,若干页面报错修复

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/views/dashboard/IndexTask.vue
... ... @@ -29,7 +29,7 @@
29 29 <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/>
30 30 </template>
31 31  
32   - <span slot="action" slot-scope="text, record">
  32 + <span slot="action">
33 33 <a @click="handleData">办理</a>
34 34 </span>
35 35  
... ... @@ -64,7 +64,7 @@
64 64 <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/>
65 65 </template>
66 66  
67   - <span slot="action" slot-scope="text, record">
  67 + <span slot="action">
68 68 <a @click="handleData">办理</a>
69 69 </span>
70 70  
... ... @@ -98,7 +98,7 @@
98 98 <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/>
99 99 </template>
100 100  
101   - <span slot="action" slot-scope="text, record">
  101 + <span slot="action">
102 102 <a @click="handleData">办理</a>
103 103 </span>
104 104  
... ... @@ -128,7 +128,7 @@
128 128 <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/>
129 129 </template>
130 130  
131   - <span slot="action" slot-scope="text, record">
  131 + <span slot="action">
132 132 <a @click="handleData">办理</a>
133 133 </span>
134 134  
... ...
ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue
... ... @@ -358,7 +358,9 @@ export default {
358 358 this.selectedMainId = ''
359 359 },
360 360 onSelectChange(selectedRowKeys, selectionRows) {
361   - this.selectedMainId = selectedRowKeys[0].toString();
  361 + if (selectedRowKeys != null && selectedRowKeys.length > 0) {
  362 + this.selectedMainId = selectedRowKeys[0].toString();
  363 + }
362 364 this.selectedRowKeys = selectedRowKeys;
363 365 this.selectionRows = selectionRows;
364 366 this.selectRecord = selectionRows;
... ...
ant-design-vue-jeecg/src/views/system/inventory/InventoryMaterialSummaryList.vue
... ... @@ -89,7 +89,7 @@
89 89 :scroll="{ x: true }"
90 90 bordered
91 91 class="j-table-force-nowrap"
92   - :rowKey="(record,index) => {return record.zoneCode + '_' + record.materialCode}"
  92 + :rowKey="(record,index) => {return record.zoneCode + '_' + record.materialCode + '_' + record.materialSpec + '_' + record.materialUnit}"
93 93 :columns="columns"
94 94 :dataSource="dataSource"
95 95 :pagination="ipagination"
... ...
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
... ... @@ -539,7 +539,9 @@ export default {
539 539 }
540 540 },
541 541 onSelectChange(selectedRowKeys, selectionRows) {
542   - this.selectedMainId = selectedRowKeys[0].toString();
  542 + if (selectedRowKeys != null && selectedRowKeys.length > 0) {
  543 + this.selectedMainId = selectedRowKeys[0].toString();
  544 + }
543 545 this.selectedRowKeys = selectedRowKeys;
544 546 this.selectRecord = selectionRows;
545 547 },
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
... ... @@ -4,44 +4,46 @@
4 4 <div class="table-page-search-wrapper">
5 5 <a-form layout="inline" @keyup.enter.native="searchQuery">
6 6 <a-row :gutter="24">
  7 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8 + <a-form-item label="盘点单编码">
  9 + <a-input placeholder="请输入盘点单编码" v-model="queryParam.code"></a-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13 + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  14 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  15 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  16 + </span>
  17 + </a-col>
7 18 </a-row>
8 19 </a-form>
9 20 </div>
10 21 <!-- 查询区域-END -->
11   -
12 22 <!-- 操作按钮区域 -->
13 23 <div class="table-operator">
14 24 <a-button v-has="'cycleCountHeader:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
15   - <a-button v-has="'cycleCountHeader:export'" type="primary" icon="download" @click="handleExportXls('盘点主表')">
16   - 导出
17   - </a-button>
18   - <a-upload v-has="'cycleCountHeader:import'" name="file" :showUploadList="false" :multiple="false"
19   - :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  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">
20 27 <a-button type="primary" icon="import">导入</a-button>
21 28 </a-upload>
22 29 <a-dropdown v-if="selectedRowKeys.length > 0">
23 30 <a-menu slot="overlay">
24 31 <a-menu-item key="1" @click="batchDel">
25   - <a-icon type="delete"/>
26   - 删除
  32 + <a-icon type="delete"/> 删除
27 33 </a-menu-item>
28 34 </a-menu>
29 35 <a-button style="margin-left: 8px"> 批量操作
30 36 <a-icon type="down"/>
31 37 </a-button>
32 38 </a-dropdown>
33   -
34   - <j-super-query :fieldList="superFieldList" v-has="'cycleCountHeader:superQuery'" @handleSuperQuery="handleSuperQuery"/>
35 39 </div>
36   -
37 40 <!-- table区域-begin -->
38 41 <div>
39 42 <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
40   - <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
41   - style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项
  43 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
  44 + <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项
42 45 <a style="margin-left: 24px" @click="onClearSelected">清空</a>
43 46 </div>
44   -
45 47 <a-table
46 48 ref="table"
47 49 size="middle"
... ... @@ -54,7 +56,6 @@
54 56 :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
55 57 class="j-table-force-nowrap"
56 58 @change="handleTableChange">
57   -
58 59 <!-- 内嵌table区域 begin -->
59 60 <template slot="expandedRowRender" slot-scope="record">
60 61 <a-tabs tabPosition="top">
... ... @@ -64,7 +65,6 @@
64 65 </a-tabs>
65 66 </template>
66 67 <!-- 内嵌table区域 end -->
67   -
68 68 <span slot="companyCode" slot-scope="companyCode">
69 69 <a-tag :key="companyCode" color=blue>
70 70 {{ solutionCompany(companyCode) }}
... ... @@ -72,24 +72,30 @@
72 72 </span>
73 73  
74 74 <span slot="countType" slot-scope="countType">
75   - <a-tag :key="countType" color=pink>
  75 + <a-tag :key="countType" :color="getCountTypeColor(countType)">
76 76 {{ solutionCountType(countType) }}
77 77 </a-tag>
78 78 </span>
79 79  
  80 + <span slot="statusCyc_dictText" slot-scope="statusCyc_dictText">
  81 + <a-tag :key="statusCyc_dictText" :color="getStatusColor(statusCyc_dictText)">
  82 + {{ statusCyc_dictText }}
  83 + </a-tag>
  84 + </span>
  85 +
80 86 <span slot="action" slot-scope="text, record">
81   - <j-select-multi-cycle-count v-if="record.statusCyc!=100" :query-config="selectUserQueryConfig" :test-config="record.id" :header-code="record.code"/>
82   - <a-divider type="vertical" v-if="record.statusCyc!=100"/>
  87 + <a v-if="record.statusCyc === 1" @click="cycleCountDetailAdd(record)">新增</a>
  88 + <a-divider type="vertical" v-if="record.statusCyc !== 100"/>
83 89 <a-dropdown>
84 90 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
85 91 <a-menu slot="overlay">
86 92 <a-menu-item v-has="'cycleCountHeader:edit'">
87   - <a @click="handleEdit(record)">编辑</a>
  93 + <a v-if="record.statusCyc === 1" @click="handleEdit(record)">编辑</a>
88 94 </a-menu-item>
89 95 <a-menu-item>
90 96 <a @click="handleDetail(record)">详情</a>
91 97 </a-menu-item>
92   - <a-menu-item v-has="'cycleCountHeader:delete'">
  98 + <a-menu-item v-if="record.statusCyc === 1" v-has="'cycleCountHeader:delete'">
93 99 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
94 100 <a>删除</a>
95 101 </a-popconfirm>
... ... @@ -97,9 +103,11 @@
97 103 </a-menu>
98 104 </a-dropdown>
99 105 </span>
  106 +
100 107 </a-table>
101 108 </div>
102 109 <cycle-count-header-modal ref="modalForm" @ok="modalFormOk"></cycle-count-header-modal>
  110 + <cycle-count-detail-modal ref="detailModalForm" @ok="detailModalFormOk"/>
103 111 </a-card>
104 112 </template>
105 113  
... ... @@ -108,15 +116,17 @@
108 116 import '@/assets/less/TableExpand.less'
109 117 import {mixinDevice} from '@/utils/mixin'
110 118 import {JeecgListMixin} from '@/mixins/JeecgListMixin'
111   -import {getCompanyList} from '@/api/api'
112   -import {getCountTypeList} from '@/api/api'
  119 +import {getCompanyList, getCountTypeList} from '@/api/api'
113 120 import CycleCountHeaderModal from './modules/CycleCountHeaderModal'
114 121 import CycleCountDetailList from "./CycleCountDetailList";
  122 +import Utils from "@/components/jeecgbiz/JButtonBizComponent/util.js"
  123 +import CycleCountDetailModal from "./modules/CycleCountDetailModal";
115 124  
116 125 export default {
117 126 name: 'CycleCountHeaderList',
118 127 mixins: [JeecgListMixin, mixinDevice],
119 128 components: {
  129 + CycleCountDetailModal,
120 130 CycleCountHeaderModal,
121 131 CycleCountDetailList,
122 132 },
... ... @@ -173,7 +183,8 @@ export default {
173 183 {
174 184 title: '盘点主单状态',
175 185 align: "center",
176   - dataIndex: 'statusCyc_dictText'
  186 + dataIndex: 'statusCyc_dictText',
  187 + scopedSlots: {customRender: 'statusCyc_dictText'}
177 188 },
178 189 {
179 190 title: '指定盘点人员',
... ... @@ -190,21 +201,6 @@ export default {
190 201 align: "center",
191 202 dataIndex: 'enable_dictText'
192 203 },
193   - // {
194   - // title:'回传时间',
195   - // align:"center",
196   - // dataIndex: 'uploadTime'
197   - // },
198   - // {
199   - // title:'回传状态',
200   - // align:"center",
201   - // dataIndex: 'uploadStatusString'
202   - // },
203   - // {
204   - // title:'关闭人',
205   - // align:"center",
206   - // dataIndex: 'closedBy'
207   - // },
208 204 {
209 205 title: '备注',
210 206 align: "center",
... ... @@ -236,6 +232,12 @@ export default {
236 232 this.getSuperFieldList();
237 233 this.loadFrom();
238 234 },
  235 + mounted() {
  236 + let that = this;
  237 + Utils.$on('refreshCycleCountHeader', () => {
  238 + that.loadData()
  239 + })
  240 + },
239 241 computed: {
240 242 importExcelUrl: function () {
241 243 return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
... ... @@ -249,7 +251,7 @@ export default {
249 251 fieldList.push({type: 'string', value: 'code', text: '盘点主表编号', dictCode: ''})
250 252 fieldList.push({type: 'string', value: 'companyCode', text: '货主编码', dictCode: ''})
251 253 fieldList.push({type: 'string', value: 'countType', text: '盘点类型', dictCode: ''})
252   - fieldList.push({type: 'int', value: 'statusCyc', text: '盘点状态', dictCode: 'cyclecount_status'})
  254 + fieldList.push({type: 'int', value: 'statusCyc', text: '盘点状态', dictCode: 'cycleCount_status'})
253 255 fieldList.push({type: 'string', value: 'remark', text: '备注', dictCode: ''})
254 256 fieldList.push({type: 'int', value: 'totalLocs', text: '总货位数', dictCode: ''})
255 257 fieldList.push({type: 'int', value: 'totalItems', text: '总物料数', dictCode: ''})
... ... @@ -273,34 +275,53 @@ export default {
273 275 }
274 276 });
275 277 },
276   -
277   - loadDataaa() {
278   - var _this = this;
279   - _this.testaa();
280   - },
281 278 solutionCompany(value) {
282   - var actions = []
  279 + let actions = []
283 280 Object.keys(this.companyList).some((key) => {
284   - if (this.companyList[key].code == ('' + value)) {
  281 + if (this.companyList[key].code === ('' + value)) {
285 282 actions.push(this.companyList[key].name)
286 283 return true
287 284 }
288 285 })
289 286 return actions.join('')
290 287 },
291   -
292 288 solutionCountType(value) {
293   - var actions = []
  289 + let actions = []
294 290 Object.keys(this.CountTypeList).some((key) => {
295   - if (this.CountTypeList[key].code == ('' + value)) {
  291 + if (this.CountTypeList[key].code === ('' + value)) {
296 292 actions.push(this.CountTypeList[key].name)
297 293 return true
298 294 }
299 295 })
300 296 return actions.join('')
301 297 },
302   -
303   -
  298 + cycleCountDetailAdd(record){
  299 + this.$refs.detailModalForm.title = "库存";
  300 + this.$refs.detailModalForm.cycleCountHeader = record;
  301 + this.$refs.detailModalForm.visible = true;
  302 + },
  303 + detailModalFormOk(){
  304 + this.loadData();
  305 + },
  306 + getStatusColor(status) {
  307 + const colors = {
  308 + '新建': 'green',
  309 + '已登记': 'orange',
  310 + '盘点完成': 'grey',
  311 + default: 'blue'
  312 + };
  313 + return colors[status] || colors.default;
  314 + },
  315 + getCountTypeColor(countType) {
  316 + const colors = {
  317 + '01': 'cyan',
  318 + '02': 'purple',
  319 + '明盘': 'cyan',
  320 + '暗盘': 'purple',
  321 + default: 'blue'
  322 + };
  323 + return colors[countType] || colors.default;
  324 + }
304 325 }
305 326 }
306 327 </script>
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/modules/CycleCountDetailModal.vue
1 1 <template>
2 2 <j-modal
3   - :title="title"
4   - :width="1200"
  3 + :title="title + '选择'"
  4 + :width="1400"
5 5 :visible="visible"
6 6 :maskClosable="false"
7 7 switchFullscreen
8 8 @ok="handleOk"
9 9 :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
10 10 @cancel="handleCancel">
11   - <cycle-count-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/>
  11 + <a-row :gutter="24">
  12 + <a-col :span="16">
  13 + <!-- 查询区域 -->
  14 + <div class="table-page-search-wrapper">
  15 + <a-form layout="inline" class="j-inline-form" @keyup.enter.native="searchQuery">
  16 + <a-row :gutter="24">
  17 + <a-col :xl="8" :lg="7" :md="8" :sm="24">
  18 + <a-form-item label="库区">
  19 + <a-select
  20 + show-search
  21 + placeholder="请选择库区"
  22 + option-filter-prop="children"
  23 + v-model="queryParam.zoneCode"
  24 + >
  25 + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">
  26 + {{ item.name }}
  27 + </a-select-option>
  28 + </a-select>
  29 + </a-form-item>
  30 + </a-col>
  31 + <a-col :xl="8" :lg="7" :md="8" :sm="24">
  32 + <a-form-item label="库位编码">
  33 + <a-input placeholder="请输入库位编码" v-model="queryParam.locationCode"></a-input>
  34 + </a-form-item>
  35 + </a-col>
  36 + <a-col :xl="8" :lg="7" :md="8" :sm="24">
  37 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  38 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  39 + </a-col>
  40 + </a-row>
  41 + </a-form>
  42 + </div>
  43 + <div style="height: 340px">
  44 + <a-table
  45 + size="middle"
  46 + bordered
  47 + :rowKey="rowKey"
  48 + :columns="columns"
  49 + :dataSource="dataSource"
  50 + :pagination="ipagination"
  51 + :loading="loading"
  52 + :scroll="{ y: 240 }"
  53 + :customRow="customRowFn"
  54 + :rowSelection="{selectedRowKeys, onChange: onSelectChange, type: 'checkbox'}"
  55 + class="j-table-force-nowrap"
  56 + @change="handleTableChange">
  57 +
  58 + <span slot="zoneCode" slot-scope="zoneCode">
  59 + <a-tag :key="zoneCode" color="blue">
  60 + {{ solutionZoneCode(zoneCode) }}
  61 + </a-tag>
  62 + </span>
  63 +
  64 + </a-table>
  65 + </div>
  66 + </a-col>
  67 + <a-col :span="8">
  68 + <a-card :title="'已选' + title" :bordered="false" :head-style="{padding:0}" :body-style="{padding:0}">
  69 + <a-table size="middle" bordered :rowKey="rowKey" v-bind="selectedTable" class="j-table-force-nowrap">
  70 + <span slot="action" slot-scope="text, record, index">
  71 + <a @click="handleDeleteSelected(record, index)">删除</a>
  72 + </span>
  73 + </a-table>
  74 + </a-card>
  75 + </a-col>
  76 + </a-row>
  77 + <!-- 底部表格 start -->
  78 + <div style="height: 320px">
  79 + <a-table
  80 + ref="table"
  81 + size="middle"
  82 + bordered
  83 + rowKey="id"
  84 + :scroll="{x:true}"
  85 + :columns="detailColumns"
  86 + :dataSource="detailDataSource"
  87 + :pagination="detailIpagination"
  88 + :loading="loading"
  89 + class="j-table-force-nowrap"
  90 + @change="handleDetailTableChange">
  91 + <span slot="companyCode" slot-scope="companyCode">
  92 + <a-tag :key="companyCode" color=blue>
  93 + {{ solutionCompany(companyCode) }}
  94 + </a-tag>
  95 + </span>
  96 +
  97 + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText">
  98 + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)">
  99 + {{ inventoryStatus_dictText }}
  100 + </a-tag>
  101 + </span>
  102 + </a-table>
  103 + </div>
  104 + <!-- 底部表格 end -->
12 105 </j-modal>
13 106 </template>
14 107  
15 108 <script>
16   - import CycleCountDetailForm from './CycleCountDetailForm'
17   - export default {
18   - name: 'CycleCountDetailModal',
19   - components: {
20   - CycleCountDetailForm
21   - },
22   - data() {
23   - return {
24   - title:'',
25   - visible: false,
26   - disableSubmit: false
27   - }
28   - },
29   - methods:{
30   - add () {
31   - this.visible=true
32   - this.$nextTick(()=>{
33   - this.$refs.realForm.add();
34   - })
35   - },
36   - edit (record) {
37   - this.visible=true
38   - this.$nextTick(()=>{
39   - this.$refs.realForm.edit(record);
40   - })
41   - },
42   - close () {
43   - this.$emit('close');
44   - this.visible = false;
  109 +
  110 +import CycleCountDetailForm from './CycleCountDetailForm'
  111 +import JSelectBizQueryItem from "@comp/jeecgbiz/JButtonBizComponent/JSelectBizQueryItem";
  112 +import {JeecgListMixin} from "@/mixins/JeecgListMixin";
  113 +import {getCompanyList, getZoneList, createCycleCountDetailByInventory} from "@api/api";
  114 +import {getAction} from "@api/manage";
  115 +
  116 +export default {
  117 + name: 'CycleCountDetailModal',
  118 + mixins: [JeecgListMixin],
  119 + components: {
  120 + JSelectBizQueryItem,
  121 + CycleCountDetailForm
  122 + },
  123 + data() {
  124 + return {
  125 + title: '',
  126 + loading: true,
  127 + visible: false,
  128 + disableSubmit: false,
  129 + cycleCountHeader: {},
  130 + queryParam: {},
  131 + rowKey: 'id',
  132 + selectedRowKeys: [],
  133 + selectedRows: [],
  134 + selectedRowIds: [],
  135 + columns: [
  136 + {title: 'ID', align: 'center', width: '20%', widthRight: '70%', dataIndex: 'id'},
  137 + {
  138 + title: '库区',
  139 + align: 'center',
  140 + width: '20%',
  141 + widthRight: '70%',
  142 + dataIndex: 'zoneCode',
  143 + scopedSlots: {customRender: 'zoneCode'}
  144 + },
  145 + {title: '容器编码', align: 'center', width: '25%', dataIndex: 'containerCode'},
  146 + {title: '容器状态', align: 'center', width: '20%', dataIndex: 'containerStatus_dictText'},
  147 + {title: '库位编码', align: 'center', width: '20%', dataIndex: 'locationCode'},
  148 + {title: '总数量', align: 'center', width: '20%', dataIndex: 'totalQty'},
  149 + {title: '状态', align: 'center', width: '20%', dataIndex: 'enable_dictText'},
  150 + ],
  151 + detailColumns: [
  152 + {title: '货主', align: "center", dataIndex: 'companyCode', scopedSlots: {customRender: 'companyCode'}},
  153 + {title: '容器编码', align: "center", dataIndex: 'containerCode'},
  154 + {title: '库位编码', align: "center", dataIndex: 'locationCode'},
  155 + {title: '物料编码', align: "center", dataIndex: 'materialCode'},
  156 + {title: '物料名称', align: "center", dataIndex: 'materialName'},
  157 + {title: '物料规格', align: "center", dataIndex: 'materialSpec'},
  158 + {title: '物料单位', align: "center", dataIndex: 'materialUnit'},
  159 + {title: '数量', align: "center", dataIndex: 'qty'},
  160 + {
  161 + title: '库存状态',
  162 + align: "center",
  163 + dataIndex: 'inventoryStatus_dictText',
  164 + scopedSlots: {customRender: 'inventoryStatus_dictText'}
  165 + },
  166 + {title: '批次', align: "center", dataIndex: 'batch'},
  167 + {title: '入库日期', align: "center", dataIndex: 'receiptDate'}
  168 + ],
  169 + selectedTable: {
  170 + pagination: false,
  171 + scroll: {y: 240},
  172 + columns: [
  173 + {title: '库位编码', align: 'center', width: '70%', dataIndex: 'locationCode'},
  174 + {title: '操作', dataIndex: 'action', align: 'center', width: 60, scopedSlots: {customRender: 'action'},}
  175 + ],
  176 + dataSource: [],
45 177 },
46   - handleOk () {
47   - this.$refs.realForm.handleOk();
  178 + dataSource: [],
  179 + detailDataSource: [],
  180 + url: {
  181 + list: '/inventory/inventoryHeader/freeList',
  182 + pageByMainIds: "/inventory/inventoryDetail/pageByMainIds"
48 183 },
49   - submitCallback(){
50   - this.$emit('ok');
51   - this.visible = false;
  184 + zoneList: [],
  185 + companyList: [],
  186 + ipagination: {
  187 + current: 1,
  188 + pageSize: 5,
  189 + pageSizeOptions: ['5'],
  190 + showTotal: (total, range) => {
  191 + return range[0] + "-" + range[1] + " 共" + total + "条"
  192 + },
  193 + showQuickJumper: true,
  194 + showSizeChanger: true,
  195 + total: 0
52 196 },
53   - handleCancel () {
54   - this.close()
  197 + detailIpagination: {
  198 + current: 1,
  199 + pageSize: 5,
  200 + pageSizeOptions: ['5'],
  201 + showTotal: (total, range) => {
  202 + return range[0] + "-" + range[1] + " 共" + total + "条"
  203 + },
  204 + showQuickJumper: true,
  205 + showSizeChanger: true,
  206 + total: 0
55 207 }
56 208 }
  209 + },
  210 + methods: {
  211 + handleOk() {
  212 + let params = {
  213 + inventoryHeaderIds: this.selectedRowIds,
  214 + cycleCountHeaderId: this.cycleCountHeader.id,
  215 + cycleCountHeaderCode: this.cycleCountHeader.code,
  216 + }
  217 + if (this.selectedRowIds.length > 0) {
  218 + createCycleCountDetailByInventory(params).then((res) => {
  219 + if (res.success) {
  220 + this.$message.success(res.message)
  221 + this.$emit('ok')
  222 + } else {
  223 + this.$message.warning(res.message);
  224 + }
  225 + }).finally(() => {
  226 + this.confirmLoading = false;
  227 + this.close()
  228 + })
  229 + } else {
  230 + this.$message.warning("至少选择一项")
  231 + }
  232 + },
  233 + onSelectChange(selectedRowKeys, selectionRows) {
  234 + this.selectedRowKeys = selectedRowKeys;
  235 + // 解决翻页后 selectionRows 没记录上一页数据的问题
  236 + if (selectedRowKeys.length === selectionRows.length) {
  237 + this.selectionRows = selectionRows;
  238 + } else {
  239 + this.selectionRows = selectedRowKeys.map(key => (
  240 + this.selectionRows.find(row => row.id === key) || selectionRows.find(row => row.id === key)
  241 + ))
  242 + }
  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();
  255 + },
  256 + customRowFn(record) {
  257 + return {
  258 + on: {
  259 + click: () => {
  260 + let key = record[this.rowKey]
  261 + let index = this.selectedRowKeys.indexOf(key)
  262 + if (index === -1) {
  263 + this.selectedRowKeys.push(key)
  264 + this.selectedTable.dataSource.push(record)
  265 + this.selectedRowIds.push(record.id)
  266 + this.getDetailDataSource();
  267 + } else {
  268 + this.handleDeleteSelected(record, index)
  269 + }
  270 + }
  271 + }
  272 + }
  273 + },
  274 + handleDeleteSelected(record, index) {
  275 + this.selectedRowKeys.splice(this.selectedRowKeys.indexOf(record[this.rowKey]), 1)
  276 + this.selectedRowIds.splice(this.selectedRowIds.indexOf(record.id), 1)
  277 + this.selectedTable.dataSource.splice(this.selectedTable.dataSource.indexOf(record), 1)
  278 + this.getDetailDataSource();
  279 + },
  280 + getDetailDataSource() {
  281 + this.loading = true;
  282 + let params = {
  283 + inventoryHeaderIds: this.selectedRowIds.join(","),
  284 + pageNo: this.detailIpagination.current,
  285 + pageSize: this.detailIpagination.pageSize
  286 + }
  287 + getAction(this.url.pageByMainIds, params).then((res) => {
  288 + if (res.success) {
  289 + this.detailDataSource = res.result ? res.result.records : null;
  290 + if (res.result && res.result.total) {
  291 + this.detailIpagination.total = res.result.total;
  292 + } else {
  293 + this.detailIpagination.total = 0;
  294 + }
  295 + } else {
  296 + this.$message.warning(res.message)
  297 + }
  298 + }).finally(() => {
  299 + this.loading = false
  300 + })
  301 + },
  302 + close() {
  303 + this.visible = false;
  304 + this.selectedRowIds = [];
  305 + this.selectionRows = [];
  306 + this.selectedRowKeys = [];
  307 + this.detailDataSource = [];
  308 + this.selectedTable.dataSource = [];
  309 + },
  310 + handleCancel() {
  311 + this.close()
  312 + },
  313 + loadForm() {
  314 + getZoneList().then(res => {
  315 + if (res.success) {
  316 + this.zoneList = res.result
  317 + }
  318 + })
  319 + getCompanyList().then(res => {
  320 + if (res.success) {
  321 + this.companyList = res.result
  322 + }
  323 + })
  324 + },
  325 + solutionZoneCode(value) {
  326 + let actions = []
  327 + Object.keys(this.zoneList).some(key => {
  328 + if (this.zoneList[key].code === '' + value) {
  329 + actions.push(this.zoneList[key].name)
  330 + return true
  331 + }
  332 + })
  333 + return actions.join('')
  334 + },
  335 + solutionCompany(value) {
  336 + let actions = []
  337 + Object.keys(this.companyList).some(key => {
  338 + if (this.companyList[key].code === '' + value) {
  339 + actions.push(this.companyList[key].name)
  340 + return true
  341 + }
  342 + })
  343 + return actions.join('')
  344 + },
  345 + getStatusColor(status) {
  346 + const colors = {
  347 + '良品': 'green',
  348 + '报废品': 'purple',
  349 + '待确认 ': 'grey',
  350 + '次品': 'red',
  351 + default: 'blue'
  352 + };
  353 + return colors[status] || colors.default;
  354 + },
  355 + },
  356 + created() {
  357 + this.loadForm();
57 358 }
  359 +}
58 360 </script>
59 361  
60   -<style scoped>
  362 +<style lang="less" scoped>
61 363 </style>
62 364 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/task/TaskHeaderHistoryList.vue
... ... @@ -147,10 +147,6 @@
147 147 </a-button>
148 148 </template>
149 149  
150   - <span slot="action" slot-scope="text, record">
151   -
152   - </span>
153   -
154 150 </a-table>
155 151 </div>
156 152  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/InventoryMaterialSummary/controller/InventoryMaterialSummaryController.java
... ... @@ -81,7 +81,7 @@ public class InventoryMaterialSummaryController extends JeecgController&lt;Inventor
81 81 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
82 82 HuahengJwtUtil.setWarehouseCode(req, inventoryDetail);
83 83 QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap());
84   - queryWrapper.select("zone_code, company_code, material_code, material_name,material_spec, material_unit, SUM(qty) as qty");
  84 + queryWrapper.select("zone_code, company_code, material_code, material_name, material_spec, material_unit, SUM(qty) as qty");
85 85 queryWrapper.groupBy("zone_code", "company_code", "material_code", "material_name", "material_spec", "material_unit");
86 86 Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize);
87 87 IPage<InventoryDetail> pageList = inventoryDetailService.page(page, queryWrapper);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryDetail/controller/InventoryDetailController.java
... ... @@ -180,5 +180,21 @@ public class InventoryDetailController extends JeecgController&lt;InventoryDetail,
180 180 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
181 181 return super.importExcel(request, response, InventoryDetail.class);
182 182 }
183   -
  183 +
  184 + /**
  185 + * 根据多个库存头id分页列表查询
  186 + */
  187 + @ApiOperation(value = "盘点库存-根据多个库存头id分页列表查询", notes = "盘点库存-根据多个库存头id分页列表查询")
  188 + @GetMapping(value = "/pageByMainIds")
  189 + public Result<IPage<InventoryDetail>> pageByMainIds(String inventoryHeaderIds, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
  190 + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  191 + if (StringUtils.isEmpty(inventoryHeaderIds)) {
  192 + return Result.OK();
  193 + }
  194 + List<String> inventoryHeaderIdList = Arrays.asList(inventoryHeaderIds.split(","));
  195 + Page<InventoryDetail> page = new Page<>(pageNo, pageSize);
  196 + IPage<InventoryDetail> pageList = inventoryDetailService.pageByMainIds(page, inventoryHeaderIdList);
  197 + inventoryDetailService.calculateInventoryAge(pageList.getRecords());// 计算库龄
  198 + return Result.OK(pageList);
  199 + }
184 200 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java
... ... @@ -103,4 +103,12 @@ public interface IInventoryDetailService extends IService&lt;InventoryDetail&gt; {
103 103 * @return
104 104 */
105 105 List<String> containerCodeList(String warehouseCode, String materiacode);
  106 +
  107 + /**
  108 + * 根据多个库存头id分页查询
  109 + * @param page 分页参数
  110 + * @param inventoryHeaderIds 库存头id
  111 + * @return 库存明细
  112 + */
  113 + IPage<InventoryDetail> pageByMainIds(Page<InventoryDetail> page, List<String> inventoryHeaderIds);
106 114 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
... ... @@ -379,4 +379,11 @@ public class InventoryDetailServiceImpl extends ServiceImpl&lt;InventoryDetailMappe
379 379 }
380 380 return containerCodeList;
381 381 }
  382 +
  383 + @Override
  384 + public IPage<InventoryDetail> pageByMainIds(Page<InventoryDetail> page, List<String> inventoryHeaderIds) {
  385 + LambdaQueryWrapper<InventoryDetail> queryWrapper = Wrappers.lambdaQuery();
  386 + queryWrapper.in(InventoryDetail::getInventoryHeaderId, inventoryHeaderIds);
  387 + return super.page(page, queryWrapper);
  388 + }
382 389 }
... ...