|
|
@@ -52,8 +52,8 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:status="{ row }">
|
|
|
- <el-tag :type="Number(row.status) === 0 ? 'info' : 'success'">
|
|
|
- {{ Number(row.status) === 0 ? '待发货' : row.status == 1 ? "已发货" : row.status == 2 ? "已收货" : "驳回" }}
|
|
|
+ <el-tag :type="getStatusInfo(row.status).type">
|
|
|
+ {{ getStatusInfo(row.status).label }}
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
@@ -96,7 +96,16 @@
|
|
|
title: '',
|
|
|
type: '',
|
|
|
itemData: {},
|
|
|
- loading: null
|
|
|
+ loading: null,
|
|
|
+ // 在制品发货状态:键为后端 status,值为 el-tag 显示配置
|
|
|
+ statusMap: {
|
|
|
+ 0: { label: '待发货', type: 'info' },
|
|
|
+ 1: { label: '已发货', type: 'success' },
|
|
|
+ 2: { label: '已收货', type: 'success' },
|
|
|
+ 7: { label: '部分发货', type: 'success' },
|
|
|
+ 8: { label: '部分收货', type: 'success' },
|
|
|
+ 9: { label: '部分驳回', type: 'success' }
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -216,6 +225,11 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ // 根据后端 status 返回对应的展示文案和 el-tag 类型,未匹配时回落为驳回
|
|
|
+ getStatusInfo(status) {
|
|
|
+ return this.statusMap[Number(status)] || { label: '驳回', type: 'success' };
|
|
|
+ },
|
|
|
+
|
|
|
open(item, type) {
|
|
|
this.visible = true;
|
|
|
this.type = type;
|