1.初步完成库存查询页面

prod
x_z 2 years ago
parent 95ea80d354
commit 9e086c45c7

@ -469,7 +469,7 @@ const formJson = {
}; };
export default { export default {
name: "IoNewOrder", name: "IoAuditedOrder",
data() { data() {
return { return {
showSearch: true, showSearch: true,

@ -470,7 +470,7 @@ const formJson = {
}; };
export default { export default {
name: "IoNewOrder", name: "IoCheckErrorOrder",
data() { data() {
return { return {
showSearch: true, showSearch: true,

@ -470,7 +470,7 @@ const formJson = {
}; };
export default { export default {
name: "IoNewOrder", name: "IoCheckSuccessOrder",
data() { data() {
return { return {
showSearch: true, showSearch: true,

@ -469,7 +469,7 @@ const formJson = {
}; };
export default { export default {
name: "IoNewOrder", name: "IoUnCheckedOrder",
data() { data() {
return { return {
showSearch: true, showSearch: true,

@ -1,131 +1,142 @@
<template> <template>
<div> <div>
<el-card> <el-card class="el-card">
<el-form :inline="true" :model="filterQuery" size="mini"> <el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" v-show="showSearch">
<el-row style="width: 100%"> <el-row>
<el-form-item class="query-form-item"> <el-col :span="6">
<el-input v-model="filterQuery.nameCode" placeholder="产品标识DI" clearable></el-input> <el-form-item class="query-form-item" label="产品标识DI:">
</el-form-item> <el-input v-model="filterQuery.nameCode" placeholder="产品标识DI"
<el-form-item class="query-form-item"> style="width: 90%"
<el-input v-model="filterQuery.productsName" placeholder="产品名称" clearable></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> </el-col>
<el-input v-model="filterQuery.batchNo" placeholder="批次号" clearable></el-input> <el-col :span="6">
</el-form-item> <el-form-item class="query-form-item" label="产品名称:">
<el-form-item class="query-form-item"> <el-input v-model="filterQuery.cpmctymc" placeholder="产品名称"
<el-select style="width: 90%"
v-model="filterQuery.supId" clearable="true"></el-input>
filterable </el-form-item>
remote </el-col>
clearable="true" <el-col :span="6">
reserve-keyword <el-form-item class="query-form-item" label="批次号:">
placeholder="请输入供应商名称" <el-input v-model="filterQuery.batchNo" placeholder="批次号"
:remote-method="findMethod" style="width: 90%"
size="mini" clearable="true"></el-input>
:loading="loading" </el-form-item>
@change="corpChange" </el-col>
> <el-col :span="6">
<el-option <el-form-item class="query-form-item" label="供应商名称:">
v-for="item in fromOptions" <el-select
:key="item.name" v-model="filterQuery.supId"
:label="item.name" filterable
:value="item.erpId" remote
clearable="true"
reserve-keyword
placeholder="供应商名称"
:remote-method="findMethod"
size="mini"
:loading="corpLoading"
@change="corpChange"
style="width: 90%"
> >
<span style="float: left">{{ item.name }}</span> <el-option
</el-option> v-for="item in fromOptions"
</el-select> :key="item.name"
</el-form-item> :label="item.name"
:value="item.erpId"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row style="width: 100%">
<el-form-item class="query-form-item"> <el-row>
<el-input v-model="filterQuery.ggxh" placeholder="规格型号" clearable></el-input> <el-col :span="6">
</el-form-item> <el-form-item class="query-form-item" label="规格型号:">
<el-form-item class="query-form-item"> <el-input v-model="filterQuery.ggxh" placeholder="规格型号"
<el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="批准文号" clearable></el-input> style="width: 90%"
</el-form-item> clearable="true"></el-input>
<el-form-item class="query-form-item"> </el-form-item>
<el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产厂家" clearable></el-input> </el-col>
</el-form-item> <el-col :span="6">
<!-- <el-form-item class="query-form-item">--> <el-form-item class="query-form-item" label="批准文号:">
<!-- <el-select v-model="filterQuery.invStorageCode" placeholder="请选择当前仓库" clearable="true"--> <el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="批准文号"
<!-- @change="invChange"--> style="width: 90%"
<!-- size="mini">--> clearable="true"></el-input>
<!-- <el-option--> </el-form-item>
<!-- v-for="item in storageList"--> </el-col>
<!-- :key="item.name"--> <el-col :span="6">
<!-- :label="item.name"--> <el-form-item class="query-form-item" label="生产厂家:">
<!-- :value="item.code">--> <el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产厂家"
<!-- <span style="float: left">{{ item.name }}</span>--> style="width: 90%"
<!-- </el-option>--> clearable="true"></el-input>
<!-- </el-select>--> </el-form-item>
<!-- </el-form-item>--> </el-col>
<el-form-item class="query-form-item"> <el-col :span="6">
<el-select v-model="filterQuery.invWarehouseCode" @change="invWarehouseChange" placeholder="请选择当前仓库" clearable="true" <el-form-item class="query-form-item" label="所属仓库:">
size="mini"> <el-select v-model="filterQuery.invCode" placeholder="请选择所属仓库" clearable="true"
<el-option style="width: 90%"
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-form-item>
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
></el-button>
<el-button type="primary" icon="search" @click="onSubmit"
>查询
</el-button
> >
</el-button-group> <el-option
</el-form-item> v-for="item in invList"
: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>
<el-table v-loading="loading" :data="list" style="width: 100%"> <div class="top-right-btn">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
>重置
</el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"
>查询
</el-button
>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
border
@current-change="handleSelectionChange">
<el-table-column label="序号" type="index"></el-table-column> <el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="产品标识" prop="nameCode" width="120"></el-table-column> <el-table-column label="产品标识" prop="nameCode" ></el-table-column>
<el-table-column label="产品名称" prop="cpmctymc" width="180"> <el-table-column label="产品名称" prop="cpmctymc"></el-table-column>
</el-table-column> <el-table-column label="规格型号" prop="ggxh" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="180" show-overflow-tooltip>
</el-table-column>
<el-table-column label="批次号" prop="batchNo" width="120"></el-table-column> <el-table-column label="批次号" prop="batchNo" width="120"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column> <el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column> <el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>
<el-table-column label="入库数量" prop="inCount" width="120"></el-table-column> <el-table-column label="入库数量" prop="inCount" width="120"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="120"></el-table-column> <el-table-column label="出库数量" prop="outCount" width="120"></el-table-column>
<el-table-column label="结余数量" prop="reCount" width="120"></el-table-column>
<el-table-column label="结余数量" prop="reCount" width="120">
<template slot-scope="scope">
{{ (scope.row.inCount - scope.row.outCount) }}
</template>
</el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip <el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column> width="120"></el-table-column>
<el-table-column label="供应商" prop="supName" v-if="showSup" show-overflow-tooltip
<el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column> width="120"></el-table-column>
<el-table-column label="仓库" prop="invStorageName" v-if="showSup" <el-table-column label="部门" prop="deptName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column> show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="分库" prop="invSubStorageName" v-if="showSup" <el-table-column label="仓库" prop="invName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column> show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="操作" width="120" fixed="right"> <el-table-column label="操作" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="intentDetail(scope.row)" @click.native.stop="detailDialog(scope.row)"
>详情 >详情
</el-button </el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
@ -136,94 +147,91 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination
v-show="total>0"
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="getList"
></pagination>
</el-card> </el-card>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
></el-pagination>
</div> </div>
</template> </template>
<script> <script>
import {findInvByUser} from "@/api/system/invSubWarehouse";
import {getInvProduct, deleteInvProduct} from "@/api/inventory/invPorduct"; import {getInvProduct, deleteInvProduct} from "@/api/inventory/invPorduct";
import draggable from "vuedraggable";
import store from "../../store";
import {getBusTypeList} from "@/api/basic/busType";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain"; import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {isBlank} from "@/utils/strUtil"; import {isBlank} from "@/utils/strUtil";
const formJson = {
site_id: "",
site_name: "",
describe: "",
ads: [],
};
export default { export default {
name: "InvProducts",
data() { data() {
return { return {
showSearch: true,
filterQuery: { filterQuery: {
invWarehouseCode: null,
invStorageCode: null,
productsName: null,
nameCode: null, nameCode: null,
relIdFk: null, cpmctymc: null,
ggxh: null,
batchNo: null, batchNo: null,
page: 1,
limit: 20,
customerId: null,
supId: null, supId: null,
unitFk: null, zczbhhzbapzbh: null,
}, ylqxzcrbarmc: null,
detailQuery: { invCode: this.$store.getters.locInvCode,
code: null,
productIdFk: null,
page: 1, page: 1,
limit: 20, limit: 10,
}, },
list: [], list: [],
storageList: [],
subInvList: [],
codeDetailVisible: false,
total: 0, total: 0,
loading: true, invList: [],
index: null, loading: false,
dialogTableVisible: false, deleteData: {
invWarehouseDisabled: true, id: "",
formLoading: false, status: 10,
},
corpLoading: false,
dialogVisible: false, dialogVisible: false,
deleteLoading: false,
busTypes: [],
idQuery: null,
showSup: false,
fromOptions: [], fromOptions: [],
showSup: false,
}; };
}, },
components: { components: {},
draggable,
},
methods: { methods: {
onReset() { onReset() {
this.$router.push({ this.$router.push({
path: "", path: "",
}); });
this.filterQuery = { this.filterQuery = {
productsName: null,
nameCode: null, nameCode: null,
relIdFk: null, cpmctymc: null,
ggxh: null,
batchNo: null, batchNo: null,
customerId: null,
unitFk: null,
supId: null, supId: null,
invWarehouseCode: null, zczbhhzbapzbh: null,
invStorageCode: null, ylqxzcrbarmc: null,
invCode: this.$store.getters.locInvCode,
page: 1, page: 1,
limit: 20, limit: 10,
}; };
this.getList(); this.getList();
}, },
onSubmit() { onSubmit() {
this.loading = true;
this.filterQuery.page = 1; this.filterQuery.page = 1;
this.getList(); this.getList();
}, },
hideSearch() {
this.showSearch = !this.showSearch;
},
handleSizeChange(val) { handleSizeChange(val) {
this.filterQuery.limit = val; this.filterQuery.limit = val;
this.getList(); this.getList();
@ -232,196 +240,99 @@ export default {
this.filterQuery.page = val; this.filterQuery.page = val;
this.getList(); this.getList();
}, },
handleUnitClick(row) { handleSelectionChange(val) {
this.curIndex = row.id; this.getOrderDetails();
this.dialogTableVisible = true;
},
closeDetailDialog(val) {
this.codeDetailVisible = false;
},
closeDialog() {
this.getList();
}, },
getList() { getList() {
this.loading = true; this.loading = true;
this.filterQuery.customerId = store.getters.customerId; getInvProduct(this.filterQuery).then((res) => {
filterProducts(this.filterQuery) this.loading = false;
.then((response) => { if (res.code === 20000) {
this.showSup = response.data.showSup; this.list = res.data.list || [];
this.loading = false; this.total = res.data.total || 0;
this.list = response.data.list || []; } else {
this.total = response.data.total || 0; this.$message.error(res.message);
})
.catch(() => {
this.loading = false;
this.list = []; this.list = [];
this.total = 0; this.total = 0;
}); }
}).catch((error) => {
this.loading = false;
this.$message.error(error.message);
this.list = [];
this.total = 0;
})
}, },
getInvList() {
deleteInvProducts(data) { findInvByUser()
this.loading = true;
let query = {
id: data,
}
deleteInvProduct(query)
.then((response) => { .then((response) => {
if (response.code == 20000) { this.invList = response.data || [];
this.getList(); this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
},
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteInvProducts(rowId);
}) })
.catch(() => { .catch(() => {
}); });
}, },
findMethod(query) { findMethod(key) {
this.corpLoading = true;
this.fromOptions = []; this.fromOptions = [];
let cQuery = { let params = {
key: query, key: key,
customerName: query, corpType: 2,
corpType:2,
page: 1, page: 1,
limit: 20, limit: 20
}; };
getBasicUnitMaintains(cQuery) getBasicUnitMaintains(params).then((res) => {
.then((response) => { this.corpLoading = false;
this.loading = false; this.fromOptions = res.data.list || [];
this.fromOptions = response.data.page.list || []; }).catch(() => {
}) this.corpLoading = false;
.catch(() => { })
this.loading = false;
});
},
getStorage() {
this.storageList = [];
filterUplLocInv()
.then((response) => {
this.storageList = response.data || [];
})
.catch(() => {
});
},
invChange() {
this.filterQuery.invWarehouseCode = "";
this.subInvList = [];
if (this.filterQuery.invStorageCode != null && this.filterQuery.invStorageCode != "") {
this.invWarehouseDisabled = false;
let query = {
filter: 3,
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
})
.catch(() => {
});
} else {
this.invWarehouseDisabled = true;
}
},
intentDetail(row) {
this.idQuery = row;
this.idQuery.customerId = null;
this.codeDetailVisible = true;
}, },
corpChange(value) { corpChange(value) {
if (isBlank(value)) { if (!isBlank(value)) {
this.findMethod(); this.findMethod(value);
} }
}
,
getBusType() {
let query = {
enabled: true,
};
getBusTypeList(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
// this.getList();
})
.catch(() => {
});
}, },
getActionName(action) { detailDialog() {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
}
}
}, },
invWarehouseChange(invWarehouseCode) { deleteDialog(id) {
this.subInvList.forEach(item => { this.$confirm("此操作将永久删除此库存信息,是否继续?", "提示", {
if (item.code === invWarehouseCode) { confirmButtonText: "确定",
this.filterQuery.invStorageCode = item.parentId; cancelButtonText: "取消",
} type: "warning"
}).then(() => {
this.deleteInvProduct(id);
}).catch(() => {
}); });
}, },
}, deleteInvProduct(id) {
filters: { let params = {id: id};
statusFilterType(status) { deleteInvProduct(params).then((res) => {
const statusMap = { if (res.code === 20000) {
false: "success", this.$message.success("删除成功!");
true: "danger", this.getList();
}; } else {
return statusMap[status]; this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
});
} }
, },
}
,
mounted() { mounted() {
document.body.ondrop = function (event) { document.body.ondrop = function (event) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
}; };
} },
,
created() { created() {
this.findMethod(); this.findMethod();
let query = this.$route.query; this.getInvList();
this.filterQuery = Object.assign(this.filterQuery, query); this.getList();
this.filterQuery.limit = parseInt(this.filterQuery.limit); },
// };
//
userInfo().then((res) => {
if (res.code === 20000) {
if (!isBlank(res.data.locInvCode)) {
this.filterQuery.invStorageCode = res.data.locInvCode;
this.invChange();
this.filterQuery.invWarehouseCode = res.data.locSubInvCode;
}
this.getList();
}
}).catch((error) => {
});
}
,
}
;
</script> </script>
<style type="text/scss" lang="scss"> <style type="text/scss" lang="scss">
</style> </style>

Loading…
Cancel
Save