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.
1270 lines
40 KiB
1270 lines
40 KiB
<template>
|
|
<view class="custom-content">
|
|
<uni-nav-bar :fontSizes="17" dark left-icon="left" @clickLeft="back" :fixed="true" :border="false"
|
|
background-color="#3E73F5" status-bar title="安全检查" />
|
|
|
|
<!-- 表单内容 -->
|
|
<view class="form-section">
|
|
<view class="form-item required">
|
|
<text class="label">企业名称</text>
|
|
<view class="icon-btn-box">
|
|
<view class="selected-company" v-if="selectedCompany">
|
|
{{ selectedCompany.enterpriseName }}
|
|
</view>
|
|
<!-- <view class="icon-box" @click="openCompanyList">
|
|
<image :src="require('./image/shaixuan@2x.png')" />
|
|
</view>
|
|
<view class="icon-box" @click="addCompanyPop">
|
|
<image :src="require('./image/add@2x.png')" />
|
|
</view> -->
|
|
</view>
|
|
</view>
|
|
|
|
<view class="form-item required">
|
|
<text class="label">检查类型</text>
|
|
<uni-data-select style="width: 150rpx;" disabled v-model="checkType" placeholder="请选择检查类型"
|
|
:localdata="checkTypeList" @change="changeType"></uni-data-select>
|
|
</view>
|
|
|
|
<view class="form-item">
|
|
<text class="label">检查日期</text>
|
|
<picker mode="date" disabled :value="checkTime" @change="onDateChange">
|
|
<view class="picker-value">{{ checkTime }}</view>
|
|
</picker>
|
|
</view>
|
|
|
|
<!-- <view class="form-item">
|
|
<text class="label">此检查是否属于某项目</text>
|
|
<radio-group :value="projectChecked" @change="onProjectCheckedChange" class="radio-group">
|
|
<label class="radio" v-for="(item, idx) in yesNoList" :key="idx">
|
|
<radio class="custom-radio" :value="item" :checked="projectChecked === item" />
|
|
<text :class="['radio-text', { checked: projectChecked === item }]">{{ item }}</text>
|
|
</label>
|
|
</radio-group>
|
|
</view> -->
|
|
|
|
<!-- <view class="form-item">
|
|
<text class="label">现场照片</text>
|
|
<view class="photo-upload">
|
|
<view class="photo-placeholder">上传图片</view>
|
|
</view>
|
|
</view> -->
|
|
|
|
<!-- <view class="form-item">
|
|
<text class="label">检查方式</text>
|
|
<view class="check-type-btns">
|
|
<button v-for="(item, idx) in checkWayList" :key="idx"
|
|
:class="['check-btn', { active: checkWay === item }]" @click="checkWay = item">{{ item
|
|
}}</button>
|
|
</view>
|
|
</view> -->
|
|
|
|
|
|
<!-- tab切换 -->
|
|
<view class="tab-section" v-show="checkWay === '自行新增'">
|
|
<!-- <view class="tab-header">
|
|
自行新增
|
|
</view> -->
|
|
|
|
<view class="tab-content">
|
|
<view v-for="(item, index) in hazardList" :key="index" :id="'hazardItem' + index" class="hazard-list">
|
|
<view class="form-item">
|
|
<text class="label">隐患描述#{{ index + 1 }}</text>
|
|
<input class="input" :disabled="disabled" v-model="item.description" placeholder="请输入隐患描述" />
|
|
</view>
|
|
<view class="form-item">
|
|
<text class="label">整改依据</text>
|
|
<uni-easyinput fontSize="32" :disabled="disabled" type="textarea" class="input" autoHeight
|
|
v-model="item.rectificationBasis" placeholder="请输入整改依据"></uni-easyinput>
|
|
</view>
|
|
<view class="form-item">
|
|
<text class="label">整改建议</text>
|
|
<uni-easyinput fontSize="32" :disabled="disabled" type="textarea" class="input" autoHeight
|
|
v-model="item.rectificationSuggestion" placeholder="请输入整改建议"></uni-easyinput>
|
|
</view>
|
|
<view class="form-item">
|
|
<text class="label">检查图片</text>
|
|
<view class="photo-upload">
|
|
<view class="photo-placeholder" @click="uploadImg(index)"
|
|
v-if="item.pics.length < 3 && !disabled">
|
|
<uni-icons type="plusempty" size="24" color="#C1C1C1"></uni-icons>
|
|
</view>
|
|
<view class="photo-placeholder" v-if="item.pics.length == 0 && disabled">
|
|
<text class="text">暂无图片</text>
|
|
</view>
|
|
<view class="photo-placeholder" v-if="item.pics.length > 0" v-for="(pic, idx) in item.pics">
|
|
<image class="photo-item" @click="preview(pic, item.pics)" :key="idx" :src="pic" />
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="form-item">
|
|
<text class="label">备注</text>
|
|
<uni-easyinput fontSize="32" :disabled="disabled" type="textarea" class="textarea" autoHeight
|
|
v-model="item.remark" placeholder="请输入备注"></uni-easyinput>
|
|
</view>
|
|
|
|
<!-- 隐患描述块 -->
|
|
<!-- <view class="desc-box" v-if="item.description && item.rectificationSuggestion">
|
|
<view>隐患描述:{{ item.description }}</view>
|
|
<view>整改建议:{{ item.rectificationSuggestion }}</view>
|
|
</view> -->
|
|
|
|
<!-- 操作按钮组 -->
|
|
<view class="action-btns" v-if="!disabled">
|
|
<button class="action-btn" v-if="index + 1 == hazardList.length" @click="addHazard">
|
|
<image :src="require('./image/addcircle@2x.png')" />
|
|
继续添加
|
|
</button>
|
|
<button class="action-btn" @click="deleteHazard(index)" v-if="hazardList.length > 1">
|
|
<image :src="require('./image/delete@2x.png')" />
|
|
删除
|
|
</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 底部操作栏 -->
|
|
<view class="footer-bar">
|
|
<button class="footer-btn cancel" v-if="!isReCheck" @click="cancel">取消</button>
|
|
<button class="footer-btn repass" v-if="isReCheck" @click="notPass">不通过</button>
|
|
<button class="footer-btn pass" v-if="isReCheck" @click="pass">通过</button>
|
|
<button class="footer-btn save" v-if="!disabled && !isReCheck" @click="onSave">保存</button>
|
|
</view>
|
|
<uni-popup ref="addComPop" type="center" background-color="#fff">
|
|
<view class="popup-box">
|
|
<view class="pop-title">
|
|
新增企业
|
|
</view>
|
|
<view class="content">
|
|
<view class="label">企业名称</view>
|
|
<input type="text" v-model="addComForm.enterpriseName" placeholder="请输入企业名称" />
|
|
</view>
|
|
<view class="content">
|
|
<view class="label">详细地址</view>
|
|
<input type="text" v-model="addComForm.address" placeholder="请输入详细地址" />
|
|
</view>
|
|
<view class="content">
|
|
<view class="label">企业联系人</view>
|
|
<input type="text" v-model="addComForm.enterpriseContacts" placeholder="请输入详细地址" />
|
|
</view>
|
|
<view class="content">
|
|
<view class="label">企业联系电话</view>
|
|
<input type="text" v-model="addComForm.enterprisePhone" placeholder="请输入详细地址" />
|
|
</view>
|
|
<view class="pop-btns">
|
|
<button @click="$refs.addComPop.close()">关闭</button>
|
|
<button @click="addCompany">修改</button>
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
<uni-popup ref="companyListPop" type="center" background-color="#fff">
|
|
<view class="company-popup">
|
|
<view class="company-popup-header">
|
|
<text class="company-popup-title">选择企业</text>
|
|
<view class="search-box">
|
|
<input class="search-input" v-model="searchKeyword" @input="searchCompany"
|
|
placeholder="请输入企业名称搜索" />
|
|
</view>
|
|
</view>
|
|
<view class="company-list">
|
|
<view class="company-item" v-for="company in filteredCompanyList" :key="company.id"
|
|
@click="selectCompany(company)">
|
|
<view class="company-name">{{ company.enterpriseName }}</view>
|
|
<view class="company-address">{{ company.address || '暂无地址' }}</view>
|
|
</view>
|
|
<view v-if="filteredCompanyList.length === 0" class="no-data">
|
|
暂无匹配的企业
|
|
</view>
|
|
</view>
|
|
<view class="company-popup-footer">
|
|
<button class="cancel-btn" @click="$refs.companyListPop.close()">取消</button>
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
<q-previewImage ref="previewImage" :urls="pics" @onLongpress="onLongpress" @open="open"
|
|
@close="close"></q-previewImage>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { parseTime } from '@/utils/ruoyi'
|
|
import store from '@/store'
|
|
import { getDicts } from '@/api/system/user'
|
|
import * as Api from '@/api/index/index'
|
|
import { getLabelByValue } from '@/utils/showDictLabel.js' // 导入工具函数
|
|
import { baseUrl } from '@/config'
|
|
import { getAccessToken, setToken } from '@/utils/auth'
|
|
import { refreshToken } from "@/api/login";
|
|
export default {
|
|
data() {
|
|
return {
|
|
createUserId: this.$store.state.user.id,
|
|
checkTypeList: [{
|
|
value: 1, text: '日常检查'
|
|
}, {
|
|
value: 2, text: '专项检查'
|
|
}],
|
|
checkType: null,
|
|
checkTime: this.parseTime(new Date()),
|
|
yesNoList: ['是', '否'],
|
|
projectChecked: '是',
|
|
checkWayList: ['检查表库', '隐患库', '自行新增'],
|
|
checkWay: '自行新增',
|
|
tabList: ['自行新增'],
|
|
tabActive: 0,
|
|
arr: [
|
|
|
|
],
|
|
hazardList: [],
|
|
addComForm: {
|
|
enterpriseName: '',
|
|
address: '',
|
|
enterpriseContacts: '',
|
|
enterprisePhone: '',
|
|
},
|
|
companyList: [], // 公司列表
|
|
filteredCompanyList: [], // 过滤后的公司列表
|
|
searchKeyword: '', // 搜索关键词
|
|
selectedCompany: null, // 已选择的公司
|
|
pics: [],//上传图片
|
|
baseApi: '/admin-api/infra/file/upload',
|
|
enterpriseId: '',//公司id
|
|
status: '1',//审核状态
|
|
disabled: false,
|
|
isReCheck: false, // 是否为复查
|
|
id: '',
|
|
formData: {}
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
const data = JSON.parse(decodeURIComponent(options.data))
|
|
console.log(data, options.val)
|
|
this.formData = { ...data }
|
|
console.log(this.formData)
|
|
this.id = data.id
|
|
this.disabled = options.val == 'true' ? true : false //禁用编辑
|
|
this.checkType = Number(data.checkType)
|
|
this.checkTime = data.checkTime
|
|
this.selectedCompany = {
|
|
id: data.enterpriseId,
|
|
enterpriseName: data.enterpriseName
|
|
},
|
|
this.status = data.status
|
|
this.hazardList = JSON.parse(data.reviewResult)
|
|
if (options.type && options.type == 1) {
|
|
this.isReCheck = true
|
|
} else {
|
|
this.isReCheck = false
|
|
}
|
|
},
|
|
onShow() {
|
|
|
|
|
|
},
|
|
mounted() {
|
|
refreshToken().then(resp => {
|
|
setToken(resp.data)
|
|
}).catch(err => {
|
|
console.log(err)
|
|
setTimeout(() => {
|
|
store.dispatch('LogOut').then(() => {
|
|
uni.reLaunch({ url: '/pages/login' })
|
|
})
|
|
}, 1500)
|
|
})
|
|
|
|
},
|
|
methods: {
|
|
parseTime(time) {
|
|
return parseTime(time, '{y}-{m}-{d}')
|
|
},
|
|
changeType(e) {
|
|
console.log(e)
|
|
},
|
|
back() {
|
|
uni.navigateBack()
|
|
},
|
|
onCheckTypeChange(e) {
|
|
this.checkTypeIndex = e.detail.value
|
|
},
|
|
onDateChange(e) {
|
|
this.checkTime = e.detail.value
|
|
},
|
|
onProjectCheckedChange(e) {
|
|
this.projectChecked = e.detail.value
|
|
},
|
|
addCompanyPop() {
|
|
this.$refs.addComPop.open();
|
|
},
|
|
openCompanyList() {
|
|
this.$refs.companyListPop.open();
|
|
this.searchKeyword = '';
|
|
this.getCompanyList();
|
|
},
|
|
// 获取公司列表
|
|
getCompanyList() {
|
|
Api.getCompanyList().then(res => {
|
|
if (res.code === 0) {
|
|
this.companyList = res.data || [];
|
|
this.filteredCompanyList = res.data || [];
|
|
}
|
|
}).catch(err => {
|
|
uni.showToast({ title: '获取企业列表失败', icon: 'none' });
|
|
});
|
|
},
|
|
|
|
// 搜索公司
|
|
searchCompany() {
|
|
if (!this.searchKeyword) {
|
|
this.filteredCompanyList = [...this.companyList];
|
|
return;
|
|
}
|
|
|
|
this.filteredCompanyList = this.companyList.filter(company =>
|
|
company.enterpriseName && company.enterpriseName.includes(this.searchKeyword)
|
|
);
|
|
},
|
|
|
|
// 选择公司
|
|
selectCompany(company) {
|
|
this.selectedCompany = company;
|
|
this.enterpriseId = company.id;
|
|
this.$refs.companyListPop.close();
|
|
},
|
|
addCompany() {
|
|
// 校验电话格式(手机号或座机号)
|
|
const phoneRegex = /^((1[3-9]\d{9})|(\d{3,4}-?\d{7,8}(-\d{1,4})?))$/;
|
|
if (!this.addComForm.enterpriseName) {
|
|
uni.showToast({ title: '请输入企业名称', icon: 'none' });
|
|
return;
|
|
}
|
|
if (!this.addComForm.address) {
|
|
uni.showToast({ title: '请输入详细地址', icon: 'none' });
|
|
return;
|
|
}
|
|
if (!this.addComForm.enterpriseContacts) {
|
|
uni.showToast({ title: '请输入企业联系人', icon: 'none' });
|
|
return;
|
|
}
|
|
if (!this.addComForm.enterprisePhone) {
|
|
uni.showToast({ title: '请输入联系电话', icon: 'none' });
|
|
return;
|
|
}
|
|
if (!phoneRegex.test(this.addComForm.enterprisePhone)) {
|
|
uni.showToast({ title: '请输入正确的手机号或座机号', icon: 'none' });
|
|
return;
|
|
}
|
|
|
|
Api.createCompany(this.addComForm).then(res => {
|
|
debugger
|
|
console.log(res)
|
|
uni.showToast({ title: '添加成功', icon: 'success' });
|
|
this.$refs.addComPop.close();
|
|
// 重置表单
|
|
this.addComForm = {
|
|
enterpriseName: '',
|
|
address: '',
|
|
enterpriseContacts: '',
|
|
enterprisePhone: ''
|
|
};
|
|
}).catch(err => {
|
|
uni.showToast({ title: '添加失败', icon: 'none' });
|
|
});
|
|
},
|
|
|
|
parseHazardData(rawData) {
|
|
const lines = rawData.split('\n').map(line => line.trim()).filter(line => line);
|
|
|
|
const hazard = {
|
|
description: '',
|
|
rectificationBasis: '',
|
|
rectificationSuggestion: '',
|
|
hazardLevel: '',
|
|
hazardType: '',
|
|
majorHazardCriteria: '无',
|
|
remark: '',
|
|
pics: []
|
|
};
|
|
|
|
let currentSection = '';
|
|
let rectificationBasisLines = [];
|
|
|
|
for (const line of lines) {
|
|
if (line.startsWith('【隐患描述】')) {
|
|
currentSection = 'description';
|
|
continue;
|
|
} else if (line.startsWith('【整改依据】')) {
|
|
currentSection = 'rectificationBasis';
|
|
continue;
|
|
} else if (line.startsWith('【整改建议】')) {
|
|
currentSection = 'rectificationSuggestion';
|
|
continue;
|
|
} else if (line.startsWith('【隐患等级】')) {
|
|
currentSection = 'hazardLevel';
|
|
continue;
|
|
} else if (line.startsWith('【隐患类型】')) {
|
|
currentSection = 'hazardType';
|
|
continue;
|
|
} else if (line.startsWith('【重大隐患判断标准】')) {
|
|
currentSection = 'majorHazardCriteria';
|
|
continue;
|
|
}
|
|
|
|
if (currentSection === 'description') {
|
|
hazard.description += line + ' ';
|
|
} else if (currentSection === 'rectificationBasis') {
|
|
rectificationBasisLines.push(line);
|
|
} else if (currentSection === 'rectificationSuggestion') {
|
|
hazard.rectificationSuggestion += line + ' ';
|
|
} else if (currentSection === 'hazardLevel') {
|
|
hazard.hazardLevel = line;
|
|
} else if (currentSection === 'hazardType') {
|
|
hazard.hazardType = line;
|
|
} else if (currentSection === 'majorHazardCriteria') {
|
|
hazard.majorHazardCriteria = line;
|
|
}
|
|
}
|
|
|
|
// 格式化整改依据
|
|
hazard.rectificationBasis = rectificationBasisLines.join('\n');
|
|
|
|
// 清理数据
|
|
hazard.description = hazard.description.trim();
|
|
hazard.rectificationSuggestion = hazard.rectificationSuggestion.trim();
|
|
|
|
return hazard;
|
|
},
|
|
|
|
// 添加新的隐患项
|
|
addHazard() {
|
|
this.hazardList.push({
|
|
description: '',
|
|
rectificationBasis: '',
|
|
rectificationSuggestion: '',
|
|
hazardLevel: '',
|
|
hazardType: '',
|
|
majorHazardCriteria: '无',
|
|
remark: '',
|
|
pics: [],
|
|
});
|
|
this.$nextTick(() => {
|
|
const lastIndex = this.hazardList.length - 1;
|
|
debugger;
|
|
|
|
uni.pageScrollTo({
|
|
selector: `#hazardItem${lastIndex}`,
|
|
duration: 300
|
|
});
|
|
})
|
|
},
|
|
|
|
// 删除隐患项
|
|
deleteHazard(index) {
|
|
uni.showModal({
|
|
title: '确定要删除吗?',
|
|
confirmText: '删除',
|
|
confirmColor: '#ff2738',
|
|
showCancel: true,
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
this.hazardList.splice(index, 1);
|
|
}
|
|
},
|
|
fail: (err) => {
|
|
console.error(err);
|
|
},
|
|
});
|
|
},
|
|
uploadImg(index) {
|
|
// 这里可以扩展以支持为每个隐患项上传图片
|
|
var that = this;
|
|
if (that.hazardList[index].pics.length < 3) {
|
|
uni.chooseImage({
|
|
count: 1,
|
|
sizeType: ['original', 'compressed'],
|
|
sourceType: ['album', 'camera'],
|
|
success: function (res) {
|
|
uni.showLoading({
|
|
mask: true,
|
|
title: "上传中"
|
|
})
|
|
var imgsrc = res.tempFilePaths;
|
|
uni.uploadFile({
|
|
header: {
|
|
"Authorization": "Bearer " + getAccessToken(),
|
|
},
|
|
url: baseUrl + that.baseApi,
|
|
filePath: imgsrc[0],
|
|
name: 'file',
|
|
success(res) {
|
|
var obj = JSON.parse(res.data);
|
|
if (obj.code != 0) {
|
|
uni.showToast({
|
|
title: "上传失败",
|
|
icon: "none"
|
|
})
|
|
uni.hideLoading();
|
|
}
|
|
that.hazardList[index].pics = that.hazardList[index].pics.concat(obj.data);
|
|
uni.hideLoading();
|
|
},
|
|
fail(res) {
|
|
uni.showToast({
|
|
title: "上传失败",
|
|
icon: "none"
|
|
})
|
|
uni.hideLoading();
|
|
}
|
|
})
|
|
}
|
|
})
|
|
} else {
|
|
uni.showToast({
|
|
title: "最多上传3张",
|
|
icon: "none"
|
|
})
|
|
}
|
|
},
|
|
preview(url, pics) {
|
|
this.pics = pics
|
|
// #ifdef MP-WEIXIN
|
|
this.$nextTick(() => {
|
|
debugger
|
|
this.$refs.previewImage.open(url); // 传入当前选中的图片地址(小程序必须添加$nextTick,解决组件首次加载无图)
|
|
})
|
|
// #endif
|
|
|
|
// #ifndef MP-WEIXIN
|
|
this.$refs.previewImage.open(url); // 传入当前选中的图片地址
|
|
// #endif
|
|
},
|
|
onLongpress(e) { //长按事件
|
|
// console.log('当前长按的图片是' + e);
|
|
// uni.showActionSheet({
|
|
// itemList: ['转发给朋友', '保存到手机'],
|
|
// success: function (res) {
|
|
// console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
|
// },
|
|
// fail: function (res) {
|
|
// console.log(res.errMsg);
|
|
// }
|
|
// });
|
|
},
|
|
|
|
/* open和close方法一般用不到,但是在一些特殊场景会用到,
|
|
* 比如预览图片时你需要覆盖 NavigationBar和 TabBar,
|
|
* 或者在app中需要预览图片时覆盖住原生组件,比如video或者map等,
|
|
* 你可以根据open和close去做一些操作,例如隐藏导航栏或者隐藏一些原生组件等
|
|
*/
|
|
open() { //监听组件显示 (隐藏TabBar和NavigationBar,隐藏video原生组件)
|
|
// uni.hideTabBar()
|
|
// uni.setNavigationBarColor({
|
|
// frontColor: '#000000', // 设置前景色为黑色
|
|
// backgroundColor: '#000000', // 设置背景色为黑色
|
|
// })
|
|
// this.videoShow = false
|
|
},
|
|
close() { //监听组件隐藏 (显示TabBar和NavigationBar,显示video原生组件)
|
|
// uni.showTabBar()
|
|
// uni.setNavigationBarColor({
|
|
// frontColor: '#ffffff', // 设置前景色为白色
|
|
// backgroundColor: '#000000', // 设置背景色为黑色
|
|
// })
|
|
// this.videoShow = true
|
|
},
|
|
onSave() {
|
|
// if (!this.checkType) {
|
|
// uni.showToast({
|
|
// title: '请选择检查类型',
|
|
// icon: 'none'
|
|
// })
|
|
// return
|
|
// }
|
|
// if (!this.enterpriseId) {
|
|
// uni.showToast({
|
|
// title: '请选择企业',
|
|
// icon: 'none'
|
|
// })
|
|
// return
|
|
// }
|
|
// if (!this.checkTime) {
|
|
// uni.showToast({
|
|
// title: '请选择检查时间',
|
|
// icon: 'none'
|
|
// })
|
|
// return
|
|
// }
|
|
if (this.hazardList.length == 0) {
|
|
uni.showToast({
|
|
title: '请至少添加一条隐患项',
|
|
icon: 'none'
|
|
})
|
|
return
|
|
}
|
|
for (let index = 0; index < this.hazardList.length; index++) {
|
|
const h = this.hazardList[index];
|
|
if (h.description.trim() == '') {
|
|
uni.showToast({
|
|
title: '隐患描述不能为空',
|
|
icon: 'none'
|
|
})
|
|
return
|
|
}
|
|
if (h.rectificationBasis.trim() == '') {
|
|
uni.showToast({
|
|
title: '整改依据不能为空',
|
|
icon: 'none'
|
|
})
|
|
return
|
|
}
|
|
}
|
|
const obj = {
|
|
id: this.id,
|
|
reviewResult: JSON.stringify(this.hazardList),
|
|
}
|
|
debugger;
|
|
Api.updateInitialReview(obj).then(res => {
|
|
debugger;
|
|
uni.showToast({
|
|
title: '修改成功',
|
|
icon: 'none'
|
|
})
|
|
setTimeout(() => {
|
|
uni.redirectTo({ url: '/pageIndex/checkHsitory/checkHsitory' })
|
|
}, 1500)
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
},
|
|
cancel() {
|
|
uni.navigateBack()
|
|
},
|
|
pass() {
|
|
this.formData = {
|
|
...this.formData,
|
|
status: '4',
|
|
}
|
|
if (!this.formData.initialReviewId) {
|
|
this.formData.initialReviewId = this.formData.id
|
|
this.formData.id = ''
|
|
Api.createReview(this.formData).then(res => {
|
|
uni.showToast({
|
|
title: '审核通过',
|
|
icon: 'none'
|
|
})
|
|
const obj = {
|
|
id: this.formData.initialReviewId,
|
|
status: '4',
|
|
}
|
|
Api.updateInitialReview(obj).then(res => {
|
|
|
|
setTimeout(() => {
|
|
uni.switchTab({ url: '/pages/index' })
|
|
}, 1500)
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
} else {
|
|
Api.updateReview(this.formData).then(res => {
|
|
uni.showToast({
|
|
title: '审核通过',
|
|
icon: 'none'
|
|
})
|
|
const obj = {
|
|
id: this.formData.initialReviewId,
|
|
status: '4',
|
|
}
|
|
Api.updateInitialReview(obj).then(res => {
|
|
|
|
setTimeout(() => {
|
|
uni.switchTab({ url: '/pages/index' })
|
|
}, 1500)
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
}
|
|
|
|
},
|
|
notPass() {
|
|
uni.showModal({
|
|
title: '提示',
|
|
content: '确定不通过审核?',
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
this.formData = {
|
|
...this.formData,
|
|
status: '3',
|
|
}
|
|
if (!this.formData.initialReviewId) {
|
|
this.formData.initialReviewId = this.formData.id
|
|
this.formData.id = ''
|
|
Api.createReview(this.formData).then(res => {
|
|
uni.showToast({
|
|
title: '审核不通过',
|
|
icon: 'none'
|
|
})
|
|
const obj = {
|
|
id: this.formData.initialReviewId,
|
|
status: '3',
|
|
}
|
|
Api.updateInitialReview(obj).then(res => {
|
|
|
|
setTimeout(() => {
|
|
uni.redirectTo({ url: '/pageIndex/checkHsitory/recheckHsitory' })
|
|
}, 1500)
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
} else {
|
|
Api.updateReview(this.formData).then(res => {
|
|
uni.showToast({
|
|
title: '审核不通过',
|
|
icon: 'none'
|
|
})
|
|
const obj = {
|
|
id: this.formData.initialReviewId,
|
|
status: '3',
|
|
}
|
|
Api.updateInitialReview(obj).then(res => {
|
|
|
|
setTimeout(() => {
|
|
uni.redirectTo({ url: '/pageIndex/checkHsitory/recheckHsitory' })
|
|
}, 1500)
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
}
|
|
|
|
} else {
|
|
uni.showToast({
|
|
title: '操作取消',
|
|
icon: 'none'
|
|
})
|
|
}
|
|
}
|
|
})
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.custom-content {
|
|
padding-bottom: 120rpx;
|
|
background: #f5f6fa;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.form-section {
|
|
background: #fff;
|
|
border-radius: 16rpx;
|
|
margin: 24rpx 0;
|
|
padding: 24rpx;
|
|
padding-bottom: 185rpx;
|
|
}
|
|
|
|
.form-item {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 32rpx;
|
|
justify-content: space-between;
|
|
|
|
.label {
|
|
// width: 180rpx;
|
|
color: #222;
|
|
font-size: 30rpx;
|
|
}
|
|
|
|
.icon-btn-box {
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
.icon-box {
|
|
width: 64rpx;
|
|
height: 56rpx;
|
|
background: #E8EFFF;
|
|
border-radius: 16rpx;
|
|
margin-right: 10rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
|
|
image {
|
|
width: 24rpx;
|
|
height: 24rpx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.input,
|
|
.picker-value,
|
|
.textarea {
|
|
flex: 1;
|
|
background: #f7f8fa;
|
|
border-radius: 8rpx;
|
|
padding: 16rpx;
|
|
font-size: 28rpx;
|
|
border: none;
|
|
min-height: 70rpx;
|
|
}
|
|
|
|
.picker-value {
|
|
color: #222;
|
|
}
|
|
|
|
.textarea {
|
|
min-height: 70rpx;
|
|
resize: none;
|
|
}
|
|
|
|
.photo-upload {
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
.photo-placeholder {
|
|
width: 100rpx;
|
|
height: 100rpx;
|
|
background: #e0e7ff;
|
|
border-radius: 16rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: #3E73F5;
|
|
font-size: 24rpx;
|
|
margin-left: 20rpx;
|
|
|
|
.photo-item {
|
|
width: 100%;
|
|
height: 100%;
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
.radio-group {
|
|
display: flex;
|
|
|
|
.radio {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-right: 32rpx;
|
|
|
|
.radio-text {
|
|
margin-left: 8rpx;
|
|
color: #888;
|
|
|
|
&.checked {
|
|
color: #3E73F5;
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.required .label::before {
|
|
content: '*';
|
|
color: #f56c6c;
|
|
margin-right: 8rpx;
|
|
}
|
|
|
|
.check-type-btns {
|
|
display: flex;
|
|
gap: 12rpx;
|
|
|
|
.check-btn {
|
|
padding: 0 14rpx;
|
|
border-radius: 8rpx;
|
|
background: #f7f8fa;
|
|
color: #3E73F5;
|
|
border: none;
|
|
font-size: 28rpx;
|
|
|
|
&.active {
|
|
background: #3E73F5;
|
|
color: #fff;
|
|
}
|
|
}
|
|
}
|
|
|
|
.tab-section {
|
|
// background: #fff;
|
|
// border-radius: 16rpx;
|
|
// padding: 20rpx;
|
|
// border: solid 1rpx #f1f1f1;
|
|
|
|
.tab-header {
|
|
display: flex;
|
|
margin-bottom: 24rpx;
|
|
position: relative;
|
|
padding-bottom: 20rpx;
|
|
padding-left: 20rpx;
|
|
|
|
&::before {
|
|
content: "";
|
|
position: absolute;
|
|
left: 0;
|
|
top: 10%;
|
|
width: 8rpx;
|
|
height: 30rpx;
|
|
background: linear-gradient(180deg, #3E73F5 0%, rgba(62, 115, 245, 0) 100%);
|
|
}
|
|
|
|
&::after {
|
|
content: "";
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 1rpx;
|
|
background: linear-gradient(90deg, #3E73F5 0%, rgba(62, 115, 245, 0) 100%);
|
|
}
|
|
|
|
.tab-item {
|
|
padding: 16rpx 32rpx;
|
|
font-size: 30rpx;
|
|
color: #888;
|
|
|
|
&.active {
|
|
color: #3E73F5;
|
|
border-bottom: 4rpx solid #3E73F5;
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
}
|
|
|
|
.tab-content {
|
|
.desc-box {
|
|
background: #f7f8fa;
|
|
border-radius: 12rpx;
|
|
padding: 16rpx;
|
|
color: #666;
|
|
font-size: 26rpx;
|
|
margin-bottom: 24rpx;
|
|
line-height: 1.8;
|
|
}
|
|
|
|
.action-btns {
|
|
display: flex;
|
|
gap: 16rpx;
|
|
|
|
.action-btn {
|
|
background: #F7F8FB;
|
|
color: #1B1B1B;
|
|
border-radius: 12rpx;
|
|
padding: 0 24rpx;
|
|
font-size: 26rpx;
|
|
border: none;
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
image {
|
|
width: 24rpx;
|
|
height: 24rpx;
|
|
margin-right: 9rpx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.form-item {
|
|
flex-direction: column;
|
|
align-items: inherit;
|
|
|
|
.label {
|
|
margin-bottom: 20rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.hazard-list {
|
|
background: #fff;
|
|
border-radius: 16rpx;
|
|
padding: 20rpx;
|
|
border: solid 1rpx #f1f1f1;
|
|
margin-bottom: 40rpx;
|
|
box-shadow: 0 0 5px 1px #e8e8e8;
|
|
}
|
|
|
|
.footer-bar {
|
|
position: fixed;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: #fff;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 24rpx 48rpx;
|
|
padding-bottom: 70rpx;
|
|
box-shadow: 0 -2rpx 8rpx rgba(0, 0, 0, 0.04);
|
|
z-index: 99;
|
|
|
|
.footer-btn {
|
|
flex: 1;
|
|
margin: 0 16rpx;
|
|
border-radius: 48rpx;
|
|
font-size: 32rpx;
|
|
padding: 6rpx 0;
|
|
border: none;
|
|
|
|
&.cancel {
|
|
background: #e6edff;
|
|
color: #3E73F5;
|
|
}
|
|
|
|
&.save {
|
|
background: #3E73F5;
|
|
color: #fff;
|
|
}
|
|
|
|
&.repass {
|
|
background: transparent;
|
|
color: #ef0000;
|
|
border: solid 1rpx #ef0000;
|
|
}
|
|
|
|
&.pass {
|
|
background: transparent;
|
|
color: #00b91d;
|
|
border: solid 1rpx #00b91d;
|
|
}
|
|
}
|
|
}
|
|
|
|
.photo-placeholder {
|
|
background: #e0e7ff;
|
|
width: 100rpx;
|
|
height: 100rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border-radius: 16rpx;
|
|
color: #3E73F5;
|
|
font-size: 26rpx;
|
|
}
|
|
|
|
.tab-header {
|
|
border-bottom: 2rpx solid #eee;
|
|
}
|
|
|
|
.tab-item.active {
|
|
color: #3E73F5;
|
|
font-weight: bold;
|
|
border-bottom: 4rpx solid #3E73F5;
|
|
}
|
|
|
|
.footer-btn {
|
|
flex: 1;
|
|
font-size: 30rpx;
|
|
margin: 0 16rpx;
|
|
padding: 20rpx 0;
|
|
border-radius: 48rpx;
|
|
}
|
|
|
|
.cancel {
|
|
background: #e6edff;
|
|
color: #3E73F5;
|
|
}
|
|
|
|
.save {
|
|
background: #3E73F5;
|
|
color: white;
|
|
}
|
|
|
|
|
|
::v-deep .custom-radio .wx-radio-input {
|
|
border-color: #ccc !important;
|
|
/* 未选中时边框颜色 */
|
|
}
|
|
|
|
::v-deep .custom-radio .wx-radio-input.wx-radio-input-checked {
|
|
background: #3E73F5 !important;
|
|
/* 选中时背景色 */
|
|
border-color: #3E73F5 !important;
|
|
/* 选中时边框颜色 */
|
|
}
|
|
|
|
::v-deep .custom-radio .wx-radio-input.wx-radio-input-checked::before {
|
|
color: transparent !important;
|
|
/* 隐藏默认图标 */
|
|
content: "" !important;
|
|
/* 清除默认内容 */
|
|
}
|
|
|
|
.uni-select {
|
|
border: none !important;
|
|
}
|
|
|
|
.popup-box {
|
|
width: 600rpx;
|
|
border-radius: 20rpx;
|
|
padding: 40rpx 30rpx;
|
|
box-sizing: border-box;
|
|
|
|
.pop-title {
|
|
text-align: center;
|
|
font-size: 36rpx;
|
|
font-weight: bold;
|
|
margin-bottom: 40rpx;
|
|
color: #333;
|
|
}
|
|
|
|
.content {
|
|
margin-bottom: 30rpx;
|
|
|
|
.label {
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
margin-bottom: 15rpx;
|
|
}
|
|
|
|
input {
|
|
width: 100%;
|
|
height: 80rpx;
|
|
border: 1rpx solid #e0e0e0;
|
|
border-radius: 10rpx;
|
|
padding: 0 20rpx;
|
|
box-sizing: border-box;
|
|
font-size: 32rpx;
|
|
}
|
|
|
|
input::placeholder {
|
|
color: #aaa;
|
|
}
|
|
}
|
|
|
|
.pop-btns {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-top: 50rpx;
|
|
|
|
button {
|
|
flex: 1;
|
|
height: 70rpx;
|
|
border-radius: 10rpx;
|
|
font-size: 30rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
button:first-child {
|
|
background: #f5f5f5;
|
|
color: #666;
|
|
margin-right: 20rpx;
|
|
}
|
|
|
|
button:last-child {
|
|
background: #3E73F5;
|
|
color: #fff;
|
|
margin-left: 20rpx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.selected-company {
|
|
max-width: 300rpx;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
margin-right: 20rpx;
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
}
|
|
|
|
.company-popup {
|
|
width: 650rpx;
|
|
max-height: 800rpx;
|
|
border-radius: 20rpx;
|
|
background: #fff;
|
|
display: flex;
|
|
flex-direction: column;
|
|
|
|
.company-popup-header {
|
|
padding: 30rpx;
|
|
border-bottom: 1rpx solid #eee;
|
|
|
|
.company-popup-title {
|
|
display: block;
|
|
text-align: center;
|
|
font-size: 36rpx;
|
|
font-weight: bold;
|
|
margin-bottom: 30rpx;
|
|
color: #333;
|
|
}
|
|
|
|
.search-box {
|
|
.search-input {
|
|
width: 100%;
|
|
height: 70rpx;
|
|
background: #f5f5f5;
|
|
border-radius: 10rpx;
|
|
padding: 0 20rpx;
|
|
font-size: 28rpx;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
}
|
|
|
|
.company-list {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
max-height: 500rpx;
|
|
padding: 20rpx 30rpx;
|
|
|
|
.company-item {
|
|
padding: 20rpx 0;
|
|
// border-bottom: 1rpx solid #f5f5f5;
|
|
|
|
.company-name {
|
|
font-size: 30rpx;
|
|
color: #333;
|
|
margin-bottom: 10rpx;
|
|
}
|
|
|
|
.company-address {
|
|
font-size: 24rpx;
|
|
color: #999;
|
|
}
|
|
}
|
|
|
|
.no-data {
|
|
text-align: center;
|
|
padding: 50rpx 0;
|
|
color: #999;
|
|
font-size: 28rpx;
|
|
}
|
|
}
|
|
|
|
.company-popup-footer {
|
|
padding: 20rpx 30rpx 30rpx;
|
|
border-top: 1rpx solid #eee;
|
|
|
|
.cancel-btn {
|
|
width: 100%;
|
|
height: 70rpx;
|
|
background: #f5f5f5;
|
|
color: #666;
|
|
border-radius: 10rpx;
|
|
font-size: 30rpx;
|
|
}
|
|
}
|
|
}
|
|
</style> |