修改bug已经去除采购管理的仓库

featFunction
郑明梁 3 years ago
parent d4b8d52622
commit a0e2060caa

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

@ -216,7 +216,8 @@ export default {
findSubInvByInv() { findSubInvByInv() {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: this.inputQuery.curInv pcode: this.inputQuery.curInv,
filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {

@ -394,22 +394,7 @@ export default {
this.company = response.data; this.company = response.data;
}); });
}, },
getStorage() {
this.storageList = [];
filterAllByUser()
.then((response) => {
if (response.code == 20000) {
this.storageList = response.data || [];
if (this.storageList != null && this.storageList.length == 1) {
this.userInfo.locInvCode = this.storageList[0].code;
}
this.findSubInvByInv();
}
})
.catch(() => {
});
},
locCHange() { locCHange() {
@ -421,8 +406,10 @@ export default {
findSubInvByInv() { findSubInvByInv() {
this.subInvList = []; this.subInvList = [];
let query = {
filterSubByInv() filter:3
};
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) {
@ -455,7 +442,7 @@ export default {
this.$store.commit(types.RECEIVE_LOCSUBINVNAME, this.locSubInvName); this.$store.commit(types.RECEIVE_LOCSUBINVNAME, this.locSubInvName);
} }
this.getStorage();
} }
}) })
.catch(() => { .catch(() => {
@ -546,6 +533,7 @@ export default {
}, },
}, },
created() { created() {
this.getBreadcrumb(); this.getBreadcrumb();
this.getCompanyData(); this.getCompanyData();
// this.getStorage(); // this.getStorage();

@ -62,18 +62,7 @@
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="locStorageCode"> <el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" @change="locInChange" <el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息" @change="setWarehouseName" style="width: 100%"
style="width: 50%"
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> clearable>
<el-option <el-option
v-for="item in subInvList" v-for="item in subInvList"
@ -81,6 +70,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>
@ -291,9 +281,7 @@ export default {
if(this.formData.billDate=="" || this.formData.billDate==null){ if(this.formData.billDate=="" || this.formData.billDate==null){
return this.$message.error("单据日期不能为空!"); return this.$message.error("单据日期不能为空!");
} }
if(this.formData.locStorageCode=="" || this.formData.locStorageCode==null){
return this.$message.error("仓库不能为空!");
}
if(this.formData.invWarehouseCode=="" || this.formData.invWarehouseCode==null){ if(this.formData.invWarehouseCode=="" || this.formData.invWarehouseCode==null){
return this.$message.error("分库不能为空!"); return this.$message.error("分库不能为空!");
} }
@ -385,6 +373,9 @@ export default {
this.getList(); this.getList();
} }
}, },
setWarehouseName(obj){
this.formData.locStorageCode= this.subInvList.find(item => item.code == obj).parentId;
},
deleteCodeArray(index, row) { deleteCodeArray(index, row) {
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", { this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
@ -441,26 +432,10 @@ export default {
this.total = 0; this.total = 0;
}); });
}, },
getStorage() {
this.storageList = [];
filterAllByUser()
.then((response) => {
this.storageList = response.data || [];
if (this.storageList != null && this.storageList.length == 1) {
this.formData.locStorageCode = this.storageList[0].code;
}
this.findSubInvs();
})
.catch(() => {
});
},
findSubInvs() { findSubInvs() {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: this.formData.locStorageCode filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {
@ -472,13 +447,7 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
locInChange(item) {
if (this.formData.invWarehouseCode != null) {
this.formData.invWarehouseCode = "";
}
this.formData.locStorageCode = item;
this.findSubInvs();
},
}, },
filters: {}, filters: {},
mounted() { mounted() {
@ -508,7 +477,7 @@ export default {
}; };
this.orderEditor = false; this.orderEditor = false;
} }
this.getStorage(); this.findSubInvs();
this.codeArray = []; this.codeArray = [];
}, },
}; };

@ -62,18 +62,8 @@
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="locStorageCode"> <el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="采购仓库信息" @change="locInChange"
style="width: 50%" :disabled="true" <el-select v-model="formData.invWarehouseCode" placeholder="采购分库信息" style="width: 100%"
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%"
:disabled="true" clearable> :disabled="true" clearable>
<el-option <el-option
v-for="item in subInvList" v-for="item in subInvList"

