新增单据类型转换设置功能

tagView
anthonywj 3 years ago
parent 732016d60a
commit a5e48ce6df

@ -1,6 +1,6 @@
{
"BASE_URL": "http://127.0.0.1:9906",
"SERVER_IP": "http://127.0.0.1:9906",
"BASE_URL": "http://192.168.0.109:9906",
"SERVER_IP": "http://192.168.0.109:9906",
"hosp_name": "福建省XX市医院"
}

@ -0,0 +1,33 @@
import axios from "../../utils/axios";
export function getBusChange(query) {
return axios({
url: "/basic/bustype/change/filter",
method: "get",
params: query
});
}
export function updateBusChange(query) {
return axios({
url: "/basic/bustype/change/update",
method: "post",
data: query
});
}
export function insertBusChange(query) {
return axios({
url: "/basic/bustype/change/insert",
method: "post",
data: query
});
}
export function delBusChange(query) {
return axios({
url: "/basic/bustype/change/delete",
method: "post",
data: query
});
}

@ -65,6 +65,7 @@ import stockDeliveryOrder from "../views/warehouse/stockDeliveryOrder";
import BussinessType from "../views/basic/BussinessType.vue";
import BussinessTypeLocl from "../views/basic/BussinessTypeLocl.vue";
import bussinessTypeThird from "../views/basic/BussinessTypeThird.vue";
import bussinessTypeChange from "../views/basic/BusTypeChange.vue";
//基础数据维护
import invWarehouse from "../views/basic/invWarehouse"
@ -374,6 +375,15 @@ export const asyncRouterMap = [
}
},
{
path: "bussinessTypeChange",
name: "单据流转设置",
component: bussinessTypeChange,
meta: {
authRule: ["admin/bussinessTypeChange"]
}
},
]
},

@ -0,0 +1,289 @@
<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 style="margin-left: 10px;display:flex;">
<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"
>新增
</el-button
>
</el-button-group>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index" width="55"></el-table-column>
<el-table-column label="单据类型名称" prop="originName"></el-table-column>
<el-table-column label="单据类型代码" prop="originAction"></el-table-column>
<el-table-column label="目标单据类型" prop="targetBusName"></el-table-column>
<el-table-column label="类型" prop="type">
<template slot-scope="scope">
<span>{{ typeMap[scope.row.type] }}</span>
</template>
</el-table-column>
<el-table-column label="状态" prop="enable">
<template slot-scope="scope">
<span>{{ enableMap[scope.row.enable] }}</span>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" width="100" 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"
@click.native.stop="handleDeleteClick(scope.row)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<el-dialog
:title="formMap[formName]"
: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"
>提交
</el-button
>
<el-button type="primary" size="small" icon="search" @click="cancelDialog"
>取消
</el-button
>
</div>
</el-dialog>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="filterQuery.page"
></el-pagination>
</el-card>
</div>
</template>
<script>
import {
getBusChange,
updateBusChange, delBusChange,
insertBusChange
} from "../../api/basic/busTypeChange";
import modifyDialog from "./BusTypeChangeModify";
import axios from "axios";
export default {
data() {
return {
filterQuery: {
name: "",
page: 1,
limit: 20,
},
addDialogVisible: false,
list: [],
inputQuery: {},
enableMap: {
true: "禁用",
false: "启用",
},
typeMap: {
1: "耗材领用",
2: "产品申购",
3: "采购计划",
},
total: 0,
loading: false,
configParms: {},
formMap: {
add: "新增单据流转设置",
update: "编辑单据流转设置",
},
formName: "add",
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
name: null,
enable: null,
page: 1,
limit: 20,
};
this.getList();
},
cancelDialog() {
this.addDialogVisible = false;
},
search() {
this.filterQuery.page = 1;
this.getList();
},
getList() {
this.loading = true;
getBusChange(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;
});
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
onAddSubmit() {
if (this.$isBlank(this.inputQuery.originName)) {
this.$message.error("单据类型名称不能为空!");
return;
}
if (this.$isBlank(this.inputQuery.originAction)) {
this.$message.error("单据类型代码不能为空!");
return;
}
if (this.$isBlank(this.inputQuery.targetBusAction)) {
this.$message.error("目标单据类型不能为空!");
return;
}
if (this.$isBlank(this.inputQuery.type)) {
this.$message.error("请选择设置类型!");
return;
}
if (this.$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;
}
insertBusChange(this.inputQuery)
.then((response) => {
if (response.code == 20000) {
this.loading = false;
this.cancelDialog();
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.cancelDialog();
});
} else {
updateBusChange(this.inputQuery)
.then((response) => {
this.loading = false;
this.cancelDialog();
this.getList();
})
.catch(() => {
this.loading = false;
this.cancelDialog();
});
}
},
handleAddClick() {
this.inputQuery = {};
this.formName = "add";
this.addDialogVisible = true;
},
handleModifyClick(row) {
this.inputQuery = row;
this.formName = "update";
this.addDialogVisible = true;
},
handleDeleteClick(row) {
this.deleteDialog(row.id)
},
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该单据类型信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let query = {
id: rowId,
}
delBusChange(query)
.then((response) => {
this.getList();
})
.catch(() => {
});
})
.catch(() => {
});
},
thirdSysChange() {
this.getList();
},
},
components: {
modifyDialog,
},
mounted() {
},
created() {
this.getList();
},
};
</script>

@ -0,0 +1,220 @@
<template>
<div>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<div class="text item">
<div class="itemTag">
<span>单据类型名称:&nbsp;</span>
</div>
<el-input
style="width: 200px"
size="small"
splaceholder="请输入内容"
:disabled="!isAdd"
v-model.trim="inputQuery.originName"
></el-input>
</div>
</el-col>
<el-col :span="10" class="el-col">
<div class="text item">
<div class="itemTag">
<span>单据类型代码:&nbsp;</span>
</div>
<el-input
style="width: 200px"
:disabled="!isAdd"
size="small"
splaceholder="请输入内容"
v-model.trim="inputQuery.originAction"
></el-input>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<div class="text item">
<div class="itemTag">
<span>目标单据类型:&nbsp;</span>
</div>
<el-select v-model="inputQuery.targetBusAction" placeholder="请选择" clearable="true">
<el-option
v-for="item in busTypes"
:key="item.localAction"
:label="item.localName"
:value="item.localAction">
<span style="float: left">{{ item.localName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.localAction }}</span>
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="10" class="el-col">
<div class="text item">
<div class="itemTag">
<span>设置类型:&nbsp;</span>
</div>
<el-select
size="small"
v-model="inputQuery.type"
placeholder="设置类型"
>
<el-option label="耗材领用" :value="1"></el-option>
<el-option label="产品申购" :value="2"></el-option>
<el-option label="采购计划" :value="3"></el-option>
</el-select>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<div class="text item">
<div class="itemTag">
<span>启用状态:&nbsp;</span>
</div>
<el-select
size="small"
v-model="inputQuery.enable"
placeholder="启用状态"
>
<el-option label="启用" :value="false"></el-option>
<el-option label="禁用" :value="true"></el-option>
</el-select>
</div>
</el-col>
<el-col :span="10" class="el-col">
<div class="text item">
<div class="itemTag">
<span>备注:&nbsp;</span>
</div>
<el-input
style="width: 200px"
size="small"
splaceholder="请输入内容"
v-model="inputQuery.remark"
></el-input>
</div>
</el-col>
</el-row>
<el-divider></el-divider>
</div>
</template>
<script>
import {
getBasicThirdSys,
} from "../../api/basic/basicThirdSys";
import {
getLocalBusType, getLocalJoinBusType,
} from "../../api/basic/busLocalType";
export default {
name: "BusTypeChangeModify",
props: {
inputQuery: {
type: Object,
required: true,
},
},
data() {
return {
filterQuery: {
enabled: true,
isBuType: true,
},
busTypes: [],
isAdd: false,
rules: {
originName: [
{
required: true,
message: "单据类型名称不能为空",
trigger: "blur"
}
],
originAction: [
{
required: true,
message: "单据类型代码不能为空",
trigger: "blur"
}
],
targetBusAction: [
{
required: true,
message: "目标单据类型不能为空",
trigger: "blur"
}
],
type: [
{
required: true,
message: "请选择设置类型",
trigger: "blur"
}
],
enable: [
{
required: true,
message: "请选择启用状态",
trigger: "blur"
}
],
},
}
},
methods: {
getBusType() {
let query = {
enabled: true,
corpType: 1,
};
getLocalJoinBusType(query)
.then((response) => {
this.busTypes = response.data.list || [];
})
.catch(() => {
});
}
},
created() {
if (this.inputQuery.originAction == null) {
this.isAdd = true;
}
this.getBusType();
}
,
}
;
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 100px;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 20px;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>
Loading…
Cancel
Save