1.调整单据流转页面

prod
x_z 3 years ago
parent 4b300fa389
commit 556cbf3713

@ -65,3 +65,11 @@ export function filterForThirdSys() {
params: null params: null
}) })
} }
export function getBusTypeListByUser(params) {
return axios({
url: "/udiwms/localBusType/filterByUser",
method: "get",
params: params
});
}

@ -8,6 +8,14 @@ export function getBusTypePreResList(params) {
}); });
} }
export function getBusTypePreResList2(params) {
return axios({
url: "/spms/busTypePre/filterBusTypePreRes",
method: "get",
params: params
});
}
export function getBusTypePreList(params) { export function getBusTypePreList(params) {
return axios({ return axios({
url: "/spms/busTypePre/filter", url: "/spms/busTypePre/filter",

@ -120,15 +120,7 @@ export default {
false: "禁用", false: "禁用",
true: "启用", true: "启用",
}, },
mainActionMap: {
WareHouseIn: "入库",
WareHouseOut: "出库"
},
fileList: [],
total: 0, total: 0,
multipleSelection: [],
headers: {},
configParams: {},
loading: false, loading: false,
typeMap: { typeMap: {
1: "耗材领用", 1: "耗材领用",

@ -25,25 +25,17 @@
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row> <el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row>
<el-table-column label="序号" type="index" width="60"></el-table-column> <el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="单据类型名称" prop="originName"></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="targetName"></el-table-column>
<el-table-column label="目标单据类型" prop="targetBusName"></el-table-column> <el-table-column label="目标当前仓库" prop="locSubInvName"></el-table-column>
<el-table-column label="类型" prop="type"> <el-table-column label="目标往来仓库" prop="defautSubInvName"></el-table-column>
<el-table-column label="时间推移(小时)" prop="beforeTime"></el-table-column>
<el-table-column label="补单方式" prop="supplementAll">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ typeMap[scope.row.type] }}</span> <span>{{ enableMap[scope.row.supplementAll] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="enable"> <el-table-column label="说明" prop="intro"></el-table-column>
<template slot-scope="scope">
<span>{{ enableMap[scope.row.enable] }}</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="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -65,10 +57,10 @@
<el-dialog <el-dialog
:title="formMap[formName]" :title="formMap[formName]"
:visible.sync="addDialogVisible" :visible.sync="modifyDialogVisible"
: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"
class="dialog-two" class="dialog-two"
width="60%" width="60%"
top="5vh" top="5vh"
@ -100,11 +92,10 @@
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, getBusTypePreResList2,
addBusTypePre, addBusTypePre,
updateBusTypePre, updateBusTypePre,
deleteBusTypePre, deleteBusTypePre, getBusTypePreList
removeBusTypePre
} from "@/api/basic/busTypePre"; } from "@/api/basic/busTypePre";
export default { export default {
@ -116,40 +107,28 @@ export default {
page: 1, page: 1,
limit: 20, limit: 20,
}, },
addDialogVisible: false,
modifyDialogVisible: false, modifyDialogVisible: false,
list: [], list: [],
inputQuery: { inputQuery: {
id: null, id: null,
originName: null,
originAction: null, originAction: null,
action: null, action: null,
name: null, invCode: null,
enable: null, defaultInvCode: null,
beforeTime: null,
supplementAll: null,
intro: null,
remark: null remark: null
}, },
enableMap: { enableMap: {
true: "禁用", true: "全量补单",
false: "启用", false: "自动补单",
},
mainActionMap: {
WareHouseIn: "入库",
WareHouseOut: "出库"
}, },
fileList: [],
total: 0, total: 0,
multipleSelection: [],
headers: {},
configParams: {},
loading: false, loading: false,
typeMap: {
1: "耗材领用",
2: "产品申购",
3: "采购计划",
},
formMap: { formMap: {
add: "新增单设置", add: "新增单据流转设置",
edit: "编辑补单设置", update: "编辑单据流转设置",
}, },
formName: null, formName: null,
@ -171,7 +150,6 @@ export default {
}, },
cancelDialog() { cancelDialog() {
this.modifyDialogVisible = false; this.modifyDialogVisible = false;
this.addDialogVisible = false;
}, },
search() { search() {
this.filterQuery.page = 1; this.filterQuery.page = 1;
@ -179,7 +157,7 @@ export default {
}, },
getList() { getList() {
this.loading = true; this.loading = true;
getBusTypePreResList(this.filterQuery) getBusTypePreResList2(this.filterQuery)
.then((response) => { .then((response) => {
if (response.code === 20000) { if (response.code === 20000) {
this.list = response.data.list || []; this.list = response.data.list || [];
@ -201,21 +179,20 @@ export default {
}, },
onAddSubmit() { onAddSubmit() {
this.inputQuery.enable = 1;
if (isBlank(this.inputQuery.originName)) {
this.$message.error("补单类型名称不能为空!")
return;
}
if (isBlank(this.inputQuery.originAction)) { if (isBlank(this.inputQuery.originAction)) {
this.$message.error("补单类型代码不能为空!"); this.$message.error("原单据类型不能为空!");
return; return;
} }
if (isBlank(this.inputQuery.action)) { if (isBlank(this.inputQuery.action)) {
this.$message.error("目标单据类型不能为空!") this.$message.error("目标单据类型不能为空!")
return; return;
} }
if (isBlank(this.inputQuery.enable)) { if (isBlank(this.inputQuery.invCode)) {
this.$message.error("请选择启用状态!") this.$message.error("目标所在仓库不能为空!")
return;
}
if (isBlank(this.inputQuery.defaultInvCode)) {
this.$message.error("目标往来仓库不能为空");
return; return;
} }
@ -226,7 +203,6 @@ export default {
this.$message.error("单据类型名称不得为纯数字类型!"); this.$message.error("单据类型名称不得为纯数字类型!");
return; return;
} }
this.inputQuery.type = 1; //
addBusTypePre(this.inputQuery).then((res) => { addBusTypePre(this.inputQuery).then((res) => {
if (res.code === 20000) { if (res.code === 20000) {
@ -260,8 +236,18 @@ export default {
handleAddClick() { handleAddClick() {
this.formName = 'add'; this.formName = 'add';
this.inputQuery = {enable: false, expireTip: true}; this.inputQuery = {
this.addDialogVisible = true; id: null,
originAction: null,
action: null,
invCode: null,
defaultInvCode: null,
beforeTime: null,
supplementAll: null,
intro: null,
remark: null
};
this.modifyDialogVisible = true;
}, },
handleModifyClick(row) { handleModifyClick(row) {

@ -3,46 +3,88 @@
<el-form :model="inputQuery" :rules="formRules" ref="dataForm" label-width="120px" border> <el-form :model="inputQuery" :rules="formRules" ref="dataForm" label-width="120px" border>
<el-row type="flex"> <el-row type="flex">
<el-col :span="11"> <el-col :span="11">
<el-form-item label="补单类型名称" prop="originName"> <el-form-item label="原单据类型" prop="originAction">
<el-input v-model="inputQuery.originName" :disabled="!isAdd" size="small" placeholder="请输入内容" style="width: 90%"></el-input> <el-select v-model="inputQuery.originAction" placeholder="原单据类型" clearable size="small"
style="width: 90%">
<el-option
v-for="item in originBusTypes"
:key="item.action"
:label="item.name"
:value="item.action">
<span style="float: left"> {{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.action }}</span>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="补单类型代码" prop="originAction"> <el-form-item label="目标单据类型" prop="action">
<el-input v-model="inputQuery.originAction" :disabled="!isAdd" size="small" placeholder="请输入内容" style="width: 90%"></el-input> <el-select v-model="inputQuery.action" placeholder="目标单据类型" clearable size="small" style="width: 90%">
<el-option
v-for="item in targetBusTypes"
:key="item.action"
:label="item.name"
:value="item.action">
<span style="float: left"> {{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.action }}</span>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<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="invCode">
<el-select v-model="inputQuery.action" placeholder="请选择" clearable size="small" style="width: 90%"> <el-select v-model="inputQuery.invCode" placeholder="目标所在仓库" clearable size="small"
@change="invChange"
style="width: 90%">
<el-option <el-option
v-for="item in busTypes" v-for="item in locInvs"
:key="item.action" :key="item.name"
:label="item.name" :label="item.name"
:value="item.action"> :value="item.code">
<span style="float: left"> {{item.name}}</span> <span style="float: left"> {{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{item.action}}</span>
</el-option> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="目标往来仓库" prop="defaultInvCode">
<el-select v-model="inputQuery.defaultInvCode" placeholder="目标往来仓库" clearable size="small"
@change="invChange"
style="width: 90%">
<el-option
v-for="item in fromInvs"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left"> {{ item.name }}</span>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row type="flex">
<el-col :span="11"> <el-col :span="11">
<el-form-item label="启用状态" prop="enable"> <el-form-item label="推移时间(小时)" prop="beforeTime">
<el-select v-model="inputQuery.enable" <el-input style="width: 90%"
size="small" size="small"
placeholder="启用状态" type="number" placeholder="请输入内容"
style="width: 90%" v-model="inputQuery.beforeTime"></el-input>
clearable </el-form-item>
> </el-col>
<el-option label="启用" :value="false"></el-option>
<el-option label="禁用" :value="true"></el-option> <el-col :span="11">
<el-form-item label="流转方式" prop="supplementAll">
<el-select v-model="inputQuery.supplementAll" placeholder="流转方式" clearable size="small"
style="width: 90%">
<el-option label="全量补单" :value="true"></el-option>
<el-option label="自动补单" :value="false"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -50,9 +92,9 @@
<el-row type="flex"> <el-row type="flex">
<el-col :span="23" type="flex"> <el-col :span="23" type="flex">
<el-form-item prop="comments"> <el-form-item prop="intro">
<label slot="label">&emsp;&emsp;</label> <label slot="label">&emsp;&emsp;</label>
<el-input v-model="inputQuery.remark" size="small" style="width: 90%" type="textarea" <el-input v-model="inputQuery.intro" size="small" style="width: 90%" type="textarea"
row="3"></el-input> row="3"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -64,7 +106,8 @@
<script> <script>
import {getBusTypeList} from "@/api/basic/busType"; import {getBusTypeList, getBusTypeListByUser} from "@/api/basic/busType";
import {filterSubByInv, filterSubAll} from "@/api/system/invSubWarehouse";
export default { export default {
name: "BusTypePreModify", name: "BusTypePreModify",
@ -81,34 +124,37 @@ export default {
enabled: true, enabled: true,
isBuType: true, isBuType: true,
}, },
busTypes: [], originBusTypes: [],
targetBusTypes: [],
locInvs: [],
fromInvs: [],
isAdd: false, isAdd: false,
formRules: { formRules: {
originName: [ originAction: [
{ {
required: true, required: true,
message: "补单类型名称不能为空", message: "原单据类型不能为空",
trigger: "blur" trigger: "blur"
} }
], ],
originAction: [ action: [
{ {
required: true, required: true,
message: "补单类型代码不能为空", message: "目标单据类型不能为空",
trigger: "blur" trigger: "blur"
} }
], ],
targetBusAction: [ invCode: [
{ {
required: true, required: true,
message: "目标单据类型不能为空", message: "目标所在仓库不能为空",
trigger: "blur" trigger: "blur"
} }
], ],
enable: [ defaultInvCode: [
{ {
required: true, required: true,
message: "请选择启用状态", message: "目标往来仓库不能为空",
trigger: "blur" trigger: "blur"
} }
], ],
@ -125,14 +171,65 @@ export default {
this.busTypes = res.data.list || []; this.busTypes = res.data.list || [];
} }
}) })
} },
getOriginBusType() {
let query = {
enable: true
};
getBusTypeList(query).then((res) => {
if (res.code === 20000) {
this.originBusTypes = res.data.list || [];
}
})
},
getTargetBusType() {
let query = {
enable: true
};
getBusTypeListByUser(query).then((res) => {
if (res.code === 20000) {
this.targetBusTypes = res.data.list || [];
}
})
},
getLocInv() {
let params = {};
filterSubAll(params).then((res) => {
if (res.code === 20000){
this.locInvs = res.data.list || [];
}
});
},
getFromInv() {
let params = {
code: this.inputQuery.invCode,
filter: 2
};
filterSubByInv(params).then((res) => {
if (res.code === 20000) {
this.fromInvs = res.data;
}
})
},
invChange() {
this.getFromInv();
this.getTargetBusType();
},
}, },
created() { created() {
if (this.inputQuery.originAction == null) { if (this.inputQuery.originAction == null) {
this.isAdd = true; this.isAdd = true;
} else {
this.getTargetBusType();
} }
this.getBusType(); this.getOriginBusType();
this.getLocInv();
} }
} }
</script> </script>

Loading…
Cancel
Save