去除仓库功能

zhairh
zhengmingliang 3 years ago committed by 郑明梁
parent 0bd1b0316a
commit 3010f2ad31

@ -16,6 +16,13 @@ export function filterSubByInv(query) {
params: query params: query
}); });
} }
export function filterSub(query) {
return axios({
url: "/spms/sub/inv/warehouse/filterSub",
method: "get",
params: query
});
}

@ -1,36 +1,15 @@
<template> <template>
<div> <div>
<el-form :model="inputQuery" :rules="formRules" ref="dataForm"> <el-form :model="inputQuery" :rules="formRules" ref="dataForm">
<el-row :gutter="20" class="el-row" type="flex"> <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.curInv" placeholder="当前仓库" @change="invChange" clearable>
<el-option
v-for="item in storageList"
:key="item.code"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="10" class="el-col"> <el-col :span="10" class="el-col">
<div class="text item"> <div class="text item">
<div class="itemTag"> <div class="itemTag">
<span>当前分库:&nbsp;</span> <span>当前分库:&nbsp;</span>
</div> </div>
<el-select v-model="inputQuery.invWarehouseCode" placeholder="当前分库" <el-select v-model="inputQuery.invWarehouseCode" placeholder="当前分库"
@change="subInvChange" @change="entrustInvChange"
filterable
clearable> clearable>
<el-option <el-option
v-for="item in subInvList" v-for="item in subInvList"
@ -38,6 +17,7 @@
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
@ -73,27 +53,6 @@
</el-row> </el-row>
<el-row :gutter="20" class="el-row" type="flex"> <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.entrustInv" placeholder="接受委托仓库" @change="entrustInvChange"
clearable>
<el-option
v-for="item in entrustStorageList"
:key="item.code"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="10" class="el-col"> <el-col :span="10" class="el-col">
<div class="text item"> <div class="text item">
<div class="itemTag"> <div class="itemTag">
@ -101,6 +60,7 @@
</div> </div>
<el-select v-model="inputQuery.entrustSubInv" placeholder="接受委托分库" <el-select v-model="inputQuery.entrustSubInv" placeholder="接受委托分库"
@change="entrustSubInvChange" @change="entrustSubInvChange"
filterable
clearable> clearable>
<el-option <el-option
v-for="item in entrustSubInvList" v-for="item in entrustSubInvList"
@ -108,6 +68,7 @@
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
@ -173,7 +134,7 @@ import {
import {filterAll, filterNext, warehouseBussinessTypeList, warehouseUserList} from "@/api/basic/invWarehouse"; import {filterAll, filterNext, warehouseBussinessTypeList, warehouseUserList} from "@/api/basic/invWarehouse";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain"; import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {filterNoUseBusType} from "@/api/basic/EntrustRece"; import {filterNoUseBusType} from "@/api/basic/EntrustRece";
import {filterSubByInv} from "@/api/basic/invSubWarehouse"; import {filterSubByInv,filterSub} from "@/api/basic/invSubWarehouse";
export default { export default {
@ -268,12 +229,13 @@ export default {
findEntrustSubInvByInv() { findEntrustSubInvByInv() {
this.entrustSubInvList = []; this.entrustSubInvList = [];
let query = { let query = {
pcode: this.inputQuery.entrustInv, code: this.inputQuery.invWarehouseCode,
filter: 2,
}; };
filterSubByInv(query) filterSub(query)
.then((response) => { .then((response) => {
this.entrustSubInvList = response.data || []; this.entrustSubInvList = response.data || [];
this.entrustSubInvChange(); this.entrustSubInvChange();
@ -295,6 +257,7 @@ export default {
}); });
}, },
getOrderType() { getOrderType() {
let query = { let query = {
locSubInvCode: this.inputQuery.invWarehouseCode locSubInvCode: this.inputQuery.invWarehouseCode
} }

@ -168,7 +168,7 @@
<el-button <el-button
type="text" type="text"
size="small" :disabled="!configParms.basicInv" size="small" :disabled="!configParms.basicInv"
@click.native.stop="selsectBussinessType(scope.row)" @click.native.stop="addBussinessType(scope.row)"
>管理单据类型 >管理单据类型
</el-button </el-button
> >
@ -332,6 +332,7 @@
<el-table-column label="单据类型编码" prop="action" fixed></el-table-column> <el-table-column label="单据类型编码" prop="action" fixed></el-table-column>
<el-table-column label="单据类型名称" prop="name" fixed></el-table-column> <el-table-column label="单据类型名称" prop="name" fixed></el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
:page-size="bussinessTypeQuery.limit" :page-size="bussinessTypeQuery.limit"
@current-change="getBussinessType" @current-change="getBussinessType"
@ -340,6 +341,7 @@
:current-page="bussinessTypeQuery.page" :current-page="bussinessTypeQuery.page"
> >
</el-pagination> </el-pagination>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native="bussinessTypeFormVisible = !bussinessTypeFormVisible" <el-button @click.native="bussinessTypeFormVisible = !bussinessTypeFormVisible"
>取消 >取消
@ -353,53 +355,6 @@
</div> </div>
</el-dialog> </el-dialog>
<!--添加单据类型弹窗---->
<!--添加单据类型弹窗-->
<el-dialog
title="仓库关联单据类型"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="userBussinessTypeFormVisible"
>
<el-row type="flex" justify="end">
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
<el-button
type="primary"
@click.native="addBussinessType()"
:loading="loading"
>选入
</el-button
>
</el-button-group>
</el-row>
<el-table v-loading="loading" :data="userBussinessTypeList" ref="typeList"
style="width: 100%">
<el-table-column label="单据类型编码" prop="action" fixed></el-table-column>
<el-table-column label="单据类型名称" prop="name" fixed></el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
:disabled="!configParms.basicInv"
@click.native.stop="delWarehouseBussinessType(scope.row.id)"
>移除
</el-button
>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click.native="userBussinessTypeFormVisible = !userBussinessTypeFormVisible"
>取消
</el-button
>
</div>
</el-dialog>
<!--表单界面--> <!--表单界面-->
<el-dialog <el-dialog
:title="formMap[formName]" :title="formMap[formName]"
@ -782,7 +737,7 @@ import {
warehouseUserList, saveWarehouseBussinessType, warehouseUserList, saveWarehouseBussinessType,
saveWarehouseUser, updateDirector, disableWarehouse, saveWarehouseUser, updateDirector, disableWarehouse,
deleteWarehouseBussinessType, deleteWarehouseBussinessType,
bindThrWarehouse, unbindThrWarehouse, filterThridSubByInv, getThrsysDetail,delWarehouseBussinessType bindThrWarehouse, unbindThrWarehouse, filterThridSubByInv, getThrsysDetail
} from "../../api/basic/invWarehouse"; } from "../../api/basic/invWarehouse";
import { import {
filterSubAll, saveSubWarehouse, deleteSubWarehouse, filterSubAll, saveSubWarehouse, deleteSubWarehouse,
@ -880,8 +835,6 @@ export default {
selectUserList: [], selectUserList: [],
selectBussinessTypeList: [], selectBussinessTypeList: [],
bussinessTypeFormVisible: false, bussinessTypeFormVisible: false,
userBussinessTypeList:[],
userBussinessTypeFormVisible:false,
thrWarehouseData: [], thrWarehouseData: [],
thrSubWarehouseData: [], thrSubWarehouseData: [],
currentId: null, currentId: null,
@ -934,8 +887,7 @@ export default {
bussinessTypeQuery: { bussinessTypeQuery: {
enabled: true, enabled: true,
page: 1, page: 1,
limit: 10, limit: 10
ids:""
}, },
bussinessTypeTotal: 0, bussinessTypeTotal: 0,
curSeleUser: null, curSeleUser: null,
@ -1174,34 +1126,7 @@ export default {
}); });
} }
}, },
//
handleUserSubDel(row){
if (row.id) {
this.$confirm("确认移除单据吗?", "提示", {
type: "warning",
})
.then(() => {
this.deleteLoading = true;
let para = {id: row.id};
deleteSubWarehouse(para)
.then((response) => {
this.deleteLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("删除成功");
this.loadSubData(row.parentId);
})
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
},
handleSubDel(row) { handleSubDel(row) {
if (row.id) { if (row.id) {
@ -1447,15 +1372,10 @@ export default {
}) })
}); });
}, },
getBussinessType(val,obj) { getBussinessType(val) {
if (val != null) { if (val != null) {
this.bussinessTypeQuery.page = val; this.bussinessTypeQuery.page = val;
} }
if(obj!=undefined){
var action=obj.toString();
this.bussinessTypeQuery.ids=action;
}
this.bussinessTypeQuery.code=this.busQuery.code; this.bussinessTypeQuery.code=this.busQuery.code;
getJoinBussinessType(this.bussinessTypeQuery).then((res) => { getJoinBussinessType(this.bussinessTypeQuery).then((res) => {
this.selectBussinessTypeList = []; this.selectBussinessTypeList = [];
@ -1533,46 +1453,17 @@ export default {
}); });
} }
}, },
// addBussinessType(row) {
// this.currentCode = row.code;
// this.currentRow = row;
// this.loadLinkData(row);
// if (this.currentCode == null || this.currentCode == '') {
// this.$message.error('');
// } else if (this.currentCode != row.code) {
// this.$message.error("")
// } else {
// this.bussinessTypeFormVisible = true;
// this.bussinessTypeQuery.page = 1;
// this.getBussinessType();
// }
// },
addBussinessType(row) { addBussinessType(row) {
var action=[]; this.currentCode = row.code;
for(var i=0;i<this.userBussinessTypeList.length;i++){ this.currentRow = row;
action.push(this.userBussinessTypeList[i].action); this.loadLinkData(row);
} if (this.currentCode != row.code) {
this.$message.error("请先选择当前分库!")
} else {
this.bussinessTypeFormVisible = true; this.bussinessTypeFormVisible = true;
this.bussinessTypeQuery.page = 1; this.bussinessTypeQuery.page = 1;
this.getBussinessType(1,action); this.getBussinessType();
},
selsectBussinessType(row){
// if(row==null || row==undefined){
// this.$message.info("");
// return;
// }
var busQuery = {
code: row.code,
page: 1,
limit: 10000
} }
warehouseBussinessTypeList(busQuery).then((res) => {
this.userBussinessTypeList = res.data.list;
}).catch((error) => {
this.$message.error("单据类型数据加载失败")
});
this.userBussinessTypeFormVisible = true;
}, },
addBussinessTypeData() { addBussinessTypeData() {
// if (this.selectBussinessTypeList.length == 0) { // if (this.selectBussinessTypeList.length == 0) {
@ -1584,6 +1475,7 @@ export default {
bussinessTypes: JSON.stringify(this.selectBussinessTypeList) bussinessTypes: JSON.stringify(this.selectBussinessTypeList)
}; };
saveWarehouseBussinessType(query).then((res) => { saveWarehouseBussinessType(query).then((res) => {
if (res.code == 20000) { if (res.code == 20000) {
this.$message.success("修改成功!"); this.$message.success("修改成功!");
// //
@ -1599,9 +1491,6 @@ export default {
this.bussinessTypeData = []; this.bussinessTypeData = [];
this.busTotal = 0; this.busTotal = 0;
}); });
this.selectWhouseBussinessType();
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
} }
@ -1611,17 +1500,6 @@ export default {
}); });
// } // }
}, },
selectWhouseBussinessType(){
var busQuery = {
code: this.currentCode,
page: 1,
limit: 100000
}
warehouseBussinessTypeList(busQuery).then((res) => {
this.userBussinessTypeList = res.data.list || [];
}).catch((error) => {
});
},
updateDirector(row) { updateDirector(row) {
row.director = !row.director; row.director = !row.director;
updateDirector(row).then((res) => { updateDirector(row).then((res) => {
@ -1650,21 +1528,14 @@ export default {
deleteWarehouseBussinessType(params).then((res) => { deleteWarehouseBussinessType(params).then((res) => {
if (res.code == 20000) { if (res.code == 20000) {
this.$message.success("已移除"); this.$message.success("已移除");
this.bussinessTypeData = []; for (let i = 0; i < this.bussinessTypeData.length; i++) {
this.selectWhouseBussinessType(); if (this.bussinessTypeData[i].id == id) {
  var busQuerys = { this.bussinessTypeData.splice(i, 1);
                        code: this.currentCode, return;
                        page: 1, }
                        limit: 10 }
                    }
            warehouseBussinessTypeList(busQuerys).then((res) => {
                    this.bussinessTypeData = res.data.list;
                }).catch((error) => {
                    this.$message.error("单据类型数据加载失败")
                });
} else { } else {
this.$message.error(res.message); this.$message.error("移除失败");
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("移除失败"); this.$message.error("移除失败");

@ -205,30 +205,6 @@
v-if="selInvVisible" v-if="selInvVisible"
> >
<el-form :model="userInfo"> <el-form :model="userInfo">
<el-row :gutter="20">
<el-col :span="4">
<div class="ao-text">
<span>仓库</span>
</div>
</el-col>
<el-col :span="16">
<el-form-item prop="locStorageCode">
<el-select v-model="userInfo.locInvCode" placeholder="仓库信息" clearable
@change="locCHange"
>
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<div class="ao-text"> <div class="ao-text">
@ -237,15 +213,15 @@
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<el-form-item prop="locInvCode"> <el-form-item prop="locInvCode">
<el-select v-model="userInfo.locSubInvCode" placeholder="分库信息" clearable <el-select v-model="userInfo.locSubInvCode" filterable placeholder="分库信息" clearable
> >
<el-option <el-option
v-for="item in subInvList" v-for="item in subInvList"
:key="item.name" :key="item.name"
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -253,7 +229,7 @@
</el-row> </el-row>
<div style="margin-top: 8px ; color: #F71616;"> <div style="margin-top: 8px ; color: #F71616;">
<span>提示进入系统前请选择您默认所在仓库与分库&nbsp;</span> <span>提示进入系统前请选择您默认所在分库&nbsp;</span>
</div> </div>
<div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'> <div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'>
<el-button type="primary" @click="submitInv" style="width: 150px">提交</el-button> <el-button type="primary" @click="submitInv" style="width: 150px">提交</el-button>
@ -449,14 +425,12 @@ export default {
findSubInvByInv() { findSubInvByInv() {
this.subInvList = []; this.subInvList = [];
let query = {
pcode: this.userInfo.locInvCode filterSubByInv()
};
filterSubByInv(query)
.then((response) => { .then((response) => {
this.subInvList = response.data || []; this.subInvList = response.data || [];
if (this.subInvList != null && this.subInvList.length == 1) { if (this.subInvList != null && this.subInvList.length == 1) {
this.userInfo.locSubInvCode = this.subInvList[0].code; this.userInfo.locSubInvCode = this.subInvList[subInvList.length].code;
} }
}) })
.catch(() => { .catch(() => {
@ -476,7 +450,7 @@ export default {
} }
if (this.$isBlank(this.userInfo.locInvCode) || this.$isBlank(this.userInfo.locSubInvCode)) { if (this.$isBlank(this.userInfo.locSubInvCode)) {
this.selInvVisible = true; this.selInvVisible = true;
} else { } else {
this.$store.commit(types.RECEIVE_LOCINVCODE, this.userInfo.locInvCode); this.$store.commit(types.RECEIVE_LOCINVCODE, this.userInfo.locInvCode);
@ -505,11 +479,6 @@ export default {
}, },
submitInv() { submitInv() {
if (this.$isBlank(this.userInfo.locInvCode)) {
this.$message.error("仓库不能为空!");
return;
}
if (this.$isBlank(this.userInfo.locSubInvCode)) { if (this.$isBlank(this.userInfo.locSubInvCode)) {
this.$message.error("分库不能为空!"); this.$message.error("分库不能为空!");
return; return;
@ -586,6 +555,7 @@ export default {
// this.getStorage(); // this.getStorage();
// this.findSubInvByInv(); // this.findSubInvByInv();
this.getUserInfo(); this.getUserInfo();
this.locCHange();
bus.$on("collapse-content", (msg) => { bus.$on("collapse-content", (msg) => {
this.collapse = msg; this.collapse = msg;
}); });

@ -368,9 +368,7 @@ export default {
thirdSysFk: [ thirdSysFk: [
{required: true, message: "请选择第三方系统", trigger: "blur"} {required: true, message: "请选择第三方系统", trigger: "blur"}
], ],
advanceType: [
{required: true, message: "请选择仓库类型", trigger: "blur"}
]
}, },
pidData: {}, pidData: {},
deleteLoading: false, deleteLoading: false,

@ -56,42 +56,28 @@
<el-row :gutter="20" style="margin-top: -10px"> <el-row :gutter="20" style="margin-top: -10px">
<el-col :span="3"> <el-col :span="3">
<div class="ao-text"> <div class="ao-text">
<span>当前仓库</span> <span>业务类型</span>
</div> </div>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="locStorageCode"> <el-form-item prop="billType">
<el-select v-model="formData.locStorageCode" style="width: 50%;" placeholder="当前仓库信息" <el-select v-model="formData.billType" placeholder="请选择业务类型"
@change="locInChange" @change="actionChange" clearable>
clearable>
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
<el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息" style="width: 50%;"
clearable>
<el-option <el-option
v-for="item in subInvList" v-for="item in busTypes"
:key="item.name" :key="item.thirdAction"
:label="item.thirdName"
:label="item.name" :value="item.thirdAction">
:value="item.code"> <span style="float: left">{{ item.thirdName }}</span>
<span style="float: left">{{ item.name }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<div class="ao-text"> <div class="ao-text">
<span>往来信息</span> <span>往来单位</span>
</div> </div>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
@ -100,10 +86,9 @@
v-model="formData.corpName" v-model="formData.corpName"
filterable filterable
remote remote
style="width: 50%"
clearable="true" clearable="true"
reserve-keyword reserve-keyword
placeholder="请输入仓库信息" placeholder="请输入往来单位"
:remote-method="findStorageMethod" :remote-method="findStorageMethod"
:loading="loading" :loading="loading"
@change="storageChange" @change="storageChange"
@ -119,58 +104,35 @@
}}</span> }}</span>
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="formData.fromSubInvCode" placeholder="请选择分库" clearable="true"
style="width: 50%"
>
<el-option
v-for="item in fromSubStorageOptions"
:key="item.code"
: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-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" style="margin-top: -10px"> <el-row :gutter="20" style="margin-top: -10px">
<el-col :span="3"> <el-col :span="3">
<div class="ao-text"> <div class="ao-text">
<span>领用类型</span> <span>当前分库</span>
</div> </div>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="billType"> <el-form-item prop="invWarehouseCode">
<el-select v-model="formData.billType" placeholder="请选择领用类型" style="width: 100%" <el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息"
clearable> clearable>
<el-option <el-option
v-for="item in busTypes" v-for="item in subInvList"
:key="item.originAction" :key="item.name"
:label="item.originName" :label="item.name"
:value="item.originAction"> :value="item.code">
<span style="float: left">{{ item.originName }}</span> <span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="3">
<div class="ao-text">
<span>备注</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="remark">
<el-input v-model="formData.remark" auto-complete="off"></el-input>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-card> </el-card>
@ -294,6 +256,20 @@
</el-card> </el-card>
</el-form> </el-form>
<el-dialog
title="产品录入"
:visible.sync="selectProductVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
v-if="selectProductVisible"
:append-to-body='true'
>
<stockOrderNewSelectProduct
:closeDialog="closeDialogC2"
:data="thisData"
></stockOrderNewSelectProduct>
</el-dialog>
<el-dialog <el-dialog
title="库存产品录入" title="库存产品录入"
@ -308,7 +284,6 @@
:closeDialog="closeDialogC2" :closeDialog="closeDialogC2"
:data="thisData" :data="thisData"
:invQueryData="invQueryData" :invQueryData="invQueryData"
:type="1"
></dialogInvProduct> ></dialogInvProduct>
</el-dialog> </el-dialog>
</div> </div>
@ -337,8 +312,8 @@ import {getBussinessType} from "../../api/basic/bussinessType";
import {getLocalBusType, getLocalJoinBusType, getLocalJoinByUser} from "../../api/basic/busLocalType"; import {getLocalBusType, getLocalJoinBusType, getLocalJoinByUser} from "../../api/basic/busLocalType";
import {filterAll, filterAllByLoc, filterAllByUser} from "@/api/basic/invWarehouse"; import {filterAll, filterAllByLoc, filterAllByUser} from "@/api/basic/invWarehouse";
import dialogInvProduct from "../inventory/DialogInvProduct" import dialogInvProduct from "../inventory/DialogInvProduct"
import {getBusChange} from "@/api/basic/busTypeChange"; import {getOriginJoinBusType} from "@/api/basic/busOriginType";
import {inserThrOrderWeb, updateReceive} from "@/api/thrsys/thrOrderReceive"; import {inserThrOrderWeb} from "@/api/thrsys/thrOrderReceive";
import {getThrOrderDetails, delThrOrders, delOrderDetail} from "@/api/thrsys/thrOrder"; import {getThrOrderDetails, delThrOrders, delOrderDetail} from "@/api/thrsys/thrOrder";
import {filterSubByInv} from "@/api/basic/invSubWarehouse"; import {filterSubByInv} from "@/api/basic/invSubWarehouse";
@ -357,10 +332,6 @@ export default {
type: Function, type: Function,
required: true, required: true,
}, },
editType: {
type: Object,
required: true,
},
}, },
data() { data() {
return { return {
@ -406,7 +377,6 @@ export default {
subInvList: [], subInvList: [],
fromOptions: [], fromOptions: [],
fromStorageOptions: [], fromStorageOptions: [],
fromSubStorageOptions: [],
total: 0, total: 0,
loading: false, loading: false,
index: null, index: null,
@ -428,6 +398,10 @@ export default {
1: "预入库", 1: "预入库",
2: "普通采购", 2: "普通采购",
}, },
curAction: {
corpType: 0,
genUnit: false,
},
orderEditor: true, orderEditor: true,
iCount: 0, iCount: 0,
sOptions: [], sOptions: [],
@ -437,11 +411,11 @@ export default {
busTypes: [], busTypes: [],
currentRow: {}, currentRow: {},
selectedIndex: "", selectedIndex: "",
selectProductVisible: false,
selectInvProductVisible: false, selectInvProductVisible: false,
thisData: {}, thisData: {},
storageList: [], storageList: [],
invQueryData: {}, invQueryData: {},
type: 1,
}; };
}, },
@ -475,7 +449,7 @@ export default {
} }
if (status === '2') { if (status === '0') {
for (let i = 0; i < this.codeArray.length; i++) { for (let i = 0; i < this.codeArray.length; i++) {
if (this.$isBlank(this.codeArray[i].count) || this.codeArray[i].count == "0") { if (this.$isBlank(this.codeArray[i].count) || this.codeArray[i].count == "0") {
return this.$message.error('单据数量不能为0'); return this.$message.error('单据数量不能为0');
@ -518,11 +492,8 @@ export default {
console.log(row); console.log(row);
this.formData.corpId = row.code; this.formData.corpId = row.code;
this.formData.corpName = row.name; this.formData.corpName = row.name;
this.findSubStorageMethod();
}, },
getStorage(event) {
//
getStorage() {
this.storageList = []; this.storageList = [];
filterAllByUser() filterAllByUser()
.then((response) => { .then((response) => {
@ -533,23 +504,6 @@ export default {
}); });
}, },
//
findSubInvs() {
this.subInvList = [];
let query = {
pcode: this.formData.locStorageCode
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
if (this.subInvList != null && this.subInvList.length == 1) {
this.formData.invWarehouseCode = this.subInvList[0].code;
}
})
.catch(() => {
});
},
getActionName(action) { getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) { for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) { if (this.busTypes[i].action === action) {
@ -557,9 +511,7 @@ export default {
} }
} }
}, },
findStorageMethod(query) {
//
findStorageMethod() {
if (this.formData.locStorageCode == null) if (this.formData.locStorageCode == null)
return; return;
this.fromStorageOptions = []; this.fromStorageOptions = [];
@ -579,22 +531,6 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
//
findSubStorageMethod() {
let cQuery = {
pcode: this.formData.corpId,
filter: 2,
};
filterSubByInv(cQuery)
.then((response) => {
this.fromSubStorageOptions = response.data || [];
})
.catch(() => {
});
},
submitFunction(status) { submitFunction(status) {
let tMessage = status === '501' ? '保存' : '提交'; let tMessage = status === '501' ? '保存' : '提交';
this.loading = true; this.loading = true;
@ -602,7 +538,10 @@ export default {
tQuery.editStatus = status; tQuery.editStatus = status;
tQuery.subErpOrders = this.codeArray; tQuery.subErpOrders = this.codeArray;
tQuery.thirdPartyDate = 2; tQuery.thirdPartyDate = 2;
if (this.editType === "add") {
// tQuery.billType = this.formData.bi;
console.log(tQuery);
inserThrOrderWeb(tQuery) inserThrOrderWeb(tQuery)
.then(response => { .then(response => {
this.loading = false; this.loading = false;
@ -616,23 +555,6 @@ export default {
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
}) })
} else if (this.editType === "update") {
updateReceive(tQuery)
.then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success(tMessage + "成功");
this.closeDialog(true);
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
})
}
}, },
selectProductFunction(event) { selectProductFunction(event) {
@ -658,20 +580,25 @@ export default {
if (this.orderEditor) { if (this.orderEditor) {
this.thisData.orderId = this.formData.id this.thisData.orderId = this.formData.id
} }
this.curAction = this.getActionItem(this.formData.billType);
this.thisData.stockOrderLists = this.codeArray; this.thisData.stockOrderLists = this.codeArray;
this.thisData.formData = this.formData; this.thisData.formData = this.formData;
this.thisData.formData.thirdSysFk = this.curAction.thirdSys;
this.thisData.billType = this.curAction.localAction;
this.invQueryData = { this.invQueryData = {
locStorageCode: this.formData.locStorageCode, locStorageCode: this.formData.locStorageCode,
}; };
this.selectInvProductVisible = true; this.selectInvProductVisible = true;
return; return;
} }
}, },
closeDialogC2(rData) { closeDialogC2(rData) {
this.selectProductVisible = false;
this.selectInvProductVisible = false; this.selectInvProductVisible = false;
this.thisData = {}; this.thisData = {};
@ -920,12 +847,13 @@ export default {
}, },
getBusType() { getBusType() {
let query = { let query = {
enable: false, enabled: true,
type: 1, corpType: 1,
}; };
getBusChange(query) getOriginJoinBusType(query)
.then((response) => { .then((response) => {
this.busTypes = response.data.list || []; this.busTypes = response.data.list || [];
this.curAction = this.busTypes[0];
}) })
.catch(() => { .catch(() => {
}); });
@ -936,6 +864,42 @@ export default {
this.formData.corpId = event.erpId; this.formData.corpId = event.erpId;
this.formData.unitIdFk = event.erpId; this.formData.unitIdFk = event.erpId;
}, },
findMethod(query) {
console.log(query);
this.fromOptions = [];
let cQuery = {
key: query,
corpType: null,
outType: null,
};
if (this.curAction.corpType == 3) {//
cQuery.corpType = 4;
this.formData.corpId = this.curAction.defaultUnit;
} else if (this.curAction.corpType == 2)//
{
cQuery.corpType = 4;
cQuery.outType = 2;
} else if (this.curAction.corpType == 0) {
cQuery.corpType = 2;
} else return;
getBasicUnitMaintains(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.page.list || [];
if (this.curAction.corpType == 3) {
for (let i = 0; i < this.fromOptions.length; i++) {
if (this.fromOptions[i].erpId == this.formData.corpId) {
this.formData.corpName = this.fromOptions[i].name;
}
}
}
})
.catch(() => {
this.loading = false;
});
},
getActionItem(action) { getActionItem(action) {
for (let i = 0; i < this.busTypes.length; i++) { for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].thirdAction === action) { if (this.busTypes[i].thirdAction === action) {
@ -943,15 +907,38 @@ export default {
} }
} }
}, },
actionChange(item) {
console.log(item);
this.curAction = this.getActionItem(item);
this.locInChange();
this.findMethod();
},
locInChange(item) { locInChange(item) {
if (this.formData.invWarehouseCode != null) { if (this.formData.invWarehouseCode != null) {
this.formData.invWarehouseCode = ""; this.formData.invWarehouseCode = "";
} }
this.formData.locStorageCode = item; this.formData.locStorageCode = item;
this.$forceUpdate(); this.$forceUpdate();
this.getBusType(item);
this.findStorageMethod(); this.findStorageMethod();
this.findSubInvs(); this.findSubInvs();
}, },
findSubInvs() {
this.subInvList = [];
let query = {
pcode: this.formData.locStorageCode
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
if (this.subInvList != null && this.subInvList.length == 1) {
this.formData.invWarehouseCode = this.subInvList[0].code;
}
})
.catch(() => {
});
}
}, },
@ -991,10 +978,8 @@ export default {
this.getBusType(); this.getBusType();
this.getStorage(); this.getStorage();
this.findSubInvs(); this.findSubInvByInv();
this.findStorageMethod();
this.findSubStorageMethod(); this.findSubStorageMethod();
// this.findSubInvByInv();
this.codeArray = []; this.codeArray = [];
this.closeConfirmFunction(false); this.closeConfirmFunction(false);
}, },

@ -66,19 +66,21 @@
<el-col :span="3"> <el-col :span="3">
<div class="ao-text"> <div class="ao-text">
<span>当前</span> <span>当前</span>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="locStorageCode"> <el-form-item prop="invWarehouseCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" @change="locCHange"> <el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息" @change="findSubStorageMethod"
>
<el-option <el-option
v-for="item in storageList" v-for="item in subInvList"
:key="item.name" :key="item.name"
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -120,26 +122,6 @@
</el-form-item> </el-form-item>
<el-form-item class="query-form-item" prop="fromCorp" <el-form-item class="query-form-item" prop="fromCorp"
v-if="curAction.corpType ==1"> v-if="curAction.corpType ==1">
<el-select
v-model="formData.fromCorp"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请输入仓库信息"
:remote-method="findStorageMethod"
:loading="loading"
@change="storageChange"
>
<el-option
v-for="item in fromStorageOptions"
:key="item.value"
:label="item.code"
:value="item">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.code }}</span>
</el-option>
</el-select>
<el-select v-model="formData.fromSubInvCode" placeholder="请选择分库" clearable="true" <el-select v-model="formData.fromSubInvCode" placeholder="请选择分库" clearable="true"
> >
@ -149,7 +131,7 @@
:label="item.name" :label="item.name"
:value="item.code"> :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.code }}</span> <span style="float: right; color: #8492a6; font-size: 13px">{{ item.warehouseName }}</span>
<!--<span style="float: right; color: #8492a6; font-size: 13px">{{ item.action }}</span>--> <!--<span style="float: right; color: #8492a6; font-size: 13px">{{ item.action }}</span>-->
</el-option> </el-option>
</el-select> </el-select>
@ -164,26 +146,7 @@
</el-col> </el-col>
<el-col :span="3">
<div class="ao-text">
<span>当前分库</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="invWarehouseCode">
<el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息"
>
<el-option
v-for="item in subInvList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -383,7 +346,7 @@ export default {
}, },
findSubStorageMethod() { findSubStorageMethod() {
let cQuery = { let cQuery = {
pcode: this.formData.fromCorpId, code: this.formData.invWarehouseCode,
filter: 2, filter: 2,
}; };
filterSubByInv(cQuery) filterSubByInv(cQuery)
@ -508,6 +471,7 @@ export default {
this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10); this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
} }
this.getBusType(); this.getBusType();
this.findSubInvByInv(this.formData.locStorageCode);
this.getStorage(); this.getStorage();
this.getStockOrderDetailList(this.curRow.id); this.getStockOrderDetailList(this.curRow.id);
} }

@ -24,19 +24,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.locStorageCode" placeholder="请选择当前仓库" clearable="true"
@change="invChangetwo"
size="mini">
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true" <el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true"
size="mini"> size="mini">
@ -46,6 +34,7 @@
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>

@ -560,12 +560,7 @@ export default {
this.filterQuery.endTime = null; this.filterQuery.endTime = null;
} }
if (!isBlank(this.filterQuery.invWarehouseCode)) {
if (isBlank(this.filterQuery.locStorageCode)) {
this.$message.warning("请选择仓库!");
return;
}
}
this.getList(); this.getList();
}, },
handleSizeChange(val) { handleSizeChange(val) {

@ -70,20 +70,21 @@
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
<span>当前</span> <span>当前</span>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="locStorageCode"> <el-form-item prop="invWarehouseCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" @change="locCHange" <el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息"
:disabled="corpOrderIdDisabled"> :disabled="corpOrderIdDisabled" @change="findSubStorageMethod" filterable>
<el-option <el-option
v-for="item in storageList" v-for="item in subInvList"
:key="item.name" :key="item.name"
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -130,30 +131,11 @@
<el-form-item class="query-form-item" prop="fromCorp" <el-form-item class="query-form-item" prop="fromCorp"
v-if="curAction.corpType ==1" v-if="curAction.corpType ==1"
> >
<el-select
v-model="formData.fromCorp"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请输入仓库信息"
:remote-method="findStorageMethod"
:loading="loading" :disabled="corpOrderIdDisabled"
@change="storageChange"
>
<el-option
v-for="item in fromStorageOptions"
:key="item.value"
:label="item.code"
:value="item">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.code }}</span>
</el-option>
</el-select>
<el-select v-model="formData.fromSubInvCode" placeholder="请选择分库" clearable="true" <el-select v-model="formData.fromSubInvCode" placeholder="请选择分库" clearable="true"
:disabled="corpOrderIdDisabled" :disabled="corpOrderIdDisabled" filterable
> >
<el-option <el-option
v-for="item in fromSubStorageOptions" v-for="item in fromSubStorageOptions"
@ -161,7 +143,7 @@
:label="item.name" :label="item.name"
:value="item.code"> :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.code }}</span> <span style="float: right; color: #8492a6; font-size: 13px">{{ item.warehouseName }}</span>
<!--<span style="float: right; color: #8492a6; font-size: 13px">{{ item.action }}</span>--> <!--<span style="float: right; color: #8492a6; font-size: 13px">{{ item.action }}</span>-->
</el-option> </el-option>
</el-select> </el-select>
@ -178,26 +160,7 @@
</el-col> </el-col>
<el-col :span="2">
<div class="ao-text">
<span>当前分库</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="invWarehouseCode">
<el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息"
:disabled="corpOrderIdDisabled" @change="subStorageChange">
<el-option
v-for="item in subInvList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="20" v-if="enableDept"> <el-row :gutter="20" v-if="enableDept">
@ -611,10 +574,7 @@ export default {
this.$message.error('未选择扫码单据类型'); this.$message.error('未选择扫码单据类型');
return return
} }
if (this.formData.locStorageCode == null || this.formData.locStorageCode == '') {
this.$message.error('当前仓库不能为空');
return;
}
if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') { if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') {
this.$message.error('当前分库不能为空'); this.$message.error('当前分库不能为空');
@ -723,10 +683,7 @@ export default {
this.$message.warning("请选择单据类型!"); this.$message.warning("请选择单据类型!");
return; return;
} }
if (this.$isBlank(this.formData.locStorageCode)) {
this.$message.error('当前仓库不能为空');
return;
}
if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') { if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') {
this.$message.error('当前分库不能为空'); this.$message.error('当前分库不能为空');
return; return;
@ -973,6 +930,7 @@ export default {
this.getBusType(); this.getBusType();
}, },
findMethod(query) { findMethod(query) {
this.fromOptions = []; this.fromOptions = [];
let cQuery = { let cQuery = {
key: query, key: query,
@ -1026,6 +984,7 @@ export default {
findStorageMethod() { findStorageMethod() {
if (this.formData.locStorageCode == null) if (this.formData.locStorageCode == null)
return; return;
this.fromStorageOptions = []; this.fromStorageOptions = [];
@ -1042,11 +1001,12 @@ export default {
findSubStorageMethod(val) { findSubStorageMethod(val) {
let cQuery = { let cQuery = {
pcode: this.formData.fromCorpId, code: this.formData.invWarehouseCode,
filter: 2, filter: 2,
}; };
filterSubByInv(cQuery) filterSubByInv(cQuery)
.then((response) => { .then((response) => {
this.fromSubStorageOptions = response.data || []; this.fromSubStorageOptions = response.data || [];
if (val == 1) { if (val == 1) {
@ -1059,14 +1019,14 @@ export default {
findSubInvByInv(invCode) { findSubInvByInv(invCode) {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: invCode
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {
this.subInvList = response.data || []; this.subInvList = response.data || [];
this.fromSubStorageOptions = response.data || [];
if (this.subInvList != null && this.subInvList.length == 1) { if (this.subInvList != null && this.subInvList.length == 1) {
this.formData.invWarehouseCode = this.subInvList[0].code; this.formData.invWarehouseCode = this.subInvList[0].code;
this.getBusType(); this.getBusType();
@ -1222,6 +1182,7 @@ export default {
}, },
created() { created() {
this.formData.code = ''; this.formData.code = '';
this.formData.actDate = new Date(); this.formData.actDate = new Date();
this.codeArray = []; this.codeArray = [];
@ -1240,7 +1201,6 @@ export default {
this.formData.preCheck = this.idQuery.preCheck; this.formData.preCheck = this.idQuery.preCheck;
this.actionEnable = true; this.actionEnable = true;
this.getCodeList(); this.getCodeList();
this.findSubStorageMethod(1); this.findSubStorageMethod(1);
} else { } else {
this.corpOrderIdDisabled = false; this.corpOrderIdDisabled = false;
@ -1263,7 +1223,7 @@ export default {
} }
} }
this.findSubInvByInv(this.formData.locStorageCode); this.findSubInvByInv(this.formData.locStorageCode);
// this.findSubStorageMethod(); this.findSubStorageMethod();
this.getBusType(); this.getBusType();
// //

@ -84,28 +84,7 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="2">
<div class="ao-text">
<span>当前仓库</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" clearable
@change="locCHange"
:disabled="corpOrderIdDisabled">
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
@ -125,6 +104,7 @@
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -466,10 +446,7 @@ export default {
this.$message.error('未选择扫码单据类型'); this.$message.error('未选择扫码单据类型');
return return
} }
if (this.formData.locStorageCode == null || this.formData.locStorageCode == '') {
this.$message.error('当前仓库不能为空');
return;
}
if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') { if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') {
this.$message.error('当前分库不能为空'); this.$message.error('当前分库不能为空');
return; return;
@ -600,10 +577,7 @@ export default {
this.$message.warning("请选择单据类型!"); this.$message.warning("请选择单据类型!");
return; return;
} }
if (this.$isBlank(this.formData.locStorageCode)) {
this.$message.error('当前仓库不能为空');
return;
}
if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') { if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') {
this.$message.error('当前分库不能为空'); this.$message.error('当前分库不能为空');
return; return;

@ -116,39 +116,19 @@
</el-form-item> </el-form-item>
<el-form-item class="query-form-item" prop="fromCorp" <el-form-item class="query-form-item" prop="fromCorp"
v-if="curAction.corpType ==1"> v-if="curAction.corpType ==1">
<el-select
v-model="formData.corpName"
filterable
remote
clearable="true" :disabled="codeArray.length>0"
reserve-keyword
placeholder="请输入仓库信息"
:remote-method="findStorageMethod"
:loading="loading"
@change="storageChange"
>
<el-option
v-for="item in fromStorageOptions"
:key="item.value"
:label="item.code"
:value="item">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{
item.code
}}</span>
</el-option>
</el-select>
<el-select v-model="formData.fromSubInvCode" placeholder="请选择分库" clearable="true"
<el-select v-model="formData.fromSubInvCode" placeholder="请选择分库" filterable clearable="true"
:disabled="codeArray.length>0" :disabled="codeArray.length>0"
> >
<el-option <el-option
v-for="item in fromSubStorageOptions" v-for="item in fromSubStorageOptions"
:key="item.code" :key="item.code"
filterable
:label="item.name" :disabled="codeArray.length>0" :label="item.name" :disabled="codeArray.length>0"
:value="item.code"> :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.code }}</span> <span style="float: right; color: #8492a6; font-size: 13px">{{ item.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
@ -164,28 +144,6 @@
</el-row> </el-row>
<el-row :gutter="20" style="margin-top: 5px"> <el-row :gutter="20" style="margin-top: 5px">
<el-col :span="3">
<div class="ao-text">
<span>当前仓库</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" @change="locInChange"
:disabled="codeArray.length>0"
clearable>
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3"> <el-col :span="3">
<div class="ao-text"> <div class="ao-text">
@ -195,7 +153,7 @@
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="invWarehouseCode"> <el-form-item prop="invWarehouseCode">
<el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息" <el-select v-model="formData.invWarehouseCode" filterable placeholder="当前分库信息"
:disabled="codeArray.length>0" :disabled="codeArray.length>0"
@change="subStorageChange" @change="subStorageChange"
clearable> clearable>
@ -205,6 +163,7 @@
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -665,7 +624,7 @@ export default {
filterAllByUser() filterAllByUser()
.then((response) => { .then((response) => {
this.storageList = response.data || []; this.storageList = response.data || [];
this.findSubInvs();
}) })
.catch(() => { .catch(() => {
}); });
@ -716,7 +675,7 @@ export default {
findSubStorageMethod() { findSubStorageMethod() {
let cQuery = { let cQuery = {
pcode: this.formData.corpId, code: this.formData.invWarehouseCode,
filter: 2, filter: 2,
}; };
filterSubByInv(cQuery) filterSubByInv(cQuery)
@ -734,6 +693,7 @@ export default {
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {
this.subInvList = response.data || []; this.subInvList = response.data || [];
if (this.subInvList != null && this.subInvList.length == 1) { if (this.subInvList != null && this.subInvList.length == 1) {
this.formData.invWarehouseCode = this.subInvList[0].code; this.formData.invWarehouseCode = this.subInvList[0].code;
@ -813,8 +773,8 @@ export default {
this.$message.error("往来信息和单据类型不能为空!") this.$message.error("往来信息和单据类型不能为空!")
return; return;
} }
if (this.$isBlank(this.formData.locStorageCode) || this.$isBlank(this.formData.invWarehouseCode)) { if (this.$isBlank(this.formData.invWarehouseCode)) {
this.$message.error("当前仓库和当前分库不能为空!"); this.$message.error("当前分库不能为空!");
return; return;
} }
this.code = ""; this.code = "";
@ -1288,12 +1248,13 @@ export default {
locInChange() { locInChange() {
this.$forceUpdate(); this.$forceUpdate();
// this.getBusType(); // this.getBusType();
this.invChange(); // this.invChange();
this.findStorageMethod(); this.findStorageMethod();
}, },
subStorageChange() { subStorageChange() {
this.getBusType(); this.getBusType();
this.findSubStorageMethod();
}, },
invChange() { invChange() {
/*if (this.$isNotBlank(this.formData.invWarehouseCode)) /*if (this.$isNotBlank(this.formData.invWarehouseCode))
@ -1308,6 +1269,7 @@ export default {
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {
this.subInvList = response.data || []; this.subInvList = response.data || [];
if (this.subInvList != null && this.subInvList.length == 1) { if (this.subInvList != null && this.subInvList.length == 1) {
this.formData.invWarehouseCode = this.subInvList[0].code; this.formData.invWarehouseCode = this.subInvList[0].code;

@ -89,28 +89,6 @@
</el-row> </el-row>
<el-row :gutter="20" style="margin-top: -10px;"> <el-row :gutter="20" style="margin-top: -10px;">
<el-col :span="3">
<div class="ao-text">
<span>当前仓库</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息"
@change="invChange"
disabled>
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3"> <el-col :span="3">
<div class="ao-text"> <div class="ao-text">
@ -129,6 +107,7 @@
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>

@ -100,29 +100,6 @@
<el-row :gutter="20" style="margin-top: 5px"> <el-row :gutter="20" style="margin-top: 5px">
<el-col :span="3">
<div class="ao-text">
<span>当前仓库</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" clearable
:disabled="codeArray.length>0"
@change="invChange">
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3"> <el-col :span="3">
<div class="ao-text"> <div class="ao-text">
<span>当前分库</span> <span>当前分库</span>
@ -141,6 +118,7 @@
:label="item.name" :label="item.name"
:value="item.code"> :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.warehouseName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>

Loading…
Cancel
Save