Commit 5a81e8225b501c29af405ebd51438028edbbec87

Authored by 谭毅彬
1 parent 7fa13912

盘点页明细新增细节优化

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/views/system/stocktaking/modules/CycleCountDetailModal.vue
@@ -42,6 +42,7 @@ @@ -42,6 +42,7 @@
42 </div> 42 </div>
43 <div style="height: 340px"> 43 <div style="height: 340px">
44 <a-table 44 <a-table
  45 + ref="table"
45 size="middle" 46 size="middle"
46 bordered 47 bordered
47 :rowKey="rowKey" 48 :rowKey="rowKey"
@@ -49,7 +50,7 @@ @@ -49,7 +50,7 @@
49 :dataSource="dataSource" 50 :dataSource="dataSource"
50 :pagination="ipagination" 51 :pagination="ipagination"
51 :loading="loading" 52 :loading="loading"
52 - :scroll="{ y: 240 }" 53 + :scroll="{ y: 235 }"
53 :customRow="customRowFn" 54 :customRow="customRowFn"
54 :rowSelection="{selectedRowKeys, onChange: onSelectChange, type: 'checkbox'}" 55 :rowSelection="{selectedRowKeys, onChange: onSelectChange, type: 'checkbox'}"
55 class="j-table-force-nowrap" 56 class="j-table-force-nowrap"
@@ -65,7 +66,7 @@ @@ -65,7 +66,7 @@
65 </div> 66 </div>
66 </a-col> 67 </a-col>
67 <a-col :span="8"> 68 <a-col :span="8">
68 - <a-card :title="'已选' + title" :bordered="false" :head-style="{padding:0}" :body-style="{padding:0}"> 69 + <a-card :title="'已选' + title" :bordered="false" :body-style="{padding:0}">
69 <a-table size="middle" bordered :rowKey="rowKey" v-bind="selectedTable" class="j-table-force-nowrap"> 70 <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 <span slot="action" slot-scope="text, record, index">
71 <a @click="handleDeleteSelected(record, index)">删除</a> 72 <a @click="handleDeleteSelected(record, index)">删除</a>
@@ -75,30 +76,31 @@ @@ -75,30 +76,31 @@
75 </a-col> 76 </a-col>
76 </a-row> 77 </a-row>
77 <!-- 底部表格 start --> 78 <!-- 底部表格 start -->
78 - <div style="height: 320px"> 79 + <div>
79 <a-table 80 <a-table
80 ref="table" 81 ref="table"
81 size="middle" 82 size="middle"
82 bordered 83 bordered
83 rowKey="id" 84 rowKey="id"
84 - :scroll="{x:true}"  
85 :columns="detailColumns" 85 :columns="detailColumns"
86 :dataSource="detailDataSource" 86 :dataSource="detailDataSource"
87 :pagination="detailIpagination" 87 :pagination="detailIpagination"
88 :loading="loading" 88 :loading="loading"
89 class="j-table-force-nowrap" 89 class="j-table-force-nowrap"
90 @change="handleDetailTableChange"> 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 91
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> 92 + <span slot="companyCode" slot-scope="companyCode">
  93 + <a-tag :key="companyCode" color=blue>
  94 + {{ solutionCompany(companyCode) }}
  95 + </a-tag>
  96 + </span>
  97 +
  98 + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText">
  99 + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)">
  100 + {{ inventoryStatus_dictText }}
  101 + </a-tag>
  102 + </span>
  103 +
