Browse Source

联合检查, 通知附件

v4
蟑螂恶霸 1 year ago
parent
commit
986d0f30bb
  1. 317
      src/views/enforce/enforceNoticeDetail.vue
  2. 14
      src/views/enforce/sign.vue
  3. 6
      src/views/enforceHome.vue
  4. 7
      src/views/enterprise/registrationDetail.vue
  5. 55
      src/views/enterprise/registrationEdit.vue

317
src/views/enforce/enforceNoticeDetail.vue

@ -2,72 +2,25 @@
<div class="address_edit">
<div class="warp_body">
<div style="background-color: white; border-radius: 5%;" v-html="data.noticeContent"></div>
<!-- <van-divider class="divdsty"/> -->
<div class="file-upload">
<div class="file-upload-center">
<label>附&nbsp; &nbsp; &nbsp; &nbsp;件</label>
</div>
<div class="zoom">
<div v-for="(ite, index) in data.images" >
<!-- <img alt="预览文件" :src="ite" @click="handleViewPdf(ite)"/>-->
<!-- <van-uploader @click="handleViewPdf(ite)" title="pdf预览" v-model="data.fileList"/>-->
<van-icon @click="handleViewPdf(ite)" name="newspaper-o" title="pdf预览" size="50"></van-icon>{{data.imagesName[index]}}
</div>
<!-- pdf预览 -->
<van-popup v-model:show="pdfOpen" title="'pdf预览'" style="width:80%" >
<div style="min-height: 439px" >
<vue-pdf-embed ref="pdfRef" v-if="!pdfFail" :source="pdfSrc" @rendered="handleDocumentRender" @loading-failed="handlePdfFaid" />
</div>
<a :href="data.pdfSource" class="loadPdf" target="_blank">
<van-button type="primary" icon="Download" plain>下载</van-button>
</a>
<van-button @click="pdfOpen = false" type="primary" class="closePdf">关 闭</van-button>
</van-popup>
<!-- <img-->
<!-- v-for="(ite, index) in data.images"-->
<!-- class="img"-->
<!-- :src="ite"-->
<!-- alt="预览图片"-->
<!-- @click="imagePreview(index)"-->
<!-- :key="index"-->
<!-- />-->
<!-- <van-image-preview-->
<!-- v-model:show="data.show"-->
<!-- :images="data.imageList"-->
<!-- @change="onChange"-->
<!-- ref="imagePre"-->
<!-- >-->
<!-- <template v-slot:index>第{{ indexImg + 1 }}页</template>-->
<!-- </van-image-preview>-->
</div>
<div style="padding: 10px;background-color: white; border-radius: 5%;" v-html="data.noticeContent"></div>
<div v-for="(item, index) in data.fileList" :key="index">
<div class="item-text">
<p><label class="card_box_label">附&nbsp; &nbsp; &nbsp; &nbsp;件:</label> <span> <a @click="toPdfView(null==item?'':item.fileUrl)">{{ null==item?'':item.fileName }}</a></span></p>
</div>
</div>
</div>
</div>
</template>
<script setup name="register">
import VuePdfEmbed from "vue-pdf-embed";
import {showSuccessToast, showImagePreview} from "vant";
import {
queryEnforcementRegistrationById,
getAttr, queryEnforceSystemNoticeDetail,
} from "@/api/enforce";
import {reactive, ref, nextTick} from "vue";
import {uploadFile} from "@/util/fileUpload";
import {queryLinkageById} from "@/api/linkage";
import { queryEnforceSystemNoticeDetail } from "@/api/enforce";
import {reactive, ref} from "vue";
import {baseUrl} from "@/config/env";
//用户筛选弹窗
// import Popup from './userFilter.vue';
const {useMy} = $globalStore;
@ -86,7 +39,7 @@ const data = reactive({
imgstr: "",
lawList: [{text: "", id: ""}],
lawCer: [{text: "", id: ""}],
imageList: [],
fileList: [],
show: ref(false),
show2: ref(false),
dataList: [],
@ -156,161 +109,22 @@ const submitData = reactive({
problem5: 0,
});
const pdfOpen = ref(false);
const isLoading = ref(true);
const pdfSrc = ref('');
const pdfFail = ref(false);
// pdf加载
function handleDocumentRender(val) {
isLoading.value = false;
pdfFail.value = false;
}
// pdf加载失败,或者404
function handlePdfFaid(val) {
isLoading.value = false;
pdfFail.value = true;
console.log('文档加载失败');
}
// 点击 预览
function handleViewPdf(file) {
isLoading.value = true;
pdfOpen.value = true;
// pdfSrc.value = file;
pdfSrc.value = file;
pdfFail.value = false;
}
const tapGood = () => {
data.good = "#7FFFD4";
data.bad = "#D3D3D3";
submitData.reslut = 0;
};
const tapBad = () => {
data.good = "#D3D3D3";
data.bad = "#7FFFD4";
submitData.reslut = 1;
};
const indexImg = ref(0);
const indexImg2 = ref(0);
const imagePreview = (newIndex) => {
var imgstrArr = data.imgstr.split(",");
nextTick(() => {
// console.log(this.$refs.testRef)
// this.$refs.imagePre.change(newIndex)
// const imagePre = ref("imagePre");
// imagePre.change(newIndex);
});
data.show = ref(true);
};
const imagePreview2 = (newIndex) => {
var imgstrArr = data.imgstr.split(",");
nextTick(() => {
// console.log(this.$refs.testRef)
// this.$refs.imagePre.change(newIndex)
// const imagePre = ref("imagePre");
// imagePre.change(newIndex);
});
data.show2 = ref(true);
};
const setLinkageItem = (id) => {
queryLinkageById(
{id: id},
(success) => {
submitData.lawEnforcementItem = success.title;
},
(error) => {
}
);
};
const setLinkageGA = (id) => {
queryLinkageById(
{id: id},
(success) => {
submitData.lawEnforcementBasis = success.title;
},
(error) => {
}
);
};
const setAttr = () => {
// 查询检查要求字典信息
getAttr(
route?.query?.id,
(success) => {
if (success.data.filePreview != null) {
if (success.data.filePreview.fileList != null) {
for (var i = 0; i < success.data.filePreview.fileList.length; i++) {
data.imgstr += success.data.filePreview.fileList[i] + ",";
}
data.imgstr = data.imgstr.substring(0, data.imgstr.length - 1);
}
data.imageList = success.data.filePreview.fileList;
success.data.filePreview.fileList;
for (const key in success.data.filePreview.fileList) {
console.log(success.data.filePreview.fileList[key]);
data.imageList[key] = success.data.filePreview.fileList[key];
}
}
},
(error) => {
}
);
};
const setEvaluateFile = (id) => {
// 查询检查要求字典信息
getAttr(
id,
(success) => {
if (success.data.filePreview != null) {
if (success.data.filePreview.fileList != null) {
for (var i = 0; i < success.data.filePreview.fileList.length; i++) {
data.imgstr += success.data.filePreview.fileList[i] + ",";
}
data.imgstr = data.imgstr.substring(0, data.imgstr.length - 1);
}
data.evaluateImageList = success.data.filePreview.fileList;
success.data.filePreview.fileList;
for (const key in success.data.filePreview.fileList) {
console.log(success.data.filePreview.fileList[key]);
data.evaluateImageList[key] =
baseUrl + success.data.filePreview.fileList[key];
}
}
},
(error) => {
}
);
};
const onChange = (newIndex) => {
indexImg.value = newIndex;
};
const onChange2 = (newIndex) => {
indexImg2.value = newIndex;
};
//3a0096181c184e5aa56f70923680856d$6e74ceda1463c165fd43eeeadce4f7cd
//初始化参数,获取扫码的企业统一信用编码
onMounted(() => {
queryRegUniteById();
});
const showArrays = (item) => {
if (item.downShow) {
item.downShow = false;
data.arrayLength = data.regList.length;
} else {
data.regList[0].downShow = true;
data.arrayLength = 1;
}
};
const toPdfView = (url) => {
console.log(url)
router.push(
{
path: "/pdfView",
query: {
url: url
}
});
}
const queryRegUniteById = () => {
queryEnforceSystemNoticeDetail(
@ -331,6 +145,7 @@ const convertReg = (regs) => {
data.noticeContent = regs.noticeContent;
data.bureauDeptNames = regs.bureauDeptNames;
data.createTime = regs.createTime;
data.fileList = regs.fileObjects;
if (regs.objectType != null) {
if (regs.objectType == 1) {
data.objectType = "监督端";
@ -343,100 +158,8 @@ const convertReg = (regs) => {
}
}
// 附件
getAttr(
data.id,
(success) => {
if (success.data.filePreview != null) {
let images = [];
let imagesName = [];
for (const key in success.data.filePreview.fileList) {
images[key] = baseUrl + success.data.filePreview.fileList[key];
data.imageList.push(
baseUrl + success.data.filePreview.fileList[key]
);
}
for (const key in success.data.filePreview.previewRespDTOS) {
imagesName[key] = success.data.filePreview.previewRespDTOS[key].caption;
}
data.imagesName = imagesName;
data.images = images;
}
console.log(data.imageList);
},
(error) => {
}
);
}
// 返回
const goBack = () => {
router.go(-1);
};
const uploadFiles = (file) => {
uploadFile(file, (res) => {
console.log(res);
submitData.fileList.push(res.url);
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;
};
const submit = () => {
addEnforcementRegistration(
submitData,
(success) => {
//跳转首页
if (success.success) {
showSuccessToast("登记成功");
router.push({path: "/home"});
}
},
(error) => {
console.log("登记失败");
}
);
};
const showPopup = () => {
data.popupVisible = true;
};
const showPopup2 = () => {
data.popupVisible2 = true;
};
const closePopup = () => {
data.popupVisible = false;
data.popupVisible2 = false;
};
const reciveData = (item) => {
submitData.lawEnforcerTwo = item.userName;
submitData.lawEnforcerIdTwo = item.userId;
};
const reciveData2 = (item) => {
submitData.subsidiaryer = item.userName;
submitData.subsidiaryerId = item.userId;
};
</script>
<script>
export default {

14
src/views/enforce/sign.vue

@ -390,14 +390,14 @@
// id
id: "",
//执法部门
lawEnforcement: "联合检查Y",
lawEnforcementId: "405",
bureauDeptId:"405",
bureauDeptName:"联合检查Y",
lawEnforcement: "",
lawEnforcementId: "",
bureauDeptId:"",
bureauDeptName:"",
//执法人员1
lawEnforcer: "联合检查Y",
lawEnforcerId: "1818",
lawCertificateNumText: "联合检查Y",
lawEnforcer: "",
lawEnforcerId: "",
lawCertificateNumText: "",
//执法人员2
lawEnforcerTwo: "",

6
src/views/enforceHome.vue

@ -1,7 +1,7 @@
<template>
<Loading class="loading-div" type="spinner" v-show="isLoading" color="#1989fa"/>
<div class="home app_content" v-if="!isLoading">
<!-- <div class="home app_content">-->
<!-- <Loading class="loading-div" type="spinner" v-show="isLoading" color="#1989fa"/>
<div class="home app_content" v-if="!isLoading"> -->
<div class="home app_content">
<!-- 导航栏 -->
<!-- <div class="header_body">
<header-nav :leftArrow="false" titelText="执法监督码"></header-nav>

7
src/views/enterprise/registrationDetail.vue

@ -20,7 +20,7 @@
<van-divider class="divdsty" />
<div class="zf-name">
执法信息<span class="joint-mark" v-if="data.regList.length > 1"
执法信息<span class="joint-mark" v-if="data.hasUnion"
>联</span
>
</div>
@ -99,7 +99,7 @@
<van-cell center title="委托执法">
<template #right-icon>
<!-- <van-switch disabled v-model="item.hasAuto"/> -->
<van-switch v-model="data.auth_checked"/>
<van-switch v-model="data.auth_checked" disabled/>
</template>
</van-cell>
@ -543,7 +543,7 @@ const data = reactive({
lawList: [],
arrayLength: 1,
allNo: 'circle',
union_checked: '0', // 联合检查选择
hasUnion: false, // 联合检查选择
auth_checked: false, // 委托执法选择
union_datas: [], // 联合检查用的分组list
check_union_no: '', // 选中的联合检查编号
@ -965,6 +965,7 @@ const convertReg = (regs) => {
obj.lawEnforcementItem = dt.lawEnforcementItem;
obj.lawEnforcementItemText = dt.lawEnforcementItemText;
data.auth_checked = dt.hasAuto==0?false:true;
data.hasUnion = dt.hasUnion==0?false:true;
obj.lawEnforcer = nameCorrect(dt.lawEnforcer);
obj.remark = dt.remark;
obj.enforce = dt.enforceReason;

55
src/views/enterprise/registrationEdit.vue

@ -243,7 +243,7 @@
</template>
</van-cell>
<div class="add-inspect" v-if="data.union_checked==1">
<div class="add-inspect" v-show="data.union_checked==1">
<div v-for="(item, index) in data.union_datas" :key="index" ref="radio_fales" @click="check_radio(Object.values(item)[0].unionNo, index)" class="item-inspect">
<van-icon name="checked" />
<div class="dept-inspect">
@ -421,14 +421,14 @@
// id
id:"",
//执法部门
lawEnforcement:"联合执法H",
lawEnforcementId:"405",
bureauDeptId:"405",
bureauDeptName:"联合执法H",
lawEnforcement:"",
lawEnforcementId:"",
bureauDeptId:"",
bureauDeptName:"",
//执法人员1
lawEnforcer:"1818",
lawEnforcerId:"1818",
lawCertificateNumText:"1818",
lawEnforcer:"",
lawEnforcerId:"",
lawCertificateNumText:"",
//执法人员2
@ -690,8 +690,10 @@
// 检查时间
// submitData.enforcementTime = formattedTimeYYYYmmdd(success.data.enforcementTime);
submitData.enforcementTime = success.data.enforcementTime;
submitData.hasUnion = success.data.hasUnion;
data.union_checked = String(success.data.hasUnion);
submitData.hasUnion = success.data.hasUnion; // 真正代表是否联合执法... 和连的标识
// data.union_checked = String(success.data.hasUnion);
submitData.uniteCheck = success.data.uniteCheck; // 单独用来判断是否勾选联合执法
data.union_checked = success.data.uniteCheck;
submitData.hasAuto = success.data.hasAuto;
data.auth_checked = success.data.hasAuto==0?false:true;
submitData.unionNo = success.data.unionNo;
@ -741,7 +743,6 @@
data.lawCer.push({text: tmpEnforceText[i], id: tmpEnforceId[i], show: nameCorrect(lawEnforcer2Show[i])});
}
}
submitData.uniteCheck = success.data.uniteCheck;
// setLinkageItem(submitData.lawEnforcementItem);
// setLinkageGA(submitData.lawEnforcementBasis);
@ -802,7 +803,6 @@
// data.union_datas =
queryUnionByHour(enterpriseNumber, checkCss, enforcementTime, unionNo, success => {
if(success.success) {
console.log('---G: ',success.data)
data.union_datas = success.data;
// 设置被选择
@ -814,14 +814,20 @@
}
const setUnionChecked = (id) => {
for (let index = 0; index < data.union_datas.length; index++) {
const rawObj = JSON.parse(JSON.stringify(data.union_datas[index]));
Object.keys(rawObj).forEach(key => {
if (key === id) {
check_radio(submitData.unionNo, index)
}
});
}
console.log("------------------->")
let tmp_flag = true;
for (let index = 0; index < data.union_datas.length; index++) {
const rawObj = JSON.parse(JSON.stringify(data.union_datas[index]));
Object.keys(rawObj).forEach(key => {
if (key === id) {
tmp_flag = false;
check_radio(submitData.unionNo, index)
}
});
}
if (tmp_flag) {
check_radio(null, 0)
}
}
const dataFillIn = () => {
@ -925,7 +931,14 @@
submitData.isUnite = 0;
// if (data.checked) { submitData.isUnite = 1; } // 原来的联合检查, 忘记咋用了, 就没用了.
//联合检查
if (data.union_checked == 1) {submitData.hasUnion = 1;} else {submitData.unionNo = null;}
if (data.union_checked == 1) {
submitData.hasUnion = 1;
submitData.uniteCheck = 1;
} else {
submitData.hasUnion = 0;
submitData.uniteCheck = 0;
submitData.unionNo = null;
}
// 是否委托检查
if (data.auth_checked) {submitData.hasAuto = 1;}
// 处理回显附件

Loading…
Cancel
Save