parent
7c8cf2ba9c
commit
03bcef8593
@ -0,0 +1,25 @@
|
|||||||
|
import axios from "../../utils/request";
|
||||||
|
|
||||||
|
export function getInvRemindMsgList(params) {
|
||||||
|
return axios({
|
||||||
|
url: "/udiwms/inv/remind/msg/filter",
|
||||||
|
method: "get",
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function confirmMsg(params) {
|
||||||
|
return axios({
|
||||||
|
url: "/udiwms/inv/remind/msg/confirmMsg",
|
||||||
|
method: "get",
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ignoreMsg(params) {
|
||||||
|
return axios({
|
||||||
|
url: "/udiwms/inv/remind/msg/ignoreMsg",
|
||||||
|
method: "get",
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
import axios from "../../utils/request";
|
||||||
|
|
||||||
|
export function getInvRemindSetList(params) {
|
||||||
|
return axios({
|
||||||
|
url: "/udiwms/inv/remind/set/filter",
|
||||||
|
method: "get",
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function saveInvRemindSet(data, formName) {
|
||||||
|
return axios({
|
||||||
|
url: formName === "add"? "/udiwms/inv/remind/set/add" : "/udiwms/inv/remind/set/update",
|
||||||
|
method: "post",
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteInvRemindSet(data){
|
||||||
|
return axios({
|
||||||
|
url: "/udiwms/inv/remind/set/delete",
|
||||||
|
method: "post",
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,340 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="el-card">
|
||||||
|
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
|
||||||
|
<el-row>
|
||||||
|
<el-form-item class="query-form-item" label="产品名称:">
|
||||||
|
<el-input v-model="filterQuery.productName" placeholder="参数关键字搜索" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item" label="仓库名称:">
|
||||||
|
<el-input v-model="filterQuery.productName" placeholder="参数关键字搜索" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item" label="货位名称:">
|
||||||
|
<el-input v-model="filterQuery.productName" placeholder="参数关键字搜索" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button-group>
|
||||||
|
<el-button type="primary"
|
||||||
|
@click.native="search"
|
||||||
|
icon="el-icon-search">
|
||||||
|
搜索
|
||||||
|
</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-table v-loading="loading" :data="list" style="width: 100%" border>
|
||||||
|
<el-table-column type="index" label="序号" width="50"></el-table-column>
|
||||||
|
<el-table-column label="产品名称" prop="productName" width="300" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column label="仓库名称" prop="invName" width="200"></el-table-column>
|
||||||
|
<el-table-column label="货位名称" prop="invSpaceName" width="200"></el-table-column>
|
||||||
|
<el-table-column label="低库存预警" prop="lowStock" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{enableMap[scope.row.lowStock]}}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="低库存预警数量" prop="lowStockNum" width="150"></el-table-column>
|
||||||
|
<el-table-column label="负库存预警" prop="lackStock" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{enableMap[scope.row.lackStock]}}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="积压预警" prop="overStock" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{enableMap[scope.row.overStock]}}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="积压预警数量" prop="overStockNum" width="150"></el-table-column>
|
||||||
|
<el-table-column label="过期提醒" prop="invSpaceName" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{enableMap[scope.row.expireDate]}}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="近效期提醒" prop="recentDate" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{enableMap[scope.row.recentDate]}}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="近效期预警天数" prop="recentDateDay" width="150"></el-table-column>
|
||||||
|
<el-table-column label="备注" prop="remark" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column label="操作" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native="handleForm(scope.$index, scope.row)"
|
||||||
|
>编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native="handleForm(scope.$index, scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="filterQuery.page"
|
||||||
|
:limit.sync="filterQuery.limit"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!--表单-->
|
||||||
|
<el-dialog
|
||||||
|
:title="formMap[formName]"
|
||||||
|
:visible.sync="formVisible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
:before-close="hideForm"
|
||||||
|
width="45%"
|
||||||
|
top="5vh"
|
||||||
|
>
|
||||||
|
<el-form :model="formData" :rules="formRules" ref="dataForm">
|
||||||
|
<el-row>
|
||||||
|
<el-form-item label="参数名:" prop="name" label-width="100px">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.name"
|
||||||
|
auto-complete="off"
|
||||||
|
:disabled="true"
|
||||||
|
style="width: 90%"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-form-item label="参数键:" prop="key" label-width="100px">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.key"
|
||||||
|
auto-complete="off" style="width: 90%"
|
||||||
|
:disabled="true"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-form-item label="参数值" prop="value" label-width="100px">
|
||||||
|
<el-input type="" v-model="formData.value" auto-complete="off" style="width: 90%"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-form-item class="query-form-item" label="提醒类型:" label-width="100px">
|
||||||
|
<el-select v-model="formData.type" placeholder="请选择提醒类型" style="width: 90%" disabled>
|
||||||
|
<el-option label="" value="0"></el-option>
|
||||||
|
<el-option label="库存预警" :value="1"></el-option>
|
||||||
|
<el-option label="过期提醒" :value="2"></el-option>
|
||||||
|
<el-option label="近效期提醒" :value="3"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-form-item label="参数说明:" label-width="100px">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
v-model="formData.remark" style="width: 90%"
|
||||||
|
:disabled="true"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click.native="hideForm">取消</el-button>
|
||||||
|
<el-button type="primary" @click.native="formSubmit()" :loading="formLoading"
|
||||||
|
>提交
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
systemParamConfigList,
|
||||||
|
systemParamConfigSave,
|
||||||
|
} from "@/api/system/param/systemParamConfig";
|
||||||
|
import {getInvRemindMsgList} from "@/api/system/invRemindMsg";
|
||||||
|
|
||||||
|
const formJson = {
|
||||||
|
id: "",
|
||||||
|
name: "",
|
||||||
|
key: "",
|
||||||
|
value: "",
|
||||||
|
type: null,
|
||||||
|
remark: "",
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
name: "remindSet",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
filterQuery: {
|
||||||
|
relId: null,
|
||||||
|
invCode: this.$store.getters.locInvCode,
|
||||||
|
invSpaceCode: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
},
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
loading: true,
|
||||||
|
index: null,
|
||||||
|
formName: null,
|
||||||
|
formMap: {
|
||||||
|
add: "新增提醒设置",
|
||||||
|
update: "提醒设置-编辑",
|
||||||
|
},
|
||||||
|
formLoading: false,
|
||||||
|
formVisible: false,
|
||||||
|
formData: formJson,
|
||||||
|
formRules: {
|
||||||
|
paramValue: [{required: true, message: "请输入参数值", trigger: "blur"}],
|
||||||
|
// ,
|
||||||
|
// paramStatus: [
|
||||||
|
// {required: true, message: "请选择参数状态", trigger: "change"}
|
||||||
|
// ]
|
||||||
|
},
|
||||||
|
|
||||||
|
typeMap: {
|
||||||
|
1: "库存预警",
|
||||||
|
2: "过期提醒",
|
||||||
|
3: "近效期提醒",
|
||||||
|
},
|
||||||
|
enableMap: {
|
||||||
|
true: "开启",
|
||||||
|
false: "关闭"
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteLoading: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onReset() {
|
||||||
|
this.$router.push({
|
||||||
|
path: "",
|
||||||
|
});
|
||||||
|
this.filterQuery = {
|
||||||
|
paramStatus: 1,
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
};
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.filterQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getInvRemindMsgList(this.filterQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.list = response.data.list || [];
|
||||||
|
this.total = response.data.total || 0;
|
||||||
|
} else {
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 刷新表单
|
||||||
|
resetForm() {
|
||||||
|
if (this.$refs["dataForm"]) {
|
||||||
|
// 清空验证信息表单
|
||||||
|
this.$refs["dataForm"].clearValidate();
|
||||||
|
// 刷新表单
|
||||||
|
this.$refs["dataForm"].resetFields();
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 隐藏表单
|
||||||
|
hideForm() {
|
||||||
|
// 更改值
|
||||||
|
this.formVisible = !this.formVisible;
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
// 显示表单
|
||||||
|
handleForm(index, row) {
|
||||||
|
this.formVisible = true;
|
||||||
|
this.formData = JSON.parse(JSON.stringify(formJson));
|
||||||
|
if (row !== null) {
|
||||||
|
this.formData = Object.assign({}, row);
|
||||||
|
}
|
||||||
|
this.formName = "add";
|
||||||
|
if (index !== null) {
|
||||||
|
this.index = index;
|
||||||
|
this.formName = "update";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formSubmit() {
|
||||||
|
// if (!Number.isInteger(parseInt(this.formData.paramValue))) {
|
||||||
|
// this.$message.warning("参数值必须为数字");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
this.$refs["dataForm"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.formLoading = true;
|
||||||
|
let data = Object.assign({}, this.formData);
|
||||||
|
data.paramValue = data.paramValue.trim();
|
||||||
|
systemParamConfigSave(data, this.formName)
|
||||||
|
.then((response) => {
|
||||||
|
this.formLoading = false;
|
||||||
|
if (response.code != 20000) {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.$message.success("操作成功");
|
||||||
|
this.formVisible = false;
|
||||||
|
if (this.formName === "add") {
|
||||||
|
// 向头部添加数据
|
||||||
|
if (response.data && response.data.id) {
|
||||||
|
data.id = response.data.id;
|
||||||
|
this.list.unshift(data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.list.splice(this.index, 1, data);
|
||||||
|
}
|
||||||
|
// 刷新表单
|
||||||
|
this.resetForm();
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.formLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
paramStatusFilterType(paramStatus) {
|
||||||
|
const paramStatusMap = {
|
||||||
|
0: "gray",
|
||||||
|
1: "success",
|
||||||
|
};
|
||||||
|
return paramStatusMap[paramStatus];
|
||||||
|
},
|
||||||
|
paramStatusFilterName(paramStatus) {
|
||||||
|
const paramStatusMap = {
|
||||||
|
0: "禁用",
|
||||||
|
1: "正常",
|
||||||
|
};
|
||||||
|
return paramStatusMap[paramStatus];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// 加载表格数据
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,319 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="el-card">
|
||||||
|
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
|
||||||
|
<el-row>
|
||||||
|
<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-input v-model="filterQuery.productName" placeholder="" clearable></el-input>
|
||||||
|
</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-row>
|
||||||
|
</el-form>
|
||||||
|
<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="productName" width="300" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column label="仓库名称" prop="invName" width="200"></el-table-column>
|
||||||
|
<el-table-column label="货位名称" prop="invSpaceName" width="200"></el-table-column>
|
||||||
|
<el-table-column label="低库存预警" prop="lowStock" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{ enableMap[scope.row.lowStock] }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="低库存预警数量" prop="lowStockNum" width="150"></el-table-column>
|
||||||
|
<el-table-column label="负库存预警" prop="lackStock" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{ enableMap[scope.row.lackStock] }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="积压预警" prop="overStock" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{ enableMap[scope.row.overStock] }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="积压预警数量" prop="overStockNum" width="150"></el-table-column>
|
||||||
|
<el-table-column label="过期提醒" prop="invSpaceName" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{ enableMap[scope.row.expireDate] }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="近效期提醒" prop="recentDate" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag>{{ enableMap[scope.row.recentDate] }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="近效期预警天数" prop="recentDateDay" width="150"></el-table-column>
|
||||||
|
<el-table-column label="备注" prop="remark" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column label="操作" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native="handleForm(scope.$index, scope.row)"
|
||||||
|
>编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native="deleteSet(scope.row.id)"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="filterQuery.page"
|
||||||
|
:limit.sync="filterQuery.limit"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!--表单-->
|
||||||
|
<el-dialog
|
||||||
|
:title="formMap[formName]"
|
||||||
|
:visible.sync="formVisible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
:before-close="hideForm"
|
||||||
|
width="45%"
|
||||||
|
top="5vh"
|
||||||
|
>
|
||||||
|
<el-form :model="formData" ref="dataForm">
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click.native="hideForm">取消</el-button>
|
||||||
|
<el-button type="primary" @click.native="formSubmit()" :loading="formLoading"
|
||||||
|
>提交
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getInvRemindSetList,
|
||||||
|
deleteInvRemindSet,
|
||||||
|
saveInvRemindSet
|
||||||
|
} from "@/api/system/invRemindSet";
|
||||||
|
import {getInvListByUser} from "@/api/system/invWarehouse";
|
||||||
|
import {getInvSpaceList} from "@/api/inventory/invSpace";
|
||||||
|
import {filterProductNames} from "@/api/inventory/invPorduct";
|
||||||
|
|
||||||
|
|
||||||
|
const formJson = {
|
||||||
|
id: "",
|
||||||
|
name: "",
|
||||||
|
key: "",
|
||||||
|
value: "",
|
||||||
|
type: null,
|
||||||
|
remark: "",
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
name: "invRemindSet",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
filterQuery: {
|
||||||
|
cpmctymc: null,
|
||||||
|
relId: null,
|
||||||
|
invCode: this.$store.getters.locInvCode,
|
||||||
|
invSpaceCode: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
},
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
loading: true,
|
||||||
|
index: null,
|
||||||
|
formName: null,
|
||||||
|
formMap: {
|
||||||
|
add: "新增提醒设置",
|
||||||
|
edit: "提醒设置-编辑",
|
||||||
|
},
|
||||||
|
formLoading: false,
|
||||||
|
formVisible: false,
|
||||||
|
formData: null,
|
||||||
|
enableMap: {
|
||||||
|
true: "开启",
|
||||||
|
false: "关闭"
|
||||||
|
},
|
||||||
|
deleteLoading: false,
|
||||||
|
invList: [],
|
||||||
|
spaceList: [],
|
||||||
|
productList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onReset() {
|
||||||
|
this.$router.push({
|
||||||
|
path: "",
|
||||||
|
});
|
||||||
|
this.filterQuery = {
|
||||||
|
relId: null,
|
||||||
|
invCode: this.$store.getters.locInvCode,
|
||||||
|
invSpaceCode: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
};
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.filterQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getInvRemindSetList(this.filterQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.list = response.data.list || [];
|
||||||
|
this.total = response.data.total || 0;
|
||||||
|
} else {
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 刷新表单
|
||||||
|
resetForm() {
|
||||||
|
if (this.$refs["dataForm"]) {
|
||||||
|
// 清空验证信息表单
|
||||||
|
this.$refs["dataForm"].clearValidate();
|
||||||
|
// 刷新表单
|
||||||
|
this.$refs["dataForm"].resetFields();
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addSet() {
|
||||||
|
this.formData = {};
|
||||||
|
this.formName = "add";
|
||||||
|
this.formVisible = true;
|
||||||
|
},
|
||||||
|
// 隐藏表单
|
||||||
|
hideForm() {
|
||||||
|
// 更改值
|
||||||
|
this.formVisible = !this.formVisible;
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
// 显示表单
|
||||||
|
handleForm(index, row) {
|
||||||
|
this.formData = row;
|
||||||
|
this.formName = "edit";
|
||||||
|
this.formVisible = true;
|
||||||
|
},
|
||||||
|
formSubmit() {
|
||||||
|
this.formLoading = true;
|
||||||
|
let data = Object.assign({}, this.formData);
|
||||||
|
data.paramValue = data.paramValue.trim();
|
||||||
|
saveInvRemindSet(data, this.formName)
|
||||||
|
.then((response) => {
|
||||||
|
this.formLoading = false;
|
||||||
|
if (response.code != 20000) {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.$message.success("操作成功");
|
||||||
|
this.formVisible = false;
|
||||||
|
this.resetForm();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.formLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteSet(id) {
|
||||||
|
this.$confirm('是否确认删除此库存预警设置, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
let params = {id: id};
|
||||||
|
deleteInvRemindSet(params).then((res) => {
|
||||||
|
if (res.code === 20000) {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
this.$message.error(error.message);
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
invChange() {
|
||||||
|
this.spaceList = [];
|
||||||
|
this.filterQuery.invSpaceCode = null;
|
||||||
|
this.getSpaceList();
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
getInvList() {
|
||||||
|
getInvListByUser()
|
||||||
|
.then((response) => {
|
||||||
|
this.invList = response.data || [];
|
||||||
|
this.getSpaceList();
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getSpaceList() {
|
||||||
|
let params = {invWarehouseCode: this.filterQuery.invCode, status: 1};
|
||||||
|
getInvSpaceList(params).then((res) => {
|
||||||
|
this.spaceList = res.data.list || [];
|
||||||
|
})
|
||||||
|
},
|
||||||
|
invSpaceChange() {
|
||||||
|
let params = {
|
||||||
|
cpmctymc: this.filterQuery.cpmctymc,
|
||||||
|
invCode: this.filterQuery.invCode,
|
||||||
|
invSpaceCode: this.filterQuery.invSpaceCode
|
||||||
|
};
|
||||||
|
filterProductNames(params).then((res) => {
|
||||||
|
this.productList = res.data.list || [];
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getInvList();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue