调整 iam
This commit is contained in:
@@ -354,7 +354,7 @@
|
||||
<el-link
|
||||
v-for="action in rowActions(row)"
|
||||
:key="action.type"
|
||||
:type="action.type === 'delete' ? 'danger' : 'primary'"
|
||||
:type="['delete', 'cancel'].includes(action.type) ? 'danger' : 'primary'"
|
||||
@click="handleRowAction(action.type, row)"
|
||||
>{{ action.label }}</el-link
|
||||
>
|
||||
@@ -1677,7 +1677,6 @@ export default {
|
||||
add: '新建配载',
|
||||
edit: '编辑配载单',
|
||||
view: '配载单详情',
|
||||
copy: '复制配载单',
|
||||
reassign: '重新派单',
|
||||
};
|
||||
return titleMap[this.dialogMode] || '配载管理';
|
||||
@@ -2014,31 +2013,28 @@ export default {
|
||||
if (status === 'draft') {
|
||||
return [
|
||||
{ type: 'edit', label: '编辑' },
|
||||
{ type: 'copy', label: '复制' },
|
||||
{ type: 'delete', label: '删除' },
|
||||
];
|
||||
}
|
||||
if (status === 'pending') {
|
||||
return [
|
||||
const actions = [
|
||||
{ type: 'view', label: '详情' },
|
||||
{ type: 'reassign', label: '重新派单' },
|
||||
{ type: 'edit', label: '编辑' },
|
||||
{ type: 'copy', label: '复制' },
|
||||
{ type: 'cancel', label: '取消' },
|
||||
{ type: 'start', label: '改为进行中' },
|
||||
];
|
||||
if (row.driverRejected) {
|
||||
actions.push({ type: 'reassign', label: '重新派单' });
|
||||
}
|
||||
actions.push({ type: 'edit', label: '编辑' }, { type: 'cancel', label: '取消' });
|
||||
return actions;
|
||||
}
|
||||
if (status === 'running') {
|
||||
return [
|
||||
{ type: 'view', label: '详情' },
|
||||
{ type: 'copy', label: '复制' },
|
||||
{ type: 'complete', label: '完成' },
|
||||
];
|
||||
}
|
||||
if (status === 'completed' || status === 'cancelled') {
|
||||
return [
|
||||
{ type: 'view', label: '详情' },
|
||||
{ type: 'copy', label: '复制' },
|
||||
];
|
||||
return [{ type: 'view', label: '详情' }];
|
||||
}
|
||||
return [{ type: 'view', label: '详情' }];
|
||||
},
|
||||
@@ -2047,8 +2043,8 @@ export default {
|
||||
view: () => this.openLoadingDialog('view', row),
|
||||
edit: () => this.openLoadingDialog('edit', row),
|
||||
reassign: () => this.openLoadingDialog('reassign', row),
|
||||
copy: () => this.copyLoading(row),
|
||||
delete: () => this.deleteLoading(row),
|
||||
start: () => this.startLoading(row),
|
||||
cancel: () => this.cancelLoading(row),
|
||||
complete: () => this.completeLoading(row),
|
||||
};
|
||||
@@ -2784,16 +2780,6 @@ export default {
|
||||
this.dialogSaving = '';
|
||||
}
|
||||
},
|
||||
copyLoading(row) {
|
||||
this.$router.push({
|
||||
path: '/business/loading-manage/form',
|
||||
query: {
|
||||
mode: 'add',
|
||||
copyId: row.id,
|
||||
name: '新增配载管理',
|
||||
},
|
||||
});
|
||||
},
|
||||
deleteLoading(row) {
|
||||
ElMessageBox.confirm(`确定删除配载单 ${row.loadingNo}?`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
@@ -2813,6 +2799,15 @@ export default {
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
startLoading(row) {
|
||||
ElMessageBox.confirm(`确定将配载单 ${row.loadingNo} 改为进行中?`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
await loadingApi.start(row.id);
|
||||
ElMessage.success('已改为进行中');
|
||||
this.loadTable();
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
completeLoading(row) {
|
||||
ElMessageBox.confirm(`确定完成配载单 ${row.loadingNo}?`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
|
||||
Reference in New Issue
Block a user