1、完善发货模板
2、完善运输计划 3、完善运单管理
This commit is contained in:
@@ -32,13 +32,12 @@
|
||||
</el-button>
|
||||
</template>
|
||||
<template #menu="scope">
|
||||
<el-button
|
||||
<el-link
|
||||
type="primary"
|
||||
text
|
||||
@click.stop="handleAdd(scope.row, scope.index)"
|
||||
v-if="userInfo.authority.includes('admin') && scope.row.category === 1"
|
||||
>新增子项
|
||||
</el-button>
|
||||
</el-link>
|
||||
</template>
|
||||
<template #name="{ row }">
|
||||
<i :class="row.source" style="margin-right: 5px" />
|
||||
@@ -89,7 +88,7 @@ export default {
|
||||
index: true,
|
||||
selection: true,
|
||||
viewBtn: true,
|
||||
menuWidth: 160,
|
||||
menuWidth: 320,
|
||||
dialogClickModal: false,
|
||||
column: [
|
||||
{
|
||||
@@ -312,8 +311,42 @@ export default {
|
||||
column.addDisabled = true;
|
||||
this.$refs.crud.rowAdd();
|
||||
},
|
||||
normalizeSubmitRow(row = {}, isUpdate = false) {
|
||||
const submitProps = [
|
||||
'id',
|
||||
'parentId',
|
||||
'code',
|
||||
'name',
|
||||
'alias',
|
||||
'path',
|
||||
'source',
|
||||
'component',
|
||||
'sort',
|
||||
'category',
|
||||
'action',
|
||||
'isOpen',
|
||||
'isDisplay',
|
||||
'remark',
|
||||
];
|
||||
const submitRow = submitProps.reduce((result, prop) => {
|
||||
if (row[prop] !== undefined) {
|
||||
result[prop] = row[prop];
|
||||
}
|
||||
return result;
|
||||
}, {});
|
||||
if (isUpdate) {
|
||||
submitRow.id = row.id || this.currentEditMenuId;
|
||||
} else {
|
||||
delete submitRow.id;
|
||||
}
|
||||
if (submitRow.parentId === '') {
|
||||
submitRow.parentId = 0;
|
||||
}
|
||||
return submitRow;
|
||||
},
|
||||
rowSave(row, done, loading) {
|
||||
add(row).then(
|
||||
const submitRow = this.normalizeSubmitRow(row);
|
||||
add(submitRow).then(
|
||||
res => {
|
||||
// 获取新增数据的相关字段
|
||||
const data = res.data.data;
|
||||
@@ -332,15 +365,15 @@ export default {
|
||||
);
|
||||
},
|
||||
rowUpdate(row, index, done, loading) {
|
||||
row.id = row.id || this.currentEditMenuId;
|
||||
update(row).then(
|
||||
const submitRow = this.normalizeSubmitRow(row, true);
|
||||
update(submitRow).then(
|
||||
() => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
});
|
||||
// 数据回调进行刷新
|
||||
done(row);
|
||||
done({ ...row, ...submitRow });
|
||||
},
|
||||
error => {
|
||||
window.console.log(error);
|
||||
@@ -417,6 +450,7 @@ export default {
|
||||
this.initData();
|
||||
}
|
||||
if (type === 'add') {
|
||||
this.form.id = undefined;
|
||||
this.form.sort = 1;
|
||||
this.form.isDisplay = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user