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.
 
 
 
 
 
 

447 lines
12 KiB

<template>
<div class="address_edit">
<span class="tohome" @click="toEnforceHomeView"><i class="van-badge__wrapper van-icon van-icon-wap-home-o"></i></span>
<!-- 中间 -->
<div class="warp_body">
<van-form @failed="onFailed" ref="form">
<van-cell-group>
<div class="qy-name">企业信息</div>
<van-field v-model="data.detail.enterpriseName"
label="企业名称"
:rules="[{ required: true, message: '必填项' }]"
placeholder="企业名称"
readonly="true"
/>
<van-field v-model="data.detail.enterpriseNumber"
readonly
label="统一社会信用代码"
:rules="[{ required: true, message: '必填项' }]"
placeholder="统一社会信用代码"
class="mult-line"
/>
</van-cell-group>
<van-divider class="divdsty"/>
<van-cell-group>
<div class="zf-name">执法信息</div>
<van-field v-model="data.detail.bureauDeptName"
label="入企单位"
readonly
/>
<van-field v-model="data.detail.lawEnforcer"
label="入企人员"
readonly
/>
<div class="add-box">
<div v-for="(item, index) in data.lawCer" :key="index">
<van-field v-model="data.lawCer[index]"
label=" "
readonly
/>
</div>
</div>
<van-field v-model="data.detail.lawEnforcementTypeText"
label="入企事由"
placeholder="请选择"
readonly
/>
<van-field v-model="data.detail.lawEnforcementItemText"
label="入企事项"
readonly
:rules="[{ required: true, message: '请输入 入企事项' }]"
rows="2"
/>
<div class="add-box">
<div v-for="(item, index) in data.lawBasisList" :key="index">
<van-field v-model="data.lawBasisList[index]"
readonly
:label="index == 0 ? '活动依据' : ' '"
/>
</div>
</div>
<van-field
v-model="data.detail.enforcementTime"
label="入企时间"
readonly
placeholder="请选择 入企时间"
:rules="[{ required: true, message: '必填项' }]"
@click="data.showTimePicker = true"
/>
<van-field v-model="data.detail.reason" label="原&nbsp; &nbsp; &nbsp; &nbsp;因" readonly="true" />
<van-divider class="divdsty" />
<!-- <div class="file-upload">
<div class="file-upload-center"><label>附&nbsp; &nbsp; &nbsp; &nbsp;件</label> <span>(不多于 8张)</span></div>
<van-uploader v-model="data.fileListObj" :after-read="uploadFiles" :before-delete="deleteFile" multiple max-count="8" class="file">
<template #preview-cover="{ file }">
<div class="preview-cover van-ellipsis">{{ file.name }}</div>
</template>
</van-uploader>
</div> -->
<div class="file-upload">
<div class="file-upload-center">
<label>附&nbsp; &nbsp; &nbsp; &nbsp;件</label>
</div>
<div class="zoom">
<img v-for="(ite, index) in data.imageList" 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>
</van-cell-group>
</van-form>
</div>
</div>
</template>
<script setup name="register">
import 'vant/es/toast/style';
import {reactive, ref} from "vue";
import { baseUrl } from "@/config/env";
import {queryNonRegistrationById, getAttr} from '@/api/enforce';
const {useCommon} = $globalStore
const router = useRouter();
//路由参数
const route = useRoute();
const form = ref(null);
const indexImg = ref(0);
const data = reactive({
id: route.query.id,
detail: {},
lawCer: [],
lawBasisList: [],
show: ref(false),
imageList: [],
imgstr: '',
});
/** 加载钩子 */
onMounted(() => {
data.id = route.query.id
queryById()
})
const queryById = () => {
queryNonRegistrationById(data.id).then(res => {
console.log(res);
data.detail = res.data
data.lawCer = res.data.lawEnforcerOther.split(",");
data.lawBasisList = res.data.lawEnforcementBasisText.split(",");
// 附件
getAttr(data.id, (success) => {
if (success.data.filePreview != null) {
let images = [];
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);
}
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]
);
}
}
console.log(data.imageList);
}, (error) => {});
})
}
const imagePreview = (newIndex) => {
data.show = ref(true);
};
const onChange = (newIndex) => {
indexImg.value = newIndex;
};
</script>
<style lang="less" scoped>
.tohome {
position: absolute;
top: 1.25%;
right: 5%;
font-size: 0.5rem;
}
.address_edit {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
background-color: #ebf3fb;
}
.warp_body {
margin: 0 3%;
padding-bottom: 3rem;
width: 94%;
height: 100%;
//border-radius: 0.25rem;
background-image: linear-gradient(to bottom, #ebf3fb, #fff);
overflow-y: auto;
margin-top: 0.15rem;
}
.qy-name, .zf-name {
margin: 0 0.27rem;
font-size: 0.42rem;
height: 1.2rem;
background-color: white;
font-weight: 600;
line-height: 3.5;
}
/* 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;
}
.divdsty {
margin: auto;
width: 100%;
height: 0.25rem;
background-color: #f4f4f4;
border: 0;
}
.file-upload {
position: relative;
min-height: 3.0rem;
max-height: 6.5rem;
padding: 1rem 0.27rem 0.27rem 0.43rem;
box-sizing: border-box;
}
.file-upload-center {
position: absolute;
top: 0.27rem;
left: 0.43rem;
width: 90%;
height: 0.65rem;
font-size: 0.37rem;
span {
font-size: 0.32rem;
color: #b9b9b9;
}
}
.zoom {
/*margin-top: 0.65rem;
padding-top: 0.27rem;
padding-left: 0.27rem;*/
img {
width: 1.95rem;
height: 2rem;
// margin: 0 0.21rem 0.21rem 0;
margin: 0 0.6rem 0.21rem 0;
font-size: 0.35rem;
}
}
.file {
position: relative;
width: 100%;
height: calc(100% - 1.5rem);
}
/deep/ .van-uploader__upload, /deep/ .van-uploader__preview-image {
width: 1.95rem !important;
}
.preview-cover {
position: absolute;
bottom: 0;
box-sizing: border-box;
width: 100%;
padding: 0.13rem;
color: #fff;
font-size: 0.32rem;
text-align: center;
background: rgba(0, 0, 0, 0.3);
}
/deep/ .van-button {
margin: 5% 3%;
padding: 0;
width: 94%;
height: 1rem;
color: #fff;
font-size: 0.4rem;
border-radius: 1rem;
background: #1367fe;
border: 1px solid #1367fe;
text-align: center;
}
.van-action-bar .van-button:first-child {
background: #fff;
color: #1367fe;
/*width: 40%;*/
}
/deep/ .van-action-bar {
box-shadow: 0 0 0.27rem #e5e5e5;
}
.add-box {
position: relative;
margin-top: -1px;
}
.add-box::after {
position: absolute;
left: 0.43rem;
bottom: 0;
width: calc(100% - 0.86rem);
border-bottom: 1px solid #ebedf0;
content: "";
transform: scaleY(.5);
}
.addbtn {
margin: 3% 0;
width: 100%;
text-align: right;
}
.addbtn i {
font-size: 0.5rem;
color: #999;
}
.add-inspect {
margin: 0 0.425rem;
padding-bottom: 0.3rem;
min-height: 2rem;
font-size: 0.37rem;
color: #323233;
}
.add-inspect p {
margin: 0.1rem 0;
padding: 0.2rem 0.1rem;
//border-bottom: 1px solid #f4f5f6;
}
/*.add-inspect p:nth-child(1) {
background-color: #fff;
}*/
.add-inspect span {
display: block;
margin-right: 0.2rem;
color: #666;
line-height: 1.75;
}
.add-inspect span.add-dept {
color: #999;
font-size: 0.3rem;
line-height: 1.25;
}
.item-delete {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1% 4.5%;
width: 100%;
background: #f3f4f5;
line-height: 2.0;
font-size: 0.3rem;
color: #999;
box-sizing: border-box;
}
.item-delete a {
font-size: 0.35rem;
color: #1367fe;
}
.item-inspect {
display: flex;
justify-content: space-between;
}
.item-inspect > i {
margin: 5% 2% 0 0;
color: #dfdddd;
font-size: 0.5rem;
}
.item-inspect > i.van-icon-checked {
color: #1367fe;
}
.dept-inspect {
margin: 2% 0;
padding: 0 2%;
width: calc(100% - 1rem);
background: #f3f4f5;
color: #666;
}
.dept-inspect p {
margin: 3% 0;
padding: 0;
}
.no-inspect {
background: none;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.block {
width: 120px;
height: 120px;
text-align: center;
}
/deep/ .mult-line .van-field__label {
padding-right: 0.5rem;
line-height: 1.25;
}
/deep/ .van-picker-column__item--selected {
background: #e5eef9;
color: #000;
font-weight: 600;
}
/deep/ .van-field .van-field__control {
color: #666;
}
/deep/ .van-field__label--required:before {
margin-left: -0.2rem;
}
</style>