多次使用出库设置功能代码提交
parent
e4ee20e568
commit
ebd9a35527
@ -0,0 +1,71 @@
|
||||
import axios from '@/utils/request'
|
||||
|
||||
export function filterList(query) {
|
||||
return axios({
|
||||
url: "/udiwms/inout/muti/filterList",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
export function addMuti(query) {
|
||||
return axios({
|
||||
url: "/udiwms/inout/muti/add",
|
||||
method: "post",
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
export function updateMuti(query) {
|
||||
return axios({
|
||||
url: "/udiwms/inout/muti/update",
|
||||
method: "post",
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
export function detailMuti(query) {
|
||||
return axios({
|
||||
url: "/udiwms/inout/muti/detail",
|
||||
method: "post",
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function findByCode(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/udiwms/basic/findByCode",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function getCodeList(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inout/code/filterList",
|
||||
method: "get",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
export function findByOrderId(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inout/code/findByOrderId",
|
||||
method: "get",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
export function getCodeListForEdit(params){
|
||||
return axios({
|
||||
url: "/udiwms/inout/code/getCodeListForEdit",
|
||||
method: "get",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form :model="filterQuery" class="query-form" size="mini" label-width="120px" :inline="true">
|
||||
<el-form-item label="当前仓库:">
|
||||
<el-input v-model="filterQuery.curInv" placeholder="请输入配送企业名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="addOrderMuti">新增</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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="当前仓库" prop="invName"></el-table-column>
|
||||
<el-table-column label="生成出库单默认往来单位" prop="fromCorpName"></el-table-column>
|
||||
<el-table-column label="生成出库单默认单据类型" prop="targetActionName"></el-table-column>
|
||||
<el-table-column label="备注" prop="remark"></el-table-column>
|
||||
<el-table-column label="操作" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click.native="editDialog(scope.row)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click.native.stop="deleteDialog(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="filterQuery.page"
|
||||
:limit.sync="filterQuery.limit"
|
||||
@pagination="handleCurrentChange"
|
||||
|
||||
></pagination>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
:title="formMap[formName]"
|
||||
:visible.sync="orderMutiSetVisible"
|
||||
:before-close="close"
|
||||
width="40%"
|
||||
v-if="orderMutiSetVisible"
|
||||
@close='closeDialog'
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
>
|
||||
<ioOrderMutiSetDialog
|
||||
:closeDialog="closeDialog"
|
||||
:inputQuery="inputQuery"
|
||||
:formName="formName"
|
||||
></ioOrderMutiSetDialog>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import ioOrderMutiSetDialog from "@/views/inout/muti/ioOrderMutiSetDialog";
|
||||
import {detailMuti, filterList} from "@/api/inout/orderMuti";
|
||||
|
||||
|
||||
export default {
|
||||
name: "ioOrderMutiSet",
|
||||
data() {
|
||||
return {
|
||||
filterQuery: {
|
||||
curInv: null,
|
||||
fromCorp: null,
|
||||
targetAction: null,
|
||||
remark: null,
|
||||
updateTime: null,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
inputQuery: {
|
||||
curInv: null,
|
||||
fromCorp: "",
|
||||
targetAction: null,
|
||||
remark: null,
|
||||
updateTime: null,
|
||||
},
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: [],
|
||||
formName: 1,
|
||||
formMap: {
|
||||
1: "新增出库设置",
|
||||
2: "编辑出库设置",
|
||||
},
|
||||
orderMutiSetVisible: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onSubmit() {
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.filterQuery.page = val.page;
|
||||
this.getList();
|
||||
},
|
||||
closeDialog(){
|
||||
this.orderMutiSetVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
addOrderMuti(){
|
||||
this.inputQuery={
|
||||
curInv: null,
|
||||
fromCorp: null,
|
||||
targetAction: null,
|
||||
remark: null,
|
||||
updateTime: null,
|
||||
}
|
||||
this.formName=1;
|
||||
this.orderMutiSetVisible = true;
|
||||
},
|
||||
editDialog(row){
|
||||
this.formName=2;
|
||||
this.inputQuery=row;
|
||||
console.log(this.inputQuery)
|
||||
this.orderMutiSetVisible = true;
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
filterList(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;
|
||||
});
|
||||
},
|
||||
deleteDialog(row) {
|
||||
detailMuti(row)
|
||||
.then((response) => {
|
||||
if(response.code == 20000){
|
||||
this.getList()
|
||||
}else{
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error(response.message);
|
||||
});
|
||||
},
|
||||
},
|
||||
components: {ioOrderMutiSetDialog},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form :model="inputQuery" label-width="120px" >
|
||||
<el-row>
|
||||
<el-col :span="20" >
|
||||
<el-form-item label="当前仓库:">
|
||||
<el-select v-model="inputQuery.curInv" @change="getBusType" placeholder="请选择当前仓库信息" style="width: 90%" clearable>
|
||||
<el-option
|
||||
v-for="item in invList"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{
|
||||
item.code
|
||||
}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="20" >
|
||||
<el-form-item label="往来单位:">
|
||||
<el-select v-model="inputQuery.fromCorp" placeholder="请选择往来仓库" @change="lokk" clearable style="width: 90%">
|
||||
<el-option
|
||||
v-for="item in fromInvOptions"
|
||||
:key="item.erpId"
|
||||
:label="item.name"
|
||||
:value="item.erpId"
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{item.code}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="20" >
|
||||
<el-form-item label="单据类型:">
|
||||
<el-select v-model="inputQuery.targetAction" placeholder="请选择单据类型" style="width: 90%" clearable>
|
||||
<el-option
|
||||
v-for="item in busTypes"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.action">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="20" >
|
||||
<el-form-item label="备注:">
|
||||
<el-input type="textarea" :rows="3" v-model="inputQuery.remark" placeholder="请输入备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'>
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
<el-button type="primary" @click="submitInv">提交</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getLocalJoinByUser} from "@/api/basic/busType";
|
||||
import {filterSubAll} from "@/api/system/invSubWarehouse";
|
||||
import {selectCorpList} from "@/api/basic/basicUnitMaintain"
|
||||
import {addMuti,updateMuti} from "@/api/inout/orderMuti";
|
||||
|
||||
export default {
|
||||
name: "ioOrderMutiSetDialog",
|
||||
props: {
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
formName: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
inputQuery: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
invList:[],
|
||||
fromInvOptions: [],
|
||||
busTypes: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getInvList() {
|
||||
filterSubAll()
|
||||
.then((response) => {
|
||||
this.invList = response.data || [];
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
lokk(){
|
||||
console.log(this.inputQuery)
|
||||
},
|
||||
findFromInvList(val) {
|
||||
let cQuery = {
|
||||
corpType: 4,
|
||||
};
|
||||
selectCorpList(cQuery)
|
||||
.then((response) => {
|
||||
this.fromInvOptions = response.data || [];
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
getBusType() {
|
||||
let query = {
|
||||
code: this.inputQuery.curInv,
|
||||
enabled: true,
|
||||
};
|
||||
getLocalJoinByUser(query)
|
||||
.then((response) => {
|
||||
this.busTypes = response.data.list || [];
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
submitInv(){
|
||||
if(this.formName==1){
|
||||
addMuti(this.inputQuery).then((response) => {
|
||||
if(response.code == 20000){
|
||||
this.closeDialog();
|
||||
}else{
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error("添加失败");
|
||||
});
|
||||
}else{
|
||||
updateMuti(this.inputQuery).then((response) => {
|
||||
if(response.code == 20000){
|
||||
this.closeDialog();
|
||||
}else{
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error("添加失败");
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
console.log(this.inputQuery)
|
||||
this.getInvList();
|
||||
this.findFromInvList();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue