追溯预警相关修改
parent
34e8534ef5
commit
92b2b8e22e
@ -0,0 +1,16 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
export function getTraceWarnList(query) {
|
||||
return axios({
|
||||
url: '/trace/remind/msg/filter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function deleteMsg(data) {
|
||||
return axios({
|
||||
url: '/trace/remind/msg/delete',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
@ -0,0 +1,388 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="el-card">
|
||||
<el-form :model="filterQuery" label-width="100px"
|
||||
v-show="showSearch">
|
||||
|
||||
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属企业:">
|
||||
|
||||
|
||||
<el-select
|
||||
v-model="filterQuery.companyIdFk"
|
||||
filterable
|
||||
remote
|
||||
clearable="true"
|
||||
reserve-keyword
|
||||
placeholder="供应商名称"
|
||||
:remote-method="findMethod"
|
||||
size="mini"
|
||||
:loading="corpLoading"
|
||||
style="width: 90%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in fromOptions"
|
||||
:key="item.companyName"
|
||||
:label="item.companyName"
|
||||
:value="item.id"
|
||||
>
|
||||
<span style="float: left">{{ item.companyName }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="4">-->
|
||||
<!-- <el-form-item label="产品名称:">-->
|
||||
<!-- <el-input v-model="filterQuery.name" placeholder="产品名称"-->
|
||||
<!-- style="width: 90%"-->
|
||||
<!-- clearable="true"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<!-- <el-col :span="4">-->
|
||||
<!-- <el-form-item label="证书名称:">-->
|
||||
<!-- <el-input v-model="filterQuery.certName" placeholder="证书名称"-->
|
||||
<!-- style="width: 90%"-->
|
||||
<!-- clearable="true"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="6">-->
|
||||
<!-- <el-form-item label="预警来源:">-->
|
||||
<!-- <el-select v-model="filterQuery.sourceType"-->
|
||||
<!-- placeholder="请选择预警类型"-->
|
||||
<!-- clearable-->
|
||||
<!-- style="width: 90%"-->
|
||||
<!-- >-->
|
||||
<!-- <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-col>-->
|
||||
<el-col :span="6">
|
||||
<el-form-item label="预警类型:">
|
||||
<el-select v-model="filterQuery.warnType"
|
||||
placeholder="请选择预警类型"
|
||||
clearable
|
||||
style="width: 90%"
|
||||
>
|
||||
<el-option label="企业资质预警" :value="1"></el-option>
|
||||
<el-option label="产品资质预警" :value="2"></el-option>
|
||||
<el-option label="产品过期预警" :value="3"></el-option>
|
||||
<el-option label="产品近效期预警" :value="4"></el-option>
|
||||
<el-option label="出入库预警" :value="5"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="预警状态:">
|
||||
<el-select v-model="filterQuery.status"
|
||||
placeholder="请选择预警状态"
|
||||
clearable
|
||||
style="width: 90%"
|
||||
>
|
||||
<el-option label="未确认" :value="1"></el-option>
|
||||
<el-option label="已确认" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据日期:">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
v-model="actDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 90%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</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" @click.native="onSubmit()" icon="el-icon-search">搜索</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
|
||||
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row>
|
||||
<el-table-column type="index" label="序号" width="50"></el-table-column>
|
||||
<el-table-column label="所属企业" prop="companyName" width="180" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column label="所属产品名称" prop="name" width="180"-->
|
||||
<!-- show-overflow-tooltip></el-table-column>-->
|
||||
|
||||
<!-- <el-table-column label="预警来源" prop="warnType" width="120">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{ sourceTypeMap[scope.row.sourceTyp] }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<el-table-column label="预警类型" prop="warnType" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusFilterType(scope.row.warnType)">{{ warnTypeMap[scope.row.warnType] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预警内容" prop="warnContent" show-overflow-tooltip width="400"></el-table-column>
|
||||
<el-table-column label="预警时间" prop="createTime" show-overflow-tooltip width="180"></el-table-column>
|
||||
<el-table-column label="预警状态" prop="status" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusFilterType(scope.row.status)">{{ statusTypeMap[scope.row.status] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
v-if="scope.row.status === 1"
|
||||
>确认
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
v-if="scope.row.status === 1"
|
||||
@click.native="delMsg(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-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {getHead, executeFuc} from "@/utils/customConfig";
|
||||
import {getTraceWarnList, deleteMsg} from "@/api/udi/traceWarn";
|
||||
import {seachCompany} from "@/api/basic/udiRlCompany";
|
||||
|
||||
export default {
|
||||
name: "traceWarnMsg",
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
filterQuery: {
|
||||
status: null,
|
||||
warnType: null,
|
||||
supName: null,
|
||||
page: 1,
|
||||
limit: 20,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
sourceType: 1,
|
||||
companyIdFk: null,
|
||||
},
|
||||
|
||||
list: [],
|
||||
total: 0,
|
||||
warnTypeMap: {
|
||||
1: "企业资质预警",
|
||||
2: "产品资质预警",
|
||||
3: "产品过期预警",
|
||||
4: "产品近效期预警",
|
||||
5: "出入库预警"
|
||||
},
|
||||
sourceTypeMap: {
|
||||
1: "远程检查",
|
||||
2: "现场检查",
|
||||
3: "自动抽查",
|
||||
},
|
||||
statusTypeMap: {
|
||||
1: "未确认",
|
||||
2: "已确认",
|
||||
null: "未确认",
|
||||
},
|
||||
loading: false,
|
||||
actDateRange: null,
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
actionType: "online",
|
||||
corpLoading: false,
|
||||
fromOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hideSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
name: null,
|
||||
status: 1,
|
||||
page: 1,
|
||||
limit: 20,
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
onSubmit() {
|
||||
this.filterQuery.page = 1;
|
||||
if (this.actDateRange !== null) {
|
||||
this.filterQuery.startTime = this.actDateRange[0];
|
||||
this.filterQuery.endTime = this.actDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.startTime = null;
|
||||
this.filterQuery.endTime = null;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
|
||||
getList() {
|
||||
this.loading = true;
|
||||
switch (this.actionType) {
|
||||
case "remote":
|
||||
this.filterQuery.sourceType = 1;
|
||||
break;
|
||||
case "online":
|
||||
this.filterQuery.sourceType = 2;
|
||||
break;
|
||||
case "auto":
|
||||
this.filterQuery.sourceType = 3;
|
||||
break;
|
||||
default:
|
||||
this.filterQuery.sourceType = null;
|
||||
break;
|
||||
}
|
||||
getTraceWarnList(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;
|
||||
});
|
||||
},
|
||||
|
||||
delMsg(row) {
|
||||
this.$confirm("是否确定删除该预警信息?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
let params = {
|
||||
id: row.id,
|
||||
};
|
||||
deleteMsg(params).then((res) => {
|
||||
if (res.code === 20000) {
|
||||
if (row.type == 1)
|
||||
this.getSupList();
|
||||
else if (row.type == 2)
|
||||
this.getManuList();
|
||||
else
|
||||
this.getProductList();
|
||||
} else {
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
statusFilterType(status) {
|
||||
const statusMap = {
|
||||
0: "warning",
|
||||
1: "warning",
|
||||
2: "warning",
|
||||
3: "warning",
|
||||
4: "warning",
|
||||
5: "warning",
|
||||
6: "warning",
|
||||
7: "warning",
|
||||
};
|
||||
return statusMap[status];
|
||||
},
|
||||
confirmFilterType(status) {
|
||||
const statusMap = {
|
||||
1: "warning",
|
||||
2: "success",
|
||||
};
|
||||
return statusMap[status];
|
||||
},
|
||||
|
||||
|
||||
findMethod(key) {
|
||||
this.corpLoading = true;
|
||||
this.fromOptions = [];
|
||||
let params = {
|
||||
searchKey: key,
|
||||
page: 1,
|
||||
limit: 10
|
||||
};
|
||||
seachCompany(params).then((res) => {
|
||||
this.corpLoading = false;
|
||||
this.fromOptions = res.data.list || [];
|
||||
}).catch(() => {
|
||||
this.corpLoading = false;
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
this.actionType = this.$route.query.type;
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue