You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
613 lines
19 KiB
613 lines
19 KiB
<template>
|
|
<div class="shop app_content">
|
|
<van-search
|
|
v-model="searchParam.searchValue"
|
|
show-action
|
|
placeholder="请输入关键字查询"
|
|
@search="onSearch"
|
|
clearable="true"
|
|
clear-icon="clear"
|
|
clear-trigger="always"
|
|
@clear="clearSearch"
|
|
>
|
|
<template #action>
|
|
<div @click="onClickButton">搜索</div>
|
|
</template>
|
|
</van-search>
|
|
|
|
|
|
<!-- 顶部弹出 -->
|
|
<van-popup v-model:show="data.showTop" position="top" :style="{ height: '30%' }">
|
|
<van-cell-group>
|
|
<van-field
|
|
v-model="searchParam.beginTime"
|
|
label="时间范围"
|
|
@click=""
|
|
readonly
|
|
/>
|
|
</van-cell-group>
|
|
</van-popup>
|
|
<div class="search-button-list">
|
|
<van-button plain hairline :class="null==data.checkNum?'search-button active':'search-button'"
|
|
@click="searchDateType(null)" round type="primary" size="mini">
|
|
全部
|
|
</van-button>
|
|
<van-button plain hairline :class="1==data.checkNum?'search-button active':'search-button'"
|
|
@click="searchDateType(1)" round type="primary"
|
|
size="mini">本月
|
|
</van-button>
|
|
<van-button plain hairline :class="2==data.checkNum?'search-button active':'search-button'"
|
|
@click="searchDateType(2)" round type="primary"
|
|
size="mini">本季
|
|
</van-button>
|
|
<van-button plain hairline :class="3==data.checkNum?'search-button active':'search-button'"
|
|
@click="searchDateType(3)" round type="primary"
|
|
size="mini">本年
|
|
</van-button>
|
|
<!-- <van-button plain hairline class="search-button" @click="searchFilter" round type="primary" size="mini">筛选</van-button>-->
|
|
<van-button plain hairline :class="9==data.checkNum?'search-button active':'search-button'"
|
|
@click="selectDate" round type="primary" size="mini">筛选
|
|
</van-button>
|
|
</div>
|
|
<div class="search-button-date">
|
|
<span class="date-select" v-show="data.dateShow" @click="selectDate">{{ data.dateSearch }}</span>
|
|
<div style="border-color: black;" class="van-hairline--bottom"></div>
|
|
<!-- <van-button class="search-button" type="primary" size="mini">统计分析</van-button> -->
|
|
<van-popup v-model:show="data.showDatePicker" position="bottom">
|
|
<van-date-picker
|
|
title="选择月度"
|
|
v-model="data.currentDate"
|
|
:min-date="data.minDate"
|
|
:max-date="data.maxDate"
|
|
:columns-type="data.columnsType"
|
|
@confirm="onDateConfirm"
|
|
@cancel="cancelSelectDate"
|
|
/>
|
|
</van-popup>
|
|
</div>
|
|
|
|
<!-- 中间 -->
|
|
<div class="shop-center">
|
|
<van-pull-refresh v-model="data.refreshing" @refresh="onRefresh">
|
|
<van-list v-model:loading="data.loading" :finished="data.finished" finished-text="没有更多了" @load="onLoad">
|
|
<div class="goods_box" v-for="(item, index) in data?.dataList" :key="index">
|
|
<van-swipe-cell class="swipe_cell">
|
|
<div class="card_box">
|
|
<div class="card_box_span">
|
|
<p>检查时间:{{ formattedTimeYYYYmmdd(item.checkTime) }}
|
|
<span v-if="item.checkTimeOrder == 1" >
|
|
上午 9:00~12:00
|
|
</span>
|
|
<span v-if="item.checkTimeOrder == 2">
|
|
下午 14:00~17:00
|
|
</span>
|
|
</p>
|
|
<div class="act-btn" v-if="item.isUnite == 1">
|
|
<span class="joint-mark">联</span>
|
|
</div>
|
|
</div>
|
|
<!-- <van-divider :style="{ color: '#1989fa', borderColor: '#1989fa',padding: '0 5px' }" /> -->
|
|
<div @click="toDetailView(item.id)">
|
|
<div class="van-hairline--bottom"></div>
|
|
<div class="card_box_span card-title">
|
|
<p>{{ item.checkItemText }}</p>
|
|
</div>
|
|
<div class="card_box_span">
|
|
<div class="one-label">
|
|
<van-field
|
|
label="执法部门"
|
|
v-model="data.bureauDeptNames[0]"
|
|
readonly
|
|
/>
|
|
<van-field class="no-label"
|
|
v-for="(item, index) in data.bureauDeptNames.slice(1, data.bureauDeptNames.length)" :key="index"
|
|
v-model="data.bureauDeptNames[index+1]"
|
|
label=" "
|
|
readonly
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</van-swipe-cell>
|
|
</div>
|
|
</van-list>
|
|
</van-pull-refresh>
|
|
</div>
|
|
|
|
<!-- 底部 -->
|
|
<div class="shop_footer_body">
|
|
<footer-nav></footer-nav>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup name="register">
|
|
import {showToast} from "vant";
|
|
import { defineProps } from 'vue';
|
|
import {queryEnforcementList} from '../../api/enterprise';
|
|
import {formattedTimeYYYYmmdd} from "@/util/util";
|
|
import {queryLinkage, queryLinkageById, queryLinkageDictByValueAndParentId} from "@/api/linkage";
|
|
|
|
const {useCommon, useShopCard} = $globalStore;
|
|
|
|
//路由参数
|
|
const route = useRoute();
|
|
const router = useRouter();
|
|
|
|
let allchecked = ref(false); // 是否全选
|
|
let refreshLoad = ref(false); // 是否加载中
|
|
let value = ref('')
|
|
let totalPrice = ref(0); // 总钱数
|
|
|
|
let searchParam = reactive({
|
|
// 分页
|
|
pageNum: 1,
|
|
pageSize: 6,
|
|
//执法事件
|
|
lawEnforcementIncident: "",
|
|
//执法部门
|
|
lawEnforcement: "",
|
|
//搜索框
|
|
searchText: ref(''),
|
|
//时间类型
|
|
dateType: null,
|
|
//是否投诉
|
|
isComplaint: null,
|
|
//企业统一信用码
|
|
enterpriseNumber: ref(useCommon.enterpriseNumber),
|
|
//查询日期
|
|
searchDate: null,
|
|
beginTime: "",
|
|
endTime: ""
|
|
});
|
|
|
|
const data = reactive({
|
|
cartList: [],
|
|
dataList: [],
|
|
dateSearch: ref(),
|
|
showDatePicker: false,
|
|
currentDate: ref(['2024', '01']),
|
|
minDate: new Date(2020, 0, 1),
|
|
maxDate: new Date(2125, 5, 1),
|
|
columnsType: ['year', 'month'],
|
|
showTop: false,
|
|
ga_columns: [],
|
|
dateShow: false,
|
|
checkNum: null,
|
|
loading: false,
|
|
finished: false,
|
|
refreshing: false,
|
|
curPage: 1,
|
|
bureauDeptNames:[],
|
|
bureauDeptIds:[],
|
|
});
|
|
|
|
const props = defineProps({
|
|
isReg: {
|
|
type: String,
|
|
default: "",
|
|
},
|
|
});
|
|
|
|
const toComplaint = (id, checkItem) => {
|
|
router.push({
|
|
path: "/enterprise/complaint",
|
|
query: {
|
|
comOrOpi: 1,
|
|
isSelect: false,
|
|
id: id,
|
|
lawEnforcementItemText: checkItem,
|
|
}
|
|
});
|
|
}
|
|
|
|
// 设置初始值为当前时间
|
|
onMounted(() => {
|
|
// getCard();
|
|
searchParam.enterpriseNumber = useCommon.enterpriseNumber;
|
|
// queryList();
|
|
queryLinkageDictByValueAndParentId({"value": "check_item", "parentId": "100"}, success => {
|
|
getLinkageByParentIdToItem(success.id)
|
|
}, error => {
|
|
});
|
|
data.dateSearch = nowDate(new Date());
|
|
});
|
|
|
|
const queryList = () => {
|
|
// 区分即时查询还是历史查询
|
|
searchParam.isReg = props?.isReg;
|
|
console.log(props?.isReg);
|
|
//TODO 临时注释
|
|
if (searchParam.enterpriseNumber == '' || searchParam.enterpriseNumber == null) {
|
|
console.log("该用户没有关联企业!");
|
|
return;
|
|
}
|
|
searchParam.pageNum = (data.curPage-1)*searchParam.pageSize;
|
|
let params = {
|
|
pageNum: (data.curPage-1)*searchParam.pageSize,
|
|
pageSize: searchParam.pageSize
|
|
}
|
|
searchParam.params = params;
|
|
queryEnforcementList(searchParam, success => {
|
|
data.curPage++;
|
|
data.loading = false; // 查出结果停止加载
|
|
if (success.total <= data.dataList.length) {
|
|
// 查到最后没数据
|
|
data.finished = true;
|
|
return;
|
|
}
|
|
for (var i = 0; i < success.rows.length; i++) {
|
|
data.bureauDeptNames = success.rows[i].bureauDeptName.split(',');
|
|
data.bureauDeptIds = success.rows[i].bureauDeptId.split(',');
|
|
var itemTxt = success.rows[i].checkItem;
|
|
for (var j = 0; j < data.ga_columns.length; j++) {
|
|
if (itemTxt == data.ga_columns[j].value) {
|
|
success.rows[i].checkItem = data.ga_columns[j].text;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
// data.dataList = success.data;
|
|
data.dataList.push(...success.rows);
|
|
}, error => {
|
|
|
|
})
|
|
}
|
|
|
|
const getLinkageByParentIdToItem = (parentId) => {
|
|
// 查询检查要求字典信息
|
|
queryLinkage({"parentId": parentId}, success => {
|
|
for (var i = 0; i < success.length; i++) {
|
|
data.ga_columns.push({text: success[i].title, value: success[i].id, id: success[i].id})
|
|
}
|
|
// queryList();
|
|
// searchDateType(null);
|
|
}, error => {
|
|
});
|
|
}
|
|
const onSearch = (val) => {
|
|
data.curPage = 1;
|
|
data.dataList = [];
|
|
onRefresh();
|
|
};
|
|
const clearSearch = (val) => {
|
|
data.curPage = 1;
|
|
data.dataList = [];
|
|
onRefresh();
|
|
};
|
|
const onClickButton = () => {
|
|
data.curPage = 1;
|
|
data.dataList = [];
|
|
onRefresh();
|
|
}
|
|
|
|
const toDetailView = (id) => {
|
|
console.log(id)
|
|
router.push(
|
|
{
|
|
path: "/enterprise/enterpriseInspectionDetail",
|
|
query: {
|
|
id: id,
|
|
isEnterprise: true
|
|
}
|
|
});
|
|
}
|
|
onActivated(() => {
|
|
});
|
|
|
|
onDeactivated(() => {
|
|
|
|
});
|
|
|
|
// 返回
|
|
const goBack = () => {
|
|
router.go(-1);
|
|
};
|
|
|
|
let resetScroll = ref(0); // 滚动记录
|
|
let isLodding = ref(true); // 是否加载中
|
|
let freshMap = reactive({
|
|
refreshLoad: false, // 是否刷新
|
|
listLoading: false, // 是否加载中
|
|
listFinished: false, // 是否加载完成标识
|
|
});
|
|
|
|
//下拉刷新
|
|
const onRefresh = () => {
|
|
data.curPage = 1;
|
|
// 清空列表数据
|
|
data.dataList = [];
|
|
data.finished = false;
|
|
|
|
// 重新加载数据
|
|
// 将 loading 设置为 true,表示处于加载状态
|
|
data.loading = true;
|
|
onLoad();
|
|
};
|
|
// 触底加载
|
|
const onLoad = () => {
|
|
setTimeout(() => {
|
|
if (data.refreshing) {
|
|
data.refreshing = false;
|
|
}
|
|
queryList();
|
|
}, 1000);
|
|
};
|
|
|
|
|
|
//获取分类下的商品列表
|
|
const getGoodslist = async (onLoad) => {
|
|
// const res = await useClassify.classifyGoods();
|
|
// if (res?.code === 20000) {
|
|
// goodsList = onLoad ? goodsList.concat(res?.data) : res?.data;
|
|
// freshMap.refreshLoad = false;
|
|
// freshMap.listLoading = false;
|
|
// freshMap.listFinished = res?.listFinished;
|
|
// if (goodsList.length > 50) {
|
|
// freshMap.listFinished = true;
|
|
// }
|
|
// }
|
|
freshMap.refreshLoad = false;
|
|
freshMap.listLoading = false;
|
|
freshMap.listFinished = true;
|
|
isLodding.value = false;
|
|
};
|
|
|
|
const selectDate = () => {
|
|
data.checkNum = 9;
|
|
data.showDatePicker = true;
|
|
console.log(data.showDatePicker)
|
|
}
|
|
|
|
const onDateConfirm = (value) => {
|
|
data.dateSearch = value.selectedValues[0] + "/" + value.selectedValues[1];
|
|
searchParam.searchDate = value.selectedValues[0] + "-" + value.selectedValues[1];
|
|
data.showDatePicker = false;
|
|
searchParam.dateType = null;
|
|
data.dateShow = true;
|
|
|
|
data.curPage = 1;
|
|
data.dataList = [];
|
|
onRefresh();
|
|
}
|
|
const nowDate = (time) => {
|
|
var year = time.getFullYear(); // 年
|
|
var month = (time.getMonth() + 1).toString().padStart(2, '0'); // 月
|
|
var date = time.getDate().toString().padStart(2, '0'); // 日
|
|
var hour = time.getHours().toString().padStart(2, '0'); // 时
|
|
var minute = time.getMinutes().toString().padStart(2, '0'); // 分
|
|
var second = time.getSeconds().toString().padStart(2, '0'); // 秒
|
|
return (
|
|
year + "/" + month
|
|
)
|
|
}
|
|
|
|
|
|
const searchDateType = (val) => {
|
|
data.checkNum = val;
|
|
searchParam.searchDate = null;
|
|
searchParam.dateType = val;
|
|
searchParam.isComplaint = null;
|
|
data.dateShow = false;
|
|
|
|
data.curPage = 1;
|
|
data.dataList = [];
|
|
onRefresh();
|
|
}
|
|
const searchFilter = () => {
|
|
data.showTop = true;
|
|
|
|
data.curPage = 1;
|
|
data.dataList = [];
|
|
onRefresh();
|
|
}
|
|
const searchComplaint = (val) => {
|
|
searchParam.isComplaint = val;
|
|
searchParam.dateType = null;
|
|
|
|
data.curPage = 1;
|
|
data.dataList = [];
|
|
onRefresh();
|
|
}
|
|
const cancelSelectDate = () => {
|
|
data.showDatePicker = false;
|
|
}
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.shop {
|
|
height: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
background-color: #ebf3fb;
|
|
|
|
.header_body {
|
|
height: 1.33rem;
|
|
}
|
|
|
|
.shop-center {
|
|
flex: 1;
|
|
overflow-y: scroll;
|
|
position: relative;
|
|
|
|
.goods_box {
|
|
display: flex;
|
|
background-color: #fff;
|
|
margin: 0.27rem;
|
|
border-radius: 0.27rem;
|
|
|
|
.swipe_cell {
|
|
width: 100%;
|
|
}
|
|
|
|
.card_box {
|
|
display: flex;
|
|
width: 100%;
|
|
padding: 0.27rem 0;
|
|
flex-direction: column;
|
|
|
|
.card_body {
|
|
background-color: #fff;
|
|
border-radius: 0.27rem;
|
|
flex: 1;
|
|
}
|
|
|
|
.card_box_span {
|
|
display: flex;
|
|
align-items: center;
|
|
margin: 2% 0;
|
|
padding: 0 3%;
|
|
color: #666;
|
|
font-size: 0.35rem;
|
|
line-height: 1.5;
|
|
|
|
p {
|
|
display: flex;
|
|
margin: 0;
|
|
}
|
|
}
|
|
|
|
.card_box_action {
|
|
position: absolute;
|
|
right: 4%;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.shop_footer_body {
|
|
//height: 101px;
|
|
position: relative;
|
|
|
|
.footer-one-btn {
|
|
height: 1.33rem;
|
|
bottom: 1.34rem;
|
|
}
|
|
}
|
|
}
|
|
|
|
.search-button-list {
|
|
height: 0.65rem;
|
|
display: flex;
|
|
flex-direction: row;
|
|
padding-left: 0.27rem;
|
|
margin-top: 0.27rem;
|
|
align-items: end;
|
|
|
|
.search-button {
|
|
width: 15%;
|
|
height: 90%;
|
|
background: #ebebeb;
|
|
border-color: #ebebeb;
|
|
color: #999;
|
|
font-size: 0.3rem;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.search-button.active {
|
|
background-color: #d9e6fd;
|
|
border-color: #75a5fb;
|
|
color: #1367fe;
|
|
}
|
|
}
|
|
|
|
.search-button-date {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: end;
|
|
position: relative;
|
|
|
|
.date-select {
|
|
margin: 3% 0 0 4%;
|
|
color: #c1bfbf;
|
|
font-size: 0.52rem;
|
|
|
|
i {
|
|
transform: rotate(90deg);
|
|
font-size: 0.4rem;
|
|
}
|
|
}
|
|
|
|
.search-button {
|
|
position: absolute;
|
|
top: 1%;
|
|
right: 3%;
|
|
width: 15%;
|
|
height: 100%;
|
|
font-size: 0.3rem;
|
|
}
|
|
}
|
|
|
|
/deep/ .van-hairline--bottom {
|
|
margin: -1% 0 3% 0;
|
|
height: 0;
|
|
background-color: transparent;
|
|
border: 1px;
|
|
}
|
|
|
|
/deep/ .card_box_span:first-child p {
|
|
color: #c1bfbf !important;
|
|
}
|
|
|
|
.card-title p {
|
|
color: #000;
|
|
font-size: 0.40rem;
|
|
font-weight: bold;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.card_box_label {
|
|
color: #323233;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/deep/ .van-search__content {
|
|
height: 0.9rem;
|
|
border: 1px solid #ececec;
|
|
border-radius: 0.15rem 0 0 0.15rem;
|
|
}
|
|
|
|
/deep/ .van-search__action {
|
|
margin: 0 3% 0 0;
|
|
width: 10%;
|
|
height: 0.9rem;
|
|
background: #1367fe;
|
|
border: 0.01rem solid #1367fe;
|
|
border-radius: 0 0.15rem 0.15rem 0;
|
|
color: #fff;
|
|
text-align: center;
|
|
line-height: 0.9rem;
|
|
}
|
|
|
|
.times {
|
|
margin: 0 0.2rem;
|
|
}
|
|
|
|
.act-btn {
|
|
display: flex;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.joint-mark {
|
|
display: inline-block;
|
|
// margin: 0 0.25rem 0 0;
|
|
width: 0.5rem;
|
|
height: 0.5rem;
|
|
background: #2d94fa;
|
|
border-radius: 50%;
|
|
color: #fff;
|
|
font-size: 0.3rem;
|
|
line-height: 1.75;
|
|
text-align: center;
|
|
margin-right: 0.25rem;
|
|
margin-top: 0.3rem
|
|
}
|
|
|
|
</style>
|
|
|