1.修改库存预警功能页面

prod
x_z 2 years ago
parent 30c572fb48
commit 217879692e

@ -139,14 +139,6 @@
<el-table-column label="产品名称" prop="productName" width="300" show-overflow-tooltip></el-table-column>
<el-table-column label="批次号" prop="batchNo" width="300" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="300" show-overflow-tooltip></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="supName" width="120"></el-table-column>
<el-table-column label="生产厂家" prop="manufactory" width="120"></el-table-column>
<el-table-column label="批准文号" prop="zczbhhzbapzbh" width="120"></el-table-column>
<el-table-column label="入库数量" prop="inCount" width="100"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="100"></el-table-column>
<el-table-column label="库存数量" prop="productionDate" width="100"></el-table-column>
<el-table-column label="消息状态" prop="status" width="100">
<template slot-scope="scope">
<el-tag>{{ statusMap[scope.row.status] }}</el-tag>
@ -164,6 +156,14 @@
</el-table-column>
<el-table-column label="预警内容" prop="msg" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="处理方式" prop="handleMsg" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="入库数量" prop="inCount" width="100"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="100"></el-table-column>
<el-table-column label="库存数量" prop="productionDate" width="100"></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="supName" width="120"></el-table-column>
<el-table-column label="生产厂家" prop="manufactory" width="120"></el-table-column>
<el-table-column label="批准文号" prop="zczbhhzbapzbh" width="120"></el-table-column>
<el-table-column label="备注" prop="remark" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
@ -221,6 +221,10 @@ export default {
total: 0,
loading: true,
index: null,
statusMap: {
1: "未确认",
2: "已确认"
},
typeMap: {
1: "库存不足预警",
2: "负库存预警",

@ -3,7 +3,7 @@
<el-form :model="setData" label-width="200px" style="margin-bottom: -15px">
<el-row>
<el-col :span="10">
<el-form-item label="仓库:">
<el-form-item class="query-form-item" label="仓库:">
<el-select v-model="setData.invCode" placeholder="请选择所属仓库"
@change="invChange"
style="width: 90%"
@ -36,77 +36,81 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="产品名称:">
<el-autocomplete
class="inline-input"
style="width: 90%"
v-model="productName"
:fetch-suggestions="queryProductName"
placeholder="请输入内容"
@select="handleSelectProduct"
@clear="clearQueryProduct"
></el-autocomplete>
</el-form-item>
</el-col>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="产品名称:">
<el-select v-model="setData.relId" placeholder="请选择货位"
style="width: 90%"
@change="handleSelectProduct"
>
<el-option
v-for="item in productList"
:key="item.cpmctymc"
:label="item.cpmctymc"
:value="item.relIdFk"
>
<span style="float: left">{{ item.cpmctymc }}</span>
<span style="float: right">{{ item.ggxh }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="规格型号:">
<el-select v-model="setData.ggxh" placeholder="请选择" style="width: 90%">
<el-option
v-for="item in ggxhList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="规格型号:">
<el-input
placeholder="规格型号"
v-model="setData.ggxh"
:disabled="true"
style="width: 90%"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启低库存预警">
<el-radio v-model="setData.lowStock" :label="true" border>开启</el-radio>
<el-radio v-model="setData.lowStock" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启负库存预警">
<el-radio v-model="setData.lackStock" :label="true" border>开启</el-radio>
<el-radio v-model="setData.lackStock" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启库存积压预警">
<el-radio v-model="setData.overStock" :label="true" border>开启</el-radio>
<el-radio v-model="setData.overStock" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启产品过期预警">
<el-radio v-model="setData.expireDate" :label="true" border>开启</el-radio>
<el-radio v-model="setData.expireDate" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启近效期预警">
<el-radio v-model="setData.recentDate" :label="true" border>开启</el-radio>
<el-radio v-model="setData.recentDate" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启低库存预警">
<el-radio v-model="setData.lowStock" :label="true" border>开启</el-radio>
<el-radio v-model="setData.lowStock" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启负库存预警">
<el-radio v-model="setData.lackStock" :label="true" border>开启</el-radio>
<el-radio v-model="setData.lackStock" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启库存积压预警">
<el-radio v-model="setData.overStock" :label="true" border>开启</el-radio>
<el-radio v-model="setData.overStock" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启产品过期预警">
<el-radio v-model="setData.expireDate" :label="true" border>开启</el-radio>
<el-radio v-model="setData.expireDate" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item class="query-form-item" label="是否开启近效期预警">
<el-radio v-model="setData.recentDate" :label="true" border>开启</el-radio>
<el-radio v-model="setData.recentDate" :label="false" border>关闭</el-radio>
</el-form-item>
</el-col>
</el-row>
</el-row>
</el-form>
@ -162,8 +166,8 @@ export default {
},
invList: [],
spaceList: [],
productList: [],
productName: null,
ggxhList: [],
formLoading: false
};
},
@ -171,6 +175,9 @@ export default {
invChange() {
this.spaceList = [];
this.setData.invSpaceCode = null;
this.setData.relId = null;
this.setData.ggxh = null;
this.getProductList();
this.getSpaceList();
},
getInvList() {
@ -189,6 +196,12 @@ export default {
})
},
invSpaceChange() {
this.setData.relId = null;
this.setData.ggxh = null;
this.getProductList();
},
getProductList() {
this.productList = [];
let params = {
cpmctymc: null,
invCode: this.setData.invCode,
@ -198,42 +211,6 @@ export default {
this.productList = res.data.list || [];
})
},
queryProductName(productName, cb) {
let params = {
cpmctymc: productName,
invCode: this.setData.invCode,
invSpaceCode: this.setData.invSpaceCode
};
filterProductNames(params).then((res) => {
let productList = res.data.list || [];
let results = productName ? productList.filter(this.createFilter(productName)) : productList;
let rs = [];
results.forEach(item => {
let data = {value: item.cpmctymc, relId: item.relIdFk}
rs.push(data);
});
cb(rs);
})
},
createFilter(queryString) {
return (productList) => {
return productList.cpmctymc.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
}
},
handleSelectProduct(item) {
this.queryName = item.value;
this.setData.relId = item.relId;
this.setData.ggxh = null;
let params = {relId: item.relId};
getGgxhList(params).then((res) => {
this.ggxhList = res.data || [];
});
},
clearQueryProduct() {
this.queryName = null;
this.setData.relId = null;
},
formSubmit() {
let result = this.verifyFormData();
if (result !== "success") {
@ -241,35 +218,36 @@ export default {
return;
}
this.formLoading = true;
saveInvRemindSet(this.setData, this.formName)
.then((response) => {
this.formLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("操作成功");
this.closeDialog();
})
.catch((error) => {
this.$message.error(error.message);
this.formLoading = false;
});
saveInvRemindSet(this.setData, this.formName)
.then((response) => {
this.formLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("操作成功");
this.closeDialog();
})
.catch((error) => {
this.$message.error(error.message);
this.formLoading = false;
});
},
verifyFormData() {
if (isBlank(this.setData.invCode)) {
return "请选择预警仓库";
}
if (!isBlank(this.setData.relId)) {
if (isBlank(this.setData.ggxh)) {
return "请选择规格型号";
}
}
if (this.setData.lowStock === false && this.setData.lackStock === false && this.setData.overStock === false && this.setData.expireDate === false && this.setData.recentDate === false) {
return "至少开启一项预警";
}
return "success";
},
handleSelectProduct(relId) {
this.productList.forEach((item) => {
if (item.relIdFk === relId) {
this.setData.ggxh = item.ggxh;
}
})
},
},
created() {
@ -277,6 +255,7 @@ export default {
this.setData = this.invRemindSetData;
}
this.getInvList();
this.getProductList();
},
};
</script>

Loading…
Cancel
Save