1.调整补单设置页面

prod
x_z 2 years ago
parent 080a3caae3
commit 381f9e44be

@ -54,7 +54,6 @@
> >
<el-button <el-button
type="text" type="text"
:disabled="scope.row.systemDefault"
@click.native.stop="deleteDialog(scope.row)" @click.native.stop="deleteDialog(scope.row)"
>删除 >删除
</el-button </el-button
@ -77,7 +76,6 @@
<modifyDialog :inputQuery="inputQuery"></modifyDialog> <modifyDialog :inputQuery="inputQuery"></modifyDialog>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="onAddSubmit" <el-button type="primary" size="small" @click="onAddSubmit"
:disabled="!configParams.typeScan"
>提交 >提交
</el-button </el-button
> >
@ -100,12 +98,10 @@
</template> </template>
<script> <script>
import {getBusTypeList, deleteBusType, updateBusType, insertBusType} from "@/api/basic/busType"; import {getBusTypeList, deleteBusType, updateBusType, insertBusType} from "@/api/basic/busType";
import {findConfig} from "@/api/thrsys/spsSyncStatus";
import {isBlank} from "@/utils/strUtil"; import {isBlank} from "@/utils/strUtil";
import modifyDialog from "@/views/system/param/busTypePreModify.vue"; import modifyDialog from "@/views/system/param/busTypePreModify.vue";
import { import {
getBusTypePreResList, getBusTypePreResList,
getBusTypePreList,
addBusTypePre, addBusTypePre,
updateBusTypePre, updateBusTypePre,
deleteBusTypePre, deleteBusTypePre,
@ -128,9 +124,8 @@ export default {
id: null, id: null,
originName: null, originName: null,
originAction: null, originAction: null,
targetBusAction: null, action: null,
targetBusName: null, name: null,
systemDefault: null,
enable: null, enable: null,
remark: null remark: null
}, },
@ -185,7 +180,7 @@ export default {
}, },
getList() { getList() {
this.loading = true; this.loading = true;
getBusTypeList(this.filterQuery) getBusTypePreResList(this.filterQuery)
.then((response) => { .then((response) => {
if (response.code === 20000) { if (response.code === 20000) {
this.list = response.data.list || []; this.list = response.data.list || [];
@ -207,54 +202,61 @@ export default {
}, },
onAddSubmit() { onAddSubmit() {
if (isBlank(this.inputQuery.name)) { this.inputQuery.enable = 1;
this.$message.error("单据类型名称不能为空!"); if (isBlank(this.inputQuery.originName)) {
this.$message.error("补单类型名称不能为空!")
return; return;
} }
if (this.$isBlank(this.inputQuery.corpType)) { if (isBlank(this.inputQuery.originAction)) {
this.$message.error("往来信息类型不能为空!"); this.$message.error("补单类型代码不能为空!");
return; return;
} }
if (this.inputQuery.mainAction == "" || this.inputQuery.mainAction == null) { if (isBlank(this.inputQuery.action)) {
this.$message.error("出入库类型不能为空!"); this.$message.error("目标单据类型不能为空!")
return; return;
} }
this.inputQuery.enable = 1; if (isBlank(this.inputQuery.enable)) {
insertBusType(this.inputQuery) this.$message.error("请选择启用状态!")
.then((response) => { return;
if (response.code == 20000) { }
if (this.formName === "add") {
let numRegExp = '^[0-9]*$';
let numReg = new RegExp(numRegExp);
if (numReg.test(this.inputQuery.name)) {
this.$message.error("单据类型名称不得为纯数字类型!");
return;
}
this.inputQuery.type = 1; //
addBusTypePre(this.inputQuery).then((res) => {
if (res.code === 20000) {
this.loading = false; this.loading = false;
this.cancelDialog(); this.cancelDialog();
this.getList(); this.getList();
} else { } else {
this.$message.error(response.message); this.$message.error(res.message);
} }
}) }).catch((error) => {
.catch(() => {
this.loading = false; this.loading = false;
this.$message.error(error.message);
this.cancelDialog(); this.cancelDialog();
}); });
}, } else {
updateBusTypePre(this.inputQuery).then((res) => {
onModifySubmit() { if (res.code === 20000) {
if (this.inputQuery.mainAction == "" || this.inputQuery.mainAction == null) {
this.$message.error("出入库类型不能为空!");
return;
}
updateBusType(this.inputQuery)
.then((response) => {
if (response.code == 20000) {
this.loading = false; this.loading = false;
this.cancelDialog(); this.cancelDialog();
this.getList(); this.getList();
} else { } else {
this.$message.error(response.message); this.$message.error(res.message);
} }
}) }).catch((error) => {
.catch(() => {
this.loading = false; this.loading = false;
this.$message.error(error.message);
this.cancelDialog(); this.cancelDialog();
}); });
}
}, },
handleAddClick() { handleAddClick() {
@ -269,53 +271,21 @@ export default {
}, },
deleteDialog(rowId) { deleteDialog(rowId) {
this.$confirm("此操作将永久删除该扫码类型信息, 是否继续?", "提示", { this.$confirm("此操作将永久删除该补单设置, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
this.deleteOrders(rowId); let params = {};
}) deleteBusTypePre(params).then((res) => {
.catch(() => { if (res.code === 20000) {
}); this.$message.success("删除成功!");
},
deleteOrders(data) {
this.loading = true;
let tquery = {
id: data.id + "",
};
deleteBusType(tquery)
.then((response) => {
this.getList(); this.getList();
if (response.code == 20000) {
this.$message({
type: "success",
message: "删除成功!",
});
} else { } else {
this.$message.error(response.message); this.$message.error(res.message);
} }
}) })
.catch(() => {
});
},
handleChange(response, files, fileList) {
if (response.code != 20000) {
this.$message.error(response.message);
} else {
this.$message.success(response.data);
this.getList();
}
},
getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParams = response.data;
}
}) })
.catch(() => { .catch(() => {
}); });
@ -325,8 +295,6 @@ export default {
modifyDialog modifyDialog
}, },
created() { created() {
this.init();
this.getSyncConfig();
this.getList(); this.getList();
}, },
}; };

@ -19,7 +19,7 @@
<el-row type="flex"> <el-row type="flex">
<el-col :span="11"> <el-col :span="11">
<el-form-item label="目标单据类型" prop="targetBusAction"> <el-form-item label="目标单据类型" prop="targetBusAction">
<el-select v-model="inputQuery.targetBusAction" placeholder="请选择" clearable size="small" style="width: 90%"> <el-select v-model="inputQuery.action" placeholder="请选择" clearable size="small" style="width: 90%">
<el-option <el-option
v-for="item in busTypes" v-for="item in busTypes"
:key="item.action" :key="item.action"
@ -37,7 +37,6 @@
<el-form-item label="启用状态" prop="enable"> <el-form-item label="启用状态" prop="enable">
<el-select v-model="inputQuery.enable" <el-select v-model="inputQuery.enable"
size="small" size="small"
:disabled="inputQuery.systemDefault"
placeholder="启用状态" placeholder="启用状态"
style="width: 90%" style="width: 90%"
clearable clearable
@ -86,14 +85,14 @@ export default {
originName: [ originName: [
{ {
required: true, required: true,
message: "类型名称不能为空", message: "单类型名称不能为空",
trigger: "blur" trigger: "blur"
} }
], ],
originAction: [ originAction: [
{ {
required: true, required: true,
message: "类型代码不能为空", message: "单类型代码不能为空",
trigger: "blur" trigger: "blur"
} }
], ],

Loading…
Cancel
Save