1.添加业务单据类型增加校验
parent
51ba4490c5
commit
8ddaf41fef
@ -1,325 +1,344 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
|
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
|
||||||
<el-form-item class="query-form-item">
|
<el-form-item class="query-form-item">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="filterQuery.name"
|
v-model="filterQuery.name"
|
||||||
placeholder="业务类型"
|
placeholder="业务类型"
|
||||||
style="width: 400px"
|
style="width: 400px"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
|
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
|
||||||
<el-button type="primary" icon="search" @click="getList">查询</el-button>
|
<el-button type="primary" icon="search" @click="search">查询</el-button>
|
||||||
<el-button type="primary" icon="search" @click="handleAddClick"
|
<el-button type="primary" icon="search" @click="handleAddClick"
|
||||||
:disabled="!configParms.typeBus"
|
:disabled="!configParms.typeBus"
|
||||||
>新增
|
>新增
|
||||||
</el-button
|
</el-button
|
||||||
>
|
>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="list" style="width: 100%">
|
<el-table v-loading="loading" :data="list" style="width: 100%">
|
||||||
<el-table-column label="序号" type="index" width="120" fixed></el-table-column>
|
<el-table-column label="序号" type="index" width="120" fixed></el-table-column>
|
||||||
<el-table-column label="业务单据类型名称" prop="name" fixed></el-table-column>
|
<el-table-column label="业务单据类型名称" prop="name" fixed></el-table-column>
|
||||||
<el-table-column label="业务单据类型代码" prop="action" fixed></el-table-column>
|
<el-table-column label="业务单据类型代码" prop="action" fixed></el-table-column>
|
||||||
<el-table-column label="第三方单据类型" prop="originAction" fixed></el-table-column>
|
<el-table-column label="第三方单据类型" prop="originAction" fixed></el-table-column>
|
||||||
<el-table-column label="是否寄售" prop="advanceType" fixed>
|
<el-table-column label="是否寄售" prop="advanceType" fixed>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ enableMap[scope.row.advanceType] }}</span>
|
<span>{{ enableMap[scope.row.advanceType] }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="预验收" prop="preIn" fixed>
|
<el-table-column label="预验收" prop="preIn" fixed>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ enableMap[scope.row.preIn] }}</span>
|
<span>{{ enableMap[scope.row.preIn] }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="缺量自动补单" prop="advanceType" fixed>
|
<el-table-column label="缺量自动补单" prop="advanceType" fixed>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ enableMap[scope.row.changeEnable] }}</span>
|
<span>{{ enableMap[scope.row.changeEnable] }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="允许供应商使用" prop="spUse" fixed>
|
<el-table-column label="允许供应商使用" prop="spUse" fixed>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ enableMap[scope.row.spUse] }}</span>
|
<span>{{ enableMap[scope.row.spUse] }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
<el-table-column label="操作" fixed="right">
|
<el-table-column label="操作" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@click.native.stop="handleModifyClick(scope.row)"
|
@click.native.stop="handleModifyClick(scope.row)"
|
||||||
>编辑
|
>编辑
|
||||||
</el-button
|
</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
:disabled="!configParms.typeBus"
|
:disabled="!configParms.typeBus"
|
||||||
@click.native.stop="deleteDialog(scope.row)"
|
@click.native.stop="deleteDialog(scope.row)"
|
||||||
>删除
|
>删除
|
||||||
</el-button
|
</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="新增业务类型关联"
|
||||||
|
:visible.sync="addDialogVisible"
|
||||||
|
width="70%"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
v-if="addDialogVisible"
|
||||||
>
|
>
|
||||||
</template>
|
<modifyDialog :inputQuery="inputQuery"></modifyDialog>
|
||||||
</el-table-column>
|
<div style="text-align: center">
|
||||||
</el-table>
|
<el-button type="primary" size="small" icon="search" @click="onAddSubmit"
|
||||||
|
:disabled="!configParms.typeBus"
|
||||||
|
>提交
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" size="small" icon="search" @click="cancelDialog"
|
||||||
|
>取消
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="新增业务类型关联"
|
title="编辑业务类型关联"
|
||||||
:visible.sync="addDialogVisible"
|
:visible.sync="modifyDialogVisible"
|
||||||
width="70%"
|
width="70%"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:close-on-press-escape="false"
|
:close-on-press-escape="false"
|
||||||
v-if="addDialogVisible"
|
v-if="modifyDialogVisible"
|
||||||
>
|
>
|
||||||
<modifyDialog :inputQuery="inputQuery"></modifyDialog>
|
<modifyDialog :inputQuery="inputQuery"></modifyDialog>
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<el-button type="primary" size="small" icon="search" @click="onAddSubmit"
|
<el-button type="primary" size="small" icon="search" @click="onModifySubmit"
|
||||||
:disabled="!configParms.typeBus"
|
:disabled="!configParms.typeBus"
|
||||||
>提交
|
>提交
|
||||||
</el-button
|
</el-button
|
||||||
>
|
>
|
||||||
<el-button type="primary" size="small" icon="search" @click="cancelDialog"
|
<el-button type="primary" size="small" icon="search" @click="cancelDialog"
|
||||||
>取消
|
>取消
|
||||||
</el-button
|
</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog
|
<el-pagination
|
||||||
title="编辑业务类型关联"
|
:page-size="filterQuery.limit"
|
||||||
:visible.sync="modifyDialogVisible"
|
@current-change="handleCurrentChange"
|
||||||
width="70%"
|
layout="prev, pager, next"
|
||||||
:close-on-click-modal="false"
|
:total="total"
|
||||||
:close-on-press-escape="false"
|
></el-pagination>
|
||||||
v-if="modifyDialogVisible"
|
</el-card>
|
||||||
>
|
</div>
|
||||||
<modifyDialog :inputQuery="inputQuery"></modifyDialog>
|
|
||||||
<div style="text-align: center">
|
|
||||||
<el-button type="primary" size="small" icon="search" @click="onModifySubmit"
|
|
||||||
:disabled="!configParms.typeBus"
|
|
||||||
>提交
|
|
||||||
</el-button
|
|
||||||
>
|
|
||||||
<el-button type="primary" size="small" icon="search" @click="cancelDialog"
|
|
||||||
>取消
|
|
||||||
</el-button
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import {getLocalBusType, addLocalBusType, updateLocalBusType, deleteLocalBusType} from "@/api/basic/busLocalType";
|
import {getLocalBusType, addLocalBusType, updateLocalBusType, deleteLocalBusType} from "@/api/basic/busLocalType";
|
||||||
import modifyDialog from "./BussinessTypeLoclModify";
|
import modifyDialog from "./BussinessTypeLoclModify";
|
||||||
import {findConfig} from "@/api/thrsys/spsSyncStatus";
|
import {findConfig} from "@/api/thrsys/spsSyncStatus";
|
||||||
|
import {isBlank} from "@/utils/strUtil";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
filterQuery: {
|
filterQuery: {
|
||||||
enabled: "1",
|
enabled: "1",
|
||||||
udiwmsType: "",
|
udiwmsType: "",
|
||||||
thirdType: "",
|
thirdType: "",
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
},
|
},
|
||||||
addDialogVisible: false,
|
addDialogVisible: false,
|
||||||
modifyDialogVisible: false,
|
modifyDialogVisible: false,
|
||||||
list: [],
|
list: [],
|
||||||
inputQuery: {
|
inputQuery: {
|
||||||
action: "",
|
action: "",
|
||||||
name: "",
|
name: "",
|
||||||
enable: "",
|
enable: "",
|
||||||
remark: "",
|
remark: "",
|
||||||
mainAction: "",
|
mainAction: "",
|
||||||
thirdSysFk: "",
|
thirdSysFk: "",
|
||||||
id: "",
|
id: "",
|
||||||
originAction: null,
|
originAction: null,
|
||||||
localAction: null,
|
localAction: null,
|
||||||
advanceType: null,
|
advanceType: null,
|
||||||
changeEnable: null,
|
changeEnable: null,
|
||||||
spUse: null,
|
spUse: null,
|
||||||
prefix: null,
|
prefix: null,
|
||||||
preIn: null,
|
preIn: null,
|
||||||
supplementAll: false,
|
supplementAll: false,
|
||||||
},
|
},
|
||||||
enableMap: {
|
enableMap: {
|
||||||
true: "是",
|
true: "是",
|
||||||
false: "否",
|
false: "否",
|
||||||
},
|
},
|
||||||
|
|
||||||
total: 0,
|
|
||||||
multipleSelection: [],
|
|
||||||
configParms: {},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
total: 0,
|
||||||
onReset() {
|
multipleSelection: [],
|
||||||
this.$router.push({
|
configParms: {},
|
||||||
path: "",
|
};
|
||||||
});
|
|
||||||
this.filterQuery = {
|
|
||||||
udiwmsType: "",
|
|
||||||
thirdType: "",
|
|
||||||
page: 1,
|
|
||||||
limit: 20,
|
|
||||||
};
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
cancelDialog() {
|
|
||||||
this.modifyDialogVisible = false;
|
|
||||||
this.addDialogVisible = false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getList() {
|
methods: {
|
||||||
this.loading = true;
|
onReset() {
|
||||||
getLocalBusType(this.filterQuery)
|
this.$router.push({
|
||||||
.then((response) => {
|
path: "",
|
||||||
this.loading = false;
|
});
|
||||||
this.list = response.data.list || [];
|
this.filterQuery = {
|
||||||
this.total = response.data.total || 0;
|
udiwmsType: "",
|
||||||
})
|
thirdType: "",
|
||||||
.catch(() => {
|
page: 1,
|
||||||
this.loading = false;
|
limit: 20,
|
||||||
this.list = [];
|
};
|
||||||
this.total = 0;
|
this.getList();
|
||||||
});
|
},
|
||||||
},
|
cancelDialog() {
|
||||||
|
this.modifyDialogVisible = false;
|
||||||
|
this.addDialogVisible = false;
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.filterQuery.page = val;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.filterQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getLocalBusType(this.filterQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = response.data.list || [];
|
||||||
|
this.total = response.data.total || 0;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
onAddSubmit() {
|
onAddSubmit() {
|
||||||
addLocalBusType(this.inputQuery)
|
if (isBlank(this.inputQuery.name)) {
|
||||||
.then((response) => {
|
this.$message.warning("业务单据类型名称为空");
|
||||||
this.loading = false;
|
return;
|
||||||
if (response.code == 20000) {
|
|
||||||
this.cancelDialog();
|
|
||||||
this.getList();
|
|
||||||
} else {
|
|
||||||
this.$message.error(response.message);
|
|
||||||
}
|
}
|
||||||
})
|
addLocalBusType(this.inputQuery)
|
||||||
.catch(() => {
|
.then((response) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.cancelDialog();
|
if (response.code == 20000) {
|
||||||
});
|
this.cancelDialog();
|
||||||
},
|
this.getList();
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.cancelDialog();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
onModifySubmit() {
|
onModifySubmit() {
|
||||||
updateLocalBusType(this.inputQuery)
|
updateLocalBusType(this.inputQuery)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.cancelDialog();
|
this.cancelDialog();
|
||||||
this.getList();
|
this.getList();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.cancelDialog();
|
this.cancelDialog();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleModifyClick(row) {
|
handleModifyClick(row) {
|
||||||
this.modifyDialogVisible = true;
|
this.modifyDialogVisible = true;
|
||||||
this.inputQuery = {
|
this.inputQuery = {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
remark: row.remark,
|
remark: row.remark,
|
||||||
action: row.action,
|
action: row.action,
|
||||||
name: row.name,
|
name: row.name,
|
||||||
enable: row.enable,
|
enable: row.enable,
|
||||||
mainAction: row.mainAction,
|
mainAction: row.mainAction,
|
||||||
localAction: row.localAction,
|
localAction: row.localAction,
|
||||||
thirdSysFk: row.thirdSysFk,
|
thirdSysFk: row.thirdSysFk,
|
||||||
originAction: row.originAction,
|
originAction: row.originAction,
|
||||||
advanceType: row.advanceType,
|
advanceType: row.advanceType,
|
||||||
changeEnable: row.changeEnable,
|
changeEnable: row.changeEnable,
|
||||||
spUse: row.spUse,
|
spUse: row.spUse,
|
||||||
prefix: row.prefix,
|
prefix: row.prefix,
|
||||||
preIn: row.preIn,
|
preIn: row.preIn,
|
||||||
supplementAll: row.supplementAll,
|
supplementAll: row.supplementAll,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
handleAddClick() {
|
handleAddClick() {
|
||||||
this.addDialogVisible = true;
|
this.addDialogVisible = true;
|
||||||
this.inputQuery = {
|
this.inputQuery = {
|
||||||
action: "",
|
action: "",
|
||||||
name: "",
|
name: "",
|
||||||
enable: "",
|
enable: "",
|
||||||
remark: "",
|
remark: "",
|
||||||
mainAction: null,
|
mainAction: null,
|
||||||
thirdSysFk: "",
|
thirdSysFk: "",
|
||||||
id: null,
|
id: null,
|
||||||
advanceType: null,
|
advanceType: null,
|
||||||
localAction: null,
|
localAction: null,
|
||||||
changeEnable: null,
|
changeEnable: null,
|
||||||
prefix: null,
|
prefix: null,
|
||||||
preIn: null,
|
preIn: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteDialog(rowId) {
|
deleteDialog(rowId) {
|
||||||
this.$confirm("此操作将永久删除该业务类型信息, 是否继续?", "提示", {
|
this.$confirm("此操作将永久删除该业务类型信息, 是否继续?", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.deleteOrders(rowId);
|
this.deleteOrders(rowId);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteOrders(data) {
|
deleteOrders(data) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let tquery = {
|
let tquery = {
|
||||||
id: data.id + "",
|
id: data.id + "",
|
||||||
};
|
};
|
||||||
|
|
||||||
deleteLocalBusType(tquery)
|
deleteLocalBusType(tquery)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.getList();
|
this.getList();
|
||||||
if (response.code == 20000) {
|
if (response.code == 20000) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "删除成功!",
|
message: "删除成功!",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.message);
|
this.$message.error(response.message);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
getSyncConfig() {
|
||||||
|
findConfig()
|
||||||
|
.then((response) => {
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.configParms = response.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
getSyncConfig() {
|
components: {
|
||||||
findConfig()
|
modifyDialog,
|
||||||
.then((response) => {
|
},
|
||||||
if (response.code == 20000) {
|
mounted() {
|
||||||
this.configParms = response.data;
|
},
|
||||||
}
|
created() {
|
||||||
})
|
this.getSyncConfig();
|
||||||
.catch(() => {
|
this.getList();
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
|
||||||
components: {
|
|
||||||
modifyDialog,
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getSyncConfig();
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue