1.库存查询页面添加预警设置

2.修改库存预警设置添加方式和页面,分离新增编辑弹窗,增加状态值查询字段
3.修改库存预警信息确认页面
ywj_dev
x_z 2 years ago
parent eea69883c8
commit 53ea6fa83e

@ -10,16 +10,32 @@ export function getInvRemindSetList(params) {
export function saveInvRemindSet(data, formName) {
return axios({
url: formName === "add"? "/udiwms/inv/remind/set/add" : "/udiwms/inv/remind/set/update",
url: formName === "add" ? "/udiwms/inv/remind/set/add" : "/udiwms/inv/remind/set/update",
method: "post",
data: data
});
}
export function deleteInvRemindSet(data){
export function deleteInvRemindSet(data) {
return axios({
url: "/udiwms/inv/remind/set/delete",
method: "post",
data: data
});
}
export function getInfoByInvId(params) {
return axios({
url: "/udiwms/inv/remind/set/getInfoByInvId",
method: "get",
params: params
});
}
export function batchAddInvRemindSet(data) {
return axios({
url: "/udiwms/inv/remind/set/batchAddInvRemindSet",
method: "post",
data: data
});
}

@ -135,12 +135,12 @@
border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="仓库" prop="invName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
show-overflow-tooltip width="200"></el-table-column>
<el-table-column label="货位" prop="spaceName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
show-overflow-tooltip width="200"></el-table-column>
<el-table-column label="DI标识" prop="nameCode" width="140"></el-table-column>
<el-table-column label="物资名称" prop="cpmctymc" width="180"></el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="180" show-overflow-tooltip></el-table-column>
<el-table-column label="物资名称" prop="cpmctymc" width="200"></el-table-column>
<el-table-column label="规格型号" prop="ggxh" show-overflow-tooltip></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="expireDate" width="120"></el-table-column>-->
@ -151,13 +151,20 @@
width="180"></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh" v-if="showSup" show-overflow-tooltip
width="180"></el-table-column>
width="200"></el-table-column>
<el-table-column label="供应商" prop="supName" v-if="showSup" show-overflow-tooltip
width="180"></el-table-column>
width="200"></el-table-column>
<!-- <el-table-column label="部门" prop="deptName" v-if="showSup"-->
<!-- show-overflow-tooltip width="120"></el-table-column>-->
<el-table-column label="操作" width="150">
<el-table-column label="操作" width="200" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="invRemindSet(scope.row)"
>添加预警设置
</el-button
>
<el-button
type="text"
size="small"
@ -198,6 +205,20 @@
></invProductsDetail>
</el-dialog>
<el-dialog
title="添加库存预警设置"
:visible.sync="addInvRemindSetDialogVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="60%"
v-if="addInvRemindSetDialogVisible"
>
<addInvRemindSetDialog
:invId="invId"
:closeDialog="closeRemindSetDialog"
></addInvRemindSetDialog>
</el-dialog>
</div>
</template>
@ -207,6 +228,7 @@ import {getInvProduct, deleteInvProduct, getProduct} from "@/api/inventory/invPo
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {isBlank} from "@/utils/strUtil";
import invProductsDetail from "@/views/inventory/InvProductsDetail.vue";
import addInvRemindSetDialog from "@/views/inventory/addInvRemindSetDialog.vue";
export default {
name: "InvProducts",
@ -249,7 +271,9 @@ export default {
supId: null,
deptCode: null,
invCode: null
}
},
addInvRemindSetDialogVisible: null,
invId: null
};
},
methods: {
@ -379,10 +403,19 @@ export default {
}).catch((error) => {
this.$message.error(error.message);
});
}
},
invRemindSet(row) {
this.invId = row.id;
this.addInvRemindSetDialogVisible = true;
},
closeRemindSetDialog() {
this.invId = null;
this.addInvRemindSetDialogVisible = false;
},
},
components: {
invProductsDetail
invProductsDetail,
addInvRemindSetDialog
},
mounted() {
document.body.ondrop = function (event) {

@ -0,0 +1,212 @@
<template>
<div>
<el-form :model="formData" label-width="200px" style="margin-bottom: -15px">
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="仓库:">
<el-input v-model="formData.invName" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="货位:">
<el-input v-model="formData.invSpaceName" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="产品名称:">
<el-input v-model="formData.productName" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="规格型号:">
<el-input v-model="formData.ggxh" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="低库存预警数量:">
<el-input v-model="formData.lowStockNum" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="库存积压预警数量:">
<el-input v-model="formData.overStockNum" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="近效期预警时间:">
<el-input v-model="formData.recentDateTime" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="近效期预警时间单位:">
<el-input v-show="formData.isDateBy == 1" value="天" disabled></el-input>
<el-input v-show="formData.isDateBy == 2" value="小时" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="是否开启低库存预警">
<el-select v-model="formData.lowStock">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></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="formData.lackStock">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="是否开启库存积压预警">
<el-select v-model="formData.overStock">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></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="formData.expireDate">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="是否开启近效期预警">
<el-select v-model="formData.recentDate">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="closeDialog">取消</el-button>
<el-button type="primary" @click.native="addInvRemindSet()" :loading="formLoading"
>提交
</el-button>
</div>
</div>
</template>
<script>
import {getInfoByInvId, saveInvRemindSet} from "@/api/system/invRemindSet";
export default {
name: "addInvRemindSetDialog",
props: {
invId: {
type: String,
required: true
},
closeDialog: {
type: Function,
required: true
}
},
data() {
return {
formData: {
relId: null,
ggxh: null,
deptCode: null,
invCode: null,
invSpaceCode: null,
lowStock: false,
lackStock: false,
overStock: false,
expireDate: false,
recentDate: false,
lowStockNum: null,
overStockNum: null,
recentDateTime: null,
isDateBy: null,
invName: null,
invSpaceName: null,
productName: null
},
formLoading: false
};
},
methods: {
getRemindSetInfo() {
getInfoByInvId({invId: this.invId}).then((res) => {
if (res.code === 20000) {
this.formData = res.data;
this.formData.lowStock = false;
this.formData.lackStock = false;
this.formData.overStock = false;
this.formData.expireDate = false;
this.formData.recentDate = false;
} else {
this.$message.error(res.meesage);
}
}).catch((error) => {
this.$message.error(error.message);
})
},
addInvRemindSet() {
if (!this.formData.lowStock && !this.formData.lackStock && !this.formData.overStock && !this.formData.expireDate && !this.formData.recentDate) {
this.$message.warning("至少开启一项预警!");
return;
}
saveInvRemindSet(this.formData, "add").then((res) => {
if (res.code === 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
this.closeDialog();
})
},
},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
created() {
this.getRemindSetInfo();
},
};
</script>
<style type="text/scss" lang="scss">
</style>

@ -0,0 +1,339 @@
<template>
<div>
<el-form :model="formData" label-width="200px">
<el-card>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="是否开启低库存预警">
<el-select v-model="formData.lowStock">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></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="formData.lackStock">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="是否开启库存积压预警">
<el-select v-model="formData.overStock">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></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="formData.expireDate">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="是否开启近效期预警">
<el-select v-model="formData.recentDate">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-divider></el-divider>
<el-form v-model="productQuery" label-width="100px" v-show="showSearch">
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="仓库名称:">
<el-select v-model="formData.invCode" placeholder="请选择所属仓库"
@change="invChange"
style="width: 90%"
>
<el-option
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-col :span="8">
<el-form-item class="query-form-item" label="货位名称:">
<el-select v-model="formData.invSpaceCode" placeholder="请选择货位"
@change="invSpaceChange"
style="width: 90%"
>
<el-option
v-for="item in spaceList"
: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="8">
<el-form-item class="query-form-item" label="产品名称:">
<el-input v-model="productQuery.cpmctymc" clearable style="width: 90%"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="产品DI:">
<el-input v-model="productQuery.nameCode" clearable style="width: 90%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="query-form-item" label="供应商名称:">
<el-input v-model="productQuery.supName" clearable style="width: 90%"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<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" @click.native="queryProductList" icon="el-icon-search">搜索</el-button>
<el-button type="primary" @click.native="formSubmit" icon="el-icon-check">选入</el-button>
</el-button-group>
</div>
<el-table v-loading="loading" :data="productList" style="width: 100%" border ref="multipleTable"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="产品名称" prop="cpmctymc" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="仓库名称" prop="invName" width="200"></el-table-column>
<el-table-column label="供应商名称" prop="supName" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" show-overflow-tooltip></el-table-column>
<el-table-column label="注册备案号" prop="zczbhhzbapzbh" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="productTotal>0"
:total="productTotal"
:page.sync="productQuery.page"
:limit.sync="productQuery.limit"
@pagination="getInvProductList"
/>
</el-form>
</div>
</template>
<script>
import {getInvListByUser} from "@/api/system/invWarehouse";
import {getInvSpaceList} from "@/api/inventory/invSpace";
import {isBlank} from "@/utils/strUtil";
import {batchAddInvRemindSet} from "@/api/system/invRemindSet";
import {getInvProduct} from "@/api/inventory/invPorduct";
export default {
props: {
closeDialog: {
type: Function,
required: true
}
},
name: "addInvRemindSetDialog",
data() {
return {
formData: {
deptCode: this.$store.getters.locDeptCode,
invCode: this.$store.getters.locInvCode,
invSpaceCode: null,
lowStock: false,
lackStock: false,
overStock: false,
expireDate: false,
recentDate: false
},
invList: [],
spaceList: [],
productList: [],
combineProductList: [],
formLoading: false,
productVisible: false,
loading: false,
productQuery: {
invCode: null,
invSpaceCode: null,
cpmctymc: null,
nameCode: null,
page: 1,
limit: 10
},
productTotal: 0,
multipleSelection: [],
showSearch: true
};
},
methods: {
hideSearch() {
this.showSearch = !this.showSearch;
},
invChange() {
this.combineProductList = [];
this.spaceList = [];
this.formData.invSpaceCode = null;
this.formData.relId = null;
this.formData.ggxh = null;
this.getProductList();
this.getSpaceList();
},
getInvList() {
getInvListByUser()
.then((response) => {
this.invList = response.data || [];
this.getSpaceList();
this.getInvProductList();
})
.catch(() => {
});
},
getSpaceList() {
let params = {invWarehouseCode: this.formData.invCode, status: 1};
getInvSpaceList(params).then((res) => {
this.spaceList = res.data.list || [];
})
},
invSpaceChange() {
this.combineProductList = [];
},
formSubmit() {
let message = this.verifyFormData();
if (message !== "success") {
this.$message.error(message);
return;
}
let relIdList = [];
if (this.combineProductList.length > 0) {
this.combineProductList.forEach((item) => {
relIdList.push(item.relIdFk);
});
}
//
let params = {
deptCode: this.formData.deptCode,
invCode: this.formData.invCode,
invSpaceCode: this.formData.invSpaceCode,
relIdList: relIdList
};
batchAddInvRemindSet(params).then((res) => {
if (res.code === 20000) {
this.$message.success("添加成功");
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
this.closeDialog();
})
},
verifyFormData() {
if (isBlank(this.formData.invCode)) {
return "请选择预警仓库";
}
if (this.formData.lowStock === false && this.formData.lackStock === false && this.formData.overStock === false && this.formData.expireDate === false && this.formData.recentDate === false) {
return "至少开启一项预警";
}
return "success";
},
selectProduct() {
this.productVisible = true;
this.getInvProductList();
this.productQuery = {
invCode: this.formData.invCode,
invSpaceCode: this.formData.invSpaceCode,
page: 1,
limit: 10
};
this.productTotal = 0;
},
getInvProductList() {
getInvProduct(this.productQuery).then((res) => {
if (res.code === 20000) {
this.productList = res.data.list || [];
this.productTotal = res.data.total || 0;
} else {
this.productList = [];
this.productTotal = 0;
}
}).catch((error) => {
this.$message.error(error.message);
this.productList = [];
this.productTotal = 0;
})
},
removeProduct(index) {
this.combineProductList.splice(index, 1);
},
onReset() {
this.productQuery = {
invCode: this.formData.invCode,
invSpaceCode: this.formData.invSpaceCode,
cpmctymc: null,
nameCode: null,
page: 1,
limit: 10
};
this.productTotal = 0;
this.productList = [];
this.getInvProductList()
},
queryProductList() {
this.getInvProductList();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
combine() {
if (this.multipleSelection.length === 0) {
this.$message.warning("请选择需要添加预警的产品!");
return;
}
this.productVisible = false;
this.multipleSelection.forEach((item) => {
this.combineProductList.push(item);
});
},
},
created() {
this.getInvList();
},
};
</script>
<style type="text/scss" lang="scss">
.el-radio {
width: 20%;
}
</style>

@ -153,7 +153,7 @@
<!-- <el-tag>{{ ignoreStatusMap[scope.row.ignoreStatus] }}</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="预警类型" prop="productionDate" width="120">
<el-table-column label="预警类型" prop="type" width="120">
<template slot-scope="scope">
<el-tag type="danger">{{ typeMap[scope.row.type] }}</el-tag>
</template>
@ -196,6 +196,77 @@
/>
</el-card>
<el-dialog
v-if="confirmMsgVisible"
title="确认预警信息"
:visible.sync="confirmMsgVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="60%"
top="5vh"
>
<el-form :model="rowData" label-width="200px" style="margin-bottom: -15px">
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="仓库:">
<el-input v-model="rowData.invName" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="货位:">
<el-input v-model="rowData.invSpaceName" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="产品名称:">
<el-input v-model="rowData.productName" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="规格型号:">
<el-input v-model="rowData.ggxh" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-eow>
<el-col :span="10">
<el-form-item class="query-form-item" label="预警类型:">
<el-input v-model="rowData.msg" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="预警类型:">
<el-input v-model="rowData.typeName" disabled></el-input>
</el-form-item>
</el-col>
</el-eow>
<el-row >
<el-col :span="20">
<el-form-item class="query-form-item" label="备注:">
<el-input v-model="handleMsg" auto-complete="off"
type="textarea" style="width: 90%"
placeholder="请输入备注内容"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="closeConfirmDialog">取消</el-button>
<el-button type="primary" @click.native="updateHandleMsg()"
>提交
</el-button>
</div>
</el-dialog>
<!-- 忽略预警弹窗 -->
<el-dialog
@ -268,7 +339,11 @@ export default {
spaceList: [],
ggxhList: [],
ignoreVisible: false,
currentId: null
currentId: null,
confirmMsgVisible: false,
handleMsg: null,
rowData: null,
};
},
methods: {
@ -384,24 +459,11 @@ export default {
this.filterQuery.relId = null;
},
confirmMsg(row) {
this.$prompt('请输入处理方式', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({value}) => {
let params = {
id: row.id,
handleMsg: value
};
confirmMsg(params).then((res) => {
if (res.code === 20000) {
this.$message.success("已确认");
this.getList();
} else {
this.$message.error(res.message);
}
})
}).catch(() => {
});
this.rowData = row;
let typeName = this.typeMap[row.type];
this.rowData.typeName = typeName;
this.handleMsg = null;
this.confirmMsgVisible = true;
},
ignoreMsg(row) {
this.ignoreVisible = true;
@ -425,7 +487,31 @@ export default {
this.currentId = null;
})
},
closeConfirmDialog() {
this.confirmMsgVisible = false;
this.rowData = {}
},
updateHandleMsg() {
let params = {
id: this.rowData.id,
handleMsg: this.handleMsg
};
confirmMsg(params).then((res) => {
if (res.code === 20000) {
this.rowData = {};
this.handleMsg = null;
this.confirmMsgVisible = false;
this.$message.success("已确认");
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.rowData = {};
this.handleMsg = null;
this.confirmMsgVisible = false;
this.$message.error(error.message);
})
},
statusFilterType(status) {
const statusMap = {

@ -1,53 +1,81 @@
<template>
<div>
<el-card class="el-card">
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-form-item class="query-form-item" label="仓库:">
<el-select v-model="filterQuery.invCode" placeholder="请选择所属仓库" clearable="true"
@change="invChange"
style="width: 90%"
>
<el-option
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-form-item class="query-form-item" label="货位:">
<el-select v-model="filterQuery.invSpaceCode" placeholder="请选择货位" clearable="true"
@change="invSpaceChange"
>
<el-option
v-for="item in spaceList"
: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" label="产品名称:">
<el-autocomplete
class="inline-input"
v-model="queryName"
:fetch-suggestions="queryProductName"
placeholder="请输入内容"
clearable
@select="handleSelect"
@clear="clearQueryProduct"
></el-autocomplete>
</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" @click.native="search" icon="el-icon-search">搜索</el-button>
<el-button type="primary" @click.native="addSet" icon="el-icon-plus">新增库存预警设置</el-button>
</el-button-group>
</el-form-item>
<el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" v-show="showSearch">
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="仓库:">
<el-select v-model="filterQuery.invCode" placeholder="请选择所属仓库" clearable="true"
@change="invChange"
style="width: 90%"
>
<el-option
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-col :span="8">
<el-form-item class="query-form-item" label="货位:">
<el-select v-model="filterQuery.invSpaceCode" placeholder="请选择货位" clearable="true"
style="width: 90%"
@change="invSpaceChange"
>
<el-option
v-for="item in spaceList"
: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="8">
<el-form-item class="query-form-item" label="产品名称:">
<el-autocomplete
class="inline-input"
v-model="queryName"
:fetch-suggestions="queryProductName"
placeholder="请输入内容"
clearable
@select="handleSelect"
@clear="clearQueryProduct"
style="width: 90%"
></el-autocomplete>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="状态:">
<el-select v-model="filterQuery.status" clearable style="width: 90%">
<el-option :value="0" label="未启用"></el-option>
<el-option :value="1" label="已启用"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<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" @click.native="search" icon="el-icon-search">搜索</el-button>
<el-button type="primary" @click.native="addSet" icon="el-icon-plus">新增库存预警设置</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 120%" border>
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="仓库名称" prop="invName" width="200"></el-table-column>
@ -80,7 +108,7 @@
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="120">
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
@ -105,16 +133,29 @@
@pagination="getList"
/>
<!--表单-->
<el-dialog
v-if="addVisible"
title="新增预警设置"
:visible.sync="addVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
:before-close="closeAddDialog"
width="60%"
>
<addInvRemindSetDialog
:closeDialog="closeAddDialog"
></addInvRemindSetDialog>
</el-dialog>
<!--表单-->
<el-dialog
v-if="formVisible"
:title="formMap[formName]"
title="编辑预警设置"
:visible.sync="formVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
:before-close="closeDialog"
width="60%"
top="5vh"
>
<invRemindSetModify
:invRemindSetData="formData"
@ -136,6 +177,7 @@ import {getInvListByUser} from "@/api/system/invWarehouse";
import {getInvSpaceList} from "@/api/inventory/invSpace";
import {filterProductNames} from "@/api/inventory/invPorduct";
import invRemindSetModify from "@/views/remind/invRemindSetModify.vue";
import addInvRemindSetDialog from "@/views/remind/addInvRemindSetDialog.vue";
export default {
name: "invRemindSet",
@ -145,6 +187,7 @@ export default {
relId: null,
invCode: this.$store.getters.locInvCode,
invSpaceCode: null,
status: 1,
page: 1,
limit: 20,
},
@ -181,10 +224,14 @@ export default {
invList: [],
spaceList: [],
queryName: null,
addVisible: false,
showSearch: true
};
},
methods: {
hideSearch() {
this.showSearch = !this.showSearch;
},
onReset() {
this.$router.push({
path: "",
@ -193,6 +240,7 @@ export default {
relId: null,
invCode: this.$store.getters.locInvCode,
invSpaceCode: null,
status: 1,
page: 1,
limit: 20,
};
@ -232,22 +280,8 @@ export default {
}
},
addSet() {
this.formData = {
id: null,
relId: null,
ggxh: null,
deptCode: this.$store.getters.locDeptCode,
invCode: this.$store.getters.locInvCode,
invSpaceCode: null,
lowStock: false,
lackStock: false,
overStock: false,
expireDate: false,
recentDate: false,
remark: null
};
this.formName = "add";
this.formVisible = true;
this.addVisible = true;
},
deleteSet(id) {
@ -348,6 +382,10 @@ export default {
};
this.getList();
},
closeAddDialog() {
this.addVisible = false;
this.getList();
},
//
handleForm(index, row) {
this.formData = row;
@ -356,7 +394,8 @@ export default {
},
},
components: {
invRemindSetModify
invRemindSetModify,
addInvRemindSetDialog
},
created() {
this.getInvList();

@ -4,36 +4,13 @@
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="仓库:">
<el-select v-model="setData.invCode" placeholder="请选择所属仓库"
@change="invChange"
style="width: 90%"
>
<el-option
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-input v-model="setData.invName" style="width: 90%" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="货位:">
<el-select v-model="setData.invSpaceCode" placeholder="请选择货位"
@change="invSpaceChange"
style="width: 90%"
>
<el-option
v-for="item in spaceList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
<el-input v-model="setData.invSpaceName" style="width: 90%" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -41,78 +18,70 @@
<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-input v-model="setData.productName" style="width: 90%" :disabled="true"></el-input>
</el-form-item>
</el-col>
<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-input v-model="setData.ggxh" style="width: 90%" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="20">
<el-col :span="10">
<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-select v-model="setData.lowStock">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-col :span="10">
<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-select v-model="setData.lackStock">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-col :span="10">
<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-select v-model="setData.overStock">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-col :span="10">
<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-select v-model="setData.expireDate">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-col :span="10">
<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-select v-model="setData.recentDate">
<el-option :value="true" label="开启"></el-option>
<el-option :value="false" label="关闭"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
@ -128,7 +97,6 @@
import {getInvListByUser} from "@/api/system/invWarehouse";
import {getInvSpaceList} from "@/api/inventory/invSpace";
import {filterProductNames} from "@/api/inventory/invPorduct";
import {getGgxhList} from "@/api/basic/product/udiRelevance";
import {isBlank} from "@/utils/strUtil";
import {saveInvRemindSet} from "@/api/system/invRemindSet";
@ -261,6 +229,6 @@ export default {
</script>
<style type="text/scss" lang="scss">
.el-radio {
width: 10%;
width: 20%;
}
</style>

Loading…
Cancel
Save