102 </a-table> 104 </a-table>
103 </div> 105 </div>
104 <!-- 底部表格 end --> 106 <!-- 底部表格 end -->
@@ -133,20 +135,13 @@ export default { @@ -133,20 +135,13 @@ export default {
133 selectedRows: [], 135 selectedRows: [],
134 selectedRowIds: [], 136 selectedRowIds: [],
135 columns: [ 137 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'}, 138 + {title: 'ID', align: 'center', width: '10%', widthRight: '70%', dataIndex: 'id'},
  139 + {title: '库区', align: 'center', width: '15%', widthRight: '70%', dataIndex: 'zoneCode', scopedSlots: {customRender: 'zoneCode'}},
  140 + {title: '库位编码', align: 'center', dataIndex: 'locationCode'},
  141 + {title: '容器编码', align: 'center', dataIndex: 'containerCode'},
  142 + {title: '容器状态', align: 'center', width: '10%', dataIndex: 'containerStatus_dictText'},
  143 + {title: '总数量', align: 'center', width: '15%', dataIndex: 'totalQty'},
  144 + {title: '状态', align: 'center', width: '10%', dataIndex: 'enable_dictText'},
150 ], 145 ],
151 detailColumns: [ 146 detailColumns: [
152 {title: '货主', align: "center", dataIndex: 'companyCode', scopedSlots: {customRender: 'companyCode'}}, 147 {title: '货主', align: "center", dataIndex: 'companyCode', scopedSlots: {customRender: 'companyCode'}},
@@ -168,7 +163,7 @@ export default { @@ -168,7 +163,7 @@ export default {
168 ], 163 ],
169 selectedTable: { 164 selectedTable: {
170 pagination: false, 165 pagination: false,
171 - scroll: {y: 240}, 166 + scroll: {y: 235},
172 columns: [ 167 columns: [
173 {title: '库位编码', align: 'center', width: '70%', dataIndex: 'locationCode'}, 168 {title: '库位编码', align: 'center', width: '70%', dataIndex: 'locationCode'},
174 {title: '操作', dataIndex: 'action', align: 'center', width: 60, scopedSlots: {customRender: 'action'},} 169 {title: '操作', dataIndex: 'action', align: 'center', width: 60, scopedSlots: {customRender: 'action'},}
@@ -186,7 +181,7 @@ export default { @@ -186,7 +181,7 @@ export default {
186 ipagination: { 181 ipagination: {
187 current: 1, 182 current: 1,
188 pageSize: 5, 183 pageSize: 5,
189 - pageSizeOptions: ['5'], 184 + pageSizeOptions: ['5', '10', '100'],
190 showTotal: (total, range) => { 185 showTotal: (total, range) => {
191 return range[0] + "-" + range[1] + " 共" + total + "条" 186 return range[0] + "-" + range[1] + " 共" + total + "条"
192 }, 187 },
@@ -197,7 +192,7 @@ export default { @@ -197,7 +192,7 @@ export default {
197 detailIpagination: { 192 detailIpagination: {
198 current: 1, 193 current: 1,
199 pageSize: 5, 194 pageSize: 5,
200 - pageSizeOptions: ['5'], 195 + pageSizeOptions: ['5', '10', '100'],
201 showTotal: (total, range) => { 196 showTotal: (total, range) => {
202 return range[0] + "-" + range[1] + " 共" + total + "条" 197 return range[0] + "-" + range[1] + " 共" + total + "条"
203 }, 198 },
@@ -208,6 +203,17 @@ export default { @@ -208,6 +203,17 @@ export default {
208 } 203 }
209 }, 204 },
210 methods: { 205 methods: {
  206 + searchReset() {
  207 + Object.keys(this.queryParam).forEach(key => {
  208 + this.queryParam[key] = ''
  209 + })
  210 + this.selectedRowKeys = []
  211 + this.selectedRows = []
  212 + this.selectedRowIds = []
  213 + this.selectedTable.dataSource = []
  214 + this.detailDataSource = []
  215 + this.loadData(1)
  216 + },
211 handleOk() { 217 handleOk() {
212 let params = { 218 let params = {
213 inventoryHeaderIds: this.selectedRowIds, 219 inventoryHeaderIds: this.selectedRowIds,
@@ -302,12 +308,8 @@ export default { @@ -302,12 +308,8 @@ export default {
302 }) 308 })
303 }, 309 },
304 close() { 310 close() {
305 - this.visible = false;  
306 - this.selectedRowIds = [];  
307 - this.selectionRows = [];  
308 - this.selectedRowKeys = [];  
309 - this.detailDataSource = [];  
310 - this.selectedTable.dataSource = []; 311 + this.searchReset()
  312 + this.visible = false
311 }, 313 },
312 handleCancel() { 314 handleCancel() {
313 this.close() 315 this.close()