Commit e27a863ebf5fad24c83813358ab9e5837173f98c
1 parent
16cfd58b
操作按钮高亮
Showing
3 changed files
with
55 additions
and
5 deletions
ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue
... | ... | @@ -49,6 +49,12 @@ |
49 | 49 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
50 | 50 | @change="handleTableChange"> |
51 | 51 | |
52 | + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> | |
53 | + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> | |
54 | + {{ inventoryStatus_dictText }} | |
55 | + </a-tag> | |
56 | + </span> | |
57 | + | |
52 | 58 | <template slot="htmlSlot" slot-scope="text"> |
53 | 59 | <div v-html="text"></div> |
54 | 60 | </template> |
... | ... | @@ -161,6 +167,7 @@ export default { |
161 | 167 | title: '库存状态', |
162 | 168 | align: "center", |
163 | 169 | dataIndex: 'inventoryStatus_dictText', |
170 | + scopedSlots: {customRender: 'inventoryStatus_dictText'} | |
164 | 171 | }, |
165 | 172 | { |
166 | 173 | title: '批次', |
... | ... | @@ -222,6 +229,16 @@ export default { |
222 | 229 | } |
223 | 230 | }, |
224 | 231 | methods: { |
232 | + getStatusColor(status) { | |
233 | + const colors = { | |
234 | + '良品': 'green', | |
235 | + '报废品': 'purple', | |
236 | + '待确认 ': 'grey', | |
237 | + '次品': 'red', | |
238 | + default: 'default' | |
239 | + }; | |
240 | + return colors[status] || colors.default; | |
241 | + }, | |
225 | 242 | clearList() { |
226 | 243 | this.dataSource = [] |
227 | 244 | this.selectedRowKeys = [] |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue
... | ... | @@ -48,6 +48,12 @@ |
48 | 48 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
49 | 49 | @change="handleTableChange"> |
50 | 50 | |
51 | + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> | |
52 | + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> | |
53 | + {{ inventoryStatus_dictText }} | |
54 | + </a-tag> | |
55 | + </span> | |
56 | + | |
51 | 57 | <template slot="htmlSlot" slot-scope="text"> |
52 | 58 | <div v-html="text"></div> |
53 | 59 | </template> |
... | ... | @@ -72,11 +78,26 @@ |
72 | 78 | <span slot="action" slot-scope="text, record"> |
73 | 79 | <a @click="combine(record)"><a-button type="primary">配盘</a-button></a> |
74 | 80 | <a-divider type="vertical"/> |
75 | - <a v-has="'shipmentDetail:edit'" @click="edit(record)">编辑</a> | |
76 | - <a-divider type="vertical"/> | |
77 | - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
78 | - <a v-has="'shipmentDetail:delete'">删除</a> | |
79 | - </a-popconfirm> | |
81 | + | |
82 | + <a-dropdown> | |
83 | + <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> | |
84 | + <a-menu slot="overlay"> | |
85 | + <a-menu-item v-has="'shipmentDetail:edit'"> | |
86 | + <a @click="handleEdit(record)">编辑</a> | |
87 | + </a-menu-item> | |
88 | + <a-menu-item v-has="'shipmentDetail:delete'"> | |
89 | + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
90 | + <a>删除</a> | |
91 | + </a-popconfirm> | |
92 | + </a-menu-item> | |
93 | + </a-menu> | |
94 | + </a-dropdown> | |
95 | + | |
96 | +<!-- <a v-has="'shipmentDetail:edit'" @click="edit(record)">编辑</a>--> | |
97 | +<!-- <a-divider type="vertical"/>--> | |
98 | +<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> | |
99 | +<!-- <a v-has="'shipmentDetail:delete'">删除</a>--> | |
100 | +<!-- </a-popconfirm>--> | |
80 | 101 | </span> |
81 | 102 | |
82 | 103 | </a-table> |
... | ... | @@ -177,6 +198,7 @@ export default { |
177 | 198 | title: '库存状态', |
178 | 199 | align: "center", |
179 | 200 | dataIndex: 'inventoryStatus_dictText', |
201 | + scopedSlots: {customRender: 'inventoryStatus_dictText'} | |
180 | 202 | }, |
181 | 203 | { |
182 | 204 | title: '批次', |
... | ... | @@ -238,6 +260,16 @@ export default { |
238 | 260 | } |
239 | 261 | }, |
240 | 262 | methods: { |
263 | + getStatusColor(status) { | |
264 | + const colors = { | |
265 | + '良品': 'green', | |
266 | + '报废品': 'purple', | |
267 | + '待确认 ': 'grey', | |
268 | + '次品': 'red', | |
269 | + default: 'default' | |
270 | + }; | |
271 | + return colors[status] || colors.default; | |
272 | + }, | |
241 | 273 | clearList() { |
242 | 274 | this.dataSource = [] |
243 | 275 | this.selectedRowKeys = [] |
... | ... |