Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/api/enforce.js
master
蟑螂恶霸 3 years ago
parent
commit
58d8808753
  1. 3
      package.json
  2. 21
      src/api/enforce.js
  3. 8
      src/api/enterprise.js
  4. BIN
      src/assets/images/bg_c.jpg
  5. BIN
      src/assets/images/item_checkc.png
  6. BIN
      src/assets/images/item_count.png
  7. BIN
      src/assets/images/item_scan.png
  8. BIN
      src/assets/images/scan.png
  9. 4
      src/components/footer-enforcement-nav/index.vue
  10. 52
      src/router/enforceHome.js
  11. 7
      src/router/home.js
  12. 2
      src/views/Home.vue
  13. 375
      src/views/enforce/enforcementPlan.vue
  14. 332
      src/views/enforce/enforcementPlanAdd.vue
  15. 119
      src/views/enforce/scanPage.vue
  16. 256
      src/views/enforce/scanQrCode.vue
  17. 209
      src/views/enforceHome.vue
  18. 54
      src/views/enterprise/enterpriseInspectionList.vue
  19. 8
      src/views/enterprise/registrationList.vue
  20. 2
      src/views/login.vue

3
package.json

@ -15,6 +15,7 @@
"docs:preview": "vitepress preview docs"
},
"dependencies": {
"@zxing/library": "^0.20.0",
"axios": "^1.6.7",
"core-js": "^3.36.0",
"jsonp": "^0.2.1",
@ -22,10 +23,12 @@
"mitt": "^3.0.1",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1",
"sass": "^1.71.1",
"vant": "^4.8.5",
"vue": "^3.4.21",
"vue-dompurify-html": "^5.0.1",
"vue-i18n": "^9.9.1",
"vue-qrcode-reader": "^5.5.3",
"vue-router": "^4.3.0"
},
"devDependencies": {

21
src/api/enforce.js

@ -1,5 +1,26 @@
/**
* 执法端接口
*/
import { _get, _post,_form,_delete } from "../http/index";
/**
* 执法计划列表
* @param {*} params
* @param {*} success
* @param {*} error
* @returns
*/
export const queryEnforcementInspectionProgramList = (params, success, error) => _get("/code/enforcementInspectionProgram/queryList", params, success, error);
/**
* 添加年度执法计划
* @param {*} params
* @param {*} success
* @param {*} error
* @returns
*/
export const addEnforcementInspectionProgram = (params, success, error) =>_post("/code/enforcementInspectionProgram/add", params, success, error)
//保存执法信息登记
export const addEnforcementRegistration = (params, success, error) => _post("/code/registration/add",params,success,error)

8
src/api/enterprise.js

@ -12,4 +12,12 @@ export const queryRegistrationList = (params, success, error) => _get("/code/reg
//保存在线投诉
export const addEnterpriseComplaint = (params, success, error) => _post("/code/complaint/add",params,success,error)
/**
* 查询企业行政执法通知记录
* @param {*} params
* @param {*} success
* @param {*} error
* @returns
*/
export const queryEnforcementList = (params, success, error) => _get("/code/enforcement/queryList",params,success,error)

BIN
src/assets/images/bg_c.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

BIN
src/assets/images/item_checkc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
src/assets/images/item_count.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
src/assets/images/item_scan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

BIN
src/assets/images/scan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

4
src/components/footer-enforcement-nav/index.vue

@ -1,7 +1,7 @@
<template>
<div class="footer_nav">
<van-tabbar class="footer-bar" v-model="data.footerActive" :route="true" safe-area-inset-bottom>
<van-tabbar-item name="Home" replace icon="wap-home-o" to="/home">{{
<van-tabbar-item name="Home" replace icon="wap-home-o" to="/enforceHome">{{
$t("common.lang_home")
}}</van-tabbar-item>
<van-tabbar-item name="Classify" replace icon="shop-o" to="/classify">
@ -20,7 +20,7 @@
name="Shop"
replace
icon="cart-o"
to="/shop"
to="/enforce/enforcementPlan"
:dot="data.dot"
:badge="goodsNum"
>计划</van-tabbar-item

52
src/router/enforceHome.js

@ -0,0 +1,52 @@
/**
* 执法端页面
*/
const routes = [
//执法端首页
{
path: "/enforceHome",
name: "enforceHome",
component: () => import("@/views/enforceHome.vue"),
meta: {
isKeepAlive: true,
},
},
//执法端扫码入企页面
{
path: "/enforce/scanQrCode",
name: "scanQrCode",
component: () => import("@/views/enforce/scanQrCode.vue"),
meta: {
isKeepAlive: true,
},
},
//执法端扫码页面
{
path: "/enforce/scanPage",
name: "scanPage",
component: () => import("@/views/enforce/scanPage.vue"),
meta: {
isKeepAlive: true,
},
},
//公布执法计划页面
{
path: "/enforce/enforcementPlan",
name: "enforcementPlan",
component: () => import("@/views/enforce/enforcementPlan.vue"),
meta: {
isKeepAlive: true,
},
},
//新增公布执法计划
{
path: "/enforce/enforcementPlanAdd",
name: "enforcementPlanAdd",
component: () => import("@/views/enforce/enforcementPlanAdd.vue"),
meta: {
isKeepAlive: true,
},
},
]
export {routes}

7
src/router/home.js

@ -7,7 +7,8 @@ const routes = [
component: login,
meta: {},
},
{
//企业端首页
{
path: "/home",
name: "Home",
component: Home,
@ -48,10 +49,10 @@ const routes = [
name: "complaint",
component: () => import("@/views/enterprise/complaint.vue"),
},
// 在线投诉
// 执法列表
{
path: "/enterprise/enterpriseInspectionList",
name: "complaint",
name: "enterpriseInspectionList",
component: () => import("@/views/enterprise/enterpriseInspectionList.vue"),
},
];

2
src/views/Home.vue

@ -139,7 +139,7 @@ onMounted(() => {
background-color: #f4f4f4;
.warp_body {
background: url("../assets/images/bg_el.jpg");
background: url("../assets/images/bg_c.jpg");
background-size: cover;
position: relative;
.carousel_box {

375
src/views/enforce/enforcementPlan.vue

@ -0,0 +1,375 @@
<template>
<div class="shop app_content">
<!-- 导航栏 -->
<div class="header_body">
<header-nav
:slefBack="true"
@goBack="goBack"
: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="search-button" @click="searchDateType()" round type="primary" size="mini">全部</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(2)" round type="primary" size="mini">本月</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(3)" round type="primary" size="mini">本季度</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(1)" round type="primary" size="mini">本年度</van-button>
<van-button plain hairline class="search-button" @click="searchComplaint(1)" round type="primary" size="mini">投诉</van-button>
</div> -->
<div class="search-button-date">
<span class="date-select" @click="selectDate">{{ data.dateSearch }}</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" :classMap="classMap" @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">
<van-swipe-cell class="swipe_cell">
<div class="card_box">
<div class="card_box_span">
<p>发布时间{{ item.createTime }} <span class="card_box_action">
<van-button @click="toComplaintView(item.id,item.lawEnforcementIncident)" type="primary" size="mini">投诉</van-button>
</span></p>
</div>
<!-- <van-divider :style="{ color: '#1989fa', borderColor: '#1989fa',padding: '0 5px' }" /> -->
<div style="border-color: aqua; border: 2px;" class="van-hairline--bottom"></div>
<div class="card_box_span">
<p style="font-size: 16px;font-weight: bold;">{{ item.planName }}</p>
</div>
<div class="card_box_span">
<p><span class="card_box_label">执法区域</span> {{ item.enforcementArea }}</p>
</div>
<div class="card_box_span">
<p><span class="card_box_label">执法部门</span> {{ item.enforcementDepartment }}</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";
const { useCommon, useShopCard } = $globalStore;
const router = useRouter();
let allchecked = ref(false); //
let refreshLoad = ref(false); //
let value = ref('')
let totalPrice = ref(0); //
let searchParam = reactive({
//
searchText: ref(''),
//
searchDate: 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'],
});
//
onMounted(() => {
console.log(useCommon.enterpriseNumber);
// getCard();
searchParam.enterpriseNumber = useCommon.enterpriseNumber;
console.log(useCommon.enterpriseNumber)
queryList();
data.dateSearch = nowDate(new Date());
});
const queryList = () =>{
queryEnforcementInspectionProgramList(searchParam,success =>{
console.log(success)
data.dataList = success.data;
},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 toComplaintView = (id,name) =>{
console.log(id,name)
router.push(
{
path: "/enterprise/complaint",
query: {
id: id,
lawEnforcementIncident: name
}
});
}
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();
};
//
const onLoad = () => {
freshMap.listFinished = true;
getGoodslist(true);
};
//
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.showDatePicker = true;
console.log(data.showDatePicker)
}
const onDateConfirm = (value)=> {
console.log(value);
value.selectedValues.forEach((item,index) => {
console.log(item);
});
data.dateSearch = value.selectedValues[0] + "/" + value.selectedValues[1]
data.showDatePicker = false;
}
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) =>{
searchParam.dateType = val;
searchParam.isComplaint = null;
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;
background-color: #f4f4f4;
.header_body {
height: 50px;
}
.shop-center {
flex: 1;
overflow-y: scroll;
position: relative;
.goods_box {
display: flex;
background-color: #fff;
margin: 6px;
border-radius: 10px;
.swipe_cell {
width: 100%;
}
.card_box {
display: flex;
width: 100%;
padding: 10px,0px;
flex-direction: column;
.card_body {
background-color: #fff;
border-radius: 10px;
flex: 1;
}
.card_box_span{
font-size: 13px;
padding-left: 5%;
height: 35px;
align-items: center;
display: flex;
align-items: center;
}
.card_box_action{
position: absolute;
right: 4%;
}
}
}
}
.shop_footer_body {
height: 101px;
position: relative;
.footer-one-btn {
height: 50px;
bottom: 51px;
}
}
}
.search-button-list{
height: 3%;
display: flex;
flex-direction: row;
padding-left: 10px;
margin-top: 6px;
align-items: end;
.search-button{
width: 15%;
height: 80%;
}
}
.search-button-date{
height: 3%;
display: flex;
flex-direction: row;
padding-left: 10px;
margin-top: 15px;
align-items: end;
position: relative;
.date-select{
font-size: 20px;
margin-left: 2%;
}
.search-button{
width: 15%;
height: 80%;
position: absolute;
top: 1%;
right: 1%;
}
}
</style>

332
src/views/enforce/enforcementPlanAdd.vue

@ -0,0 +1,332 @@
<template>
<div class="address_edit">
<!-- 导航栏 -->
<div class="header_body">
<header-nav
:slefBack="true"
@goBack="goBack"
:titelText="`执法检查计划`"
>
</header-nav>
</div>
<!-- 中间 -->
<div class="warp_body">
<van-cell-group>
<van-field
v-model="submitData.planYear"
required
label="计划年度"
placeholder="必填"
readonly
:rules="[{ required: true, message: '请选择年度计划' }]"
@click="selectDate"
/>
<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>
<van-field
v-model="submitData.planName"
label="计划名称"
placeholder="请输入"
required
:rules="[{ required: true, message: '请输入计划名称' }]"
/>
<van-field
v-model="submitData.enforcementDepartment"
label="执法部门"
placeholder="请选择"
@click=""
required
:rules="[{ required: true, message: '请选择执法部门'}]"
/>
<van-field
v-model="submitData.enforcementTime"
label="执法时间"
placeholder="请选择"
clickable
is-link
readonly
required
:rules="[{ required: true, message: '请选择执法时间'}]"
@click="selectEnforcementTime"
/>
<van-popup v-model:show="data.showPicker" position="bottom">
<van-date-picker
title="选择日期"
v-model="data.currentDate1"
:min-date="data.minDate"
:max-date="data.maxDate"
:columns-type="data.columnsTypes"
@confirm="onEnforcementTimeConfirm"
@cancel="cancelEnforcementTime"
/>
</van-popup>
<van-field
v-model="submitData.enforcementArea"
label="执法区域"
placeholder="请输入"
required
:rules="[{ required: true, message: '请输入执法区域'}]"
/>
<div class="file-upload">
<div class="file-upload-center">
文件上传 <span>(不多于9张)</span>
</div>
<van-uploader v-model="submitData.fileListObj" class="file" :after-read="uploadFiles" multiple @oversize="onOversize" :before-delete="deleteFile" accept="file">
<template #preview-cover="{ file }">
<div class="preview-cover van-ellipsis">{{ file.name }}</div>
</template>
</van-uploader>
</div>
</van-cell-group>
<van-action-bar>
<van-action-bar-button color="#be99ff" text="保存" @click="submit" />
</van-action-bar>
</div>
</div>
</template>
<script setup name="register">
import { showSuccessToast,showLoadingToast,closeToast } from 'vant';
import {addEnforcementInspectionProgram} from '@/api/enforce'
import {getDict} from '../../api/Home'
import {uploadFile} from '../../util/fileUpload'
import { reactive, ref } from "vue";
const { useMy } = $globalStore
const router = useRouter();
const route = useRoute();
let queryaddressId = ref("");
const data = reactive({
searchResult: [],
showPicker: false,
columns: [],
selectTypeValue : ref[0],
showDatePicker: ref(false),
columnsType :['year'],
columnsTypes :['year','month','day'],
currentDate: ref(['2024']),
minDate: new Date(2020, 0, 1),
maxDate: new Date(2125, 5, 1),
currentDate1: ref(['2024','03','01']),
});
//
const submitData = reactive({
//ID
relId:"",
//
planYear:"",
//
planName:"",
//
enforcementDepartment:"",
//ID
enforcementDepartmentId:"",
//
enforcementTime:"",
//
enforcementArea:"",
//
fileList:[],
//vant
fileListObj:[],
})
//
const goBack = () => {
router.go(-1);
};
const submit = () =>{
// console.log(submitData);
showSuccessToast('保存成功');
addEnforcementInspectionProgram(submitData,success =>{
console.log(success)
//
if(success.success){
console.log("保存成功");
showSuccessToast('保存成功');
goBack();
}
},error=>{
console.log("保存失败")
})
}
//
// const toast = showLoadingToast({
// duration: 0,
// forbidClick: true,
// message: '',
// });
// let second = 3;
// const timer = setInterval(() => {
// second--;
// if (second) {
// } else {
// clearInterval(timer);
// closeToast();
// }
// }, 1000);
//
const onSave = () => {
router.replace({ name: "addressList" });
};
const onConfirm = (value)=> {
data.showPicker = false;
console.log(value)
submitData.enforceType = value.selectedValues[0];
submitData.enforceTypeText = value.selectedOptions[0].text;
}
const selectType = () =>{
data.showPicker = true;
// console.log(data)
}
const uploadFiles = (file) =>{
uploadFile(file,(res) =>{
console.log(file.fileName);
submitData.fileList.push({
fileUrl:res.url,
fileName: file.file.name
})
console.log(submitData.fileList);
});
}
const deleteFile = (file,index) =>{
console.log(index);
submitData.fileListObj.filter((item, indexs) => {
if (index.index == indexs) {
submitData.fileListObj.splice(indexs, 1);//splice
}
});
submitData.fileList.filter((item, indexs) => {
if (index.index == indexs) {
submitData.fileList.splice(indexs, 1);//splice
}
});
console.log(submitData.fileList);
return true;
}
onMounted(() => {
console.log(route?.query?.id);
console.log(route?.query?.lawEnforcementIncident);
submitData.relId = route?.query?.id;
submitData.lawEnforcementIncident = route?.query?.lawEnforcementIncident;
getDict({"dictType": "caseType"},success =>{
console.log(success);
success.data.forEach(res =>{
console.log(res)
var obj = { text: res.dictLabel, value: res.dictValue };
data.columns.push(obj)
})
},error =>{
})
});
const selectDate = () =>{
data.showDatePicker = true;
console.log(data.showDatePicker)
}
const onDateConfirm = (value)=> {
console.log(value);
value.selectedValues.forEach((item,index) => {
console.log(item);
submitData.planYear = item;
});
// submitData.establishmentTime = "2023-04-21"
data.showDatePicker = false;
}
//
const cancelSelectDate = () =>{
data.showDatePicker = false;
}
//
const cancelEnforcementTime = () =>{
data.showPicker = false;
}
const selectEnforcementTime = () =>{
data.showPicker = true;
}
const onEnforcementTimeConfirm = (value)=> {
console.log(value);
value.selectedValues.forEach((item,index) => {
console.log(item);
});
submitData.enforcementTime = value.selectedValues[0] + "-" + value.selectedValues[1] + "-" + value.selectedValues[2] + " 00:00:00";
data.showPicker = false;
}
</script>
<style lang="less" scoped>
.address_edit {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
background-color: #f4f4f4;
}
/* vant4的 Toast 和 Popup 样式冲突,会导致 Toast 变成白底 */
.van-popup.van-toast{
background: var(--van-toast-background) !important;
box-sizing: content-box !important;
/* 下面3条css,影响不大 */
transition: all var(--van-duration-fast) !important;
width: var(--van-toast-default-width) !important;
max-width: var(--van-toast-max-width) !important;
}
.van-popup.van-toast .van-toast__icon{
font-size: var(--van-toast-icon-size) !important;
}
.file-upload{
height: 165px;
position: relative;
}
.file-upload-center{
position: absolute;
height: 20%;
top: 10%;
left: 2%;
font-size: 18px;
span {
font-size: 13px;
color: rgb(221, 229, 227);
}
}
.file{
position: absolute;
bottom: 10%;
left: 2%;
}
.preview-cover {
position: absolute;
bottom: 0;
box-sizing: border-box;
width: 100%;
padding: 4px;
color: #fff;
font-size: 12px;
text-align: center;
background: rgba(0, 0, 0, 0.3);
}
</style>

119
src/views/enforce/scanPage.vue

@ -0,0 +1,119 @@
<template>
<div class="scan-page">
<!-- 返回导航栏 -->
<!-- left-text="取消" -->
<van-nav-bar title="扫描二维码/条形码" left-arrow
fixed class="scan-index-bar" @click-left="clickIndexLeft()"
></van-nav-bar>
<!-- 扫码区域 -->
<video ref="video" id="video" class="scan-video" autoplay></video>
<!-- 提示语 -->
<div v-show="tipShow" class="scan-tip">{{ tipMsg }}</div>
</div>
</template>
<script>
import { BrowserMultiFormatReader } from '@zxing/library';
import { Toast, Dialog, Notify } from 'vant';
export default {
name: 'ScanCodePage', //
data() {
return {
codeReader: null,
tipShow: false, //
tipMsg: '', //
scanText: '', //
}
},
created() {
this.openScan();
},
watch: {
'$route'(to, from) {
if(to.path == '/ScanCodePage'){ //
this.openScan();
}
}
},
destroyed(){
this.codeReader.reset();
this.codeReader = null;
},
methods: {
async openScan() { //
this.codeReader = await new BrowserMultiFormatReader();
this.codeReader.getVideoInputDevices().then(videoDevices => {
this.tipMsg = '正在调用摄像头...';
this.tipShow = true;
console.log('get-videoDevices', videoDevices);
// id
let firstDeviceId = videoDevices[videoDevices.length - 1].deviceId;
//
if (videoDevices.length > 1) {
// label 'camera2 0, facing back' 'back' '0'
firstDeviceId = videoDevices.find(el => { return el.label.indexOf('back') > -1 && el.label.indexOf('0') > -1 }) ?
videoDevices.find(el => { return el.label.indexOf('back') > -1 && el.label.indexOf('0') > -1 }).deviceId :
videoDevices[videoDevices.length - 1].deviceId;
}
console.log('get-firstDeviceId', firstDeviceId);
this.decodeFromInputVideoFunc(firstDeviceId);
}).catch(err => {
this.tipShow = false;
console.error(err);
});
},
decodeFromInputVideoFunc(firstDeviceId) { // 使
this.codeReader.reset(); //
this.codeReader.decodeFromInputVideoDeviceContinuously(firstDeviceId, 'video', (result, err) => {
this.tipMsg = '正在尝试识别...';
if (result) {
console.log('扫码结果', result);
this.scanText = result.text;
if (this.scanText) {
this.tipShow = false;
Dialog.confirm({ //
title: '扫码结果',
message: this.scanText,
}).then(() => { //
}).catch(() => { //
});
}
}
});
},
clickIndexLeft(){ //
// this.$destroy();
this.$router.go(-1);
// window.location.href = document.referrer;
}
}
}
</script>
<style lang="scss">
.scan-index-bar{
background-image: linear-gradient( -45deg, #42a5ff ,#59cfff);
.van-nav-bar__title, .van-nav-bar__arrow, .van-nav-bar__text{
color: #fff !important;
}
}
.scan-page{
min-height: 100vh;
background-color: #363636;
overflow-y: hidden;
.scan-video{
height: 85vh;
}
.scan-tip{
width: 100vw;
text-align: center;
color: white;
font-size: 5vw;
}
}
</style>

256
src/views/enforce/scanQrCode.vue

@ -0,0 +1,256 @@
<template>
<div class="home app_content">
<!-- 导航栏 -->
<div class="header_body">
<!-- <header-nav :leftArrow="false" titelText="扫码入企"></header-nav> -->
<header-nav
:slefBack="true"
@goBack="goBack"
:titelText="`扫码入企`"
>
</header-nav>
</div>
<!-- 中间 -->
<div class="warp_body">
<!-- <refresh-list v-model:freshMap="freshMap" @refresh="onRefresh" @onLoad="onLoad"> -->
<div class="carousel_box">
<div class="box-scan-one">
<span class="box-scan-text">扫一扫企业二维码</span>
</div>
<div class="box-scan-two">
<span class="box-scan-text">即可查看企业信息</span>
</div>
</div>
<div class="boutique_box">
<!-- <van-cell :border="false" title="精品" /> -->
<div class="boutique_body">
<!-- <goodsCard :goodsList="boutique" :cardAttr="boutiqueAttr"></goodsCard> -->
<div class="box-qr-code" @click="toScanPageView">
<img src="../../assets/images/scan.png" />
<span class="box-qr-code-text">执法监督码</span>
</div>
</div>
</div>
<!-- <div class="recommend_box">
<van-cell :border="false" title="推荐" />
<div class="recommend_body">
<goodsCard :goodsList="recommend"></goodsCard>
</div>
</div> -->
<!-- </refresh-list> -->
</div>
<!-- 底部 -->
<!-- <div class="footer_body">
<footer-nav></footer-nav>
</div> -->
</div>
</template>
<script setup name="Home">
import {getEnterpriseMerchantAuthorization} from '@/api/Home';
const { useCommon } = $globalStore;
const router = useRouter();
let carouselList = reactive([]); //
let boutique = reactive([]); //
let recommend = reactive([]); //
let freshMap = reactive({
refreshLoad: false, //
listLoading: false, //
listFinished: false, //
});
const data = reactive({});
const boutiqueAttr = reactive({
columnNum: 4,
itemClass: "boutique_item",
goodsCradclass: "boutique-crad",
}); //
//
const getCarousel = async () => {
// const res = await useHome.getCarousel();
// if (res?.code === 20000) {
// carouselList = res?.data;
// }
};
//
const boutiqueGoods = async () => {
// const res = await useHome.boutiqueGoods();
// if (res?.code === 20000) {
// boutique = res?.data;
// }
};
const toScanPageView = async() =>{
router.push({
path: "/enforce/scanPage",
query: {}
});
};
const toRegistrationListView = async() =>{
router.push({
path: "/enterprise/registrationList",
});
}
const toComplaintView = async() =>{
router.push({
path: "/enterprise/complaint",
});
}
//
const onRefresh = () => {
freshMap.listFinished = false;
freshMap.listLoading = true;
freshMap.refreshLoad = true;
// Promise.all([getCarousel(), boutiqueGoods(), recommendGoods()]).then(() => {
// freshMap.refreshLoad = false;
// });
};
//
const onLoad = () => {
// recommendGoods(true);
};
onMounted(() => {
getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber},success =>{
if(!(success.data == null && success.data.length == 0)){
useCommon.SET_USER_ENTERPRISE_NUMBER(success.data[0].enterpriseNumber);
}
},error =>{
})
})
//
const goBack = () => {
router.go(-1);
};
</script>
<style lang="less" scoped>
.home {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
background-color: #f4f4f4;
.warp_body {
background-color: rgb(163, 156, 156);
background-size: cover;
position: relative;
.carousel_box {
height: 150px;
width: 100%;
padding-bottom: 10px;
position: relative;
.box-scan-one{
position: absolute;
top: 30%;
left: 15%;
font-size: 14px;
background-color: beige;
height: 100px;
width: 30%;
.box-scan-text{
margin-top: 70%;
display: block;
font-size: 12px;
width: 100%;
text-align: center
}
}
.box-scan-two{
position: absolute;
top: 30%;
right: 15%;
font-size: 14px;
background-color: beige;
height: 100px;
width: 30%;
.box-scan-text{
margin-top: 70%;
display: block;
font-size: 12px;
width: 100%;
text-align: center
}
}
}
}
.boutique_box {
position: absolute;
width: 100%;
bottom: 30%;
.boutique_body {
padding: 0px 0px 10px 0px;
display: flex;
justify-content: center;
};
.box-qr-code{
width: 47%;
text-align: right;
height: 4.66667rem;
background-color: var(--van-primary-color);
border-radius: 0.26667rem;
// background-size: cover;
border-radius: 50%;
// background-image: url("@/assets/images/scan.png");
.box-qr-code-text{
margin-right: 25%;
margin-top: 70%;
display: block;
font-size: 0.45333rem;
}
img{
position: absolute;
top: 0%;
left: 34%;
}
}
.box-info{
width: 52%;
text-align: right;
height: 3.66667rem;
background-color: #ff976a;
border-radius: 10px;
background: url("@/assets/images/item_check.png");
background-size: cover;
.box-info-text{
margin-right: 3%;
margin-top: 2%;
display: block;
font-size: 17px
}
}
.box-complaint{
width: 36%;
text-align: right;
height: 3.66667rem;
background-color: #ff976a;
border-radius: 10px;
margin-left: 2%;
background: url("@/assets/images/item_complain.png");
background-size: cover;
.box-complaint-text{
margin-right: 5%;
margin-top: 3%;
display: block;
font-size: 17px
}
}
}
.recommend_box {
.recommend_body {
width: 100%;
}
}
}
</style>

209
src/views/enforceHome.vue

@ -0,0 +1,209 @@
<template>
<div class="home app_content">
<!-- 导航栏 -->
<div class="header_body">
<header-nav :leftArrow="false" titelText="首页"></header-nav>
</div>
<!-- 中间 -->
<div class="warp_body">
<!-- <refresh-list v-model:freshMap="freshMap" @refresh="onRefresh" @onLoad="onLoad"> -->
<div class="carousel_box" @onLoad="onLoad">
<carousel-card v-if="carouselList.length" v-model:carouselList="carouselList"></carousel-card>
</div>
<div class="boutique_box">
<!-- <van-cell :border="false" title="精品" /> -->
<div class="boutique_body">
<!-- <goodsCard :goodsList="boutique" :cardAttr="boutiqueAttr"></goodsCard> -->
<div class="box-qr-code" @click="toScanCodeView">
<span class="box-qr-code-text">扫码入企</span>
</div>
</div>
<div class="boutique_body">
<!-- <goodsCard :goodsList="boutique" :cardAttr="boutiqueAttr"></goodsCard> -->
<div class="box-info" @click="toRegistrationListView">
<span class="box-info-text" >历史检查信息</span>
</div>
<div class="box-complaint" @click="toComplaintView">
<span class="box-complaint-text">统计分析</span>
</div>
</div>
</div>
<!-- <div class="recommend_box">
<van-cell :border="false" title="推荐" />
<div class="recommend_body">
<goodsCard :goodsList="recommend"></goodsCard>
</div>
</div> -->
<!-- </refresh-list> -->
</div>
<!-- 底部 -->
<div class="footer_body">
<footer-enforcement-nav></footer-enforcement-nav>
</div>
</div>
</template>
<script setup name="Home">
import {getEnterpriseMerchantAuthorization} from '../api/Home';
const { useCommon } = $globalStore;
const router = useRouter();
let carouselList = reactive([]); //
let boutique = reactive([]); //
let recommend = reactive([]); //
let freshMap = reactive({
refreshLoad: false, //
listLoading: false, //
listFinished: false, //
});
const data = reactive({});
const boutiqueAttr = reactive({
columnNum: 4,
itemClass: "boutique_item",
goodsCradclass: "boutique-crad",
}); //
//
const getCarousel = async () => {
// const res = await useHome.getCarousel();
// if (res?.code === 20000) {
// carouselList = res?.data;
// }
};
//
const boutiqueGoods = async () => {
// const res = await useHome.boutiqueGoods();
// if (res?.code === 20000) {
// boutique = res?.data;
// }
};
/**扫码入企 */
const toScanCodeView = async() =>{
router.push({ path: "/enforce/scanQrCode" });
};
const toRegistrationListView = async() =>{
router.push({
path: "/enterprise/registrationList",
});
}
const toComplaintView = async() =>{
router.push({
path: "/enterprise/complaint",
});
}
//
const onRefresh = () => {
freshMap.listFinished = false;
freshMap.listLoading = true;
freshMap.refreshLoad = true;
// Promise.all([getCarousel(), boutiqueGoods(), recommendGoods()]).then(() => {
// freshMap.refreshLoad = false;
// });
};
//
const onLoad = () => {
// recommendGoods(true);
};
onMounted(() => {
getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber},success =>{
if(!(success.data == null && success.data.length == 0)){
useCommon.SET_USER_ENTERPRISE_NUMBER(success.data[0].enterpriseNumber);
}
},error =>{
})
});
</script>
<style lang="less" scoped>
.home {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
background-color: #f4f4f4;
.warp_body {
background: url("../assets/images/bg_el.jpg");
background-size: cover;
position: relative;
.carousel_box {
height: 150px;
width: 100%;
padding-bottom: 10px;
}
}
.boutique_box {
position: absolute;
width: 100%;
bottom: 3%;
.boutique_body {
padding: 0px 0px 10px 0px;
display: flex;
justify-content: center;
};
.box-qr-code{
width: 90%;
text-align: right;
height: 3.66667rem;
background-color: #ff976a;
border-radius: 10px;
background: url("../assets/images/item_scan.png");
background-size: cover;
.box-qr-code-text{
margin-right: 3%;
margin-top: 2%;
display: block;
font-size: 17px
}
}
.box-info{
width: 52%;
text-align: right;
height: 3.66667rem;
background-color: #ff976a;
border-radius: 10px;
background: url("../assets/images/item_checkc.png");
background-size: cover;
.box-info-text{
margin-right: 3%;
margin-top: 2%;
display: block;
font-size: 17px
}
}
.box-complaint{
width: 36%;
text-align: right;
height: 3.66667rem;
background-color: #ff976a;
border-radius: 10px;
margin-left: 2%;
background: url("../assets/images/item_count.png");
background-size: cover;
.box-complaint-text{
margin-right: 5%;
margin-top: 3%;
display: block;
font-size: 17px
}
}
}
.recommend_box {
.recommend_body {
width: 100%;
}
}
}
</style>

54
src/views/enterprise/enterpriseInspectionList.vue

@ -3,12 +3,7 @@
<div class="shop app_content">
<!-- 导航栏 -->
<div class="header_body">
<header-nav
:slefBack="true"
@goBack="goBack"
:titelText="`行政检查通知`"
>
</header-nav>
<header-nav :leftArrow="false" titelText="行政检查通知"></header-nav>
</div>
<van-search
v-model="searchParam.searchText"
@ -20,11 +15,25 @@
<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="search-button" @click="searchDateType()" round type="primary" size="mini">全部</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(1)" round type="primary" size="mini">本年</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(2)" round type="primary" size="mini">本月</van-button>
<van-button plain hairline class="search-button" @click="searchComplaint(1)" round type="primary" size="mini">投诉</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(1)" round type="primary" size="mini">本月</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(2)" round type="primary" size="mini">本季度</van-button>
<van-button plain hairline class="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>
</div>
<div class="search-button-date">
<span class="date-select" @click="selectDate">{{ data.dateSearch }}</span>
@ -60,17 +69,17 @@
<!-- <van-divider :style="{ color: '#1989fa', borderColor: '#1989fa',padding: '0 5px' }" /> -->
<div style="border-color: aqua; border: 2px;" class="van-hairline--bottom"></div>
<div class="card_box_span">
<p style="font-size: 16px;font-weight: bold;">{{ item.lawEnforcementIncident }}</p>
<p style="font-size: 16px;font-weight: bold;">{{ item.lawEnforcementItem }}</p>
</div>
<div class="card_box_span">
<p><span class="card_box_label">登记编号</span> {{ item.lawEnforcement }}</p>
<p><span class="card_box_label">登记编号</span> {{ item.lawEnforcementCode }}</p>
</div>
<div class="card_box_span">
<p><span class="card_box_label">执法部门</span> {{ item.lawEnforcer }}</p>
<p><span class="card_box_label">执法部门</span> {{ item.lawEnforcement }}</p>
</div>
<div class="card_box_span">
<p><span class="card_box_label">企业名称</span> {{ item.remark }}</p>
<p><span class="card_box_label">企业名称</span> {{ item.enterpriseName }}</p>
</div>
</div>
</van-swipe-cell>
@ -90,7 +99,7 @@
<script setup name="registrationList">
import { showToast } from "vant";
import {queryRegistrationList} from '../../api/enterprise';
import {queryEnforcementList} from '../../api/enterprise';
import { setGoodsNum } from "@/util/util";
const { useCommon, useShopCard } = $globalStore;
@ -113,6 +122,11 @@ let searchParam = reactive({
isComplaint: null,
//
enterpriseNumber: ref(useCommon.enterpriseNumber),
//
searchDate:null,
beginTime:"",
endTime:""
});
const data = reactive({
@ -124,6 +138,7 @@ const data = reactive({
minDate: new Date(2020, 0, 1),
maxDate: new Date(2125, 5, 1),
columnsType :['year', 'month'],
showTop:false,
});
//
@ -136,7 +151,7 @@ onMounted(() => {
data.dateSearch = nowDate(new Date());
});
const queryList = () =>{
queryRegistrationList(searchParam,success =>{
queryEnforcementList(searchParam,success =>{
console.log(success)
data.dataList = success.data;
},error =>{
@ -248,8 +263,11 @@ const onDateConfirm = (value)=> {
value.selectedValues.forEach((item,index) => {
console.log(item);
});
data.dateSearch = value.selectedValues[0] + "/" + value.selectedValues[1]
data.dateSearch = value.selectedValues[0] + "/" + value.selectedValues[1];
searchParam.searchDate = value.selectedValues[0] + "-" + value.selectedValues[1];
data.showDatePicker = false;
//
queryList();
}
const nowDate = (time) => {
var year = time.getFullYear(); //
@ -269,6 +287,10 @@ const searchDateType = (val) =>{
searchParam.isComplaint = null;
queryList();
}
const searchFilter = () =>{
data.showTop = true;
queryList();
}
const searchComplaint = (val) =>{
searchParam.isComplaint = val;
searchParam.dateType = null;

8
src/views/enterprise/registrationList.vue

@ -6,14 +6,14 @@
<header-nav
:slefBack="true"
@goBack="goBack"
:titelText="`执法信息`"
:titelText="`历史检查信息`"
>
</header-nav>
</div>
<van-search
v-model="searchParam.searchText"
show-action
placeholder="请输入执法人员/执法部门"
placeholder="请输入关键字查询"
@search="onSearch"
>
<template #action>
@ -22,8 +22,9 @@
</van-search>
<div class="search-button-list">
<van-button plain hairline class="search-button" @click="searchDateType()" round type="primary" size="mini">全部</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(1)" round type="primary" size="mini">本年</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(2)" round type="primary" size="mini">本月</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(3)" round type="primary" size="mini">本季度</van-button>
<van-button plain hairline class="search-button" @click="searchDateType(1)" round type="primary" size="mini">本年度</van-button>
<van-button plain hairline class="search-button" @click="searchComplaint(1)" round type="primary" size="mini">投诉</van-button>
</div>
<div class="search-button-date">
@ -89,7 +90,6 @@
</template>
<script setup name="registrationList">
import { showToast } from "vant";
import {queryRegistrationList} from '../../api/enterprise';
import { setGoodsNum } from "@/util/util";
const { useCommon, useShopCard } = $globalStore;

2
src/views/login.vue

@ -38,7 +38,7 @@ const onSubmit = async (values) => {
// await getGoodsnum();
// await getLang();
userLogin(values,success=>{
router.push({ name: "Home" });
router.push({ name: "enforceHome" });
//
console.log(success.data)
//

Loading…
Cancel
Save