基本功能都已完成
This commit is contained in:
263
components/AreaFormPopup.vue
Normal file
263
components/AreaFormPopup.vue
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
<template>
|
||||||
|
<view class="popup-mask" v-if="visible" @click="handleClose">
|
||||||
|
<view class="popup-content" @click.stop>
|
||||||
|
<view class="popup-header">
|
||||||
|
<view class="popup-title text-bold">{{ isEdit ? '编辑区域' : '新增区域' }}</view>
|
||||||
|
<view class="popup-close" @click="handleClose">×</view>
|
||||||
|
</view>
|
||||||
|
<view class="popup-body">
|
||||||
|
<!-- 区域名称 -->
|
||||||
|
<view class="flex margin-bottom-sm">
|
||||||
|
<view>区域名称</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<input
|
||||||
|
class="form-input"
|
||||||
|
v-model="formData.name"
|
||||||
|
placeholder="请输入区域名称"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 区域颜色 -->
|
||||||
|
<view class="flex margin-bottom-sm margin-top">
|
||||||
|
<view>区域颜色</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex align-center">
|
||||||
|
<input
|
||||||
|
class="color-input flex-sub"
|
||||||
|
v-model="formData.color"
|
||||||
|
placeholder="#FF5733"
|
||||||
|
/>
|
||||||
|
<view class="color-preview" :style="{ backgroundColor: formData.color }"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 预设颜色 -->
|
||||||
|
<view class="margin-top margin-bottom-sm text-gray">预设颜色</view>
|
||||||
|
<view class="color-grid">
|
||||||
|
<view
|
||||||
|
v-for="(color, index) in presetColors"
|
||||||
|
:key="color + index"
|
||||||
|
class="color-item"
|
||||||
|
:class="{ 'color-item-active': formData.color === color }"
|
||||||
|
:style="{ backgroundColor: color }"
|
||||||
|
@click="selectColor(color)"
|
||||||
|
></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="popup-footer">
|
||||||
|
<button class="btn-cancel" @click="handleClose">取消</button>
|
||||||
|
<button class="btn-confirm bg-blue" @click="handleSubmit" :loading="loading">确定</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isEdit: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
editData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:visible', 'submit', 'close']);
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formData = reactive({
|
||||||
|
name: '',
|
||||||
|
color: '#FF5733'
|
||||||
|
});
|
||||||
|
|
||||||
|
// 预设颜色
|
||||||
|
const presetColors = [
|
||||||
|
'#2563eb', '#ef4444', '#10b981', '#f59e0b', '#6366f1', '#ec4899', '#06b6d4',
|
||||||
|
'#84cc16', '#f97316', '#4f46e5', '#dc2626', '#f59e0b', '#d97706', '#8b5cf6',
|
||||||
|
'#db2777'
|
||||||
|
];
|
||||||
|
|
||||||
|
// 监听 editData 变化,填充表单
|
||||||
|
watch(() => props.editData, (newVal) => {
|
||||||
|
if (newVal && Object.keys(newVal).length > 0) {
|
||||||
|
formData.name = newVal.name || '';
|
||||||
|
formData.color = newVal.color || '#FF5733';
|
||||||
|
}
|
||||||
|
}, { immediate: true, deep: true });
|
||||||
|
|
||||||
|
// 监听弹窗关闭,重置表单
|
||||||
|
watch(() => props.visible, (newVal) => {
|
||||||
|
if (!newVal) {
|
||||||
|
resetForm();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 选择预设颜色
|
||||||
|
const selectColor = (color) => {
|
||||||
|
formData.color = color;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.name = '';
|
||||||
|
formData.color = '#FF5733';
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
const handleClose = () => {
|
||||||
|
emit('update:visible', false);
|
||||||
|
emit('close');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const handleSubmit = () => {
|
||||||
|
// 表单验证
|
||||||
|
if (!formData.name) {
|
||||||
|
uni.showToast({ title: '请输入区域名称', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!formData.color) {
|
||||||
|
uni.showToast({ title: '请选择区域颜色', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
emit('submit', {
|
||||||
|
name: formData.name,
|
||||||
|
color: formData.color
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
// 弹窗遮罩
|
||||||
|
.popup-mask {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 弹窗内容
|
||||||
|
.popup-content {
|
||||||
|
width: 600rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-close {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-body {
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-footer {
|
||||||
|
display: flex;
|
||||||
|
padding: 20rpx 30rpx 30rpx;
|
||||||
|
|
||||||
|
button {
|
||||||
|
flex: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin: 0 10rpx;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-cancel {
|
||||||
|
background: #f5f5f5;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-confirm {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单输入框
|
||||||
|
.form-input {
|
||||||
|
width: 100%;
|
||||||
|
height: 70rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
border: 2rpx solid #dadbde;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 颜色输入框
|
||||||
|
.color-input {
|
||||||
|
height: 70rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
border: 2rpx solid #dadbde;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 颜色预览
|
||||||
|
.color-preview {
|
||||||
|
width: 70rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
border: 2rpx solid #e5e5e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预设颜色网格
|
||||||
|
.color-grid {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-item {
|
||||||
|
width: 70rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
border: 4rpx solid transparent;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-item-active {
|
||||||
|
border-color: #333;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -48,8 +48,7 @@
|
|||||||
},
|
},
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */// "mp-weixin" : {
|
||||||
// "mp-weixin" : {
|
|
||||||
// "appid" : "",
|
// "appid" : "",
|
||||||
// "setting" : {
|
// "setting" : {
|
||||||
// "urlCheck" : false
|
// "urlCheck" : false
|
||||||
@@ -66,7 +65,7 @@
|
|||||||
// "usingComponents" : true
|
// "usingComponents" : true
|
||||||
// },
|
// },
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "",
|
"appid" : "wxe3533791db8a8734",
|
||||||
"mergeVirtualHostAttributes" : true,
|
"mergeVirtualHostAttributes" : true,
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
"setting" : {
|
"setting" : {
|
||||||
@@ -80,7 +79,7 @@
|
|||||||
"desc" : "你的位置信息将用于选择隐患位置"
|
"desc" : "你的位置信息将用于选择隐患位置"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"requiredPrivateInfos" : ["chooseLocation", "getLocation"]
|
"requiredPrivateInfos" : [ "chooseLocation", "getLocation" ]
|
||||||
},
|
},
|
||||||
"mp-toutiao" : {
|
"mp-toutiao" : {
|
||||||
"appid" : "",
|
"appid" : "",
|
||||||
@@ -90,5 +89,4 @@
|
|||||||
"enable" : false
|
"enable" : false
|
||||||
},
|
},
|
||||||
"vueVersion" : "3"
|
"vueVersion" : "3"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
{
|
{
|
||||||
"path":"pages/closeout/editor",
|
"path":"pages/closeout/editor",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "编辑销号申请"
|
"navigationBarTitleText": "销号详情"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -143,8 +143,8 @@
|
|||||||
{
|
{
|
||||||
"path":"pages/personalcenter/my",
|
"path":"pages/personalcenter/my",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的",
|
"navigationBarTitleText": "我的"
|
||||||
"navigationStyle": "custom"
|
// "navigationStyle": "custom"
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,23 +1,60 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page padding">
|
<view class="page padding">
|
||||||
<view class="text-gray text-center" v-if="!hasData">暂无证件照记录</view>
|
<!-- 证照列表 -->
|
||||||
<button class="cuIcon-add bg-blue round margin-top-xl" @click="showAddPopup = true">新增</button>
|
<view class="license-list" v-if="licenseList.length > 0">
|
||||||
|
<view class="license-item" v-for="(item, index) in licenseList" :key="item.id">
|
||||||
<!-- 新增证件照弹窗 -->
|
<view class="license-info">
|
||||||
<u-popup :show="showAddPopup" mode="center" round="20" @close="showAddPopup = false">
|
<view class="license-header">
|
||||||
<view class="popup-content">
|
<text class="license-type">{{ item.type || '未知类型' }}</text>
|
||||||
<view class="popup-header">
|
<view class="license-actions">
|
||||||
<view class="popup-title text-bold">新增证照</view>
|
<text class="action-btn text-blue" @click="handleEdit(item)">编辑</text>
|
||||||
<view class="popup-close" @click="showAddPopup = false">×</view>
|
<text class="action-btn text-red" @click="handleDelete(item)">删除</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="license-detail">
|
||||||
|
<view class="detail-row">
|
||||||
|
<text class="label">证件编号:</text>
|
||||||
|
<text class="value">{{ item.code || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="detail-row">
|
||||||
|
<text class="label">有效期:</text>
|
||||||
|
<text class="value">{{ item.startDate || '-' }} 至 {{ item.endDate || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="detail-row">
|
||||||
|
<text class="label">法人:</text>
|
||||||
|
<text class="value">{{ item.legalPerson || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="license-photo" v-if="item.photo">
|
||||||
|
<image :src="getImageUrl(item.photo)" mode="aspectFill" @click="previewImage(item.photo)"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="popup-body">
|
<!-- 空状态 -->
|
||||||
|
<view class="empty-state" v-else>
|
||||||
|
<text class="text-gray text-center">暂无证照记录</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 新增按钮 -->
|
||||||
|
<button class="add-btn cuIcon-add bg-blue round" @click="openAddPopup">+ 新增</button>
|
||||||
|
|
||||||
|
<!-- 新增/编辑证照弹窗 -->
|
||||||
|
<u-popup :show="showAddPopup" mode="center" round="20" @close="closePopup">
|
||||||
|
<view class="popup-content">
|
||||||
|
<view class="popup-header">
|
||||||
|
<view class="popup-title text-bold">{{ isEdit ? '编辑证照' : '新增证照' }}</view>
|
||||||
|
<view class="popup-close" @click="closePopup">×</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<scroll-view class="popup-body" scroll-y>
|
||||||
<!-- 部门 -->
|
<!-- 部门 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">部门<text class="text-red">*</text></view>
|
<view class="form-label">部门<text class="text-red">*</text></view>
|
||||||
<view class="form-input form-select" @click="showDeptPopup = true">
|
<view class="form-input form-select" @click="showDeptPopup = true">
|
||||||
<text :class="formData.dept ? '' : 'text-gray'">
|
<text :class="formData.enterpriseName ? '' : 'text-gray'">
|
||||||
{{ formData.dept || '请选择部门' }}
|
{{ formData.enterpriseName || '请选择部门' }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -25,49 +62,60 @@
|
|||||||
<!-- 证件类型 -->
|
<!-- 证件类型 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">证件类型</view>
|
<view class="form-label">证件类型</view>
|
||||||
<input class="form-input" v-model="formData.idType" placeholder="请输入证件类型" />
|
<input class="form-input" v-model="formData.type" placeholder="请输入证件类型" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 证件编号 -->
|
<!-- 证件编号 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">证件编号</view>
|
<view class="form-label">证件编号</view>
|
||||||
<input class="form-input" v-model="formData.number" placeholder="请输入证件编号" />
|
<input class="form-input" v-model="formData.code" placeholder="请输入证件编号" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 开始日期 -->
|
<!-- 开始日期 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">开始日期</view>
|
<view class="form-label">开始日期</view>
|
||||||
<view class="form-input form-select" @click="showDatePicker = true">
|
<view class="form-input form-select" @click="openDatePicker('start')">
|
||||||
<text :class="formData.expireDate ? '' : 'text-gray'">
|
<text :class="formData.startDate ? '' : 'text-gray'">
|
||||||
{{ formData.expireDate || '请选择开始时间' }}
|
{{ formData.startDate || '请选择开始日期' }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 结束日期 -->
|
<!-- 结束日期 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">结束日期</view>
|
<view class="form-label">结束日期</view>
|
||||||
<view class="form-input form-select" @click="showDatePicker = true">
|
<view class="form-input form-select" @click="openDatePicker('end')">
|
||||||
<text :class="formData.expireDate ? '' : 'text-gray'">
|
<text :class="formData.endDate ? '' : 'text-gray'">
|
||||||
{{ formData.expireDate || '请选择结束时间' }}
|
{{ formData.endDate || '请选择结束日期' }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 上传证件照 -->
|
<!-- 法人 -->
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="form-label">法人</view>
|
||||||
|
<input class="form-input" v-model="formData.legalPerson" placeholder="请输入法人" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 封面图片 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">封面图片</view>
|
<view class="form-label">封面图片</view>
|
||||||
<view class="upload-box" @click="chooseImage">
|
<view class="upload-box" @click="chooseImage">
|
||||||
<view class="upload-add" v-if="!formData.image">
|
<view class="upload-add" v-if="!formData.photoPreview">
|
||||||
<text class="upload-icon">+</text>
|
<text class="upload-icon">+</text>
|
||||||
<text class="upload-text">上传照片</text>
|
<text class="upload-text">上传照片</text>
|
||||||
</view>
|
</view>
|
||||||
<image v-else :src="formData.image" mode="aspectFill" class="upload-img"></image>
|
<view class="upload-preview" v-else>
|
||||||
|
<image :src="formData.photoPreview" mode="aspectFill" class="upload-img"></image>
|
||||||
|
<view class="upload-delete" @click.stop="removeImage">×</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
<view class="popup-footer">
|
<view class="popup-footer">
|
||||||
<button class="btn-cancel" @click="showAddPopup = false">取消</button>
|
<button class="btn-cancel" @click="closePopup">取消</button>
|
||||||
<button class="btn-confirm bg-blue" @click="handleSubmit">确定</button>
|
<button class="btn-confirm bg-blue" @click="handleSubmit" :loading="submitting">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
@@ -75,9 +123,11 @@
|
|||||||
<!-- 日期选择器 -->
|
<!-- 日期选择器 -->
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
:show="showDatePicker"
|
:show="showDatePicker"
|
||||||
|
v-model="datePickerValue"
|
||||||
mode="date"
|
mode="date"
|
||||||
@confirm="onDateConfirm"
|
@confirm="onDateConfirm"
|
||||||
@cancel="showDatePicker = false"
|
@cancel="onDateCancel"
|
||||||
|
@close="onDateCancel"
|
||||||
></u-datetime-picker>
|
></u-datetime-picker>
|
||||||
|
|
||||||
<!-- 选择部门弹窗 -->
|
<!-- 选择部门弹窗 -->
|
||||||
@@ -88,60 +138,289 @@
|
|||||||
<view class="popup-close" @click="showDeptPopup = false">×</view>
|
<view class="popup-close" @click="showDeptPopup = false">×</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="dept-list">
|
<scroll-view class="dept-list" scroll-y v-if="deptList.length > 0">
|
||||||
<view
|
<view
|
||||||
class="dept-item"
|
class="dept-item"
|
||||||
v-for="(item, index) in deptList"
|
v-for="item in deptList"
|
||||||
:key="index"
|
:key="item.id"
|
||||||
@click="selectedDept = item"
|
@click="selectedDept = item"
|
||||||
>
|
>
|
||||||
<view class="dept-checkbox" :class="{ 'dept-checkbox-active': selectedDept === item }">
|
<view class="dept-checkbox" :class="{ 'dept-checkbox-active': selectedDept && selectedDept.id === item.id }">
|
||||||
<text v-if="selectedDept === item">✓</text>
|
<text v-if="selectedDept && selectedDept.id === item.id">✓</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="dept-name">{{ item }}</text>
|
<text class="dept-name">{{ item.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="text-gray text-center padding" v-else>
|
||||||
|
暂无部门数据
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<button class="btn-dept-confirm bg-blue" @click="confirmDept">确定</button>
|
<button class="btn-dept-confirm bg-blue" @click="confirmDept">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
|
<!-- 删除确认弹窗 -->
|
||||||
|
<u-modal
|
||||||
|
:show="showDeleteModal"
|
||||||
|
title="确认删除"
|
||||||
|
content="确定要删除这条证照记录吗?"
|
||||||
|
showCancelButton
|
||||||
|
@confirm="confirmDelete"
|
||||||
|
@cancel="showDeleteModal = false"
|
||||||
|
></u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
|
import {
|
||||||
|
getLicenseEnterpriseSelect,
|
||||||
|
getLicenseList,
|
||||||
|
getLicenseDetail,
|
||||||
|
addLicense,
|
||||||
|
updateLicense,
|
||||||
|
deleteLicense
|
||||||
|
} from '@/request/three_one_api/license.js';
|
||||||
|
import { baseUrl, getToken } from '@/request/request.js';
|
||||||
|
|
||||||
const hasData = ref(false);
|
// 证照列表
|
||||||
|
const licenseList = ref([]);
|
||||||
|
// 部门列表
|
||||||
|
const deptList = ref([]);
|
||||||
|
const selectedDept = ref(null);
|
||||||
|
|
||||||
|
// 弹窗控制
|
||||||
const showAddPopup = ref(false);
|
const showAddPopup = ref(false);
|
||||||
const showDatePicker = ref(false);
|
const showDatePicker = ref(false);
|
||||||
const showDeptPopup = ref(false);
|
const showDeptPopup = ref(false);
|
||||||
|
const showDeleteModal = ref(false);
|
||||||
|
|
||||||
// 部门列表
|
// 编辑状态
|
||||||
const deptList = ref([
|
const isEdit = ref(false);
|
||||||
'湘西自治州和谐网络科技有限公司',
|
const currentEditId = ref(null);
|
||||||
'湘西自治州和谐云大数据科技有限公司',
|
const currentDeleteItem = ref(null);
|
||||||
'湘西网络有限公司'
|
const submitting = ref(false);
|
||||||
]);
|
|
||||||
const selectedDept = ref('');
|
|
||||||
|
|
||||||
|
// 日期选择类型
|
||||||
|
const datePickerType = ref('start');
|
||||||
|
// 日期选择器的值(时间戳)
|
||||||
|
const datePickerValue = ref(Date.now());
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
dept: '',
|
enterpriseId: '',
|
||||||
|
enterpriseName: '',
|
||||||
type: '',
|
type: '',
|
||||||
idType: '',
|
code: '',
|
||||||
number: '',
|
|
||||||
startDate: '',
|
startDate: '',
|
||||||
expireDate: '',
|
endDate: '',
|
||||||
image: ''
|
legalPerson: '',
|
||||||
|
photo: '',
|
||||||
|
photoPreview: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 页面加载
|
||||||
|
onMounted(() => {
|
||||||
|
loadLicenseList();
|
||||||
|
loadDeptList();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取图片完整URL
|
||||||
|
const getImageUrl = (path) => {
|
||||||
|
if (!path) return '';
|
||||||
|
if (path.startsWith('http')) return path;
|
||||||
|
return baseUrl + path;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 预览图片
|
||||||
|
const previewImage = (path) => {
|
||||||
|
uni.previewImage({
|
||||||
|
urls: [getImageUrl(path)]
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 加载证照列表
|
||||||
|
const loadLicenseList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getLicenseList();
|
||||||
|
if (res.code === 0) {
|
||||||
|
licenseList.value = res.data.records || [];
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('获取证照列表失败:', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 加载部门列表
|
||||||
|
const loadDeptList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getLicenseEnterpriseSelect();
|
||||||
|
if (res.code === 0) {
|
||||||
|
deptList.value = res.data || [];
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('获取部门列表失败:', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 打开新增弹窗
|
||||||
|
const openAddPopup = () => {
|
||||||
|
resetForm();
|
||||||
|
isEdit.value = false;
|
||||||
|
currentEditId.value = null;
|
||||||
|
showAddPopup.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 编辑证照
|
||||||
|
const handleEdit = async (item) => {
|
||||||
|
try {
|
||||||
|
// 先获取详情
|
||||||
|
const res = await getLicenseDetail({ id: item.id });
|
||||||
|
if (res.code === 0) {
|
||||||
|
const detail = res.data;
|
||||||
|
isEdit.value = true;
|
||||||
|
currentEditId.value = item.id;
|
||||||
|
|
||||||
|
// 填充表单数据
|
||||||
|
formData.enterpriseId = detail.enterpriseId || '';
|
||||||
|
formData.type = detail.type || '';
|
||||||
|
formData.code = detail.code || '';
|
||||||
|
formData.startDate = detail.startDate || '';
|
||||||
|
formData.endDate = detail.endDate || '';
|
||||||
|
formData.legalPerson = detail.legalPerson || '';
|
||||||
|
formData.photo = detail.photo || '';
|
||||||
|
formData.photoPreview = detail.photo ? getImageUrl(detail.photo) : '';
|
||||||
|
|
||||||
|
// 设置部门名称
|
||||||
|
const dept = deptList.value.find(d => d.id === detail.enterpriseId);
|
||||||
|
formData.enterpriseName = dept ? dept.name : '';
|
||||||
|
selectedDept.value = dept || null;
|
||||||
|
|
||||||
|
showAddPopup.value = true;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('获取证照详情失败:', err);
|
||||||
|
uni.showToast({ title: '获取详情失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 删除证照
|
||||||
|
const handleDelete = (item) => {
|
||||||
|
currentDeleteItem.value = item;
|
||||||
|
showDeleteModal.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 确认删除
|
||||||
|
const confirmDelete = async () => {
|
||||||
|
if (!currentDeleteItem.value) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await deleteLicense({ id: currentDeleteItem.value.id });
|
||||||
|
if (res.code === 0) {
|
||||||
|
uni.showToast({ title: '删除成功', icon: 'success' });
|
||||||
|
loadLicenseList();
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('删除失败:', err);
|
||||||
|
uni.showToast({ title: '删除失败', icon: 'none' });
|
||||||
|
} finally {
|
||||||
|
showDeleteModal.value = false;
|
||||||
|
currentDeleteItem.value = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
const closePopup = () => {
|
||||||
|
showAddPopup.value = false;
|
||||||
|
resetForm();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.enterpriseId = '';
|
||||||
|
formData.enterpriseName = '';
|
||||||
|
formData.type = '';
|
||||||
|
formData.code = '';
|
||||||
|
formData.startDate = '';
|
||||||
|
formData.endDate = '';
|
||||||
|
formData.legalPerson = '';
|
||||||
|
formData.photo = '';
|
||||||
|
formData.photoPreview = '';
|
||||||
|
selectedDept.value = null;
|
||||||
|
isEdit.value = false;
|
||||||
|
currentEditId.value = null;
|
||||||
|
};
|
||||||
|
|
||||||
// 确认选择部门
|
// 确认选择部门
|
||||||
const confirmDept = () => {
|
const confirmDept = () => {
|
||||||
if (selectedDept.value) {
|
if (selectedDept.value) {
|
||||||
formData.dept = selectedDept.value;
|
formData.enterpriseId = selectedDept.value.id;
|
||||||
|
formData.enterpriseName = selectedDept.value.name;
|
||||||
}
|
}
|
||||||
showDeptPopup.value = false;
|
showDeptPopup.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 打开日期选择器
|
||||||
|
const openDatePicker = (type) => {
|
||||||
|
datePickerType.value = type;
|
||||||
|
|
||||||
|
// 根据已有的日期设置选择器初始值
|
||||||
|
let currentDate = '';
|
||||||
|
if (type === 'start' && formData.startDate) {
|
||||||
|
currentDate = formData.startDate;
|
||||||
|
} else if (type === 'end' && formData.endDate) {
|
||||||
|
currentDate = formData.endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果有已选择的日期,转换为时间戳
|
||||||
|
if (currentDate) {
|
||||||
|
datePickerValue.value = new Date(currentDate).getTime();
|
||||||
|
} else {
|
||||||
|
datePickerValue.value = Date.now();
|
||||||
|
}
|
||||||
|
|
||||||
|
showDatePicker.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 日期选择取消/关闭
|
||||||
|
const onDateCancel = () => {
|
||||||
|
showDatePicker.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 日期选择确认
|
||||||
|
const onDateConfirm = (e) => {
|
||||||
|
// 使用 v-model 绑定的 datePickerValue
|
||||||
|
const timestamp = datePickerValue.value;
|
||||||
|
|
||||||
|
// 验证时间戳
|
||||||
|
if (!timestamp || isNaN(timestamp)) {
|
||||||
|
console.error('无效的日期值:', timestamp);
|
||||||
|
showDatePicker.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const date = new Date(timestamp);
|
||||||
|
|
||||||
|
// 验证日期是否有效
|
||||||
|
if (isNaN(date.getTime())) {
|
||||||
|
console.error('无效的日期:', date);
|
||||||
|
showDatePicker.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const dateStr = `${year}-${month}-${day}`;
|
||||||
|
|
||||||
|
if (datePickerType.value === 'start') {
|
||||||
|
formData.startDate = dateStr;
|
||||||
|
} else {
|
||||||
|
formData.endDate = dateStr;
|
||||||
|
}
|
||||||
|
showDatePicker.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
// 选择图片
|
// 选择图片
|
||||||
const chooseImage = () => {
|
const chooseImage = () => {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
@@ -149,40 +428,102 @@ const chooseImage = () => {
|
|||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
sourceType: ['album', 'camera'],
|
sourceType: ['album', 'camera'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
formData.image = res.tempFilePaths[0];
|
const tempFilePath = res.tempFilePaths[0];
|
||||||
|
formData.photoPreview = tempFilePath;
|
||||||
|
// 上传图片
|
||||||
|
uploadImage(tempFilePath);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 日期选择确认
|
// 上传图片
|
||||||
const onDateConfirm = (e) => {
|
const uploadImage = (filePath) => {
|
||||||
const date = new Date(e.value);
|
uni.showLoading({ title: '上传中...' });
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
uni.uploadFile({
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
url: baseUrl + '/frontend/attachment/upload',
|
||||||
formData.expireDate = `${year}-${month}-${day}`;
|
filePath: filePath,
|
||||||
showDatePicker.value = false;
|
name: 'file',
|
||||||
|
header: {
|
||||||
|
'Authorization': getToken()
|
||||||
|
},
|
||||||
|
success: (uploadRes) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
try {
|
||||||
|
const data = JSON.parse(uploadRes.data);
|
||||||
|
if (data.code === 0 && data.data) {
|
||||||
|
formData.photo = data.data.url || data.data;
|
||||||
|
uni.showToast({ title: '上传成功', icon: 'success' });
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: data.msg || '上传失败', icon: 'none' });
|
||||||
|
formData.photoPreview = '';
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('解析上传结果失败:', e);
|
||||||
|
uni.showToast({ title: '上传失败', icon: 'none' });
|
||||||
|
formData.photoPreview = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
console.error('上传失败:', err);
|
||||||
|
uni.showToast({ title: '上传失败', icon: 'none' });
|
||||||
|
formData.photoPreview = '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 移除图片
|
||||||
|
const removeImage = () => {
|
||||||
|
formData.photo = '';
|
||||||
|
formData.photoPreview = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const handleSubmit = () => {
|
const handleSubmit = async () => {
|
||||||
if (!formData.dept) {
|
// 表单验证
|
||||||
|
if (!formData.enterpriseId) {
|
||||||
uni.showToast({ title: '请选择部门', icon: 'none' });
|
uni.showToast({ title: '请选择部门', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('提交数据:', formData);
|
submitting.value = true;
|
||||||
uni.showToast({ title: '新增成功', icon: 'success' });
|
|
||||||
showAddPopup.value = false;
|
|
||||||
|
|
||||||
// 重置表单
|
try {
|
||||||
formData.dept = '';
|
const submitData = {
|
||||||
formData.type = '';
|
enterpriseId: formData.enterpriseId,
|
||||||
formData.number = '';
|
type: formData.type,
|
||||||
formData.startDate = '';
|
code: formData.code,
|
||||||
formData.expireDate = '';
|
startDate: formData.startDate,
|
||||||
formData.image = '';
|
endDate: formData.endDate,
|
||||||
selectedDept.value = '';
|
legalPerson: formData.legalPerson,
|
||||||
|
photo: formData.photo
|
||||||
|
};
|
||||||
|
|
||||||
|
let res;
|
||||||
|
if (isEdit.value) {
|
||||||
|
// 编辑
|
||||||
|
submitData.id = currentEditId.value;
|
||||||
|
res = await updateLicense(submitData);
|
||||||
|
} else {
|
||||||
|
// 新增
|
||||||
|
res = await addLicense(submitData);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.code === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: isEdit.value ? '修改成功' : '新增成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
closePopup();
|
||||||
|
loadLicenseList();
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('提交失败:', err);
|
||||||
|
uni.showToast({ title: '操作失败', icon: 'none' });
|
||||||
|
} finally {
|
||||||
|
submitting.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -190,6 +531,96 @@ const handleSubmit = () => {
|
|||||||
.page {
|
.page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
|
padding-bottom: 120rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 证照列表样式
|
||||||
|
.license-list {
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.license-item {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
padding: 24rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.license-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
padding-bottom: 16rpx;
|
||||||
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.license-type {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.license-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
font-size: 28rpx;
|
||||||
|
padding: 8rpx 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.license-detail {
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-row {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: #999;
|
||||||
|
width: 160rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
color: #333;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.license-photo {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 空状态
|
||||||
|
.empty-state {
|
||||||
|
padding: 200rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增按钮
|
||||||
|
.add-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
line-height: 88rpx;
|
||||||
|
border-radius: 44rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 弹出框样式
|
// 弹出框样式
|
||||||
@@ -257,6 +688,7 @@ const handleSubmit = () => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upload-add {
|
.upload-add {
|
||||||
@@ -276,12 +708,33 @@ const handleSubmit = () => {
|
|||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.upload-preview {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.upload-img {
|
.upload-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.upload-delete {
|
||||||
|
position: absolute;
|
||||||
|
top: -16rpx;
|
||||||
|
right: -16rpx;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
background: #ff4d4f;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.popup-footer {
|
.popup-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page padding">
|
<view class="page padding">
|
||||||
|
<!-- 进度显示 -->
|
||||||
|
<view class="progress-bar" v-if="checkData">
|
||||||
|
<view class="progress-text">
|
||||||
|
<text class="current-index">第 {{ checkData.currentIndex || 1 }} 个问题</text>
|
||||||
|
<text class="total-count"> / 共 {{ checkData.totalCount || 1 }} 个</text>
|
||||||
|
</view>
|
||||||
|
<view class="progress-line">
|
||||||
|
<view class="progress-inner" :style="{ width: progressPercent + '%' }"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="padding bg-white radius">
|
<view class="padding bg-white radius">
|
||||||
<view class="text-bold">{{ checkData?.name || '加载中...' }}</view>
|
<view class="text-bold">{{ checkData?.name || '加载中...' }}</view>
|
||||||
<view class="margin-top">
|
<view class="margin-top">
|
||||||
@@ -22,18 +33,169 @@
|
|||||||
</u-radio>
|
</u-radio>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
|
||||||
|
<!-- 异常时显示隐患信息区域 -->
|
||||||
|
<view v-if="radiovalue1 === '异常'" class="hazard-section margin-top">
|
||||||
|
<view class="hazard-tip">
|
||||||
|
<text class="cuIcon-warn text-yellow margin-right-xs"></text>
|
||||||
|
<text class="text-orange">检查结果为异常,需填写隐患信息</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 未填写时显示按钮 -->
|
||||||
|
<view v-if="!hasHazardData" class="hazard-btn" @click="openHazardPopup">
|
||||||
|
<text class="text-blue">填写隐患信息</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 已填写时显示卡片 -->
|
||||||
|
<view v-else class="hazard-card">
|
||||||
|
<view class="card-header">
|
||||||
|
<view class="text-bold text-black">{{ hazardFormData.title }}</view>
|
||||||
|
<view class="level-tag" :class="{
|
||||||
|
'level-minor': hazardFormData.level === 0,
|
||||||
|
'level-normal': hazardFormData.level === 1,
|
||||||
|
'level-major': hazardFormData.level === 2
|
||||||
|
}">{{ levelOptions[hazardFormData.level]?.title }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="card-body">
|
||||||
|
<view class="info-row">
|
||||||
|
<text class="text-gray">隐患来源:</text>
|
||||||
|
<text>{{ sourceOptions[hazardFormData.source]?.title || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-row">
|
||||||
|
<text class="text-gray">隐患位置:</text>
|
||||||
|
<text>{{ hazardAddress || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-row">
|
||||||
|
<text class="text-gray">隐患描述:</text>
|
||||||
|
<text class="description-text">{{ hazardFormData.description || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-row" v-if="hazardFileList.length > 0">
|
||||||
|
<text class="text-gray">附件:</text>
|
||||||
|
<text>{{ hazardFileList.length }}个文件</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="card-footer">
|
||||||
|
<button class="btn-edit" @click="editHazard">修改</button>
|
||||||
|
<button class="btn-clear" @click="clearHazard">清除</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="margin-top">
|
||||||
<up-textarea v-model="value1" placeholder="请输入备注信息" ></up-textarea>
|
<up-textarea v-model="value1" placeholder="请输入备注信息" ></up-textarea>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="bg-blue round margin-top-xl" @click="handleSubmit">提交</button>
|
<button class="bg-blue round margin-top-xl" @click="handleSubmit">提交</button>
|
||||||
|
|
||||||
|
<!-- 新增隐患弹窗 -->
|
||||||
|
<u-popup :show="showHazardPopup" mode="center" round="20" @close="showHazardPopup = false">
|
||||||
|
<view class="popup-content">
|
||||||
|
<view class="popup-header">
|
||||||
|
<view class="popup-title text-bold">填写隐患信息</view>
|
||||||
|
<view class="popup-close" @click="showHazardPopup = false">×</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view class="popup-body" scroll-y :style="{ height: '60vh' }">
|
||||||
|
<view class="flex margin-bottom">
|
||||||
|
<view class="text-gray">隐患图片/视频</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<up-upload :fileList="hazardFileList" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
||||||
|
:maxCount="10"></up-upload>
|
||||||
|
<view class="text-gray text-sm">必填:请上传现场照片或者视频作为隐患证据</view>
|
||||||
|
<view class="flex margin-bottom margin-top">
|
||||||
|
<view class="text-gray">隐患标题</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<up-input placeholder="请输入内容" border="surround" v-model="hazardFormData.title"></up-input>
|
||||||
|
<view class="text-sm text-gray margin-top-xs">请用简洁的语言概括隐患要点</view>
|
||||||
|
<view class="flex margin-bottom margin-top">
|
||||||
|
<view class="text-gray">隐患等级</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<up-choose v-model="hazardFormData.level" :options="levelOptions" :wrap="false" item-width="183rpx"
|
||||||
|
item-height="72rpx"></up-choose>
|
||||||
|
<view class="flex margin-bottom margin-top">
|
||||||
|
<view class="text-gray">隐患来源</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<up-choose v-model="hazardFormData.source" :options="sourceOptions" :wrap="false" item-width="183rpx"
|
||||||
|
item-height="72rpx"></up-choose>
|
||||||
|
<view class="flex margin-bottom margin-top">
|
||||||
|
<view class="text-gray">隐患位置</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="address-box">
|
||||||
|
<up-input class="address-input-wrapper" v-model="hazardAddress" placeholder="请输入地址" border="surround"></up-input>
|
||||||
|
<button class="btn-address bg-blue" @tap.stop="chooseLocation">选择地址</button>
|
||||||
|
</view>
|
||||||
|
<view class="text-gray text-sm margin-top-xs">如:办公楼3层东侧消防通道、生产车间A区设备旁等</view>
|
||||||
|
|
||||||
|
<!-- 隐患区域选择 -->
|
||||||
|
<view class="flex margin-bottom margin-top">
|
||||||
|
<view class="text-gray">隐患区域</view>
|
||||||
|
</view>
|
||||||
|
<view class="select-trigger" @click="showAreaPicker = true">
|
||||||
|
<view class="select-value" :class="{ 'placeholder': !selectedAreaName }">
|
||||||
|
{{ selectedAreaName || '请选择隐患区域' }}
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-unfold"></text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="flex margin-bottom margin-top">
|
||||||
|
<view class="text-gray">隐患描述</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<up-textarea v-model="hazardFormData.description" placeholder="请输入内容"></up-textarea>
|
||||||
|
<view class="text-gray text-sm margin-top-xs">请详细说明隐患现状、潜在风险及影响范围</view>
|
||||||
|
<view class="text-gray margin-bottom margin-top">隐患标签</view>
|
||||||
|
<up-choose v-model="hazardFormData.tagIndex" :options="tagOptions"></up-choose>
|
||||||
|
<view class="text-gray text-sm">可选择多个相关标签对隐患进行分类</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="popup-footer">
|
||||||
|
<button class="btn-cancel" @click="showHazardPopup = false">取消</button>
|
||||||
|
<button class="btn-confirm bg-blue" @click="confirmHazard">确定</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
|
||||||
|
<!-- 区域选择弹窗 -->
|
||||||
|
<u-popup :show="showAreaPicker" mode="bottom" round="20" @close="showAreaPicker = false">
|
||||||
|
<view class="picker-popup">
|
||||||
|
<view class="picker-header">
|
||||||
|
<view class="picker-cancel" @click="showAreaPicker = false">取消</view>
|
||||||
|
<view class="picker-title">选择隐患区域</view>
|
||||||
|
<view class="picker-confirm" @click="confirmAreaSelect">确定</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view class="picker-body" scroll-y>
|
||||||
|
<view
|
||||||
|
v-for="item in areaList"
|
||||||
|
:key="item.id"
|
||||||
|
class="picker-item"
|
||||||
|
:class="{ 'picker-item-active': tempAreaId === item.id }"
|
||||||
|
@click="tempAreaId = item.id"
|
||||||
|
>
|
||||||
|
<view class="flex align-center">
|
||||||
|
<view class="area-color-dot" :style="{ backgroundColor: item.color }"></view>
|
||||||
|
<text>{{ item.name }}</text>
|
||||||
|
</view>
|
||||||
|
<text v-if="tempAreaId === item.id" class="cuIcon-check text-blue"></text>
|
||||||
|
</view>
|
||||||
|
<view v-if="areaList.length === 0" class="text-gray text-center padding">
|
||||||
|
暂无区域数据
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive, computed } from 'vue';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { enterCheckPlan,submitCheckResult } from '@/request/api.js';
|
import { enterCheckPlan, submitCheckResult, addHiddenDanger, getHiddenDangerLabelList } from '@/request/api.js';
|
||||||
|
import { baseUrl, getToken } from '@/request/request.js';
|
||||||
|
import { getAreaList } from '@/request/three_one_api/area.js';
|
||||||
|
|
||||||
// 页面参数
|
// 页面参数
|
||||||
const oneTableId = ref('');
|
const oneTableId = ref('');
|
||||||
@@ -64,6 +226,10 @@
|
|||||||
|
|
||||||
const groupChange = (n) => {
|
const groupChange = (n) => {
|
||||||
console.log('groupChange', n);
|
console.log('groupChange', n);
|
||||||
|
// 切换到非异常时清除隐患数据
|
||||||
|
if (n !== '异常') {
|
||||||
|
clearHazard();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const radioChange = (n) => {
|
const radioChange = (n) => {
|
||||||
@@ -73,6 +239,232 @@
|
|||||||
// 备注
|
// 备注
|
||||||
const value1 = ref('');
|
const value1 = ref('');
|
||||||
|
|
||||||
|
// ==================== 隐患信息相关 ====================
|
||||||
|
|
||||||
|
// 弹窗控制
|
||||||
|
const showHazardPopup = ref(false);
|
||||||
|
|
||||||
|
// 隐患表单数据(暂存)
|
||||||
|
const hazardFormData = reactive({
|
||||||
|
title: '',
|
||||||
|
level: 0,
|
||||||
|
source: 0,
|
||||||
|
description: '',
|
||||||
|
tagIndex: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
// 隐患地址和经纬度
|
||||||
|
const hazardAddress = ref('');
|
||||||
|
const hazardLng = ref(0);
|
||||||
|
const hazardLat = ref(0);
|
||||||
|
|
||||||
|
// 区域选择相关
|
||||||
|
const showAreaPicker = ref(false);
|
||||||
|
const areaList = ref([]);
|
||||||
|
const selectedAreaId = ref('');
|
||||||
|
const selectedAreaName = ref('');
|
||||||
|
const tempAreaId = ref('');
|
||||||
|
|
||||||
|
// 获取区域列表
|
||||||
|
const fetchAreaList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getAreaList();
|
||||||
|
if (res.code === 0 && res.data && res.data.records) {
|
||||||
|
areaList.value = res.data.records;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取区域列表失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 确认区域选择
|
||||||
|
const confirmAreaSelect = () => {
|
||||||
|
if (tempAreaId.value) {
|
||||||
|
selectedAreaId.value = tempAreaId.value;
|
||||||
|
const selected = areaList.value.find(item => item.id === tempAreaId.value);
|
||||||
|
selectedAreaName.value = selected ? selected.name : '';
|
||||||
|
}
|
||||||
|
showAreaPicker.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 隐患附件列表
|
||||||
|
const hazardFileList = ref([]);
|
||||||
|
|
||||||
|
// 是否已填写隐患数据
|
||||||
|
const hasHazardData = computed(() => {
|
||||||
|
return hazardFormData.title && hazardFileList.value.length > 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 进度百分比
|
||||||
|
const progressPercent = computed(() => {
|
||||||
|
if (!checkData.value) return 0;
|
||||||
|
const current = checkData.value.currentIndex || 1;
|
||||||
|
const total = checkData.value.totalCount || 1;
|
||||||
|
return Math.round((current / total) * 100);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 隐患等级选项
|
||||||
|
const levelOptions = ref([
|
||||||
|
{ id: 1, title: '轻微隐患' },
|
||||||
|
{ id: 2, title: '一般隐患' },
|
||||||
|
{ id: 3, title: '重大隐患' }
|
||||||
|
]);
|
||||||
|
|
||||||
|
// 隐患来源选项
|
||||||
|
const sourceOptions = ref([
|
||||||
|
{ id: 1, title: '随手拍' },
|
||||||
|
{ id: 2, title: '企业自查' },
|
||||||
|
{ id: 3, title: '行业互查' },
|
||||||
|
{ id: 4, title: '专家诊查' }
|
||||||
|
]);
|
||||||
|
|
||||||
|
// 隐患标签选项
|
||||||
|
const tagOptions = ref([]);
|
||||||
|
|
||||||
|
// 获取隐患标签列表
|
||||||
|
const fetchTagOptions = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getHiddenDangerLabelList();
|
||||||
|
if (res.code === 0) {
|
||||||
|
tagOptions.value = res.data.map(item => ({
|
||||||
|
id: item.id,
|
||||||
|
title: item.name
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取标签列表失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 打开隐患信息弹窗
|
||||||
|
const openHazardPopup = () => {
|
||||||
|
showHazardPopup.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 编辑隐患信息(回显数据)
|
||||||
|
const editHazard = () => {
|
||||||
|
showHazardPopup.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 清除隐患信息
|
||||||
|
const clearHazard = () => {
|
||||||
|
hazardFormData.title = '';
|
||||||
|
hazardFormData.level = 0;
|
||||||
|
hazardFormData.source = 0;
|
||||||
|
hazardFormData.description = '';
|
||||||
|
hazardFormData.tagIndex = 0;
|
||||||
|
hazardAddress.value = '';
|
||||||
|
hazardLng.value = 0;
|
||||||
|
hazardLat.value = 0;
|
||||||
|
hazardFileList.value = [];
|
||||||
|
selectedAreaId.value = '';
|
||||||
|
selectedAreaName.value = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
// 确认隐患信息(只暂存,不调接口)
|
||||||
|
const confirmHazard = () => {
|
||||||
|
// 表单验证
|
||||||
|
if (hazardFileList.value.length === 0) {
|
||||||
|
uni.showToast({ title: '请上传隐患图片/视频', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!hazardFormData.title) {
|
||||||
|
uni.showToast({ title: '请输入隐患标题', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!hazardAddress.value) {
|
||||||
|
uni.showToast({ title: '请输入隐患位置', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!hazardFormData.description) {
|
||||||
|
uni.showToast({ title: '请输入隐患描述', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证通过,关闭弹窗(数据已在 reactive 中暂存)
|
||||||
|
showHazardPopup.value = false;
|
||||||
|
uni.showToast({ title: '隐患信息已暂存', icon: 'success' });
|
||||||
|
};
|
||||||
|
|
||||||
|
// 选择地址
|
||||||
|
const chooseLocation = () => {
|
||||||
|
showHazardPopup.value = false;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.chooseLocation({
|
||||||
|
success: (res) => {
|
||||||
|
hazardAddress.value = res.address + (res.name ? `(${res.name})` : '');
|
||||||
|
hazardLng.value = res.longitude;
|
||||||
|
hazardLat.value = res.latitude;
|
||||||
|
showHazardPopup.value = true;
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
showHazardPopup.value = true;
|
||||||
|
if (err.errMsg && err.errMsg.indexOf('cancel') === -1) {
|
||||||
|
uni.showToast({ title: '选择位置失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 300);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 删除图片
|
||||||
|
const deletePic = (event) => {
|
||||||
|
hazardFileList.value.splice(event.index, 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 新增图片
|
||||||
|
const afterRead = async (event) => {
|
||||||
|
let lists = [].concat(event.file);
|
||||||
|
let fileListLen = hazardFileList.value.length;
|
||||||
|
lists.map((item) => {
|
||||||
|
hazardFileList.value.push({
|
||||||
|
...item,
|
||||||
|
status: 'uploading',
|
||||||
|
message: '上传中',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
for (let i = 0; i < lists.length; i++) {
|
||||||
|
const result = await uploadFilePromise(lists[i].url);
|
||||||
|
let item = hazardFileList.value[fileListLen];
|
||||||
|
hazardFileList.value.splice(fileListLen, 1, {
|
||||||
|
...item,
|
||||||
|
status: 'success',
|
||||||
|
message: '',
|
||||||
|
url: result,
|
||||||
|
});
|
||||||
|
fileListLen++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
const uploadFilePromise = (filePath) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.uploadFile({
|
||||||
|
url: baseUrl + '/frontend/attachment/upload',
|
||||||
|
filePath: filePath,
|
||||||
|
name: 'file',
|
||||||
|
header: {
|
||||||
|
'Authorization': getToken()
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
const data = JSON.parse(res.data);
|
||||||
|
if (data.code === 0) {
|
||||||
|
resolve(data.data);
|
||||||
|
} else {
|
||||||
|
reject(data.msg || '上传失败');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('上传失败:', err);
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// ==================== 提交逻辑 ====================
|
||||||
|
|
||||||
// 提交检查结果
|
// 提交检查结果
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
// 验证是否选择了检查结果
|
// 验证是否选择了检查结果
|
||||||
@@ -90,32 +482,121 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果选择异常,验证是否填写了隐患信息
|
||||||
|
if (radiovalue1.value === '异常' && !hasHazardData.value) {
|
||||||
|
uni.showToast({ title: '请填写隐患信息', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const params = {
|
uni.showLoading({ title: '提交中...' });
|
||||||
|
|
||||||
|
// 如果选择异常,先调用新增隐患接口
|
||||||
|
if (radiovalue1.value === '异常' && hasHazardData.value) {
|
||||||
|
// 构建附件列表
|
||||||
|
const attachments = hazardFileList.value.map(file => {
|
||||||
|
let url = '';
|
||||||
|
if (typeof file.url === 'string') {
|
||||||
|
url = file.url;
|
||||||
|
} else if (file.url && typeof file.url === 'object') {
|
||||||
|
url = file.url.url || file.url.path || '';
|
||||||
|
}
|
||||||
|
const fileName = (typeof url === 'string' && url) ? url.split('/').pop() : (file.name || '');
|
||||||
|
return {
|
||||||
|
fileName: fileName || '',
|
||||||
|
filePath: url || '',
|
||||||
|
fileType: file.type || 'image/png',
|
||||||
|
fileSize: file.size || 0
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取隐患标签ID
|
||||||
|
const selectedTag = tagOptions.value[hazardFormData.tagIndex];
|
||||||
|
const tagId = selectedTag ? selectedTag.id : null;
|
||||||
|
|
||||||
|
// 构建隐患参数
|
||||||
|
const hazardParams = {
|
||||||
|
taskId: checkData.value?.taskId,
|
||||||
|
checkPointId: checkData.value?.checkPointId,
|
||||||
|
title: hazardFormData.title,
|
||||||
|
level: hazardFormData.level + 1,
|
||||||
|
lng: hazardLng.value || 0,
|
||||||
|
lat: hazardLat.value || 0,
|
||||||
|
address: hazardAddress.value || '',
|
||||||
|
areaId: selectedAreaId.value || null, // 隐患区域ID
|
||||||
|
description: hazardFormData.description || '',
|
||||||
|
source: sourceOptions.value[hazardFormData.source]?.title || '',
|
||||||
|
tagId: tagId,
|
||||||
|
attachments: attachments
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log('隐患参数:', hazardParams);
|
||||||
|
|
||||||
|
// 调用新增隐患接口
|
||||||
|
const hazardRes = await addHiddenDanger(hazardParams);
|
||||||
|
if (hazardRes.code !== 0) {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({ title: hazardRes.msg || '新增隐患失败', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log('新增隐患成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用提交巡检结果接口
|
||||||
|
const submitParams = {
|
||||||
taskId: checkData.value?.taskId,
|
taskId: checkData.value?.taskId,
|
||||||
result: resultValue,
|
result: resultValue,
|
||||||
remark: value1.value
|
remark: value1.value
|
||||||
};
|
};
|
||||||
console.log('提交参数:', params);
|
console.log('提交参数:', submitParams);
|
||||||
|
|
||||||
const res = await submitCheckResult(params);
|
const res = await submitCheckResult(submitParams);
|
||||||
console.log('提交结果:', res);
|
uni.hideLoading();
|
||||||
|
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
uni.showToast({ title: '提交成功', icon: 'success' });
|
// 判断是否全部完成
|
||||||
// 提交成功后可以返回上一页或刷新数据
|
if (res.data && res.data.allFinished === true) {
|
||||||
|
// 全部完成,退出页面
|
||||||
|
uni.showToast({ title: '全部检查已完成', icon: 'success' });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
} else if (res.data && res.data.nextTask) {
|
||||||
|
// 还有下一个问题,更新数据继续
|
||||||
|
uni.showToast({ title: '提交成功,进入下一题', icon: 'success' });
|
||||||
|
|
||||||
|
// 重置表单状态
|
||||||
|
resetFormState();
|
||||||
|
|
||||||
|
// 更新为下一个检查项的数据
|
||||||
|
checkData.value = res.data.nextTask;
|
||||||
|
} else {
|
||||||
|
// 兜底处理:没有 allFinished 也没有 nextTask,直接返回
|
||||||
|
uni.showToast({ title: '提交成功', icon: 'success' });
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: res.msg || '提交失败', icon: 'none' });
|
uni.showToast({ title: res.msg || '提交失败', icon: 'none' });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
uni.hideLoading();
|
||||||
console.error('提交失败:', error);
|
console.error('提交失败:', error);
|
||||||
uni.showToast({ title: '提交失败', icon: 'none' });
|
uni.showToast({ title: '提交失败', icon: 'none' });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 重置表单状态(进入下一题时调用)
|
||||||
|
const resetFormState = () => {
|
||||||
|
// 重置检查结果选择
|
||||||
|
radiovalue1.value = '';
|
||||||
|
// 重置备注
|
||||||
|
value1.value = '';
|
||||||
|
// 清除隐患信息
|
||||||
|
clearHazard();
|
||||||
|
};
|
||||||
|
|
||||||
// 获取检查项数据
|
// 获取检查项数据
|
||||||
const getCheckData = async () => {
|
const getCheckData = async () => {
|
||||||
try {
|
try {
|
||||||
@@ -136,6 +617,10 @@
|
|||||||
oneTableId.value = options.id;
|
oneTableId.value = options.id;
|
||||||
getCheckData();
|
getCheckData();
|
||||||
}
|
}
|
||||||
|
// 获取隐患标签列表
|
||||||
|
fetchTagOptions();
|
||||||
|
// 获取区域列表
|
||||||
|
fetchAreaList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -144,4 +629,342 @@
|
|||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 进度显示
|
||||||
|
.progress-bar {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
padding: 24rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-text {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
|
||||||
|
.current-index {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2667E9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-count {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-line {
|
||||||
|
height: 12rpx;
|
||||||
|
background: #E5E5E5;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-inner {
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, #2667E9, #5B9BFF);
|
||||||
|
border-radius: 6rpx;
|
||||||
|
transition: width 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 隐患信息区域
|
||||||
|
.hazard-section {
|
||||||
|
border-top: 1rpx solid #eee;
|
||||||
|
padding-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提示文字
|
||||||
|
.hazard-tip {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 16rpx 20rpx;
|
||||||
|
background: #FFF7E6;
|
||||||
|
border: 1rpx solid #FFE7BA;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.text-orange {
|
||||||
|
color: #FA8C16;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填写隐患信息按钮
|
||||||
|
.hazard-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 88rpx;
|
||||||
|
border: 2rpx dashed #2667E9;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background: #F5F9FF;
|
||||||
|
|
||||||
|
.text-blue {
|
||||||
|
color: #2667E9;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 隐患信息卡片
|
||||||
|
.hazard-card {
|
||||||
|
background: #F5F9FF;
|
||||||
|
border: 1rpx solid #D6E4FF;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-bottom: 1rpx solid #E8E8E8;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
|
.info-row {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-gray {
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description-text {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-footer {
|
||||||
|
display: flex;
|
||||||
|
border-top: 1rpx solid #E8E8E8;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
button {
|
||||||
|
flex: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
border-radius: 0;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-edit {
|
||||||
|
background: #fff;
|
||||||
|
color: #2667E9;
|
||||||
|
border-right: 1rpx solid #E8E8E8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-clear {
|
||||||
|
background: #fff;
|
||||||
|
color: #F56C6C;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 隐患等级标签
|
||||||
|
.level-tag {
|
||||||
|
padding: 4rpx 16rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.level-minor {
|
||||||
|
background: #F6FFED;
|
||||||
|
border: 2rpx solid #B7EB8F;
|
||||||
|
color: #52C41A;
|
||||||
|
}
|
||||||
|
|
||||||
|
.level-normal {
|
||||||
|
background: #FFF7E6;
|
||||||
|
border: 2rpx solid #FFD591;
|
||||||
|
color: #FA8C16;
|
||||||
|
}
|
||||||
|
|
||||||
|
.level-major {
|
||||||
|
background: #FFF1F0;
|
||||||
|
border: 2rpx solid #FFA39E;
|
||||||
|
color: #F5222D;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 弹窗样式
|
||||||
|
.popup-content {
|
||||||
|
width: 600rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #eee;
|
||||||
|
|
||||||
|
.popup-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-close {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #999;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-body {
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-footer {
|
||||||
|
display: flex;
|
||||||
|
border-top: 1rpx solid #eee;
|
||||||
|
|
||||||
|
button {
|
||||||
|
flex: 1;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
border-radius: 0;
|
||||||
|
font-size: 30rpx;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-cancel {
|
||||||
|
background: #fff;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-confirm {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.address-box {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
|
||||||
|
.address-input-wrapper {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-address {
|
||||||
|
flex-shrink: 0;
|
||||||
|
height: 70rpx;
|
||||||
|
line-height: 70rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择器触发器样式
|
||||||
|
.select-trigger {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background: #fff;
|
||||||
|
border: 1rpx solid #dcdfe6;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 20rpx 24rpx;
|
||||||
|
|
||||||
|
.select-value {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
&.placeholder {
|
||||||
|
color: #c0c4cc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择弹窗样式
|
||||||
|
.picker-popup {
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.picker-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #eee;
|
||||||
|
|
||||||
|
.picker-cancel {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-confirm {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #2667E9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-body {
|
||||||
|
max-height: 600rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx 0;
|
||||||
|
border-bottom: 1rpx solid #f5f5f5;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.picker-item-active {
|
||||||
|
color: #2667E9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 区域颜色圆点
|
||||||
|
.area-color-dot {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -9,173 +9,462 @@
|
|||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<!-- 查询条件 -->
|
<!-- 查询条件 -->
|
||||||
<view class="bg-white radius padding margin-top">
|
<view class="bg-white radius padding margin-top search-card">
|
||||||
<view class="flex">
|
<view class="section-header">
|
||||||
<!-- <view class="lg cuIcon-search bg-blue radius text-center align-center"></view> -->
|
<image class="section-icon" src="/static/yujin/yujin_sousuo.png" mode="aspectFit"></image>
|
||||||
<view class="text-black text-bold">查询条件</view>
|
<view class="text-black text-bold">查询条件</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-top margin-bottom">开始日期</view>
|
<!-- 日期选择行 -->
|
||||||
<up-datetime-picker hasInput :show="show" v-model="value1" mode="date"></up-datetime-picker>
|
<view class="date-row margin-top">
|
||||||
<view class="margin-top margin-bottom">结束日期</view>
|
<view class="date-item">
|
||||||
<up-datetime-picker hasInput :show="show" v-model="value1" mode="date"></up-datetime-picker>
|
<view class="date-label">开始日期</view>
|
||||||
<view class="margin-top margin-bottom">公司名称</view>
|
<view class="date-picker" @click="showStartDatePicker = true">
|
||||||
<up-input placeholder="请输入公司名称"></up-input>
|
<text :class="searchForm.startDate ? 'date-value' : 'date-placeholder'">
|
||||||
<button class="bg-blue round margin-top">查询</button>
|
{{ searchForm.startDate || '请选择' }}
|
||||||
|
</text>
|
||||||
|
<text class="cuIcon-unfold"></text>
|
||||||
</view>
|
</view>
|
||||||
|
<up-datetime-picker
|
||||||
|
:show="showStartDatePicker"
|
||||||
|
v-model="startDateValue"
|
||||||
|
mode="date"
|
||||||
|
@confirm="onStartDateConfirm"
|
||||||
|
@cancel="showStartDatePicker = false"
|
||||||
|
@close="showStartDatePicker = false"
|
||||||
|
></up-datetime-picker>
|
||||||
|
</view>
|
||||||
|
<view class="date-item">
|
||||||
|
<view class="date-label">结束日期</view>
|
||||||
|
<view class="date-picker" @click="showEndDatePicker = true">
|
||||||
|
<text :class="searchForm.endDate ? 'date-value' : 'date-placeholder'">
|
||||||
|
{{ searchForm.endDate || '请选择' }}
|
||||||
|
</text>
|
||||||
|
<text class="cuIcon-unfold"></text>
|
||||||
|
</view>
|
||||||
|
<up-datetime-picker
|
||||||
|
:show="showEndDatePicker"
|
||||||
|
v-model="endDateValue"
|
||||||
|
mode="date"
|
||||||
|
@confirm="onEndDateConfirm"
|
||||||
|
@cancel="showEndDatePicker = false"
|
||||||
|
@close="showEndDatePicker = false"
|
||||||
|
></up-datetime-picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="margin-top">
|
||||||
|
<view class="date-label">公司名称</view>
|
||||||
|
<up-input v-model="searchForm.deptName" placeholder="请输入公司名称" border="surround"></up-input>
|
||||||
|
</view>
|
||||||
|
<button class="search-btn" @click="handleSearch">查询</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 统计概览 -->
|
<!-- 统计概览 -->
|
||||||
<view class="padding bg-white radius margin-top">
|
<view class="padding bg-white radius margin-top">
|
||||||
<view class="flex">
|
<view class="section-header">
|
||||||
<view></view>
|
<image class="section-icon" src="/static/yujin/yujin_tongji.png" mode="aspectFit"></image>
|
||||||
<view class="text-bold text-black">统计概览</view>
|
<view class="text-bold text-black">统计概览</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex col-4 grid margin-top " style="gap:20rpx">
|
<view class="stat-grid margin-top">
|
||||||
<view class="text-center padding-top-sm " style="width: 142rpx;height: 124rpx;background:#628EFB; border-radius: 8rpx;color: #fff;">
|
<view class="stat-item stat-total">
|
||||||
<view>80</view>
|
<view class="stat-num">{{ statistics.total }}</view>
|
||||||
<view>总计</view>
|
<view class="stat-label">总计</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center padding-top-sm " style="width: 142rpx;height: 124rpx;background:#32DCC7; border-radius: 8rpx;color: #fff;">
|
<view class="stat-item stat-overdue">
|
||||||
<view>70</view>
|
<view class="stat-num">{{ statistics.overdue }}</view>
|
||||||
<view>逾期</view>
|
<view class="stat-label">逾期</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center padding-top-sm " style="width: 142rpx;height: 124rpx;background:#32D1E9; border-radius: 8rpx;color: #fff;">
|
<view class="stat-item stat-completed">
|
||||||
<view>20</view>
|
<view class="stat-num">{{ statistics.completed }}</view>
|
||||||
<view>已完成</view>
|
<view class="stat-label">已完成</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center padding-top-sm " style="width: 142rpx;height: 124rpx;background:#A190F5; border-radius: 8rpx;color: #fff;">
|
<view class="stat-item stat-pending">
|
||||||
<view>20</view>
|
<view class="stat-num">{{ statistics.pending }}</view>
|
||||||
<view>待处理</view>
|
<view class="stat-label">待处理</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 数据列表 -->
|
|
||||||
<view class="bg-white radius padding margin-top margin-bottom flex">
|
<!-- 数据列表标题 -->
|
||||||
<view class="list-title"></view>
|
<view class="bg-white radius padding margin-top margin-bottom flex align-center">
|
||||||
|
<view class="list-title-bar"></view>
|
||||||
<view class="text-bold text-black">日常安全检查预警数据列表</view>
|
<view class="text-bold text-black">日常安全检查预警数据列表</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bg-white radius padding list-list">
|
|
||||||
<view class=" flex justify-between">
|
<!-- 数据列表 -->
|
||||||
<view class="text-bold text-black">#1</view>
|
<view v-for="(item, index) in dataList" :key="item.id" class="list-card">
|
||||||
<view>严重逾期</view>
|
<!-- 状态标签(斜角) -->
|
||||||
|
<view class="status-tag" :class="getStatusClass(item.overdueDays)">
|
||||||
|
<text class="status-text">{{ getStatusText(item.overdueDays, item.statusName) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
|
||||||
<view class="text-gray" style="white-space: nowrap;">企业名称:</view>
|
<view class="card-header">
|
||||||
<view>湘西和谐云大数据产业发展有限公司</view>
|
<view class="text-bold text-black">#{{ index + 1 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="card-row">
|
||||||
<view class="text-gray">计划名称:</view>
|
<view class="row-label">企业名称:</view>
|
||||||
<view>检查计划</view>
|
<view class="row-value">{{ item.deptName || '-' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="card-row">
|
||||||
<view class="text-gray">计划周期:</view>
|
<view class="row-label">计划名称:</view>
|
||||||
<view>每天一次</view>
|
<view class="row-value">{{ item.planName || '-' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="card-row">
|
||||||
<view class="text-gray">预约检查日期:</view>
|
<view class="row-label">计划周期:</view>
|
||||||
<view>2025-11-20</view>
|
<view class="row-value">{{ item.cycleName || '-' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="card-row">
|
||||||
<view class="text-gray">实际完成时间:</view>
|
<view class="row-label">预约检查日期:</view>
|
||||||
<view>未完成</view>
|
<view class="row-value">{{ item.taskDate || '-' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="card-row">
|
||||||
<view class="text-gray">负责人:</view>
|
<view class="row-label">实际完成时间:</view>
|
||||||
<view>符友成</view>
|
<view class="row-value">{{ item.finishTime || '未完成' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="card-row">
|
||||||
<view class="text-gray">逾期天数:</view>
|
<view class="row-label">负责人:</view>
|
||||||
<view>17天 </view>
|
<view class="row-value">{{ item.executorName || '-' }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="card-row">
|
||||||
|
<view class="row-label">逾期天数:</view>
|
||||||
|
<view class="row-value">{{ item.overdueDays || '-' }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 空状态 -->
|
||||||
|
<view v-if="dataList.length === 0" class="empty-tip">
|
||||||
|
<text>暂无数据</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { ref, reactive, onMounted } from 'vue'
|
||||||
ref
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
} from 'vue'
|
import { getInspectionWarningList } from '@/request/api.js'
|
||||||
|
|
||||||
const activeIndex = ref(0)
|
// 搜索表单
|
||||||
|
const searchForm = reactive({
|
||||||
|
startDate: '',
|
||||||
|
endDate: '',
|
||||||
|
deptName: ''
|
||||||
|
})
|
||||||
|
|
||||||
const warningList = ref([{
|
// 日期选择器
|
||||||
id: 1,
|
const showStartDatePicker = ref(false)
|
||||||
name: '全部状态80',
|
const showEndDatePicker = ref(false)
|
||||||
},
|
const startDateValue = ref(Number(new Date()))
|
||||||
{
|
const endDateValue = ref(Number(new Date()))
|
||||||
id: 2,
|
|
||||||
name: '逾期未检16',
|
// 统计数据
|
||||||
},
|
const statistics = reactive({
|
||||||
{
|
total: 0,
|
||||||
id: 3,
|
overdue: 0,
|
||||||
name: '严重逾期50',
|
completed: 0,
|
||||||
},
|
pending: 0
|
||||||
{
|
})
|
||||||
id: 4,
|
|
||||||
name: '期限内待检4',
|
// 列表数据
|
||||||
},
|
const dataList = ref([])
|
||||||
{
|
const pageNum = ref(1)
|
||||||
id: 5,
|
const pageSize = ref(20)
|
||||||
name: '逾期已完成8',
|
|
||||||
},
|
// 日期格式化
|
||||||
{
|
const formatDate = (timestamp) => {
|
||||||
id: 6,
|
const date = new Date(timestamp)
|
||||||
name: '按期已完成2',
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 日期选择确认
|
||||||
|
const onStartDateConfirm = (e) => {
|
||||||
|
searchForm.startDate = formatDate(e.value)
|
||||||
|
showStartDatePicker.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
const onEndDateConfirm = (e) => {
|
||||||
|
searchForm.endDate = formatDate(e.value)
|
||||||
|
showEndDatePicker.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取状态样式类
|
||||||
|
const getStatusClass = (overdueDays) => {
|
||||||
|
if (!overdueDays || overdueDays === '按期') {
|
||||||
|
return 'status-normal' // 按期/期限内
|
||||||
}
|
}
|
||||||
])
|
const days = parseInt(overdueDays)
|
||||||
|
if (days >= 7) {
|
||||||
const switchTab = (index) => {
|
return 'status-serious' // 严重逾期(红色)
|
||||||
activeIndex.value = index
|
} else if (days >= 1) {
|
||||||
|
return 'status-overdue' // 逾期(橙色)
|
||||||
}
|
}
|
||||||
// 日期
|
return 'status-normal'
|
||||||
const value1 = ref(Date.now());
|
}
|
||||||
|
|
||||||
|
// 获取状态文本
|
||||||
|
const getStatusText = (overdueDays, statusName) => {
|
||||||
|
if (!overdueDays || overdueDays === '按期') {
|
||||||
|
return statusName === '已完成' ? '按期已完成' : '期限内待检'
|
||||||
|
}
|
||||||
|
const days = parseInt(overdueDays)
|
||||||
|
if (days >= 7) {
|
||||||
|
return '严重逾期'
|
||||||
|
} else if (days >= 1) {
|
||||||
|
return statusName === '已完成' ? '逾期已完成' : '逾期未检'
|
||||||
|
}
|
||||||
|
return '期限内待检'
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取数据
|
||||||
|
const fetchData = async () => {
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
pageNum: pageNum.value,
|
||||||
|
pageSize: pageSize.value
|
||||||
|
}
|
||||||
|
// 添加查询条件
|
||||||
|
if (searchForm.startDate) {
|
||||||
|
params.startDate = searchForm.startDate
|
||||||
|
}
|
||||||
|
if (searchForm.endDate) {
|
||||||
|
params.endDate = searchForm.endDate
|
||||||
|
}
|
||||||
|
if (searchForm.deptName && searchForm.deptName.trim()) {
|
||||||
|
params.deptName = searchForm.deptName.trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await getInspectionWarningList(params)
|
||||||
|
if (res.code === 0) {
|
||||||
|
// 更新统计数据
|
||||||
|
if (res.data.statistics) {
|
||||||
|
statistics.total = res.data.statistics.total || 0
|
||||||
|
statistics.overdue = res.data.statistics.overdue || 0
|
||||||
|
statistics.completed = res.data.statistics.completed || 0
|
||||||
|
statistics.pending = res.data.statistics.pending || 0
|
||||||
|
}
|
||||||
|
// 更新列表数据
|
||||||
|
if (res.data.page && res.data.page.records) {
|
||||||
|
dataList.value = res.data.page.records
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取预警列表失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
const handleSearch = () => {
|
||||||
|
pageNum.value = 1
|
||||||
|
fetchData()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 页面加载
|
||||||
|
onShow(() => {
|
||||||
|
fetchData()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page {
|
.page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
}
|
padding-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-scroll {
|
// 区块标题
|
||||||
white-space: nowrap;
|
.section-header {
|
||||||
}
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
.tab-list {
|
.section-icon {
|
||||||
display: inline-flex;
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-right: 12rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索卡片
|
||||||
|
.search-card {
|
||||||
|
.date-row {
|
||||||
|
display: flex;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
|
|
||||||
|
.date-item {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-item {
|
.date-label {
|
||||||
display: inline-flex;
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-picker {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 72rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
background: #f8f8f8;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
border: 1rpx solid #eee;
|
||||||
|
|
||||||
|
.date-value {
|
||||||
|
color: #333;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-placeholder {
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-btn {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #2667E9 100%);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 统计卡片
|
||||||
|
.stat-grid {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
|
||||||
|
.stat-item {
|
||||||
|
flex: 1;
|
||||||
|
height: 124rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
color: #fff;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 16rpx 28rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
background: #fff;
|
|
||||||
border: 1rpx solid #ddd;
|
|
||||||
color: #333;
|
|
||||||
flex-shrink: 0;
|
|
||||||
|
|
||||||
&.tab-active {
|
.stat-num {
|
||||||
background: #2979ff;
|
font-size: 40rpx;
|
||||||
border-color: #2979ff;
|
font-weight: bold;
|
||||||
color: #fff;
|
}
|
||||||
|
|
||||||
|
.stat-label {
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.list-title {
|
|
||||||
width: 10rpx;
|
.stat-total {
|
||||||
|
background: linear-gradient(135deg, #628EFB 0%, #4A7CF7 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-overdue {
|
||||||
|
background: linear-gradient(135deg, #32DCC7 0%, #20C5B0 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-completed {
|
||||||
|
background: linear-gradient(135deg, #32D1E9 0%, #20B8D0 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-pending {
|
||||||
|
background: linear-gradient(135deg, #A190F5 0%, #8B78E8 100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表标题
|
||||||
|
.list-title-bar {
|
||||||
|
width: 8rpx;
|
||||||
height: 32rpx;
|
height: 32rpx;
|
||||||
background: #2667E9;
|
background: #2667E9;
|
||||||
border-radius: 10rpx;
|
border-radius: 4rpx;
|
||||||
line-height: 32rpx;
|
margin-right: 12rpx;
|
||||||
margin-right: 10rpx;
|
}
|
||||||
}
|
|
||||||
.list-list {
|
// 数据卡片
|
||||||
|
.list-card {
|
||||||
|
position: relative;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
box-shadow: 0rpx 2rpx 10rpx rgba(0, 0, 0, 0.08);
|
||||||
border-left: 5px solid #2667E9;
|
border-left: 8rpx solid #2667E9;
|
||||||
border-radius: 20rpx;
|
border-radius: 16rpx;
|
||||||
padding: 20rpx;
|
padding: 30rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-row {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
|
||||||
|
.row-label {
|
||||||
|
color: #999;
|
||||||
|
white-space: nowrap;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-value {
|
||||||
|
color: #333;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态标签(斜角样式)
|
||||||
|
.status-tag {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 160rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
transform: rotate(0deg);
|
||||||
|
border-radius: 0 16rpx 0 16rpx;
|
||||||
|
|
||||||
|
.status-text {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 严重逾期 - 红色
|
||||||
|
.status-serious {
|
||||||
|
background: linear-gradient(135deg, #FF6B6B 0%, #EE5A5A 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 逾期 - 橙色
|
||||||
|
.status-overdue {
|
||||||
|
background: linear-gradient(135deg, #FFA726 0%, #FF9800 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按期/正常 - 绿色
|
||||||
|
.status-normal {
|
||||||
|
background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 逾期已完成 - 蓝色
|
||||||
|
.status-completed {
|
||||||
|
background: linear-gradient(135deg, #42A5F5 0%, #2196F3 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 空状态
|
||||||
|
.empty-tip {
|
||||||
|
text-align: center;
|
||||||
|
padding: 100rpx 0;
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,226 +1,213 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="padding page">
|
<view class="padding page">
|
||||||
<view class="padding bg-white radius">
|
<!-- 区域列表 -->
|
||||||
|
<view class="area-list" v-if="areaList.length > 0">
|
||||||
|
<view class="padding bg-white radius margin-bottom" v-for="item in areaList" :key="item.id">
|
||||||
<view class="flex justify-between">
|
<view class="flex justify-between">
|
||||||
<view>
|
<view>
|
||||||
<view class="text-bold text-black">{{ areaData.name || '区域名称' }}</view>
|
<view class="text-bold text-black">{{ item.name || '区域名称' }}</view>
|
||||||
<view class="margin-top flex align-center">
|
<view class="margin-top flex align-center">
|
||||||
<text>颜色:</text>
|
<text>颜色:</text>
|
||||||
<view class="color-dot" :style="{ backgroundColor: areaData.color }"></view>
|
<view class="color-dot" :style="{ backgroundColor: item.color }"></view>
|
||||||
<text class="margin-left-xs">{{ areaData.color }}</text>
|
<text class="margin-left-xs">{{ item.color }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<button class="bg-blue cu-btn" @click="openEditPopup" >编辑</button>
|
<button class="bg-blue cu-btn" @click="openEditPopup(item)">编辑</button>
|
||||||
<button class="bg-red cu-btn margin-left">删除</button>
|
<button class="bg-red cu-btn margin-left" @click="handleDelete(item)">删除</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="cuIcon-add bg-blue round margin-top-xl">新增公司区域</button>
|
|
||||||
|
|
||||||
<!-- 编辑区域弹出框 -->
|
|
||||||
<u-popup :show="showEditPopup" mode="center" round="20" @close="showEditPopup = false">
|
|
||||||
<view class="popup-content">
|
|
||||||
<view class="popup-header">
|
|
||||||
<view class="popup-title text-bold">编辑区域</view>
|
|
||||||
<view class="popup-close" @click="showEditPopup = false">×</view>
|
|
||||||
</view>
|
|
||||||
<view class="popup-body">
|
|
||||||
<!-- 区域名称 -->
|
|
||||||
<view class="flex margin-bottom-sm">
|
|
||||||
<view>区域名称</view>
|
|
||||||
<view class="text-red">*</view>
|
|
||||||
</view>
|
|
||||||
<up-input v-model="formData.name" placeholder="请输入区域名称"></up-input>
|
|
||||||
|
|
||||||
<!-- 区域颜色 -->
|
|
||||||
<view class="flex margin-bottom-sm margin-top">
|
|
||||||
<view>区域颜色</view>
|
|
||||||
<view class="text-red">*</view>
|
|
||||||
</view>
|
|
||||||
<view class="flex align-center">
|
|
||||||
<up-input v-model="formData.color" placeholder="#ef4444" class="flex-sub"></up-input>
|
|
||||||
<view class="color-preview" :style="{ backgroundColor: formData.color }"></view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 预设颜色 -->
|
<!-- 空状态 -->
|
||||||
<view class="margin-top margin-bottom-sm text-gray">预设颜色</view>
|
<view class="empty-state" v-else>
|
||||||
<view class="color-grid">
|
<text class="text-gray">暂无区域数据</text>
|
||||||
<view
|
|
||||||
v-for="(color, index) in presetColors"
|
|
||||||
:key="index"
|
|
||||||
class="color-item"
|
|
||||||
:style="{ backgroundColor: color }"
|
|
||||||
@click="selectColor(color)"
|
|
||||||
></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="popup-footer">
|
<!-- 新增按钮 -->
|
||||||
<button class="btn-cancel" @click="showEditPopup = false">取消</button>
|
<button class="add-btn cuIcon-add bg-blue round" @click="openAddPopup">新增公司区域</button>
|
||||||
<button class="btn-confirm bg-blue" @click="handleEdit">确定</button>
|
|
||||||
</view>
|
<!-- 新增/编辑弹窗组件 -->
|
||||||
</view>
|
<AreaFormPopup
|
||||||
</u-popup>
|
v-model:visible="showPopup"
|
||||||
|
:isEdit="isEdit"
|
||||||
|
:editData="editData"
|
||||||
|
:loading="submitting"
|
||||||
|
@submit="handleSubmit"
|
||||||
|
@close="handlePopupClose"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
|
import AreaFormPopup from '@/components/AreaFormPopup.vue';
|
||||||
|
import {
|
||||||
|
getAreaList,
|
||||||
|
getAreaDetail,
|
||||||
|
addArea,
|
||||||
|
updateArea,
|
||||||
|
deleteArea
|
||||||
|
} from '@/request/three_one_api/area.js';
|
||||||
|
|
||||||
// 弹出框显示状态
|
// 区域列表
|
||||||
const showEditPopup = ref(false);
|
const areaList = ref([]);
|
||||||
|
|
||||||
// 当前区域数据(用于列表显示)
|
// 弹窗控制
|
||||||
const areaData = reactive({
|
const showPopup = ref(false);
|
||||||
name: '区域名称',
|
const isEdit = ref(false);
|
||||||
color: '#ef4444'
|
const currentEditId = ref(null);
|
||||||
|
const submitting = ref(false);
|
||||||
|
|
||||||
|
// 编辑时的数据
|
||||||
|
const editData = ref({});
|
||||||
|
|
||||||
|
// 页面加载
|
||||||
|
onMounted(() => {
|
||||||
|
loadAreaList();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 表单数据
|
// 加载区域列表
|
||||||
const formData = reactive({
|
const loadAreaList = async () => {
|
||||||
name: '',
|
try {
|
||||||
color: '#ef4444'
|
const res = await getAreaList();
|
||||||
});
|
if (res.code === 0) {
|
||||||
|
areaList.value = res.data.records || [];
|
||||||
// 预设颜色
|
}
|
||||||
const presetColors = [
|
} catch (err) {
|
||||||
'#2563eb', '#ef4444', '#10b981', '#f59e0b', '#6366f1', '#ec4899', '#06b6d4',
|
console.error('获取区域列表失败:', err);
|
||||||
'#84cc16', '#f97316', '#4f46e5', '#dc2626', '#f59e0b', '#d97706', '#8b5cf6',
|
}
|
||||||
'#db2777'
|
|
||||||
];
|
|
||||||
|
|
||||||
// 打开编辑弹出框
|
|
||||||
const openEditPopup = () => {
|
|
||||||
// 初始化表单数据为当前区域数据
|
|
||||||
formData.name = areaData.name;
|
|
||||||
formData.color = areaData.color;
|
|
||||||
showEditPopup.value = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选择预设颜色
|
// 打开新增弹窗
|
||||||
const selectColor = (color) => {
|
const openAddPopup = () => {
|
||||||
formData.color = color;
|
isEdit.value = false;
|
||||||
|
currentEditId.value = null;
|
||||||
|
editData.value = {};
|
||||||
|
showPopup.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 确定编辑
|
// 打开编辑弹窗
|
||||||
const handleEdit = () => {
|
const openEditPopup = async (item) => {
|
||||||
if (!formData.name) {
|
try {
|
||||||
uni.showToast({ title: '请输入区域名称', icon: 'none' });
|
const res = await getAreaDetail({ id: item.id });
|
||||||
return;
|
if (res.code === 0) {
|
||||||
|
isEdit.value = true;
|
||||||
|
currentEditId.value = item.id;
|
||||||
|
editData.value = {
|
||||||
|
name: res.data.name || '',
|
||||||
|
color: res.data.color || '#FF5733'
|
||||||
|
};
|
||||||
|
showPopup.value = true;
|
||||||
}
|
}
|
||||||
if (!formData.color) {
|
} catch (err) {
|
||||||
uni.showToast({ title: '请选择区域颜色', icon: 'none' });
|
console.error('获取区域详情失败:', err);
|
||||||
return;
|
uni.showToast({ title: '获取详情失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 弹窗关闭
|
||||||
|
const handlePopupClose = () => {
|
||||||
|
isEdit.value = false;
|
||||||
|
currentEditId.value = null;
|
||||||
|
editData.value = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const handleSubmit = async (formData) => {
|
||||||
|
submitting.value = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const submitData = {
|
||||||
|
name: formData.name,
|
||||||
|
color: formData.color
|
||||||
|
};
|
||||||
|
|
||||||
|
let res;
|
||||||
|
if (isEdit.value) {
|
||||||
|
submitData.id = currentEditId.value;
|
||||||
|
res = await updateArea(submitData);
|
||||||
|
} else {
|
||||||
|
res = await addArea(submitData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新区域数据
|
if (res.code === 0) {
|
||||||
areaData.name = formData.name;
|
showPopup.value = false;
|
||||||
areaData.color = formData.color;
|
|
||||||
|
|
||||||
showEditPopup.value = false;
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '编辑成功',
|
title: isEdit.value ? '修改成功' : '新增成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
});
|
});
|
||||||
|
loadAreaList();
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('提交失败:', err);
|
||||||
|
uni.showToast({ title: '操作失败', icon: 'none' });
|
||||||
|
} finally {
|
||||||
|
submitting.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 删除区域
|
||||||
|
const handleDelete = (item) => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '确认删除',
|
||||||
|
content: '确定要删除该区域吗?',
|
||||||
|
confirmColor: '#e54d42',
|
||||||
|
success: async (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
try {
|
||||||
|
const result = await deleteArea({ id: item.id });
|
||||||
|
if (result.code === 0) {
|
||||||
|
uni.showToast({ title: '删除成功', icon: 'success' });
|
||||||
|
loadAreaList();
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('删除失败:', err);
|
||||||
|
uni.showToast({ title: '删除失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page {
|
.page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
}
|
padding-bottom: 120rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.popup-content {
|
// 区域列表
|
||||||
width: 600rpx;
|
.area-list {
|
||||||
background: #fff;
|
padding-bottom: 20rpx;
|
||||||
border-radius: 20rpx;
|
}
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-header {
|
// 空状态
|
||||||
display: flex;
|
.empty-state {
|
||||||
justify-content: space-between;
|
padding: 200rpx 0;
|
||||||
align-items: center;
|
text-align: center;
|
||||||
padding: 30rpx;
|
}
|
||||||
border-bottom: 1rpx solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-title {
|
// 新增按钮
|
||||||
|
.add-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
line-height: 88rpx;
|
||||||
|
border-radius: 44rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-close {
|
// 颜色圆点
|
||||||
font-size: 40rpx;
|
.color-dot {
|
||||||
color: #999;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-body {
|
|
||||||
padding: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-footer {
|
|
||||||
display: flex;
|
|
||||||
padding: 20rpx 30rpx 30rpx;
|
|
||||||
|
|
||||||
button {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
font-size: 30rpx;
|
|
||||||
margin: 0 10rpx;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-cancel {
|
|
||||||
background: #f5f5f5;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-confirm {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 颜色预览
|
|
||||||
.color-preview {
|
|
||||||
width: 80rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 预设颜色网格
|
|
||||||
.color-grid {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 16rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.color-item {
|
|
||||||
width: 70rpx;
|
|
||||||
height: 70rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: transform 0.2s;
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
transform: scale(0.9);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 颜色圆点
|
|
||||||
.color-dot {
|
|
||||||
width: 30rpx;
|
width: 30rpx;
|
||||||
height: 30rpx;
|
height: 30rpx;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,41 +1,101 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page padding">
|
<view class="page padding">
|
||||||
<view class="padding bg-white radius flex justify-between margin-bottom" v-for="item in list" :key="item.id">
|
<!-- 检查表列表 -->
|
||||||
<view>{{ item.name }}</view>
|
<view class="checklist-card" v-for="item in list" :key="item.id">
|
||||||
<view>
|
<view class="card-name">{{ item.name }}</view>
|
||||||
<button class="bg-blue cu-btn margin-right-xs" @click="edit()">编辑</button>
|
|
||||||
<button class="bg-red cu-btn">删除</button>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 空状态 -->
|
||||||
|
<view v-if="list.length === 0" class="empty-tip">
|
||||||
|
<text>暂无检查表</text>
|
||||||
</view>
|
</view>
|
||||||
<button class="lg cuIcon-add bg-blue round margin-top-xl" @click="edit()">新增检查表</button>
|
|
||||||
|
<!-- 新增按钮 -->
|
||||||
|
<button class="add-btn" @click="goToAdd">
|
||||||
|
<text class="cuIcon-add"></text>
|
||||||
|
<text>新增检查表</text>
|
||||||
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
import { useRouter } from 'vue-router'
|
import { getCheckTableList } from '@/request/api.js'
|
||||||
import { getCheckTableList } from '@/request/api.js'
|
|
||||||
const router = useRouter()
|
const list = ref([])
|
||||||
const list = ref([])
|
|
||||||
const edit = () => {
|
// 获取检查表列表
|
||||||
|
const fetchList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getCheckTableList({ pageNum: 1, pageSize: 100 });
|
||||||
|
if (res.code === 0) {
|
||||||
|
list.value = res.data.records || [];
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取检查表列表失败:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转到新增页面
|
||||||
|
const goToAdd = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/editchecklist/editchecklist'
|
url: '/pages/editchecklist/editchecklist'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onLoad(() => {
|
|
||||||
getCheckTableList().then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
list.value = res.data.records
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
|
// 每次显示页面时刷新数据
|
||||||
|
onShow(() => {
|
||||||
|
fetchList();
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page {
|
.page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
|
padding-bottom: 120rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checklist-card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||||
|
|
||||||
|
.card-name {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-tip {
|
||||||
|
text-align: center;
|
||||||
|
padding: 100rpx 0;
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #2668EA 100%);
|
||||||
|
border-radius: 45rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-shadow: 0 8rpx 20rpx rgba(102, 126, 234, 0.4);
|
||||||
|
|
||||||
|
.cuIcon-add {
|
||||||
|
margin-right: 10rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<view><button class="bg-blue round cu-btn lg" @click="editor()">查看详情</button></view>
|
<view><button class="bg-blue round cu-btn lg" @click="editor()">查看详情</button></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="cuIcon-add bg-blue round margin-top" @click="showAddPopup = true">新增</button>
|
<button class="cuIcon-add bg-blue round margin-top" @click="openAddPopup">新增</button>
|
||||||
<!-- 弹出框 -->
|
<!-- 弹出框 -->
|
||||||
<u-popup :show="showAddPopup" mode="center" round="20" @close="showAddPopup = false">
|
<u-popup :show="showAddPopup" mode="center" round="20" @close="showAddPopup = false">
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
<view class="popup-title text-bold">新增销号申请</view>
|
<view class="popup-title text-bold">新增销号申请</view>
|
||||||
<view class="popup-close" @click="showAddPopup = false">×</view>
|
<view class="popup-close" @click="showAddPopup = false">×</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="popup-body">
|
<scroll-view class="popup-body" scroll-y :style="{ height: '60vh' }">
|
||||||
<view class="flex margin-bottom">
|
<view class="flex margin-bottom">
|
||||||
<view>隐患</view>
|
<view>隐患</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
@@ -66,7 +66,16 @@
|
|||||||
@close="showDatePicker = false"
|
@close="showDatePicker = false"
|
||||||
></up-datetime-picker>
|
></up-datetime-picker>
|
||||||
<view class="margin-bottom margin-top">隐患治理责任单位</view>
|
<view class="margin-bottom margin-top">隐患治理责任单位</view>
|
||||||
<up-input v-model="formData.responsibleDeptName" placeholder="请输入隐患治理责任单位"></up-input>
|
<view class="picker-input" @click="showDeptPicker = true">
|
||||||
|
<text :class="selectedDeptName ? '' : 'text-gray'">{{ selectedDeptName || '请选择隐患治理责任单位' }}</text>
|
||||||
|
</view>
|
||||||
|
<up-picker
|
||||||
|
:show="showDeptPicker"
|
||||||
|
:columns="deptColumns"
|
||||||
|
@confirm="onDeptConfirm"
|
||||||
|
@cancel="showDeptPicker = false"
|
||||||
|
@close="showDeptPicker = false"
|
||||||
|
></up-picker>
|
||||||
<view class="margin-bottom margin-top">主要负责人</view>
|
<view class="margin-bottom margin-top">主要负责人</view>
|
||||||
<up-input v-model="formData.responsiblePerson" placeholder="请输入主要负责人"></up-input>
|
<up-input v-model="formData.responsiblePerson" placeholder="请输入主要负责人"></up-input>
|
||||||
<view class="margin-bottom margin-top">主要治理内容</view>
|
<view class="margin-bottom margin-top">主要治理内容</view>
|
||||||
@@ -75,7 +84,7 @@
|
|||||||
<up-textarea v-model="formData.treatmentResult" placeholder="请输入隐患治理完成情况"></up-textarea>
|
<up-textarea v-model="formData.treatmentResult" placeholder="请输入隐患治理完成情况"></up-textarea>
|
||||||
<view class="margin-bottom margin-top">隐患治理责任单位自行验收的情况</view>
|
<view class="margin-bottom margin-top">隐患治理责任单位自行验收的情况</view>
|
||||||
<up-textarea v-model="formData.selfVerifyContent" placeholder="请输入隐患治理责任单位自行验收的情况"></up-textarea>
|
<up-textarea v-model="formData.selfVerifyContent" placeholder="请输入隐患治理责任单位自行验收的情况"></up-textarea>
|
||||||
</view>
|
</scroll-view>
|
||||||
<view class="popup-footer">
|
<view class="popup-footer">
|
||||||
<button class="btn-cancel" @click="showAddPopup = false">取消</button>
|
<button class="btn-cancel" @click="showAddPopup = false">取消</button>
|
||||||
<button class="btn-confirm bg-blue" @click="handleAdd">确定</button>
|
<button class="btn-confirm bg-blue" @click="handleAdd">确定</button>
|
||||||
@@ -87,18 +96,26 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted } from 'vue'
|
import { ref, reactive, onMounted } from 'vue'
|
||||||
import {getMyWriteOffList, applyDelete } from '@/request/api.js';
|
import { getMyWriteOffList, applyDelete, getAcceptanceList, getDepartmentPersonUsers } from '@/request/api.js';
|
||||||
|
|
||||||
// 弹窗控制
|
// 弹窗控制
|
||||||
const showAddPopup = ref(false);
|
const showAddPopup = ref(false);
|
||||||
const showHazardPicker = ref(false);
|
const showHazardPicker = ref(false);
|
||||||
const showDatePicker = ref(false);
|
const showDatePicker = ref(false);
|
||||||
|
const showDeptPicker = ref(false);
|
||||||
|
|
||||||
// 隐患选择
|
// 隐患选择
|
||||||
const selectedHazard = ref('');
|
const selectedHazard = ref('');
|
||||||
const selectedHazardId = ref('');
|
const selectedHazardId = ref('');
|
||||||
const hazardColumns = ref([['暂无数据']]);
|
const hazardColumns = ref([['暂无数据']]);
|
||||||
const hazardList = ref([]); // 存储完整隐患数据
|
const acceptanceHazardList = ref([]); // 存储可申请销号的隐患数据
|
||||||
|
const hazardList = ref([]); // 存储销号申请列表
|
||||||
|
|
||||||
|
// 部门选择
|
||||||
|
const selectedDeptName = ref('');
|
||||||
|
const selectedDeptId = ref('');
|
||||||
|
const deptColumns = ref([['暂无数据']]);
|
||||||
|
const deptList = ref([]); // 存储部门列表
|
||||||
|
|
||||||
// 日期选择
|
// 日期选择
|
||||||
const dateValue = ref(Date.now());
|
const dateValue = ref(Date.now());
|
||||||
@@ -106,31 +123,100 @@
|
|||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
rectifyDeadline: '', // 整改时限
|
rectifyDeadline: '', // 整改时限
|
||||||
responsibleDeptName: '', // 隐患治理责任单位
|
responsibleDeptId: '', // 隐患治理责任单位ID
|
||||||
responsiblePerson: '', // 主要负责人
|
responsiblePerson: '', // 主要负责人
|
||||||
mainTreatmentContent: '', // 主要治理内容
|
mainTreatmentContent: '', // 主要治理内容
|
||||||
treatmentResult: '', // 隐患治理完成内容
|
treatmentResult: '', // 隐患治理完成内容
|
||||||
selfVerifyContent: '' // 责任单位自行验收情况
|
selfVerifyContent: '' // 责任单位自行验收情况
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取验收完成的隐患列表
|
// 获取销号申请列表(页面显示用)
|
||||||
const fetchHazardList = async () => {
|
const fetchWriteOffList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getMyWriteOffList();
|
const res = await getMyWriteOffList();
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
const list = res.data;
|
hazardList.value = res.data;
|
||||||
hazardList.value = list;
|
console.log('销号申请列表:', res.data);
|
||||||
// 转换为 picker 需要的格式
|
|
||||||
if (list.length > 0) {
|
|
||||||
hazardColumns.value = [list.map(item => item.hazardTitle || `隐患${item.hazardId}`)];
|
|
||||||
}
|
|
||||||
console.log('隐患列表:', list);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取隐患列表失败:', error);
|
console.error('获取销号申请列表失败:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取可申请销号的隐患列表(弹窗选择用)
|
||||||
|
const fetchAcceptanceList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getAcceptanceList();
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
const list = res.data.records || res.data || [];
|
||||||
|
acceptanceHazardList.value = list;
|
||||||
|
// 转换为 picker 需要的格式
|
||||||
|
if (list.length > 0) {
|
||||||
|
hazardColumns.value = [list.map(item => item.title || item.hazardTitle || `隐患${item.hazardId}`)];
|
||||||
|
} else {
|
||||||
|
hazardColumns.value = [['暂无可申请销号的隐患']];
|
||||||
|
}
|
||||||
|
console.log('可申请销号的隐患列表:', list);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取可申请销号隐患列表失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取部门列表
|
||||||
|
const fetchDeptList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getDepartmentPersonUsers();
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
const users = [];
|
||||||
|
res.data.forEach(dept => {
|
||||||
|
if (dept.users && dept.users.length > 0) {
|
||||||
|
dept.users.forEach(user => {
|
||||||
|
users.push({
|
||||||
|
userId: user.userId,
|
||||||
|
deptId: dept.deptId,
|
||||||
|
name: `${user.nickName}(${dept.deptName})`
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
deptList.value = users;
|
||||||
|
// 转换为 picker 需要的格式
|
||||||
|
if (users.length > 0) {
|
||||||
|
deptColumns.value = [users.map(item => item.name)];
|
||||||
|
} else {
|
||||||
|
deptColumns.value = [['暂无人员数据']];
|
||||||
|
}
|
||||||
|
console.log('部门人员列表:', users);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取部门人员列表失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 部门选择确认
|
||||||
|
const onDeptConfirm = (e) => {
|
||||||
|
console.log('选择的人员:', e);
|
||||||
|
if (e.value && e.value.length > 0) {
|
||||||
|
selectedDeptName.value = e.value[0];
|
||||||
|
// 找到对应的用户ID和部门ID
|
||||||
|
const index = e.indexs[0];
|
||||||
|
if (deptList.value[index]) {
|
||||||
|
selectedDeptId.value = deptList.value[index].deptId;
|
||||||
|
formData.responsibleDeptId = deptList.value[index].deptId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
showDeptPicker.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 打开新增弹窗
|
||||||
|
const openAddPopup = () => {
|
||||||
|
resetForm();
|
||||||
|
fetchAcceptanceList(); // 获取可申请销号的隐患列表
|
||||||
|
fetchDeptList(); // 获取部门列表
|
||||||
|
showAddPopup.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
// 隐患选择确认
|
// 隐患选择确认
|
||||||
const onHazardConfirm = (e) => {
|
const onHazardConfirm = (e) => {
|
||||||
console.log('选择的隐患:', e);
|
console.log('选择的隐患:', e);
|
||||||
@@ -138,8 +224,8 @@
|
|||||||
selectedHazard.value = e.value[0];
|
selectedHazard.value = e.value[0];
|
||||||
// 找到对应的隐患ID
|
// 找到对应的隐患ID
|
||||||
const index = e.indexs[0];
|
const index = e.indexs[0];
|
||||||
if (hazardList.value[index]) {
|
if (acceptanceHazardList.value[index]) {
|
||||||
selectedHazardId.value = hazardList.value[index].hazardId;
|
selectedHazardId.value = acceptanceHazardList.value[index].hazardId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showHazardPicker.value = false;
|
showHazardPicker.value = false;
|
||||||
@@ -163,8 +249,10 @@
|
|||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
selectedHazard.value = '';
|
selectedHazard.value = '';
|
||||||
selectedHazardId.value = '';
|
selectedHazardId.value = '';
|
||||||
|
selectedDeptName.value = '';
|
||||||
|
selectedDeptId.value = '';
|
||||||
formData.rectifyDeadline = '';
|
formData.rectifyDeadline = '';
|
||||||
formData.responsibleDeptName = '';
|
formData.responsibleDeptId = '';
|
||||||
formData.responsiblePerson = '';
|
formData.responsiblePerson = '';
|
||||||
formData.mainTreatmentContent = '';
|
formData.mainTreatmentContent = '';
|
||||||
formData.treatmentResult = '';
|
formData.treatmentResult = '';
|
||||||
@@ -178,10 +266,11 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建请求参数
|
// 构建请求参数(与接口文档对应)
|
||||||
const params = {
|
const params = {
|
||||||
hazardId: Number(selectedHazardId.value), // 隐患ID(必需)
|
hazardId: Number(selectedHazardId.value), // 隐患ID(必需)
|
||||||
rectifyDeadline: formData.rectifyDeadline || '', // 整改时限
|
rectifyDeadline: formData.rectifyDeadline || '', // 整改时限
|
||||||
|
responsibleDeptId: Number(formData.responsibleDeptId) || 0, // 隐患治理责任单位ID
|
||||||
responsiblePerson: formData.responsiblePerson || '', // 主要负责人
|
responsiblePerson: formData.responsiblePerson || '', // 主要负责人
|
||||||
mainTreatmentContent: formData.mainTreatmentContent || '', // 主要治理内容
|
mainTreatmentContent: formData.mainTreatmentContent || '', // 主要治理内容
|
||||||
treatmentResult: formData.treatmentResult || '', // 隐患治理完成内容
|
treatmentResult: formData.treatmentResult || '', // 隐患治理完成内容
|
||||||
@@ -196,6 +285,8 @@
|
|||||||
uni.showToast({ title: '申请成功', icon: 'success' });
|
uni.showToast({ title: '申请成功', icon: 'success' });
|
||||||
showAddPopup.value = false;
|
showAddPopup.value = false;
|
||||||
resetForm();
|
resetForm();
|
||||||
|
// 刷新销号申请列表
|
||||||
|
fetchWriteOffList();
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: res.msg || '申请失败', icon: 'none' });
|
uni.showToast({ title: res.msg || '申请失败', icon: 'none' });
|
||||||
}
|
}
|
||||||
@@ -211,9 +302,9 @@
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
// 页面加载时获取数据
|
// 页面加载时获取销号申请列表
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchHazardList();
|
fetchWriteOffList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -251,8 +342,6 @@
|
|||||||
|
|
||||||
.popup-body {
|
.popup-body {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
max-height: 800rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-footer {
|
.popup-footer {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<up-input v-model="formData.statusName" placeholder="" disabled></up-input>
|
<up-input v-model="formData.statusName" placeholder="" disabled></up-input>
|
||||||
<view class="flex justify-center margin-top-xl" style="gap: 30rpx;">
|
<view class="flex justify-center margin-top-xl" style="gap: 30rpx;">
|
||||||
<button class="round cu-btn lg" @click="handleCancel">返回</button>
|
<button class="round cu-btn lg" @click="handleCancel">返回</button>
|
||||||
<button v-if="canEdit" class="bg-blue round cu-btn lg" @click="handleSubmit">保存</button>
|
<!-- <button v-if="canEdit" class="bg-blue round cu-btn lg" @click="handleSubmit">保存</button> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,49 +1,825 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page padding">
|
<view class="page padding">
|
||||||
<view class="padding bg-white radius list">
|
<!-- 有企业信息时显示详情 -->
|
||||||
|
<view v-if="hasEnterpriseInfo" class="padding bg-white radius list">
|
||||||
<view class="flex justify-between">
|
<view class="flex justify-between">
|
||||||
<view class="text-bold">湘西自治州和谐网络科技有限公司</view>
|
<view class="text-bold text-lg">{{ enterpriseInfo.name }}</view>
|
||||||
<view class="lg text-blue cuIcon-edit over" @click="edit()">编辑</view>
|
<view class="lg text-blue cuIcon-edit over" @click="openEditPopup">编辑</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="info-item" v-if="enterpriseInfo.enterpriseTypeName">
|
||||||
<view class="text-gray">所属部门:</view>
|
<view class="text-gray">企业类型:</view>
|
||||||
<view>湘西自治州和谐网络科技有限公司</view>
|
<view>{{ enterpriseInfo.enterpriseTypeName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="info-item" v-if="enterpriseInfo.industryName">
|
||||||
<view class="text-gray">企业代码:</view>
|
<view class="text-gray">行业类型:</view>
|
||||||
<view>91433126MA4P8WWG20</view>
|
<view>{{ enterpriseInfo.industryName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="info-item" v-if="enterpriseInfo.creditCode">
|
||||||
|
<view class="text-gray">统一社会信用代码:</view>
|
||||||
|
<view>{{ enterpriseInfo.creditCode }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.registeredCapital">
|
||||||
|
<view class="text-gray">注册资本:</view>
|
||||||
|
<view>{{ enterpriseInfo.registeredCapital }}万元</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.establishDate">
|
||||||
|
<view class="text-gray">成立时间:</view>
|
||||||
|
<view>{{ enterpriseInfo.establishDate }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.employeeCount">
|
||||||
|
<view class="text-gray">员工总数:</view>
|
||||||
|
<view>{{ enterpriseInfo.employeeCount }}人</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.mainBusiness">
|
||||||
|
<view class="text-gray">主营行业:</view>
|
||||||
|
<view>{{ enterpriseInfo.mainBusiness }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.mainProducts">
|
||||||
|
<view class="text-gray">主要产品/服务:</view>
|
||||||
|
<view>{{ enterpriseInfo.mainProducts }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.annualOutput">
|
||||||
|
<view class="text-gray">年产值:</view>
|
||||||
|
<view>{{ enterpriseInfo.annualOutput }}万元</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.province || enterpriseInfo.city">
|
||||||
|
<view class="text-gray">所在地区:</view>
|
||||||
|
<view>{{ enterpriseInfo.province }}{{ enterpriseInfo.city }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.address">
|
||||||
|
<view class="text-gray">详细地址:</view>
|
||||||
|
<view>{{ enterpriseInfo.address }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.phone">
|
||||||
<view class="text-gray">联系电话:</view>
|
<view class="text-gray">联系电话:</view>
|
||||||
<view>13974356210</view>
|
<view>{{ enterpriseInfo.phone }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="info-item" v-if="enterpriseInfo.email">
|
||||||
<view class="text-gray">企业地址:</view>
|
<view class="text-gray">电子邮箱:</view>
|
||||||
<view>湘西州文学艺术界联合会6楼</view>
|
<view>{{ enterpriseInfo.email }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.legalPerson">
|
||||||
|
<view class="text-gray">法定代表人:</view>
|
||||||
|
<view>{{ enterpriseInfo.legalPerson }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.legalPersonPhone">
|
||||||
|
<view class="text-gray">法人联系电话:</view>
|
||||||
|
<view>{{ enterpriseInfo.legalPersonPhone }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.safetyManager">
|
||||||
|
<view class="text-gray">安全负责人:</view>
|
||||||
|
<view>{{ enterpriseInfo.safetyManager }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="enterpriseInfo.safetyManagerPhone">
|
||||||
|
<view class="text-gray">安全负责人电话:</view>
|
||||||
|
<view>{{ enterpriseInfo.safetyManagerPhone }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 没有企业信息时显示新增按钮 -->
|
||||||
|
<view v-else class="empty-box">
|
||||||
|
<view class="text-gray text-center margin-bottom">暂无企业信息</view>
|
||||||
|
<button class="bg-blue round" @click="openAddPopup">新增企业信息</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 新增/编辑弹窗 - 使用 up-modal -->
|
||||||
|
<up-modal
|
||||||
|
:show="showPopup"
|
||||||
|
:title="isEdit ? '编辑企业信息' : '新增企业信息'"
|
||||||
|
:showConfirmButton="true"
|
||||||
|
:showCancelButton="true"
|
||||||
|
confirmText="确定"
|
||||||
|
cancelText="取消"
|
||||||
|
@confirm="handleSubmit"
|
||||||
|
@cancel="showPopup = false"
|
||||||
|
@close="showPopup = false"
|
||||||
|
:closeOnClickOverlay="false"
|
||||||
|
>
|
||||||
|
<scroll-view class="modal-scroll-body" scroll-y="true">
|
||||||
|
<!-- 企业名称 -->
|
||||||
|
<view class="form-label">
|
||||||
|
<view class="text-gray">企业名称</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.name" placeholder="请输入企业名称" />
|
||||||
|
|
||||||
|
<!-- 企业类型 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">企业类型</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<view class="select-trigger" @click="openEnterpriseTypePopup">
|
||||||
|
<view class="select-value" :class="{ 'placeholder': !selectedEnterpriseTypeName }">
|
||||||
|
{{ selectedEnterpriseTypeName || '请选择企业类型' }}
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-unfold"></text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 行业类型 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">行业类型</view>
|
||||||
|
<view class="text-red">*</view>
|
||||||
|
</view>
|
||||||
|
<view class="select-trigger" @click="openIndustryPopup">
|
||||||
|
<view class="select-value" :class="{ 'placeholder': !selectedIndustryName }">
|
||||||
|
{{ selectedIndustryName || '请选择行业类型' }}
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-unfold"></text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 统一社会信用代码 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">统一社会信用代码</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.creditCode" placeholder="请输入统一社会信用代码" />
|
||||||
|
|
||||||
|
<!-- 注册资本 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">注册资本(万元)</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.registeredCapital" placeholder="请输入注册资本" type="number" />
|
||||||
|
|
||||||
|
<!-- 成立时间 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">成立时间</view>
|
||||||
|
</view>
|
||||||
|
<view class="select-trigger" @click="showDatePicker = true">
|
||||||
|
<view class="select-value" :class="{ 'placeholder': !formData.establishDate }">
|
||||||
|
{{ formData.establishDate || '请选择成立时间' }}
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-calendar"></text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 员工总数 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">员工总数</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.employeeCount" placeholder="请输入员工总数" type="number" />
|
||||||
|
|
||||||
|
<!-- 主营行业 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">主营行业</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.mainBusiness" placeholder="请输入主营行业" />
|
||||||
|
|
||||||
|
<!-- 主要产品/服务 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">主要产品/服务</view>
|
||||||
|
</view>
|
||||||
|
<textarea class="form-textarea" v-model="formData.mainProducts" placeholder="请输入主要产品/服务"></textarea>
|
||||||
|
|
||||||
|
<!-- 年产值 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">年产值(万元)</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.annualOutput" placeholder="请输入年产值" type="number" />
|
||||||
|
|
||||||
|
<!-- 所在省份 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">所在省份</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.province" placeholder="请输入所在省份" />
|
||||||
|
|
||||||
|
<!-- 所在城市 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">所在城市</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.city" placeholder="请输入所在城市" />
|
||||||
|
|
||||||
|
<!-- 详细地址 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">详细地址</view>
|
||||||
|
</view>
|
||||||
|
<textarea class="form-textarea" v-model="formData.address" placeholder="请输入详细地址"></textarea>
|
||||||
|
|
||||||
|
<!-- 联系电话 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">联系电话</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.phone" placeholder="请输入联系电话" />
|
||||||
|
|
||||||
|
<!-- 电子邮箱 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">电子邮箱</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.email" placeholder="请输入电子邮箱" />
|
||||||
|
|
||||||
|
<!-- 法定代表人 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">法定代表人</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.legalPerson" placeholder="请输入法定代表人" />
|
||||||
|
|
||||||
|
<!-- 法人联系电话 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">法人联系电话</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.legalPersonPhone" placeholder="请输入法人联系电话" />
|
||||||
|
|
||||||
|
<!-- 安全负责人 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">安全负责人</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.safetyManager" placeholder="请输入安全负责人" />
|
||||||
|
|
||||||
|
<!-- 安全负责人电话 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">安全负责人电话</view>
|
||||||
|
</view>
|
||||||
|
<input class="form-input" v-model="formData.safetyManagerPhone" placeholder="请输入安全负责人电话" />
|
||||||
|
|
||||||
|
<!-- 资质证书 -->
|
||||||
|
<view class="form-label margin-top">
|
||||||
|
<view class="text-gray">资质证书</view>
|
||||||
|
</view>
|
||||||
|
<up-upload :fileList="certificateFiles" @afterRead="afterRead" @delete="deleteCertificate" name="certificate" multiple :maxCount="10" accept="all"></up-upload>
|
||||||
|
<view class="text-gray text-sm margin-bottom">支持上传图片、PDF等文件</view>
|
||||||
|
</scroll-view>
|
||||||
|
</up-modal>
|
||||||
|
|
||||||
|
<!-- 日期选择器单独放在外面 -->
|
||||||
|
<u-datetime-picker
|
||||||
|
:show="showDatePicker"
|
||||||
|
v-model="establishDateValue"
|
||||||
|
mode="date"
|
||||||
|
@confirm="onDateConfirm"
|
||||||
|
@cancel="showDatePicker = false"
|
||||||
|
@close="showDatePicker = false"
|
||||||
|
></u-datetime-picker>
|
||||||
|
|
||||||
|
<!-- 企业类型选择弹窗 -->
|
||||||
|
<u-popup :show="showEnterpriseTypePopup" mode="bottom" round="20" @close="showEnterpriseTypePopup = false">
|
||||||
|
<view class="picker-popup">
|
||||||
|
<view class="picker-header">
|
||||||
|
<view class="picker-cancel" @click="showEnterpriseTypePopup = false">取消</view>
|
||||||
|
<view class="picker-title">选择企业类型</view>
|
||||||
|
<view class="picker-confirm" @click="confirmEnterpriseType">确定</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view class="picker-body" scroll-y>
|
||||||
|
<view
|
||||||
|
class="picker-item"
|
||||||
|
v-for="item in enterpriseTypeList"
|
||||||
|
:key="item.id"
|
||||||
|
:class="{ 'active': tempEnterpriseTypeId === item.id }"
|
||||||
|
@click="tempEnterpriseTypeId = item.id"
|
||||||
|
>
|
||||||
|
<text>{{ item.name }}</text>
|
||||||
|
<text v-if="tempEnterpriseTypeId === item.id" class="cuIcon-check text-blue"></text>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
|
||||||
|
<!-- 行业类型选择弹窗 -->
|
||||||
|
<u-popup :show="showIndustryPopup" mode="bottom" round="20" @close="showIndustryPopup = false">
|
||||||
|
<view class="picker-popup">
|
||||||
|
<view class="picker-header">
|
||||||
|
<view class="picker-cancel" @click="showIndustryPopup = false">取消</view>
|
||||||
|
<view class="picker-title">选择行业类型</view>
|
||||||
|
<view class="picker-confirm" @click="confirmIndustry">确定</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view class="picker-body" scroll-y>
|
||||||
|
<view
|
||||||
|
class="picker-item"
|
||||||
|
v-for="item in industryList"
|
||||||
|
:key="item.id"
|
||||||
|
:class="{ 'active': tempIndustryId === item.id }"
|
||||||
|
@click="tempIndustryId = item.id"
|
||||||
|
>
|
||||||
|
<text>{{ item.name }}</text>
|
||||||
|
<text v-if="tempIndustryId === item.id" class="cuIcon-check text-blue"></text>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref, reactive, onMounted, computed } from 'vue'
|
||||||
const edit = () => {
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
uni.navigateTo({
|
import { getEnterpriseinfo, addEnterprise, updateEnterprise, getEnterprisetype, getindustry } from '@/request/api.js'
|
||||||
url: '/pages/editcompanInformation/editcompanInformation'
|
import { baseUrl, getToken } from '@/request/request.js'
|
||||||
|
|
||||||
|
// 企业信息
|
||||||
|
const enterpriseInfo = ref({})
|
||||||
|
const hasEnterpriseInfo = computed(() => {
|
||||||
|
return enterpriseInfo.value && enterpriseInfo.value.name
|
||||||
|
})
|
||||||
|
|
||||||
|
// 弹窗控制
|
||||||
|
const showPopup = ref(false)
|
||||||
|
const isEdit = ref(false)
|
||||||
|
const showDatePicker = ref(false)
|
||||||
|
const establishDateValue = ref(Date.now())
|
||||||
|
|
||||||
|
// 下拉选项
|
||||||
|
const enterpriseTypeList = ref([])
|
||||||
|
const industryList = ref([])
|
||||||
|
|
||||||
|
// 选择弹窗控制
|
||||||
|
const showEnterpriseTypePopup = ref(false)
|
||||||
|
const showIndustryPopup = ref(false)
|
||||||
|
const tempEnterpriseTypeId = ref('')
|
||||||
|
const tempIndustryId = ref('')
|
||||||
|
const selectedEnterpriseTypeName = ref('')
|
||||||
|
const selectedIndustryName = ref('')
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formData = reactive({
|
||||||
|
deptId: '',
|
||||||
|
enterpriseTypeId: '',
|
||||||
|
industryId: '',
|
||||||
|
name: '',
|
||||||
|
creditCode: '',
|
||||||
|
registeredCapital: '',
|
||||||
|
establishDate: '',
|
||||||
|
employeeCount: '',
|
||||||
|
mainBusiness: '',
|
||||||
|
mainProducts: '',
|
||||||
|
annualOutput: '',
|
||||||
|
province: '',
|
||||||
|
city: '',
|
||||||
|
address: '',
|
||||||
|
phone: '',
|
||||||
|
email: '',
|
||||||
|
legalPerson: '',
|
||||||
|
legalPersonPhone: '',
|
||||||
|
safetyManager: '',
|
||||||
|
safetyManagerPhone: '',
|
||||||
|
certificates: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
// 资质证书文件列表
|
||||||
|
const certificateFiles = ref([])
|
||||||
|
|
||||||
|
// 获取用户部门ID
|
||||||
|
const getDeptId = () => {
|
||||||
|
try {
|
||||||
|
const userInfoStr = uni.getStorageSync('userInfo')
|
||||||
|
if (userInfoStr) {
|
||||||
|
const userInfo = JSON.parse(userInfoStr)
|
||||||
|
return userInfo.deptId || ''
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取用户信息失败:', error)
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取企业信息
|
||||||
|
const fetchEnterpriseInfo = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getEnterpriseinfo()
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
enterpriseInfo.value = res.data
|
||||||
|
console.log('企业信息:', res.data)
|
||||||
|
} else {
|
||||||
|
enterpriseInfo.value = {}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取企业信息失败:', error)
|
||||||
|
enterpriseInfo.value = {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取企业类型列表
|
||||||
|
const fetchEnterpriseTypes = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getEnterprisetype()
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
enterpriseTypeList.value = res.data.map(item => ({
|
||||||
|
id: String(item.id),
|
||||||
|
name: item.name
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取企业类型失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取行业类型列表
|
||||||
|
const fetchIndustryTypes = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getindustry({})
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
industryList.value = res.data.map(item => ({
|
||||||
|
id: String(item.id),
|
||||||
|
name: item.name
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取行业类型失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开企业类型选择弹窗
|
||||||
|
const openEnterpriseTypePopup = () => {
|
||||||
|
tempEnterpriseTypeId.value = formData.enterpriseTypeId
|
||||||
|
showEnterpriseTypePopup.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认企业类型选择
|
||||||
|
const confirmEnterpriseType = () => {
|
||||||
|
if (tempEnterpriseTypeId.value) {
|
||||||
|
formData.enterpriseTypeId = tempEnterpriseTypeId.value
|
||||||
|
const selected = enterpriseTypeList.value.find(item => item.id === tempEnterpriseTypeId.value)
|
||||||
|
selectedEnterpriseTypeName.value = selected ? selected.name : ''
|
||||||
|
}
|
||||||
|
showEnterpriseTypePopup.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开行业类型选择弹窗
|
||||||
|
const openIndustryPopup = () => {
|
||||||
|
tempIndustryId.value = formData.industryId
|
||||||
|
showIndustryPopup.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认行业类型选择
|
||||||
|
const confirmIndustry = () => {
|
||||||
|
if (tempIndustryId.value) {
|
||||||
|
formData.industryId = tempIndustryId.value
|
||||||
|
const selected = industryList.value.find(item => item.id === tempIndustryId.value)
|
||||||
|
selectedIndustryName.value = selected ? selected.name : ''
|
||||||
|
}
|
||||||
|
showIndustryPopup.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 日期确认
|
||||||
|
const onDateConfirm = (e) => {
|
||||||
|
const date = new Date(e.value)
|
||||||
|
formData.establishDate = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
|
||||||
|
showDatePicker.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.deptId = getDeptId()
|
||||||
|
formData.enterpriseTypeId = ''
|
||||||
|
formData.industryId = ''
|
||||||
|
formData.name = ''
|
||||||
|
formData.creditCode = ''
|
||||||
|
formData.registeredCapital = ''
|
||||||
|
formData.establishDate = ''
|
||||||
|
formData.employeeCount = ''
|
||||||
|
formData.mainBusiness = ''
|
||||||
|
formData.mainProducts = ''
|
||||||
|
formData.annualOutput = ''
|
||||||
|
formData.province = ''
|
||||||
|
formData.city = ''
|
||||||
|
formData.address = ''
|
||||||
|
formData.phone = ''
|
||||||
|
formData.email = ''
|
||||||
|
formData.legalPerson = ''
|
||||||
|
formData.legalPersonPhone = ''
|
||||||
|
formData.safetyManager = ''
|
||||||
|
formData.safetyManagerPhone = ''
|
||||||
|
formData.certificates = ''
|
||||||
|
certificateFiles.value = []
|
||||||
|
selectedEnterpriseTypeName.value = ''
|
||||||
|
selectedIndustryName.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开新增弹窗
|
||||||
|
const openAddPopup = () => {
|
||||||
|
isEdit.value = false
|
||||||
|
resetForm()
|
||||||
|
showPopup.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开编辑弹窗
|
||||||
|
const openEditPopup = () => {
|
||||||
|
isEdit.value = true
|
||||||
|
// 填充表单数据
|
||||||
|
formData.deptId = enterpriseInfo.value.deptId || getDeptId()
|
||||||
|
formData.enterpriseTypeId = String(enterpriseInfo.value.enterpriseTypeId || '')
|
||||||
|
formData.industryId = String(enterpriseInfo.value.industryId || '')
|
||||||
|
formData.name = enterpriseInfo.value.name || ''
|
||||||
|
formData.creditCode = enterpriseInfo.value.creditCode || ''
|
||||||
|
formData.registeredCapital = enterpriseInfo.value.registeredCapital || ''
|
||||||
|
formData.establishDate = enterpriseInfo.value.establishDate || ''
|
||||||
|
formData.employeeCount = enterpriseInfo.value.employeeCount || ''
|
||||||
|
formData.mainBusiness = enterpriseInfo.value.mainBusiness || ''
|
||||||
|
formData.mainProducts = enterpriseInfo.value.mainProducts || ''
|
||||||
|
formData.annualOutput = enterpriseInfo.value.annualOutput || ''
|
||||||
|
formData.province = enterpriseInfo.value.province || ''
|
||||||
|
formData.city = enterpriseInfo.value.city || ''
|
||||||
|
formData.address = enterpriseInfo.value.address || ''
|
||||||
|
formData.phone = enterpriseInfo.value.phone || ''
|
||||||
|
formData.email = enterpriseInfo.value.email || ''
|
||||||
|
formData.legalPerson = enterpriseInfo.value.legalPerson || ''
|
||||||
|
formData.legalPersonPhone = enterpriseInfo.value.legalPersonPhone || ''
|
||||||
|
formData.safetyManager = enterpriseInfo.value.safetyManager || ''
|
||||||
|
formData.safetyManagerPhone = enterpriseInfo.value.safetyManagerPhone || ''
|
||||||
|
|
||||||
|
// 同步显示已选择的类型名称
|
||||||
|
selectedEnterpriseTypeName.value = enterpriseInfo.value.enterpriseTypeName || ''
|
||||||
|
selectedIndustryName.value = enterpriseInfo.value.industryName || ''
|
||||||
|
|
||||||
|
// 处理资质证书
|
||||||
|
if (enterpriseInfo.value.certificates) {
|
||||||
|
try {
|
||||||
|
const certs = JSON.parse(enterpriseInfo.value.certificates)
|
||||||
|
certificateFiles.value = certs.map(cert => ({
|
||||||
|
url: cert.filePath || cert.url,
|
||||||
|
name: cert.fileName || cert.name,
|
||||||
|
status: 'success'
|
||||||
|
}))
|
||||||
|
} catch (e) {
|
||||||
|
certificateFiles.value = []
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
certificateFiles.value = []
|
||||||
|
}
|
||||||
|
|
||||||
|
showPopup.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
const afterRead = async (event) => {
|
||||||
|
let lists = [].concat(event.file)
|
||||||
|
let fileListLen = certificateFiles.value.length
|
||||||
|
lists.forEach((item) => {
|
||||||
|
certificateFiles.value.push({
|
||||||
|
...item,
|
||||||
|
status: 'uploading',
|
||||||
|
message: '上传中'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
for (let i = 0; i < lists.length; i++) {
|
||||||
|
const result = await uploadFilePromise(lists[i].url)
|
||||||
|
let item = certificateFiles.value[fileListLen]
|
||||||
|
certificateFiles.value.splice(fileListLen, 1, {
|
||||||
|
...item,
|
||||||
|
status: 'success',
|
||||||
|
message: '',
|
||||||
|
url: result
|
||||||
|
})
|
||||||
|
fileListLen++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除文件
|
||||||
|
const deleteCertificate = (event) => {
|
||||||
|
certificateFiles.value.splice(event.index, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上传文件Promise
|
||||||
|
const uploadFilePromise = (filePath) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.uploadFile({
|
||||||
|
url: baseUrl + '/frontend/attachment/upload',
|
||||||
|
filePath: filePath,
|
||||||
|
name: 'file',
|
||||||
|
header: {
|
||||||
|
'Authorization': getToken()
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
const data = JSON.parse(res.data)
|
||||||
|
if (data.code === 0) {
|
||||||
|
resolve(data.data)
|
||||||
|
} else {
|
||||||
|
reject(data.msg || '上传失败')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('上传失败:', err)
|
||||||
|
reject(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
// 表单验证
|
||||||
|
if (!formData.name) {
|
||||||
|
uni.showToast({ title: '请输入企业名称', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!formData.enterpriseTypeId) {
|
||||||
|
uni.showToast({ title: '请选择企业类型', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!formData.industryId) {
|
||||||
|
uni.showToast({ title: '请选择行业类型', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建资质证书JSON
|
||||||
|
const certificates = certificateFiles.value.map(file => ({
|
||||||
|
fileName: file.name || file.url.split('/').pop(),
|
||||||
|
filePath: file.url
|
||||||
|
}))
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
deptId: Number(formData.deptId) || Number(getDeptId()),
|
||||||
|
enterpriseTypeId: Number(formData.enterpriseTypeId),
|
||||||
|
industryId: Number(formData.industryId),
|
||||||
|
name: formData.name,
|
||||||
|
creditCode: formData.creditCode || '',
|
||||||
|
registeredCapital: Number(formData.registeredCapital) || 0,
|
||||||
|
establishDate: formData.establishDate || '',
|
||||||
|
employeeCount: Number(formData.employeeCount) || 0,
|
||||||
|
mainBusiness: formData.mainBusiness || '',
|
||||||
|
mainProducts: formData.mainProducts || '',
|
||||||
|
annualOutput: Number(formData.annualOutput) || 0,
|
||||||
|
province: formData.province || '',
|
||||||
|
city: formData.city || '',
|
||||||
|
address: formData.address || '',
|
||||||
|
phone: formData.phone || '',
|
||||||
|
email: formData.email || '',
|
||||||
|
legalPerson: formData.legalPerson || '',
|
||||||
|
legalPersonPhone: formData.legalPersonPhone || '',
|
||||||
|
safetyManager: formData.safetyManager || '',
|
||||||
|
safetyManagerPhone: formData.safetyManagerPhone || '',
|
||||||
|
certificates: JSON.stringify(certificates)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是编辑模式,添加 id 字段
|
||||||
|
if (isEdit.value && enterpriseInfo.value.id) {
|
||||||
|
params.id = enterpriseInfo.value.id
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res
|
||||||
|
if (isEdit.value) {
|
||||||
|
res = await updateEnterprise(params)
|
||||||
|
} else {
|
||||||
|
res = await addEnterprise(params)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.code === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: isEdit.value ? '修改成功' : '新增成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
showPopup.value = false
|
||||||
|
// 刷新数据
|
||||||
|
fetchEnterpriseInfo()
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg || '操作失败',
|
||||||
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('提交失败:', error)
|
||||||
|
uni.showToast({
|
||||||
|
title: '操作失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 页面显示时获取数据
|
||||||
|
onShow(() => {
|
||||||
|
fetchEnterpriseInfo()
|
||||||
|
fetchEnterpriseTypes()
|
||||||
|
fetchIndustryTypes()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page {
|
.page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
}
|
}
|
||||||
.list {
|
|
||||||
|
.list {
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
||||||
border-left: 5px solid #2667E9;
|
border-left: 5px solid #2667E9;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-item {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
.text-gray {
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: #999;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-box {
|
||||||
|
padding: 100rpx 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
// up-modal 内的滚动区域
|
||||||
|
.modal-scroll-body {
|
||||||
|
height: 60vh;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单输入框样式
|
||||||
|
.form-input {
|
||||||
|
width: 100%;
|
||||||
|
height: 80rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
border: 1rpx solid #dcdfe6;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-textarea {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 160rpx;
|
||||||
|
padding: 20rpx 24rpx;
|
||||||
|
border: 1rpx solid #dcdfe6;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
|
||||||
|
.text-red {
|
||||||
|
margin-left: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择触发器样式
|
||||||
|
.select-trigger {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background: #fff;
|
||||||
|
border: 1rpx solid #dcdfe6;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 20rpx 24rpx;
|
||||||
|
|
||||||
|
.select-value {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
&.placeholder {
|
||||||
|
color: #c0c4cc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择弹窗样式
|
||||||
|
.picker-popup {
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.picker-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #eee;
|
||||||
|
|
||||||
|
.picker-cancel {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-confirm {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #2667E9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-body {
|
||||||
|
max-height: 600rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx 0;
|
||||||
|
border-bottom: 1rpx solid #f5f5f5;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: #2667E9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@
|
|||||||
<view class="popup-title text-bold">新增设备</view>
|
<view class="popup-title text-bold">新增设备</view>
|
||||||
<view class="popup-close" @click="showAddPopup = false">×</view>
|
<view class="popup-close" @click="showAddPopup = false">×</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="popup-body">
|
<scroll-view class="popup-body" scroll-y :style="{ height: '60vh' }">
|
||||||
<!-- 在这里填写表单内容 -->
|
<!-- 在这里填写表单内容 -->
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<view class=" margin-bottom">型号</view>
|
<view class=" margin-bottom">型号</view>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="margin-top-sm margin-bottom margin-top">备注</view>
|
<view class="margin-top-sm margin-bottom margin-top">备注</view>
|
||||||
<up-textarea v-model="value1" placeholder="请输入备注"></up-textarea>
|
<up-textarea v-model="value1" placeholder="请输入备注"></up-textarea>
|
||||||
</view>
|
</scroll-view>
|
||||||
<view class="popup-footer">
|
<view class="popup-footer">
|
||||||
<button class="btn-cancel" @click="showAddPopup = false">取消</button>
|
<button class="btn-cancel" @click="showAddPopup = false">取消</button>
|
||||||
<button class="btn-confirm bg-blue" @click="handleAdd">确定</button>
|
<button class="btn-confirm bg-blue" @click="handleAdd">确定</button>
|
||||||
@@ -169,8 +169,6 @@
|
|||||||
|
|
||||||
.popup-body {
|
.popup-body {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
max-height: 60vh;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-footer {
|
.popup-footer {
|
||||||
|
|||||||
@@ -25,18 +25,27 @@
|
|||||||
<view class="flex justify-end" style="gap: 10rpx;">
|
<view class="flex justify-end" style="gap: 10rpx;">
|
||||||
<!-- 所有状态都显示查看详情 -->
|
<!-- 所有状态都显示查看详情 -->
|
||||||
<button class="round cu-btn lg light bg-blue" @click="details(item)">查看详情</button>
|
<button class="round cu-btn lg light bg-blue" @click="details(item)">查看详情</button>
|
||||||
<!-- 待整改、待验收显示立即整改 -->
|
<!-- 待整改状态:canEdit为true时显示隐患交办和立即整改,为false时不显示 -->
|
||||||
<button v-if="item.statusName === '待整改' || item.statusName === '待验收'"
|
<button v-if="item.statusName === '待整改' && item.canEdit"
|
||||||
class="round cu-btn lg light bg-blue" @click="Rectification(item)">立即整改</button>
|
class="round cu-btn lg light bg-blue" @click="assignHazard(item)">隐患交办</button>
|
||||||
<!-- 待验收显示立即验收 -->
|
<button v-if="item.statusName === '待整改' && item.canEdit"
|
||||||
<button v-if="item.statusName === '待验收'"
|
class="round cu-btn lg bg-blue" @click="Rectification(item)">立即整改</button>
|
||||||
|
<!-- 待验收显示编辑整改信息和立即验收 -->
|
||||||
|
<button v-if="item.statusName === '待验收' && item.canEdit"
|
||||||
|
class="round cu-btn lg light bg-blue" @click="editRectification(item)">编辑整改信息</button>
|
||||||
|
<button v-if="item.statusName === '待验收' && canAcceptance"
|
||||||
class="round cu-btn lg bg-blue" @click="acceptance(item)">立即验收</button>
|
class="round cu-btn lg bg-blue" @click="acceptance(item)">立即验收</button>
|
||||||
<!-- 待交办显示隐患交办 -->
|
<!-- 待交办显示隐患交办 -->
|
||||||
<button v-if="item.statusName === '待交办'"
|
<button v-if="item.statusName === '待交办'"
|
||||||
class="round cu-btn lg bg-blue" @click="assignHazard(item)">隐患交办</button>
|
class="round cu-btn lg bg-blue" @click="assignHazard(item)">隐患交办</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="cuIcon-add round bg-blue margin-top-xl" @click="showAddPopup = true">新增</button>
|
|
||||||
|
<!-- 固定在底部的悬浮新增按钮 -->
|
||||||
|
<view class="fixed-add-btn" @click="showAddPopup = true">
|
||||||
|
<text class="cuIcon-add"></text>
|
||||||
|
<text>新增</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 新增弹窗 -->
|
<!-- 新增弹窗 -->
|
||||||
<u-popup :show="showAddPopup" mode="center" round="20" @close="showAddPopup = false">
|
<u-popup :show="showAddPopup" mode="center" round="20" @close="showAddPopup = false">
|
||||||
@@ -45,7 +54,7 @@
|
|||||||
<view class="popup-title text-bold">新增隐患排查</view>
|
<view class="popup-title text-bold">新增隐患排查</view>
|
||||||
<view class="popup-close" @click="showAddPopup = false">×</view>
|
<view class="popup-close" @click="showAddPopup = false">×</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="popup-body">
|
<scroll-view class="popup-body" scroll-y>
|
||||||
<view class="flex margin-bottom">
|
<view class="flex margin-bottom">
|
||||||
<view class="text-gray">隐患图片/视频</view>
|
<view class="text-gray">隐患图片/视频</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
@@ -77,12 +86,22 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="address-box">
|
<view class="address-box">
|
||||||
<view class="address-input" @tap.stop="chooseLocation">
|
<up-input class="address-input-wrapper" v-model="selectedAddress" placeholder="请输入地址" border="surround"></up-input>
|
||||||
<text :class="selectedAddress ? '' : 'text-gray'">{{ selectedAddress || '请选择地址' }}</text>
|
|
||||||
</view>
|
|
||||||
<button class="btn-address bg-blue" @tap.stop="chooseLocation">选择地址</button>
|
<button class="btn-address bg-blue" @tap.stop="chooseLocation">选择地址</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-gray text-sm margin-top-xs">如:办公楼3层东侧消防通道、生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view>
|
<view class="text-gray text-sm margin-top-xs">如:办公楼3层东侧消防通道、生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view>
|
||||||
|
|
||||||
|
<!-- 隐患区域选择 -->
|
||||||
|
<view class="flex margin-bottom margin-top">
|
||||||
|
<view class="text-gray">隐患区域</view>
|
||||||
|
</view>
|
||||||
|
<view class="select-trigger" @click="showAreaPicker = true">
|
||||||
|
<view class="select-value" :class="{ 'placeholder': !selectedAreaName }">
|
||||||
|
{{ selectedAreaName || '请选择隐患区域' }}
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-unfold"></text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="flex margin-bottom margin-top">
|
<view class="flex margin-bottom margin-top">
|
||||||
<view class="text-gray">隐患描述</view>
|
<view class="text-gray">隐患描述</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
@@ -92,13 +111,42 @@
|
|||||||
<view class="text-gray margin-bottom margin-top">隐患标签</view>
|
<view class="text-gray margin-bottom margin-top">隐患标签</view>
|
||||||
<up-choose v-model="formData.tagIndex" :options="tagOptions"></up-choose>
|
<up-choose v-model="formData.tagIndex" :options="tagOptions"></up-choose>
|
||||||
<view class="text-gray text-sm">可选择多个相关标签对隐患进行分类</view>
|
<view class="text-gray text-sm">可选择多个相关标签对隐患进行分类</view>
|
||||||
</view>
|
</scroll-view>
|
||||||
<view class="popup-footer">
|
<view class="popup-footer">
|
||||||
<button class="btn-cancel" @click="showAddPopup = false">取消</button>
|
<button class="btn-cancel" @click="showAddPopup = false">取消</button>
|
||||||
<button class="btn-confirm bg-blue" @click="handleAdd">确定</button>
|
<button class="btn-confirm bg-blue" @click="handleAdd">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
|
<!-- 区域选择弹窗 -->
|
||||||
|
<u-popup :show="showAreaPicker" mode="bottom" round="20" @close="showAreaPicker = false">
|
||||||
|
<view class="picker-popup">
|
||||||
|
<view class="picker-header">
|
||||||
|
<view class="picker-cancel" @click="showAreaPicker = false">取消</view>
|
||||||
|
<view class="picker-title">选择隐患区域</view>
|
||||||
|
<view class="picker-confirm" @click="confirmAreaSelect">确定</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view class="picker-body" scroll-y>
|
||||||
|
<view
|
||||||
|
v-for="item in areaList"
|
||||||
|
:key="item.id"
|
||||||
|
class="picker-item"
|
||||||
|
:class="{ 'picker-item-active': tempAreaId === item.id }"
|
||||||
|
@click="tempAreaId = item.id"
|
||||||
|
>
|
||||||
|
<view class="flex align-center">
|
||||||
|
<view class="area-color-dot" :style="{ backgroundColor: item.color }"></view>
|
||||||
|
<text>{{ item.name }}</text>
|
||||||
|
</view>
|
||||||
|
<text v-if="tempAreaId === item.id" class="cuIcon-check text-blue"></text>
|
||||||
|
</view>
|
||||||
|
<view v-if="areaList.length === 0" class="text-gray text-center padding">
|
||||||
|
暂无区域数据
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -120,6 +168,7 @@
|
|||||||
getMyHiddenDangerList,
|
getMyHiddenDangerList,
|
||||||
getHiddenDangerLabelList
|
getHiddenDangerLabelList
|
||||||
} from '@/request/api.js'
|
} from '@/request/api.js'
|
||||||
|
import { getAreaList } from '@/request/three_one_api/area.js'
|
||||||
import {
|
import {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
getToken
|
getToken
|
||||||
@@ -128,6 +177,27 @@
|
|||||||
// 弹窗控制
|
// 弹窗控制
|
||||||
const showAddPopup = ref(false);
|
const showAddPopup = ref(false);
|
||||||
|
|
||||||
|
// 获取用户角色,判断是否有验收权限(admin或manage才能验收)
|
||||||
|
const userRole = ref('');
|
||||||
|
const canAcceptance = computed(() => {
|
||||||
|
return userRole.value === 'admin' || userRole.value === 'manage';
|
||||||
|
});
|
||||||
|
|
||||||
|
// 从storage获取用户信息
|
||||||
|
const getUserRole = () => {
|
||||||
|
try {
|
||||||
|
const userInfoStr = uni.getStorageSync('userInfo');
|
||||||
|
if (userInfoStr) {
|
||||||
|
const userInfo = JSON.parse(userInfoStr);
|
||||||
|
userRole.value = userInfo.role || '';
|
||||||
|
console.log('当前用户角色:', userRole.value);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取用户信息失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
getUserRole();
|
||||||
|
|
||||||
// 任务相关ID(从接口获取)
|
// 任务相关ID(从接口获取)
|
||||||
const taskId = ref('');
|
const taskId = ref('');
|
||||||
const checkPointId = ref('');
|
const checkPointId = ref('');
|
||||||
@@ -174,13 +244,51 @@
|
|||||||
// 地址选择 - 调用腾讯地图
|
// 地址选择 - 调用腾讯地图
|
||||||
const selectedAddress = ref('');
|
const selectedAddress = ref('');
|
||||||
|
|
||||||
|
// 区域选择相关
|
||||||
|
const showAreaPicker = ref(false);
|
||||||
|
const areaList = ref([]);
|
||||||
|
const selectedAreaId = ref('');
|
||||||
|
const selectedAreaName = ref('');
|
||||||
|
const tempAreaId = ref('');
|
||||||
|
|
||||||
|
// 获取区域列表
|
||||||
|
const fetchAreaList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getAreaList();
|
||||||
|
if (res.code === 0 && res.data && res.data.records) {
|
||||||
|
areaList.value = res.data.records;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取区域列表失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fetchAreaList();
|
||||||
|
|
||||||
|
// 确认区域选择
|
||||||
|
const confirmAreaSelect = () => {
|
||||||
|
if (tempAreaId.value) {
|
||||||
|
selectedAreaId.value = tempAreaId.value;
|
||||||
|
const selected = areaList.value.find(item => item.id === tempAreaId.value);
|
||||||
|
selectedAreaName.value = selected ? selected.name : '';
|
||||||
|
}
|
||||||
|
showAreaPicker.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
const chooseLocation = () => {
|
const chooseLocation = () => {
|
||||||
console.log('chooseLocation called');
|
console.log('chooseLocation called');
|
||||||
// 先关闭弹窗,避免在弹窗中调用地图选择出现问题
|
// 先关闭弹窗,避免在弹窗中调用地图选择出现问题
|
||||||
showAddPopup.value = false;
|
showAddPopup.value = false;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
// 先获取当前位置,再打开地图选择
|
||||||
|
uni.getLocation({
|
||||||
|
type: 'gcj02', // 使用国测局坐标系(腾讯地图使用)
|
||||||
|
success: (locationRes) => {
|
||||||
|
console.log('获取当前位置成功:', locationRes);
|
||||||
|
// 使用当前位置作为地图初始中心点
|
||||||
uni.chooseLocation({
|
uni.chooseLocation({
|
||||||
|
latitude: locationRes.latitude,
|
||||||
|
longitude: locationRes.longitude,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('选择位置成功:', res);
|
console.log('选择位置成功:', res);
|
||||||
// 获取选择的位置信息
|
// 获取选择的位置信息
|
||||||
@@ -203,6 +311,31 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('获取当前位置失败:', err);
|
||||||
|
// 即使获取位置失败,也打开地图选择(不带初始位置)
|
||||||
|
uni.chooseLocation({
|
||||||
|
success: (res) => {
|
||||||
|
console.log('选择位置成功:', res);
|
||||||
|
selectedAddress.value = res.address + (res.name ? `(${res.name})` : '');
|
||||||
|
lng.value = res.longitude;
|
||||||
|
lat.value = res.latitude;
|
||||||
|
showAddPopup.value = true;
|
||||||
|
},
|
||||||
|
fail: (chooseErr) => {
|
||||||
|
console.error('选择位置失败:', chooseErr);
|
||||||
|
showAddPopup.value = true;
|
||||||
|
if (chooseErr.errMsg && chooseErr.errMsg.indexOf('cancel') === -1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '选择位置失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}, 300);
|
}, 300);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -250,19 +383,21 @@
|
|||||||
|
|
||||||
// 构建请求参数
|
// 构建请求参数
|
||||||
const params = {
|
const params = {
|
||||||
|
|
||||||
title: formData.title, //标题
|
title: formData.title, //标题
|
||||||
level: formData.level + 1, // 1.轻微隐患 2.一般隐患 3.重大隐患
|
level: formData.level + 1, // 1.轻微隐患 2.一般隐患 3.重大隐患
|
||||||
lng: lng.value || 0, //经度
|
lng: lng.value || 0, //经度
|
||||||
lat: lat.value || 0, //纬度
|
lat: lat.value || 0, //纬度
|
||||||
address: selectedAddress.value || '', //详细地址
|
address: selectedAddress.value || '', //详细地址
|
||||||
|
areaId: selectedAreaId.value || null, //隐患区域ID
|
||||||
description: formData.description || '', //隐患描述
|
description: formData.description || '', //隐患描述
|
||||||
tagId: tagId, //隐患标签ID
|
tagId: tagId, //隐患标签ID
|
||||||
taskId: taskId.value, //关联任务ID
|
taskId: taskId.value, //关联任务ID
|
||||||
checkPointId: checkPointId.value, //关联检查点ID
|
checkPointId: checkPointId.value, //关联检查点ID
|
||||||
source: sourceOptions.value[formData.source]?.title || '', //隐患来源(随手拍、企业自查、行业互查、专家诊查)
|
source: sourceOptions.value[formData.source]?.title || '', //隐患来源(随手拍、企业自查、行业互查、专家诊查)
|
||||||
|
attachments: attachments, //附件列表(图片/视频)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log('提交的参数:', params);
|
||||||
//
|
//
|
||||||
try {
|
try {
|
||||||
const res = await addHiddenDanger(params);
|
const res = await addHiddenDanger(params);
|
||||||
@@ -278,6 +413,8 @@
|
|||||||
formData.description = '';
|
formData.description = '';
|
||||||
formData.tagIndex = 0;
|
formData.tagIndex = 0;
|
||||||
selectedAddress.value = '';
|
selectedAddress.value = '';
|
||||||
|
selectedAreaId.value = '';
|
||||||
|
selectedAreaName.value = '';
|
||||||
fileList1.value = [];
|
fileList1.value = [];
|
||||||
// 刷新隐患列表
|
// 刷新隐患列表
|
||||||
fetchHiddenDangerList();
|
fetchHiddenDangerList();
|
||||||
@@ -320,6 +457,7 @@
|
|||||||
// 页面显示时刷新列表(从交办、验收页面返回时自动刷新)
|
// 页面显示时刷新列表(从交办、验收页面返回时自动刷新)
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
fetchHiddenDangerList();
|
fetchHiddenDangerList();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const details = (item) => {
|
const details = (item) => {
|
||||||
@@ -332,6 +470,14 @@
|
|||||||
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 编辑整改信息(待验收状态)
|
||||||
|
const editRectification = (item) => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/hiddendanger/rectification?rectifyId=${item.rectifyId}&isEdit=1`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const acceptance = (item) => {
|
const acceptance = (item) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/hiddendanger/acceptance?hazardId=${item.hazardId}&assignId=${item.assignId}&rectifyId=${item.rectifyId}`
|
url: `/pages/hiddendanger/acceptance?hazardId=${item.hazardId}&assignId=${item.assignId}&rectifyId=${item.rectifyId}`
|
||||||
@@ -476,6 +622,31 @@
|
|||||||
.page {
|
.page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
|
padding-bottom: 120rpx; // 给底部按钮留出空间
|
||||||
|
}
|
||||||
|
|
||||||
|
// 固定在底部的悬浮新增按钮
|
||||||
|
.fixed-add-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #2668EA 100%);
|
||||||
|
border-radius: 44rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
box-shadow: 0 8rpx 24rpx rgba(38, 104, 234, 0.4);
|
||||||
|
z-index: 100;
|
||||||
|
|
||||||
|
.cuIcon-add {
|
||||||
|
margin-right: 10rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-list {
|
.list-list {
|
||||||
@@ -576,18 +747,8 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
|
|
||||||
.address-input {
|
.address-input-wrapper {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background: #fff;
|
|
||||||
border: 1rpx solid #F6F6F6;
|
|
||||||
;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #333;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-address {
|
.btn-address {
|
||||||
@@ -605,6 +766,87 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 选择器触发器样式
|
||||||
|
.select-trigger {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background: #fff;
|
||||||
|
border: 1rpx solid #dcdfe6;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 20rpx 24rpx;
|
||||||
|
|
||||||
|
.select-value {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
&.placeholder {
|
||||||
|
color: #c0c4cc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择弹窗样式
|
||||||
|
.picker-popup {
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.picker-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #eee;
|
||||||
|
|
||||||
|
.picker-cancel {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-confirm {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #2667E9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-body {
|
||||||
|
max-height: 600rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx 0;
|
||||||
|
border-bottom: 1rpx solid #f5f5f5;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.picker-item-active {
|
||||||
|
color: #2667E9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 区域颜色圆点
|
||||||
|
.area-color-dot {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.address-popup {
|
.address-popup {
|
||||||
width: 600rpx;
|
width: 600rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|||||||
@@ -1,58 +1,91 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page padding">
|
<view class="page padding">
|
||||||
<view class="padding bg-white radius">
|
<view class="padding bg-white radius">
|
||||||
<view class="flex margin-bottom">
|
<view class="form-label margin-bottom">
|
||||||
<view class="text-gray">整改方案</view>
|
<view class="text-gray">整改方案</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
</view>
|
</view>
|
||||||
<up-textarea v-model="formData.rectifyPlan" placeholder="请输入内容"></up-textarea>
|
<up-textarea v-model="formData.rectifyPlan" placeholder="请输入内容"></up-textarea>
|
||||||
<view class="flex margin-bottom margin-top">
|
<view class="form-label margin-bottom margin-top">
|
||||||
<view class="text-gray">整改完成情况</view>
|
<view class="text-gray">整改完成情况</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
</view>
|
</view>
|
||||||
<up-textarea v-model="formData.rectifyResult" placeholder="请输入内容"></up-textarea>
|
<up-textarea v-model="formData.rectifyResult" placeholder="请输入内容"></up-textarea>
|
||||||
<view class="flex margin-bottom">
|
<view class="form-label margin-bottom margin-top">
|
||||||
<view class="text-gray margin-top">投资资金(计划)</view>
|
<view class="text-gray">投资资金(计划)</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
</view>
|
</view>
|
||||||
<up-input v-model="formData.planCost" placeholder="请输入内容" type="number"></up-input>
|
<up-input v-model="formData.planCost" placeholder="请输入内容" type="number"></up-input>
|
||||||
<view class="flex margin-bottom">
|
<view class="form-label margin-bottom margin-top">
|
||||||
<view class="text-gray margin-top">投资资金(实际)</view>
|
<view class="text-gray">投资资金(实际)</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
</view>
|
</view>
|
||||||
<up-input v-model="formData.actualCost" placeholder="请输入内容" type="number"></up-input>
|
<up-input v-model="formData.actualCost" placeholder="请输入内容" type="number"></up-input>
|
||||||
<view class="flex margin-bottom">
|
<view class="form-label margin-bottom margin-top">
|
||||||
<view class="text-gray margin-top">限定整改时间</view>
|
<view class="text-gray">限定整改时间</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
</view>
|
</view>
|
||||||
<up-datetime-picker hasInput :show="show" v-model="value1" mode="date"></up-datetime-picker>
|
<up-datetime-picker hasInput :show="show" v-model="value1" mode="date"></up-datetime-picker>
|
||||||
<view class="flex margin-bottom margin-top">
|
<view class="form-label margin-bottom margin-top">
|
||||||
<view class="text-gray">整改人员</view>
|
<view class="text-gray">整改人员</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
<view class="margin-left-sm text-black" v-if="selectedUserName">{{ selectedUserName }}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<up-select v-model:current="cateId" :options="cateList" @select="selectItem"></up-select>
|
<!-- 点击打开人员选择弹窗 -->
|
||||||
|
<view class="select-trigger" @click="showUserPopup = true">
|
||||||
|
<view class="select-content" :class="{ 'text-gray': selectedUsers.length === 0 }">
|
||||||
|
{{ selectedUsers.length > 0 ? selectedUsersText : '请选择整改人员(可多选)' }}
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-unfold"></text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="flex margin-bottom">
|
<!-- 人员多选弹窗 -->
|
||||||
|
<u-popup :show="showUserPopup" mode="bottom" round="20" @close="showUserPopup = false">
|
||||||
|
<view class="user-popup">
|
||||||
|
<view class="popup-header">
|
||||||
|
<view class="popup-title text-bold">选择整改人员</view>
|
||||||
|
<view class="popup-close" @click="showUserPopup = false">×</view>
|
||||||
|
</view>
|
||||||
|
<view class="popup-body">
|
||||||
|
<up-checkbox-group v-model="selectedUserIds" placement="column" @change="onUserChange">
|
||||||
|
<view class="user-item" v-for="item in cateList" :key="item.id">
|
||||||
|
<up-checkbox
|
||||||
|
:label="item.name"
|
||||||
|
:name="item.id"
|
||||||
|
activeColor="#2667E9"
|
||||||
|
shape="square"
|
||||||
|
></up-checkbox>
|
||||||
|
</view>
|
||||||
|
</up-checkbox-group>
|
||||||
|
</view>
|
||||||
|
<view class="popup-footer">
|
||||||
|
<button class="btn-cancel" @click="showUserPopup = false">取消</button>
|
||||||
|
<button class="btn-confirm bg-blue" @click="confirmUserSelect">确定</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
|
||||||
|
<view class="form-label margin-bottom margin-top">
|
||||||
<view class="text-gray">整改图片/视频</view>
|
<view class="text-gray">整改图片/视频</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
</view>
|
</view>
|
||||||
<up-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
<up-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
||||||
:maxCount="10"></up-upload>
|
:maxCount="10"></up-upload>
|
||||||
<button class="bg-blue round margin-top-xl" @click="handleSubmit">提交整改</button>
|
<button class="bg-blue round margin-top-xl" @click="handleSubmit">{{ isEdit ? '保存修改' : '提交整改' }}</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref,reactive,onMounted} from 'vue'
|
import {ref,reactive,computed} from 'vue'
|
||||||
import {onLoad} from '@dcloudio/uni-app'
|
import {onLoad} from '@dcloudio/uni-app'
|
||||||
import {submitRectification,getDepartmentPersonUsers} from '@/request/api.js'
|
import {submitRectification,getDepartmentPersonUsers,getRectifyDetail,getDeptUsersWithSubordinates} from '@/request/api.js'
|
||||||
import {baseUrl,getToken} from '@/request/request.js'
|
import {baseUrl,getToken} from '@/request/request.js'
|
||||||
|
|
||||||
// 从页面参数获取的ID
|
// 从页面参数获取的ID
|
||||||
const hazardId = ref('');
|
const hazardId = ref('');
|
||||||
const assignId = ref('');
|
const assignId = ref('');
|
||||||
|
const rectifyId = ref(''); // 整改ID(编辑模式时使用)
|
||||||
|
const isEdit = ref(false); // 是否为编辑模式
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
@@ -66,17 +99,42 @@
|
|||||||
const value1 = ref(Date.now());
|
const value1 = ref(Date.now());
|
||||||
const radiovalue1 = ref('');
|
const radiovalue1 = ref('');
|
||||||
|
|
||||||
// 整改人员
|
// 整改人员(多选)
|
||||||
const cateId = ref('')
|
|
||||||
const cateList = ref([])
|
const cateList = ref([])
|
||||||
const selectedUserName = ref('') // 选中的人员名称
|
const showUserPopup = ref(false) // 人员选择弹窗
|
||||||
|
const selectedUserIds = ref([]) // 选中的用户ID数组
|
||||||
|
const selectedUsers = ref([]) // 选中的用户对象数组
|
||||||
|
|
||||||
|
// 选中人员的显示文本
|
||||||
|
const selectedUsersText = computed(() => {
|
||||||
|
if (selectedUsers.value.length === 0) return '';
|
||||||
|
if (selectedUsers.value.length <= 2) {
|
||||||
|
return selectedUsers.value.map(u => u.name).join('、');
|
||||||
|
}
|
||||||
|
return `${selectedUsers.value[0].name}等${selectedUsers.value.length}人`;
|
||||||
|
});
|
||||||
|
|
||||||
|
// checkbox变化事件
|
||||||
|
const onUserChange = (ids) => {
|
||||||
|
console.log('选中的ID:', ids);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 确认选择人员
|
||||||
|
const confirmUserSelect = () => {
|
||||||
|
// 根据选中的ID获取用户对象
|
||||||
|
selectedUsers.value = cateList.value.filter(item => selectedUserIds.value.includes(item.id));
|
||||||
|
showUserPopup.value = false;
|
||||||
|
console.log('选中的整改人员:', selectedUsers.value);
|
||||||
|
};
|
||||||
|
|
||||||
// 获取部门人员列表
|
// 获取部门人员列表
|
||||||
const fetchDeptUsers = async () => {
|
const fetchDeptUsers = async () => {
|
||||||
|
console.log('当前hazardId:', hazardId.value);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await getDepartmentPersonUsers();
|
const res = await getDeptUsersWithSubordinates({hazardId:hazardId.value});
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
// 将部门下的用户数据扁平化为 up-select 需要的格式
|
// 将部门下的用户数据扁平化
|
||||||
const userList = [];
|
const userList = [];
|
||||||
res.data.forEach(dept => {
|
res.data.forEach(dept => {
|
||||||
if (dept.users && dept.users.length > 0) {
|
if (dept.users && dept.users.length > 0) {
|
||||||
@@ -96,9 +154,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 页面加载时获取人员列表
|
|
||||||
fetchDeptUsers();
|
|
||||||
|
|
||||||
// 上传图片
|
// 上传图片
|
||||||
const fileList1 = ref([]);
|
const fileList1 = ref([]);
|
||||||
|
|
||||||
@@ -173,6 +228,13 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (selectedUsers.value.length === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请选择整改人员',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 构建附件列表
|
// 构建附件列表
|
||||||
const attachments = fileList1.value.map(file => {
|
const attachments = fileList1.value.map(file => {
|
||||||
@@ -198,14 +260,21 @@
|
|||||||
rectifyResult: formData.rectifyResult,
|
rectifyResult: formData.rectifyResult,
|
||||||
planCost: Number(formData.planCost) || 0,
|
planCost: Number(formData.planCost) || 0,
|
||||||
actualCost: Number(formData.actualCost) || 0,
|
actualCost: Number(formData.actualCost) || 0,
|
||||||
attachments: attachments
|
attachments: attachments,
|
||||||
|
// 整改人员ID数组
|
||||||
|
rectifyUserIds: selectedUserIds.value.map(id => Number(id))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 编辑模式需要传递rectifyId
|
||||||
|
if (rectifyId.value) {
|
||||||
|
params.rectifyId = rectifyId.value;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await submitRectification(params);
|
const res = await submitRectification(params);
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '提交成功',
|
title: isEdit.value ? '保存成功' : '提交成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -213,19 +282,76 @@
|
|||||||
}, 1500);
|
}, 1500);
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg || '提交失败',
|
title: res.msg || (isEdit.value ? '保存失败' : '提交失败'),
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('提交整改失败:', error);
|
console.error('提交整改失败:', error);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '您不是整改人员',
|
title: '操作失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取整改详情(编辑模式)
|
||||||
|
const fetchRectifyDetail = async () => {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: '加载中...' });
|
||||||
|
const res = await getRectifyDetail({ rectifyId: rectifyId.value });
|
||||||
|
uni.hideLoading();
|
||||||
|
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
const data = res.data;
|
||||||
|
// 回显表单数据
|
||||||
|
formData.rectifyPlan = data.rectifyPlan || '';
|
||||||
|
formData.rectifyResult = data.rectifyResult || '';
|
||||||
|
formData.planCost = data.planCost ? String(data.planCost) : '';
|
||||||
|
formData.actualCost = data.actualCost ? String(data.actualCost) : '';
|
||||||
|
|
||||||
|
// 保存hazardId和assignId
|
||||||
|
hazardId.value = data.hazardId || '';
|
||||||
|
assignId.value = data.assignId || '';
|
||||||
|
|
||||||
|
// 回显附件
|
||||||
|
if (data.attachments && data.attachments.length > 0) {
|
||||||
|
fileList1.value = data.attachments.map(att => ({
|
||||||
|
url: att.filePath.startsWith('http') ? att.filePath : (baseUrl.replace('/api', '') + att.filePath),
|
||||||
|
status: 'success',
|
||||||
|
message: '',
|
||||||
|
name: att.fileName,
|
||||||
|
type: att.fileType,
|
||||||
|
filePath: att.filePath // 保存原始路径用于提交
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 回显整改人员(如果有)
|
||||||
|
if (data.memberIds) {
|
||||||
|
const memberIdArr = data.memberIds.split(',').map(id => String(id.trim()));
|
||||||
|
selectedUserIds.value = memberIdArr;
|
||||||
|
// 等人员列表加载完成后再匹配
|
||||||
|
setTimeout(() => {
|
||||||
|
selectedUsers.value = cateList.value.filter(item => memberIdArr.includes(item.id));
|
||||||
|
}, 500);
|
||||||
|
} else if (data.rectifierId) {
|
||||||
|
// 如果没有memberIds,使用rectifierId
|
||||||
|
selectedUserIds.value = [String(data.rectifierId)];
|
||||||
|
setTimeout(() => {
|
||||||
|
selectedUsers.value = cateList.value.filter(item => item.id === String(data.rectifierId));
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置页面标题
|
||||||
|
uni.setNavigationBarTitle({ title: '编辑整改信息' });
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
uni.hideLoading();
|
||||||
|
console.error('获取整改详情失败:', error);
|
||||||
|
uni.showToast({ title: '获取详情失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
if (options.hazardId) {
|
if (options.hazardId) {
|
||||||
hazardId.value = options.hazardId;
|
hazardId.value = options.hazardId;
|
||||||
@@ -233,13 +359,18 @@
|
|||||||
if (options.assignId) {
|
if (options.assignId) {
|
||||||
assignId.value = options.assignId;
|
assignId.value = options.assignId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 在hazardId赋值后调用,确保有值
|
||||||
|
fetchDeptUsers();
|
||||||
|
|
||||||
|
// 编辑模式
|
||||||
|
if (options.rectifyId) {
|
||||||
|
rectifyId.value = options.rectifyId;
|
||||||
|
isEdit.value = options.isEdit === '1';
|
||||||
|
// 获取整改详情
|
||||||
|
fetchRectifyDetail();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// 选择整改人员
|
|
||||||
const selectItem = (item) => {
|
|
||||||
console.log('选择的整改人员:', item);
|
|
||||||
cateId.value = item.id;
|
|
||||||
selectedUserName.value = item.name; // 显示选中的人员名称
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -248,6 +379,17 @@
|
|||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 表单标签样式 - 让*号和文字对齐
|
||||||
|
.form-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.text-red {
|
||||||
|
margin-left: 4rpx;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.date-input {
|
.date-input {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
@@ -260,4 +402,87 @@
|
|||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 选择触发器样式
|
||||||
|
.select-trigger {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background: #fff;
|
||||||
|
border: 1rpx solid #dcdfe6;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 20rpx 24rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.select-content {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 人员选择弹窗
|
||||||
|
.user-popup {
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.popup-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #eee;
|
||||||
|
|
||||||
|
.popup-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-close {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #999;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-body {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
max-height: 600rpx;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-item {
|
||||||
|
padding: 24rpx 0;
|
||||||
|
border-bottom: 1rpx solid #f5f5f5;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-footer {
|
||||||
|
display: flex;
|
||||||
|
border-top: 1rpx solid #eee;
|
||||||
|
|
||||||
|
button {
|
||||||
|
flex: 1;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
border-radius: 0;
|
||||||
|
font-size: 30rpx;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-cancel {
|
||||||
|
background: #fff;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-confirm {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -6,9 +6,9 @@
|
|||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-bottom">
|
<view class="margin-bottom">
|
||||||
<view v-if="rectifyAttachments.length > 0" class="margin-top">
|
<view v-if="detailData.attachments && detailData.attachments.length > 0" class="margin-top">
|
||||||
<view class="flex" style="flex-wrap: wrap; gap: 10rpx;">
|
<view class="flex" style="flex-wrap: wrap; gap: 10rpx;">
|
||||||
<image v-for="(img, idx) in rectifyAttachments" :key="idx" :src="getFullPath(img.filePath)" style="width: 136rpx;height: 136rpx;border-radius: 16rpx;" mode="aspectFill" @click="previewRectifyImage(idx)"></image>
|
<image v-for="(img, idx) in detailData.attachments" :key="idx" :src="getFullPath(img.filePath)" style="width: 136rpx;height: 136rpx;border-radius: 16rpx;" mode="aspectFill" @click="previewHazardImage(idx)"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="text-gray text-sm">暂无图片</view>
|
<view v-else class="text-gray text-sm">暂无图片</view>
|
||||||
@@ -44,7 +44,12 @@
|
|||||||
<button class="address-btn bg-blue">选择地址</button>
|
<button class="address-btn bg-blue">选择地址</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-gray text-sm">如:办公楼3层东侧消防通道,生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view>
|
<view class="text-gray text-sm">如:办公楼3层东侧消防通道,生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view>
|
||||||
<view class="flex margin-bottom ">
|
|
||||||
|
<!-- 隐患区域 -->
|
||||||
|
<view class="text-gray margin-top margin-bottom">隐患区域</view>
|
||||||
|
<view class="bg-gray padding radius">{{ detailData.areaName || '暂无' }}</view>
|
||||||
|
|
||||||
|
<view class="flex margin-bottom margin-top">
|
||||||
<view class="text-gray">隐患描述</view>
|
<view class="text-gray">隐患描述</view>
|
||||||
<view class="text-red">*</view>
|
<view class="text-red">*</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -74,6 +79,7 @@
|
|||||||
source: '',
|
source: '',
|
||||||
description: '',
|
description: '',
|
||||||
address: '',
|
address: '',
|
||||||
|
areaName: '', // 隐患区域名称
|
||||||
createdAt: '',
|
createdAt: '',
|
||||||
attachments: []
|
attachments: []
|
||||||
});
|
});
|
||||||
@@ -93,8 +99,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 图片预览 - 隐患图片
|
// 图片预览 - 隐患图片
|
||||||
const previewImage = (attachments, index) => {
|
const previewHazardImage = (index) => {
|
||||||
const urls = attachments.map(item => getFullPath(item.filePath));
|
if (!detailData.attachments || detailData.attachments.length === 0) return;
|
||||||
|
const urls = detailData.attachments.map(item => getFullPath(item.filePath));
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
current: index,
|
current: index,
|
||||||
urls: urls
|
urls: urls
|
||||||
@@ -116,6 +123,8 @@
|
|||||||
const res = await getHiddenDangerDetail({ hazardId, assignId });
|
const res = await getHiddenDangerDetail({ hazardId, assignId });
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
Object.assign(detailData, res.data);
|
Object.assign(detailData, res.data);
|
||||||
|
console.log('隐患详情数据:', res.data);
|
||||||
|
console.log('隐患附件:', res.data.attachments);
|
||||||
|
|
||||||
// 提取整改附件:assigns[0].rectify.attachments
|
// 提取整改附件:assigns[0].rectify.attachments
|
||||||
if (res.data.assigns && res.data.assigns.length > 0) {
|
if (res.data.assigns && res.data.assigns.length > 0) {
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="flex padding-top-xl padding-bottom-xl text-white " style="background-color:#007aff ;">
|
<view class="flex padding-top-xl padding-bottom-xl text-white " style="background-color:#007aff ;">
|
||||||
<view class="cu-avatar xl round margin-left">
|
<view class="cu-avatar xl round margin-left">
|
||||||
<image></image>
|
<image class="avatar-image" :src="getImageUrl(userInfo.avatar) || defaultAvatar" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-left">
|
<view class="padding-left" style="display: flex;flex-direction: column;gap: 10rpx;justify-content: center;align-items: center;">
|
||||||
<view class="text-bold">{{ userInfo.deptName || '未知部门' }}</view>
|
<view class="text-bold">{{ userInfo.deptName || '未知部门' }}</view>
|
||||||
<view class="flex padding-top-xs">
|
<view class="flex padding-top-xs">
|
||||||
<view>用户:</view>
|
<view>用户:</view>
|
||||||
@@ -82,7 +82,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="margin-top margin-bottom flex justify-end">
|
<view class="margin-top margin-bottom flex justify-end">
|
||||||
<button class="cu-btn round lg light bg-blue margin-right" @click.stop="ViewDetails(item)">查看详情</button>
|
<button class="cu-btn round lg light bg-blue margin-right" @click.stop="ViewDetails(item)">查看详情</button>
|
||||||
<button class="cu-btn round lg bg-blue" @click.stop="goDetails(item)">开始检查</button>
|
<button v-if="item.finishedCount < item.totalCount" class="cu-btn round lg bg-blue" @click.stop="goDetails(item)">开始检查</button>
|
||||||
|
<view v-else class="cu-btn round lg bg-green">已完成</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -92,10 +93,13 @@
|
|||||||
<view class="border-tite"></view>
|
<view class="border-tite"></view>
|
||||||
<view class="text-bold margin-left-xs">我的隐患排查</view>
|
<view class="text-bold margin-left-xs">我的隐患排查</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list-list padding margin-bottom" v-for="(item,index) in hiddenDangerData" :key="item.id" @click="HazardList()">
|
<view class="list-list padding margin-bottom" v-for="(item,index) in hiddenDangerData" :key="item.hazardId">
|
||||||
<view class="flex text-bold">
|
<view class="flex text-bold justify-between">
|
||||||
|
<view class="flex">
|
||||||
<view>隐患</view>
|
<view>隐患</view>
|
||||||
<view class="text-bold margin-left">#15</view>
|
<view class="text-bold margin-left">#{{ index + 1 }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="text-blue">{{item.statusName}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="flex margin-top">
|
||||||
<view class="text-gray">标题:</view>
|
<view class="text-gray">标题:</view>
|
||||||
@@ -111,20 +115,32 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="flex margin-top">
|
||||||
<view class="text-gray">隐患等级:</view>
|
<view class="text-gray">隐患等级:</view>
|
||||||
<view>{{item.levelName}}</view>
|
<view class="level-tag" :class="{
|
||||||
</view>
|
'level-minor': item.levelName === '轻微隐患',
|
||||||
<view class="flex margin-top">
|
'level-normal': item.levelName === '一般隐患',
|
||||||
<view class="text-gray">隐患状态:</view>
|
'level-major': item.levelName === '重大隐患'
|
||||||
<view>{{item.statusName}}</view>
|
}">{{item.levelName}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top">
|
<view class="flex margin-top">
|
||||||
<view class="text-gray">发现时间:</view>
|
<view class="text-gray">发现时间:</view>
|
||||||
<view>{{item.createdAt}}</view>
|
<view>{{item.createdAt}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-top margin-bottom flex" style="gap: 5rpx;">
|
<view class="margin-top margin-bottom flex justify-end" style="gap: 10rpx;">
|
||||||
<button class="cu-btn round lg light bg-blue " style="white-space: nowrap;">查看详情</button>
|
<!-- 所有状态都显示查看详情 -->
|
||||||
<button class="cu-btn round lg light bg-blue " style="white-space: nowrap;">立即整改</button>
|
<button class="cu-btn round lg light bg-blue" @click.stop="viewHazardDetail(item)">查看详情</button>
|
||||||
<button class="cu-btn round lg bg-blue " style="white-space: nowrap;">立即验收</button>
|
<!-- 待整改状态:canEdit为true时显示隐患交办和立即整改 -->
|
||||||
|
<button v-if="item.statusName === '待整改' && item.canEdit"
|
||||||
|
class="cu-btn round lg light bg-blue" @click.stop="assignHazard(item)">隐患交办</button>
|
||||||
|
<button v-if="item.statusName === '待整改' && item.canEdit"
|
||||||
|
class="cu-btn round lg bg-blue" @click.stop="goRectification(item)">立即整改</button>
|
||||||
|
<!-- 待验收显示编辑整改信息和立即验收 -->
|
||||||
|
<button v-if="item.statusName === '待验收' && item.canEdit"
|
||||||
|
class="cu-btn round lg light bg-blue" @click.stop="editRectification(item)">编辑整改信息</button>
|
||||||
|
<button v-if="item.statusName === '待验收' && canAcceptance"
|
||||||
|
class="cu-btn round lg bg-blue" @click.stop="goAcceptance(item)">立即验收</button>
|
||||||
|
<!-- 待交办显示隐患交办 -->
|
||||||
|
<button v-if="item.statusName === '待交办'"
|
||||||
|
class="cu-btn round lg bg-blue" @click.stop="assignHazard(item)">隐患交办</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -133,23 +149,58 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive, computed } from 'vue';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
// import { onLoad } from '@dcloudio/uni-app';
|
||||||
import {getCheckPlanList,getHiddenDangerList} from '@/request/api.js'
|
import {getCheckPlanList,getHiddenDangerList} from '@/request/api.js'
|
||||||
|
import { getProfileDetail } from '@/request/three_one_api/info.js';
|
||||||
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
|
import { baseUrl } from '@/request/request.js';
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
||||||
|
const defaultAvatar = 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg';
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const userInfo = reactive({
|
const userInfo = reactive({
|
||||||
userId: '',
|
userId: '',
|
||||||
username: '',
|
username: '',
|
||||||
nickName: '',
|
nickName: '',
|
||||||
deptId: '',
|
deptId: '',
|
||||||
deptName: ''
|
deptName: '',
|
||||||
|
role: '',
|
||||||
|
avatar: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取用户信息
|
// 获取用户角色,判断是否有验收权限(admin或manage才能验收)
|
||||||
const getUserInfo = () => {
|
const canAcceptance = computed(() => {
|
||||||
|
return userInfo.role === 'admin' || userInfo.role === 'manage';
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取图片完整URL(用于显示)
|
||||||
|
const getImageUrl = (path) => {
|
||||||
|
if (!path) return '';
|
||||||
|
if (path.startsWith('http')) return path;
|
||||||
|
return baseUrl + path;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取用户信息(从接口获取)
|
||||||
|
const getUserInfo = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getProfileDetail();
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
userInfo.userId = res.data.userId || '';
|
||||||
|
userInfo.username = res.data.userName || '';
|
||||||
|
userInfo.nickName = res.data.nickName || '';
|
||||||
|
userInfo.deptId = res.data.deptId || '';
|
||||||
|
userInfo.deptName = res.data.deptName || '';
|
||||||
|
userInfo.avatar = res.data.avatar || '';
|
||||||
|
// 获取角色信息
|
||||||
|
if (res.data.roles && res.data.roles.length > 0) {
|
||||||
|
userInfo.role = res.data.roles[0].roleKey || '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('获取用户信息失败:', e);
|
||||||
|
// 如果接口失败,尝试从本地存储获取
|
||||||
try {
|
try {
|
||||||
const storedUserInfo = uni.getStorageSync('userInfo');
|
const storedUserInfo = uni.getStorageSync('userInfo');
|
||||||
if (storedUserInfo) {
|
if (storedUserInfo) {
|
||||||
@@ -159,9 +210,12 @@
|
|||||||
userInfo.nickName = info.nickName || '';
|
userInfo.nickName = info.nickName || '';
|
||||||
userInfo.deptId = info.deptId || '';
|
userInfo.deptId = info.deptId || '';
|
||||||
userInfo.deptName = info.deptName || '';
|
userInfo.deptName = info.deptName || '';
|
||||||
|
userInfo.role = info.role || '';
|
||||||
|
userInfo.avatar = info.avatar || '';
|
||||||
|
}
|
||||||
|
} catch (storageError) {
|
||||||
|
console.error('从本地存储获取用户信息失败:', storageError);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
console.error('获取用户信息失败:', e);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const infoList = ref([{
|
const infoList = ref([{
|
||||||
@@ -264,9 +318,15 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 页面加载时调用接口
|
// 页面加载时调用接口
|
||||||
onLoad(() => {
|
// onLoad(() => {
|
||||||
|
// getUserInfo();
|
||||||
|
// getCheckPlanLists();
|
||||||
|
// });
|
||||||
|
// 页面每次显示时都会加载数据
|
||||||
|
onShow(() => {
|
||||||
getUserInfo();
|
getUserInfo();
|
||||||
getCheckPlanLists();
|
getCheckPlanLists();
|
||||||
|
getHiddenDangerLists();
|
||||||
});
|
});
|
||||||
//我的隐患排查
|
//我的隐患排查
|
||||||
const hiddenDangerParams = ref({
|
const hiddenDangerParams = ref({
|
||||||
@@ -296,6 +356,42 @@
|
|||||||
getHiddenDangerLists();
|
getHiddenDangerLists();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ========== 隐患排查相关跳转函数 ==========
|
||||||
|
// 查看隐患详情
|
||||||
|
const viewHazardDetail = (item) => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 立即整改(待整改状态)
|
||||||
|
const goRectification = (item) => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑整改信息(待验收状态)
|
||||||
|
const editRectification = (item) => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/hiddendanger/rectification?rectifyId=${item.rectifyId}&isEdit=1`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 立即验收
|
||||||
|
const goAcceptance = (item) => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/hiddendanger/acceptance?hazardId=${item.hazardId}&assignId=${item.assignId}&rectifyId=${item.rectifyId}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 隐患交办
|
||||||
|
const assignHazard = (item) => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/hiddendanger/assignment?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -309,7 +405,13 @@
|
|||||||
z-index: 10;
|
z-index: 10;
|
||||||
min-height: calc(100vh - 400rpx);
|
min-height: calc(100vh - 400rpx);
|
||||||
}
|
}
|
||||||
.content {}
|
|
||||||
|
// 头像图片样式
|
||||||
|
.avatar-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
.grid-list {
|
.grid-list {
|
||||||
gap: 30rpx;
|
gap: 30rpx;
|
||||||
@@ -370,4 +472,31 @@
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #2667E9;
|
color: #2667E9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 隐患等级标签样式
|
||||||
|
.level-tag {
|
||||||
|
padding: 4rpx 16rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 轻微隐患
|
||||||
|
.level-minor {
|
||||||
|
background: #F6FFED;
|
||||||
|
border: 2rpx solid #B7EB8F;
|
||||||
|
color: #52C41A;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 一般隐患
|
||||||
|
.level-normal {
|
||||||
|
background: #FFF7E6;
|
||||||
|
border: 2rpx solid #FFD591;
|
||||||
|
color: #FA8C16;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重大隐患
|
||||||
|
.level-major {
|
||||||
|
background: #FFF1F0;
|
||||||
|
border: 2rpx solid #FFA39E;
|
||||||
|
color: #F5222D;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -18,10 +18,10 @@
|
|||||||
<input class="sl-input" v-model="password" type="text" maxlength="32" placeholder="请输入密码" :password="showPassword"/>
|
<input class="sl-input" v-model="password" type="text" maxlength="32" placeholder="请输入密码" :password="showPassword"/>
|
||||||
<image class="eye-img" :src="showPassword ? '/static/index/cl.png' : '/static/index/op.png'" @click="changePassword"></image>
|
<image class="eye-img" :src="showPassword ? '/static/index/cl.png' : '/static/index/op.png'" @click="changePassword"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="agreement">
|
<!-- <view class="agreement">
|
||||||
<navigator url="reg" open-type="navigate" class="link">注册成员账号</navigator>
|
<navigator url="reg" open-type="navigate" class="link">注册成员账号</navigator>
|
||||||
<navigator url="forget" open-type="navigate" class="link">忘记密码?</navigator>
|
<navigator url="forget" open-type="navigate" class="link">忘记密码?</navigator>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="padding-lr">
|
<view class="padding-lr">
|
||||||
@@ -32,10 +32,10 @@
|
|||||||
<text>登录普通成员</text>
|
<text>登录普通成员</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
|
|
||||||
<view class="button-report margin-top" hover-class="button-hover" @tap="goToReport">
|
<!-- <view class="button-report margin-top" hover-class="button-hover" @tap="goToReport">
|
||||||
<image src="/static/index/photos.png" class="icon-image"></image>
|
<image src="/static/index/photos.png" class="icon-image"></image>
|
||||||
<text>随手拍举报</text>
|
<text>随手拍举报</text>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<!-- <view class="protocol-box">
|
<!-- <view class="protocol-box">
|
||||||
<navigator url="agreement" open-type="navigate" class="protocol-link">《用户协议》</navigator>
|
<navigator url="agreement" open-type="navigate" class="protocol-link">《用户协议》</navigator>
|
||||||
@@ -112,7 +112,9 @@ const handleLogin = async () => {
|
|||||||
username: res.data.username,
|
username: res.data.username,
|
||||||
nickName: res.data.nickName,
|
nickName: res.data.nickName,
|
||||||
deptId: res.data.deptId,
|
deptId: res.data.deptId,
|
||||||
deptName: res.data.deptName
|
deptName: res.data.deptName,
|
||||||
|
role:res.data.role,
|
||||||
|
isDept:res.data.isDept
|
||||||
};
|
};
|
||||||
uni.setStorageSync('userInfo', JSON.stringify(userInfo));
|
uni.setStorageSync('userInfo', JSON.stringify(userInfo));
|
||||||
|
|
||||||
|
|||||||
@@ -1,38 +1,50 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class=" page padding ">
|
<view class="page padding">
|
||||||
<view class=" padding bg-white radius margin-bottom" v-for="(item,index) in list" :key="item.id">
|
<!-- 成员管理卡片 -->
|
||||||
<view class="flex justify-between align-center">
|
<view class="member-card bg-white radius">
|
||||||
|
<!-- 卡片头部:公司名称 + 角色标签 -->
|
||||||
|
<view class="card-header">
|
||||||
<view class="flex align-center">
|
<view class="flex align-center">
|
||||||
<view class="border-tite"></view>
|
<view class="border-line"></view>
|
||||||
<view class="text-bold margin-left-xs" @click="show = true">湘西自治州和谐网络科技有限公司</view>
|
<view class="text-bold margin-left-sm">{{ userInfo.deptName || '未知部门' }}</view>
|
||||||
<up-picker :show="show" :columns="columns"></up-picker>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="tag-outline">负责人</view>
|
<view class="role-tag">{{ roleText }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="flex margin-top">
|
<!-- 成员列表 -->
|
||||||
<view class="cu-avatar radius lg"
|
<view class="member-list">
|
||||||
style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg);">
|
<view
|
||||||
</view>
|
class="member-item"
|
||||||
<view class="margin-left">
|
v-for="(item, index) in list"
|
||||||
<view class="flex">
|
:key="item.userId"
|
||||||
<view>{{item.nickName}}</view>
|
:class="{ 'border-bottom': index < list.length - 1 }"
|
||||||
<view class="margin-left-xs light bg-olive padding-left-xs padding-right-xs">{{item.statusName}}</view>
|
>
|
||||||
</view>
|
<view class="cu-avatar radius lg bg-gray" style="background-image:url(https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png);"></view>
|
||||||
<view class="flex text-gray">
|
<view class="member-info">
|
||||||
<view>手机设置:</view>
|
<view class="flex align-center">
|
||||||
<view>{{item.phonenumber}}</view>
|
<text class="member-name">{{ item.nickName }}</text>
|
||||||
</view>
|
<view class="status-tag" :class="item.statusName === '正常' ? 'status-normal' : 'status-locked'">
|
||||||
<view class="flex text-gray">
|
{{ item.statusName }}
|
||||||
<view>登录IP:</view>
|
|
||||||
<view>45.135.228.172</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="bg-blue btn-lock" @click="Lock(item)">{{ item.lockStatus === 1 ? '解锁' : '锁定' }}</button>
|
<view class="member-phone text-gray">
|
||||||
|
<text>手机:{{ item.phonenumber || '未设置' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<button class="btn-lock bg-blue" @click="Lock(item)">
|
||||||
|
{{ item.status === '1' ? '解锁' : '锁定' }}
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 添加成员按钮 -->
|
||||||
|
<view class="add-btn-wrapper">
|
||||||
|
<button class="add-btn" @click="showPopup = true">
|
||||||
|
<text class="cuIcon-add"></text>
|
||||||
|
<text>添加成员</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="lg cuIcon-add bg-blue round margin-top-xl" @click="showPopup = true">添加成员</button>
|
|
||||||
|
|
||||||
<!-- 添加成员弹出框 -->
|
<!-- 添加成员弹出框 -->
|
||||||
<u-popup :show="showPopup" mode="center" round="20" @close="showPopup = false">
|
<u-popup :show="showPopup" mode="center" round="20" @close="showPopup = false">
|
||||||
@@ -42,43 +54,49 @@
|
|||||||
<view class="popup-close" @click="showPopup = false">×</view>
|
<view class="popup-close" @click="showPopup = false">×</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="popup-body">
|
<scroll-view class="popup-body" scroll-y>
|
||||||
<!-- 用户名 -->
|
<!-- 用户名 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">用户名<text class="text-red">*</text></view>
|
<view class="form-label">用户名<text class="text-red">*</text></view>
|
||||||
<input class="form-input" v-model="formData.username" placeholder="请输入用户名" />
|
<up-input v-model="formData.username" placeholder="请输入用户名" border="surround"></up-input>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 昵称 -->
|
<!-- 昵称 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">昵称</view>
|
<view class="form-label">昵称</view>
|
||||||
<input class="form-input" v-model="formData.nickname" placeholder="请输入昵称" />
|
<up-input v-model="formData.nickname" placeholder="请输入昵称" border="surround"></up-input>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 手机号 -->
|
<!-- 手机号 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">手机号</view>
|
<view class="form-label">手机号</view>
|
||||||
<input class="form-input" v-model="formData.phone" placeholder="请输入手机号" type="number" />
|
<up-input v-model="formData.phone" placeholder="请输入手机号" type="number" border="surround"></up-input>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 密码 -->
|
<!-- 密码 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">密码<text class="text-red">*</text></view>
|
<view class="form-label">密码<text class="text-red">*</text></view>
|
||||||
<input class="form-input" v-model="formData.password" placeholder="请输入密码(6-16位)" password />
|
<up-input v-model="formData.password" placeholder="请输入密码(6-16位)" password border="surround"></up-input>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 主部门 -->
|
<!-- 角色类型 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="form-label">主部门<text class="text-red">*</text></view>
|
<view class="form-label">角色类型<text class="text-red">*</text></view>
|
||||||
<view class="form-input form-select" @click="showDeptPicker = true">
|
<view class="form-select" @click="showRolePicker = true">
|
||||||
<text :class="formData.department ? '' : 'text-gray'">
|
<text :class="selectedRoleName ? '' : 'text-gray'">
|
||||||
{{ formData.department || '请选择主部门' }}
|
{{ selectedRoleName || '请选择角色类型' }}
|
||||||
</text>
|
</text>
|
||||||
|
<text class="cuIcon-unfold"></text>
|
||||||
</view>
|
</view>
|
||||||
<up-picker :show="showDeptPicker" :columns="deptColumns" @confirm="onDeptConfirm"
|
<up-picker
|
||||||
@cancel="showDeptPicker = false" @close="showDeptPicker = false"></up-picker>
|
:show="showRolePicker"
|
||||||
</view>
|
:columns="roleColumns"
|
||||||
|
@confirm="onRoleConfirm"
|
||||||
|
@cancel="showRolePicker = false"
|
||||||
|
@close="showRolePicker = false"
|
||||||
|
></up-picker>
|
||||||
</view>
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
<view class="popup-footer">
|
<view class="popup-footer">
|
||||||
<button class="btn-cancel" @click="showPopup = false">取消</button>
|
<button class="btn-cancel" @click="showPopup = false">取消</button>
|
||||||
@@ -91,84 +109,148 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref,reactive } from 'vue';
|
import { ref, reactive, computed, onMounted } from 'vue';
|
||||||
import { addMember,getMemberList,lockOrUnlockMember} from '@/request/api.js';
|
import { addMember, getMemberList, lockOrUnlockMember } from '@/request/api.js';
|
||||||
//成员列表
|
|
||||||
const list = ref([]);
|
|
||||||
getMemberList().then(res => {
|
|
||||||
list.value = res.data;
|
|
||||||
});
|
|
||||||
const showPopup = ref(false);
|
|
||||||
const showDeptPicker = ref(false);
|
|
||||||
|
|
||||||
const formData = reactive({
|
// 用户信息(从storage获取)
|
||||||
|
const userInfo = ref({
|
||||||
|
deptId: '',
|
||||||
|
deptName: '',
|
||||||
|
nickName: '',
|
||||||
|
role: '',
|
||||||
|
userId: '',
|
||||||
|
username: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
// 角色显示文本
|
||||||
|
const roleText = computed(() => {
|
||||||
|
const role = userInfo.value.role;
|
||||||
|
if (role === 'manage' || role === 'admin') {
|
||||||
|
return '管理人员';
|
||||||
|
} else if (role === 'common') {
|
||||||
|
return '执行人员';
|
||||||
|
}
|
||||||
|
return '成员';
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取用户信息
|
||||||
|
const getUserInfo = () => {
|
||||||
|
try {
|
||||||
|
const userInfoStr = uni.getStorageSync('userInfo');
|
||||||
|
if (userInfoStr) {
|
||||||
|
userInfo.value = JSON.parse(userInfoStr);
|
||||||
|
console.log('用户信息:', userInfo.value);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取用户信息失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 成员列表
|
||||||
|
const list = ref([]);
|
||||||
|
|
||||||
|
// 获取成员列表
|
||||||
|
const fetchMemberList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getMemberList();
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
list.value = res.data;
|
||||||
|
console.log('成员列表:', res.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取成员列表失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 弹窗控制
|
||||||
|
const showPopup = ref(false);
|
||||||
|
const showRolePicker = ref(false);
|
||||||
|
const selectedRoleName = ref('');
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formData = reactive({
|
||||||
username: '',
|
username: '',
|
||||||
nickname: '',
|
nickname: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
password: '',
|
password: '',
|
||||||
department: ''
|
roleType: ''
|
||||||
});
|
});
|
||||||
const handleSubmit = async () => {
|
|
||||||
// 表单验证
|
// 角色类型选择器数据
|
||||||
|
const roleColumns = reactive([
|
||||||
|
['管理员', '普通成员']
|
||||||
|
]);
|
||||||
|
|
||||||
|
// 角色名称与值的映射
|
||||||
|
const roleMap = {
|
||||||
|
'管理员': 'manage',
|
||||||
|
'普通成员': 'common'
|
||||||
|
};
|
||||||
|
|
||||||
|
// 角色类型选择确认
|
||||||
|
const onRoleConfirm = (e) => {
|
||||||
|
if (e.value && e.value.length > 0) {
|
||||||
|
selectedRoleName.value = e.value[0];
|
||||||
|
formData.roleType = roleMap[e.value[0]];
|
||||||
|
}
|
||||||
|
showRolePicker.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.username = '';
|
||||||
|
formData.nickname = '';
|
||||||
|
formData.phone = '';
|
||||||
|
formData.password = '';
|
||||||
|
formData.roleType = '';
|
||||||
|
selectedRoleName.value = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
const handleSubmit = async () => {
|
||||||
if (!formData.username) {
|
if (!formData.username) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '请输入用户名', icon: 'none' });
|
||||||
title: '请输入用户名',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!formData.password || formData.password.length < 6 || formData.password.length > 16) {
|
if (!formData.password || formData.password.length < 6 || formData.password.length > 16) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '请输入6-16位密码', icon: 'none' });
|
||||||
title: '请输入6-16位密码',
|
return;
|
||||||
icon: 'none'
|
}
|
||||||
});
|
if (!formData.roleType) {
|
||||||
|
uni.showToast({ title: '请选择角色类型', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建请求参数(根据接口要求的字段名)
|
|
||||||
const params = {
|
const params = {
|
||||||
userName: formData.username,
|
userName: formData.username,
|
||||||
nickName: formData.nickname || '',
|
nickName: formData.nickname || '',
|
||||||
phonenumber: formData.phone || '',
|
phonenumber: formData.phone || '',
|
||||||
password: formData.password,
|
password: formData.password,
|
||||||
roleType: 'common'
|
roleType: formData.roleType
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await addMember(params);
|
const res = await addMember(params);
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '添加成功', icon: 'success' });
|
||||||
title: '添加成功',
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
showPopup.value = false;
|
showPopup.value = false;
|
||||||
// 重置表单
|
resetForm();
|
||||||
formData.username = '';
|
// 刷新成员列表
|
||||||
formData.nickname = '';
|
fetchMemberList();
|
||||||
formData.phone = '';
|
|
||||||
formData.password = '';
|
|
||||||
formData.department = '';
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({ title: res.msg || '添加失败', icon: 'none' });
|
||||||
title: res.msg || '添加失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('添加成员失败:', error);
|
console.error('添加成员失败:', error);
|
||||||
uni.showToast({
|
uni.showToast({ title: '请求失败', icon: 'none' });
|
||||||
title: '请求失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 锁定/解锁成员
|
// 锁定/解锁成员
|
||||||
const Lock = (item) => {
|
const Lock = (item) => {
|
||||||
// 当前是锁定状态则解锁,否则锁定
|
const isLocked = item.status === '1';
|
||||||
const isLocked = item.lockStatus === 1;
|
|
||||||
const actionText = isLocked ? '解锁' : '锁定';
|
const actionText = isLocked ? '解锁' : '锁定';
|
||||||
const newLockStatus = isLocked ? 0 : 1;
|
const newStatus = isLocked ? '0' : '1';
|
||||||
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -179,171 +261,244 @@
|
|||||||
try {
|
try {
|
||||||
const result = await lockOrUnlockMember({
|
const result = await lockOrUnlockMember({
|
||||||
userId: item.userId,
|
userId: item.userId,
|
||||||
lockStatus: newLockStatus
|
lockStatus: Number(newStatus)
|
||||||
});
|
});
|
||||||
if (result.code === 0) {
|
if (result.code === 0) {
|
||||||
uni.showToast({
|
uni.showToast({ title: `${actionText}成功`, icon: 'success' });
|
||||||
title: `${actionText}成功`,
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
// 更新本地状态
|
// 更新本地状态
|
||||||
item.lockStatus = newLockStatus;
|
item.status = newStatus;
|
||||||
item.statusName = newLockStatus === 1 ? '已锁定' : '正常';
|
item.statusName = newStatus === '1' ? '已锁定' : '正常';
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({ title: result.msg || `${actionText}失败`, icon: 'none' });
|
||||||
title: result.msg || `${actionText}失败`,
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`${actionText}成员失败:`, error);
|
console.error(`${actionText}成员失败:`, error);
|
||||||
uni.showToast({
|
uni.showToast({ title: '请求失败', icon: 'none' });
|
||||||
title: '请求失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
//选择部门(顶部切换用)
|
|
||||||
const show = ref(false);
|
|
||||||
const columns = reactive([
|
|
||||||
['湘西自治州和谐网络科技有限公司', '湘西自治州和谐云科技有限公司']
|
|
||||||
]);
|
|
||||||
|
|
||||||
// 主部门选择器数据
|
// 页面加载
|
||||||
const deptColumns = reactive([
|
onMounted(() => {
|
||||||
['湘西自治州和谐网络科技有限公司', '湘西自治州和谐云科技有限公司', '研发部门', '深圳总公司', '若依科技']
|
getUserInfo();
|
||||||
]);
|
fetchMemberList();
|
||||||
|
});
|
||||||
// 主部门选择确认
|
|
||||||
const onDeptConfirm = (e) => {
|
|
||||||
console.log('选择的部门:', e);
|
|
||||||
// e.value 是选中的值数组
|
|
||||||
if (e.value && e.value.length > 0) {
|
|
||||||
formData.department = e.value[0];
|
|
||||||
}
|
|
||||||
showDeptPicker.value = false;
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page {
|
.page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
}
|
}
|
||||||
|
|
||||||
.border-tite {
|
// 成员卡片
|
||||||
|
.member-card {
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 卡片头部
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
|
||||||
|
.border-line {
|
||||||
width: 8rpx;
|
width: 8rpx;
|
||||||
height: 32rpx;
|
height: 32rpx;
|
||||||
background: #2667E9;
|
background: #2667E9;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.tag-outline {
|
// 角色标签
|
||||||
padding: 4rpx 16rpx;
|
.role-tag {
|
||||||
border-radius: 8rpx;
|
padding: 8rpx 24rpx;
|
||||||
background: #EEF3FF;
|
background: #EEF3FF;
|
||||||
color: #2E7CF3;
|
color: #2667E9;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
flex-shrink: 0;
|
border-radius: 24rpx 0 0 24rpx;
|
||||||
margin-right: -30rpx;
|
margin-right: -30rpx;
|
||||||
border-radius: 24rpx 0rpx 0rpx 24rpx;
|
}
|
||||||
|
|
||||||
|
// 成员列表
|
||||||
|
.member-list {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 成员项
|
||||||
|
.member-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 24rpx 0;
|
||||||
|
|
||||||
|
&.border-bottom {
|
||||||
|
border-bottom: 1rpx solid #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-lock {
|
.cu-avatar {
|
||||||
width: 112rpx;
|
flex-shrink: 0;
|
||||||
height: 52rpx;
|
}
|
||||||
line-height: 52rpx;
|
}
|
||||||
|
|
||||||
|
// 成员信息
|
||||||
|
.member-info {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.member-name {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.member-phone {
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态标签
|
||||||
|
.status-tag {
|
||||||
|
margin-left: 12rpx;
|
||||||
|
padding: 4rpx 12rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
|
||||||
|
&.status-normal {
|
||||||
|
background: #E8F5E9;
|
||||||
|
color: #4CAF50;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.status-locked {
|
||||||
|
background: #FFEBEE;
|
||||||
|
color: #F44336;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 锁定按钮
|
||||||
|
.btn-lock {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
line-height: 56rpx;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
border-radius: 28rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加成员按钮
|
||||||
|
.add-btn-wrapper {
|
||||||
|
padding: 30rpx;
|
||||||
|
border-top: 1rpx solid #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 88rpx;
|
||||||
|
background: #fff;
|
||||||
|
border: 2rpx dashed #2667E9;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
color: #2667E9;
|
||||||
|
font-size: 30rpx;
|
||||||
|
|
||||||
|
.cuIcon-add {
|
||||||
|
margin-right: 10rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 弹出框样式
|
&::after {
|
||||||
.popup-content {
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 弹出框样式
|
||||||
|
.popup-content {
|
||||||
width: 600rpx;
|
width: 600rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
padding: 30rpx;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-header {
|
.popup-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 30rpx;
|
padding: 30rpx;
|
||||||
}
|
border-bottom: 1rpx solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
.popup-title {
|
.popup-title {
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-close {
|
.popup-close {
|
||||||
font-size: 48rpx;
|
font-size: 48rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-body {
|
.popup-body {
|
||||||
|
padding: 30rpx;
|
||||||
max-height: 700rpx;
|
max-height: 700rpx;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-item {
|
.form-item {
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-label {
|
.form-label {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-bottom: 12rpx;
|
margin-bottom: 12rpx;
|
||||||
}
|
|
||||||
|
|
||||||
.form-input {
|
|
||||||
width: 100%;
|
|
||||||
height: 80rpx;
|
|
||||||
border: 2rpx solid #E5E5E5;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
padding: 0 24rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-select {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
line-height: 80rpx;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.popup-footer {
|
.form-select {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
align-items: center;
|
||||||
gap: 30rpx;
|
justify-content: space-between;
|
||||||
margin-top: 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-cancel {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
line-height: 80rpx;
|
border: 2rpx solid #dadbde;
|
||||||
border: 2rpx solid #2667E9;
|
border-radius: 8rpx;
|
||||||
border-radius: 40rpx;
|
padding: 0 24rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-footer {
|
||||||
|
display: flex;
|
||||||
|
border-top: 1rpx solid #eee;
|
||||||
|
|
||||||
|
button {
|
||||||
|
flex: 1;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
border-radius: 0;
|
||||||
|
font-size: 30rpx;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-cancel {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
color: #2667E9;
|
color: #666;
|
||||||
font-size: 30rpx;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.btn-confirm {
|
.btn-confirm {
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 30rpx;
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@@ -1,24 +1,178 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="padding page">
|
<view class="page">
|
||||||
<view class="padding bg-white">
|
<view class="padding bg-white margin-top">
|
||||||
<view class="flex justify-between padding-bottom solid-bottom">
|
<!-- 旧密码 -->
|
||||||
<view>修改登录密码</view>
|
<view class="form-item solid-bottom">
|
||||||
<view class="lg text-gray cuIcon-right"></view>
|
<view class="form-label">旧密码</view>
|
||||||
|
<view class="form-input-wrap">
|
||||||
|
<input
|
||||||
|
class="form-input"
|
||||||
|
v-model="formData.oldPassword"
|
||||||
|
:type="showOldPwd ? 'text' : 'password'"
|
||||||
|
placeholder="请输入旧密码"
|
||||||
|
/>
|
||||||
|
<view class="pwd-toggle" @click="showOldPwd = !showOldPwd">
|
||||||
|
<text :class="showOldPwd ? 'cuIcon-attention' : 'cuIcon-attentionforbid'"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-between padding-top padding-bottom solid-bottom">
|
|
||||||
<view>注销账户</view>
|
|
||||||
<view class="lg text-gray cuIcon-right"></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 新密码 -->
|
||||||
|
<view class="form-item solid-bottom">
|
||||||
|
<view class="form-label">新密码</view>
|
||||||
|
<view class="form-input-wrap">
|
||||||
|
<input
|
||||||
|
class="form-input"
|
||||||
|
v-model="formData.newPassword"
|
||||||
|
:type="showNewPwd ? 'text' : 'password'"
|
||||||
|
placeholder="请输入新密码"
|
||||||
|
/>
|
||||||
|
<view class="pwd-toggle" @click="showNewPwd = !showNewPwd">
|
||||||
|
<text :class="showNewPwd ? 'cuIcon-attention' : 'cuIcon-attentionforbid'"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 确认密码 -->
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="form-label">确认密码</view>
|
||||||
|
<view class="form-input-wrap">
|
||||||
|
<input
|
||||||
|
class="form-input"
|
||||||
|
v-model="formData.confirmPassword"
|
||||||
|
:type="showConfirmPwd ? 'text' : 'password'"
|
||||||
|
placeholder="请再次输入新密码"
|
||||||
|
/>
|
||||||
|
<view class="pwd-toggle" @click="showConfirmPwd = !showConfirmPwd">
|
||||||
|
<text :class="showConfirmPwd ? 'cuIcon-attention' : 'cuIcon-attentionforbid'"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 提示信息 -->
|
||||||
|
<view class="tips">
|
||||||
|
<text class="text-gray text-sm">密码长度至少6位,建议包含字母和数字</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 保存按钮 -->
|
||||||
|
<view class="padding">
|
||||||
|
<button class="bg-blue round" @click="handleSave" :loading="saving">保存</button>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { updatePassword } from '@/request/three_one_api/info.js';
|
||||||
|
|
||||||
|
const saving = ref(false);
|
||||||
|
const showOldPwd = ref(false);
|
||||||
|
const showNewPwd = ref(false);
|
||||||
|
const showConfirmPwd = ref(false);
|
||||||
|
|
||||||
|
const formData = reactive({
|
||||||
|
oldPassword: '',
|
||||||
|
newPassword: '',
|
||||||
|
confirmPassword: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
// 保存
|
||||||
|
const handleSave = async () => {
|
||||||
|
// 表单验证
|
||||||
|
if (!formData.oldPassword) {
|
||||||
|
uni.showToast({ title: '请输入旧密码', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!formData.newPassword) {
|
||||||
|
uni.showToast({ title: '请输入新密码', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (formData.newPassword.length < 6) {
|
||||||
|
uni.showToast({ title: '新密码长度至少6位', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!formData.confirmPassword) {
|
||||||
|
uni.showToast({ title: '请确认新密码', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (formData.newPassword !== formData.confirmPassword) {
|
||||||
|
uni.showToast({ title: '两次输入的密码不一致', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (formData.oldPassword === formData.newPassword) {
|
||||||
|
uni.showToast({ title: '新密码不能与旧密码相同', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
saving.value = true;
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
oldPassword: formData.oldPassword,
|
||||||
|
newPassword: formData.newPassword,
|
||||||
|
confirmPassword: formData.confirmPassword
|
||||||
|
};
|
||||||
|
|
||||||
|
const res = await updatePassword(params);
|
||||||
|
if (res.code === 0) {
|
||||||
|
uni.showToast({ title: '密码修改成功', icon: 'success' });
|
||||||
|
// 清空表单
|
||||||
|
formData.oldPassword = '';
|
||||||
|
formData.newPassword = '';
|
||||||
|
formData.confirmPassword = '';
|
||||||
|
// 延迟返回
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1500);
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '修改失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('修改密码失败:', err);
|
||||||
|
uni.showToast({ title: '修改失败', icon: 'none' });
|
||||||
|
} finally {
|
||||||
|
saving.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page {
|
.page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-item {
|
||||||
|
padding: 30rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-label {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-input-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: #f5f5f5;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-input {
|
||||||
|
flex: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pwd-toggle {
|
||||||
|
padding: 10rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<view class="flex justify-between align-center padding-tb solid-bottom" @click="chooseAvatar">
|
<view class="flex justify-between align-center padding-tb solid-bottom" @click="chooseAvatar">
|
||||||
<view class="text-black">头像</view>
|
<view class="text-black">头像</view>
|
||||||
<view class="flex align-center">
|
<view class="flex align-center">
|
||||||
<image class="avatar" :src="userInfo.avatar" mode="aspectFill"></image>
|
<image class="avatar" :src="avatarPreview || getImageUrl(userInfo.avatar) || defaultAvatar" mode="aspectFill"></image>
|
||||||
<view class="lg text-gray cuIcon-right margin-left-xs"></view>
|
<view class="lg text-gray cuIcon-right margin-left-xs"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -14,25 +14,25 @@
|
|||||||
<view class="flex justify-between align-center padding-tb solid-bottom">
|
<view class="flex justify-between align-center padding-tb solid-bottom">
|
||||||
<view class="text-black label-text">昵称</view>
|
<view class="text-black label-text">昵称</view>
|
||||||
<view class="flex align-center flex-sub justify-end">
|
<view class="flex align-center flex-sub justify-end">
|
||||||
<input class="input-right" v-model="userInfo.nickname" placeholder="请输入昵称" />
|
<input class="input-right" v-model="userInfo.nickName" placeholder="请输入昵称" />
|
||||||
<view class="lg text-gray cuIcon-right margin-left-xs"></view>
|
<view class="lg text-gray cuIcon-right margin-left-xs"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 用户名 -->
|
<!-- 电话号码 -->
|
||||||
<view class="flex justify-between align-center padding-tb solid-bottom">
|
<view class="flex justify-between align-center padding-tb solid-bottom">
|
||||||
<view class="text-black label-text">用户名</view>
|
<view class="text-black label-text">电话号码</view>
|
||||||
<view class="flex align-center">
|
|
||||||
<text class="text-black">{{ userInfo.username }}</text>
|
|
||||||
<view class="lg text-gray cuIcon-right margin-left-xs"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 个性签名 -->
|
|
||||||
<view class="flex justify-between align-center padding-tb solid-bottom">
|
|
||||||
<view class="text-black label-text">个性签名</view>
|
|
||||||
<view class="flex align-center flex-sub justify-end">
|
<view class="flex align-center flex-sub justify-end">
|
||||||
<input class="input-right" v-model="userInfo.signature" placeholder="请输入个性签名" />
|
<input class="input-right" v-model="userInfo.phonenumber" placeholder="请输入电话号码" type="number" />
|
||||||
|
<view class="lg text-gray cuIcon-right margin-left-xs"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 邮箱 -->
|
||||||
|
<view class="flex justify-between align-center padding-tb solid-bottom">
|
||||||
|
<view class="text-black label-text">邮箱</view>
|
||||||
|
<view class="flex align-center flex-sub justify-end">
|
||||||
|
<input class="input-right" v-model="userInfo.email" placeholder="请输入邮箱" />
|
||||||
<view class="lg text-gray cuIcon-right margin-left-xs"></view>
|
<view class="lg text-gray cuIcon-right margin-left-xs"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -44,15 +44,15 @@
|
|||||||
<view class="gender-switch">
|
<view class="gender-switch">
|
||||||
<view
|
<view
|
||||||
class="gender-item"
|
class="gender-item"
|
||||||
:class="{ 'gender-active': userInfo.gender === 1, 'gender-male': userInfo.gender === 1 }"
|
:class="{ 'gender-active': userInfo.sex === '0', 'gender-male': userInfo.sex === '0' }"
|
||||||
@click="userInfo.gender = 1"
|
@click="userInfo.sex = '0'"
|
||||||
>
|
>
|
||||||
<text class="cuIcon-male"></text>
|
<text class="cuIcon-male"></text>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="gender-item"
|
class="gender-item"
|
||||||
:class="{ 'gender-active': userInfo.gender === 2, 'gender-female': userInfo.gender === 2 }"
|
:class="{ 'gender-active': userInfo.sex === '1', 'gender-female': userInfo.sex === '1' }"
|
||||||
@click="userInfo.gender = 2"
|
@click="userInfo.sex = '1'"
|
||||||
>
|
>
|
||||||
<text class="cuIcon-female"></text>
|
<text class="cuIcon-female"></text>
|
||||||
</view>
|
</view>
|
||||||
@@ -60,42 +60,59 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 日期选择 -->
|
<button class="bg-blue round margin-top-xl" @click="handleSave" :loading="saving">保存</button>
|
||||||
<view class="flex justify-between align-center padding-tb solid-bottom" @click="showDatePicker = true">
|
|
||||||
<view class="text-black">日期选择</view>
|
|
||||||
<view class="flex align-center">
|
|
||||||
<text class="text-black">{{ userInfo.birthday || '请选择日期' }}</text>
|
|
||||||
<view class="lg text-gray cuIcon-right margin-left-xs"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<up-calendar
|
|
||||||
:show="showDatePicker"
|
|
||||||
mode="single"
|
|
||||||
@confirm="confirmDate"
|
|
||||||
@close="showDatePicker = false"
|
|
||||||
></up-calendar>
|
|
||||||
|
|
||||||
<button class="bg-blue round margin-top-xl" @click="handleSave">保存</button>
|
|
||||||
<button class="round line-blue margin-top" @click="handleLogout">退出登录</button>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
|
import { baseUrl, getToken } from '@/request/request.js';
|
||||||
|
import { getProfileDetail, updateProfile } from '@/request/three_one_api/info.js';
|
||||||
|
|
||||||
const showDatePicker = ref(false);
|
const saving = ref(false);
|
||||||
|
const defaultAvatar = 'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg';
|
||||||
|
const avatarPreview = ref(''); // 用于显示选择的图片临时预览
|
||||||
|
|
||||||
const userInfo = reactive({
|
const userInfo = reactive({
|
||||||
avatar: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg',
|
avatar: '', // 保存相对路径,用于提交
|
||||||
nickname: '希缝弗斯',
|
nickName: '',
|
||||||
username: '17374339800',
|
phonenumber: '',
|
||||||
signature: '',
|
email: '',
|
||||||
gender: 1, // 1-男 2-女
|
sex: '0' // '0'-男 '1'-女
|
||||||
birthday: '2025-10-09'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 获取图片完整URL(用于显示)
|
||||||
|
const getImageUrl = (path) => {
|
||||||
|
if (!path) return '';
|
||||||
|
if (path.startsWith('http')) return path;
|
||||||
|
return baseUrl + path;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 页面加载时获取个人信息
|
||||||
|
onMounted(() => {
|
||||||
|
loadProfileDetail();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取个人信息
|
||||||
|
const loadProfileDetail = async () => {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: '加载中...' });
|
||||||
|
const res = await getProfileDetail();
|
||||||
|
uni.hideLoading();
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
userInfo.avatar = res.data.avatar || '';
|
||||||
|
userInfo.nickName = res.data.nickName || '';
|
||||||
|
userInfo.phonenumber = res.data.phonenumber || '';
|
||||||
|
userInfo.email = res.data.email || '';
|
||||||
|
userInfo.sex = res.data.sex || '0';
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
uni.hideLoading();
|
||||||
|
console.error('获取个人信息失败:', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 选择头像
|
// 选择头像
|
||||||
const chooseAvatar = () => {
|
const chooseAvatar = () => {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
@@ -103,33 +120,84 @@ const chooseAvatar = () => {
|
|||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
sourceType: ['album', 'camera'],
|
sourceType: ['album', 'camera'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
userInfo.avatar = res.tempFilePaths[0];
|
const tempFilePath = res.tempFilePaths[0];
|
||||||
|
// 显示临时预览
|
||||||
|
avatarPreview.value = tempFilePath;
|
||||||
|
// 上传获取链接
|
||||||
|
uploadAvatar(tempFilePath);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 日期选择确认
|
// 上传头像获取链接
|
||||||
const confirmDate = (e) => {
|
const uploadAvatar = (filePath) => {
|
||||||
userInfo.birthday = e[0];
|
uni.showLoading({ title: '上传中...' });
|
||||||
showDatePicker.value = false;
|
|
||||||
|
uni.uploadFile({
|
||||||
|
url: baseUrl + '/frontend/attachment/upload',
|
||||||
|
filePath: filePath,
|
||||||
|
name: 'file',
|
||||||
|
header: {
|
||||||
|
'Authorization': getToken()
|
||||||
|
},
|
||||||
|
success: (uploadRes) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
try {
|
||||||
|
const data = JSON.parse(uploadRes.data);
|
||||||
|
if (data.code === 0 && data.data) {
|
||||||
|
// 上传成功,保存相对路径(用于提交)
|
||||||
|
userInfo.avatar = data.data.url || data.data;
|
||||||
|
uni.showToast({ title: '上传成功', icon: 'success' });
|
||||||
|
} else {
|
||||||
|
avatarPreview.value = ''; // 上传失败,清除预览
|
||||||
|
uni.showToast({ title: data.msg || '上传失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
avatarPreview.value = '';
|
||||||
|
uni.showToast({ title: '上传失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.hideLoading();
|
||||||
|
avatarPreview.value = '';
|
||||||
|
uni.showToast({ title: '上传失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 保存
|
// 保存
|
||||||
const handleSave = () => {
|
const handleSave = async () => {
|
||||||
uni.showToast({ title: '保存成功', icon: 'success' });
|
// 表单验证
|
||||||
};
|
if (!userInfo.nickName) {
|
||||||
|
uni.showToast({ title: '请输入昵称', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 退出登录
|
saving.value = true;
|
||||||
const handleLogout = () => {
|
try {
|
||||||
uni.showModal({
|
const params = {
|
||||||
title: '提示',
|
nickName: userInfo.nickName,
|
||||||
content: '确定要退出登录吗?',
|
phonenumber: userInfo.phonenumber,
|
||||||
success: (res) => {
|
email: userInfo.email,
|
||||||
if (res.confirm) {
|
sex: userInfo.sex,
|
||||||
uni.reLaunch({ url: '/pages/login/login' });
|
avatar: userInfo.avatar // 提交相对路径
|
||||||
|
};
|
||||||
|
|
||||||
|
const res = await updateProfile(params);
|
||||||
|
if (res.code === 0) {
|
||||||
|
uni.showToast({ title: '保存成功', icon: 'success' });
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1500);
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '保存失败', icon: 'none' });
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('保存失败:', err);
|
||||||
|
uni.showToast({ title: '保存失败', icon: 'none' });
|
||||||
|
} finally {
|
||||||
|
saving.value = false;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,101 +1,134 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="title">
|
<view class="page-wrapper">
|
||||||
<view class="padding">
|
<!-- 顶部弥散渐变背景 -->
|
||||||
<view class="text-center margin-top-xl text-white text-bold">我的</view>
|
<view class="header-bg">
|
||||||
<view class="flex justify-between align-center" style="padding-top:60rpx;" >
|
<!-- 弥散光斑效果 -->
|
||||||
<view class="flex align-center">
|
<view class="blur-circle circle-1"></view>
|
||||||
<view class="cu-avatar xl round" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg);"></view>
|
<view class="blur-circle circle-2"></view>
|
||||||
<view class="margin-left">
|
<view class="blur-circle circle-3"></view>
|
||||||
<view class="text-white text-lg text-bold">hhhrrrr</view>
|
|
||||||
<view class="text-white" style="opacity: 0.8;">17374339800</view>
|
<!-- 标题 -->
|
||||||
|
<!-- <view class="header-title">我的</view> -->
|
||||||
|
|
||||||
|
<!-- 用户信息区域 -->
|
||||||
|
<view class="user-info-section">
|
||||||
|
<view class="user-avatar">
|
||||||
|
<image class="avatar-img" :src="getImageUrl(userInfo.avatar) || defaultAvatar" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="user-details">
|
||||||
|
<view class="user-name">{{ userInfo.nickName || '未设置昵称' }}</view>
|
||||||
|
<view class="user-phone">{{ userInfo.phonenumber || '未绑定手机' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="cu-btn round edit-btn bg-blue text-white ">编辑资料</button>
|
<button class="edit-btn" @click="editinfo()">编辑资料</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="page-content">
|
|
||||||
<view class="padding bg-white radius">
|
|
||||||
<view class="flex justify-between padding-bottom solid-bottom">
|
|
||||||
<view class="flex " @click="Helpcenter()">
|
|
||||||
<image src="/static/my/Helpcenter.png" style="width:40rpx;height: 40rpx;"></image>
|
|
||||||
<view class="margin-left">帮助中心</view>
|
|
||||||
</view>
|
|
||||||
<view class="lg text-gray cuIcon-right"></view>
|
|
||||||
</view>
|
|
||||||
<view class="flex justify-between padding-bottom padding-top solid-bottom">
|
|
||||||
<view class="flex">
|
|
||||||
<image src="/static/my/CustomerService.png" style="width:40rpx;height: 40rpx;"></image>
|
|
||||||
<view class="margin-left">智能客服</view>
|
|
||||||
</view>
|
|
||||||
<view class="lg text-gray cuIcon-right"></view>
|
|
||||||
</view>
|
|
||||||
<view class="flex justify-between padding-bottom padding-top solid-bottom">
|
|
||||||
<view class="flex" @click="Account()">
|
|
||||||
<image src="/static/my/Account.png" style="width:40rpx;height: 40rpx;"></image>
|
|
||||||
<view class="margin-left">账号安全</view>
|
|
||||||
</view>
|
|
||||||
<view class="lg text-gray cuIcon-right"></view>
|
|
||||||
</view>
|
|
||||||
<view class="flex justify-between padding-bottom padding-top solid-bottom">
|
|
||||||
<view class="flex" @click="notification()">
|
|
||||||
<image src="/static/my/Notification.png" style="width:40rpx;height: 40rpx;"></image>
|
|
||||||
<view class="margin-left">新消息通知</view>
|
|
||||||
</view>
|
|
||||||
<view class="lg text-gray cuIcon-right"></view>
|
|
||||||
</view>
|
|
||||||
<view class="flex justify-between padding-bottom padding-top solid-bottom">
|
|
||||||
<view class="flex">
|
|
||||||
<image src="/static/my/Delete.png" style="width:40rpx;height: 40rpx;"></image>
|
|
||||||
<view class="margin-left">清除缓存</view>
|
|
||||||
</view>
|
|
||||||
<view class="lg text-gray cuIcon-right"></view>
|
|
||||||
</view>
|
|
||||||
<view class="flex justify-between padding-bottom padding-top solid-bottom">
|
|
||||||
<view class="flex" @click="Settings()">
|
|
||||||
<image src="/static/my/Settings.png" style="width:40rpx;height: 40rpx;"></image>
|
|
||||||
<view class="margin-left">通用设置</view>
|
|
||||||
</view>
|
|
||||||
<view class="lg text-gray cuIcon-right"></view>
|
|
||||||
</view>
|
|
||||||
<view class="flex justify-between padding-bottom padding-top solid-bottom">
|
|
||||||
<view class="flex">
|
|
||||||
<image src="/static/my/Helpcenter.png" style="width:40rpx;height: 40rpx;"></image>
|
|
||||||
<view class="margin-left">关于</view>
|
|
||||||
</view>
|
|
||||||
<view class="lg text-gray cuIcon-right"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<button class=" bg-blue round margin-top-xl " @click="handleLogout()">退出登录</button>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
<!-- 内容区域 -->
|
||||||
|
<view class="content-area">
|
||||||
|
<!-- 菜单卡片 -->
|
||||||
|
<view class="menu-card">
|
||||||
|
<!-- <view class="menu-item" @click="Helpcenter()">
|
||||||
|
<view class="menu-left">
|
||||||
|
<image src="/static/my/Helpcenter.png" class="menu-icon"></image>
|
||||||
|
<text class="menu-text">帮助中心</text>
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-right menu-arrow"></text>
|
||||||
|
</view> -->
|
||||||
|
<!-- <view class="menu-item">
|
||||||
|
<view class="menu-left">
|
||||||
|
<image src="/static/my/CustomerService.png" class="menu-icon"></image>
|
||||||
|
<text class="menu-text">智能客服</text>
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-right menu-arrow"></text>
|
||||||
|
</view> -->
|
||||||
|
<view class="menu-item" @click="editinfo()">
|
||||||
|
<view class="menu-left">
|
||||||
|
<image src="/static/my/Notification.png" class="menu-icon"></image>
|
||||||
|
<text class="menu-text">编辑个人信息</text>
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-right menu-arrow"></text>
|
||||||
|
</view>
|
||||||
|
<view class="menu-item" @click="Account()">
|
||||||
|
<view class="menu-left">
|
||||||
|
<image src="/static/my/Account.png" class="menu-icon"></image>
|
||||||
|
<text class="menu-text">修改登录密码</text>
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-right menu-arrow"></text>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="menu-item">
|
||||||
|
<view class="menu-left">
|
||||||
|
<image src="/static/my/Delete.png" class="menu-icon"></image>
|
||||||
|
<text class="menu-text">清除缓存</text>
|
||||||
|
</view>
|
||||||
|
<view class="menu-right">
|
||||||
|
<text class="menu-value">0B</text>
|
||||||
|
<text class="cuIcon-right menu-arrow"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="menu-item" @click="Settings()">
|
||||||
|
<view class="menu-left">
|
||||||
|
<image src="/static/my/Settings.png" class="menu-icon"></image>
|
||||||
|
<text class="menu-text">通用设置</text>
|
||||||
|
</view>
|
||||||
|
<text class="cuIcon-right menu-arrow"></text>
|
||||||
|
</view>
|
||||||
|
<view class="menu-item">
|
||||||
|
<view class="menu-left">
|
||||||
|
<image src="/static/my/Helpcenter.png" class="menu-icon"></image>
|
||||||
|
<text class="menu-text">关于</text>
|
||||||
|
</view>
|
||||||
|
<view class="menu-right">
|
||||||
|
<text class="menu-value">1.0.0</text>
|
||||||
|
<text class="cuIcon-right menu-arrow"></text>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 退出登录按钮 -->
|
||||||
|
<button class="logout-btn" @click="handleLogout()">退出登录</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
|
import { baseUrl } from '@/request/request.js';
|
||||||
|
import { getProfileDetail } from '@/request/three_one_api/info.js';
|
||||||
|
|
||||||
|
const defaultAvatar = 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg';
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const userInfo = reactive({
|
const userInfo = reactive({
|
||||||
|
avatar: '',
|
||||||
nickName: '',
|
nickName: '',
|
||||||
phonenumber: ''
|
phonenumber: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
// // 获取用户信息
|
// 获取图片完整URL(用于显示)
|
||||||
// const getUserInfo = () => {
|
const getImageUrl = (path) => {
|
||||||
// try {
|
if (!path) return '';
|
||||||
// const storedUserInfo = uni.getStorageSync('userInfo');
|
if (path.startsWith('http')) return path;
|
||||||
// if (storedUserInfo) {
|
return baseUrl + path;
|
||||||
// const info = JSON.parse(storedUserInfo);
|
};
|
||||||
// userInfo.nickName = info.nickName || '';
|
|
||||||
// userInfo.phonenumber = info.phonenumber || info.username || '';
|
|
||||||
// }
|
|
||||||
// } catch (e) {
|
|
||||||
// console.error('获取用户信息失败:', e);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
onMounted(() => {
|
// 获取用户信息
|
||||||
getUserInfo();
|
const loadUserInfo = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getProfileDetail();
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
userInfo.avatar = res.data.avatar || '';
|
||||||
|
userInfo.nickName = res.data.nickName || '';
|
||||||
|
userInfo.phonenumber = res.data.phonenumber || '';
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('获取用户信息失败:', e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 每次页面显示时获取最新数据(包括从编辑页返回)
|
||||||
|
onShow(() => {
|
||||||
|
loadUserInfo();
|
||||||
});
|
});
|
||||||
|
|
||||||
//帮助中心
|
//帮助中心
|
||||||
@@ -110,6 +143,12 @@
|
|||||||
url:'/pages/personalcenter/notification'
|
url:'/pages/personalcenter/notification'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//编辑个人信息
|
||||||
|
const editinfo = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/personalcenter/edit'
|
||||||
|
})
|
||||||
|
}
|
||||||
//通用设置
|
//通用设置
|
||||||
const Settings = () => {
|
const Settings = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -144,22 +183,190 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
page {
|
.page-wrapper {
|
||||||
|
min-height: 100vh;
|
||||||
background: #EBF2FC;
|
background: #EBF2FC;
|
||||||
}
|
}
|
||||||
.page-content {
|
|
||||||
background: #EBF2FC;
|
// 顶部弥散渐变背景
|
||||||
border-radius: 40rpx 40rpx 0rpx 0rpx;
|
.header-bg {
|
||||||
margin-top: -40rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
padding-bottom: 50rpx;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
height: 400rpx;
|
||||||
min-height: calc(100vh - 400rpx);
|
background: linear-gradient(180deg, #3B7FED 0%, #007AFF 50%, #8BB8F8 100%);
|
||||||
}
|
|
||||||
.title {
|
|
||||||
height: 440rpx;
|
|
||||||
background: linear-gradient(135deg, #2667E9 0%, #4A8AF4 50%, #719BF0 100%);
|
|
||||||
padding-top: 60rpx;
|
padding-top: 60rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
// 弥散光斑效果
|
||||||
|
.blur-circle {
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 50%;
|
||||||
|
filter: blur(60rpx);
|
||||||
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.circle-1 {
|
||||||
|
width: 300rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
background: rgba(100, 180, 255, 0.6);
|
||||||
|
top: -50rpx;
|
||||||
|
left: -50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-2 {
|
||||||
|
width: 250rpx;
|
||||||
|
height: 250rpx;
|
||||||
|
background: rgba(150, 200, 255, 0.5);
|
||||||
|
top: 100rpx;
|
||||||
|
right: -30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-3 {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
background: rgba(180, 220, 255, 0.4);
|
||||||
|
bottom: 50rpx;
|
||||||
|
left: 200rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 标题
|
||||||
|
.header-title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fff;
|
||||||
|
position: relative;
|
||||||
|
z-index: 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户信息区域
|
||||||
|
.user-info-section {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 60rpx 40rpx 0;
|
||||||
|
position: relative;
|
||||||
|
z-index: 5;
|
||||||
|
|
||||||
|
.user-avatar {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 120rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 4rpx solid rgba(255, 255, 255, 0.5);
|
||||||
|
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.15);
|
||||||
|
|
||||||
|
.avatar-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-details {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 24rpx;
|
||||||
|
|
||||||
|
.user-name {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fff;
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-phone {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: rgba(255, 255, 255, 0.85);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-btn {
|
||||||
|
// padding: 16rpx 32rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.25);
|
||||||
|
border: 2rpx solid rgba(255, 255, 255, 0.5);
|
||||||
|
border-radius: 32rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #fff;
|
||||||
|
backdrop-filter: blur(10rpx);
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 内容区域
|
||||||
|
.content-area {
|
||||||
|
position: relative;
|
||||||
|
margin-top: -60rpx;
|
||||||
|
padding: 0 30rpx 50rpx;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 菜单卡片
|
||||||
|
.menu-card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 10rpx 0;
|
||||||
|
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 32rpx 36rpx;
|
||||||
|
border-bottom: 1rpx solid #F5F5F5;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.menu-icon {
|
||||||
|
width: 44rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-text {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.menu-value {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-arrow {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 退出登录按钮
|
||||||
|
.logout-btn {
|
||||||
|
margin-top: 60rpx;
|
||||||
|
height: 96rpx;
|
||||||
|
line-height: 96rpx;
|
||||||
|
background: linear-gradient(135deg, #3B7FED 0%, #5A9CF5 100%);
|
||||||
|
border-radius: 48rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 8rpx 24rpx rgba(59, 127, 237, 0.35);
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
160
request/api.js
160
request/api.js
@@ -63,10 +63,15 @@ export function getMyHiddenDangerList(params) {
|
|||||||
}
|
}
|
||||||
//获取隐患详情
|
//获取隐患详情
|
||||||
export function getHiddenDangerDetail(params) {
|
export function getHiddenDangerDetail(params) {
|
||||||
|
// 过滤掉 assignId 为 null、undefined、'null'、空字符串的情况
|
||||||
|
const filteredParams = { ...params };
|
||||||
|
if (filteredParams.assignId == null || filteredParams.assignId === 'null' || filteredParams.assignId === '') {
|
||||||
|
delete filteredParams.assignId;
|
||||||
|
}
|
||||||
return requestAPI({
|
return requestAPI({
|
||||||
url: '/frontend/hazard/detail',
|
url: '/frontend/hazard/detail',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
data: params
|
data: filteredParams
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//获取隐患排查列表
|
//获取隐患排查列表
|
||||||
@@ -86,6 +91,25 @@ export function submitRectification(params) {
|
|||||||
data: params
|
data: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取整改详情
|
||||||
|
export function getRectifyDetail(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/hazard/rectify/detail',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改整改
|
||||||
|
export function updateRectification(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/hazard/rectify/update',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//获取隐患标签列表
|
//获取隐患标签列表
|
||||||
export function getHiddenDangerLabelList() {
|
export function getHiddenDangerLabelList() {
|
||||||
return requestAPI({
|
return requestAPI({
|
||||||
@@ -101,6 +125,15 @@ export function getDepartmentPersonUsers(params) {
|
|||||||
data: params
|
data: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取部门人员列表(包含参与过该隐患环节下的所有部门人员)
|
||||||
|
export function getDeptUsersWithSubordinates(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/hazard/dept/users/with-subordinates',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
//成员管理
|
//成员管理
|
||||||
//添加成员
|
//添加成员
|
||||||
export function addMember(params) {
|
export function addMember(params) {
|
||||||
@@ -194,3 +227,128 @@ export function getCheckTableDetail(params) {
|
|||||||
data: params
|
data: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 获取企业类型下拉列表
|
||||||
|
export function getEnterprisetype() {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/enterprise/type/select',
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取当前部门的企业基本信息
|
||||||
|
export function getEnterpriseinfo() {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/enterprise/info',
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增本部门企业基本信息(需要admin或manage权限)
|
||||||
|
export function addEnterprise(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/enterprise/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改本部门企业基本信息(需要admin或manage权限)
|
||||||
|
export function updateEnterprise(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/enterprise/update',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 获取行业类型下拉列表
|
||||||
|
export function getindustry(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/enterprise/industry/select',
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取法规列表(可搜索筛选)
|
||||||
|
export function getRegulationList(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/admin/regulation/list',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增检查项
|
||||||
|
export function addCheckPoint(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/admin/oneTable/checkPoint/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取检查项详情
|
||||||
|
export function detailcheckPoint(id) {
|
||||||
|
return requestAPI({
|
||||||
|
url: `/admin/oneTable/checkPoint/detail/${id}`,
|
||||||
|
method: 'POST'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除检查点
|
||||||
|
export function deleteCheckPoint(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/admin/oneTable/checkPoint/delete',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取检查库列表(可搜索筛选)
|
||||||
|
export function getCheckItemList(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/admin/oneTable/item/list',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取检查库详情列表
|
||||||
|
export function getCheckItemListDetail(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/admin/oneTable/item/listDetail',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前部门所有用户
|
||||||
|
export function getDeptUsers(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/admin/user/dept/users',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取父级部门列表(从当前到顶层)
|
||||||
|
export function getParentDepts() {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/admin/dept/parents',
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取日常检查预警列表
|
||||||
|
export function getInspectionWarningList(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/admin/warning/inspection/list',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -2,8 +2,8 @@ import Request from './luch-request/index.js';
|
|||||||
// 基础的url
|
// 基础的url
|
||||||
|
|
||||||
|
|
||||||
// const baseUrl = 'https://xyb.hexieweb.cn/xyb100zz';
|
const baseUrl = 'https://yingji.hexieapi.com/prod-api';
|
||||||
const baseUrl = 'http://192.168.1.168:5004';
|
// const baseUrl = 'http://192.168.1.168:5004';
|
||||||
|
|
||||||
const http = new Request({
|
const http = new Request({
|
||||||
baseURL: baseUrl,
|
baseURL: baseUrl,
|
||||||
@@ -31,13 +31,15 @@ const objectToQueryString = (obj) => {
|
|||||||
return keyValuePairs.join('&');
|
return keyValuePairs.join('&');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提示
|
// 提示(延迟显示,避免和 hideLoading 冲突)
|
||||||
function showToast(title) {
|
function showToast(title) {
|
||||||
|
setTimeout(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title,
|
title,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请求
|
// 请求
|
||||||
@@ -84,7 +86,7 @@ const requestAPI = (config) => {
|
|||||||
// 检查业务状态码(如果后端有的话)
|
// 检查业务状态码(如果后端有的话)
|
||||||
if (res.data && res.data.code !== undefined) {
|
if (res.data && res.data.code !== undefined) {
|
||||||
// 支持 code === 200 或 code === 0 作为成功状态
|
// 支持 code === 200 或 code === 0 作为成功状态
|
||||||
if (res.data.code === 200 || res.data.code === 0) {
|
if (res.data.code === 200 || res.data.code === 0 || res.code === 0) {
|
||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
} else if (res.data.code === 401) {
|
} else if (res.data.code === 401) {
|
||||||
// token过期处理
|
// token过期处理
|
||||||
@@ -96,10 +98,14 @@ const requestAPI = (config) => {
|
|||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
});
|
});
|
||||||
}, 1500);
|
}, 1500);
|
||||||
reject('401');
|
reject({ code: 401, msg: '登录已过期' });
|
||||||
} else {
|
} else {
|
||||||
showToast(res.data.msg || '请求失败');
|
// 支持多种错误信息字段:msg、message、error
|
||||||
reject(res.data.code);
|
const errorMsg = res.data.msg || res.data.message || res.data.error || res.msg || '请求失败';
|
||||||
|
console.error('接口错误:', res.data); // 打印完整错误信息便于调试
|
||||||
|
showToast(errorMsg);
|
||||||
|
// reject 时传递完整错误信息,方便页面获取
|
||||||
|
reject({ code: res.data.code, msg: errorMsg, data: res.data });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 没有业务状态码,直接返回数据
|
// 没有业务状态码,直接返回数据
|
||||||
|
|||||||
63
request/three_one_api/area.js
Normal file
63
request/three_one_api/area.js
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import { requestAPI } from '../request.js';
|
||||||
|
|
||||||
|
// 获取区域下拉列表(简单列表,用于其他模块选择区域)
|
||||||
|
export function getAreaSelect(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/area/select',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取企业下拉列表(用于新增/修改区域时选择企业)
|
||||||
|
export function getEnterpriseSelect() {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/area/enterprise/select',
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除区域(需要admin或manage角色)
|
||||||
|
export function deleteArea(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/area/delete',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改区域(需要admin或manage角色)
|
||||||
|
export function updateArea(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/area/update',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增区域(需要admin或manage角色)
|
||||||
|
export function addArea(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/area/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取区域详情
|
||||||
|
export function getAreaDetail(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/area/detail',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取区域列表(本部门企业的区域)
|
||||||
|
export function getAreaList(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/area/list',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
27
request/three_one_api/info.js
Normal file
27
request/three_one_api/info.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { requestAPI } from '../request.js';
|
||||||
|
|
||||||
|
// 获取个人信息详情
|
||||||
|
export function getProfileDetail() {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/profile/detail',
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改个人信息
|
||||||
|
export function updateProfile(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/profile/update',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改密码
|
||||||
|
export function updatePassword(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/profile/password',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
54
request/three_one_api/license.js
Normal file
54
request/three_one_api/license.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import { requestAPI } from '../request.js';
|
||||||
|
|
||||||
|
// 获取企业下拉列表
|
||||||
|
export function getLicenseEnterpriseSelect() {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/license/enterprise/select',
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除证照(需要admin或manage角色)
|
||||||
|
export function deleteLicense(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/license/delete',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改证照(需要admin或manage角色)
|
||||||
|
export function updateLicense(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/license/update',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增证照(需要admin或manage角色)
|
||||||
|
export function addLicense(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/license/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取证照详情
|
||||||
|
export function getLicenseDetail(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/license/detail',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取证照列表(本部门企业的证照)
|
||||||
|
export function getLicenseList(params) {
|
||||||
|
return requestAPI({
|
||||||
|
url: '/frontend/license/list',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
BIN
static/yujin/yujin_sousuo.png
Normal file
BIN
static/yujin/yujin_sousuo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
static/yujin/yujin_tongji.png
Normal file
BIN
static/yujin/yujin_tongji.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
60
unpackage/dist/dev/mp-weixin/app.js
vendored
60
unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -1,60 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
||||||
const common_vendor = require("./common/vendor.js");
|
|
||||||
const uni_modules_uviewPlus_index = require("./uni_modules/uview-plus/index.js");
|
|
||||||
if (!Math) {
|
|
||||||
"./pages/index/index.js";
|
|
||||||
"./pages/map/map.js";
|
|
||||||
"./pages/plandetail/plandetail.js";
|
|
||||||
"./pages/Inspectionresult/Inspectionresult.js";
|
|
||||||
"./pages/membermanagemen/membermanagemen.js";
|
|
||||||
"./pages/corporateInformation/corporateInformation.js";
|
|
||||||
"./pages/editcompanInformation/editcompanInformation.js";
|
|
||||||
"./pages/checklist/checklist.js";
|
|
||||||
"./pages/editchecklist/editchecklist.js";
|
|
||||||
"./pages/Inspectionlog/Inspectionlog.js";
|
|
||||||
"./pages/Inspectionchecklist/Inspectionchecklist.js";
|
|
||||||
"./pages/Idphotomanagement/Idphotomanagement.js";
|
|
||||||
"./pages/hiddendanger/Inspection.js";
|
|
||||||
"./pages/hiddendanger/view.js";
|
|
||||||
"./pages/hiddendanger/rectification.js";
|
|
||||||
"./pages/hiddendanger/acceptance.js";
|
|
||||||
"./pages/hiddendanger/assignment.js";
|
|
||||||
"./pages/closeout/application.js";
|
|
||||||
"./pages/closeout/editor.js";
|
|
||||||
"./pages/equipmentregistration/equipmentregistration.js";
|
|
||||||
"./pages/area/management.js";
|
|
||||||
"./pages/Inspectionwarning/Inspectionwarning.js";
|
|
||||||
"./pages/personalcenter/my.js";
|
|
||||||
"./pages/personalcenter/helpcenter.js";
|
|
||||||
"./pages/personalcenter/notification.js";
|
|
||||||
"./pages/personalcenter/settings.js";
|
|
||||||
"./pages/personalcenter/account.js";
|
|
||||||
"./pages/personalcenter/edit.js";
|
|
||||||
"./pages/login/login.js";
|
|
||||||
"./pages/login/reg.js";
|
|
||||||
"./pages/login/enterprise.js";
|
|
||||||
"./pages/login/success.js";
|
|
||||||
"./pages/login/forget.js";
|
|
||||||
"./pages/login/agreement.js";
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
onLaunch: function() {
|
|
||||||
console.log("App Launch");
|
|
||||||
},
|
|
||||||
onShow: function() {
|
|
||||||
console.log("App Show");
|
|
||||||
},
|
|
||||||
onHide: function() {
|
|
||||||
console.log("App Hide");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function createApp() {
|
|
||||||
const app = common_vendor.createSSRApp(_sfc_main);
|
|
||||||
app.use(uni_modules_uviewPlus_index.uviewPlus);
|
|
||||||
return {
|
|
||||||
app
|
|
||||||
};
|
|
||||||
}
|
|
||||||
createApp().app.mount("#app");
|
|
||||||
exports.createApp = createApp;
|
|
||||||
86
unpackage/dist/dev/mp-weixin/app.json
vendored
86
unpackage/dist/dev/mp-weixin/app.json
vendored
@@ -1,86 +0,0 @@
|
|||||||
{
|
|
||||||
"pages": [
|
|
||||||
"pages/index/index",
|
|
||||||
"pages/map/map",
|
|
||||||
"pages/plandetail/plandetail",
|
|
||||||
"pages/Inspectionresult/Inspectionresult",
|
|
||||||
"pages/membermanagemen/membermanagemen",
|
|
||||||
"pages/corporateInformation/corporateInformation",
|
|
||||||
"pages/editcompanInformation/editcompanInformation",
|
|
||||||
"pages/checklist/checklist",
|
|
||||||
"pages/editchecklist/editchecklist",
|
|
||||||
"pages/Inspectionlog/Inspectionlog",
|
|
||||||
"pages/Inspectionchecklist/Inspectionchecklist",
|
|
||||||
"pages/Idphotomanagement/Idphotomanagement",
|
|
||||||
"pages/hiddendanger/Inspection",
|
|
||||||
"pages/hiddendanger/view",
|
|
||||||
"pages/hiddendanger/rectification",
|
|
||||||
"pages/hiddendanger/acceptance",
|
|
||||||
"pages/hiddendanger/assignment",
|
|
||||||
"pages/closeout/application",
|
|
||||||
"pages/closeout/editor",
|
|
||||||
"pages/equipmentregistration/equipmentregistration",
|
|
||||||
"pages/area/management",
|
|
||||||
"pages/Inspectionwarning/Inspectionwarning",
|
|
||||||
"pages/personalcenter/my",
|
|
||||||
"pages/personalcenter/helpcenter",
|
|
||||||
"pages/personalcenter/notification",
|
|
||||||
"pages/personalcenter/settings",
|
|
||||||
"pages/personalcenter/account",
|
|
||||||
"pages/personalcenter/edit",
|
|
||||||
"pages/login/login",
|
|
||||||
"pages/login/reg",
|
|
||||||
"pages/login/enterprise",
|
|
||||||
"pages/login/success",
|
|
||||||
"pages/login/forget",
|
|
||||||
"pages/login/agreement"
|
|
||||||
],
|
|
||||||
"window": {
|
|
||||||
"navigationBarTextStyle": "white",
|
|
||||||
"navigationBarTitleText": "uni-app",
|
|
||||||
"navigationBarBackgroundColor": "#007aff",
|
|
||||||
"backgroundColor": "#F8F8F8"
|
|
||||||
},
|
|
||||||
"tabBar": {
|
|
||||||
"color": "#999999",
|
|
||||||
"selectedColor": "#007aff",
|
|
||||||
"borderStyle": "black",
|
|
||||||
"backgroundColor": "#ffffff",
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"pagePath": "pages/index/index",
|
|
||||||
"text": "首页",
|
|
||||||
"iconPath": "static/tabBar/home1.png",
|
|
||||||
"selectedIconPath": "static/tabBar/home.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/map/map",
|
|
||||||
"text": "一张图",
|
|
||||||
"iconPath": "static/tabBar/map.png",
|
|
||||||
"selectedIconPath": "static/tabBar/map1.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/Inspectionwarning/Inspectionwarning",
|
|
||||||
"text": "预警",
|
|
||||||
"iconPath": "static/tabBar/warning.png",
|
|
||||||
"selectedIconPath": "static/tabBar/warning1.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/personalcenter/my",
|
|
||||||
"text": "我的",
|
|
||||||
"iconPath": "static/tabBar/my.png",
|
|
||||||
"selectedIconPath": "static/tabBar/my1.png"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"permission": {
|
|
||||||
"scope.userLocation": {
|
|
||||||
"desc": "你的位置信息将用于选择隐患位置"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"requiredPrivateInfos": [
|
|
||||||
"chooseLocation",
|
|
||||||
"getLocation"
|
|
||||||
],
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
8522
unpackage/dist/dev/mp-weixin/app.wxss
vendored
8522
unpackage/dist/dev/mp-weixin/app.wxss
vendored
File diff suppressed because one or more lines are too long
29
unpackage/dist/dev/mp-weixin/common/assets.js
vendored
29
unpackage/dist/dev/mp-weixin/common/assets.js
vendored
@@ -1,29 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const _imports_0$5 = "/static/蒙版组 273.png";
|
|
||||||
const _imports_0$4 = "/static/my/Helpcenter.png";
|
|
||||||
const _imports_1$2 = "/static/my/CustomerService.png";
|
|
||||||
const _imports_2 = "/static/my/Account.png";
|
|
||||||
const _imports_3$1 = "/static/my/Notification.png";
|
|
||||||
const _imports_4 = "/static/my/Delete.png";
|
|
||||||
const _imports_5 = "/static/my/Settings.png";
|
|
||||||
const _imports_0$3 = "/static/my/Customer service.png";
|
|
||||||
const _imports_1$1 = "/static/my/Phone.png";
|
|
||||||
const _imports_0$2 = "/static/index/index_bg.png";
|
|
||||||
const _imports_0$1 = "/static/index/phone.png";
|
|
||||||
const _imports_1 = "/static/index/lock.png";
|
|
||||||
const _imports_3 = "/static/index/photos.png";
|
|
||||||
const _imports_0 = "/static/index/蒙版组 260.png";
|
|
||||||
exports._imports_0 = _imports_0$5;
|
|
||||||
exports._imports_0$1 = _imports_0$4;
|
|
||||||
exports._imports_0$2 = _imports_0$3;
|
|
||||||
exports._imports_0$3 = _imports_0$2;
|
|
||||||
exports._imports_0$4 = _imports_0$1;
|
|
||||||
exports._imports_0$5 = _imports_0;
|
|
||||||
exports._imports_1 = _imports_1$2;
|
|
||||||
exports._imports_1$1 = _imports_1$1;
|
|
||||||
exports._imports_1$2 = _imports_1;
|
|
||||||
exports._imports_2 = _imports_2;
|
|
||||||
exports._imports_3 = _imports_3$1;
|
|
||||||
exports._imports_3$1 = _imports_3;
|
|
||||||
exports._imports_4 = _imports_4;
|
|
||||||
exports._imports_5 = _imports_5;
|
|
||||||
7829
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
7829
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,136 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
|
||||||
const _easycom_u_datetime_picker2 = common_vendor.resolveComponent("u-datetime-picker");
|
|
||||||
(_easycom_u_popup2 + _easycom_u_datetime_picker2)();
|
|
||||||
}
|
|
||||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
|
||||||
const _easycom_u_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_u_popup + _easycom_u_datetime_picker)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "Idphotomanagement",
|
|
||||||
setup(__props) {
|
|
||||||
const hasData = common_vendor.ref(false);
|
|
||||||
const showAddPopup = common_vendor.ref(false);
|
|
||||||
const showDatePicker = common_vendor.ref(false);
|
|
||||||
const showDeptPopup = common_vendor.ref(false);
|
|
||||||
const deptList = common_vendor.ref([
|
|
||||||
"湘西自治州和谐网络科技有限公司",
|
|
||||||
"湘西自治州和谐云大数据科技有限公司",
|
|
||||||
"湘西网络有限公司"
|
|
||||||
]);
|
|
||||||
const selectedDept = common_vendor.ref("");
|
|
||||||
const formData = common_vendor.reactive({
|
|
||||||
dept: "",
|
|
||||||
type: "",
|
|
||||||
idType: "",
|
|
||||||
number: "",
|
|
||||||
startDate: "",
|
|
||||||
expireDate: "",
|
|
||||||
image: ""
|
|
||||||
});
|
|
||||||
const confirmDept = () => {
|
|
||||||
if (selectedDept.value) {
|
|
||||||
formData.dept = selectedDept.value;
|
|
||||||
}
|
|
||||||
showDeptPopup.value = false;
|
|
||||||
};
|
|
||||||
const chooseImage = () => {
|
|
||||||
common_vendor.index.chooseImage({
|
|
||||||
count: 1,
|
|
||||||
sizeType: ["compressed"],
|
|
||||||
sourceType: ["album", "camera"],
|
|
||||||
success: (res) => {
|
|
||||||
formData.image = res.tempFilePaths[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const onDateConfirm = (e) => {
|
|
||||||
const date = new Date(e.value);
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
||||||
const day = String(date.getDate()).padStart(2, "0");
|
|
||||||
formData.expireDate = `${year}-${month}-${day}`;
|
|
||||||
showDatePicker.value = false;
|
|
||||||
};
|
|
||||||
const handleSubmit = () => {
|
|
||||||
if (!formData.dept) {
|
|
||||||
common_vendor.index.showToast({ title: "请选择部门", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log("提交数据:", formData);
|
|
||||||
common_vendor.index.showToast({ title: "新增成功", icon: "success" });
|
|
||||||
showAddPopup.value = false;
|
|
||||||
formData.dept = "";
|
|
||||||
formData.type = "";
|
|
||||||
formData.number = "";
|
|
||||||
formData.startDate = "";
|
|
||||||
formData.expireDate = "";
|
|
||||||
formData.image = "";
|
|
||||||
selectedDept.value = "";
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: !hasData.value
|
|
||||||
}, !hasData.value ? {} : {}, {
|
|
||||||
b: common_vendor.o(($event) => showAddPopup.value = true),
|
|
||||||
c: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
d: common_vendor.t(formData.dept || "请选择部门"),
|
|
||||||
e: common_vendor.n(formData.dept ? "" : "text-gray"),
|
|
||||||
f: common_vendor.o(($event) => showDeptPopup.value = true),
|
|
||||||
g: formData.idType,
|
|
||||||
h: common_vendor.o(($event) => formData.idType = $event.detail.value),
|
|
||||||
i: formData.number,
|
|
||||||
j: common_vendor.o(($event) => formData.number = $event.detail.value),
|
|
||||||
k: common_vendor.t(formData.expireDate || "请选择开始时间"),
|
|
||||||
l: common_vendor.n(formData.expireDate ? "" : "text-gray"),
|
|
||||||
m: common_vendor.o(($event) => showDatePicker.value = true),
|
|
||||||
n: common_vendor.t(formData.expireDate || "请选择结束时间"),
|
|
||||||
o: common_vendor.n(formData.expireDate ? "" : "text-gray"),
|
|
||||||
p: common_vendor.o(($event) => showDatePicker.value = true),
|
|
||||||
q: !formData.image
|
|
||||||
}, !formData.image ? {} : {
|
|
||||||
r: formData.image
|
|
||||||
}, {
|
|
||||||
s: common_vendor.o(chooseImage),
|
|
||||||
t: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
v: common_vendor.o(handleSubmit),
|
|
||||||
w: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
x: common_vendor.p({
|
|
||||||
show: showAddPopup.value,
|
|
||||||
mode: "center",
|
|
||||||
round: "20"
|
|
||||||
}),
|
|
||||||
y: common_vendor.o(onDateConfirm),
|
|
||||||
z: common_vendor.o(($event) => showDatePicker.value = false),
|
|
||||||
A: common_vendor.p({
|
|
||||||
show: showDatePicker.value,
|
|
||||||
mode: "date"
|
|
||||||
}),
|
|
||||||
B: common_vendor.o(($event) => showDeptPopup.value = false),
|
|
||||||
C: common_vendor.f(deptList.value, (item, index, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: selectedDept.value === item
|
|
||||||
}, selectedDept.value === item ? {} : {}, {
|
|
||||||
b: selectedDept.value === item ? 1 : "",
|
|
||||||
c: common_vendor.t(item),
|
|
||||||
d: index,
|
|
||||||
e: common_vendor.o(($event) => selectedDept.value = item, index)
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
D: common_vendor.o(confirmDept),
|
|
||||||
E: common_vendor.o(($event) => showDeptPopup.value = false),
|
|
||||||
F: common_vendor.p({
|
|
||||||
show: showDeptPopup.value,
|
|
||||||
mode: "center",
|
|
||||||
round: "20"
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1ad9c724"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "证件照管理",
|
|
||||||
"usingComponents": {
|
|
||||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
|
|
||||||
"u-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['page', 'padding', 'data-v-1ad9c724', virtualHostClass]}}" style="{{virtualHostStyle}}"><view wx:if="{{a}}" class="text-gray text-center data-v-1ad9c724">暂无证件照记录</view><button class="cuIcon-add bg-blue round margin-top-xl data-v-1ad9c724" bindtap="{{b}}">新增</button><u-popup wx:if="{{x}}" class="data-v-1ad9c724" virtualHostClass="data-v-1ad9c724" u-s="{{['d']}}" bindclose="{{w}}" u-i="1ad9c724-0" bind:__l="__l" u-p="{{x}}"><view class="popup-content data-v-1ad9c724"><view class="popup-header data-v-1ad9c724"><view class="popup-title text-bold data-v-1ad9c724">新增证照</view><view class="popup-close data-v-1ad9c724" bindtap="{{c}}">×</view></view><view class="popup-body data-v-1ad9c724"><view class="form-item data-v-1ad9c724"><view class="form-label data-v-1ad9c724">部门<text class="text-red data-v-1ad9c724">*</text></view><view class="form-input form-select data-v-1ad9c724" bindtap="{{f}}"><text class="{{['data-v-1ad9c724', e]}}">{{d}}</text></view></view><view class="form-item data-v-1ad9c724"><view class="form-label data-v-1ad9c724">证件类型</view><input class="form-input data-v-1ad9c724" placeholder="请输入证件类型" value="{{g}}" bindinput="{{h}}"/></view><view class="form-item data-v-1ad9c724"><view class="form-label data-v-1ad9c724">证件编号</view><input class="form-input data-v-1ad9c724" placeholder="请输入证件编号" value="{{i}}" bindinput="{{j}}"/></view><view class="form-item data-v-1ad9c724"><view class="form-label data-v-1ad9c724">开始日期</view><view class="form-input form-select data-v-1ad9c724" bindtap="{{m}}"><text class="{{['data-v-1ad9c724', l]}}">{{k}}</text></view></view><view class="form-item data-v-1ad9c724"><view class="form-label data-v-1ad9c724">结束日期</view><view class="form-input form-select data-v-1ad9c724" bindtap="{{p}}"><text class="{{['data-v-1ad9c724', o]}}">{{n}}</text></view></view><view class="form-item data-v-1ad9c724"><view class="form-label data-v-1ad9c724">封面图片</view><view class="upload-box data-v-1ad9c724" bindtap="{{s}}"><view wx:if="{{q}}" class="upload-add data-v-1ad9c724"><text class="upload-icon data-v-1ad9c724">+</text><text class="upload-text data-v-1ad9c724">上传照片</text></view><image wx:else src="{{r}}" mode="aspectFill" class="upload-img data-v-1ad9c724"></image></view></view></view><view class="popup-footer data-v-1ad9c724"><button class="btn-cancel data-v-1ad9c724" bindtap="{{t}}">取消</button><button class="btn-confirm bg-blue data-v-1ad9c724" bindtap="{{v}}">确定</button></view></view></u-popup><u-datetime-picker wx:if="{{A}}" class="data-v-1ad9c724" virtualHostClass="data-v-1ad9c724" bindconfirm="{{y}}" bindcancel="{{z}}" u-i="1ad9c724-1" bind:__l="__l" u-p="{{A}}"></u-datetime-picker><u-popup wx:if="{{F}}" class="data-v-1ad9c724" virtualHostClass="data-v-1ad9c724" u-s="{{['d']}}" bindclose="{{E}}" u-i="1ad9c724-2" bind:__l="__l" u-p="{{F}}"><view class="dept-popup data-v-1ad9c724"><view class="popup-header data-v-1ad9c724"><view class="popup-title text-bold data-v-1ad9c724">选择部门</view><view class="popup-close data-v-1ad9c724" bindtap="{{B}}">×</view></view><view class="dept-list data-v-1ad9c724"><view wx:for="{{C}}" wx:for-item="item" wx:key="d" class="dept-item data-v-1ad9c724" bindtap="{{item.e}}"><view class="{{['dept-checkbox', 'data-v-1ad9c724', item.b && 'dept-checkbox-active']}}"><text wx:if="{{item.a}}" class="data-v-1ad9c724">✓</text></view><text class="dept-name data-v-1ad9c724">{{item.c}}</text></view></view><button class="btn-dept-confirm bg-blue data-v-1ad9c724" bindtap="{{D}}">确定</button></view></u-popup></view>
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-1ad9c724 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.popup-content.data-v-1ad9c724 {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
}
|
|
||||||
.popup-header.data-v-1ad9c724 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
.popup-title.data-v-1ad9c724 {
|
|
||||||
font-size: 34rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.popup-close.data-v-1ad9c724 {
|
|
||||||
font-size: 48rpx;
|
|
||||||
color: #999;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
.popup-body.data-v-1ad9c724 {
|
|
||||||
max-height: 700rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.form-item.data-v-1ad9c724 {
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
}
|
|
||||||
.form-label.data-v-1ad9c724 {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 12rpx;
|
|
||||||
}
|
|
||||||
.form-input.data-v-1ad9c724 {
|
|
||||||
width: 100%;
|
|
||||||
height: 80rpx;
|
|
||||||
border: 2rpx solid #E5E5E5;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
padding: 0 24rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.form-select.data-v-1ad9c724 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
line-height: 80rpx;
|
|
||||||
}
|
|
||||||
.upload-box.data-v-1ad9c724 {
|
|
||||||
width: 200rpx;
|
|
||||||
height: 200rpx;
|
|
||||||
border: 2rpx dashed #ccc;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.upload-add.data-v-1ad9c724 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.upload-icon.data-v-1ad9c724 {
|
|
||||||
font-size: 60rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.upload-text.data-v-1ad9c724 {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-top: 8rpx;
|
|
||||||
}
|
|
||||||
.upload-img.data-v-1ad9c724 {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
}
|
|
||||||
.popup-footer.data-v-1ad9c724 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 30rpx;
|
|
||||||
margin-top: 40rpx;
|
|
||||||
}
|
|
||||||
.btn-cancel.data-v-1ad9c724 {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border: 2rpx solid #E5E5E5;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
background: #fff;
|
|
||||||
color: #333;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.btn-confirm.data-v-1ad9c724 {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.dept-popup.data-v-1ad9c724 {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
}
|
|
||||||
.dept-list.data-v-1ad9c724 {
|
|
||||||
max-height: 400rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
.dept-item.data-v-1ad9c724 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 24rpx;
|
|
||||||
border: 2rpx solid #E5E5E5;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
}
|
|
||||||
.dept-checkbox.data-v-1ad9c724 {
|
|
||||||
width: 36rpx;
|
|
||||||
height: 36rpx;
|
|
||||||
border: 2rpx solid #ccc;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
.dept-checkbox-active.data-v-1ad9c724 {
|
|
||||||
background: #2667E9;
|
|
||||||
border-color: #2667E9;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.dept-name.data-v-1ad9c724 {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.btn-dept-confirm.data-v-1ad9c724 {
|
|
||||||
width: 100%;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const _sfc_main = {};
|
|
||||||
function _sfc_render(_ctx, _cache) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "检查清单",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['padding', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="text-bold text-black">检查清单预览</view><view class="flex margin-bottom"><view class="text-gray">计划名称:</view><view>和谐矿业每日巡检</view></view><view class="flex margin-bottom"><view class="text-gray">检查时间:</view><view>2025-11-19 10:18:40</view></view><view class="flex margin-bottom"><view class="text-gray">检查人员:</view><view>18174379303</view></view><image></image><view class="flex margin-bottom"><view>被检查单位:</view><view></view></view><view class="flex margin-bottom"><view>检查人员:</view><view></view></view><view class="flex margin-bottom"><view>上次检查情况:</view><view></view></view><view class="flex margin-bottom"><view>本次检查情况:</view><view></view></view><view class="flex margin-bottom"><view>检查日期:</view><view>2025-11-19 10:18:40</view></view><view class="flex justify-between"><view class="flex text-center align-center"><button class="bg-blue">缩小</button><view>50%</view><button class="bg-blue">放大</button></view><button class="lg cu-btn">重置</button></view></view>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "Inspectionlog",
|
|
||||||
setup(__props) {
|
|
||||||
const Checklist = () => {
|
|
||||||
common_vendor.index.navigateTo({
|
|
||||||
url: "/pages/Inspectionchecklist/Inspectionchecklist"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.o(($event) => Checklist())
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2f72507f"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "检查记录",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['page', 'padding', 'data-v-2f72507f', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius list data-v-2f72507f"><view class="text-bold margin-bottom text-black data-v-2f72507f">和谐矿业每日巡检</view><view class="flex margin-bottom data-v-2f72507f"><view class="text-gray data-v-2f72507f">检查时间:</view><view class="data-v-2f72507f">2025-11-19 10:18:40</view></view><view class="flex margin-bottom data-v-2f72507f"><view class="text-gray data-v-2f72507f">检查人员:</view><view class="data-v-2f72507f">18174379303</view></view><view class="flex margin-bottom data-v-2f72507f"><view class="text-gray data-v-2f72507f">隐患数量:</view><view class="data-v-2f72507f">1</view></view><view class="flex margin-bottom data-v-2f72507f"><view class="text-gray data-v-2f72507f">备注:</view><view class="data-v-2f72507f">可以</view></view><view class="flex justify-between data-v-2f72507f"><view class="data-v-2f72507f"></view><button class="bg-blue round cu-btn lg data-v-2f72507f" bindtap="{{a}}">预览清单</button></view></view></view>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-2f72507f {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.list.data-v-2f72507f {
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
|
||||||
border-left: 5px solid #2667E9;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const request_api = require("../../request/api.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
|
|
||||||
const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group");
|
|
||||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
|
||||||
(_easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2)();
|
|
||||||
}
|
|
||||||
const _easycom_u_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
|
|
||||||
const _easycom_u_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
|
|
||||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "Inspectionresult",
|
|
||||||
setup(__props) {
|
|
||||||
const oneTableId = common_vendor.ref("");
|
|
||||||
const checkData = common_vendor.ref(null);
|
|
||||||
const radiolist1 = common_vendor.reactive([
|
|
||||||
{
|
|
||||||
name: "正常",
|
|
||||||
value: 1,
|
|
||||||
disabled: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "异常",
|
|
||||||
value: 2,
|
|
||||||
disabled: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "不涉及",
|
|
||||||
value: 3,
|
|
||||||
disabled: false
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
const radiovalue1 = common_vendor.ref("");
|
|
||||||
const groupChange = (n) => {
|
|
||||||
console.log("groupChange", n);
|
|
||||||
};
|
|
||||||
const radioChange = (n) => {
|
|
||||||
console.log("radioChange", n);
|
|
||||||
};
|
|
||||||
const value1 = common_vendor.ref("");
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
var _a;
|
|
||||||
if (!radiovalue1.value) {
|
|
||||||
common_vendor.index.showToast({ title: "请选择检查结果", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const selectedItem = radiolist1.find((item) => item.name === radiovalue1.value);
|
|
||||||
const resultValue = selectedItem ? selectedItem.value : null;
|
|
||||||
if (!resultValue) {
|
|
||||||
common_vendor.index.showToast({ title: "请选择检查结果", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const params = {
|
|
||||||
taskId: (_a = checkData.value) == null ? void 0 : _a.taskId,
|
|
||||||
result: resultValue,
|
|
||||||
remark: value1.value
|
|
||||||
};
|
|
||||||
console.log("提交参数:", params);
|
|
||||||
const res = await request_api.submitCheckResult(params);
|
|
||||||
console.log("提交结果:", res);
|
|
||||||
if (res.code === 0) {
|
|
||||||
common_vendor.index.showToast({ title: "提交成功", icon: "success" });
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.navigateBack();
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
|
||||||
common_vendor.index.showToast({ title: res.msg || "提交失败", icon: "none" });
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("提交失败:", error);
|
|
||||||
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const getCheckData = async () => {
|
|
||||||
try {
|
|
||||||
const res = await request_api.enterCheckPlan(oneTableId.value);
|
|
||||||
console.log("检查项数据:", res);
|
|
||||||
if (res.code === 0) {
|
|
||||||
checkData.value = res.data;
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
console.log("接收到的参数:", options);
|
|
||||||
if (options.id) {
|
|
||||||
oneTableId.value = options.id;
|
|
||||||
getCheckData();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
var _a, _b;
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(((_a = checkData.value) == null ? void 0 : _a.name) || "加载中..."),
|
|
||||||
b: ((_b = checkData.value) == null ? void 0 : _b.point) || "",
|
|
||||||
c: common_vendor.f(radiolist1, (item, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: index,
|
|
||||||
b: common_vendor.o(radioChange, index),
|
|
||||||
c: "643afff0-1-" + i0 + ",643afff0-0",
|
|
||||||
d: common_vendor.p({
|
|
||||||
customStyle: {
|
|
||||||
marginBottom: "8px"
|
|
||||||
},
|
|
||||||
label: item.name,
|
|
||||||
name: item.name
|
|
||||||
})
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
d: common_vendor.o(groupChange),
|
|
||||||
e: common_vendor.o(($event) => radiovalue1.value = $event),
|
|
||||||
f: common_vendor.p({
|
|
||||||
placement: "row",
|
|
||||||
modelValue: radiovalue1.value
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(($event) => value1.value = $event),
|
|
||||||
h: common_vendor.p({
|
|
||||||
placeholder: "请输入备注信息",
|
|
||||||
modelValue: value1.value
|
|
||||||
}),
|
|
||||||
i: common_vendor.o(handleSubmit)
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-643afff0"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "检查结果",
|
|
||||||
"usingComponents": {
|
|
||||||
"u-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
|
|
||||||
"u-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
|
|
||||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['page', 'padding', 'data-v-643afff0', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-643afff0"><view class="text-bold data-v-643afff0">{{a}}</view><view class="margin-top data-v-643afff0"><rich-text class="data-v-643afff0" nodes="{{b}}"></rich-text></view><view class="margin-top data-v-643afff0"><u-radio-group wx:if="{{f}}" class="data-v-643afff0" virtualHostClass="data-v-643afff0" u-s="{{['d']}}" bindchange="{{d}}" u-i="643afff0-0" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"><u-radio wx:for="{{c}}" wx:for-item="item" wx:key="a" class="data-v-643afff0" virtualHostClass="data-v-643afff0" bindchange="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d}}"></u-radio></u-radio-group></view><view class="data-v-643afff0"><up-textarea wx:if="{{h}}" class="data-v-643afff0" virtualHostClass="data-v-643afff0" u-i="643afff0-2" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-textarea></view></view><button class="bg-blue round margin-top-xl data-v-643afff0" bindtap="{{i}}">提交</button></view>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-643afff0 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
|
||||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
||||||
(_easycom_up_datetime_picker2 + _easycom_up_input2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
|
||||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_datetime_picker + _easycom_up_input)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "Inspectionwarning",
|
|
||||||
setup(__props) {
|
|
||||||
const activeIndex = common_vendor.ref(0);
|
|
||||||
const warningList = common_vendor.ref([
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: "全部状态80"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: "逾期未检16"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: "严重逾期50"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
name: "期限内待检4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
name: "逾期已完成8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
name: "按期已完成2"
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
const switchTab = (index) => {
|
|
||||||
activeIndex.value = index;
|
|
||||||
};
|
|
||||||
const value1 = common_vendor.ref(Date.now());
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.f(warningList.value, (item, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.name),
|
|
||||||
b: activeIndex.value === index ? 1 : "",
|
|
||||||
c: index,
|
|
||||||
d: common_vendor.o(($event) => switchTab(index), index)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
b: common_vendor.o(($event) => value1.value = $event),
|
|
||||||
c: common_vendor.p({
|
|
||||||
hasInput: true,
|
|
||||||
show: _ctx.show,
|
|
||||||
mode: "date",
|
|
||||||
modelValue: value1.value
|
|
||||||
}),
|
|
||||||
d: common_vendor.o(($event) => value1.value = $event),
|
|
||||||
e: common_vendor.p({
|
|
||||||
hasInput: true,
|
|
||||||
show: _ctx.show,
|
|
||||||
mode: "date",
|
|
||||||
modelValue: value1.value
|
|
||||||
}),
|
|
||||||
f: common_vendor.p({
|
|
||||||
placeholder: "请输入公司名称"
|
|
||||||
})
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-00b99536"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "日常安全检查预警",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
|
||||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['padding', 'page', 'data-v-00b99536', virtualHostClass]}}" style="{{virtualHostStyle}}"><scroll-view scroll-x class="tab-scroll data-v-00b99536"><view class="tab-list data-v-00b99536"><view wx:for="{{a}}" wx:for-item="item" wx:key="c" class="{{['tab-item', 'data-v-00b99536', item.b && 'tab-active']}}" bindtap="{{item.d}}">{{item.a}}</view></view></scroll-view><view class="bg-white radius padding margin-top data-v-00b99536"><view class="flex data-v-00b99536"><view class="text-black text-bold data-v-00b99536">查询条件</view></view><view class="margin-top margin-bottom data-v-00b99536">开始日期</view><up-datetime-picker wx:if="{{c}}" class="data-v-00b99536" virtualHostClass="data-v-00b99536" u-i="00b99536-0" bind:__l="__l" bindupdateModelValue="{{b}}" u-p="{{c}}"></up-datetime-picker><view class="margin-top margin-bottom data-v-00b99536">结束日期</view><up-datetime-picker wx:if="{{e}}" class="data-v-00b99536" virtualHostClass="data-v-00b99536" u-i="00b99536-1" bind:__l="__l" bindupdateModelValue="{{d}}" u-p="{{e}}"></up-datetime-picker><view class="margin-top margin-bottom data-v-00b99536">公司名称</view><up-input wx:if="{{f}}" class="data-v-00b99536" virtualHostClass="data-v-00b99536" u-i="00b99536-2" bind:__l="__l" u-p="{{f}}"></up-input><button class="bg-blue round margin-top data-v-00b99536">查询</button></view><view class="padding bg-white radius margin-top data-v-00b99536"><view class="flex data-v-00b99536"><view class="data-v-00b99536"></view><view class="text-bold text-black data-v-00b99536">统计概览</view></view><view class="flex col-4 grid margin-top data-v-00b99536" style="gap:20rpx"><view class="text-center padding-top-sm data-v-00b99536" style="width:142rpx;height:124rpx;background:#628EFB;border-radius:8rpx;color:#fff"><view class="data-v-00b99536">80</view><view class="data-v-00b99536">总计</view></view><view class="text-center padding-top-sm data-v-00b99536" style="width:142rpx;height:124rpx;background:#32DCC7;border-radius:8rpx;color:#fff"><view class="data-v-00b99536">70</view><view class="data-v-00b99536">逾期</view></view><view class="text-center padding-top-sm data-v-00b99536" style="width:142rpx;height:124rpx;background:#32D1E9;border-radius:8rpx;color:#fff"><view class="data-v-00b99536">20</view><view class="data-v-00b99536">已完成</view></view><view class="text-center padding-top-sm data-v-00b99536" style="width:142rpx;height:124rpx;background:#A190F5;border-radius:8rpx;color:#fff"><view class="data-v-00b99536">20</view><view class="data-v-00b99536">待处理</view></view></view></view><view class="bg-white radius padding margin-top margin-bottom flex data-v-00b99536"><view class="list-title data-v-00b99536"></view><view class="text-bold text-black data-v-00b99536">日常安全检查预警数据列表</view></view><view class="bg-white radius padding list-list data-v-00b99536"><view class="flex justify-between data-v-00b99536"><view class="text-bold text-black data-v-00b99536">#1</view><view class="data-v-00b99536">严重逾期</view></view><view class="flex margin-top data-v-00b99536"><view class="text-gray data-v-00b99536" style="white-space:nowrap">企业名称:</view><view class="data-v-00b99536">湘西和谐云大数据产业发展有限公司</view></view><view class="flex margin-top data-v-00b99536"><view class="text-gray data-v-00b99536">计划名称:</view><view class="data-v-00b99536">检查计划</view></view><view class="flex margin-top data-v-00b99536"><view class="text-gray data-v-00b99536">计划周期:</view><view class="data-v-00b99536">每天一次</view></view><view class="flex margin-top data-v-00b99536"><view class="text-gray data-v-00b99536">预约检查日期:</view><view class="data-v-00b99536">2025-11-20</view></view><view class="flex margin-top data-v-00b99536"><view class="text-gray data-v-00b99536">实际完成时间:</view><view class="data-v-00b99536">未完成</view></view><view class="flex margin-top data-v-00b99536"><view class="text-gray data-v-00b99536">负责人:</view><view class="data-v-00b99536">符友成</view></view><view class="flex margin-top data-v-00b99536"><view class="text-gray data-v-00b99536">逾期天数:</view><view class="data-v-00b99536">17天 </view></view></view></view>
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-00b99536 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.tab-scroll.data-v-00b99536 {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.tab-list.data-v-00b99536 {
|
|
||||||
display: inline-flex;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.tab-item.data-v-00b99536 {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 16rpx 28rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
background: #fff;
|
|
||||||
border: 1rpx solid #ddd;
|
|
||||||
color: #333;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
.tab-item.tab-active.data-v-00b99536 {
|
|
||||||
background: #2979ff;
|
|
||||||
border-color: #2979ff;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.list-title.data-v-00b99536 {
|
|
||||||
width: 10rpx;
|
|
||||||
height: 32rpx;
|
|
||||||
background: #2667E9;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
line-height: 32rpx;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
.list-list.data-v-00b99536 {
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
|
||||||
border-left: 5px solid #2667E9;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
||||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
|
||||||
(_easycom_up_input2 + _easycom_u_popup2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
||||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_input + _easycom_u_popup)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "management",
|
|
||||||
setup(__props) {
|
|
||||||
const showEditPopup = common_vendor.ref(false);
|
|
||||||
const areaData = common_vendor.reactive({
|
|
||||||
name: "区域名称",
|
|
||||||
color: "#ef4444"
|
|
||||||
});
|
|
||||||
const formData = common_vendor.reactive({
|
|
||||||
name: "",
|
|
||||||
color: "#ef4444"
|
|
||||||
});
|
|
||||||
const presetColors = [
|
|
||||||
"#2563eb",
|
|
||||||
"#ef4444",
|
|
||||||
"#10b981",
|
|
||||||
"#f59e0b",
|
|
||||||
"#6366f1",
|
|
||||||
"#ec4899",
|
|
||||||
"#06b6d4",
|
|
||||||
"#84cc16",
|
|
||||||
"#f97316",
|
|
||||||
"#4f46e5",
|
|
||||||
"#dc2626",
|
|
||||||
"#f59e0b",
|
|
||||||
"#d97706",
|
|
||||||
"#8b5cf6",
|
|
||||||
"#db2777"
|
|
||||||
];
|
|
||||||
const openEditPopup = () => {
|
|
||||||
formData.name = areaData.name;
|
|
||||||
formData.color = areaData.color;
|
|
||||||
showEditPopup.value = true;
|
|
||||||
};
|
|
||||||
const selectColor = (color) => {
|
|
||||||
formData.color = color;
|
|
||||||
};
|
|
||||||
const handleEdit = () => {
|
|
||||||
if (!formData.name) {
|
|
||||||
common_vendor.index.showToast({ title: "请输入区域名称", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!formData.color) {
|
|
||||||
common_vendor.index.showToast({ title: "请选择区域颜色", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
areaData.name = formData.name;
|
|
||||||
areaData.color = formData.color;
|
|
||||||
showEditPopup.value = false;
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "编辑成功",
|
|
||||||
icon: "success"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(areaData.name || "区域名称"),
|
|
||||||
b: areaData.color,
|
|
||||||
c: common_vendor.t(areaData.color),
|
|
||||||
d: common_vendor.o(openEditPopup),
|
|
||||||
e: common_vendor.o(($event) => showEditPopup.value = false),
|
|
||||||
f: common_vendor.o(($event) => formData.name = $event),
|
|
||||||
g: common_vendor.p({
|
|
||||||
placeholder: "请输入区域名称",
|
|
||||||
modelValue: formData.name
|
|
||||||
}),
|
|
||||||
h: common_vendor.o(($event) => formData.color = $event),
|
|
||||||
i: common_vendor.p({
|
|
||||||
placeholder: "#ef4444",
|
|
||||||
modelValue: formData.color
|
|
||||||
}),
|
|
||||||
j: formData.color,
|
|
||||||
k: common_vendor.f(presetColors, (color, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: index,
|
|
||||||
b: color,
|
|
||||||
c: common_vendor.o(($event) => selectColor(color), index)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
l: common_vendor.o(($event) => showEditPopup.value = false),
|
|
||||||
m: common_vendor.o(handleEdit),
|
|
||||||
n: common_vendor.o(($event) => showEditPopup.value = false),
|
|
||||||
o: common_vendor.p({
|
|
||||||
show: showEditPopup.value,
|
|
||||||
mode: "center",
|
|
||||||
round: "20"
|
|
||||||
})
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-847f15e8"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "区域管理",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
|
||||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['padding', 'page', 'data-v-847f15e8', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-847f15e8"><view class="flex justify-between data-v-847f15e8"><view class="data-v-847f15e8"><view class="text-bold text-black data-v-847f15e8">{{a}}</view><view class="margin-top flex align-center data-v-847f15e8"><text class="data-v-847f15e8">颜色:</text><view class="color-dot data-v-847f15e8" style="{{'background-color:' + b}}"></view><text class="margin-left-xs data-v-847f15e8">{{c}}</text></view></view><view class="data-v-847f15e8"><button class="bg-blue cu-btn data-v-847f15e8" bindtap="{{d}}">编辑</button><button class="bg-red cu-btn margin-left data-v-847f15e8">删除</button></view></view></view><button class="cuIcon-add bg-blue round margin-top-xl data-v-847f15e8">新增公司区域</button><u-popup wx:if="{{o}}" class="data-v-847f15e8" virtualHostClass="data-v-847f15e8" u-s="{{['d']}}" bindclose="{{n}}" u-i="847f15e8-0" bind:__l="__l" u-p="{{o}}"><view class="popup-content data-v-847f15e8"><view class="popup-header data-v-847f15e8"><view class="popup-title text-bold data-v-847f15e8">编辑区域</view><view class="popup-close data-v-847f15e8" bindtap="{{e}}">×</view></view><view class="popup-body data-v-847f15e8"><view class="flex margin-bottom-sm data-v-847f15e8"><view class="data-v-847f15e8">区域名称</view><view class="text-red data-v-847f15e8">*</view></view><up-input wx:if="{{g}}" class="data-v-847f15e8" virtualHostClass="data-v-847f15e8" u-i="847f15e8-1,847f15e8-0" bind:__l="__l" bindupdateModelValue="{{f}}" u-p="{{g}}"></up-input><view class="flex margin-bottom-sm margin-top data-v-847f15e8"><view class="data-v-847f15e8">区域颜色</view><view class="text-red data-v-847f15e8">*</view></view><view class="flex align-center data-v-847f15e8"><up-input wx:if="{{i}}" class="flex-sub data-v-847f15e8" virtualHostClass="flex-sub data-v-847f15e8" u-i="847f15e8-2,847f15e8-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"></up-input><view class="color-preview data-v-847f15e8" style="{{'background-color:' + j}}"></view></view><view class="margin-top margin-bottom-sm text-gray data-v-847f15e8">预设颜色</view><view class="color-grid data-v-847f15e8"><view wx:for="{{k}}" wx:for-item="color" wx:key="a" class="color-item data-v-847f15e8" style="{{'background-color:' + color.b}}" bindtap="{{color.c}}"></view></view></view><view class="popup-footer data-v-847f15e8"><button class="btn-cancel data-v-847f15e8" bindtap="{{l}}">取消</button><button class="btn-confirm bg-blue data-v-847f15e8" bindtap="{{m}}">确定</button></view></view></u-popup></view>
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-847f15e8 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.popup-content.data-v-847f15e8 {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.popup-header.data-v-847f15e8 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 30rpx;
|
|
||||||
border-bottom: 1rpx solid #eee;
|
|
||||||
}
|
|
||||||
.popup-title.data-v-847f15e8 {
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
.popup-close.data-v-847f15e8 {
|
|
||||||
font-size: 40rpx;
|
|
||||||
color: #999;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.popup-body.data-v-847f15e8 {
|
|
||||||
padding: 30rpx;
|
|
||||||
}
|
|
||||||
.popup-footer.data-v-847f15e8 {
|
|
||||||
display: flex;
|
|
||||||
padding: 20rpx 30rpx 30rpx;
|
|
||||||
}
|
|
||||||
.popup-footer button.data-v-847f15e8 {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
font-size: 30rpx;
|
|
||||||
margin: 0 10rpx;
|
|
||||||
}
|
|
||||||
.popup-footer button.data-v-847f15e8::after {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
.popup-footer .btn-cancel.data-v-847f15e8 {
|
|
||||||
background: #f5f5f5;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.popup-footer .btn-confirm.data-v-847f15e8 {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.color-preview.data-v-847f15e8 {
|
|
||||||
width: 80rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
.color-grid.data-v-847f15e8 {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 16rpx;
|
|
||||||
}
|
|
||||||
.color-item.data-v-847f15e8 {
|
|
||||||
width: 70rpx;
|
|
||||||
height: 70rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: transform 0.2s;
|
|
||||||
}
|
|
||||||
.color-item.data-v-847f15e8:active {
|
|
||||||
transform: scale(0.9);
|
|
||||||
}
|
|
||||||
.color-dot.data-v-847f15e8 {
|
|
||||||
width: 30rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const request_api = require("../../request/api.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "checklist",
|
|
||||||
setup(__props) {
|
|
||||||
common_vendor.useRouter();
|
|
||||||
const list = common_vendor.ref([]);
|
|
||||||
const edit = () => {
|
|
||||||
common_vendor.index.navigateTo({
|
|
||||||
url: "/pages/editchecklist/editchecklist"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
common_vendor.onLoad(() => {
|
|
||||||
request_api.getCheckTableList().then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
list.value = res.data.records;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.f(list.value, (item, k0, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.name),
|
|
||||||
b: common_vendor.o(($event) => edit(), item.id),
|
|
||||||
c: item.id
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
b: common_vendor.o(($event) => edit())
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4d00090a"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "检查表",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['page', 'padding', 'data-v-4d00090a', virtualHostClass]}}" style="{{virtualHostStyle}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="c" class="padding bg-white radius flex justify-between margin-bottom data-v-4d00090a"><view class="data-v-4d00090a">{{item.a}}</view><view class="data-v-4d00090a"><button class="bg-blue cu-btn margin-right-xs data-v-4d00090a" bindtap="{{item.b}}">编辑</button><button class="bg-red cu-btn data-v-4d00090a">删除</button></view></view><button class="lg cuIcon-add bg-blue round margin-top-xl data-v-4d00090a" bindtap="{{b}}">新增检查表</button></view>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-4d00090a {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
@@ -1,211 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const request_api = require("../../request/api.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
|
|
||||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
|
||||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
||||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
|
||||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
|
||||||
(_easycom_up_picker2 + _easycom_up_datetime_picker2 + _easycom_up_input2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
|
|
||||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
|
||||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
||||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
|
||||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_picker + _easycom_up_datetime_picker + _easycom_up_input + _easycom_up_textarea + _easycom_u_popup)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "application",
|
|
||||||
setup(__props) {
|
|
||||||
const showAddPopup = common_vendor.ref(false);
|
|
||||||
const showHazardPicker = common_vendor.ref(false);
|
|
||||||
const showDatePicker = common_vendor.ref(false);
|
|
||||||
const selectedHazard = common_vendor.ref("");
|
|
||||||
const selectedHazardId = common_vendor.ref("");
|
|
||||||
const hazardColumns = common_vendor.ref([["暂无数据"]]);
|
|
||||||
const hazardList = common_vendor.ref([]);
|
|
||||||
const dateValue = common_vendor.ref(Date.now());
|
|
||||||
const formData = common_vendor.reactive({
|
|
||||||
rectifyDeadline: "",
|
|
||||||
// 整改时限
|
|
||||||
responsibleDeptName: "",
|
|
||||||
// 隐患治理责任单位
|
|
||||||
responsiblePerson: "",
|
|
||||||
// 主要负责人
|
|
||||||
mainTreatmentContent: "",
|
|
||||||
// 主要治理内容
|
|
||||||
treatmentResult: "",
|
|
||||||
// 隐患治理完成内容
|
|
||||||
selfVerifyContent: ""
|
|
||||||
// 责任单位自行验收情况
|
|
||||||
});
|
|
||||||
const fetchHazardList = async () => {
|
|
||||||
try {
|
|
||||||
const res = await request_api.getMyWriteOffList();
|
|
||||||
if (res.code === 0 && res.data) {
|
|
||||||
const list = res.data;
|
|
||||||
hazardList.value = list;
|
|
||||||
if (list.length > 0) {
|
|
||||||
hazardColumns.value = [list.map((item) => item.hazardTitle || `隐患${item.hazardId}`)];
|
|
||||||
}
|
|
||||||
console.log("隐患列表:", list);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("获取隐患列表失败:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const onHazardConfirm = (e) => {
|
|
||||||
console.log("选择的隐患:", e);
|
|
||||||
if (e.value && e.value.length > 0) {
|
|
||||||
selectedHazard.value = e.value[0];
|
|
||||||
const index = e.indexs[0];
|
|
||||||
if (hazardList.value[index]) {
|
|
||||||
selectedHazardId.value = hazardList.value[index].hazardId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
showHazardPicker.value = false;
|
|
||||||
};
|
|
||||||
const onDateConfirm = (e) => {
|
|
||||||
console.log("选择的日期时间:", e);
|
|
||||||
const date = new Date(e.value);
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
||||||
const day = String(date.getDate()).padStart(2, "0");
|
|
||||||
const hours = String(date.getHours()).padStart(2, "0");
|
|
||||||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
||||||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
||||||
formData.rectifyDeadline = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
||||||
showDatePicker.value = false;
|
|
||||||
};
|
|
||||||
const resetForm = () => {
|
|
||||||
selectedHazard.value = "";
|
|
||||||
selectedHazardId.value = "";
|
|
||||||
formData.rectifyDeadline = "";
|
|
||||||
formData.responsibleDeptName = "";
|
|
||||||
formData.responsiblePerson = "";
|
|
||||||
formData.mainTreatmentContent = "";
|
|
||||||
formData.treatmentResult = "";
|
|
||||||
formData.selfVerifyContent = "";
|
|
||||||
};
|
|
||||||
const handleAdd = async () => {
|
|
||||||
if (!selectedHazardId.value) {
|
|
||||||
common_vendor.index.showToast({ title: "请选择隐患", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const params = {
|
|
||||||
hazardId: Number(selectedHazardId.value),
|
|
||||||
// 隐患ID(必需)
|
|
||||||
rectifyDeadline: formData.rectifyDeadline || "",
|
|
||||||
// 整改时限
|
|
||||||
responsiblePerson: formData.responsiblePerson || "",
|
|
||||||
// 主要负责人
|
|
||||||
mainTreatmentContent: formData.mainTreatmentContent || "",
|
|
||||||
// 主要治理内容
|
|
||||||
treatmentResult: formData.treatmentResult || "",
|
|
||||||
// 隐患治理完成内容
|
|
||||||
selfVerifyContent: formData.selfVerifyContent || ""
|
|
||||||
// 责任单位自行验收情况
|
|
||||||
};
|
|
||||||
console.log("提交数据:", params);
|
|
||||||
try {
|
|
||||||
const res = await request_api.applyDelete(params);
|
|
||||||
if (res.code === 0) {
|
|
||||||
common_vendor.index.showToast({ title: "申请成功", icon: "success" });
|
|
||||||
showAddPopup.value = false;
|
|
||||||
resetForm();
|
|
||||||
} else {
|
|
||||||
common_vendor.index.showToast({ title: res.msg || "申请失败", icon: "none" });
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("申请失败:", error);
|
|
||||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const editor = () => {
|
|
||||||
common_vendor.index.navigateTo({
|
|
||||||
url: "/pages/closeout/editor"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
fetchHazardList();
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.f(hazardList.value, (item, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.hazardTitle),
|
|
||||||
b: common_vendor.t(item.statusName),
|
|
||||||
c: common_vendor.t(item.hazardCreatedAt),
|
|
||||||
d: common_vendor.t(item.responsibleDeptName),
|
|
||||||
e: common_vendor.t(item.responsiblePerson),
|
|
||||||
f: common_vendor.t(item.createdAt),
|
|
||||||
g: common_vendor.o(($event) => editor(), index),
|
|
||||||
h: index
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
b: common_vendor.o(($event) => showAddPopup.value = true),
|
|
||||||
c: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
d: common_vendor.t(selectedHazard.value || "请选择隐患"),
|
|
||||||
e: common_vendor.n(selectedHazard.value ? "" : "text-gray"),
|
|
||||||
f: common_vendor.o(($event) => showHazardPicker.value = true),
|
|
||||||
g: common_vendor.o(onHazardConfirm),
|
|
||||||
h: common_vendor.o(($event) => showHazardPicker.value = false),
|
|
||||||
i: common_vendor.o(($event) => showHazardPicker.value = false),
|
|
||||||
j: common_vendor.p({
|
|
||||||
show: showHazardPicker.value,
|
|
||||||
columns: hazardColumns.value
|
|
||||||
}),
|
|
||||||
k: common_vendor.t(formData.rectifyDeadline || "请选择整改时限"),
|
|
||||||
l: common_vendor.n(formData.rectifyDeadline ? "" : "text-gray"),
|
|
||||||
m: common_vendor.o(($event) => showDatePicker.value = true),
|
|
||||||
n: common_vendor.o(onDateConfirm),
|
|
||||||
o: common_vendor.o(($event) => showDatePicker.value = false),
|
|
||||||
p: common_vendor.o(($event) => showDatePicker.value = false),
|
|
||||||
q: common_vendor.o(($event) => dateValue.value = $event),
|
|
||||||
r: common_vendor.p({
|
|
||||||
show: showDatePicker.value,
|
|
||||||
mode: "datetime",
|
|
||||||
modelValue: dateValue.value
|
|
||||||
}),
|
|
||||||
s: common_vendor.o(($event) => formData.responsibleDeptName = $event),
|
|
||||||
t: common_vendor.p({
|
|
||||||
placeholder: "请输入隐患治理责任单位",
|
|
||||||
modelValue: formData.responsibleDeptName
|
|
||||||
}),
|
|
||||||
v: common_vendor.o(($event) => formData.responsiblePerson = $event),
|
|
||||||
w: common_vendor.p({
|
|
||||||
placeholder: "请输入主要负责人",
|
|
||||||
modelValue: formData.responsiblePerson
|
|
||||||
}),
|
|
||||||
x: common_vendor.o(($event) => formData.mainTreatmentContent = $event),
|
|
||||||
y: common_vendor.p({
|
|
||||||
placeholder: "请输入主要治理内容",
|
|
||||||
modelValue: formData.mainTreatmentContent
|
|
||||||
}),
|
|
||||||
z: common_vendor.o(($event) => formData.treatmentResult = $event),
|
|
||||||
A: common_vendor.p({
|
|
||||||
placeholder: "请输入隐患治理完成情况",
|
|
||||||
modelValue: formData.treatmentResult
|
|
||||||
}),
|
|
||||||
B: common_vendor.o(($event) => formData.selfVerifyContent = $event),
|
|
||||||
C: common_vendor.p({
|
|
||||||
placeholder: "请输入隐患治理责任单位自行验收的情况",
|
|
||||||
modelValue: formData.selfVerifyContent
|
|
||||||
}),
|
|
||||||
D: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
E: common_vendor.o(handleAdd),
|
|
||||||
F: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
G: common_vendor.p({
|
|
||||||
show: showAddPopup.value,
|
|
||||||
mode: "center",
|
|
||||||
round: "20"
|
|
||||||
})
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4b6250eb"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "销号申请",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
|
|
||||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
|
||||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
|
||||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
|
||||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['padding', 'page', 'data-v-4b6250eb', virtualHostClass]}}" style="{{virtualHostStyle}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="h" class="padding bg-white radius margin-bottom data-v-4b6250eb"><view class="flex justify-between margin-bottom data-v-4b6250eb"><view class="text-bold text-black data-v-4b6250eb">{{item.a}}</view><view class="data-v-4b6250eb">{{item.b}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">隐患日期:</view><view class="text-black data-v-4b6250eb">{{item.c}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">责任单位:</view><view class="text-black data-v-4b6250eb">{{item.d}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">判定人员:</view><view class="text-black data-v-4b6250eb">{{item.e}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">创建时间:</view><view class="text-black data-v-4b6250eb">{{item.f}}</view></view><view class="flex justify-between data-v-4b6250eb"><view class="data-v-4b6250eb"></view><view class="data-v-4b6250eb"><button class="bg-blue round cu-btn lg data-v-4b6250eb" bindtap="{{item.g}}">查看详情</button></view></view></view><button class="cuIcon-add bg-blue round margin-top data-v-4b6250eb" bindtap="{{b}}">新增</button><u-popup wx:if="{{G}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-s="{{['d']}}" bindclose="{{F}}" u-i="4b6250eb-0" bind:__l="__l" u-p="{{G}}"><view class="popup-content data-v-4b6250eb"><view class="popup-header data-v-4b6250eb"><view class="popup-title text-bold data-v-4b6250eb">新增销号申请</view><view class="popup-close data-v-4b6250eb" bindtap="{{c}}">×</view></view><view class="popup-body data-v-4b6250eb"><view class="flex margin-bottom data-v-4b6250eb"><view class="data-v-4b6250eb">隐患</view><view class="text-red data-v-4b6250eb">*</view></view><view class="picker-input data-v-4b6250eb" bindtap="{{f}}"><text class="{{['data-v-4b6250eb', e]}}">{{d}}</text></view><up-picker wx:if="{{j}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" bindconfirm="{{g}}" bindcancel="{{h}}" bindclose="{{i}}" u-i="4b6250eb-1,4b6250eb-0" bind:__l="__l" u-p="{{j}}"></up-picker><view class="flex margin-bottom margin-top data-v-4b6250eb"><view class="data-v-4b6250eb">整改时限</view></view><view class="picker-input data-v-4b6250eb" bindtap="{{m}}"><text class="{{['data-v-4b6250eb', l]}}">{{k}}</text></view><up-datetime-picker wx:if="{{r}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" bindconfirm="{{n}}" bindcancel="{{o}}" bindclose="{{p}}" u-i="4b6250eb-2,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{q}}" u-p="{{r}}"></up-datetime-picker><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位</view><up-input wx:if="{{t}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-3,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{s}}" u-p="{{t}}"></up-input><view class="margin-bottom margin-top data-v-4b6250eb">主要负责人</view><up-input wx:if="{{w}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-4,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{v}}" u-p="{{w}}"></up-input><view class="margin-bottom margin-top data-v-4b6250eb">主要治理内容</view><up-textarea wx:if="{{y}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-5,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{x}}" u-p="{{y}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理完成内容</view><up-textarea wx:if="{{A}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-6,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{z}}" u-p="{{A}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位自行验收的情况</view><up-textarea wx:if="{{C}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-7,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{B}}" u-p="{{C}}"></up-textarea></view><view class="popup-footer data-v-4b6250eb"><button class="btn-cancel data-v-4b6250eb" bindtap="{{D}}">取消</button><button class="btn-confirm bg-blue data-v-4b6250eb" bindtap="{{E}}">确定</button></view></view></u-popup></view>
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-4b6250eb {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.popup-content.data-v-4b6250eb {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.popup-header.data-v-4b6250eb {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 30rpx;
|
|
||||||
border-bottom: 1rpx solid #eee;
|
|
||||||
}
|
|
||||||
.popup-header .popup-title.data-v-4b6250eb {
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.popup-header .popup-close.data-v-4b6250eb {
|
|
||||||
font-size: 40rpx;
|
|
||||||
color: #999;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
.popup-body.data-v-4b6250eb {
|
|
||||||
padding: 30rpx;
|
|
||||||
max-height: 800rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.popup-footer.data-v-4b6250eb {
|
|
||||||
display: flex;
|
|
||||||
border-top: 1rpx solid #eee;
|
|
||||||
}
|
|
||||||
.popup-footer button.data-v-4b6250eb {
|
|
||||||
flex: 1;
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
border-radius: 0;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.popup-footer button.data-v-4b6250eb::after {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
.popup-footer .btn-cancel.data-v-4b6250eb {
|
|
||||||
background: #fff;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.popup-footer .btn-confirm.data-v-4b6250eb {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.picker-input.data-v-4b6250eb {
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
padding: 24rpx 20rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
border: 1rpx solid #eee;
|
|
||||||
}
|
|
||||||
.picker-input text.data-v-4b6250eb {
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const request_api = require("../../request/api.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
||||||
_easycom_up_input2();
|
|
||||||
}
|
|
||||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
||||||
if (!Math) {
|
|
||||||
_easycom_up_input();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "editor",
|
|
||||||
setup(__props) {
|
|
||||||
const getPageOptions = () => {
|
|
||||||
const pages = getCurrentPages();
|
|
||||||
const currentPage = pages[pages.length - 1];
|
|
||||||
return (currentPage == null ? void 0 : currentPage.options) || {};
|
|
||||||
};
|
|
||||||
const pageId = common_vendor.ref("");
|
|
||||||
const canEdit = common_vendor.ref(false);
|
|
||||||
const formData = common_vendor.reactive({
|
|
||||||
id: "",
|
|
||||||
hazardId: "",
|
|
||||||
hazardTitle: "",
|
|
||||||
// 隐患标题
|
|
||||||
hazardCreatedAt: "",
|
|
||||||
// 隐患日期
|
|
||||||
responsibleDeptName: "",
|
|
||||||
// 隐患治理责任单位
|
|
||||||
responsiblePerson: "",
|
|
||||||
// 主要负责人
|
|
||||||
createdAt: "",
|
|
||||||
// 创建时间
|
|
||||||
statusName: ""
|
|
||||||
// 状态
|
|
||||||
});
|
|
||||||
const fetchDetail = async (id) => {
|
|
||||||
console.log("=== fetchDetail 被调用 ===, id:", id);
|
|
||||||
try {
|
|
||||||
const res = await request_api.getMyWriteOffList();
|
|
||||||
console.log("接口返回:", res);
|
|
||||||
if (res.code === 0 && res.data && res.data.length > 0) {
|
|
||||||
const list = res.data;
|
|
||||||
let data = null;
|
|
||||||
if (id) {
|
|
||||||
data = list.find((item) => item.id == id);
|
|
||||||
}
|
|
||||||
if (!data) {
|
|
||||||
data = list[0];
|
|
||||||
}
|
|
||||||
console.log("绑定数据:", data);
|
|
||||||
formData.id = data.id;
|
|
||||||
formData.hazardId = data.hazardId;
|
|
||||||
formData.hazardTitle = data.hazardTitle || "";
|
|
||||||
formData.hazardCreatedAt = data.hazardCreatedAt || "";
|
|
||||||
formData.responsibleDeptName = data.responsibleDeptName || "";
|
|
||||||
formData.responsiblePerson = data.responsiblePerson || "";
|
|
||||||
formData.createdAt = data.createdAt || "";
|
|
||||||
formData.statusName = data.statusName || "";
|
|
||||||
if (data.status == 1 || data.statusName === "待审核") {
|
|
||||||
canEdit.value = true;
|
|
||||||
console.log("状态为待审核,可以编辑");
|
|
||||||
} else {
|
|
||||||
canEdit.value = false;
|
|
||||||
console.log("状态为已审核,不可编辑");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("获取详情失败:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const handleCancel = () => {
|
|
||||||
common_vendor.index.navigateBack();
|
|
||||||
};
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
console.log("保存数据:", formData);
|
|
||||||
common_vendor.index.showToast({ title: "保存成功", icon: "success" });
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.navigateBack();
|
|
||||||
}, 1500);
|
|
||||||
};
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
console.log("=== onLoad 触发 ===");
|
|
||||||
console.log("options:", options);
|
|
||||||
pageId.value = (options == null ? void 0 : options.id) || "";
|
|
||||||
fetchDetail(pageId.value);
|
|
||||||
});
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
console.log("=== onMounted 触发 ===");
|
|
||||||
if (!pageId.value) {
|
|
||||||
const options = getPageOptions();
|
|
||||||
console.log("备用获取参数:", options);
|
|
||||||
pageId.value = (options == null ? void 0 : options.id) || "";
|
|
||||||
fetchDetail(pageId.value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.o(($event) => formData.hazardTitle = $event),
|
|
||||||
b: common_vendor.p({
|
|
||||||
placeholder: "",
|
|
||||||
disabled: true,
|
|
||||||
modelValue: formData.hazardTitle
|
|
||||||
}),
|
|
||||||
c: common_vendor.o(($event) => formData.hazardCreatedAt = $event),
|
|
||||||
d: common_vendor.p({
|
|
||||||
placeholder: "",
|
|
||||||
disabled: true,
|
|
||||||
modelValue: formData.hazardCreatedAt
|
|
||||||
}),
|
|
||||||
e: common_vendor.o(($event) => formData.responsibleDeptName = $event),
|
|
||||||
f: common_vendor.p({
|
|
||||||
placeholder: "请输入",
|
|
||||||
disabled: !canEdit.value,
|
|
||||||
modelValue: formData.responsibleDeptName
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(($event) => formData.responsiblePerson = $event),
|
|
||||||
h: common_vendor.p({
|
|
||||||
placeholder: "请输入",
|
|
||||||
disabled: !canEdit.value,
|
|
||||||
modelValue: formData.responsiblePerson
|
|
||||||
}),
|
|
||||||
i: common_vendor.o(($event) => formData.createdAt = $event),
|
|
||||||
j: common_vendor.p({
|
|
||||||
placeholder: "",
|
|
||||||
disabled: true,
|
|
||||||
modelValue: formData.createdAt
|
|
||||||
}),
|
|
||||||
k: common_vendor.o(($event) => formData.statusName = $event),
|
|
||||||
l: common_vendor.p({
|
|
||||||
placeholder: "",
|
|
||||||
disabled: true,
|
|
||||||
modelValue: formData.statusName
|
|
||||||
}),
|
|
||||||
m: common_vendor.o(handleCancel),
|
|
||||||
n: canEdit.value
|
|
||||||
}, canEdit.value ? {
|
|
||||||
o: common_vendor.o(handleSubmit)
|
|
||||||
} : {});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-bbd4165b"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "编辑销号申请",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['padding', 'page', 'data-v-bbd4165b', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-bbd4165b"><view class="flex margin-bottom data-v-bbd4165b"><view class="text-gray data-v-bbd4165b">隐患</view></view><up-input wx:if="{{b}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">隐患日期</view><up-input wx:if="{{d}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">隐患治理责任单位</view><up-input wx:if="{{f}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-2" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">主要负责人</view><up-input wx:if="{{h}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-3" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">创建时间</view><up-input wx:if="{{j}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-4" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">状态</view><up-input wx:if="{{l}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-5" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"></up-input><view class="flex justify-center margin-top-xl data-v-bbd4165b" style="gap:30rpx"><button class="round cu-btn lg data-v-bbd4165b" bindtap="{{m}}">返回</button><button wx:if="{{n}}" class="bg-blue round cu-btn lg data-v-bbd4165b" bindtap="{{o}}">保存</button></view></view></view>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-bbd4165b {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "corporateInformation",
|
|
||||||
setup(__props) {
|
|
||||||
const edit = () => {
|
|
||||||
common_vendor.index.navigateTo({
|
|
||||||
url: "/pages/editcompanInformation/editcompanInformation"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.o(($event) => edit())
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0d880083"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "企业信息",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['page', 'padding', 'data-v-0d880083', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius list data-v-0d880083"><view class="flex justify-between data-v-0d880083"><view class="text-bold data-v-0d880083">湘西自治州和谐网络科技有限公司</view><view class="lg text-blue cuIcon-edit over data-v-0d880083" bindtap="{{a}}">编辑</view></view><view class="flex margin-top data-v-0d880083"><view class="text-gray data-v-0d880083">所属部门:</view><view class="data-v-0d880083">湘西自治州和谐网络科技有限公司</view></view><view class="flex margin-top data-v-0d880083"><view class="text-gray data-v-0d880083">企业代码:</view><view class="data-v-0d880083">91433126MA4P8WWG20</view></view><view class="flex margin-top data-v-0d880083"><view class="text-gray data-v-0d880083">联系电话:</view><view class="data-v-0d880083">13974356210</view></view><view class="flex margin-top data-v-0d880083"><view class="text-gray data-v-0d880083">企业地址:</view><view class="data-v-0d880083">湘西州文学艺术界联合会6楼</view></view></view></view>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-0d880083 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.list.data-v-0d880083 {
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
|
||||||
border-left: 5px solid #2667E9;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
@@ -1,274 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
require("../../request/request.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
||||||
const _easycom_up_select2 = common_vendor.resolveComponent("up-select");
|
|
||||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
|
||||||
const _easycom_up_switch2 = common_vendor.resolveComponent("up-switch");
|
|
||||||
const _easycom_up_calendar2 = common_vendor.resolveComponent("up-calendar");
|
|
||||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
|
||||||
(_easycom_up_input2 + _easycom_up_select2 + _easycom_up_textarea2 + _easycom_up_switch2 + _easycom_up_calendar2 + _easycom_u_popup2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
||||||
const _easycom_up_select = () => "../../uni_modules/uview-plus/components/u-select/u-select.js";
|
|
||||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
|
||||||
const _easycom_up_switch = () => "../../uni_modules/uview-plus/components/u-switch/u-switch.js";
|
|
||||||
const _easycom_up_calendar = () => "../../uni_modules/uview-plus/components/u-calendar/u-calendar.js";
|
|
||||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_input + _easycom_up_select + _easycom_up_textarea + _easycom_up_switch + _easycom_up_calendar + _easycom_u_popup)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "editchecklist",
|
|
||||||
setup(__props) {
|
|
||||||
const cateId = common_vendor.ref("");
|
|
||||||
const cateList = common_vendor.ref([
|
|
||||||
{
|
|
||||||
id: "1",
|
|
||||||
name: "湘西自治州和谐网络科技有限公司"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "2",
|
|
||||||
name: "湘西自治州和谐云大数据科技有限公司"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "3",
|
|
||||||
name: "湘西网络有限公司"
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
const selectItem = (item) => {
|
|
||||||
console.log(item);
|
|
||||||
};
|
|
||||||
const value = common_vendor.ref(false);
|
|
||||||
const show = common_vendor.ref(false);
|
|
||||||
const mode = common_vendor.ref("single");
|
|
||||||
const confirm = (e) => {
|
|
||||||
console.log(e);
|
|
||||||
};
|
|
||||||
const showAddPopup = common_vendor.ref(false);
|
|
||||||
const checkForm = common_vendor.reactive({
|
|
||||||
projectName: "",
|
|
||||||
checkContent: "",
|
|
||||||
law: "",
|
|
||||||
image: ""
|
|
||||||
});
|
|
||||||
const showLawPopup = common_vendor.ref(false);
|
|
||||||
const lawKeyword = common_vendor.ref("");
|
|
||||||
const selectedLaw = common_vendor.ref("");
|
|
||||||
const lawList = common_vendor.ref([
|
|
||||||
"中华人民共和国安全生产法 第三十二条",
|
|
||||||
'建设项目安全设施"三同时"监督管理办法 第二十条',
|
|
||||||
"中华人民共和国职业病防治法 第十七条",
|
|
||||||
"中华人民共和国职业病防治法 第十八条",
|
|
||||||
"中华人民共和国消防法(2021版)第十一条",
|
|
||||||
"建设工程消防监督管理规定 第二十条"
|
|
||||||
]);
|
|
||||||
const filteredLawList = common_vendor.computed(() => {
|
|
||||||
if (!lawKeyword.value)
|
|
||||||
return lawList.value;
|
|
||||||
return lawList.value.filter((item) => item.includes(lawKeyword.value));
|
|
||||||
});
|
|
||||||
const loadMoreLaw = () => {
|
|
||||||
common_vendor.index.showToast({ title: "加载更多...", icon: "none" });
|
|
||||||
};
|
|
||||||
const confirmLaw = () => {
|
|
||||||
if (selectedLaw.value) {
|
|
||||||
checkForm.law = selectedLaw.value;
|
|
||||||
}
|
|
||||||
showLawPopup.value = false;
|
|
||||||
};
|
|
||||||
const showLibraryPopup = common_vendor.ref(false);
|
|
||||||
const libraryKeyword = common_vendor.ref("");
|
|
||||||
const selectedLibraries = common_vendor.ref([]);
|
|
||||||
const libraryList = common_vendor.ref([
|
|
||||||
{ id: 1, name: '安全生产隐患"常见病"检查诊断表(个性部分)公路养护工程', count: 18 },
|
|
||||||
{ id: 2, name: '安全生产隐患"常见病"检查诊断表(个性部分)出租汽车企业', count: 12 },
|
|
||||||
{ id: 3, name: '安全生产隐患"常见病"检查诊断表(个性部分)城镇燃气', count: 12 }
|
|
||||||
]);
|
|
||||||
const filteredLibraryList = common_vendor.computed(() => {
|
|
||||||
if (!libraryKeyword.value)
|
|
||||||
return libraryList.value;
|
|
||||||
return libraryList.value.filter((item) => item.name.includes(libraryKeyword.value));
|
|
||||||
});
|
|
||||||
const toggleLibrarySelect = (item) => {
|
|
||||||
const index = selectedLibraries.value.indexOf(item.id);
|
|
||||||
if (index > -1) {
|
|
||||||
selectedLibraries.value.splice(index, 1);
|
|
||||||
} else {
|
|
||||||
selectedLibraries.value.push(item.id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const addSelectedLibrary = () => {
|
|
||||||
if (selectedLibraries.value.length === 0) {
|
|
||||||
common_vendor.index.showToast({ title: "请选择检查库", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log("添加检查库:", selectedLibraries.value);
|
|
||||||
common_vendor.index.showToast({ title: "添加成功", icon: "success" });
|
|
||||||
showLibraryPopup.value = false;
|
|
||||||
selectedLibraries.value = [];
|
|
||||||
};
|
|
||||||
const chooseImage = () => {
|
|
||||||
common_vendor.index.chooseImage({
|
|
||||||
count: 1,
|
|
||||||
sizeType: ["compressed"],
|
|
||||||
sourceType: ["album", "camera"],
|
|
||||||
success: (res) => {
|
|
||||||
checkForm.image = res.tempFilePaths[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const handleAddCheck = () => {
|
|
||||||
if (!checkForm.projectName) {
|
|
||||||
common_vendor.index.showToast({ title: "请输入项目名称", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!checkForm.checkContent) {
|
|
||||||
common_vendor.index.showToast({ title: "请输入检查内容", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log("提交检查项:", checkForm);
|
|
||||||
common_vendor.index.showToast({ title: "添加成功", icon: "success" });
|
|
||||||
showAddPopup.value = false;
|
|
||||||
checkForm.projectName = "";
|
|
||||||
checkForm.checkContent = "";
|
|
||||||
checkForm.law = "";
|
|
||||||
checkForm.image = "";
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.p({
|
|
||||||
placeholder: "请输入检查表名称",
|
|
||||||
border: "surround"
|
|
||||||
}),
|
|
||||||
b: common_vendor.o(selectItem),
|
|
||||||
c: common_vendor.o(($event) => cateId.value = $event),
|
|
||||||
d: common_vendor.p({
|
|
||||||
placeholder: "请选择分派单位",
|
|
||||||
label: "湘西自治州和谐网络科技有限公司",
|
|
||||||
options: cateList.value,
|
|
||||||
current: cateId.value
|
|
||||||
}),
|
|
||||||
e: common_vendor.o(($event) => _ctx.value1 = $event),
|
|
||||||
f: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
modelValue: _ctx.value1
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(selectItem),
|
|
||||||
h: common_vendor.o(($event) => cateId.value = $event),
|
|
||||||
i: common_vendor.p({
|
|
||||||
placeholder: "请选择分派单位",
|
|
||||||
label: "全员",
|
|
||||||
options: cateList.value,
|
|
||||||
current: cateId.value
|
|
||||||
}),
|
|
||||||
j: common_vendor.o(selectItem),
|
|
||||||
k: common_vendor.o(($event) => cateId.value = $event),
|
|
||||||
l: common_vendor.p({
|
|
||||||
placeholder: "请选择分派单位",
|
|
||||||
label: "选择部门",
|
|
||||||
options: cateList.value,
|
|
||||||
current: cateId.value
|
|
||||||
}),
|
|
||||||
m: common_vendor.o(selectItem),
|
|
||||||
n: common_vendor.o(($event) => cateId.value = $event),
|
|
||||||
o: common_vendor.p({
|
|
||||||
placeholder: "请选择分派单位",
|
|
||||||
label: "每天一次",
|
|
||||||
options: cateList.value,
|
|
||||||
current: cateId.value
|
|
||||||
}),
|
|
||||||
p: common_vendor.o(_ctx.change),
|
|
||||||
q: common_vendor.o(($event) => value.value = $event),
|
|
||||||
r: common_vendor.p({
|
|
||||||
activeColor: "#07C160 ",
|
|
||||||
modelValue: value.value
|
|
||||||
}),
|
|
||||||
s: common_vendor.o(_ctx.change),
|
|
||||||
t: common_vendor.o(($event) => value.value = $event),
|
|
||||||
v: common_vendor.p({
|
|
||||||
activeColor: "#07C160 ",
|
|
||||||
modelValue: value.value
|
|
||||||
}),
|
|
||||||
w: common_vendor.o(($event) => show.value = true),
|
|
||||||
x: common_vendor.o(confirm),
|
|
||||||
y: common_vendor.p({
|
|
||||||
show: show.value,
|
|
||||||
mode: mode.value
|
|
||||||
}),
|
|
||||||
z: common_vendor.o(($event) => show.value = true),
|
|
||||||
A: common_vendor.o(confirm),
|
|
||||||
B: common_vendor.p({
|
|
||||||
show: show.value,
|
|
||||||
mode: mode.value
|
|
||||||
}),
|
|
||||||
C: common_vendor.o(($event) => showAddPopup.value = true),
|
|
||||||
D: common_vendor.o(($event) => showLibraryPopup.value = true),
|
|
||||||
E: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
F: checkForm.projectName,
|
|
||||||
G: common_vendor.o(($event) => checkForm.projectName = $event.detail.value),
|
|
||||||
H: checkForm.checkContent,
|
|
||||||
I: common_vendor.o(($event) => checkForm.checkContent = $event.detail.value),
|
|
||||||
J: common_vendor.t(checkForm.law || "选择法规"),
|
|
||||||
K: common_vendor.o(($event) => showLawPopup.value = true),
|
|
||||||
L: !checkForm.image
|
|
||||||
}, !checkForm.image ? {} : {
|
|
||||||
M: checkForm.image
|
|
||||||
}, {
|
|
||||||
N: common_vendor.o(chooseImage),
|
|
||||||
O: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
P: common_vendor.o(handleAddCheck),
|
|
||||||
Q: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
R: common_vendor.p({
|
|
||||||
show: showAddPopup.value,
|
|
||||||
mode: "center",
|
|
||||||
round: "20"
|
|
||||||
}),
|
|
||||||
S: common_vendor.o(($event) => showLawPopup.value = false),
|
|
||||||
T: lawKeyword.value,
|
|
||||||
U: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
|
|
||||||
V: common_vendor.f(filteredLawList.value, (item, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item),
|
|
||||||
b: selectedLaw.value === item ? 1 : "",
|
|
||||||
c: index,
|
|
||||||
d: common_vendor.o(($event) => selectedLaw.value = item, index)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
W: common_vendor.o(loadMoreLaw),
|
|
||||||
X: common_vendor.o(($event) => showLawPopup.value = false),
|
|
||||||
Y: common_vendor.o(confirmLaw),
|
|
||||||
Z: common_vendor.o(($event) => showLawPopup.value = false),
|
|
||||||
aa: common_vendor.p({
|
|
||||||
show: showLawPopup.value,
|
|
||||||
mode: "center",
|
|
||||||
round: "20"
|
|
||||||
}),
|
|
||||||
ab: common_vendor.o(($event) => showLibraryPopup.value = false),
|
|
||||||
ac: libraryKeyword.value,
|
|
||||||
ad: common_vendor.o(($event) => libraryKeyword.value = $event.detail.value),
|
|
||||||
ae: common_vendor.f(filteredLibraryList.value, (item, index, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: selectedLibraries.value.includes(item.id)
|
|
||||||
}, selectedLibraries.value.includes(item.id) ? {} : {}, {
|
|
||||||
b: selectedLibraries.value.includes(item.id) ? 1 : "",
|
|
||||||
c: common_vendor.t(item.name),
|
|
||||||
d: common_vendor.t(item.count),
|
|
||||||
e: index,
|
|
||||||
f: common_vendor.o(($event) => toggleLibrarySelect(item), index)
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
af: common_vendor.o(addSelectedLibrary),
|
|
||||||
ag: common_vendor.o(($event) => showLibraryPopup.value = false),
|
|
||||||
ah: common_vendor.p({
|
|
||||||
show: showLibraryPopup.value,
|
|
||||||
mode: "center",
|
|
||||||
round: "20"
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-98282eb3"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "编辑检查表",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
|
||||||
"up-select": "../../uni_modules/uview-plus/components/u-select/u-select",
|
|
||||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
|
||||||
"up-switch": "../../uni_modules/uview-plus/components/u-switch/u-switch",
|
|
||||||
"up-calendar": "../../uni_modules/uview-plus/components/u-calendar/u-calendar",
|
|
||||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,257 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-98282eb3 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.btn-right.data-v-98282eb3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
.but.data-v-98282eb3 {
|
|
||||||
width: 304rpx;
|
|
||||||
height: 72rpx;
|
|
||||||
border-radius: 6rpx 6rpx 6rpx 6rpx;
|
|
||||||
border: 2rpx solid #108FFF;
|
|
||||||
color: #108FFF;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 72rpx;
|
|
||||||
}
|
|
||||||
.popup-content.data-v-98282eb3 {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
}
|
|
||||||
.popup-header.data-v-98282eb3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
.popup-title.data-v-98282eb3 {
|
|
||||||
font-size: 34rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.popup-close.data-v-98282eb3 {
|
|
||||||
font-size: 48rpx;
|
|
||||||
color: #999;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
.popup-body.data-v-98282eb3 {
|
|
||||||
max-height: 700rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.form-item.data-v-98282eb3 {
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
}
|
|
||||||
.form-label.data-v-98282eb3 {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 12rpx;
|
|
||||||
}
|
|
||||||
.form-input.data-v-98282eb3 {
|
|
||||||
width: 100%;
|
|
||||||
height: 80rpx;
|
|
||||||
border: 2rpx solid #E5E5E5;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
padding: 0 24rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.form-btn.data-v-98282eb3 {
|
|
||||||
width: 100%;
|
|
||||||
height: 80rpx;
|
|
||||||
border: 2rpx solid #E5E5E5;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
.upload-box.data-v-98282eb3 {
|
|
||||||
width: 160rpx;
|
|
||||||
height: 160rpx;
|
|
||||||
border: 2rpx dashed #ccc;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.upload-add.data-v-98282eb3 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.upload-icon.data-v-98282eb3 {
|
|
||||||
font-size: 48rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.upload-text.data-v-98282eb3 {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-top: 8rpx;
|
|
||||||
}
|
|
||||||
.upload-img.data-v-98282eb3 {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
}
|
|
||||||
.popup-footer.data-v-98282eb3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 30rpx;
|
|
||||||
margin-top: 40rpx;
|
|
||||||
}
|
|
||||||
.btn-cancel.data-v-98282eb3 {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border: 2rpx solid #E5E5E5;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
background: #fff;
|
|
||||||
color: #333;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.btn-confirm.data-v-98282eb3 {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.law-popup.data-v-98282eb3 {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
max-height: 80vh;
|
|
||||||
}
|
|
||||||
.search-box.data-v-98282eb3 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #F5F5F5;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
padding: 16rpx 24rpx;
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
}
|
|
||||||
.search-icon.data-v-98282eb3 {
|
|
||||||
font-size: 28rpx;
|
|
||||||
margin-right: 12rpx;
|
|
||||||
}
|
|
||||||
.search-input.data-v-98282eb3 {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 28rpx;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
.law-list.data-v-98282eb3 {
|
|
||||||
max-height: 500rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.law-item.data-v-98282eb3 {
|
|
||||||
padding: 24rpx;
|
|
||||||
border: 2rpx solid #E5E5E5;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.law-item-active.data-v-98282eb3 {
|
|
||||||
border-color: #2667E9;
|
|
||||||
background: #F0F6FF;
|
|
||||||
}
|
|
||||||
.load-more.data-v-98282eb3 {
|
|
||||||
text-align: center;
|
|
||||||
padding: 24rpx;
|
|
||||||
border: 2rpx solid #2667E9;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
margin-top: 16rpx;
|
|
||||||
}
|
|
||||||
.law-footer.data-v-98282eb3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 30rpx;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
|
||||||
.library-popup.data-v-98282eb3 {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
max-height: 80vh;
|
|
||||||
}
|
|
||||||
.library-list.data-v-98282eb3 {
|
|
||||||
max-height: 500rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.library-item.data-v-98282eb3 {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
padding: 24rpx;
|
|
||||||
border: 2rpx solid #E5E5E5;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
}
|
|
||||||
.library-checkbox.data-v-98282eb3 {
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
border: 2rpx solid #ccc;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-shrink: 0;
|
|
||||||
margin-top: 4rpx;
|
|
||||||
}
|
|
||||||
.library-checkbox-active.data-v-98282eb3 {
|
|
||||||
background: #2667E9;
|
|
||||||
border-color: #2667E9;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.library-info.data-v-98282eb3 {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.library-name.data-v-98282eb3 {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
.library-count.data-v-98282eb3 {
|
|
||||||
font-size: 24rpx;
|
|
||||||
margin-top: 8rpx;
|
|
||||||
}
|
|
||||||
.btn-add-library.data-v-98282eb3 {
|
|
||||||
width: 100%;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 30rpx;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
|
||||||
@@ -1,207 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
||||||
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
|
|
||||||
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
|
|
||||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
|
||||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
|
||||||
(_easycom_up_input2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_up_upload2 + _easycom_up_textarea2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
||||||
const _easycom_up_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
|
|
||||||
const _easycom_up_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
|
|
||||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
|
||||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_input + _easycom_up_radio + _easycom_up_radio_group + _easycom_up_upload + _easycom_up_textarea)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "editcompanInformation",
|
|
||||||
setup(__props) {
|
|
||||||
const radiolist1 = common_vendor.reactive([
|
|
||||||
{
|
|
||||||
name: "矿山开采",
|
|
||||||
disabled: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "化工生产",
|
|
||||||
disabled: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "冶金工业",
|
|
||||||
disabled: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "建筑施工",
|
|
||||||
disabled: false
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
const radiovalue1 = common_vendor.ref("矿山开采");
|
|
||||||
const groupChange = (n) => {
|
|
||||||
console.log("groupChange", n);
|
|
||||||
};
|
|
||||||
const radioChange = (n) => {
|
|
||||||
console.log("radioChange", n);
|
|
||||||
};
|
|
||||||
const fileList1 = common_vendor.ref([]);
|
|
||||||
const afterRead = (event) => {
|
|
||||||
console.log(event);
|
|
||||||
};
|
|
||||||
const deletePic = (event) => {
|
|
||||||
console.log(event);
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.o(_ctx.change),
|
|
||||||
b: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
c: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
d: common_vendor.o(_ctx.change),
|
|
||||||
e: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
f: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(_ctx.change),
|
|
||||||
h: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
i: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
j: common_vendor.o(_ctx.change),
|
|
||||||
k: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
l: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
m: common_vendor.o(_ctx.change),
|
|
||||||
n: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
o: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
p: common_vendor.o(_ctx.change),
|
|
||||||
q: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
r: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
s: common_vendor.f(radiolist1, (item, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: index,
|
|
||||||
b: common_vendor.o(radioChange, index),
|
|
||||||
c: "2e9c764f-7-" + i0 + ",2e9c764f-6",
|
|
||||||
d: common_vendor.p({
|
|
||||||
customStyle: {
|
|
||||||
marginBottom: "8px"
|
|
||||||
},
|
|
||||||
label: item.name,
|
|
||||||
name: item.name
|
|
||||||
})
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
t: common_vendor.o(groupChange),
|
|
||||||
v: common_vendor.o(($event) => radiovalue1.value = $event),
|
|
||||||
w: common_vendor.p({
|
|
||||||
placement: "row",
|
|
||||||
shape: "square",
|
|
||||||
modelValue: radiovalue1.value
|
|
||||||
}),
|
|
||||||
x: common_vendor.o(_ctx.change),
|
|
||||||
y: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
z: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
A: common_vendor.o(_ctx.change),
|
|
||||||
B: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
C: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
D: common_vendor.o(_ctx.change),
|
|
||||||
E: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
F: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
G: common_vendor.o(_ctx.change),
|
|
||||||
H: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
I: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
J: common_vendor.o(_ctx.change),
|
|
||||||
K: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
L: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
M: common_vendor.o(_ctx.change),
|
|
||||||
N: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
O: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
P: common_vendor.o(_ctx.change),
|
|
||||||
Q: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
R: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
S: common_vendor.o(_ctx.change),
|
|
||||||
T: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
U: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
V: common_vendor.o(_ctx.change),
|
|
||||||
W: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
X: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
Y: common_vendor.o(_ctx.change),
|
|
||||||
Z: common_vendor.o(($event) => _ctx.value = $event),
|
|
||||||
aa: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: _ctx.value
|
|
||||||
}),
|
|
||||||
ab: common_vendor.o(afterRead),
|
|
||||||
ac: common_vendor.o(deletePic),
|
|
||||||
ad: common_vendor.p({
|
|
||||||
fileList: fileList1.value,
|
|
||||||
name: "1",
|
|
||||||
multiple: true,
|
|
||||||
maxCount: 10
|
|
||||||
}),
|
|
||||||
ae: common_vendor.o(($event) => _ctx.value1 = $event),
|
|
||||||
af: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
modelValue: _ctx.value1
|
|
||||||
})
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2e9c764f"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "编辑企业信息",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
|
||||||
"up-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
|
|
||||||
"up-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
|
|
||||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
|
|
||||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,30 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-2e9c764f {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
||||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
|
||||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
|
||||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
|
||||||
(_easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
||||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
|
||||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
|
||||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_input + _easycom_up_datetime_picker + _easycom_up_textarea + _easycom_u_popup)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "equipmentregistration",
|
|
||||||
setup(__props) {
|
|
||||||
const showAddPopup = common_vendor.ref(false);
|
|
||||||
const fileList = common_vendor.ref([]);
|
|
||||||
const toAdd = () => {
|
|
||||||
showAddPopup.value = true;
|
|
||||||
};
|
|
||||||
const chooseFile = () => {
|
|
||||||
common_vendor.index.chooseMessageFile({
|
|
||||||
count: 10,
|
|
||||||
type: "all",
|
|
||||||
success: (res) => {
|
|
||||||
const files = res.tempFiles.map((file) => ({
|
|
||||||
name: file.name,
|
|
||||||
path: file.path,
|
|
||||||
size: file.size
|
|
||||||
}));
|
|
||||||
fileList.value = [...fileList.value, ...files];
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
common_vendor.index.chooseImage({
|
|
||||||
count: 9,
|
|
||||||
success: (res) => {
|
|
||||||
const files = res.tempFilePaths.map((path, index) => ({
|
|
||||||
name: `文件${fileList.value.length + index + 1}`,
|
|
||||||
path,
|
|
||||||
size: 0
|
|
||||||
}));
|
|
||||||
fileList.value = [...fileList.value, ...files];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const removeFile = (index) => {
|
|
||||||
fileList.value.splice(index, 1);
|
|
||||||
};
|
|
||||||
const handleAdd = () => {
|
|
||||||
showAddPopup.value = false;
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "新增成功",
|
|
||||||
icon: "success"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const show = common_vendor.ref(false);
|
|
||||||
const value1 = common_vendor.ref(Date.now());
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.o(toAdd),
|
|
||||||
b: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
c: common_vendor.p({
|
|
||||||
placeholder: "请输入型号"
|
|
||||||
}),
|
|
||||||
d: common_vendor.p({
|
|
||||||
placeholder: "请输入名称"
|
|
||||||
}),
|
|
||||||
e: common_vendor.p({
|
|
||||||
placeholder: "请输入参数"
|
|
||||||
}),
|
|
||||||
f: common_vendor.p({
|
|
||||||
placeholder: "请输入数量"
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(($event) => value1.value = $event),
|
|
||||||
h: common_vendor.p({
|
|
||||||
hasInput: true,
|
|
||||||
show: show.value,
|
|
||||||
mode: "date",
|
|
||||||
modelValue: value1.value
|
|
||||||
}),
|
|
||||||
i: common_vendor.o(($event) => value1.value = $event),
|
|
||||||
j: common_vendor.p({
|
|
||||||
hasInput: true,
|
|
||||||
show: show.value,
|
|
||||||
mode: "date",
|
|
||||||
modelValue: value1.value
|
|
||||||
}),
|
|
||||||
k: common_vendor.p({
|
|
||||||
placeholder: "请输入区域"
|
|
||||||
}),
|
|
||||||
l: common_vendor.o(chooseFile),
|
|
||||||
m: fileList.value.length > 0
|
|
||||||
}, fileList.value.length > 0 ? {
|
|
||||||
n: common_vendor.f(fileList.value, (file, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(file.name),
|
|
||||||
b: common_vendor.o(($event) => removeFile(index), index),
|
|
||||||
c: index
|
|
||||||
};
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
o: common_vendor.o(($event) => value1.value = $event),
|
|
||||||
p: common_vendor.p({
|
|
||||||
placeholder: "请输入备注",
|
|
||||||
modelValue: value1.value
|
|
||||||
}),
|
|
||||||
q: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
r: common_vendor.o(handleAdd),
|
|
||||||
s: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
t: common_vendor.p({
|
|
||||||
show: showAddPopup.value,
|
|
||||||
mode: "center",
|
|
||||||
round: "20"
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1714bad4"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "设备登记",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
|
||||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
|
||||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
|
||||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['padding', 'data-v-1714bad4', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding data-v-1714bad4"><view class="text-gray text-center margin-top-xl margin-bottom-xl data-v-1714bad4">暂无设备</view><button class="cuIcon-add round bg-blue data-v-1714bad4" bindtap="{{a}}">新增</button></view><u-popup wx:if="{{t}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-s="{{['d']}}" bindclose="{{s}}" u-i="1714bad4-0" bind:__l="__l" u-p="{{t}}"><view class="popup-content data-v-1714bad4"><view class="popup-header data-v-1714bad4"><view class="popup-title text-bold data-v-1714bad4">新增设备</view><view class="popup-close data-v-1714bad4" bindtap="{{b}}">×</view></view><view class="popup-body data-v-1714bad4"><view class="flex data-v-1714bad4"><view class="margin-bottom data-v-1714bad4">型号</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{c}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-1,1714bad4-0" bind:__l="__l" u-p="{{c}}"></up-input><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">名称</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{d}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-2,1714bad4-0" bind:__l="__l" u-p="{{d}}"></up-input><view class="margin-bottom margin-top data-v-1714bad4">参数</view><up-input wx:if="{{e}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-3,1714bad4-0" bind:__l="__l" u-p="{{e}}"></up-input><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">数量(单位:台)</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{f}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-4,1714bad4-0" bind:__l="__l" u-p="{{f}}"></up-input><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">购买时间</view><view class="text-red data-v-1714bad4">*</view></view><up-datetime-picker wx:if="{{h}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-5,1714bad4-0" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-datetime-picker><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">设备预警时间</view><view class="text-red data-v-1714bad4">*</view></view><up-datetime-picker wx:if="{{j}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-6,1714bad4-0" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-datetime-picker><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">区域</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{k}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-7,1714bad4-0" bind:__l="__l" u-p="{{k}}"></up-input><view class="margin-top-sm margin-bottom-sm margin-bottom margin-top data-v-1714bad4">上传资料</view><view class="upload-area data-v-1714bad4" bindtap="{{l}}"><view class="upload-icon data-v-1714bad4"><text class="cuIcon-upload data-v-1714bad4" style="font-size:60rpx;color:#999"></text></view><view class="upload-text data-v-1714bad4">点击选择文件</view><view class="upload-tip data-v-1714bad4">支持Word、Excel、PDF、图片等格式</view><button class="cu-but bg-blue data-v-1714bad4">选择文件</button></view><view wx:if="{{m}}" class="file-list data-v-1714bad4"><view wx:for="{{n}}" wx:for-item="file" wx:key="c" class="file-item data-v-1714bad4"><text class="file-name data-v-1714bad4">{{file.a}}</text><text class="file-delete text-red data-v-1714bad4" catchtap="{{file.b}}">×</text></view></view><view class="margin-top-sm margin-bottom margin-top data-v-1714bad4">备注</view><up-textarea wx:if="{{p}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-8,1714bad4-0" bind:__l="__l" bindupdateModelValue="{{o}}" u-p="{{p}}"></up-textarea></view><view class="popup-footer data-v-1714bad4"><button class="btn-cancel data-v-1714bad4" bindtap="{{q}}">取消</button><button class="btn-confirm bg-blue data-v-1714bad4" bindtap="{{r}}">确定</button></view></view></u-popup></view>
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.popup-content.data-v-1714bad4 {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.popup-header.data-v-1714bad4 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 30rpx;
|
|
||||||
border-bottom: 1rpx solid #eee;
|
|
||||||
}
|
|
||||||
.popup-title.data-v-1714bad4 {
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
.popup-close.data-v-1714bad4 {
|
|
||||||
font-size: 40rpx;
|
|
||||||
color: #999;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.popup-body.data-v-1714bad4 {
|
|
||||||
padding: 30rpx;
|
|
||||||
max-height: 60vh;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.popup-footer.data-v-1714bad4 {
|
|
||||||
display: flex;
|
|
||||||
border-top: 1rpx solid #eee;
|
|
||||||
}
|
|
||||||
.popup-footer button.data-v-1714bad4 {
|
|
||||||
flex: 1;
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
border-radius: 0;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.popup-footer button.data-v-1714bad4::after {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
.popup-footer .btn-cancel.data-v-1714bad4 {
|
|
||||||
background: #f5f5f5;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.popup-footer .btn-confirm.data-v-1714bad4 {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.upload-area.data-v-1714bad4 {
|
|
||||||
background: #F8F8F;
|
|
||||||
border: 2rpx dashed #C5D4F5;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
padding: 40rpx 30rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-top: 16rpx;
|
|
||||||
}
|
|
||||||
.upload-icon.data-v-1714bad4 {
|
|
||||||
width: 80rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
}
|
|
||||||
.upload-text.data-v-1714bad4 {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
.upload-tip.data-v-1714bad4 {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
}
|
|
||||||
.upload-btn.data-v-1714bad4 {
|
|
||||||
padding: 16rpx 48rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
}
|
|
||||||
.file-list.data-v-1714bad4 {
|
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
|
||||||
.file-item.data-v-1714bad4 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 16rpx 20rpx;
|
|
||||||
background: #f5f5f5;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
margin-bottom: 12rpx;
|
|
||||||
}
|
|
||||||
.file-name.data-v-1714bad4 {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #333;
|
|
||||||
flex: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.file-delete.data-v-1714bad4 {
|
|
||||||
font-size: 36rpx;
|
|
||||||
padding-left: 20rpx;
|
|
||||||
}
|
|
||||||
@@ -1,417 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const request_api = require("../../request/api.js");
|
|
||||||
const request_request = require("../../request/request.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
|
||||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
||||||
const _easycom_up_choose2 = common_vendor.resolveComponent("up-choose");
|
|
||||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
|
||||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
|
||||||
(_easycom_up_upload2 + _easycom_up_input2 + _easycom_up_choose2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
|
||||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
||||||
const _easycom_up_choose = () => "../../uni_modules/uview-plus/components/u-choose/u-choose.js";
|
|
||||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
|
||||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_upload + _easycom_up_input + _easycom_up_choose + _easycom_up_textarea + _easycom_u_popup)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "Inspection",
|
|
||||||
setup(__props) {
|
|
||||||
const showAddPopup = common_vendor.ref(false);
|
|
||||||
const taskId = common_vendor.ref("");
|
|
||||||
const checkPointId = common_vendor.ref("");
|
|
||||||
const fetchTaskInfo = async (oneTableId) => {
|
|
||||||
try {
|
|
||||||
const startRes = await request_api.enterCheckPlan(oneTableId);
|
|
||||||
if (startRes.code === 0 && startRes.data) {
|
|
||||||
const tid = startRes.data.taskId;
|
|
||||||
const detailRes = await request_api.getCheckTaskDetail(tid);
|
|
||||||
if (detailRes.code === 0 && detailRes.data) {
|
|
||||||
taskId.value = detailRes.data.taskId;
|
|
||||||
checkPointId.value = detailRes.data.checkPointId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("获取任务信息失败:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
if (options.id) {
|
|
||||||
fetchTaskInfo(options.id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const formData = common_vendor.reactive({
|
|
||||||
title: "",
|
|
||||||
// 隐患标题
|
|
||||||
level: 0,
|
|
||||||
// 隐患等级索引
|
|
||||||
description: "",
|
|
||||||
// 隐患描述
|
|
||||||
tagIndex: 0,
|
|
||||||
// 隐患标签索引
|
|
||||||
source: ""
|
|
||||||
// 隐患来源
|
|
||||||
});
|
|
||||||
const lng = common_vendor.ref(0);
|
|
||||||
const lat = common_vendor.ref(0);
|
|
||||||
const selectedAddress = common_vendor.ref("");
|
|
||||||
const chooseLocation = () => {
|
|
||||||
console.log("chooseLocation called");
|
|
||||||
showAddPopup.value = false;
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.chooseLocation({
|
|
||||||
success: (res) => {
|
|
||||||
console.log("选择位置成功:", res);
|
|
||||||
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
|
|
||||||
lng.value = res.longitude;
|
|
||||||
lat.value = res.latitude;
|
|
||||||
showAddPopup.value = true;
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.error("选择位置失败:", err);
|
|
||||||
showAddPopup.value = true;
|
|
||||||
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "选择位置失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, 300);
|
|
||||||
};
|
|
||||||
const handleAdd = async () => {
|
|
||||||
var _a;
|
|
||||||
if (!formData.title) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "请输入隐患标题",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (fileList1.value.length === 0) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "请上传隐患图片/视频",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fileList1.value.map((file) => {
|
|
||||||
let url = "";
|
|
||||||
if (typeof file.url === "string") {
|
|
||||||
url = file.url;
|
|
||||||
} else if (file.url && typeof file.url === "object") {
|
|
||||||
url = file.url.url || file.url.path || "";
|
|
||||||
}
|
|
||||||
const fileName = typeof url === "string" && url ? url.split("/").pop() : file.name || "";
|
|
||||||
return {
|
|
||||||
fileName: fileName || "",
|
|
||||||
filePath: url || "",
|
|
||||||
fileType: file.type || "image/png",
|
|
||||||
fileSize: file.size || 0
|
|
||||||
};
|
|
||||||
});
|
|
||||||
const selectedTag = tagOptions.value[formData.tagIndex];
|
|
||||||
const tagId = selectedTag ? selectedTag.id : null;
|
|
||||||
console.log("innnn", sourceOptions);
|
|
||||||
const params = {
|
|
||||||
title: formData.title,
|
|
||||||
//标题
|
|
||||||
level: formData.level + 1,
|
|
||||||
// 1.轻微隐患 2.一般隐患 3.重大隐患
|
|
||||||
lng: lng.value || 0,
|
|
||||||
//经度
|
|
||||||
lat: lat.value || 0,
|
|
||||||
//纬度
|
|
||||||
address: selectedAddress.value || "",
|
|
||||||
//详细地址
|
|
||||||
description: formData.description || "",
|
|
||||||
//隐患描述
|
|
||||||
tagId,
|
|
||||||
//隐患标签ID
|
|
||||||
taskId: taskId.value,
|
|
||||||
//关联任务ID
|
|
||||||
checkPointId: checkPointId.value,
|
|
||||||
//关联检查点ID
|
|
||||||
source: ((_a = sourceOptions.value[formData.source]) == null ? void 0 : _a.title) || ""
|
|
||||||
//隐患来源(随手拍、企业自查、行业互查、专家诊查)
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
const res = await request_api.addHiddenDanger(params);
|
|
||||||
if (res.code === 0) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "新增成功",
|
|
||||||
icon: "success"
|
|
||||||
});
|
|
||||||
showAddPopup.value = false;
|
|
||||||
formData.title = "";
|
|
||||||
formData.level = 0;
|
|
||||||
formData.description = "";
|
|
||||||
formData.tagIndex = 0;
|
|
||||||
selectedAddress.value = "";
|
|
||||||
fileList1.value = [];
|
|
||||||
fetchHiddenDangerList();
|
|
||||||
} else {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: res.msg || "新增失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "请求失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const hiddenDangerList = common_vendor.ref([]);
|
|
||||||
const fetchHiddenDangerList = async () => {
|
|
||||||
try {
|
|
||||||
const res = await request_api.getMyHiddenDangerList();
|
|
||||||
if (res.code === 0) {
|
|
||||||
hiddenDangerList.value = res.data.records;
|
|
||||||
} else {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: res.msg || "获取隐患列表失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "请求失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
common_vendor.onShow(() => {
|
|
||||||
fetchHiddenDangerList();
|
|
||||||
});
|
|
||||||
const details = (item) => {
|
|
||||||
common_vendor.index.navigateTo({
|
|
||||||
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const Rectification = (item) => {
|
|
||||||
common_vendor.index.navigateTo({
|
|
||||||
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const acceptance = (item) => {
|
|
||||||
common_vendor.index.navigateTo({
|
|
||||||
url: `/pages/hiddendanger/acceptance?hazardId=${item.hazardId}&assignId=${item.assignId}&rectifyId=${item.rectifyId}`
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const assignHazard = (item) => {
|
|
||||||
common_vendor.index.navigateTo({
|
|
||||||
url: `/pages/hiddendanger/assignment?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const fileList1 = common_vendor.ref([]);
|
|
||||||
const deletePic = (event) => {
|
|
||||||
fileList1.value.splice(event.index, 1);
|
|
||||||
};
|
|
||||||
const afterRead = async (event) => {
|
|
||||||
let lists = [].concat(event.file);
|
|
||||||
let fileListLen = fileList1.value.length;
|
|
||||||
lists.map((item) => {
|
|
||||||
fileList1.value.push({
|
|
||||||
...item,
|
|
||||||
status: "uploading",
|
|
||||||
message: "上传中"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
for (let i = 0; i < lists.length; i++) {
|
|
||||||
const result = await uploadFilePromise(lists[i].url);
|
|
||||||
let item = fileList1.value[fileListLen];
|
|
||||||
fileList1.value.splice(fileListLen, 1, {
|
|
||||||
...item,
|
|
||||||
status: "success",
|
|
||||||
message: "",
|
|
||||||
url: result
|
|
||||||
});
|
|
||||||
fileListLen++;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const uploadFilePromise = (filePath) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
common_vendor.index.uploadFile({
|
|
||||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
|
||||||
filePath,
|
|
||||||
name: "file",
|
|
||||||
header: {
|
|
||||||
"Authorization": request_request.getToken()
|
|
||||||
},
|
|
||||||
success: (res) => {
|
|
||||||
const data = JSON.parse(res.data);
|
|
||||||
if (data.code === 0) {
|
|
||||||
resolve(data.data);
|
|
||||||
} else {
|
|
||||||
reject(data.msg || "上传失败");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.error("上传失败:", err);
|
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const tagOptions = common_vendor.ref([]);
|
|
||||||
const fetchTagOptions = async () => {
|
|
||||||
try {
|
|
||||||
const res = await request_api.getHiddenDangerLabelList();
|
|
||||||
if (res.code === 0) {
|
|
||||||
tagOptions.value = res.data.map((item) => ({
|
|
||||||
id: item.id,
|
|
||||||
title: item.name
|
|
||||||
}));
|
|
||||||
} else {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: res.msg || "获取标签列表失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "请求失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
fetchTagOptions();
|
|
||||||
const levelOptions = common_vendor.ref([
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
title: "轻微隐患"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
title: "一般隐患"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
title: "重大隐患"
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
const sourceOptions = common_vendor.ref([
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
title: "随手拍"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
title: "企业自查"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
title: "行业互查"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
title: "专家诊查"
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
common_vendor.watch(() => formData.source, (newVal) => {
|
|
||||||
const selected = sourceOptions.value[newVal];
|
|
||||||
console.log("隐患来源选择结果:", {
|
|
||||||
索引: newVal,
|
|
||||||
选中项: selected,
|
|
||||||
id: selected == null ? void 0 : selected.id,
|
|
||||||
title: selected == null ? void 0 : selected.title
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.f(hiddenDangerList.value, (item, k0, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(item.title),
|
|
||||||
b: common_vendor.t(item.statusName),
|
|
||||||
c: common_vendor.t(item.levelName),
|
|
||||||
d: item.levelName === "轻微隐患" ? 1 : "",
|
|
||||||
e: item.levelName === "一般隐患" ? 1 : "",
|
|
||||||
f: item.levelName === "重大隐患" ? 1 : "",
|
|
||||||
g: common_vendor.t(item.address),
|
|
||||||
h: common_vendor.t(item.createdAt),
|
|
||||||
i: common_vendor.o(($event) => details(item), item.hazardId),
|
|
||||||
j: item.statusName === "待整改" || item.statusName === "待验收"
|
|
||||||
}, item.statusName === "待整改" || item.statusName === "待验收" ? {
|
|
||||||
k: common_vendor.o(($event) => Rectification(item), item.hazardId)
|
|
||||||
} : {}, {
|
|
||||||
l: item.statusName === "待验收"
|
|
||||||
}, item.statusName === "待验收" ? {
|
|
||||||
m: common_vendor.o(($event) => acceptance(item), item.hazardId)
|
|
||||||
} : {}, {
|
|
||||||
n: item.statusName === "待交办"
|
|
||||||
}, item.statusName === "待交办" ? {
|
|
||||||
o: common_vendor.o(($event) => assignHazard(item), item.hazardId)
|
|
||||||
} : {}, {
|
|
||||||
p: item.hazardId
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
b: common_vendor.o(($event) => showAddPopup.value = true),
|
|
||||||
c: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
d: common_vendor.o(afterRead),
|
|
||||||
e: common_vendor.o(deletePic),
|
|
||||||
f: common_vendor.p({
|
|
||||||
fileList: fileList1.value,
|
|
||||||
name: "1",
|
|
||||||
multiple: true,
|
|
||||||
maxCount: 10
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(($event) => formData.title = $event),
|
|
||||||
h: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
border: "surround",
|
|
||||||
modelValue: formData.title
|
|
||||||
}),
|
|
||||||
i: common_vendor.o(($event) => formData.level = $event),
|
|
||||||
j: common_vendor.p({
|
|
||||||
options: levelOptions.value,
|
|
||||||
wrap: false,
|
|
||||||
["item-width"]: "183rpx",
|
|
||||||
["item-height"]: "72rpx",
|
|
||||||
modelValue: formData.level
|
|
||||||
}),
|
|
||||||
k: common_vendor.o(($event) => formData.source = $event),
|
|
||||||
l: common_vendor.p({
|
|
||||||
options: sourceOptions.value,
|
|
||||||
wrap: false,
|
|
||||||
["item-width"]: "183rpx",
|
|
||||||
["item-height"]: "72rpx",
|
|
||||||
modelValue: formData.source
|
|
||||||
}),
|
|
||||||
m: common_vendor.t(selectedAddress.value || "请选择地址"),
|
|
||||||
n: common_vendor.n(selectedAddress.value ? "" : "text-gray"),
|
|
||||||
o: common_vendor.o(chooseLocation),
|
|
||||||
p: common_vendor.o(chooseLocation),
|
|
||||||
q: common_vendor.o(($event) => formData.description = $event),
|
|
||||||
r: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
modelValue: formData.description
|
|
||||||
}),
|
|
||||||
s: common_vendor.o(($event) => formData.tagIndex = $event),
|
|
||||||
t: common_vendor.p({
|
|
||||||
options: tagOptions.value,
|
|
||||||
modelValue: formData.tagIndex
|
|
||||||
}),
|
|
||||||
v: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
w: common_vendor.o(handleAdd),
|
|
||||||
x: common_vendor.o(($event) => showAddPopup.value = false),
|
|
||||||
y: common_vendor.p({
|
|
||||||
show: showAddPopup.value,
|
|
||||||
mode: "center",
|
|
||||||
round: "20"
|
|
||||||
})
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b44c631d"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "隐患排查",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
|
|
||||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
|
||||||
"up-choose": "../../uni_modules/uview-plus/components/u-choose/u-choose",
|
|
||||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
|
||||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,200 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-b44c631d {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.list-list.data-v-b44c631d {
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
|
||||||
border-left: 5px solid #2667E9;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
.level-tag.data-v-b44c631d {
|
|
||||||
padding: 4rpx 16rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
.level-minor.data-v-b44c631d {
|
|
||||||
background: #F6FFED;
|
|
||||||
border: 2rpx solid #B7EB8F;
|
|
||||||
color: #52C41A;
|
|
||||||
}
|
|
||||||
.level-normal.data-v-b44c631d {
|
|
||||||
background: #FFF7E6;
|
|
||||||
border: 2rpx solid #FFD591;
|
|
||||||
color: #FA8C16;
|
|
||||||
}
|
|
||||||
.level-major.data-v-b44c631d {
|
|
||||||
background: #FFF1F0;
|
|
||||||
border: 2rpx solid #FFA39E;
|
|
||||||
color: #F5222D;
|
|
||||||
}
|
|
||||||
.popup-content.data-v-b44c631d {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.popup-header.data-v-b44c631d {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 30rpx;
|
|
||||||
border-bottom: 1rpx solid #eee;
|
|
||||||
}
|
|
||||||
.popup-header .popup-title.data-v-b44c631d {
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.popup-header .popup-close.data-v-b44c631d {
|
|
||||||
font-size: 40rpx;
|
|
||||||
color: #999;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
.popup-body.data-v-b44c631d {
|
|
||||||
padding: 30rpx;
|
|
||||||
max-height: 900rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.popup-footer.data-v-b44c631d {
|
|
||||||
display: flex;
|
|
||||||
border-top: 1rpx solid #eee;
|
|
||||||
}
|
|
||||||
.popup-footer button.data-v-b44c631d {
|
|
||||||
flex: 1;
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
border-radius: 0;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.popup-footer button.data-v-b44c631d::after {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
.popup-footer .btn-cancel.data-v-b44c631d {
|
|
||||||
background: #fff;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.popup-footer .btn-confirm.data-v-b44c631d {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.address-box.data-v-b44c631d {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.address-box .address-input.data-v-b44c631d {
|
|
||||||
flex: 1;
|
|
||||||
background: #fff;
|
|
||||||
border: 1rpx solid #F6F6F6;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #333;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.address-box .btn-address.data-v-b44c631d {
|
|
||||||
flex-shrink: 0;
|
|
||||||
height: 70rpx;
|
|
||||||
line-height: 70rpx;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.address-box .btn-address.data-v-b44c631d::after {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
.address-popup.data-v-b44c631d {
|
|
||||||
width: 600rpx;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.address-popup-body.data-v-b44c631d {
|
|
||||||
padding: 30rpx;
|
|
||||||
max-height: 500rpx;
|
|
||||||
}
|
|
||||||
.address-popup-body .search-box.data-v-b44c631d {
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
.address-popup-body .search-box .search-input.data-v-b44c631d {
|
|
||||||
width: 100%;
|
|
||||||
background: #f5f5f5;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
padding: 16rpx 20rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
.address-popup-body .address-list.data-v-b44c631d {
|
|
||||||
max-height: 350rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.address-popup-body .address-item.data-v-b44c631d {
|
|
||||||
padding: 24rpx 20rpx;
|
|
||||||
border-bottom: 1rpx solid #eee;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.address-popup-body .address-item.data-v-b44c631d:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
.address-popup-body .address-item.address-item-active.data-v-b44c631d {
|
|
||||||
background: #EBF2FC;
|
|
||||||
color: #2667E9;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/* 全局样式覆盖 up-tag 文字居中 */
|
|
||||||
.u-tag {
|
|
||||||
justify-content: center !important;
|
|
||||||
}
|
|
||||||
@@ -1,231 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const request_api = require("../../request/api.js");
|
|
||||||
const request_request = require("../../request/request.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
|
||||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
|
||||||
(_easycom_up_textarea2 + _easycom_up_upload2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
|
||||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_textarea + _easycom_up_upload)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "acceptance",
|
|
||||||
setup(__props) {
|
|
||||||
const rectifyId = common_vendor.ref("");
|
|
||||||
const hazardId = common_vendor.ref("");
|
|
||||||
const assignId = common_vendor.ref("");
|
|
||||||
const rectifyData = common_vendor.reactive({
|
|
||||||
rectifyPlan: "",
|
|
||||||
rectifyResult: ""
|
|
||||||
});
|
|
||||||
const rectifyAttachments = common_vendor.ref([]);
|
|
||||||
const formData = common_vendor.reactive({
|
|
||||||
result: 1,
|
|
||||||
// 验收结果 1.通过 2.不通过
|
|
||||||
verifyRemark: ""
|
|
||||||
// 验收备注
|
|
||||||
});
|
|
||||||
const fileList1 = common_vendor.ref([]);
|
|
||||||
const getFullPath = (filePath) => {
|
|
||||||
if (!filePath)
|
|
||||||
return "";
|
|
||||||
if (filePath.startsWith("http://") || filePath.startsWith("https://")) {
|
|
||||||
return filePath;
|
|
||||||
}
|
|
||||||
return request_request.baseUrl + filePath;
|
|
||||||
};
|
|
||||||
const previewImage = (index) => {
|
|
||||||
const urls = rectifyAttachments.value.map((item) => getFullPath(item.filePath));
|
|
||||||
common_vendor.index.previewImage({
|
|
||||||
current: index,
|
|
||||||
urls
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const fetchDetail = async () => {
|
|
||||||
if (!hazardId.value || !assignId.value)
|
|
||||||
return;
|
|
||||||
try {
|
|
||||||
const res = await request_api.getHiddenDangerDetail({ hazardId: hazardId.value, assignId: assignId.value });
|
|
||||||
if (res.code === 0 && res.data) {
|
|
||||||
if (res.data.assigns && res.data.assigns.length > 0) {
|
|
||||||
const assign = res.data.assigns[0];
|
|
||||||
if (assign.rectify) {
|
|
||||||
rectifyData.rectifyPlan = assign.rectify.rectifyPlan || "";
|
|
||||||
rectifyData.rectifyResult = assign.rectify.rectifyResult || "";
|
|
||||||
if (assign.rectify.attachments) {
|
|
||||||
rectifyAttachments.value = assign.rectify.attachments;
|
|
||||||
}
|
|
||||||
console.log("整改记录:", rectifyData);
|
|
||||||
console.log("整改附件:", rectifyAttachments.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("获取隐患详情失败:", error);
|
|
||||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
if (options.rectifyId) {
|
|
||||||
rectifyId.value = options.rectifyId;
|
|
||||||
}
|
|
||||||
if (options.hazardId) {
|
|
||||||
hazardId.value = options.hazardId;
|
|
||||||
}
|
|
||||||
if (options.assignId) {
|
|
||||||
assignId.value = options.assignId;
|
|
||||||
}
|
|
||||||
console.log("验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
|
|
||||||
fetchDetail();
|
|
||||||
});
|
|
||||||
const handleCancel = () => {
|
|
||||||
common_vendor.index.navigateBack();
|
|
||||||
};
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
if (!rectifyId.value) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "缺少整改ID",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const attachments = fileList1.value.map((file) => {
|
|
||||||
let url = "";
|
|
||||||
if (typeof file.url === "string") {
|
|
||||||
url = file.url;
|
|
||||||
} else if (file.url && typeof file.url === "object") {
|
|
||||||
url = file.url.url || file.url.path || "";
|
|
||||||
}
|
|
||||||
const fileName = typeof url === "string" && url ? url.split("/").pop() : file.name || "";
|
|
||||||
return {
|
|
||||||
fileName: fileName || "",
|
|
||||||
filePath: url || "",
|
|
||||||
fileType: file.type || "image/png",
|
|
||||||
fileSize: file.size || 0
|
|
||||||
};
|
|
||||||
});
|
|
||||||
const params = {
|
|
||||||
rectifyId: Number(rectifyId.value),
|
|
||||||
result: formData.result,
|
|
||||||
verifyRemark: formData.verifyRemark || "",
|
|
||||||
attachments
|
|
||||||
};
|
|
||||||
console.log("提交验收参数:", params);
|
|
||||||
try {
|
|
||||||
const res = await request_api.acceptanceRectification(params);
|
|
||||||
if (res.code === 0) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "验收成功",
|
|
||||||
icon: "success"
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.navigateBack();
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: res.msg || "验收失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("验收失败:", error);
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "请求失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const deletePic = (event) => {
|
|
||||||
fileList1.value.splice(event.index, 1);
|
|
||||||
};
|
|
||||||
const afterRead = async (event) => {
|
|
||||||
let lists = [].concat(event.file);
|
|
||||||
let fileListLen = fileList1.value.length;
|
|
||||||
lists.map((item) => {
|
|
||||||
fileList1.value.push({
|
|
||||||
...item,
|
|
||||||
status: "uploading",
|
|
||||||
message: "上传中"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
for (let i = 0; i < lists.length; i++) {
|
|
||||||
const result = await uploadFilePromise(lists[i].url);
|
|
||||||
let item = fileList1.value[fileListLen];
|
|
||||||
fileList1.value.splice(fileListLen, 1, {
|
|
||||||
...item,
|
|
||||||
status: "success",
|
|
||||||
message: "",
|
|
||||||
url: result
|
|
||||||
});
|
|
||||||
fileListLen++;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const uploadFilePromise = (filePath) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
common_vendor.index.uploadFile({
|
|
||||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
|
||||||
filePath,
|
|
||||||
name: "file",
|
|
||||||
header: {
|
|
||||||
"Authorization": request_request.getToken()
|
|
||||||
},
|
|
||||||
success: (res) => {
|
|
||||||
const data = JSON.parse(res.data);
|
|
||||||
if (data.code === 0) {
|
|
||||||
resolve(data.data);
|
|
||||||
} else {
|
|
||||||
reject(data.msg || "上传失败");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.error("上传失败:", err);
|
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(rectifyData.rectifyPlan || "暂无"),
|
|
||||||
b: common_vendor.t(rectifyData.rectifyResult || "暂无"),
|
|
||||||
c: rectifyAttachments.value.length > 0
|
|
||||||
}, rectifyAttachments.value.length > 0 ? {
|
|
||||||
d: common_vendor.f(rectifyAttachments.value, (img, idx, i0) => {
|
|
||||||
return {
|
|
||||||
a: idx,
|
|
||||||
b: getFullPath(img.filePath),
|
|
||||||
c: common_vendor.o(($event) => previewImage(idx), idx)
|
|
||||||
};
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
e: common_vendor.n(formData.result === 1 ? "active" : ""),
|
|
||||||
f: common_vendor.o(($event) => formData.result = 1),
|
|
||||||
g: common_vendor.n(formData.result === 2 ? "active" : ""),
|
|
||||||
h: common_vendor.o(($event) => formData.result = 2),
|
|
||||||
i: common_vendor.o(($event) => formData.verifyRemark = $event),
|
|
||||||
j: common_vendor.p({
|
|
||||||
placeholder: "请输入验收备注",
|
|
||||||
modelValue: formData.verifyRemark
|
|
||||||
}),
|
|
||||||
k: common_vendor.o(afterRead),
|
|
||||||
l: common_vendor.o(deletePic),
|
|
||||||
m: common_vendor.p({
|
|
||||||
fileList: fileList1.value,
|
|
||||||
name: "1",
|
|
||||||
multiple: true,
|
|
||||||
maxCount: 10
|
|
||||||
}),
|
|
||||||
n: common_vendor.o(handleCancel),
|
|
||||||
o: common_vendor.o(handleSubmit)
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-39f9b795"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "隐患验收",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
|
||||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['page', 'padding', 'data-v-39f9b795', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-39f9b795"><view class="text-gray margin-bottom data-v-39f9b795">整改记录</view><view class="padding solid radius data-v-39f9b795"><view class="flex data-v-39f9b795"><view class="data-v-39f9b795">整改方案:</view><view class="data-v-39f9b795">{{a}}</view></view><view class="flex margin-top-sm data-v-39f9b795"><view class="data-v-39f9b795">完成情况:</view><view class="data-v-39f9b795">{{b}}</view></view><view class="margin-top-sm data-v-39f9b795"><view class="data-v-39f9b795">整改附件:</view><view wx:if="{{c}}" class="flex margin-top-xs data-v-39f9b795" style="flex-wrap:wrap;gap:10rpx"><image wx:for="{{d}}" wx:for-item="img" wx:key="a" class="data-v-39f9b795" src="{{img.b}}" style="width:136rpx;height:136rpx;border-radius:16rpx" mode="aspectFill" bindtap="{{img.c}}"></image></view><view wx:else class="text-gray text-sm margin-top-xs data-v-39f9b795">暂无附件</view></view></view><view class="flex margin-bottom margin-top data-v-39f9b795"><view class="text-gray data-v-39f9b795">验收结果</view><view class="text-red data-v-39f9b795">*</view></view><view class="flex data-v-39f9b795" style="gap:20rpx"><button class="{{['data-v-39f9b795', 'result-btn', e]}}" bindtap="{{f}}">通过</button><button class="{{['data-v-39f9b795', 'result-btn', g]}}" bindtap="{{h}}">不通过</button></view><view class="flex margin-bottom margin-top data-v-39f9b795"><view class="text-gray data-v-39f9b795">验收备注</view></view><up-textarea wx:if="{{j}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" u-i="39f9b795-0" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-textarea><view class="flex margin-bottom margin-top data-v-39f9b795"><view class="text-gray data-v-39f9b795">验收图片/视频</view></view><up-upload wx:if="{{m}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" bindafterRead="{{k}}" binddelete="{{l}}" u-i="39f9b795-1" bind:__l="__l" u-p="{{m}}"></up-upload><view class="flex margin-top-xl data-v-39f9b795" style="gap:20rpx"><button class="round flex-sub data-v-39f9b795" bindtap="{{n}}">取消</button><button class="bg-blue round flex-sub data-v-39f9b795" bindtap="{{o}}">提交验收</button></view></view></view>
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-39f9b795 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.result-btn.data-v-39f9b795 {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
background: #f5f5f5;
|
|
||||||
color: #666;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
.result-btn.data-v-39f9b795::after {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
.result-btn.active.data-v-39f9b795 {
|
|
||||||
background: #2667E9;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const request_api = require("../../request/api.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
|
|
||||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
|
||||||
(_easycom_up_picker2 + _easycom_up_datetime_picker2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
|
|
||||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_picker + _easycom_up_datetime_picker)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "assignment",
|
|
||||||
setup(__props) {
|
|
||||||
const hazardId = common_vendor.ref("");
|
|
||||||
const assignId = common_vendor.ref("");
|
|
||||||
const showUserPicker = common_vendor.ref(false);
|
|
||||||
const selectedUser = common_vendor.ref("");
|
|
||||||
const selectedUserId = common_vendor.ref("");
|
|
||||||
const userColumns = common_vendor.ref([["暂无数据"]]);
|
|
||||||
const userList = common_vendor.ref([]);
|
|
||||||
const showDatePicker = common_vendor.ref(false);
|
|
||||||
const dateValue = common_vendor.ref(Date.now());
|
|
||||||
const selectedDate = common_vendor.ref("");
|
|
||||||
const fetchDeptUsers = async () => {
|
|
||||||
try {
|
|
||||||
const res = await request_api.getDepartmentPersonUsers();
|
|
||||||
if (res.code === 0 && res.data) {
|
|
||||||
const users = [];
|
|
||||||
res.data.forEach((dept) => {
|
|
||||||
if (dept.users && dept.users.length > 0) {
|
|
||||||
dept.users.forEach((user) => {
|
|
||||||
users.push({
|
|
||||||
id: String(user.userId),
|
|
||||||
name: `${user.nickName}(${dept.deptName})`
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
userList.value = users;
|
|
||||||
userColumns.value = [users.map((u) => u.name)];
|
|
||||||
console.log("整改人员列表:", users);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("获取部门人员失败:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const onUserConfirm = (e) => {
|
|
||||||
console.log("选择的人员:", e);
|
|
||||||
if (e.value && e.value.length > 0) {
|
|
||||||
selectedUser.value = e.value[0];
|
|
||||||
const user = userList.value.find((u) => u.name === e.value[0]);
|
|
||||||
if (user) {
|
|
||||||
selectedUserId.value = user.id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
showUserPicker.value = false;
|
|
||||||
};
|
|
||||||
const onDateConfirm = (e) => {
|
|
||||||
console.log("选择的日期时间:", e);
|
|
||||||
const date = new Date(e.value);
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
||||||
const day = String(date.getDate()).padStart(2, "0");
|
|
||||||
const hours = String(date.getHours()).padStart(2, "0");
|
|
||||||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
||||||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
||||||
selectedDate.value = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
||||||
showDatePicker.value = false;
|
|
||||||
};
|
|
||||||
const handleCancel = () => {
|
|
||||||
common_vendor.index.navigateBack();
|
|
||||||
};
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
if (!selectedUserId.value) {
|
|
||||||
common_vendor.index.showToast({ title: "请选择整改人员", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!selectedDate.value) {
|
|
||||||
common_vendor.index.showToast({ title: "请选择整改期限", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const params = {
|
|
||||||
hazardId: Number(hazardId.value),
|
|
||||||
// 隐患ID
|
|
||||||
assigneeId: Number(selectedUserId.value),
|
|
||||||
// 被指派人ID
|
|
||||||
deadline: selectedDate.value,
|
|
||||||
// 处理期限
|
|
||||||
assignRemark: ""
|
|
||||||
// 交办备注(可选)
|
|
||||||
};
|
|
||||||
console.log("提交数据:", params);
|
|
||||||
try {
|
|
||||||
const res = await request_api.assignHiddenDanger(params);
|
|
||||||
if (res.code === 0) {
|
|
||||||
common_vendor.index.showToast({ title: "交办成功", icon: "success" });
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.navigateBack();
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
|
||||||
common_vendor.index.showToast({ title: res.msg || "交办失败", icon: "none" });
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("交办失败:", error);
|
|
||||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
if (options.hazardId)
|
|
||||||
hazardId.value = options.hazardId;
|
|
||||||
if (options.assignId)
|
|
||||||
assignId.value = options.assignId;
|
|
||||||
fetchDeptUsers();
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(selectedUser.value || "请选择整改人员"),
|
|
||||||
b: common_vendor.n(selectedUser.value ? "" : "text-gray"),
|
|
||||||
c: common_vendor.o(($event) => showUserPicker.value = true),
|
|
||||||
d: common_vendor.o(onUserConfirm),
|
|
||||||
e: common_vendor.o(($event) => showUserPicker.value = false),
|
|
||||||
f: common_vendor.o(($event) => showUserPicker.value = false),
|
|
||||||
g: common_vendor.p({
|
|
||||||
show: showUserPicker.value,
|
|
||||||
columns: userColumns.value
|
|
||||||
}),
|
|
||||||
h: common_vendor.t(selectedDate.value || "请选择整改期限"),
|
|
||||||
i: common_vendor.n(selectedDate.value ? "" : "text-gray"),
|
|
||||||
j: common_vendor.o(($event) => showDatePicker.value = true),
|
|
||||||
k: common_vendor.o(onDateConfirm),
|
|
||||||
l: common_vendor.o(($event) => showDatePicker.value = false),
|
|
||||||
m: common_vendor.o(($event) => showDatePicker.value = false),
|
|
||||||
n: common_vendor.o(($event) => dateValue.value = $event),
|
|
||||||
o: common_vendor.p({
|
|
||||||
show: showDatePicker.value,
|
|
||||||
mode: "datetime",
|
|
||||||
modelValue: dateValue.value
|
|
||||||
}),
|
|
||||||
p: common_vendor.o(handleCancel),
|
|
||||||
q: common_vendor.o(handleSubmit)
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6209e844"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "隐患交办",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
|
|
||||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{['padding', 'page', 'data-v-6209e844', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding radius bg-white data-v-6209e844"><view class="flex margin-bottom data-v-6209e844"><view class="text-gray data-v-6209e844">整改人员</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{c}}"><text class="{{['data-v-6209e844', b]}}">{{a}}</text></view><up-picker wx:if="{{g}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{d}}" bindcancel="{{e}}" bindclose="{{f}}" u-i="6209e844-0" bind:__l="__l" u-p="{{g}}"></up-picker><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">整改期限</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{j}}"><text class="{{['data-v-6209e844', i]}}">{{h}}</text></view><up-datetime-picker wx:if="{{o}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{k}}" bindcancel="{{l}}" bindclose="{{m}}" u-i="6209e844-1" bind:__l="__l" bindupdateModelValue="{{n}}" u-p="{{o}}"></up-datetime-picker><view class="btn-group margin-top-xl data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{p}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{q}}">确认</button></view></view></view>
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* uni.scss */
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page.data-v-6209e844 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background: #EBF2FC;
|
|
||||||
}
|
|
||||||
.picker-input.data-v-6209e844 {
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
padding: 24rpx 20rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
border: 1rpx solid #F6F6F6;
|
|
||||||
}
|
|
||||||
.picker-input text.data-v-6209e844 {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.btn-group.data-v-6209e844 {
|
|
||||||
display: flex;
|
|
||||||
gap: 30rpx;
|
|
||||||
}
|
|
||||||
.btn-cancel.data-v-6209e844 {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border: 2rpx solid #2667E9;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
background: #fff;
|
|
||||||
color: #2667E9;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.btn-confirm.data-v-6209e844 {
|
|
||||||
flex: 1;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
@@ -1,246 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const request_api = require("../../request/api.js");
|
|
||||||
const request_request = require("../../request/request.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
|
||||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
||||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
|
||||||
const _easycom_up_select2 = common_vendor.resolveComponent("up-select");
|
|
||||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
|
||||||
(_easycom_up_textarea2 + _easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_select2 + _easycom_up_upload2)();
|
|
||||||
}
|
|
||||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
|
||||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
||||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
|
||||||
const _easycom_up_select = () => "../../uni_modules/uview-plus/components/u-select/u-select.js";
|
|
||||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_up_textarea + _easycom_up_input + _easycom_up_datetime_picker + _easycom_up_select + _easycom_up_upload)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "rectification",
|
|
||||||
setup(__props) {
|
|
||||||
const hazardId = common_vendor.ref("");
|
|
||||||
const assignId = common_vendor.ref("");
|
|
||||||
const formData = common_vendor.reactive({
|
|
||||||
rectifyPlan: "",
|
|
||||||
// 整改方案
|
|
||||||
rectifyResult: "",
|
|
||||||
// 整改完成情况
|
|
||||||
planCost: "",
|
|
||||||
// 投资资金(计划)
|
|
||||||
actualCost: ""
|
|
||||||
// 投资资金(实际)
|
|
||||||
});
|
|
||||||
const show = common_vendor.ref(false);
|
|
||||||
const value1 = common_vendor.ref(Date.now());
|
|
||||||
common_vendor.ref("");
|
|
||||||
const cateId = common_vendor.ref("");
|
|
||||||
const cateList = common_vendor.ref([]);
|
|
||||||
const selectedUserName = common_vendor.ref("");
|
|
||||||
const fetchDeptUsers = async () => {
|
|
||||||
try {
|
|
||||||
const res = await request_api.getDepartmentPersonUsers();
|
|
||||||
if (res.code === 0 && res.data) {
|
|
||||||
const userList = [];
|
|
||||||
res.data.forEach((dept) => {
|
|
||||||
if (dept.users && dept.users.length > 0) {
|
|
||||||
dept.users.forEach((user) => {
|
|
||||||
userList.push({
|
|
||||||
id: String(user.userId),
|
|
||||||
name: `${user.nickName}(${dept.deptName})`
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
cateList.value = userList;
|
|
||||||
console.log("整改人员列表:", cateList.value);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("获取部门人员失败:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
fetchDeptUsers();
|
|
||||||
const fileList1 = common_vendor.ref([]);
|
|
||||||
const deletePic = (event) => {
|
|
||||||
fileList1.value.splice(event.index, 1);
|
|
||||||
};
|
|
||||||
const afterRead = async (event) => {
|
|
||||||
let lists = [].concat(event.file);
|
|
||||||
let fileListLen = fileList1.value.length;
|
|
||||||
lists.map((item) => {
|
|
||||||
fileList1.value.push({
|
|
||||||
...item,
|
|
||||||
status: "uploading",
|
|
||||||
message: "上传中"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
for (let i = 0; i < lists.length; i++) {
|
|
||||||
const result = await uploadFilePromise(lists[i].url);
|
|
||||||
let item = fileList1.value[fileListLen];
|
|
||||||
fileList1.value.splice(fileListLen, 1, {
|
|
||||||
...item,
|
|
||||||
status: "success",
|
|
||||||
message: "",
|
|
||||||
url: result
|
|
||||||
});
|
|
||||||
fileListLen++;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const uploadFilePromise = (filePath) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
common_vendor.index.uploadFile({
|
|
||||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
|
||||||
filePath,
|
|
||||||
name: "file",
|
|
||||||
header: {
|
|
||||||
"Authorization": request_request.getToken()
|
|
||||||
},
|
|
||||||
success: (res) => {
|
|
||||||
const data = JSON.parse(res.data);
|
|
||||||
if (data.code === 0) {
|
|
||||||
resolve(data.data);
|
|
||||||
} else {
|
|
||||||
reject(data.msg || "上传失败");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.error("上传失败:", err);
|
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
if (!formData.rectifyPlan) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "请输入整改方案",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!formData.rectifyResult) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "请输入整改完成情况",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const attachments = fileList1.value.map((file) => {
|
|
||||||
let url = "";
|
|
||||||
if (typeof file.url === "string") {
|
|
||||||
url = file.url;
|
|
||||||
} else if (file.url && typeof file.url === "object") {
|
|
||||||
url = file.url.url || file.url.path || "";
|
|
||||||
}
|
|
||||||
const fileName = typeof url === "string" && url ? url.split("/").pop() : file.name || "";
|
|
||||||
return {
|
|
||||||
fileName: fileName || "",
|
|
||||||
filePath: url || "",
|
|
||||||
fileType: file.type || "image/png",
|
|
||||||
fileSize: file.size || 0
|
|
||||||
};
|
|
||||||
});
|
|
||||||
const params = {
|
|
||||||
hazardId: hazardId.value,
|
|
||||||
assignId: assignId.value,
|
|
||||||
rectifyPlan: formData.rectifyPlan,
|
|
||||||
rectifyResult: formData.rectifyResult,
|
|
||||||
planCost: Number(formData.planCost) || 0,
|
|
||||||
actualCost: Number(formData.actualCost) || 0,
|
|
||||||
attachments
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
const res = await request_api.submitRectification(params);
|
|
||||||
if (res.code === 0) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "提交成功",
|
|
||||||
icon: "success"
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.navigateBack();
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: res.msg || "提交失败",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("提交整改失败:", error);
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "您不是整改人员",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
if (options.hazardId) {
|
|
||||||
hazardId.value = options.hazardId;
|
|
||||||
}
|
|
||||||
if (options.assignId) {
|
|
||||||
assignId.value = options.assignId;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const selectItem = (item) => {
|
|
||||||
console.log("选择的整改人员:", item);
|
|
||||||
cateId.value = item.id;
|
|
||||||
selectedUserName.value = item.name;
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.o(($event) => formData.rectifyPlan = $event),
|
|
||||||
b: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
modelValue: formData.rectifyPlan
|
|
||||||
}),
|
|
||||||
c: common_vendor.o(($event) => formData.rectifyResult = $event),
|
|
||||||
d: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
modelValue: formData.rectifyResult
|
|
||||||
}),
|
|
||||||
e: common_vendor.o(($event) => formData.planCost = $event),
|
|
||||||
f: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
type: "number",
|
|
||||||
modelValue: formData.planCost
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(($event) => formData.actualCost = $event),
|
|
||||||
h: common_vendor.p({
|
|
||||||
placeholder: "请输入内容",
|
|
||||||
type: "number",
|
|
||||||
modelValue: formData.actualCost
|
|
||||||
}),
|
|
||||||
i: common_vendor.o(($event) => value1.value = $event),
|
|
||||||
j: common_vendor.p({
|
|
||||||
hasInput: true,
|
|
||||||
show: show.value,
|
|
||||||
mode: "date",
|
|
||||||
modelValue: value1.value
|
|
||||||
}),
|
|
||||||
k: selectedUserName.value
|
|
||||||
}, selectedUserName.value ? {
|
|
||||||
l: common_vendor.t(selectedUserName.value)
|
|
||||||
} : {}, {
|
|
||||||
m: common_vendor.o(selectItem),
|
|
||||||
n: common_vendor.o(($event) => cateId.value = $event),
|
|
||||||
o: common_vendor.p({
|
|
||||||
options: cateList.value,
|
|
||||||
current: cateId.value
|
|
||||||
}),
|
|
||||||
p: common_vendor.o(afterRead),
|
|
||||||
q: common_vendor.o(deletePic),
|
|
||||||
r: common_vendor.p({
|
|
||||||
fileList: fileList1.value,
|
|
||||||
name: "1",
|
|
||||||
multiple: true,
|
|
||||||
maxCount: 10
|
|
||||||
}),
|
|
||||||
s: common_vendor.o(handleSubmit)
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f18ba0ce"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "隐患整改",
|
|
||||||
"usingComponents": {
|
|
||||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
|
||||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
|
||||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
|
||||||
"up-select": "../../uni_modules/uview-plus/components/u-select/u-select",
|
|
||||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user