1.添加业务单据类型增加校验

fencang
x_z 3 years ago
parent 51ba4490c5
commit 8ddaf41fef

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

Loading…
Cancel
Save