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.

473 lines
15 KiB

<template>
<div class="shop app_content">
<!-- 导航栏 -->
<!-- <div class="header_body">
<header-nav
:leftArrow="false"
:titelText="`公布执法检查计划`"
>
</header-nav>
</div>-->
<van-search
v-model="searchParam.searchText"
show-action
placeholder="请输入计划名称/执法部门/区域查询"
@search="onSearch"
>
<template #action>
<div @click="onClickButton">搜索</div>
</template>
</van-search>
<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="9==data.checkNum?'search-button active':'search-button'" @click="selectDate" round type="primary" size="mini">筛选
</van-button>
</div>
<div class="search-button-date">
2 years ago
<span class="date-select" v-show="data.dateShow" @click="selectDate">{{ data.dateSearch }} <van-icon name="play" /></span>
<div style="border-color: black;" class="van-hairline--bottom"></div>
<van-button class="search-button" type="primary" size="mini" @click="openPlanAddView">创建</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">
<lodding-card :isLodding="isLodding">
<refresh-list v-model:freshMap="freshMap" @refresh="onRefresh" @onLoad="onLoad"
:resetScroll="resetScroll" class="refresh_box">
<div class="refresh_content" v-if="data?.dataList.length">
<!-- <div class="goods_box" v-for="(item, index) in data?.dataList" :key="index" @click="toPdfView(item.fileObject.fileUrl)">-->
<div class="goods_box" v-for="(item, index) in data?.dataList" :key="index"
@click="toPdfView(null!=item.fileObject?item.fileObject.fileUrl:null)">
<van-swipe-cell class="swipe_cell">
<div class="card_box">
<div class="card_box_span">
<p>发布时间:{{ item.createTime }} <span class="card_box_action"></span></p>
</div>
<!-- <van-divider :style="{ color: '#1989fa', borderColor: '#1989fa',padding: '0 5px' }" /> -->
<div class="van-hairline--bottom"></div>
<div class="card_box_span">
<p style="display: flex;"><span class="card_box_label">执法计划:</span> <a style="color: #2b75fd;">{{
null!=item.fileObject?item.fileObject.fileName:"" }}</a></p>
</div>
<div class="card_box_span">
<p style="display: flex;"><span class="card_box_label">计划名称:</span>{{item.planName }}</p>
</div>
<div class="card_box_span">
<p><span class="card_box_label">执法部门:</span> {{ item.bureauDeptName }}
</p>
</div>
<div class="card_box_span">
<p><span class="card_box_label">执法区域:</span> {{ item.enforcementArea }}</p>
</div>
<!-- <div class="card_box_span">-->
<!-- <p style="display: flex;"><span class="card_box_label">执法计划:</span> <a style="color: #2b75fd;">{{-->
<!-- null!=item.fileObject?item.fileObject.fileName:"" }}</a></p>-->
<!-- </div>-->
<!-- <div class="card_box_span">
<p><span class="card_box_label">执法计划:</span> {{ item.fileObject.fileName }}</p>
</div> -->
</div>
</van-swipe-cell>
</div>
</div>
<van-empty v-else class="no_data" description="暂无数据"/>
</refresh-list>
</lodding-card>
</div>
<!-- 底部 -->
<div class="shop_footer_body">
<footer-enforcement-nav></footer-enforcement-nav>
</div>
</div>
</template>
<script setup name="enforcementInspectionProgram">
import {queryEnforcementInspectionProgramList} from "@/api/enforce";
import {setGoodsNum} from "@/util/util";
import {showFailToast} from 'vant';
const {useCommon, useShopCard} = $globalStore;
const router = useRouter();
let allchecked = ref(false); // 是否全选
let refreshLoad = ref(false); // 是否加载中
let searchParam = reactive({
//搜索框
searchText: ref(''),
//日期查询
searchDate: ref(''),
// 用户id
dataScopeId: "",
// dataScopeId: "1731",
});
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'],
dateShow: false,
checkNum: null
});
// 设置初始值为当前时间
onMounted(() => {
console.log(useCommon.enterpriseNumber);
console.log(useCommon.userId);
// getCard();
searchParam.enterpriseNumber = useCommon.enterpriseNumber;
searchParam.dataScopeId = useCommon.userId;
console.log(useCommon.enterpriseNumber)
queryList();
data.dateSearch = nowDate(new Date());
});
const queryList = () => {
queryEnforcementInspectionProgramList(searchParam, success => {
data.dataList = success.data;
freshMap.refreshLoad = false;
freshMap.listLoading = false;
freshMap.listFinished = true;
isLodding.value = false;
}, error => {
})
}
const onSearch = (val) => {
queryEnforcementInspectionProgramList(
{
"searchText": searchParam.searchText
}
, success => {
console.log(success)
data.dataList = success.data;
}, error => {
})
};
const onClickButton = () => {
console.log(searchParam.searchText)
queryList();
}
const toPdfView = (url) => {
if (null != url) {
router.push(
{
path: "/pdfView",
query: {
url: url
}
});
} else {
showFailToast("没有执行计划")
}
}
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 = () => {
freshMap.listFinished = false;
freshMap.listLoading = true;
// getGoodslist();
queryList();
};
// 触底加载
const onLoad = () => {
freshMap.listFinished = true;
freshMap.loading = false;
};
//获取分类下的商品列表
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;
};
onMounted(async () => {
// let res = await getClassify();
// if (res && res?.length) {
// classifyId = res?.[0]?.id;
// classifyId && getGoodslist();
// } else {
// isLodding.value = false;
// }
queryList();
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.dateSearch = value.selectedValues[0] + "-" + value.selectedValues[1];
data.showDatePicker = false;
data.dateShow = true;
queryList();
}
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.dateSearch = null;
searchParam.dateType = val;
searchParam.isComplaint = null;
data.dateShow = false;
queryList();
}
const searchComplaint = (val) => {
searchParam.isComplaint = val;
searchParam.dateType = null;
queryList();
}
const openPlanAddView = () => {
router.push(
{
path: "/enforce/enforcementPlanAdd",
query: {}
});
}
</script>
<style lang="less" scoped>
.shop {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
2 years ago
background-color: #ebf3fb;
.header_body {
2 years ago
height: 1.33rem;
}
.shop-center {
flex: 1;
overflow-y: scroll;
position: relative;
.goods_box {
display: flex;
background-color: #fff;
2 years ago
margin: 0.27rem;
border-radius: 0.27rem;
.swipe_cell {
width: 100%;
}
.card_box {
display: flex;
width: 100%;
2 years ago
padding: 0.27rem 0;
flex-direction: column;
.card_body {
background-color: #fff;
2 years ago
border-radius: 0.27rem;
flex: 1;
}
.card_box_span {
display: flex;
align-items: center;
2 years ago
margin: 1% 0;
padding-left: 3%;
2 years ago
font-size: 0.35rem;
line-height: 1.5;
p {
margin: 0;
}
}
.card_box_action {
position: absolute;
right: 4%;
}
}
}
}
.shop_footer_body {
2 years ago
//height: 101px;
position: relative;
.footer-one-btn {
2 years ago
height: 1.33rem;
bottom: 1.34rem;
}
}
}
.search-button-list {
2 years ago
height: 0.7rem;
display: flex;
flex-direction: row;
2 years ago
padding-left: 0.27rem;
margin-top: 0.27rem;
align-items: end;
.search-button {
width: 15%;
2 years ago
height: 100%;
background: #e3e0e0;
border-color: #e3e0e0;
color: #4c4c4c;
font-size: 0.3rem;
}
.search-button.active {
2 years ago
background-color: #1367fe;
2 years ago
border-color: #1367fe;
2 years ago
color: #fff;
}
}
.search-button-date {
2 years ago
display: flex;
flex-direction: row;
align-items: end;
position: relative;
2 years ago
height: 0.65rem;
margin: 3% 0 1%;
2 years ago
.date-select {
font-size: 0.52rem;
2 years ago
margin: 3% 0 0 4%;
2 years ago
i {
transform: rotate(90deg);
font-size: 0.4rem;
}
}
.search-button {
position: absolute;
2 years ago
top: 0;
2 years ago
right: 3%;
2 years ago
width: 15%;
2 years ago
height: 0.6rem;
2 years ago
font-size: 0.3rem;
}
}
2 years ago
/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;
2 years ago
border: 1px solid #1367fe;
2 years ago
border-radius: 0 0.15rem 0.15rem 0;
color: #fff;
text-align: center;
line-height: 0.9rem;
}
2 years ago
/deep/ .van-hairline--bottom {
margin: -1% 0 3% 0;
height: 0;
background-color: transparent;
border: 1px;
}
/deep/ .card_box_span:first-child {
color: #c1bfbf;
}
.card-title p {
2 years ago
font-size: 0.40rem;
2 years ago
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card_box_label {
color: rgba(128, 128, 128, 0.65);
white-space: nowrap;
}
</style>