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 42 </div>
43 43 <div style="height: 340px">
44 44 <a-table
  45 + ref="table"
45 46 size="middle"
46 47 bordered
47 48 :rowKey="rowKey"
... ... @@ -49,7 +50,7 @@
49 50 :dataSource="dataSource"
50 51 :pagination="ipagination"
51 52 :loading="loading"
52   - :scroll="{ y: 240 }"
  53 + :scroll="{ y: 235 }"
53 54 :customRow="customRowFn"
54 55 :rowSelection="{selectedRowKeys, onChange: onSelectChange, type: 'checkbox'}"
55 56 class="j-table-force-nowrap"
... ... @@ -65,7 +66,7 @@
65 66 </div>
66 67 </a-col>
67 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 70 <a-table size="middle" bordered :rowKey="rowKey" v-bind="selectedTable" class="j-table-force-nowrap">
70 71 <span slot="action" slot-scope="text, record, index">
71 72 <a @click="handleDeleteSelected(record, index)">删除</a>
... ... @@ -75,30 +76,31 @@
75 76 </a-col>
76 77 </a-row>
77 78 <!-- 底部表格 start -->
78   - <div style="height: 320px">
  79 + <div>
79 80 <a-table
80 81 ref="table"
81 82 size="middle"
82 83 bordered
83 84 rowKey="id"
84   - :scroll="{x:true}"
85 85 :columns="detailColumns"
86 86 :dataSource="detailDataSource"
87 87 :pagination="detailIpagination"
88 88 :loading="loading"
89 89 class="j-table-force-nowrap"
90 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 104 </a-table>
103 105 </div>
104 106 <!-- 底部表格 end -->
... ... @@ -133,20 +135,13 @@ export default {
133 135 selectedRows: [],
134 136 selectedRowIds: [],
135 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 146 detailColumns: [
152 147 {title: '货主', align: "center", dataIndex: 'companyCode', scopedSlots: {customRender: 'companyCode'}},
... ... @@ -168,7 +163,7 @@ export default {
168 163 ],
169 164 selectedTable: {
170 165 pagination: false,
171   - scroll: {y: 240},
  166 + scroll: {y: 235},
172 167 columns: [
173 168 {title: '库位编码', align: 'center', width: '70%', dataIndex: 'locationCode'},
174 169 {title: '操作', dataIndex: 'action', align: 'center', width: 60, scopedSlots: {customRender: 'action'},}
... ... @@ -186,7 +181,7 @@ export default {
186 181 ipagination: {
187 182 current: 1,
188 183 pageSize: 5,
189   - pageSizeOptions: ['5'],
  184 + pageSizeOptions: ['5', '10', '100'],
190 185 showTotal: (total, range) => {
191 186 return range[0] + "-" + range[1] + " 共" + total + "条"
192 187 },
... ... @@ -197,7 +192,7 @@ export default {
197 192 detailIpagination: {
198 193 current: 1,
199 194 pageSize: 5,
200   - pageSizeOptions: ['5'],
  195 + pageSizeOptions: ['5', '10', '100'],
201 196 showTotal: (total, range) => {
202 197 return range[0] + "-" + range[1] + " 共" + total + "条"
203 198 },
... ... @@ -208,6 +203,17 @@ export default {
208 203 }
209 204 },
210 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 217 handleOk() {
212 218 let params = {
213 219 inventoryHeaderIds: this.selectedRowIds,
... ... @@ -302,12 +308,8 @@ export default {
302 308 })
303 309 },
304 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 314 handleCancel() {
313 315 this.close()
... ...