@ -83,18 +83,8 @@
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="locStorageCode"> <el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="采购仓库信息" @change="locInChange"
style="width: 50%" <el-select v-model="formData.invWarehouseCode" auto-complete="" @change="setLocStorageCode" filterable placeholder="采购分库信息" style="width: 100%"
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> clearable>
<el-option <el-option
v-for="item in subInvList" v-for="item in subInvList"
@ -102,6 +92,8 @@
: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>
@ -319,9 +311,7 @@ export default {
if(this.formData.billType=="" || this.formData.billType==null){ if(this.formData.billType=="" || this.formData.billType==null){
return this.$message.error("采购类型不能为空!"); return this.$message.error("采购类型不能为空!");
} }
if(this.formData.locStorageCode=="" || this.formData.locStorageCode==null){
return this.$message.error("采购仓库不能为空!");
}
if(this.formData.invWarehouseCode=="" || this.formData.invWarehouseCode==null){ if(this.formData.invWarehouseCode=="" || this.formData.invWarehouseCode==null){
return this.$message.error("采购分库不能为空!"); return this.$message.error("采购分库不能为空!");
} }
@ -374,6 +364,10 @@ export default {
this.thisData.stockOrderLists = this.codeArray; this.thisData.stockOrderLists = this.codeArray;
this.selectProductVisible = true; this.selectProductVisible = true;
}, },
setLocStorageCode(obj){
debugger
 this.formData.locStorageCode= this.subInvList.find(item => item.code == obj).parentId;
},
closeDialogC2(rData) { closeDialogC2(rData) {
this.selectProductVisible = false; this.selectProductVisible = false;
this.thisData = {}; this.thisData = {};
@ -465,26 +459,10 @@ export default {
this.total = 0; this.total = 0;
}); });
}, },
getStorage() {
this.storageList = [];
filterAllByUser()
.then((response) => {
this.storageList = response.data || [];
if (this.storageList != null && this.storageList.length == 1) {
this.formData.locStorageCode = this.storageList[0].code;
}
this.findSubInvs();
})
.catch(() => {
});
},
findSubInvs() { findSubInvs() {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: this.formData.locStorageCode filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {
@ -496,13 +474,6 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
locInChange(item) {
if (this.formData.invWarehouseCode != null) {
this.formData.invWarehouseCode = "";
}
this.formData.locStorageCode = item;
this.findSubInvs();
},
getBusType() { getBusType() {
let query = { let query = {
enable: false, enable: false,
@ -544,7 +515,7 @@ export default {
}; };
this.orderEditor = false; this.orderEditor = false;
} }
this.getStorage(); this.findSubInvs();
this.getBusType(); this.getBusType();
this.codeArray = []; this.codeArray = [];
}, },

@ -61,20 +61,7 @@
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="locStorageCode"> <el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息" style="width: 100%"
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息"
:disabled="true"
style="width: 50%"
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%"
:disabled="true" :disabled="true"
clearable> clearable>
<el-option <el-option
@ -83,9 +70,10 @@
: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-col> </el-col>
@ -97,18 +85,7 @@
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="targetInv"> <el-form-item prop="targetInv">
<el-select v-model="formData.targetInv" placeholder="当前仓库信息" @change="locInChange" <el-select v-model="formData.targetSubInv" placeholder="当前分库信息" @change="setTargetInv" style="width: 100%"
style="width: 50%"
clearable>
<el-option
v-for="item in targetInvList"
: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.targetSubInv" placeholder="当前分库信息" style="width: 50%"
clearable> clearable>
<el-option <el-option
v-for="item in targetSubInvList" v-for="item in targetSubInvList"
@ -116,6 +93,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>
@ -438,6 +416,9 @@ export default {
}); });
}, },
setTargetInv(obj){
 this.formData.targetInv= this.targetSubInvList.find(item => item.code == obj).parentId;
},
getStockOrderDetailList() { getStockOrderDetailList() {
this.loading = true; this.loading = true;
listApplyDetail(this.query) // listApplyDetail(this.query) //
@ -455,15 +436,7 @@ export default {
}, },
getStorage() {
this.storageList = [];
filterAllByUser()
.then((response) => {
this.storageList = response.data || [];
})
.catch(() => {
});
},
findSubInvs() { findSubInvs() {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
@ -472,7 +445,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) {getStorage
this.formData.invWarehouseCode = this.subInvList[0].code; this.formData.invWarehouseCode = this.subInvList[0].code;
} }
}) })
@ -498,7 +471,7 @@ export default {
findTargetSubInvs() { findTargetSubInvs() {
this.targetSubInvList = []; this.targetSubInvList = [];
let query = { let query = {
pcode: this.formData.targetInv filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {
@ -512,13 +485,7 @@ export default {
}, },
locInChange(item) {
if (this.formData.targetSubInv != null) {
this.formData.targetSubInv = "";
}
this.formData.targetInv = item;
this.findTargetSubInvs();
},
getBusType() { getBusType() {
let query = { let query = {
@ -561,8 +528,8 @@ export default {
}; };
this.orderEditor = false; this.orderEditor = false;
} }
this.getStorage();
this.findSubInvs(); this.findSubInvs();
this.findTargetSubInvs();
this.getTargetStorage(); this.getTargetStorage();
this.codeArray = []; this.codeArray = [];
this.getBusType(); this.getBusType();

@ -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,54 +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>
@ -290,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="库存产品录入"
@ -304,14 +284,13 @@
:closeDialog="closeDialogC2" :closeDialog="closeDialogC2"
:data="thisData" :data="thisData"
:invQueryData="invQueryData" :invQueryData="invQueryData"
:type="1"
></dialogInvProduct> ></dialogInvProduct>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
stockOrderDetail, stockOrderDetail,
submitStockOrder, submitStockOrder,
stockOrderGenerateBillNo, stockOrderGenerateBillNo,
@ -322,23 +301,23 @@ import {
uploadStockOrderDetail, uploadStockOrderDetail,
stockOrderDetailQueryProduct, stockOrderDetailQueryProduct,
getStockOrderDetailInstrumentById, stockOrderDetail2, generateBillNoInt getStockOrderDetailInstrumentById, stockOrderDetail2, generateBillNoInt
} from "../../api/warehouse/stockOrder"; } from "../../api/warehouse/stockOrder";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import {saveAs} from "file-saver"; import {saveAs} from "file-saver";
import {parseTime} from "../../filtres"; import {parseTime} from "../../filtres";
import store from "../../store"; import store from "../../store";
import stockOrderNewSelectProduct from "../warehouse/stockOrderNewSelectProduct"; import stockOrderNewSelectProduct from "../warehouse/stockOrderNewSelectProduct";
import {getBasicUnitMaintains, getBasicUnitMaintains2} from "../../api/basic/basicUnitMaintain"; import {getBasicUnitMaintains, getBasicUnitMaintains2} from "../../api/basic/basicUnitMaintain";
import {getBussinessType} from "../../api/basic/bussinessType"; 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";
export default { export default {
name: "idQuery", name: "idQuery",
props: { props: {
closeDialog: { closeDialog: {
@ -353,10 +332,6 @@ export default {
type: Function, type: Function,
required: true, required: true,
}, },
editType: {
type: Object,
required: true,
},
}, },
data() { data() {
return { return {
@ -388,9 +363,7 @@ export default {
billType: [ billType: [
{required: true, message: "请选择业务类型", trigger: "blur"} {required: true, message: "请选择业务类型", trigger: "blur"}
], ],
locStorageCode: [
{required: true, message: "请选择当前仓库", trigger: "blur"}
],
invWarehouseCode: [ invWarehouseCode: [
{required: true, message: "请选择当前分库", trigger: "blur"} {required: true, message: "请选择当前分库", trigger: "blur"}
], ],
@ -402,7 +375,6 @@ export default {
subInvList: [], subInvList: [],
fromOptions: [], fromOptions: [],
fromStorageOptions: [], fromStorageOptions: [],
fromSubStorageOptions: [],
total: 0, total: 0,
loading: false, loading: false,
index: null, index: null,
@ -424,6 +396,10 @@ export default {
1: "预入库", 1: "预入库",
2: "普通采购", 2: "普通采购",
}, },
curAction: {
corpType: 0,
genUnit: false,
},
orderEditor: true, orderEditor: true,
iCount: 0, iCount: 0,
sOptions: [], sOptions: [],
@ -433,11 +409,12 @@ export default {
busTypes: [], busTypes: [],
currentRow: {}, currentRow: {},
selectedIndex: "", selectedIndex: "",
selectProductVisible: false,
selectInvProductVisible: false, selectInvProductVisible: false,
thisData: {}, thisData: {},
storageList: [], storageList: [],
invQueryData: {}, invQueryData: {},
type: 1,
}; };
}, },
components: { components: {
@ -470,7 +447,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');
@ -513,11 +490,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) => {
@ -528,23 +502,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) {
@ -552,9 +509,7 @@ export default {
} }
} }
}, },
findStorageMethod(query) {
//
findStorageMethod() {
if (this.formData.locStorageCode == null) if (this.formData.locStorageCode == null)
return; return;
this.fromStorageOptions = []; this.fromStorageOptions = [];
@ -574,22 +529,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;
@ -597,7 +536,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;
@ -611,23 +553,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) {
@ -653,20 +578,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 = {};
@ -915,12 +845,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(() => {
}); });
@ -931,6 +862,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) {
@ -938,15 +905,39 @@ 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,
filter:3
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
if (this.subInvList != null && this.subInvList.length == 1) {
this.formData.invWarehouseCode = this.subInvList[0].code;
}
})
.catch(() => {
});
}
}, },
@ -986,27 +977,26 @@ 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);
}, },
}; };
</script> </script>
<style> <style>
.ao-text { .ao-text {
width: 100%; width: 100%;
font-size: 13px; font-size: 13px;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
float: right; float: right;
text-align: right; text-align: right;
margin-top: 10px; margin-top: 10px;
} }
</style>
</style>

@ -104,7 +104,8 @@ export default {
findSubInvByInv() { findSubInvByInv() {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: this.userInfo.locInvCode pcode: this.userInfo.locInvCode,
filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {

@ -320,7 +320,8 @@ export default {
findSubInvByInv(invCode) { findSubInvByInv(invCode) {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: invCode pcode: invCode,
filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {

@ -1000,6 +1000,7 @@ export default {
}, },
findSubStorageMethod(val) { findSubStorageMethod(val) {
this. getBusType() ;
let cQuery = { let cQuery = {
code: this.formData.invWarehouseCode, code: this.formData.invWarehouseCode,
filter: 2, filter: 2,
@ -1018,11 +1019,11 @@ export default {
}, },
findSubInvByInv(invCode) { findSubInvByInv() {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {
@ -1222,7 +1223,7 @@ export default {
this.findStorageMethod(); this.findStorageMethod();
} }
} }
this.findSubInvByInv(this.formData.locStorageCode); this.findSubInvByInv();
this.findSubStorageMethod(); this.findSubStorageMethod();
this.getBusType(); this.getBusType();

@ -764,7 +764,7 @@ export default {
this.formData.vailInv = this.curAction.vailInv; this.formData.vailInv = this.curAction.vailInv;
this.formData.codeFillCheck = this.curAction.codeFillCheck; this.formData.codeFillCheck = this.curAction.codeFillCheck;
} }
this.getStorage(this.formData.billType);
}) })
.catch(() => { .catch(() => {
}); });
@ -773,7 +773,7 @@ export default {
findSubInvByInv(invCode) { findSubInvByInv(invCode) {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: invCode filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {

@ -116,9 +116,7 @@
</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.fromSubInvCode" placeholder="请选择分库" @change="setCorpName" filterable clearable="true"
<el-select v-model="formData.fromSubInvCode" placeholder="请选择分库" filterable clearable="true"
:disabled="codeArray.length>0" :disabled="codeArray.length>0"
> >
<el-option <el-option
@ -619,16 +617,7 @@ export default {
this.findSubStorageMethod(); this.findSubStorageMethod();
}, },
getStorage(event) {
this.storageList = [];
filterAllByUser()
.then((response) => {
this.storageList = response.data || [];
})
.catch(() => {
});
},
getActionName(action) { getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) { for (let i = 0; i < this.busTypes.length; i++) {
@ -687,9 +676,11 @@ export default {
}, },
findSubInvByInv(invCode) { findSubInvByInv(invCode) {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: invCode pcode: invCode,
filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {
@ -769,8 +760,16 @@ export default {
} }
if (this.$isBlank(event)) { if (this.$isBlank(event)) {
if (this.$isBlank(this.formData.corpName) || this.$isBlank(this.formData.billType)) { if ( this.$isBlank(this.formData.billType)) {
this.$message.error("往来信息和单据类型不能为空!") this.$message.error("单据类型不能为空!")
return;
}
if(this.curAction.corpType==1 && this.$isBlank(this.formData.fromSubInvCode)){
this.$message.error("往来单位不能不能为空!")
return;
}
if(this.curAction.corpType!=1 && this.$isBlank(this.formData.corpName)){
this.$message.error("往来单位不能不能为空!")
return; return;
} }
if (this.$isBlank(this.formData.invWarehouseCode)) { if (this.$isBlank(this.formData.invWarehouseCode)) {
@ -1079,6 +1078,10 @@ export default {
}); });
}, },
setCorpName(code){
this.formData.corpId=code
this.formData.corpName= this.fromSubStorageOptions.find(item => item.code == code).name
},
copyDetail(row) { copyDetail(row) {
this.$confirm("是否复制该记录?", "提示", { this.$confirm("是否复制该记录?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
@ -1265,7 +1268,7 @@ export default {
findSubInvs() { findSubInvs() {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: this.formData.locStorageCode filter:3
}; };
filterSubByInv(query) filterSubByInv(query)
.then((response) => { .then((response) => {
@ -1318,7 +1321,6 @@ export default {
} }
this.findMethod(); this.findMethod();
this.getBusType(); this.getBusType();
this.getStorage();
this.findSubInvByInv(); this.findSubInvByInv();
this.findSubStorageMethod(); this.findSubStorageMethod();
this.codeArray = []; this.codeArray = [];

@ -62,7 +62,7 @@
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="corpName"> <el-form-item prop="corpName">
<el-input v-model="formData.corpName" auto-complete="off" :disabled="true"></el-input> <el-input v-if="formData.fromSubInvName ==null" v-model="formData.corpName" auto-complete="off" :disabled="true"></el-input>
<el-input v-if="formData.fromSubInvName !=null" v-model="formData.fromSubInvName" <el-input v-if="formData.fromSubInvName !=null" v-model="formData.fromSubInvName"
auto-complete="off" :disabled="true"></el-input> auto-complete="off" :disabled="true"></el-input>
</el-form-item> </el-form-item>
@ -546,7 +546,7 @@ export default {
} }
if (this.$isBlank(event)) { if (this.$isBlank(event)) {
if (this.$isBlank(this.formData.corpName) || this.$isBlank(this.formData.billType)) { if (this.$isBlank(this.formData.corpName) && this.$isBlank(this.formData.fromSubInvName ==null) || this.$isBlank(this.formData.billType)) {
this.$message.error("往来信息和单据类型不能为空!") this.$message.error("往来信息和单据类型不能为空!")
return; return;
} }

@ -72,7 +72,7 @@
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="billType"> <el-form-item prop="billType">
<el-select v-model="formData.billType" placeholder="请选择业务类型" @change="getStorage" <el-select v-model="formData.billType" placeholder="请选择业务类型"
:disabled="codeArray.length>0" :disabled="codeArray.length>0"
clearable> clearable>
<el-option <el-option
@ -905,15 +905,18 @@ export default {
}, },
getBusType() { getBusType() {
if(this.$isBlank(this.query.orderIdFk)){
this.formData.billType=null; this.formData.billType=null;
}
let query = { let query = {
enabled: true, enabled: true,
invWarehouseCode: this.formData.invWarehouseCode invWarehouseCode: this.formData.invWarehouseCode
}; };
getLocalJoinByUser(query) getLocalJoinByUser(query)
.then((response) => { .then((response) => {
this.busTypes = response.data.list || []; this.busTypes = response.data.list || [];
this.getStorage(this.formData.billType);
}) })
.catch(() => { .catch(() => {
}); });
@ -1002,6 +1005,7 @@ export default {
} }
if(this.formData.invWarehouseCode!=null){ if(this.formData.invWarehouseCode!=null){
this.getBusType(); this.getBusType();
} }

Loading…
Cancel
Save