<!-- 一般事项详情页 -->
<template>
<div class="content">
<div class="reportTime">
<p class="title">上报时间</p>
<p class="contentText">{{ sj ? sj : nowTime }}</p>
<a-divider />
</div>
<a-spin :spinning="confirmLoading">
<div class="reportTime">
<!-- @change="handleChange" -->
<a-select v-model="formState.noticeCommunityType" style="width: 100%" placeholder="请选择发布性质">
<a-select-option value="信息公示">信息公示</a-select-option>
</a-select>
</div>
<div class="reportTime">
<!-- <p class="title"><span style="color: red">* </span>附件上传</p>
<a-upload
v-if="!$route.query.type"
accept=".jpg,.png,.jpeg,.heic,.raw,.heif"
:multiple="false"
:headers="headers"
:action="action"
list-type="picture-card"
@change="fileChange($event, i)"
@preview="handlePreview"
>
<div>
<a-icon type="plus" />
选择附件
</div>
</a-upload>
<div v-else style="display: flex; gap: 10px">
<img style="width: 120px" src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg" alt="" />
<img style="width: 120px" src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg" alt="" />
</div> -->
<a-divider />
</div>
<!-- 信息公示 -->
<div class="reportTime">
<h2 style="color: rgb(31,157,255);">信息公示</h2>
<span
style="color:#000000">按照《北京市物业管理条例》第70条,物业服务人应当在物业管理区域内显著位置设置公示栏,如实公示、及时更新下列信息,并且可以通过互联网方式告知全体业主。</span>
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item prop="publicColumnUrl" :rules="{
required: true,
message: '请选择需要上传的文件',
}">
<span slot="label">
<span>公示栏(请上传照片,每次上传不要超过9张)</span>
<div>(拍照上传)</div>
</span>
<a-upload @change="handleUploadChange($event, 'publicColumnUrl')" v-if="!$route.query.type"
accept=".jpg,.png,.jpeg,.heic,.raw,.heif" list-type="picture-card"
:file-list="model.publicColumnUrl" :multiple="true" :headers="headers" :action="action" :before-upload="beforeUploadCheck">
<div>
<a-icon type="plus" />
选择附件
</div>
</a-upload>
<div v-else style="display: flex; gap: 10px">
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
</div>
<!-- <a-input v-model="model.lastYear" placeholder="请输入租户名称"></a-input> -->
</a-form-model-item>
<a-form-model-item prop="otherPublicInfoUrl" :rules="{
required: true,
message: '请选择需要上传的文件',
}">
<span slot="label">
<span>其他公示信息</span>
<div>(拍照上传)</div>
</span>
<a-upload @change="itemFileChange($event, 'otherPublicInfoUrl')" v-if="!$route.query.type"
accept=".jpg,.png,.jpeg,.heic,.raw,.heif" list-type="picture-card"
:file-list="model.otherPublicInfoUrl" :multiple="false" :headers="headers" :action="action">
<div>
<a-icon type="plus" />
选择附件
</div>
</a-upload>
<div v-else style="display: flex; gap: 10px">
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
</div>
<!-- <a-input v-model="model.lastYear" placeholder="请输入租户名称"></a-input> -->
</a-form-model-item>
<a-form-model-item prop="incomeDetailUrl" :rules="{
required: true,
message: '请选择需要上传的文件',
}">
<span slot="label">
<span>上一年度物业服务收支情况明细表</span>
<div>(拍照上传)</div>
</span>
<a-upload @change="itemFileChange($event, 'incomeDetailUrl')" v-if="!$route.query.type"
accept=".jpg,.png,.jpeg,.heic,.raw,.heif" list-type="picture-card"
:file-list="model.incomeDetailUrl" :multiple="false" :headers="headers" :action="action">
<div>
<a-icon type="plus" />
选择附件
</div>
</a-upload>
<div v-else style="display: flex; gap: 10px">
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
</div>
<!-- <a-input v-model="model.lastYear" placeholder="请输入租户名称"></a-input> -->
</a-form-model-item>
<a-form-model-item prop="incomeStatusUrl" :rules="{
required: true,
message: '请选择需要上传的文件',
}">
<span slot="label">
<span>物业共用部分经营收支情况表</span>
<div>(拍照上传)</div>
</span>
<a-upload @change="itemFileChange($event, 'incomeStatusUrl')" v-if="!$route.query.type"
accept=".jpg,.png,.jpeg,.heic,.raw,.heif" list-type="picture-card"
:file-list="model.incomeStatusUrl" :multiple="false" :headers="headers" :action="action">
<div>
<a-icon type="plus" />
选择附件
</div>
</a-upload>
<div v-else style="display: flex; gap: 10px">
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
</div>
</a-form-model-item>
<a-form-model-item prop="incomeBudgetUrl" :rules="{
required: true,
message: '请选择需要上传的文件',
trigger: ['change'],
}">
<span slot="label">
<span>本年度物业服务项目收支预算</span>
<div>(拍照上传)</div>
</span>
<a-upload @change="itemFileChange($event, 'incomeBudgetUrl')" v-if="!$route.query.type"
accept=".jpg,.png,.jpeg,.heic,.raw,.heif" :multiple="false" list-type="picture-card"
:file-list="model.incomeBudgetUrl" :headers="headers" :action="action">
<div>
<a-icon type="plus" />
选择附件
</div>
</a-upload>
<div v-else style="display: flex; gap: 10px">
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
<img style="width: 120px"
src="http://ygwy.hdgufei.cn:9000/hdygwy/IMG_20250406_134603238_1743920758142.jpg"
alt="" />
</div>
</a-form-model-item>
</a-form-model>
</div>
</a-spin>
<!-- <div @click="onCheckboxGroupClick">
<a-checkbox-group v-model="checkedList" @change="groupChange" v-if="childTabActive == '1' && paTabActive == 1">
<div v-for="(item, i) in plainOptions" :key="i">
<span class="title middleTitle" v-if="item.title"> {{ item.title }}</span>
<br v-if="item.title" />
<a-checkbox v-if="!item.title" :value="item.id" @change="checkBoxChange($event, i)">
<button
style="background-color: transparent; border: none; white-space: normal; outline: none; text-align: left"
>
<span> {{ item.rowNum }}、 {{ item.xxms }} </span>
<div v-if="!checkedList.includes(item.id)">
<a-radio-group style="margin-top: 10px" v-model="formModel[i].sblx" @change="radioChange">
<a-radio value="2" style="color: #3b77b3">维护记录</a-radio>
<a-radio value="1" style="color: #3b77b3">问题记录</a-radio>
</a-radio-group>
<div class="itemDetail">
<div class="title">
{{ formModel[i].sblx == 2 ? '维护描述' : '问题描述' }}
</div>
<div class="discription">
<a-input v-model="formModel[i].wtms" type="textarea" placeholder="请输入" rows="3"></a-input>
</div>
</div>
<div class="itemDetail">
<div class="title">
{{ formModel[i].sblx == 2 ? '维护附件' : '问题附件' }}
</div>
<div class="discription">
<a-upload
accept=".jpg,.png,.jpeg,.heic,.raw,.heif"
:multiple="false"
:headers="headers"
:action="action"
list-type="picture-card"
@change="fileChange($event, i)"
:file-list="formModel[i].wtfj"
@preview="handlePreview"
>
<div>
<a-icon type="plus" />
选择附件
</div>
</a-upload>
</div>
</div>
</div>
</button>
</a-checkbox>
</div>
</a-checkbox-group>
</div>
</a-spin>
<div class="reportItem" v-if="childTabActive == '2' && paTabActive == 1">
<div class="item" v-for="(item, i) in reprotedData" :key="i">
<p class="title middleTitle" v-if="item.title">{{ item.title }}</p>
<div v-if="!item.title">
<div style="display: flex; justify-content: space-between">
<div>
<a-icon type="schedule" style="margin-right: 5px; color: #3b77b3" />
{{ item.jgsx ? item.jgsx : '--' }}
</div>
<a-button
style="font-size: 12px; margin: 0"
@click="toHandle(item)"
shape="round"
type="primary"
size="small"
v-if="item.sblx != 2"
>去处置
</a-button>
</div>
<div class="mainCon">{{ item.xxms }}</div>
<div class="title" v-if="item.wtms">
{{ item.sblx == 2 ? '维护描述' : '问题描述' }}
</div>
<div class="problemCon" v-if="item.wtms">
{{ item.wtms ? item.wtms : '--' }}
</div>
<div class="title" v-if="item.wtfj">
{{ item.sblx == 2 ? '维护附件' : '问题附件' }}
</div>
<div style="width: 50px; height: 50px" v-if="item.wtfj">
<img style="width: 50px; height: 50px" :src="item.wtfj" mode="" />
</div>
</div>
<a-divider />
</div>
</div>
<a-modal :visible="previewVisible" :footer="null" @cancel="previewVisible = false">
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal> -->
</div>
</template>
<script>
import {
getPerformanceById,
saveFocusPerformance,
savePerformance,
getPerById
} from '@/api/dailySupervision';
import moment from 'moment';
export default {
data() {
return {
model: {
publicColumnUrl: [] // 初始化为空数组
},
formState: {
noticeCommunityType: '信息公示'
},
sj: "",
nowTime: moment(new Date()).format('YYYY年-MM月-DD日 HH:mm:ss'),
confirmLoading: false,
previewVisible: false,
previewImage: '',
model: {
publicColumnUrl: [],
otherPublicInfoUrl: [],
incomeDetailUrl: [],
incomeStatusUrl: [],
incomeBudgetUrl: []
},
validatorRules: {
// lastYear: [
// { required: true, message: '请上传附件' }
// ],
// common: [
// { required: true, message: '请上传附件' }
// ],
// money: [
// { required: true, message: '请上传附件' }
// ]
},
headers: {
'X-Access-Token': localStorage.getItem('token')
},
action: '/hdygwy/sys/common/upload',
headers: {
'X-Access-Token': localStorage.getItem('token')
},
action: '/hdygwy/sys/common/upload',
childTabActive: this.$route.query.childTabActive,
paTabActive: this.$route.query.paTabActive,
};
},
props: {},
mounted() {
this.getGetPerformanceById();
},
methods: {
// 文件上传前的检查
beforeUploadCheck(file, fileList) {
// 当前已上传文件数 + 新选文件数
const totalCount = this.model.publicColumnUrl.length + fileList.length;
if (totalCount >= 9) {
this.$message.error('最多只能上传9张图片');
return false; // 阻止上传
}
// 检查文件类型
const validTypes = ['.jpg', '.png', '.jpeg', '.heic', '.raw', '.heif'];
const extension = file.name.substring(file.name.lastIndexOf('.')).toLowerCase();
if (!validTypes.includes(extension)) {
this.$message.error('不支持的文件格式!');
return false;
}
return true;
},
// 处理文件变化
// handleUploadChange(info, fieldName) {
// let fileList = [...info.fileList];
// // 限制最多9个文件
// if (fileList.length > 9) {
// fileList = fileList.slice(0, 9);
// this.$message.warning('最多只能上传9张图片');
// }
// // 更新模型数据
// this.model[fieldName] = fileList;
// },
handleUploadChange(info, fieldName) {
let fileList = [...info.fileList];
// 检查是否有上传失败的文件
const failedFiles = fileList.filter(file => file.status === 'error');
if (failedFiles.length > 0) {
this.$message.error('上传失败!请重新上传');
// 清除上传失败的文件
fileList = fileList.filter(file => file.status !== 'error');
}
// 限制最多9个文件
if (fileList.length > 9) {
fileList = fileList.slice(0, 9);
this.$message.warning('最多只能上传9张图片');
}
// 更新模型数据
this.model[fieldName] = fileList;
},
// itemFileChange(op, field) {
// this.model[field] = op.fileList;
// },
itemFileChange(op, field) {
const fileList = [...op.fileList];
// 检查是否有上传失败的文件
const failedFiles = fileList.filter(file => file.status === 'error');
if (failedFiles.length > 0) {
this.$message.error('上传失败!请重新上传');
// 清除上传失败的文件
this.model[field] = fileList.filter(file => file.status !== 'error');
return;
}
this.model[field] = fileList;
},
// 日常事项提交
wySave() {
this.$refs.form.validate(valid => {
console.log('valid =>', valid);
if (valid) {
let params = {
"sxlx":2,
"xmid": this.$route.query.projectId,
"lysxid": this.$route.query.id,
"lysxName": this.$route.query.name,
"sbsj": moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
"publicColumnUrl": this.model.incomeDetailUrl.map((item) => item.response
.message).join(","),
"otherPublicInfoUrl": this.model.incomeDetailUrl.map((item) => item.response
.message).join(","),
"incomeDetailUrl": this.model.incomeDetailUrl.map((item) => item.response
.message).join(","),
"incomeStatusUrl": this.model.incomeStatusUrl.map((item) => item.response
.message).join(","),
"incomeBudgetUrl": this.model.incomeBudgetUrl.map((item) => item.response
.message).join(",")
}
savePerformance(params).then((res) => {
if (res.success) {
this.$message.success(res.message);
this.$router.push({
path: "/dailSupervision",
query: {
paTabActive: this.$route.query.paTabActive,
childTabActive: this.$route.query.childTabActive,
},
});
}
});
}
})
// this.spinning = true;
// const deptArr = [];
// this.formModel.forEach((item) => {
// deptArr.push(item);
// });
// deptArr.map((item1) => {
// if (item1.wtfj) {
// item1.wtfj = item1.wtfj[0].response.message;
// }
// });
// saveFocusPerformance(JSON.stringify(deptArr)).then((res) => {
// if (undefined == res) {
// this.spinning = false;
// }
// this.$router.push({
// path: '/dailSupervision'
// });
// this.spinning = false;
// if (res.success) {
// this.$message.success('提交成功');
// }
// });
},
getGetPerformanceById() {
this.checkedList = [];
this.formModel = [];
let id = this.$route.query.id ? this.$route.query.id : "83"
if (this.$route.query.sxlx == 1) {
id = this.$route.query.dkpc;
}
const params = {
id: id,
type: this.$route.query.paTabActive,
projectId: this.$route.query.projectId,
batchKey: this.$route.query.batchKey
};
if (this.$route.query.reproted == 1) {
getPerformanceById(params).then((res) => {
if (res.success) {
this.spinning = false;
this.checkAttachment = [];
const {
result
} = res;
if (result.data) {
this.isSnowId = result.data.id;
this.datas = result.data;
this.xxms = result.data ? result.data.xxms : "";
this.sblx = result.data.sblx;
this.sbsj = result.data.sbsj;
this.jgsx = result.data.jgsx;
this.wtms = result.data.wtms;
result.data.wtfj ?
result.data.wtfj.split(",").forEach((item) => {
this.checkAttachment.push(item);
}) :
null;
}
this.jcrxm = result.data.jcrxm;
this.jcrdh = result.jcrdh;
this.$emit("getCheckPerInfo", this.jcrxm, this.jcrdh);
}
});
} else {
getPerById(params).then((res) => {
if (res.success) {
this.spinning = false;
this.checkAttachment = [];
const {
result
} = res;
if (result.data) {
this.xxms = result.data ? result.data.xxms : "";
this.sblx = result.data.sblx;
this.sbsj = result.data.sbsj;
this.jgsx = result.data.jgsx;
this.jcrxm = result.jcrxm;
this.jcrdh = result.jcrdh;
this.$emit("getCheckPerInfo", this.jcrxm, this.jcrdh);
} else {
this.$message.error(res.message);
}
}
});
}
},
onCheckAllChange(e) {
this.mainCheck = e.target.checked;
if (e.target.checked) {
this.checkedList = [...this.checkedListTemp];
if (this.formModel.length != 0) {
this.formModel.forEach((item) => {
item.sblx = '2';
});
}
} else {
this.checkedList = [];
}
},
onCheckboxGroupClick() {
this.stopChange += 1;
this.stopCheckedList = this.checkedList;
},
checkBoxChange(e, i) {
// this.formModel[i].sblx = e.target.checked ? 2 : 1;
this.formModel[i].sbzt = e.target.checked ? 2 : 0;
},
groupChange(e) {
if (this.stopChange == 2) {
this.checkedList = this.stopCheckedList;
return (this.stopChange = 0);
} else {
this.stopChange = 0;
if (e.length != this.plainOptions.length) {
this.mainCheck = false;
} else {
this.mainCheck = true;
}
}
},
toHandle(item) {
this.$router.push({
path: '/waitHandle',
query: {
title: '待处置',
id: item.eid,
paTabActive: this.$route.query.paTabActive,
projectId: this.$route.query.projectId
}
});
},
fileChange(info, index) {
const wtms = this.formModel[index].wtms;
this.formModel[index].wtfj = [...info.fileList];
if (this.formModel[index].wtfj.length > 1) {
this.formModel[index].wtfj = this.formModel[index].wtfj.slice(-1);
}
// this.$forceUpdate();
this.formModel[index].wtms = wtms;
},
handlePreview(file) {
this.previewImage = file.url || file.response.message;
this.previewVisible = true;
},
radioChange(e) {
const isAllChecke = this.formModel.find((item) => item.sblx == '1');
if (!isAllChecke) {
this.mainCheck = true;
}
}
}
};
</script>
<style lang="less" scoped>
.content {
font-size: 14px;
color: #aaa;
.reportItem {
.item {
margin-top: 20px;
}
}
.title {
font-weight: 550;
margin-bottom: 5px;
font-size: 16px;
color: #333;
margin-top: 15px;
}
}
.middleTitle {
margin-top: 20px;
}
.itemDetail {
margin-top: 10px;
}
/deep/ .ant-checkbox-wrapper {
margin-bottom: 10px;
margin-left: 0;
}
/deep/ .ant-btn-primary {
background: #3b77b3;
border: 1px solid #3b77b3;
font-size: 12px;
}
/deep/ .ant-checkbox-wrapper {
display: flex;
}
/deep/ .ant-checkbox-wrapper>span {
display: inline-block;
}
/deep/ .ant-checkbox-checked {
height: 10px !important;
}
</style>
必填项取消掉可上传可不上传
最新发布