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.
 
 

743 lines
23 KiB

<template>
<div class="shop app_content">
<!-- 导航栏 -->
<!-- <div class="header_body">
<header-nav :leftArrow="false" titelText="行政检查预约"/>
</div>-->
<van-search
v-model="searchParam.searchValue"
show-action placeholder="执法事项/执法部门/企业名称"
clearable="true"
clear-icon="clear"
clear-trigger="always"
@search="onSearch">
<template #action>
<div @click="onClickButton">搜索</div>
</template>
</van-search>
<div class="search-button-list" v-if="isReg == 1">
<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">
<span class="date-select" v-show="data.dateShow" @click="selectDate">{{ data.dateSearch }}</span>
<div class="van-hairline&#45;&#45;bottom"></div>
<!-- <van-button class="search-button" @click="goAdd" 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" @click="toDetailView(item.id)">-->
<div class="card_box">
<div class="card_box_span">
<p>检查时间{{ formattedTimeYYYYmmdd(item.checkTime) }}
<span class="times" v-if="item.checkTimeOrder == 1" >
上午 9:00~12:00
</span>
<span class="times" v-if="item.checkTimeOrder == 2">
下午 14:00~17:00
</span>
</p>
<div class="act-btn" v-if="item.isUnite == 1">
<!-- <span class="card_box_action"></span>-->
<span class="joint-mark">联</span>
</div>
</div>
<div @click="toDetailView(item.id)">
<!-- <van-divider :style="{ color: '#1989fa', borderColor: '#1989fa',padding: '0 5px' }" />-->
<div class="van-hairline--bottom"></div>
<div class="card_box_span card-title">
<p>{{ item.checkItemText }}</p>
</div>
<!-- <div class="card_box_span">
<p><span class="card_box_label">登记编号:</span> {{ item.lawEnforcementCode }}</p>
</div> -->
<div class="card_box_span">
<p><label class="card_box_label">执法部门:</label> <span>{{ item.bureauDeptName }}</span></p>
</div>
<div class="card_box_span">
<p><label class="card_box_label">企业名称:</label> <span>{{ item.enterpriseName }}</span></p>
</div>
<div class="card_box_span">
<p v-if="item.isReg == 0"><label class="card_box_label">执法状态:</label> <span>未登记</span></p>
<p v-if="item.isReg == 1"><label class="card_box_label">执法状态:</label> <span>已登记</span></p>
</div>
<div class="btn-list">
<a v-if="item.isReg != 1 && item.status != 1 && item.status != 3" @click.stop="toEditView(item.id)"><van-icon name="edit" />变更</a>
<a v-if="item.isReg != 1 && item.status != 1" @click.stop="openCancel(item.id)"><van-icon name="close" />取消</a>
<a v-if="item.isReg == 1" @click.stop="relaunchView(item.id)"><van-icon name="passed" />再次发起</a>
</div>
</div>
</div>
</van-swipe-cell>
</div>
</van-list>
</van-pull-refresh>
</div>
<!-- 底部 -->
<div class="shop_footer_body">
<footer-enforcement-nav></footer-enforcement-nav>
</div>
<div class="van-overlay" v-show="data.showIsCancel">
<div class="popcont">
<div class="poptip">确认取消该行政检查通知?</div>
<div class="popup-btn">
<a @click="cancel(0)">取消</a><a @click="cancel(1)">确认</a>
</div>
</div>
</div>
</div>
</template>
<script setup name="registrationList">
import {showToast, Toast,showSuccessToast} from "vant";
import {queryEnterpriseLawEnforcementList, queryTotal,cancelEnterpriseLawEnforcement} from '@/api/administrative';
import {setGoodsNum} from "@/util/util";
import {getDict} from "@/api/Home";
import {queryLinkage, queryLinkageById, queryLinkageDictByValueAndParentId} from "@/api/linkage";
import {formattedTimeYYYYmmdd} from "@/util/util";
import {ref,defineEmits,defineProps } from 'vue';
const {useCommon, useShopCard} = $globalStore;
//接受组件参数
const props = defineProps({
isReg: {
type: Object,
default: 0
}
})
//路由参数
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: "",
//搜索框
searchValue: ref(''),
//时间类型
dateType: null,
//是否投诉
isComplaint: null,
//企业统一信用码 ref(useCommon.enterpriseNumber)
enterpriseNumber: "",
lawEnforcerId: ref(useCommon.userId),
//日期搜索
searchDate: ref(),
isReg: ref(),
});
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'],
ga_columns: [],
dateShow: false,
checkNum: null,
loading: false,
finished: false,
refreshing: false,
curPage: 1,
total: 0,
dateColumns: [
{ text: '年度', value: 'year' },
{ text: '季度', value: 'quarter' },
{ text: '月度', value: 'month' },
],
showIsCancel: ref(false),
currentId: "",
});
// 设置初始值为当前时间
onMounted(() => {
// queryLinkageDictByValueAndParentId({"value": "check_item", "parentId": "100"}, success => {
// getLinkageByParentIdToItem(success.id)
// }, error => {
// });
data.curPage = 1;
data.dateSearch = nowDate(new Date());
isLodding.value = false;
searchParam.isReg = props?.isReg;
});
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 queryList = () => {
searchParam.pageNum = (data.curPage-1)*searchParam.pageSize;
let params = {
pageNum: (data.curPage-1)*searchParam.pageSize,
pageSize: searchParam.pageSize
}
searchParam.params = params;
queryEnterpriseLawEnforcementList(searchParam, success => {
data.curPage++;
data.loading = false; // 查出结果停止加载
if (success.total <= data.dataList.length) {
// 查到最后没数据
data.finished = true;
return;
}
// for (var i = 0; i < success.data.length; i++) {
// var itemTxt = success.data[i].checkItem;
// for (var j = 0; j < data.ga_columns.length; j++) {
// if (itemTxt == data.ga_columns[j].value) {
// success.data[i].checkItem = data.ga_columns[j].text;
// break;
// }
// }
// }
// data.dataList = success.data;
data.dataList.push(...success.rows);
}, error => {
})
}
const onSearch = (val) => {
data.curPage = 1;
data.dataList = [];
queryEnterpriseLawEnforcementList(
{
"searchValue": searchParam.searchValue
}
, success => {
data.dataList = success.data;
}, error => {
})
};
const toEditView = (id) => {
router.push(
{
path: "/appointmentEdit",
query: {
id: id,
}
});
}
const onClickButton = () => {
data.curPage = 1;
data.dataList = [];
onRefresh();
}
const toComplaintView = (id, name) => {
router.push(
{
path: "/enterprise/complaint",
query: {
id: id,
lawEnforcementIncident: name
}
});
}
onActivated(() => {
});
onDeactivated(() => {
});
const goAdd = () => {
router.push({
path: "/appointment",
// query: {
// enterpriseNumber: "123",
// }
});
}
// 返回
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;
}
const onDateConfirm = (value) => {
data.dateSearch = value.selectedValues[0] + "/" + value.selectedValues[1]
data.showDatePicker = false;
//日期搜索
searchParam.searchDate = value.selectedValues[0] + "-" + value.selectedValues[1]
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.dateType = val;
searchParam.isComplaint = null;
searchParam.searchDate = null;
data.dateShow = false;
data.curPage = 1;
data.dataList = [];
onRefresh();
}
const searchComplaint = (val) => {
searchParam.isComplaint = val;
searchParam.dateType = null;
data.curPage = 1;
data.dataList = [];
onRefresh();
}
const toDetailView = (id) => {
router.push(
{
// path: "/enterprise/enterpriseInspectionDetail",
path: "/appointmentDetail",
query: {
id: id,
}
});
}
const setLinkageItem = (id) => {
queryLinkageById({"id": id}, success => {
submitData.checkItem = success.title
}, error => {
});
}
const formattedTime = (dateTime) => {
const date = new Date(dateTime);
const year = date.getFullYear();
const month = ("0" + (date.getMonth() + 1)).slice(-2);
const day = ("0" + date.getDate()).slice(-2);
const hour = ("0" + date.getHours()).slice(-2);
const minute = ("0" + date.getMinutes()).slice(-2);
const second = ("0" + date.getSeconds()).slice(-2);
return `${year}-${month}-${day}`;
}
const relaunchView = (id) =>{
router.push(
{
path: "/appointmentRelaunch",
query: {
id: id,
}
});
}
const openCancel = (id) =>{
data.showIsCancel = true;
data.currentId = id;
}
const cancel = (val) => {
if(val == 0){
data.showIsCancel = false;
return;
}else{
console.log("=====> route?.query?.id : ", data.currentId)
cancelEnterpriseLawEnforcement(data.currentId,success =>{
// router.go(-1);
data.currentId = "";
data.showIsCancel = false;
showSuccessToast("已取消并通知企业");
onRefresh();
// queryList();
});
}
};
</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;
top: 6%;
right: 4%;
button {
width: 1rem;
height: 0.5rem;
line-height: 1.5;
}
}
}
}
}
.shop_footer_body {
//height: 101px;
position: relative;
.footer-one-btn {
height: 1.33rem;
bottom: 1.34rem;
}
}
}
.search-button-list {
height: 0.7rem;
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;
/*height: 0.65rem;
margin: 3% 0 1%;*/
.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: 0;
right: 3%;
width: 15%;
height: 0.6rem;
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 {
display: block !important;
color: #000;
font-size: 0.40rem;
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card_box_label {
color: #323233;
}
/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: 1px solid #1367fe;
border-radius: 0 0.15rem 0.15rem 0;
color: #fff;
text-align: center;
line-height: 0.9rem;
}
.btn-list {
display: flex;
align-items: center;
justify-content: flex-end;
margin: 0.3rem 3% 0;
width: 94%;
border-top: 1px solid #f4f5f6;
}
.btn-list a {
margin: 3% 3% 1%;
font-size: 0.35rem;
color: #1367fe;
white-space: nowrap;
}
.btn-list a i {
margin: 0 0.12rem;
font-size: 0.4rem;
}
.times {
margin: 0 0.2rem;
}
.van-overlay {
z-index: 999;
}
.popcont {
position: absolute;
z-index: 100;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 5% 3% 0;
width: 70%;
height: 4rem;
background: linear-gradient(to bottom, #d6e7f9, #fff);
border-radius: 0.35rem;
}
.poptip {
margin: 0.3rem;
min-height: 1.25rem;
font-size: 0.4rem;
font-weight: 600;
text-align: center;
//border-bottom: 1px solid #eee;
}
.popup-btn {
display: flex;
align-items: center;
justify-content: space-between;
margin: 2% auto 0;
width: 90%;
height: 1.5rem;
}
.popup-btn a {
width: 45%;
color: #333;
font-size: 0.37rem;
line-height: 2.5;
text-align: center;
border: 1px solid #ddd;
border-radius: 1rem;
}
.popup-btn a:last-child {
background-color: #1367fe;
color: #fff;
border-color: #1367fe;
}
.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>