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