1.18整合
@@ -74,8 +74,14 @@
|
||||
"es6" : true,
|
||||
"postcss" : true,
|
||||
"minified" : true
|
||||
},
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "你的位置信息将用于选择隐患位置"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos" : ["chooseLocation", "getLocation"]
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"appid" : "",
|
||||
"mergeVirtualHostAttributes" : true
|
||||
|
||||
90
pages.json
@@ -14,6 +14,12 @@
|
||||
"navigationBarTitleText": "三查一曝光"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/map/map",
|
||||
"style": {
|
||||
"navigationBarTitleText": "一张图"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/plandetail/plandetail",
|
||||
"style": {
|
||||
@@ -98,6 +104,12 @@
|
||||
"navigationBarTitleText": "隐患验收"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path":"pages/hiddendanger/assignment",
|
||||
"style": {
|
||||
"navigationBarTitleText": "隐患交办"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path":"pages/closeout/application",
|
||||
"style": {
|
||||
@@ -170,6 +182,52 @@
|
||||
"navigationBarTitleText": "编辑资料"
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/login/login",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "登录页面",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/login/reg",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "注册账号",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/login/enterprise",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "注册新企业"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/login/success",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "注册成功"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/login/forget",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "忘记密码",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/login/agreement",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "用户协议",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
@@ -178,5 +236,37 @@
|
||||
"navigationBarBackgroundColor": "#007aff",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#999999",
|
||||
"selectedColor": "#007aff",
|
||||
"borderStyle": "black",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "首页",
|
||||
"iconPath": "static/tabBar/home.png",
|
||||
"selectedIconPath": "static/tabBar/home.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/map/map",
|
||||
"text": "一张图",
|
||||
"iconPath": "static/tabBar/map.png",
|
||||
"selectedIconPath": "static/tabBar/map.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/Inspectionwarning/Inspectionwarning",
|
||||
"text": "预警",
|
||||
"iconPath": "static/tabBar/warning.png",
|
||||
"selectedIconPath": "static/tabBar/warning.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/personalcenter/my",
|
||||
"text": "我的",
|
||||
"iconPath": "static/tabBar/my.png",
|
||||
"selectedIconPath": "static/tabBar/my.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"uniIdRouter": {}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
<template>
|
||||
<view class="padding page">
|
||||
<view class="padding bg-white radius">
|
||||
<view class="padding bg-white radius margin-bottom" v-for="(item,index) in hazardList" :key="index">
|
||||
<view class="flex justify-between margin-bottom">
|
||||
<view class="text-bold text-black">发现火苗</view>
|
||||
<view>已审核</view>
|
||||
<view class="text-bold text-black">{{item.hazardTitle}}</view>
|
||||
<view>{{item.statusName}}</view>
|
||||
</view>
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray">隐患日期:</view>
|
||||
<view class="text-black">2025-11-11</view>
|
||||
<view class="text-black">{{item.hazardCreatedAt}}</view>
|
||||
</view>
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray">责任单位:</view>
|
||||
<view class="text-black">吉首网络有限公司</view>
|
||||
<view class="text-black">{{item.responsibleDeptName}}</view>
|
||||
</view>
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray">判定人员:</view>
|
||||
<view class="text-black">张起</view>
|
||||
<view class="text-black">{{item.responsiblePerson}}</view>
|
||||
</view>
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray">创建时间:</view>
|
||||
<view class="text-black">2025-11-14 06:33:49</view>
|
||||
|
||||
<view class="text-black">{{item.createdAt}}</view>
|
||||
</view>
|
||||
<view class="flex justify-between">
|
||||
<view></view>
|
||||
@@ -39,24 +40,41 @@
|
||||
<view>隐患</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<up-input placeholder="请选择隐患"></up-input>
|
||||
<view class="picker-input" @click="showHazardPicker = true">
|
||||
<text :class="selectedHazard ? '' : 'text-gray'">{{ selectedHazard || '请选择隐患' }}</text>
|
||||
</view>
|
||||
<up-picker
|
||||
:show="showHazardPicker"
|
||||
:columns="hazardColumns"
|
||||
@confirm="onHazardConfirm"
|
||||
@cancel="showHazardPicker = false"
|
||||
@close="showHazardPicker = false"
|
||||
></up-picker>
|
||||
|
||||
<view class="flex margin-bottom margin-top">
|
||||
<view>整改时限</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<view>
|
||||
<up-datetime-picker hasInput :show="show" v-model="value1" mode="date"></up-datetime-picker>
|
||||
<view class="picker-input" @click="showDatePicker = true">
|
||||
<text :class="formData.rectifyDeadline ? '' : 'text-gray'">{{ formData.rectifyDeadline || '请选择整改时限' }}</text>
|
||||
</view>
|
||||
<up-datetime-picker
|
||||
:show="showDatePicker"
|
||||
v-model="dateValue"
|
||||
mode="datetime"
|
||||
@confirm="onDateConfirm"
|
||||
@cancel="showDatePicker = false"
|
||||
@close="showDatePicker = false"
|
||||
></up-datetime-picker>
|
||||
<view class="margin-bottom margin-top">隐患治理责任单位</view>
|
||||
<up-input placeholder="请输入隐患治理责任单位"></up-input>
|
||||
<up-input v-model="formData.responsibleDeptName" placeholder="请输入隐患治理责任单位"></up-input>
|
||||
<view class="margin-bottom margin-top">主要负责人</view>
|
||||
<up-input placeholder="请输入主要负责人"></up-input>
|
||||
<up-input v-model="formData.responsiblePerson" placeholder="请输入主要负责人"></up-input>
|
||||
<view class="margin-bottom margin-top">主要治理内容</view>
|
||||
<up-textarea v-model="value" placeholder="请输入主要治理内容" ></up-textarea>
|
||||
<up-textarea v-model="formData.mainTreatmentContent" placeholder="请输入主要治理内容"></up-textarea>
|
||||
<view class="margin-bottom margin-top">隐患治理完成内容</view>
|
||||
<up-textarea v-model="value" placeholder="请输入隐患治理完成情况" ></up-textarea>
|
||||
<up-textarea v-model="formData.treatmentResult" placeholder="请输入隐患治理完成情况"></up-textarea>
|
||||
<view class="margin-bottom margin-top">隐患治理责任单位自行验收的情况</view>
|
||||
<up-textarea v-model="value" placeholder="请输入隐患治理责任单位自行验收的情况" ></up-textarea>
|
||||
<up-textarea v-model="formData.selfVerifyContent" placeholder="请输入隐患治理责任单位自行验收的情况"></up-textarea>
|
||||
</view>
|
||||
<view class="popup-footer">
|
||||
<button class="btn-cancel" @click="showAddPopup = false">取消</button>
|
||||
@@ -68,29 +86,135 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import {getMyWriteOffList, applyDelete } from '@/request/api.js';
|
||||
|
||||
// 弹窗控制
|
||||
const showAddPopup = ref(false);
|
||||
const showHazardPicker = ref(false);
|
||||
const showDatePicker = ref(false);
|
||||
|
||||
// 隐患选择
|
||||
const selectedHazard = ref('');
|
||||
const selectedHazardId = ref('');
|
||||
const hazardColumns = ref([['暂无数据']]);
|
||||
const hazardList = ref([]); // 存储完整隐患数据
|
||||
|
||||
// 日期选择
|
||||
const dateValue = ref(Date.now());
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
rectifyDeadline: '', // 整改时限
|
||||
responsibleDeptName: '', // 隐患治理责任单位
|
||||
responsiblePerson: '', // 主要负责人
|
||||
mainTreatmentContent: '', // 主要治理内容
|
||||
treatmentResult: '', // 隐患治理完成内容
|
||||
selfVerifyContent: '' // 责任单位自行验收情况
|
||||
});
|
||||
|
||||
// 获取验收完成的隐患列表
|
||||
const fetchHazardList = async () => {
|
||||
try {
|
||||
const res = await getMyWriteOffList();
|
||||
if (res.code === 0 && res.data) {
|
||||
const list = res.data;
|
||||
hazardList.value = list;
|
||||
// 转换为 picker 需要的格式
|
||||
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];
|
||||
// 找到对应的隐患ID
|
||||
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 = () => {
|
||||
// 在这里处理新增逻辑
|
||||
showAddPopup.value = false;
|
||||
uni.showToast({
|
||||
title: '新增成功',
|
||||
icon: 'success'
|
||||
});
|
||||
const handleAdd = async () => {
|
||||
if (!selectedHazardId.value) {
|
||||
uni.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 || '' // 责任单位自行验收情况
|
||||
};
|
||||
// 整改时限
|
||||
const value1 = ref(Date.now());
|
||||
|
||||
console.log('提交数据:', params);
|
||||
|
||||
try {
|
||||
const res = await applyDelete(params);
|
||||
if (res.code === 0) {
|
||||
uni.showToast({ title: '申请成功', icon: 'success' });
|
||||
showAddPopup.value = false;
|
||||
resetForm();
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '申请失败', icon: 'none' });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('申请失败:', error);
|
||||
uni.showToast({ title: '请求失败', icon: 'none' });
|
||||
}
|
||||
};
|
||||
|
||||
const editor = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/closeout/editor'
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
// 页面加载时获取数据
|
||||
onMounted(() => {
|
||||
fetchHazardList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -156,4 +280,17 @@
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.picker-input {
|
||||
background: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
// border: 1rpx solid #F6F6F6;
|
||||
border: 1rpx solid #eee;
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
// color: #333;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,36 +3,133 @@
|
||||
<view class="padding bg-white radius">
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray">隐患</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<up-input placeholder="请输入内容"></up-input>
|
||||
<view class="flex margin-bottom margin-top">
|
||||
<view class="text-gray">整改时限</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<up-input placeholder="请输入内容"></up-input>
|
||||
<up-input v-model="formData.hazardTitle" placeholder="" disabled></up-input>
|
||||
<view class="text-gray margin-bottom margin-top">隐患日期</view>
|
||||
<up-input v-model="formData.hazardCreatedAt" placeholder="" disabled></up-input>
|
||||
<view class="text-gray margin-bottom margin-top">隐患治理责任单位</view>
|
||||
<up-input placeholder="请输入内容"></up-input>
|
||||
<up-input v-model="formData.responsibleDeptName" placeholder="请输入" :disabled="!canEdit"></up-input>
|
||||
<view class="text-gray margin-bottom margin-top">主要负责人</view>
|
||||
<up-input placeholder="请输入内容"></up-input>
|
||||
<view class="margin-bottom text-gray margin-top">主要治理内容</view>
|
||||
<up-textarea v-model="value1" placeholder="请输入内容" ></up-textarea>
|
||||
<view class="margin-bottom text-gray margin-top">隐患治理完成情况</view>
|
||||
<up-textarea v-model="value1" placeholder="请输入内容" ></up-textarea>
|
||||
<view class="margin-bottom text-gray margin-top">隐患治理责任单位自行验收的情况</view>
|
||||
<up-textarea v-model="value1" placeholder="请输入内容" ></up-textarea>
|
||||
<view class="flex justify-center margin-top-xl">
|
||||
<button class="lg round cu-btn lg margin-right">取消</button>
|
||||
<button class="bg-blue round cu-btn lg ">确定</button>
|
||||
<up-input v-model="formData.responsiblePerson" placeholder="请输入" :disabled="!canEdit"></up-input>
|
||||
<view class="text-gray margin-bottom margin-top">创建时间</view>
|
||||
<up-input v-model="formData.createdAt" placeholder="" disabled></up-input>
|
||||
<view class="text-gray margin-bottom margin-top">状态</view>
|
||||
<up-input v-model="formData.statusName" placeholder="" disabled></up-input>
|
||||
<view class="flex justify-center margin-top-xl" style="gap: 30rpx;">
|
||||
<button class="round cu-btn lg" @click="handleCancel">返回</button>
|
||||
<button v-if="canEdit" class="bg-blue round cu-btn lg" @click="handleSubmit">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import {getMyWriteOffList } from '@/request/api.js';
|
||||
|
||||
// 获取页面参数的方法
|
||||
const getPageOptions = () => {
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
return currentPage?.options || {};
|
||||
};
|
||||
|
||||
// 页面参数
|
||||
const pageId = ref('');
|
||||
const canEdit = ref(false); // 是否可编辑(待审核状态可编辑)
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
hazardId: '',
|
||||
hazardTitle: '', // 隐患标题
|
||||
hazardCreatedAt: '', // 隐患日期
|
||||
responsibleDeptName: '', // 隐患治理责任单位
|
||||
responsiblePerson: '', // 主要负责人
|
||||
createdAt: '', // 创建时间
|
||||
statusName: '' // 状态
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const fetchDetail = async (id) => {
|
||||
console.log('=== fetchDetail 被调用 ===, id:', id);
|
||||
try {
|
||||
const res = await getMyWriteOffList();
|
||||
console.log('接口返回:', res);
|
||||
if (res.code === 0 && res.data && res.data.length > 0) {
|
||||
const list = res.data;
|
||||
// 如果有 id 就按 id 找,否则取第一条
|
||||
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 || '';
|
||||
|
||||
// 根据返回数据的状态判断是否可编辑(待审核 status=1 可编辑)
|
||||
if (data.status == 1 || data.statusName === '待审核') {
|
||||
canEdit.value = true;
|
||||
console.log('状态为待审核,可以编辑');
|
||||
} else {
|
||||
canEdit.value = false;
|
||||
console.log('状态为已审核,不可编辑');
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取详情失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 返回
|
||||
const handleCancel = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
// 保存
|
||||
const handleSubmit = async () => {
|
||||
console.log('保存数据:', formData);
|
||||
// TODO: 调用更新接口
|
||||
uni.showToast({ title: '保存成功', icon: 'success' });
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
};
|
||||
|
||||
// 页面加载
|
||||
onLoad((options) => {
|
||||
console.log('=== onLoad 触发 ===');
|
||||
console.log('options:', options);
|
||||
pageId.value = options?.id || '';
|
||||
fetchDetail(pageId.value);
|
||||
});
|
||||
|
||||
// 备用:onMounted
|
||||
onMounted(() => {
|
||||
console.log('=== onMounted 触发 ===');
|
||||
if (!pageId.value) {
|
||||
const options = getPageOptions();
|
||||
console.log('备用获取参数:', options);
|
||||
pageId.value = options?.id || '';
|
||||
fetchDetail(pageId.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style l>
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
<template>
|
||||
<view class=" page padding">
|
||||
<view class="padding radius bg-white list-list margin-bottom" v-for="item in hiddenDangerList" :key="item.hazardId">
|
||||
<view class="padding radius bg-white list-list margin-bottom" v-for="item in hiddenDangerList"
|
||||
:key="item.hazardId">
|
||||
<view class="flex justify-between margin-bottom">
|
||||
<view class="text-bold text-black">{{item.title}}</view>
|
||||
<view class="text-blue">{{item.statusName}}</view>
|
||||
</view>
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray">隐患等级:</view>
|
||||
<view>{{item.levelName}}</view>
|
||||
<view class="level-tag" :class="{
|
||||
'level-minor': item.levelName === '轻微隐患',
|
||||
'level-normal': item.levelName === '一般隐患',
|
||||
'level-major': item.levelName === '重大隐患'
|
||||
}">{{item.levelName}}</view>
|
||||
</view>
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray" style="white-space: nowrap;">隐患位置:</view>
|
||||
@@ -17,10 +22,18 @@
|
||||
<view class="text-gray">创建时间:</view>
|
||||
<view class="text-black">{{item.createdAt}}</view>
|
||||
</view>
|
||||
<view class="flex col-3" 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="Rectification(item)">立即整改</button>
|
||||
<button class="round cu-btn lg bg-blue" @click="acceptance()">立即验收</button>
|
||||
<!-- 待整改、待验收显示立即整改 -->
|
||||
<button v-if="item.statusName === '待整改' || item.statusName === '待验收'"
|
||||
class="round cu-btn lg light bg-blue" @click="Rectification(item)">立即整改</button>
|
||||
<!-- 待验收显示立即验收 -->
|
||||
<button v-if="item.statusName === '待验收'"
|
||||
class="round cu-btn lg bg-blue" @click="acceptance(item)">立即验收</button>
|
||||
<!-- 待交办显示隐患交办 -->
|
||||
<button v-if="item.statusName === '待交办'"
|
||||
class="round cu-btn lg bg-blue" @click="assignHazard(item)">隐患交办</button>
|
||||
</view>
|
||||
</view>
|
||||
<button class="cuIcon-add round bg-blue margin-top-xl" @click="showAddPopup = true">新增</button>
|
||||
@@ -50,43 +63,25 @@
|
||||
<view class="text-gray">隐患等级</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<up-choose v-model="formData.level" :options="levelOptions" :wrap="false" item-width="183rpx" item-height="72rpx"></up-choose>
|
||||
|
||||
<up-choose v-model="formData.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="formData.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">
|
||||
<view class="address-input" @click="showAddressPopup = true">
|
||||
<view class="address-input" @tap.stop="chooseLocation">
|
||||
<text :class="selectedAddress ? '' : 'text-gray'">{{ selectedAddress || '请选择地址' }}</text>
|
||||
</view>
|
||||
<button class="btn-address bg-blue" @click="showAddressPopup = true">选择地址</button>
|
||||
<button class="btn-address bg-blue" @tap.stop="chooseLocation">选择地址</button>
|
||||
</view>
|
||||
|
||||
<!-- 地址选择弹窗 -->
|
||||
<u-popup :show="showAddressPopup" mode="center" round="20" @close="showAddressPopup = false">
|
||||
<view class="address-popup">
|
||||
<view class="popup-header">
|
||||
<view class="popup-title text-bold">选择地址</view>
|
||||
<view class="popup-close" @click="showAddressPopup = false">×</view>
|
||||
</view>
|
||||
<view class="address-popup-body">
|
||||
<view class="search-box">
|
||||
<input class="search-input" v-model="addressKeyword" placeholder="请输入关键词搜索" />
|
||||
</view>
|
||||
<view class="address-list">
|
||||
<view class="address-item" v-for="(item, index) in filteredAddressList" :key="index"
|
||||
@click="tempSelectedAddress = item" :class="{'address-item-active': tempSelectedAddress === item}">
|
||||
<text>{{ item }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-footer">
|
||||
<button class="btn-cancel" @click="showAddressPopup = false">取消</button>
|
||||
<button class="btn-confirm bg-blue" @click="confirmAddress">定位</button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<view class="text-gray text-sm margin-top-xs">如:办公楼3层东侧消防通道、生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view>
|
||||
<view class="flex margin-bottom margin-top">
|
||||
<view class="text-gray">隐患描述</view>
|
||||
@@ -108,10 +103,27 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, reactive } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { addHiddenDanger, enterCheckPlan, getCheckTaskDetail,getMyHiddenDangerList,getHiddenDangerLabelList} from '@/request/api.js'
|
||||
import { baseUrl,AUTH_TOKEN } from '@/request/request.js'
|
||||
import {
|
||||
ref,
|
||||
computed,
|
||||
reactive,
|
||||
watch
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
addHiddenDanger,
|
||||
enterCheckPlan,
|
||||
getCheckTaskDetail,
|
||||
getMyHiddenDangerList,
|
||||
getHiddenDangerLabelList
|
||||
} from '@/request/api.js'
|
||||
import {
|
||||
baseUrl,
|
||||
getToken
|
||||
} from '@/request/request.js'
|
||||
|
||||
// 弹窗控制
|
||||
const showAddPopup = ref(false);
|
||||
@@ -152,43 +164,63 @@
|
||||
level: 0, // 隐患等级索引
|
||||
description: '', // 隐患描述
|
||||
tagIndex: 0, // 隐患标签索引
|
||||
source: '', // 隐患来源
|
||||
});
|
||||
|
||||
// 经纬度
|
||||
const lng = ref(0);
|
||||
const lat = ref(0);
|
||||
|
||||
// 地址选择
|
||||
const showAddressPopup = ref(false);
|
||||
const addressKeyword = ref('');
|
||||
// 地址选择 - 调用腾讯地图
|
||||
const selectedAddress = ref('');
|
||||
const tempSelectedAddress = ref('');
|
||||
const addressList = ref([
|
||||
'湖南省湘西土家族苗族自治州吉首市人民北路105号',
|
||||
'湖南省湘西土家族苗族自治州吉首市人民南路100号',
|
||||
'湖南省湘西土家族苗族自治州吉首市团结广场',
|
||||
'湖南省湘西土家族苗族自治州吉首市火车站'
|
||||
]);
|
||||
const filteredAddressList = computed(() => {
|
||||
if (!addressKeyword.value) return addressList.value;
|
||||
return addressList.value.filter(item => item.includes(addressKeyword.value));
|
||||
|
||||
const chooseLocation = () => {
|
||||
console.log('chooseLocation called');
|
||||
// 先关闭弹窗,避免在弹窗中调用地图选择出现问题
|
||||
showAddPopup.value = false;
|
||||
|
||||
setTimeout(() => {
|
||||
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: (err) => {
|
||||
console.error('选择位置失败:', err);
|
||||
// 重新打开弹窗
|
||||
showAddPopup.value = true;
|
||||
// 用户取消选择不提示
|
||||
if (err.errMsg && err.errMsg.indexOf('cancel') === -1) {
|
||||
uni.showToast({
|
||||
title: '选择位置失败',
|
||||
icon: 'none'
|
||||
});
|
||||
const confirmAddress = () => {
|
||||
if (tempSelectedAddress.value) {
|
||||
selectedAddress.value = tempSelectedAddress.value;
|
||||
}
|
||||
showAddressPopup.value = false;
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
};
|
||||
|
||||
// 确定新增
|
||||
const handleAdd = async () => {
|
||||
// 表单验证
|
||||
if (!formData.title) {
|
||||
uni.showToast({ title: '请输入隐患标题', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请输入隐患标题',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (fileList1.value.length === 0) {
|
||||
uni.showToast({ title: '请上传隐患图片/视频', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请上传隐患图片/视频',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -214,6 +246,7 @@
|
||||
// 获取隐患标签ID
|
||||
const selectedTag = tagOptions.value[formData.tagIndex];
|
||||
const tagId = selectedTag ? selectedTag.id : null;
|
||||
console.log("innnn",sourceOptions);
|
||||
|
||||
// 构建请求参数
|
||||
const params = {
|
||||
@@ -227,7 +260,7 @@
|
||||
tagId: tagId, //隐患标签ID
|
||||
taskId: taskId.value, //关联任务ID
|
||||
checkPointId: checkPointId.value, //关联检查点ID
|
||||
source:'cillum labore veniam',//隐患来源
|
||||
source: sourceOptions.value[formData.source]?.title || '', //隐患来源(随手拍、企业自查、行业互查、专家诊查)
|
||||
|
||||
};
|
||||
//
|
||||
@@ -246,12 +279,20 @@
|
||||
formData.tagIndex = 0;
|
||||
selectedAddress.value = '';
|
||||
fileList1.value = [];
|
||||
// 刷新隐患列表
|
||||
fetchHiddenDangerList();
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '新增失败', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: res.msg || '新增失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
uni.showToast({ title: '请求失败', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
//获取隐患列表
|
||||
@@ -260,16 +301,26 @@
|
||||
try {
|
||||
const res = await getMyHiddenDangerList();
|
||||
if (res.code === 0) {
|
||||
hiddenDangerList.value = res.data;
|
||||
hiddenDangerList.value = res.data.records;
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '获取隐患列表失败', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: res.msg || '获取隐患列表失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
uni.showToast({ title: '请求失败', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 页面显示时刷新列表(从交办、验收页面返回时自动刷新)
|
||||
onShow(() => {
|
||||
fetchHiddenDangerList();
|
||||
});
|
||||
|
||||
const details = (item) => {
|
||||
uni.navigateTo({
|
||||
@@ -281,9 +332,15 @@
|
||||
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
})
|
||||
}
|
||||
const acceptance = () => {
|
||||
const acceptance = (item) => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/hiddendanger/acceptance'
|
||||
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}`
|
||||
})
|
||||
}
|
||||
const fileList1 = ref([]);
|
||||
@@ -325,7 +382,7 @@
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
header: {
|
||||
'Authorization': AUTH_TOKEN
|
||||
'Authorization': getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
@@ -342,15 +399,6 @@
|
||||
});
|
||||
});
|
||||
};
|
||||
// 隐患标签选项
|
||||
// const tagOptions = ref([
|
||||
// {id: 1, title: '安全'},
|
||||
// {id: 2, title: '人机工程'},
|
||||
// {id: 3, title: '其他'},
|
||||
// {id: 4, title: '职业健康'},
|
||||
// {id: 5, title: '电气隐患'},
|
||||
// {id: 6, title: '环保'}
|
||||
// ])
|
||||
const tagOptions = ref([]);
|
||||
const fetchTagOptions = async () => {
|
||||
try {
|
||||
@@ -362,22 +410,66 @@
|
||||
title: item.name
|
||||
}));
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '获取标签列表失败', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: res.msg || '获取标签列表失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
uni.showToast({ title: '请求失败', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
fetchTagOptions();
|
||||
|
||||
//
|
||||
// 隐患等级选项
|
||||
const levelOptions = ref([
|
||||
{id: 1, title: '轻微隐患'},
|
||||
{id: 2, title: '一般隐患'},
|
||||
{id: 3, title: '重大隐患'}
|
||||
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: '专家诊查'
|
||||
}
|
||||
])
|
||||
|
||||
// 监听隐患来源选择变化
|
||||
watch(() => formData.source, (newVal) => {
|
||||
const selected = sourceOptions.value[newVal];
|
||||
console.log('隐患来源选择结果:', {
|
||||
索引: newVal,
|
||||
选中项: selected,
|
||||
id: selected?.id,
|
||||
title: selected?.title
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -394,6 +486,33 @@
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
// 隐患等级标签样式
|
||||
.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;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
@@ -460,7 +579,8 @@
|
||||
.address-input {
|
||||
flex: 1;
|
||||
background: #fff;
|
||||
border: 1rpx solid #F6F6F6;;
|
||||
border: 1rpx solid #F6F6F6;
|
||||
;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx;
|
||||
font-size: 26rpx;
|
||||
@@ -529,7 +649,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -2,27 +2,204 @@
|
||||
<view class="page padding">
|
||||
<view class="padding bg-white radius">
|
||||
<view class="text-gray margin-bottom">整改记录</view>
|
||||
<up-textarea v-model="value1" placeholder="请输入内容"></up-textarea>
|
||||
<view class="padding solid radius">
|
||||
<view class="flex">
|
||||
<view>整改方案:</view>
|
||||
<view>{{ rectifyData.rectifyPlan || '暂无' }}</view>
|
||||
</view>
|
||||
<view class="flex margin-top-sm">
|
||||
<view>完成情况:</view>
|
||||
<view>{{ rectifyData.rectifyResult || '暂无' }}</view>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<view>整改附件:</view>
|
||||
<view class="flex margin-top-xs" style="flex-wrap: wrap; gap: 10rpx;" v-if="rectifyAttachments.length > 0">
|
||||
<image v-for="(img, idx) in rectifyAttachments" :key="idx" :src="getFullPath(img.filePath)" style="width: 136rpx;height: 136rpx;border-radius: 16rpx;" mode="aspectFill" @click="previewImage(idx)"></image>
|
||||
</view>
|
||||
<view v-else class="text-gray text-sm margin-top-xs">暂无附件</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex margin-bottom margin-top">
|
||||
<view class="text-gray">验收内容</view>
|
||||
<view class="text-gray">验收结果</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<up-textarea v-model="value1" placeholder="请输入内容"></up-textarea>
|
||||
<view class="flex" style="gap: 20rpx;">
|
||||
<button :class="['result-btn', formData.result === 1 ? 'active' : '']" @click="formData.result = 1">通过</button>
|
||||
<button :class="['result-btn', formData.result === 2 ? 'active' : '']" @click="formData.result = 2">不通过</button>
|
||||
</view>
|
||||
<view class="flex margin-bottom margin-top">
|
||||
<view class="text-gray">验收备注</view>
|
||||
</view>
|
||||
<up-textarea v-model="formData.verifyRemark" placeholder="请输入验收备注"></up-textarea>
|
||||
<view class="flex margin-bottom margin-top">
|
||||
<view class="text-gray">验收图片/视频</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<up-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="10"></up-upload>
|
||||
<button class="bg-blue round margin-top-xl"> 提交验收</button>
|
||||
<view class="flex margin-top-xl" style="gap: 20rpx;">
|
||||
<button class="round flex-sub" @click="handleCancel">取消</button>
|
||||
<button class="bg-blue round flex-sub" @click="handleSubmit">提交验收</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { acceptanceRectification, getHiddenDangerDetail } from '@/request/api.js';
|
||||
import { baseUrl,getToken } from '@/request/request.js';
|
||||
|
||||
// 页面参数
|
||||
const rectifyId = ref('');
|
||||
const hazardId = ref('');
|
||||
const assignId = ref('');
|
||||
|
||||
// 整改记录数据
|
||||
const rectifyData = reactive({
|
||||
rectifyPlan: '',
|
||||
rectifyResult: ''
|
||||
});
|
||||
|
||||
// 整改附件
|
||||
const rectifyAttachments = ref([]);
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
result: 1, // 验收结果 1.通过 2.不通过
|
||||
verifyRemark: '' // 验收备注
|
||||
});
|
||||
|
||||
const fileList1 = ref([]);
|
||||
|
||||
// 获取完整图片路径
|
||||
const getFullPath = (filePath) => {
|
||||
if (!filePath) return '';
|
||||
if (filePath.startsWith('http://') || filePath.startsWith('https://')) {
|
||||
return filePath;
|
||||
}
|
||||
return baseUrl + filePath;
|
||||
};
|
||||
|
||||
// 图片预览
|
||||
const previewImage = (index) => {
|
||||
const urls = rectifyAttachments.value.map(item => getFullPath(item.filePath));
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: urls
|
||||
});
|
||||
};
|
||||
|
||||
// 获取隐患详情
|
||||
const fetchDetail = async () => {
|
||||
if (!hazardId.value || !assignId.value) return;
|
||||
|
||||
try {
|
||||
const res = await getHiddenDangerDetail({ hazardId: hazardId.value, assignId: assignId.value });
|
||||
if (res.code === 0 && res.data) {
|
||||
// 提取整改信息:assigns[0].rectify
|
||||
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 {
|
||||
uni.showToast({ title: res.msg || '获取详情失败', icon: 'none' });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取隐患详情失败:', error);
|
||||
uni.showToast({ title: '请求失败', icon: 'none' });
|
||||
}
|
||||
};
|
||||
|
||||
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 = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
// 提交验收
|
||||
const handleSubmit = async () => {
|
||||
if (!rectifyId.value) {
|
||||
uni.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: attachments
|
||||
};
|
||||
|
||||
console.log('提交验收参数:', params);
|
||||
|
||||
try {
|
||||
const res = await acceptanceRectification(params);
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '验收成功',
|
||||
icon: 'success'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || '验收失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('验收失败:', error);
|
||||
uni.showToast({
|
||||
title: '请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 删除图片
|
||||
const deletePic = (event) => {
|
||||
fileList1.value.splice(event.index, 1);
|
||||
@@ -30,7 +207,6 @@
|
||||
|
||||
// 新增图片
|
||||
const afterRead = async (event) => {
|
||||
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = fileList1.value.length;
|
||||
lists.map((item) => {
|
||||
@@ -53,20 +229,27 @@
|
||||
}
|
||||
};
|
||||
|
||||
const uploadFilePromise = (url) => {
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let a = uni.uploadFile({
|
||||
url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
|
||||
filePath: url,
|
||||
uni.uploadFile({
|
||||
url: baseUrl + '/frontend/attachment/upload',
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
formData: {
|
||||
user: 'test',
|
||||
header: {
|
||||
'Authorization': getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
setTimeout(() => {
|
||||
resolve(res.data.data);
|
||||
}, 1000);
|
||||
const data = JSON.parse(res.data);
|
||||
if (data.code === 0) {
|
||||
resolve(data.data);
|
||||
} else {
|
||||
reject(data.msg || '上传失败');
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('上传失败:', err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -77,4 +260,23 @@
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
|
||||
.result-btn {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #2667E9;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
210
pages/hiddendanger/assignment.vue
Normal file
@@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<view class="padding page">
|
||||
<view class="padding radius bg-white">
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray">整改人员</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<view class="picker-input" @click="showUserPicker = true">
|
||||
<text :class="selectedUser ? '' : 'text-gray'">{{ selectedUser || '请选择整改人员' }}</text>
|
||||
</view>
|
||||
<up-picker
|
||||
:show="showUserPicker"
|
||||
:columns="userColumns"
|
||||
@confirm="onUserConfirm"
|
||||
@cancel="showUserPicker = false"
|
||||
@close="showUserPicker = false"
|
||||
></up-picker>
|
||||
|
||||
<view class="flex margin-bottom margin-top">
|
||||
<view class="text-gray">整改期限</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<view class="picker-input" @click="showDatePicker = true">
|
||||
<text :class="selectedDate ? '' : 'text-gray'">{{ selectedDate || '请选择整改期限' }}</text>
|
||||
</view>
|
||||
<up-datetime-picker
|
||||
:show="showDatePicker"
|
||||
v-model="dateValue"
|
||||
mode="datetime"
|
||||
@confirm="onDateConfirm"
|
||||
@cancel="showDatePicker = false"
|
||||
@close="showDatePicker = false"
|
||||
></up-datetime-picker>
|
||||
|
||||
<view class="btn-group margin-top-xl">
|
||||
<button class="btn-cancel" @click="handleCancel">取消</button>
|
||||
<button class="btn-confirm bg-blue" @click="handleSubmit">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { getDepartmentPersonUsers,assignHiddenDanger } from '@/request/api.js';
|
||||
|
||||
// 页面参数
|
||||
const hazardId = ref('');
|
||||
const assignId = ref('');
|
||||
|
||||
// 整改人员选择
|
||||
const showUserPicker = ref(false);
|
||||
const selectedUser = ref('');
|
||||
const selectedUserId = ref('');
|
||||
const userColumns = ref([['暂无数据']]);
|
||||
const userList = ref([]); // 存储完整用户数据
|
||||
|
||||
// 整改期限选择
|
||||
const showDatePicker = ref(false);
|
||||
const dateValue = ref(Date.now());
|
||||
const selectedDate = ref('');
|
||||
|
||||
// 获取部门人员列表
|
||||
const fetchDeptUsers = 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({
|
||||
id: String(user.userId),
|
||||
name: `${user.nickName}(${dept.deptName})`
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
userList.value = users;
|
||||
// 转换为 picker 需要的格式
|
||||
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];
|
||||
// 找到对应的用户ID
|
||||
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 = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
// 确认提交
|
||||
const handleSubmit = async () => {
|
||||
if (!selectedUserId.value) {
|
||||
uni.showToast({ title: '请选择整改人员', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!selectedDate.value) {
|
||||
uni.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 assignHiddenDanger(params);
|
||||
if (res.code === 0) {
|
||||
uni.showToast({ title: '交办成功', icon: 'success' });
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '交办失败', icon: 'none' });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('交办失败:', error);
|
||||
uni.showToast({ title: '请求失败', icon: 'none' });
|
||||
}
|
||||
};
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.hazardId) hazardId.value = options.hazardId;
|
||||
if (options.assignId) assignId.value = options.assignId;
|
||||
fetchDeptUsers();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
|
||||
.picker-input {
|
||||
background: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border: 1rpx solid #F6F6F6;
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
display: flex;
|
||||
gap: 30rpx;
|
||||
}
|
||||
|
||||
.btn-cancel {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border: 2rpx solid #2667E9;
|
||||
border-radius: 40rpx;
|
||||
background: #fff;
|
||||
color: #2667E9;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -28,30 +28,29 @@
|
||||
<view class="date-input" @click="show = true">
|
||||
<text :class="selectedDate ? '' : 'text-gray'">{{ selectedDate || '请选择日期' }}</text>
|
||||
</view>
|
||||
<up-calendar :show="show" :mode="mode" @confirm="confirmDate" @close="show = false"></up-calendar>
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray">整改人员</view>
|
||||
<view class="text-red">*</view>
|
||||
<up-datetime-picker hasInput :show="show" v-model="value1" mode="date"></up-datetime-picker>
|
||||
<view class=" margin-bottom margin-top">
|
||||
<!-- <view class="text-gray">整改人员</view>
|
||||
<view class="text-red">*</view> -->
|
||||
<up-select v-model:current="cateId" label="整改人员" :options="cateList" @select="selectItem"></up-select>
|
||||
</view>
|
||||
<up-radio-group v-model="radiovalue1" placement="column" @change="groupChange">
|
||||
<up-radio shape="square" :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1"
|
||||
:key="index" :label="item.name" :name="item.name" @change="radioChange"></up-radio>
|
||||
</up-radio-group>
|
||||
|
||||
<view class="flex margin-bottom">
|
||||
<view class="text-gray">整改图片/视频</view>
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<up-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="10"></up-upload>
|
||||
<up-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
||||
:maxCount="10"></up-upload>
|
||||
<button class="bg-blue round margin-top-xl" @click="handleSubmit">提交整改</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ref,reactive} from 'vue'
|
||||
import {ref,reactive,onMounted} from 'vue'
|
||||
import {onLoad} from '@dcloudio/uni-app'
|
||||
import {submitRectification} from '@/request/api.js'
|
||||
import { baseUrl, AUTH_TOKEN } from '@/request/request.js'
|
||||
import {submitRectification,getDepartmentPersonUsers} from '@/request/api.js'
|
||||
import {baseUrl,getToken} from '@/request/request.js'
|
||||
|
||||
// 从页面参数获取的ID
|
||||
const hazardId = ref('');
|
||||
@@ -66,28 +65,42 @@
|
||||
});
|
||||
|
||||
const show = ref(false);
|
||||
const mode = ref('single');
|
||||
const value1 = ref(Date.now());
|
||||
const selectedDate = ref('');
|
||||
const radiovalue1 = ref('');
|
||||
|
||||
// 基本案列数据
|
||||
const radiolist1 = reactive([{
|
||||
name: '孙致远',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
name: '符友成',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
name: '向彪',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
name: '向纪荣',
|
||||
disabled: false,
|
||||
},
|
||||
]);
|
||||
// 整改人员
|
||||
const cateId = ref('')
|
||||
const cateList = ref([])
|
||||
|
||||
// 获取部门人员列表
|
||||
const fetchDeptUsers = async () => {
|
||||
try {
|
||||
const res = await getDepartmentPersonUsers();
|
||||
if (res.code === 0 && res.data) {
|
||||
// 将部门下的用户数据扁平化为 up-select 需要的格式
|
||||
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 = ref([]);
|
||||
|
||||
@@ -96,7 +109,7 @@
|
||||
fileList1.value.splice(event.index, 1);
|
||||
};
|
||||
|
||||
// 新增图片
|
||||
// 新增图】片
|
||||
const afterRead = async (event) => {
|
||||
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file);
|
||||
@@ -121,12 +134,6 @@
|
||||
}
|
||||
};
|
||||
|
||||
// 日期选择确认
|
||||
const confirmDate = (e) => {
|
||||
selectedDate.value = e[0];
|
||||
show.value = false;
|
||||
};
|
||||
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
@@ -134,7 +141,7 @@
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
header: {
|
||||
'Authorization': AUTH_TOKEN
|
||||
'Authorization': getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
@@ -155,11 +162,17 @@
|
||||
// 提交整改
|
||||
const handleSubmit = async () => {
|
||||
if (!formData.rectifyPlan) {
|
||||
uni.showToast({ title: '请输入整改方案', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请输入整改方案',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!formData.rectifyResult) {
|
||||
uni.showToast({ title: '请输入整改完成情况', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请输入整改完成情况',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -193,16 +206,25 @@
|
||||
try {
|
||||
const res = await submitRectification(params);
|
||||
if (res.code === 0) {
|
||||
uni.showToast({ title: '提交成功', icon: 'success' });
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'success'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '提交失败', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: res.msg || '提交失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('提交整改失败:', error);
|
||||
uni.showToast({ title: '请求失败', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -214,6 +236,11 @@
|
||||
assignId.value = options.assignId;
|
||||
}
|
||||
});
|
||||
// 选择整改人员
|
||||
const selectItem = (item) => {
|
||||
console.log('选择的整改人员:', item);
|
||||
cateId.value = item.id;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -6,8 +6,10 @@
|
||||
<view class="text-red">*</view>
|
||||
</view>
|
||||
<view class="margin-bottom">
|
||||
<view class="flex" style="flex-wrap: wrap; gap: 10rpx;" v-if="detailData?.attachments && detailData.attachments.length > 0">
|
||||
<image v-for="(img, idx) in detailData.attachments" :key="idx" :src="img.filePath" style="width: 136rpx;height: 136rpx;border-radius: 16rpx;" mode="aspectFill"></image>
|
||||
<view v-if="rectifyAttachments.length > 0" class="margin-top">
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="text-gray text-sm">暂无图片</view>
|
||||
<view class="text-gray text-sm margin-top-xs">必填:请上传现场照片或者视频作为隐患证据</view>
|
||||
@@ -60,6 +62,7 @@
|
||||
import { ref, reactive } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getHiddenDangerDetail } from '@/request/api.js'
|
||||
import { baseUrl } from '@/request/request.js'
|
||||
|
||||
// 详情数据
|
||||
const detailData = reactive({
|
||||
@@ -75,12 +78,53 @@
|
||||
attachments: []
|
||||
});
|
||||
|
||||
// 整改附件(单独存储)
|
||||
const rectifyAttachments = ref([]);
|
||||
|
||||
// 获取完整图片路径
|
||||
const getFullPath = (filePath) => {
|
||||
if (!filePath) return '';
|
||||
// 如果已经是完整路径则直接返回
|
||||
if (filePath.startsWith('http://') || filePath.startsWith('https://')) {
|
||||
return filePath;
|
||||
}
|
||||
// 拼接 baseUrl
|
||||
return baseUrl + filePath;
|
||||
};
|
||||
|
||||
// 图片预览 - 隐患图片
|
||||
const previewImage = (attachments, index) => {
|
||||
const urls = attachments.map(item => getFullPath(item.filePath));
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: urls
|
||||
});
|
||||
};
|
||||
|
||||
// 图片预览 - 整改图片
|
||||
const previewRectifyImage = (index) => {
|
||||
const urls = rectifyAttachments.value.map(item => getFullPath(item.filePath));
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: urls
|
||||
});
|
||||
};
|
||||
|
||||
// 获取隐患详情
|
||||
const fetchDetail = async (hazardId, assignId) => {
|
||||
try {
|
||||
const res = await getHiddenDangerDetail({ hazardId, assignId });
|
||||
if (res.code === 0 && res.data) {
|
||||
Object.assign(detailData, res.data);
|
||||
|
||||
// 提取整改附件:assigns[0].rectify.attachments
|
||||
if (res.data.assigns && res.data.assigns.length > 0) {
|
||||
const assign = res.data.assigns[0];
|
||||
if (assign.rectify && assign.rectify.attachments) {
|
||||
rectifyAttachments.value = assign.rectify.attachments;
|
||||
console.log('整改附件:', rectifyAttachments.value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '获取详情失败', icon: 'none' });
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
<image></image>
|
||||
</view>
|
||||
<view class="padding-left">
|
||||
<view class="text-bold">湘西和谐云大数据产业发展有限公司</view>
|
||||
<view class="text-bold">{{ userInfo.deptName || '未知部门' }}</view>
|
||||
<view class="flex padding-top-xs">
|
||||
<view>手机号:</view>
|
||||
<view>17374339800</view>
|
||||
<view>用户:</view>
|
||||
<view>{{ userInfo.nickName || userInfo.username || '未登录' }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between">
|
||||
<view></view>
|
||||
@@ -18,11 +18,11 @@
|
||||
</view>
|
||||
<view class="padding" style="background: #EBF2FC;">
|
||||
<view class="bg-white padding radius">
|
||||
<view class>
|
||||
<view></view>
|
||||
<view>功能菜单</view>
|
||||
<view class="flex margin-bottom-xl">
|
||||
<view class="border-tite"></view>
|
||||
<view class="margin-left-xs text-bold " >功能菜单</view>
|
||||
</view>
|
||||
<view class=" grid col-3 grid-list">
|
||||
<view class=" grid col-3 ">
|
||||
<view class="list " v-for="(item, index) in infoList" :key="index" @click="handleMenuClick(item)">
|
||||
<image style="width: 102rpx;height: 102rpx;" :src="item.src"></image>
|
||||
<view>{{ item.name}}</view>
|
||||
@@ -92,36 +92,36 @@
|
||||
<view class="border-tite"></view>
|
||||
<view class="text-bold margin-left-xs">我的隐患排查</view>
|
||||
</view>
|
||||
<view class="list-list padding">
|
||||
<view class="list-list padding margin-bottom" v-for="(item,index) in hiddenDangerData" :key="item.id" @click="HazardList()">
|
||||
<view class="flex text-bold">
|
||||
<view>隐患</view>
|
||||
<view class="text-bold margin-left">#15</view>
|
||||
</view>
|
||||
<view class="flex margin-top">
|
||||
<view class="text-gray">标题:</view>
|
||||
<view>有隐患</view>
|
||||
<view>{{item.title}}</view>
|
||||
</view>
|
||||
<view class="flex margin-top">
|
||||
<view class="text-gray">隐患来源:</view>
|
||||
<view>企业自查</view>
|
||||
<view>{{item.source}}</view>
|
||||
</view>
|
||||
<view class="flex margin-top">
|
||||
<view class="text-gray" style="white-space: nowrap;">隐患位置:</view>
|
||||
<view>湖南省湘西土家族苗族自治州吉首市人民北路105号</view>
|
||||
<view>{{item.address}}</view>
|
||||
</view>
|
||||
<view class="flex margin-top">
|
||||
<view class="text-gray">隐患等级:</view>
|
||||
<view>一般隐患</view>
|
||||
<view>{{item.levelName}}</view>
|
||||
</view>
|
||||
<view class="flex margin-top">
|
||||
<view class="text-gray">隐患状态:</view>
|
||||
<view>待验收</view>
|
||||
<view>{{item.statusName}}</view>
|
||||
</view>
|
||||
<view class="flex margin-top">
|
||||
<view class="text-gray">发现时间:</view>
|
||||
<view>2025-11-11 17:08:09</view>
|
||||
<view>{{item.createdAt}}</view>
|
||||
</view>
|
||||
<view class="margin-top margin-bottom flex">
|
||||
<view class="margin-top margin-bottom flex" style="gap: 5rpx;">
|
||||
<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 bg-blue " style="white-space: nowrap;">立即验收</button>
|
||||
@@ -129,41 +129,41 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar tabbar bg-white">
|
||||
<view class="action">
|
||||
<view class="cuIcon-cu-image">
|
||||
<image src="/static/tabbar/组 20264.png"></image>
|
||||
</view>
|
||||
<view class="text-blue">首页</view>
|
||||
</view>
|
||||
<view class="action">
|
||||
<view class="cuIcon-cu-image">
|
||||
<image src="/static/tabbar/组 20261.png"></image>
|
||||
</view>
|
||||
<view class="text-gray">一张图</view>
|
||||
</view>
|
||||
<view class="action" @click="Inspectionwarning()">
|
||||
<view class="cuIcon-cu-image">
|
||||
<image src="/static/tabbar/组 20262.png"></image>
|
||||
</view>
|
||||
<view class="text-gray" >预警</view>
|
||||
</view>
|
||||
<view class="action" @click="my()">
|
||||
<view class="cuIcon-cu-image">
|
||||
<image src="/static/tabbar/组 20263.png"></image>
|
||||
</view>
|
||||
<view class="text-gray">我的</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import {getCheckPlanList} from '@/request/api.js'
|
||||
import {getCheckPlanList,getHiddenDangerList} from '@/request/api.js'
|
||||
|
||||
const loading = ref(true);
|
||||
|
||||
// 用户信息
|
||||
const userInfo = reactive({
|
||||
userId: '',
|
||||
username: '',
|
||||
nickName: '',
|
||||
deptId: '',
|
||||
deptName: ''
|
||||
});
|
||||
|
||||
// 获取用户信息
|
||||
const getUserInfo = () => {
|
||||
try {
|
||||
const storedUserInfo = uni.getStorageSync('userInfo');
|
||||
if (storedUserInfo) {
|
||||
const info = JSON.parse(storedUserInfo);
|
||||
userInfo.userId = info.userId || '';
|
||||
userInfo.username = info.username || '';
|
||||
userInfo.nickName = info.nickName || '';
|
||||
userInfo.deptId = info.deptId || '';
|
||||
userInfo.deptName = info.deptName || '';
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取用户信息失败:', e);
|
||||
}
|
||||
};
|
||||
const infoList = ref([{
|
||||
name: '成员管理',
|
||||
src: '../../static/组 19378.png'
|
||||
@@ -212,18 +212,6 @@
|
||||
url: `/pages/Inspectionresult/Inspectionresult?id=${item.id}`
|
||||
})
|
||||
}
|
||||
// 预警
|
||||
const Inspectionwarning = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/Inspectionwarning/Inspectionwarning'
|
||||
})
|
||||
}
|
||||
// 我的
|
||||
const my = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/personalcenter/my'
|
||||
})
|
||||
}
|
||||
// 菜单点击跳转
|
||||
const handleMenuClick = (item) => {
|
||||
const menuRoutes = {
|
||||
@@ -277,7 +265,35 @@
|
||||
|
||||
// 页面加载时调用接口
|
||||
onLoad(() => {
|
||||
getUserInfo();
|
||||
getCheckPlanLists();
|
||||
});
|
||||
//我的隐患排查
|
||||
const hiddenDangerParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: ''
|
||||
});
|
||||
const hiddenDangerData = ref([]);
|
||||
|
||||
const getHiddenDangerLists = async () => {
|
||||
try {
|
||||
const res = await getHiddenDangerList(hiddenDangerParams.value);
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
hiddenDangerData.value = res.data.records;
|
||||
console.log(hiddenDangerData.value,1111);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 页面加载时调用接口
|
||||
onLoad(() => {
|
||||
getHiddenDangerLists();
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -286,7 +302,8 @@
|
||||
.content {}
|
||||
|
||||
.grid-list {
|
||||
// gap: 5px 5px;
|
||||
gap: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
|
||||
27
pages/login/agreement.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<view>
|
||||
<web-view :webview-styles="webviewStyles" :src="articleUrl"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
|
||||
// 响应式数据
|
||||
const articleUrl = ref('');
|
||||
const webviewStyles = ref({
|
||||
progress: {
|
||||
color: '#3D83F6' // 使用蓝色主题色
|
||||
}
|
||||
});
|
||||
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
// 设置协议URL,实际使用时替换为真实的协议地址
|
||||
articleUrl.value = 'http://www.baidu.com/';
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 可以根据需要添加样式
|
||||
</style>
|
||||
214
pages/login/enterprise.vue
Normal file
@@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="padding solid radius margin">
|
||||
<up-form labelPosition="left" :model="state.model1" :rules="state.rules" ref="form1">
|
||||
<up-form-item :required="true" label="企业名称" prop="userInfo.name" :borderBottom="true" ref="item1" label-width="90">
|
||||
<up-input border="none" placeholder="请填写营业执照上的企业名称" inputAlign="right"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item :required="true" label="管理员姓名" prop="userInfo.name" :borderBottom="true" ref="item1" label-width="120">
|
||||
<up-input border="none" placeholder="请输入管理员姓名" inputAlign="right" ></up-input>
|
||||
</up-form-item>
|
||||
|
||||
</up-form>
|
||||
|
||||
<view class="margin-top-xl">
|
||||
<button class="round" :class="state.isAgreed ? 'bg-blue' : 'bg-gray'"
|
||||
:disabled="!state.isAgreed" @click="handleRegister">
|
||||
申请注册
|
||||
</button>
|
||||
</view>
|
||||
<!-- 用户协议复选框 -->
|
||||
<view class="protocol-agreement">
|
||||
<view class="protocol-checkbox" @click="toggleAgreement">
|
||||
<view class="checkbox" :class="{ 'checked': state.isAgreed }">
|
||||
<text class="checkmark" v-if="state.isAgreed">✓</text>
|
||||
</view>
|
||||
<text class="protocol-text">
|
||||
我已阅读并接受
|
||||
<text class="protocol-link" @click.stop="showProtocol('user')">《服务协议》</text>
|
||||
和
|
||||
<text class="protocol-link" @click.stop="showProtocol('privacy')">《隐私政策》</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 协议弹窗 -->
|
||||
<view class="container">
|
||||
<lsl-protocol-popup
|
||||
title="用户协议和隐私政策"
|
||||
predesc="为了更好地保护您的个人信息和合法权益,在使用我们的服务前,请您务必仔细阅读并充分理解以下协议条款。"
|
||||
subdesc='请您详细阅读各条款内容,特别是免除或限制责任的条款。如您同意以下协议条款,请点击"同意并继续"开始使用我们的服务。'
|
||||
color="#007AFF"
|
||||
:onNeed='state.showProtocolPopup'
|
||||
@agree="handleAgreeProtocol"
|
||||
@close="closeProtocolPopup"
|
||||
:other="other"
|
||||
open_type='getPhoneNumber|agreePrivacyAuthorization'>
|
||||
</lsl-protocol-popup>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onUnmounted,reactive } from 'vue';
|
||||
// 使用 reactive 创建响应式状态
|
||||
const state = reactive({
|
||||
showSex: false,
|
||||
isAgreed: false, // 用户是否同意协议
|
||||
showProtocolPopup: false, // 是否显示协议弹窗
|
||||
model1: {
|
||||
userInfo: {
|
||||
name: 'uview-plus UI',
|
||||
sex: '',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'userInfo.name': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请填写姓名',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// 切换协议同意状态
|
||||
const toggleAgreement = () => {
|
||||
state.isAgreed = !state.isAgreed;
|
||||
};
|
||||
|
||||
// 显示协议内容
|
||||
const showProtocol = (type) => {
|
||||
if (type === 'user') {
|
||||
// 跳转到用户协议页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/agreement'
|
||||
});
|
||||
} else if (type === 'privacy') {
|
||||
// 显示隐私政策弹窗
|
||||
state.showProtocolPopup = true;
|
||||
}
|
||||
};
|
||||
|
||||
// 处理注册按钮点击
|
||||
const handleRegister = () => {
|
||||
if (!state.isAgreed) {
|
||||
uni.showToast({
|
||||
title: '请先阅读并同意用户协议和隐私政策',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 这里可以添加注册逻辑
|
||||
console.log('开始注册流程');
|
||||
};
|
||||
|
||||
// 同意协议回调
|
||||
const handleAgreeProtocol = () => {
|
||||
state.isAgreed = true;
|
||||
state.showProtocolPopup = false;
|
||||
uni.showToast({
|
||||
title: '已同意协议条款',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
});
|
||||
};
|
||||
|
||||
// 关闭协议弹窗
|
||||
const closeProtocolPopup = () => {
|
||||
state.showProtocolPopup = false;
|
||||
};
|
||||
|
||||
// 获取列表(原方法保留)
|
||||
const getList = () => {
|
||||
console.log('获取列表');
|
||||
};
|
||||
|
||||
// 用户协议配置
|
||||
const other = [
|
||||
[
|
||||
{
|
||||
tit: '《服务协议》',
|
||||
type: 'page', // doc自行下载打开文档 page跳转页面
|
||||
content: '/pages/login/agreement', // 文档地址/页面跳转地址
|
||||
},
|
||||
{
|
||||
tit: '《隐私政策》',
|
||||
type: 'page', // doc自行下载打开文档 page跳转页面
|
||||
content: '/pages/login/privacy', // 文档地址/页面跳转地址
|
||||
}
|
||||
]
|
||||
]
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 协议同意区域 */
|
||||
.protocol-agreement {
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.protocol-checkbox {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 15rpx;
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
border: 2rpx solid #ddd;
|
||||
border-radius: 6rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
transition: all 0.3s ease;
|
||||
margin-top: 2rpx;
|
||||
}
|
||||
|
||||
.checkbox.checked {
|
||||
background-color: #007AFF;
|
||||
border-color: #007AFF;
|
||||
}
|
||||
|
||||
.checkmark {
|
||||
color: white;
|
||||
font-size: 20rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.protocol-text {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.protocol-link {
|
||||
color: #007AFF;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 注册按钮样式 */
|
||||
.bg-gray {
|
||||
background-color: #ccc !important;
|
||||
color: #999 !important;
|
||||
}
|
||||
|
||||
.bg-blue {
|
||||
background-color: #007AFF !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
button[disabled] {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
button:not([disabled]):active {
|
||||
transform: scale(0.98);
|
||||
transition: transform 0.1s ease;
|
||||
}
|
||||
</style>
|
||||
296
pages/login/forget.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- 添加ColorUI自定义导航栏 -->
|
||||
<cu-custom :isBack="true">
|
||||
<view slot="backText">返回</view>
|
||||
<view slot="content">忘记密码</view>
|
||||
</cu-custom>
|
||||
|
||||
<view class="list">
|
||||
<view class="tishi">若您忘记了密码,可在此重新设置新密码。</view>
|
||||
<view class="list-call">
|
||||
<image class="img" src="/static/index/phone.png"></image>
|
||||
<input class="sl-input" type="number" v-model="phone" maxlength="11" placeholder="请输入手机号" />
|
||||
</view>
|
||||
<view class="list-call">
|
||||
<image class="img" src="/static/index/lock.png"></image>
|
||||
<input class="sl-input" type="text" v-model="password" maxlength="32" placeholder="请输入新密码" :password="!showPassword" />
|
||||
<text class="eye-icon" :class="{'eye-active': showPassword}" @tap="togglePassword"></text>
|
||||
</view>
|
||||
<view class="list-call">
|
||||
<!-- <image class="img" src="/static/index/code.png"></image> -->
|
||||
<!-- <input class="sl-input" type="number" v-model="code" maxlength="4" placeholder="验证码" /> -->
|
||||
<view class="yzm" :class="{ yzms: second > 0 }" @tap="getCode">{{codeText}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="padding-lr">
|
||||
<view class="button-login" hover-class="button-hover" @tap="handleReset">
|
||||
<text>修改密码</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onUnmounted } from 'vue';
|
||||
|
||||
// 响应式数据
|
||||
const phone = ref('');
|
||||
const password = ref('');
|
||||
const code = ref('');
|
||||
const second = ref(0);
|
||||
const showPassword = ref(false);
|
||||
let timer = null;
|
||||
|
||||
// 计算属性
|
||||
const codeText = computed(() => {
|
||||
if (second.value === 0) {
|
||||
return '获取验证码';
|
||||
} else {
|
||||
const secondStr = second.value < 10 ? `0${second.value}` : second.value;
|
||||
return `重新获取${secondStr}`;
|
||||
}
|
||||
});
|
||||
|
||||
// 方法定义
|
||||
const togglePassword = () => {
|
||||
showPassword.value = !showPassword.value;
|
||||
};
|
||||
|
||||
const getCode = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '手机号不正确'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (second.value > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
second.value = 60;
|
||||
startCountdown();
|
||||
|
||||
// 发送验证码请求
|
||||
uni.request({
|
||||
url: 'http://example.com/api/code',
|
||||
data: {
|
||||
phone: phone.value,
|
||||
type: 'forget'
|
||||
},
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
uni.showToast({
|
||||
title: res.data.msg || '获取验证码失败',
|
||||
icon: 'none'
|
||||
});
|
||||
second.value = 0;
|
||||
clearCountdown();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.msg || '验证码已发送'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: '网络请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
second.value = 0;
|
||||
clearCountdown();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const startCountdown = () => {
|
||||
clearCountdown();
|
||||
timer = setInterval(() => {
|
||||
second.value--;
|
||||
if (second.value === 0) {
|
||||
clearCountdown();
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const clearCountdown = () => {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
};
|
||||
|
||||
const handleReset = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '手机号不正确'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (password.value.length < 6) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '密码不正确'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (code.value.length !== 4) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '验证码不正确'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 修改密码请求
|
||||
uni.request({
|
||||
url: 'http://example.com/api/forget',
|
||||
data: {
|
||||
phone: phone.value,
|
||||
password: password.value,
|
||||
code: code.value
|
||||
},
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
uni.showToast({
|
||||
title: res.data.msg || '修改密码失败',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.msg || '修改密码成功'
|
||||
});
|
||||
|
||||
// 延时返回登录页
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: '网络请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 组件卸载时清除定时器
|
||||
onUnmounted(() => {
|
||||
clearCountdown();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.tishi {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
line-height: 50rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 50rpx;
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
|
||||
.list-call {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
color: #333333;
|
||||
background: #F5F7FB;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F5F7FB;
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.img {
|
||||
width: 30rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.sl-input {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.eye-icon {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
&::before {
|
||||
content: '\e69c'; /* 闭眼图标的unicode */
|
||||
}
|
||||
|
||||
&.eye-active {
|
||||
color: #3D83F6;
|
||||
&::before {
|
||||
content: '\e69d'; /* 睁眼图标的unicode */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.yzm {
|
||||
width: 200rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #3D83F6;
|
||||
&.yzms {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.padding-lr {
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
|
||||
.button-login {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #3E95F1 0%, #4269F5 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 130rpx;
|
||||
}
|
||||
|
||||
.button-hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
</style>
|
||||
391
pages/login/login.vue
Normal file
@@ -0,0 +1,391 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="header">
|
||||
<image src="/static/index/index_bg.png" class="bg-image"></image>
|
||||
<view class="padding login">
|
||||
<view class="text-xl text-black text-bold">账号登录</view>
|
||||
<view class="padding-top">欢迎登录三查一曝光平台</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="list">
|
||||
<view class="list-call">
|
||||
<image class="img" src="/static/index/phone.png"></image>
|
||||
<input class="sl-input" v-model="username" type="text" placeholder="请输入用户名" />
|
||||
</view>
|
||||
<view class="list-call">
|
||||
<image class="img" src="/static/index/lock.png"></image>
|
||||
<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>
|
||||
</view>
|
||||
<view class="agreement">
|
||||
<navigator url="reg" open-type="navigate" class="link">注册成员账号</navigator>
|
||||
<navigator url="forget" open-type="navigate" class="link">忘记密码?</navigator>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="padding-lr">
|
||||
<button class="button-login" hover-class="button-hover" @click="handleLogin">
|
||||
登录
|
||||
</button>
|
||||
<!-- <view class="button-login" hover-class="button-hover" @tap="handleLogin('member')">
|
||||
<text>登录普通成员</text>
|
||||
</view> -->
|
||||
|
||||
<view class="button-report margin-top" hover-class="button-hover" @tap="goToReport">
|
||||
<image src="/static/index/photos.png" class="icon-image"></image>
|
||||
<text>随手拍举报</text>
|
||||
</view>
|
||||
|
||||
<!-- <view class="protocol-box">
|
||||
<navigator url="agreement" open-type="navigate" class="protocol-link">《用户协议》</navigator>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { login } from '@/request/api.js';
|
||||
|
||||
// 响应式数据
|
||||
const username = ref('');
|
||||
const password = ref('');
|
||||
const showPassword = ref(true);
|
||||
|
||||
// 方法定义
|
||||
const changePassword = () => {
|
||||
showPassword.value = !showPassword.value;
|
||||
}
|
||||
|
||||
const getPhoneNumber = () => {
|
||||
// 获取手机号的逻辑,可以接入一键登录SDK
|
||||
uni.showToast({
|
||||
title: '获取手机号功能待实现',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
const handleLogin = async () => {
|
||||
console.log('点击登录按钮');
|
||||
console.log('用户名:', username.value);
|
||||
console.log('密码:', password.value);
|
||||
|
||||
// 验证用户名
|
||||
if (!username.value) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入用户名'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证密码
|
||||
if (!password.value) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入密码'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
console.log('开始调用登录接口...');
|
||||
|
||||
const res = await login({
|
||||
username: username.value,
|
||||
password: password.value
|
||||
});
|
||||
|
||||
console.log('登录接口返回:', res);
|
||||
|
||||
if (res.code === 0) {
|
||||
// 登录成功,保存token和用户信息
|
||||
if (res.data.token) {
|
||||
uni.setStorageSync('token', res.data.token);
|
||||
}
|
||||
// 保存用户信息
|
||||
const userInfo = {
|
||||
userId: res.data.userId,
|
||||
username: res.data.username,
|
||||
nickName: res.data.nickName,
|
||||
deptId: res.data.deptId,
|
||||
deptName: res.data.deptName
|
||||
};
|
||||
uni.setStorageSync('userInfo', JSON.stringify(userInfo));
|
||||
|
||||
uni.showToast({
|
||||
title: '登录成功',
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}, 1500);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || '登录失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('登录失败:', error);
|
||||
uni.showToast({
|
||||
title: '网络请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// const handleLogin = () => {
|
||||
// if (phone.value.length != 11) {
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// title: '手机号不正确'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// if (password.value.length < 6) {
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// title: '密码不正确'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 登录请求
|
||||
// uni.request({
|
||||
// url: 'http://example.com/api/login',
|
||||
// data: {
|
||||
// phone: phone.value,
|
||||
// password: password.value
|
||||
// },
|
||||
// method: 'POST',
|
||||
// dataType: 'json',
|
||||
// success: (res) => {
|
||||
// if (res.data.code != 200) {
|
||||
// uni.showToast({
|
||||
// title: res.data.msg || '登录失败',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// } else {
|
||||
// // 登录成功,保存token等信息
|
||||
// uni.setStorageSync('token', res.data.data.token);
|
||||
// uni.setStorageSync('userInfo', JSON.stringify(res.data.data.userInfo));
|
||||
|
||||
// // 返回上一页或首页
|
||||
// uni.navigateBack({
|
||||
// delta: 1,
|
||||
// fail: () => {
|
||||
// uni.switchTab({
|
||||
// url: '/pages/index/index'
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// fail: () => {
|
||||
// uni.showToast({
|
||||
// title: '网络请求失败',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
const goToReport = () => {
|
||||
//跳转到主页面 跳到分包
|
||||
uni.navigateTo({
|
||||
url: '/subpackages/suishoupai/pages/index/index'
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.header {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
margin-bottom: 0;
|
||||
|
||||
.bg-image {
|
||||
width: 100%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
|
||||
.login {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
color: #666666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 50rpx;
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
background-color: #FFFFFF;
|
||||
margin-top: -2rpx; /* 消除可能的间隙 */
|
||||
|
||||
.list-call {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
color: #333333;
|
||||
background: #F5F7FB;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F5F7FB;
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.img {
|
||||
width: 30rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.sl-input {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.eye-img {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.agreement {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
color: #3D83F6;
|
||||
text-align: center;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
|
||||
.link {
|
||||
font-size: 30rpx;
|
||||
color: #3D83F6;
|
||||
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.padding-lr {
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
|
||||
.button-login {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #3E95F1 0%, #4269F5 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 130rpx;
|
||||
border: none;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
.button-report {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #FF7878 0%, #F2505B 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.margin-top {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.button-hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.text-blue {
|
||||
color: #3D83F6;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.icon-image {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.text-xl {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.text-black {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.text-bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.padding {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.padding-top {
|
||||
padding-top: 15rpx;
|
||||
}
|
||||
|
||||
.protocol-box {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.protocol-link {
|
||||
font-size: 28rpx;
|
||||
color: #3D83F6;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
365
pages/login/reg.vue
Normal file
@@ -0,0 +1,365 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- 加一个自定义导航栏 -->
|
||||
|
||||
|
||||
<view class="header">
|
||||
<!-- <image src="/static/index/index_bg.png"></image> -->
|
||||
<cu-custom :isBack="true">
|
||||
<view slot="backText">返回</view>
|
||||
<view slot="content">注册新成员账号</view>
|
||||
</cu-custom>
|
||||
</view>
|
||||
<!--
|
||||
<view class="list">
|
||||
<view class="list-call">
|
||||
<image class="img" src="/static/index/phone.png"></image>
|
||||
<input class="sl-input" v-model="phone" type="number" maxlength="11" placeholder="手机号" />
|
||||
</view>
|
||||
<view class="list-call">
|
||||
<image class="img" src="/static/index/lock.png"></image>
|
||||
<input class="sl-input" v-model="password" type="text" maxlength="32" placeholder="登录密码" :password="!showPassword" />
|
||||
<text class="eye-icon" :class="{'eye-active': showPassword}" @tap="togglePassword"></text>
|
||||
</view>
|
||||
<view class="list-call">
|
||||
<text class="code-icon"></text>
|
||||
<input class="sl-input" v-model="code" type="number" maxlength="4" placeholder="验证码" />
|
||||
<view class="yzm" :class="{ yzms: second > 0 }" @tap="getCode">{{codeText}}</view>
|
||||
</view>
|
||||
<view class="list-call">
|
||||
<text class="invite-icon"></text>
|
||||
<input class="sl-input" v-model="invitation" type="text" maxlength="12" placeholder="邀请码" />
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="padding solid radius margin">
|
||||
<up-form labelPosition="left" :model="state.model1" :rules="state.rules" ref="form1">
|
||||
<up-form-item label="加入企业" prop="userInfo.name" :borderBottom="true" ref="item1" label-width="90">
|
||||
<up-input border="none" placeholder="请输入企业名称" inputAlign="right"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item :required="true" label="真实姓名" prop="userInfo.name" :borderBottom="true" ref="item1" label-width="90">
|
||||
<up-input border="none" placeholder="请输入" inputAlign="right"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item :required="true" label="选择分组/部门" prop="userInfo.name" :borderBottom="true" ref="item1" label-width="120">
|
||||
<up-input border="none" placeholder="选择" inputAlign="right" ></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item :required="true" label="手机号码" prop="userInfo.name" :borderBottom="true" ref="item1" label-width="90">
|
||||
<up-input border="none" placeholder="请输入手机号码" inputAlign="right"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item :required="true" label="密码" prop="userInfo.name" :borderBottom="true" ref="item1" label-width="90">
|
||||
<up-input border="none" placeholder="请输入密码" inputAlign="right"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item :required="true" label="确认密码" prop="userInfo.name" :borderBottom="true" ref="item1" label-width="90">
|
||||
<up-input border="none" placeholder="请输入密码" inputAlign="right"></up-input>
|
||||
</up-form-item>
|
||||
</up-form>
|
||||
<view class="">
|
||||
<view class="button-login" hover-class="button-hover" @tap="handleRegister">
|
||||
<text>申请加入</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onUnmounted,reactive } from 'vue';
|
||||
|
||||
// 响应式数据
|
||||
const phone = ref('');
|
||||
const password = ref('');
|
||||
const code = ref('');
|
||||
const invitation = ref('');
|
||||
const second = ref(0);
|
||||
const showPassword = ref(false);
|
||||
let timer = null;
|
||||
|
||||
// 使用 reactive 创建响应式状态
|
||||
const state = reactive({
|
||||
showSex: false,
|
||||
model1: {
|
||||
userInfo: {
|
||||
name: 'uview-plus UI',
|
||||
sex: '',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'userInfo.name': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请填写姓名',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
},
|
||||
});
|
||||
// 计算属性
|
||||
const codeText = computed(() => {
|
||||
if (second.value === 0) {
|
||||
return '获取验证码';
|
||||
} else {
|
||||
const secondStr = second.value < 10 ? `0${second.value}` : second.value;
|
||||
return `重新获取${secondStr}`;
|
||||
}
|
||||
});
|
||||
|
||||
// 方法定义
|
||||
const togglePassword = () => {
|
||||
showPassword.value = !showPassword.value;
|
||||
};
|
||||
|
||||
const getCode = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '手机号不正确'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (second.value > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
second.value = 60;
|
||||
startCountdown();
|
||||
|
||||
// 发送验证码请求
|
||||
uni.request({
|
||||
url: 'http://example.com/api/code',
|
||||
data: {
|
||||
phone: phone.value,
|
||||
type: 'reg'
|
||||
},
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
uni.showToast({
|
||||
title: res.data.msg || '获取验证码失败',
|
||||
icon: 'none'
|
||||
});
|
||||
second.value = 0;
|
||||
clearCountdown();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.msg || '验证码已发送'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: '网络请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
second.value = 0;
|
||||
clearCountdown();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const startCountdown = () => {
|
||||
clearCountdown();
|
||||
timer = setInterval(() => {
|
||||
second.value--;
|
||||
if (second.value === 0) {
|
||||
clearCountdown();
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const clearCountdown = () => {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
};
|
||||
|
||||
const handleRegister = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '手机号不正确'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (password.value.length < 6) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '密码不正确'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (code.value.length !== 4) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '验证码不正确'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 注册请求
|
||||
uni.request({
|
||||
url: 'http://example.com/api/register',
|
||||
data: {
|
||||
phone: phone.value,
|
||||
password: password.value,
|
||||
code: code.value,
|
||||
invitation: invitation.value
|
||||
},
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
uni.showToast({
|
||||
title: res.data.msg || '注册失败',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.msg || '注册成功'
|
||||
});
|
||||
|
||||
// 延时返回登录页
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: '网络请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 组件卸载时清除定时器
|
||||
onUnmounted(() => {
|
||||
clearCountdown();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.header {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 50rpx;
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
|
||||
.list-call {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
color: #333333;
|
||||
background: #F5F7FB;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F5F7FB;
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.img {
|
||||
width: 30rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.sl-input {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.eye-icon {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
&::before {
|
||||
content: '\e69c'; /* 闭眼图标的unicode */
|
||||
}
|
||||
|
||||
&.eye-active {
|
||||
color: #3D83F6;
|
||||
&::before {
|
||||
content: '\e69d'; /* 睁眼图标的unicode */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.yzm {
|
||||
width: 200rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #3D83F6;
|
||||
&.yzms {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.code-icon::before {
|
||||
content: '\e682'; /* 验证码图标的unicode */
|
||||
color: #999;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.invite-icon::before {
|
||||
content: '\e683'; /* 邀请码图标的unicode */
|
||||
color: #999;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
// .padding-lr {
|
||||
// padding-left: 70rpx;
|
||||
// padding-right: 70rpx;
|
||||
// }
|
||||
|
||||
.button-login {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #3E95F1 0%, #4269F5 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 130rpx;
|
||||
}
|
||||
|
||||
.button-hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
::v-deep .up-input__input {
|
||||
color: #3D83F6;
|
||||
}
|
||||
</style>
|
||||
31
pages/login/success.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 注册成功 -->
|
||||
<view class="text-center" v-if="success">
|
||||
<image src="/static/index/蒙版组 260.png" style="width: 160rpx;height: 160rpx;margin-top: 140rpx;"></image>
|
||||
<view class="text-bold margin-bottom-xl margin-top-xl">注册成功</view>
|
||||
<view class="text-gray">等待管理员确认后,才能进行账号登录</view>
|
||||
<button class="bg-blue round lg but ">返回首页</button>
|
||||
</view>
|
||||
<!-- 注册异常 -->
|
||||
<view class="text-center" v-else>
|
||||
<image src="/static/index/蒙版组 261.png" style="width: 160rpx;height: 160rpx;margin-top: 140rpx;"></image>
|
||||
<view class="text-bold margin-bottom-xl margin-top-xl">注册异常</view>
|
||||
<view class="text-gray">员工已注册,如账号异常请联系管理员</view>
|
||||
<button class="bg-blue round lg but ">返回首页</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const success = true
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.but {
|
||||
width: 248rpx;
|
||||
height: 88rpx;
|
||||
margin-top: 100rpx;
|
||||
|
||||
}
|
||||
</style>
|
||||
18
pages/map/map.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="text-center padding-top-xl">
|
||||
<text class="text-xl text-gray">一张图功能开发中...</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class=" page padding ">
|
||||
<view class=" padding bg-white radius">
|
||||
<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="flex align-center">
|
||||
<view class="border-tite"></view>
|
||||
@@ -11,22 +11,24 @@
|
||||
</view>
|
||||
|
||||
<view class="flex margin-top">
|
||||
<view class="cu-avatar radius lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg);"></view>
|
||||
<view class="cu-avatar radius lg"
|
||||
style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg);">
|
||||
</view>
|
||||
<view class="margin-left">
|
||||
<view class="flex">
|
||||
<view>罗燚</view>
|
||||
<view class="margin-left-xs light bg-olive padding-left-xs padding-right-xs">正常</view>
|
||||
<view>{{item.nickName}}</view>
|
||||
<view class="margin-left-xs light bg-olive padding-left-xs padding-right-xs">{{item.statusName}}</view>
|
||||
</view>
|
||||
<view class="flex text-gray">
|
||||
<view>手机设置:</view>
|
||||
<view>未设置</view>
|
||||
<view>{{item.phonenumber}}</view>
|
||||
</view>
|
||||
<view class="flex text-gray">
|
||||
<view>登录IP:</view>
|
||||
<view>45.135.228.172</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="bg-blue btn-lock" @click="Lock()">锁定</button>
|
||||
<button class="bg-blue btn-lock" @click="Lock(item)">{{ item.lockStatus === 1 ? '解锁' : '锁定' }}</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -73,6 +75,8 @@
|
||||
{{ formData.department || '请选择主部门' }}
|
||||
</text>
|
||||
</view>
|
||||
<up-picker :show="showDeptPicker" :columns="deptColumns" @confirm="onDeptConfirm"
|
||||
@cancel="showDeptPicker = false" @close="showDeptPicker = false"></up-picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -82,13 +86,18 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<TabBar />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref,reactive } from 'vue';
|
||||
|
||||
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);
|
||||
|
||||
@@ -99,50 +108,124 @@ const formData = reactive({
|
||||
password: '',
|
||||
department: ''
|
||||
});
|
||||
|
||||
const handleSubmit = () => {
|
||||
const handleSubmit = async () => {
|
||||
// 表单验证
|
||||
if (!formData.username) {
|
||||
uni.showToast({ title: '请输入用户名', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请输入用户名',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!formData.password || formData.password.length < 6 || formData.password.length > 16) {
|
||||
uni.showToast({ title: '请输入6-16位密码', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!formData.department) {
|
||||
uni.showToast({ title: '请选择主部门', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请输入6-16位密码',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 提交逻辑
|
||||
console.log('提交数据:', formData);
|
||||
uni.showToast({ title: '添加成功', icon: 'success' });
|
||||
showPopup.value = false;
|
||||
// 构建请求参数(根据接口要求的字段名)
|
||||
const params = {
|
||||
userName: formData.username,
|
||||
nickName: formData.nickname || '',
|
||||
phonenumber: formData.phone || '',
|
||||
password: formData.password,
|
||||
roleType: 'common'
|
||||
};
|
||||
|
||||
// 锁定成员
|
||||
const Lock = () => {
|
||||
try {
|
||||
const res = await addMember(params);
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '添加成功',
|
||||
icon: 'success'
|
||||
});
|
||||
showPopup.value = false;
|
||||
// 重置表单
|
||||
formData.username = '';
|
||||
formData.nickname = '';
|
||||
formData.phone = '';
|
||||
formData.password = '';
|
||||
formData.department = '';
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || '添加失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('添加成员失败:', error);
|
||||
uni.showToast({
|
||||
title: '请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 锁定/解锁成员
|
||||
const Lock = (item) => {
|
||||
// 当前是锁定状态则解锁,否则锁定
|
||||
const isLocked = item.lockStatus === 1;
|
||||
const actionText = isLocked ? '解锁' : '锁定';
|
||||
const newLockStatus = isLocked ? 0 : 1;
|
||||
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要锁定该成员吗?',
|
||||
content: `确定要${actionText}该成员吗?`,
|
||||
confirmColor: '#2667E9',
|
||||
success: (res) => {
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
// 确认锁定
|
||||
console.log('用户点击确定');
|
||||
uni.showToast({ title: '锁定成功', icon: 'success' });
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
try {
|
||||
const result = await lockOrUnlockMember({
|
||||
userId: item.userId,
|
||||
lockStatus: newLockStatus
|
||||
});
|
||||
if (result.code === 0) {
|
||||
uni.showToast({
|
||||
title: `${actionText}成功`,
|
||||
icon: 'success'
|
||||
});
|
||||
// 更新本地状态
|
||||
item.lockStatus = newLockStatus;
|
||||
item.statusName = newLockStatus === 1 ? '已锁定' : '正常';
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: result.msg || `${actionText}失败`,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`${actionText}成员失败:`, error);
|
||||
uni.showToast({
|
||||
title: '请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
//选择部门
|
||||
//选择部门(顶部切换用)
|
||||
const show = ref(false);
|
||||
const columns = reactive([
|
||||
['湘西自治州和谐网络科技有限公司', '湘西自治州和谐云科技有限公司']
|
||||
]);
|
||||
|
||||
// 主部门选择器数据
|
||||
const deptColumns = reactive([
|
||||
['湘西自治州和谐网络科技有限公司', '湘西自治州和谐云科技有限公司', '研发部门', '深圳总公司', '若依科技']
|
||||
]);
|
||||
|
||||
// 主部门选择确认
|
||||
const onDeptConfirm = (e) => {
|
||||
console.log('选择的部门:', e);
|
||||
// e.value 是选中的值数组
|
||||
if (e.value && e.value.length > 0) {
|
||||
formData.department = e.value[0];
|
||||
}
|
||||
showDeptPicker.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<view class="lg text-gray cuIcon-right"></view>
|
||||
</view>
|
||||
</view>
|
||||
<button class=" bg-blue round margin-top-xl ">退出登录</button>
|
||||
<button class=" bg-blue round margin-top-xl " @click="handleLogout()">退出登录</button>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
@@ -98,6 +98,24 @@
|
||||
url:'/pages/personalcenter/account'
|
||||
})
|
||||
}
|
||||
//退出登录
|
||||
const handleLogout = () => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要退出登录吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.clearStorageSync()
|
||||
uni.reLaunch({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@@ -37,6 +37,14 @@ export function addHiddenDanger(params) {
|
||||
data: params
|
||||
});
|
||||
}
|
||||
//交办隐患
|
||||
export function assignHiddenDanger(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/hazard/assign',
|
||||
method: 'POST',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
//文件图片上传
|
||||
export function uploadFile(params) {
|
||||
return requestAPI({
|
||||
@@ -61,6 +69,15 @@ export function getHiddenDangerDetail(params) {
|
||||
data: params
|
||||
});
|
||||
}
|
||||
//获取隐患排查列表
|
||||
export function getHiddenDangerList(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/hazard/my/list',
|
||||
method: 'GET',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
//提交整改
|
||||
export function submitRectification(params) {
|
||||
return requestAPI({
|
||||
@@ -76,3 +93,80 @@ export function getHiddenDangerLabelList() {
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
//获取部门人员列表(本部门、上级部门、上上级部门)
|
||||
export function getDepartmentPersonUsers(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/hazard/dept/users',
|
||||
method: 'GET',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
//成员管理
|
||||
//添加成员
|
||||
export function addMember(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/member/add',
|
||||
method: 'POST',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
//获取成员列表
|
||||
export function getMemberList(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/member/list',
|
||||
method: 'GET',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
//锁定/解锁成员
|
||||
export function lockOrUnlockMember(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/member/lock',
|
||||
method: 'POST',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
//销号申请
|
||||
//申请销号
|
||||
export function applyDelete(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/hazard/writeoff/apply',
|
||||
method: 'POST',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
//获取验收完成的隐患列表(可申请销号)
|
||||
export function getAcceptanceList(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/hazard/verified/list',
|
||||
method: 'GET',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
//获取我的销号申请列表
|
||||
export function getMyWriteOffList(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/hazard/writeoff/my/list',
|
||||
method: 'GET',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
//验收整改
|
||||
export function acceptanceRectification(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/hazard/verify',
|
||||
method: 'POST',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
//登录
|
||||
export function login(params) {
|
||||
return requestAPI({
|
||||
url: '/frontend/auth/login',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
noAuth: true // 登录接口不需要 Authorization
|
||||
});
|
||||
}
|
||||
@@ -7,15 +7,14 @@ import Request from './luch-request/index.js';
|
||||
|
||||
const http = new Request({
|
||||
baseURL: baseUrl,
|
||||
timeout: 10000,
|
||||
header: {
|
||||
// 'content-type': 'application/json',
|
||||
'Authorization': "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiNzQ5NGU2MzAtNTRlYS00ZTM5LWIxYjUtNzc2MzY5NTRhYmJmIn0.7l5CMwFitlpXniZ6PTR5DqN8ASFTFZ1DCUZKjOtr5CpuXWiPHeSW19nY8XKfGdxMvB7j-OnXuSznLRjx-N7K9g"
|
||||
}
|
||||
timeout: 10000
|
||||
})
|
||||
|
||||
// 固定的 token
|
||||
const AUTH_TOKEN = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiNTQyMjJlODYtZDUyNS00ZTA0LWI3Y2QtMGU1ZWYzYmIwM2EwIn0.x8zPXafDGVjIDIcAdWsWT3F2fU20QHVLFR15b251LfwpfRt_UaDo1-bvHEyi8hxqVkiStOqi09TTUTPBgjPYkw";
|
||||
// 动态获取 token(从登录接口存储的)
|
||||
const getToken = () => {
|
||||
const token = uni.getStorageSync('token');
|
||||
return token ? `Bearer ${token}` : '';
|
||||
};
|
||||
// 请求之前查看是否为空
|
||||
const isEmptyObject = (obj) => {
|
||||
return Object.keys(obj).length === 0;
|
||||
@@ -44,7 +43,7 @@ function showToast(title) {
|
||||
// 请求
|
||||
const requestAPI = (config) => {
|
||||
// 支持对象参数或传统参数
|
||||
let { url, method = 'GET', data = {} } = typeof config === 'object' && config.url ? config : { url: config, method: arguments[1] || 'GET', data: arguments[2] || {} };
|
||||
let { url, method = 'GET', data = {}, noAuth = false } = typeof config === 'object' && config.url ? config : { url: config, method: arguments[1] || 'GET', data: arguments[2] || {} };
|
||||
|
||||
if (method == 'GET' && !isEmptyObject(data)) {
|
||||
url += '?' + objectToQueryString(data);
|
||||
@@ -53,14 +52,24 @@ const requestAPI = (config) => {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
|
||||
// 构建 header,登录等接口不需要 Authorization
|
||||
const header = {
|
||||
'Content-Type': 'application/json'
|
||||
};
|
||||
if (!noAuth) {
|
||||
const token = getToken();
|
||||
if (token) {
|
||||
header['Authorization'] = token;
|
||||
}
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: baseUrl + url,
|
||||
method,
|
||||
data,
|
||||
header: {
|
||||
'Authorization': AUTH_TOKEN
|
||||
},
|
||||
header,
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
|
||||
@@ -79,8 +88,14 @@ const requestAPI = (config) => {
|
||||
resolve(res.data);
|
||||
} else if (res.data.code === 401) {
|
||||
// token过期处理
|
||||
uni.removeStorageSync('_user_token_');
|
||||
uni.removeStorageSync('token');
|
||||
uni.removeStorageSync('userInfo');
|
||||
showToast('登录已过期,请重新登录');
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}, 1500);
|
||||
reject('401');
|
||||
} else {
|
||||
showToast(res.data.msg || '请求失败');
|
||||
@@ -109,4 +124,4 @@ const requestAPI = (config) => {
|
||||
};
|
||||
|
||||
// 文件末尾应该导出
|
||||
export { requestAPI,baseUrl,AUTH_TOKEN };
|
||||
export { requestAPI, baseUrl, getToken };
|
||||
BIN
static/index/Bell2x.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
static/index/Bell_BG2x.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
static/index/cl.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
static/index/eye.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/index/index_bg.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
static/index/index_bg2.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
static/index/lock.png
Normal file
|
After Width: | Height: | Size: 780 B |
BIN
static/index/op.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/index/phone.png
Normal file
|
After Width: | Height: | Size: 513 B |
BIN
static/index/photos.png
Normal file
|
After Width: | Height: | Size: 609 B |
BIN
static/index/蒙版组 260.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
static/index/蒙版组 261.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 539 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 947 B After Width: | Height: | Size: 947 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
8
unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -4,6 +4,7 @@ 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";
|
||||
@@ -18,6 +19,7 @@ if (!Math) {
|
||||
"./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";
|
||||
@@ -29,6 +31,12 @@ if (!Math) {
|
||||
"./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() {
|
||||
|
||||
51
unpackage/dist/dev/mp-weixin/app.json
vendored
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/map/map",
|
||||
"pages/plandetail/plandetail",
|
||||
"pages/Inspectionresult/Inspectionresult",
|
||||
"pages/membermanagemen/membermanagemen",
|
||||
@@ -15,6 +16,7 @@
|
||||
"pages/hiddendanger/view",
|
||||
"pages/hiddendanger/rectification",
|
||||
"pages/hiddendanger/acceptance",
|
||||
"pages/hiddendanger/assignment",
|
||||
"pages/closeout/application",
|
||||
"pages/closeout/editor",
|
||||
"pages/equipmentregistration/equipmentregistration",
|
||||
@@ -25,7 +27,13 @@
|
||||
"pages/personalcenter/notification",
|
||||
"pages/personalcenter/settings",
|
||||
"pages/personalcenter/account",
|
||||
"pages/personalcenter/edit"
|
||||
"pages/personalcenter/edit",
|
||||
"pages/login/login",
|
||||
"pages/login/reg",
|
||||
"pages/login/enterprise",
|
||||
"pages/login/success",
|
||||
"pages/login/forget",
|
||||
"pages/login/agreement"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "white",
|
||||
@@ -33,5 +41,46 @@
|
||||
"navigationBarBackgroundColor": "#007aff",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#999999",
|
||||
"selectedColor": "#007aff",
|
||||
"borderStyle": "black",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "首页",
|
||||
"iconPath": "static/tabBar/home.png",
|
||||
"selectedIconPath": "static/tabBar/home.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/map/map",
|
||||
"text": "一张图",
|
||||
"iconPath": "static/tabBar/map.png",
|
||||
"selectedIconPath": "static/tabBar/map.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/Inspectionwarning/Inspectionwarning",
|
||||
"text": "预警",
|
||||
"iconPath": "static/tabBar/warning.png",
|
||||
"selectedIconPath": "static/tabBar/warning.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/personalcenter/my",
|
||||
"text": "我的",
|
||||
"iconPath": "static/tabBar/my.png",
|
||||
"selectedIconPath": "static/tabBar/my.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于选择隐患位置"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos": [
|
||||
"chooseLocation",
|
||||
"getLocation"
|
||||
],
|
||||
"usingComponents": {}
|
||||
}
|
||||
36
unpackage/dist/dev/mp-weixin/common/assets.js
vendored
@@ -1,27 +1,29 @@
|
||||
"use strict";
|
||||
const _imports_0$2 = "/static/蒙版组 273.png";
|
||||
const _imports_1$2 = "/static/tabbar/组 20264.png";
|
||||
const _imports_2$1 = "/static/tabbar/组 20261.png";
|
||||
const _imports_3$1 = "/static/tabbar/组 20262.png";
|
||||
const _imports_4$1 = "/static/tabbar/组 20263.png";
|
||||
const _imports_0$1 = "/static/my/Helpcenter.png";
|
||||
const _imports_1$1 = "/static/my/CustomerService.png";
|
||||
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 = "/static/my/Notification.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 = "/static/my/Customer service.png";
|
||||
const _imports_1 = "/static/my/Phone.png";
|
||||
exports._imports_0 = _imports_0$2;
|
||||
exports._imports_0$1 = _imports_0$1;
|
||||
exports._imports_0$2 = _imports_0;
|
||||
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$1;
|
||||
exports._imports_2$1 = _imports_2;
|
||||
exports._imports_2 = _imports_2;
|
||||
exports._imports_3 = _imports_3$1;
|
||||
exports._imports_3$1 = _imports_3;
|
||||
exports._imports_4 = _imports_4$1;
|
||||
exports._imports_4$1 = _imports_4;
|
||||
exports._imports_4 = _imports_4;
|
||||
exports._imports_5 = _imports_5;
|
||||
|
||||
@@ -7775,6 +7775,7 @@ const createSubpackageApp = initCreateSubpackageApp();
|
||||
const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => {
|
||||
!isInSSRComponentSetup && injectHook(lifecycle, hook, target);
|
||||
};
|
||||
const onShow = /* @__PURE__ */ createHook(ON_SHOW);
|
||||
const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
|
||||
/*!
|
||||
* vue-router v4.3.0
|
||||
@@ -7812,6 +7813,9 @@ exports.n = n;
|
||||
exports.nextTick$1 = nextTick$1;
|
||||
exports.o = o;
|
||||
exports.onLoad = onLoad;
|
||||
exports.onMounted = onMounted;
|
||||
exports.onShow = onShow;
|
||||
exports.onUnmounted = onUnmounted;
|
||||
exports.p = p;
|
||||
exports.r = r;
|
||||
exports.reactive = reactive;
|
||||
@@ -7821,4 +7825,5 @@ exports.s = s;
|
||||
exports.sr = sr;
|
||||
exports.t = t;
|
||||
exports.useRouter = useRouter;
|
||||
exports.watch = watch;
|
||||
exports.wx$1 = wx$1;
|
||||
|
||||
@@ -1,76 +1,204 @@
|
||||
"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");
|
||||
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_input2 + _easycom_up_datetime_picker2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
(_easycom_up_picker2 + _easycom_up_datetime_picker2 + _easycom_up_input2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
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_input + _easycom_up_datetime_picker + _easycom_up_textarea + _easycom_u_popup)();
|
||||
(_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 handleAdd = () => {
|
||||
showAddPopup.value = false;
|
||||
common_vendor.index.showToast({
|
||||
title: "新增成功",
|
||||
icon: "success"
|
||||
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 value1 = common_vendor.ref(Date.now());
|
||||
const editor = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/closeout/editor"
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
fetchHazardList();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => editor()),
|
||||
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.p({
|
||||
placeholder: "请选择隐患"
|
||||
}),
|
||||
e: common_vendor.o(($event) => value1.value = $event),
|
||||
f: common_vendor.p({
|
||||
hasInput: true,
|
||||
show: _ctx.show,
|
||||
mode: "date",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
g: common_vendor.p({
|
||||
placeholder: "请输入隐患治理责任单位"
|
||||
}),
|
||||
h: common_vendor.p({
|
||||
placeholder: "请输入主要负责人"
|
||||
}),
|
||||
i: common_vendor.o(($event) => _ctx.value = $event),
|
||||
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({
|
||||
placeholder: "请输入主要治理内容",
|
||||
modelValue: _ctx.value
|
||||
show: showHazardPicker.value,
|
||||
columns: hazardColumns.value
|
||||
}),
|
||||
k: common_vendor.o(($event) => _ctx.value = $event),
|
||||
l: common_vendor.p({
|
||||
placeholder: "请输入隐患治理完成情况",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
m: common_vendor.o(($event) => _ctx.value = $event),
|
||||
n: common_vendor.p({
|
||||
placeholder: "请输入隐患治理责任单位自行验收的情况",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
o: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
p: common_vendor.o(handleAdd),
|
||||
q: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
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"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "销号申请",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"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 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-4b6250eb', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-4b6250eb"><view class="flex justify-between margin-bottom data-v-4b6250eb"><view class="text-bold text-black data-v-4b6250eb">发现火苗</view><view class="data-v-4b6250eb">已审核</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">2025-11-11</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">吉首网络有限公司</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">张起</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">2025-11-14 06:33:49</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="{{a}}">查看详情</button></view></view></view><button class="cuIcon-add bg-blue round margin-top data-v-4b6250eb" bindtap="{{b}}">新增</button><u-popup wx:if="{{r}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-s="{{['d']}}" bindclose="{{q}}" u-i="4b6250eb-0" bind:__l="__l" u-p="{{r}}"><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><up-input wx:if="{{d}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-1,4b6250eb-0" bind:__l="__l" u-p="{{d}}"></up-input><view class="flex margin-bottom margin-top data-v-4b6250eb"><view class="data-v-4b6250eb">整改时限</view><view class="text-red data-v-4b6250eb">*</view></view><view class="data-v-4b6250eb"><up-datetime-picker wx:if="{{f}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-2,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-datetime-picker></view><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位</view><up-input wx:if="{{g}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-3,4b6250eb-0" bind:__l="__l" u-p="{{g}}"></up-input><view class="margin-bottom margin-top data-v-4b6250eb">主要负责人</view><up-input wx:if="{{h}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-4,4b6250eb-0" bind:__l="__l" u-p="{{h}}"></up-input><view class="margin-bottom margin-top data-v-4b6250eb">主要治理内容</view><up-textarea wx:if="{{j}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-5,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理完成内容</view><up-textarea wx:if="{{l}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-6,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位自行验收的情况</view><up-textarea wx:if="{{n}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-7,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{m}}" u-p="{{n}}"></up-textarea></view><view class="popup-footer data-v-4b6250eb"><button class="btn-cancel data-v-4b6250eb" bindtap="{{o}}">取消</button><button class="btn-confirm bg-blue data-v-4b6250eb" bindtap="{{p}}">确定</button></view></view></u-popup></view>
|
||||
<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>
|
||||
@@ -76,3 +76,13 @@
|
||||
.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,46 +1,145 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {};
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
(_easycom_up_input2 + _easycom_up_textarea2)();
|
||||
_easycom_up_input2();
|
||||
}
|
||||
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";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_textarea)();
|
||||
_easycom_up_input();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache) {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
placeholder: "请输入内容"
|
||||
}),
|
||||
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: "请输入内容"
|
||||
}),
|
||||
c: common_vendor.p({
|
||||
placeholder: "请输入内容"
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.hazardTitle
|
||||
}),
|
||||
c: common_vendor.o(($event) => formData.hazardCreatedAt = $event),
|
||||
d: common_vendor.p({
|
||||
placeholder: "请输入内容"
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.hazardCreatedAt
|
||||
}),
|
||||
e: common_vendor.o(($event) => _ctx.value1 = $event),
|
||||
e: common_vendor.o(($event) => formData.responsibleDeptName = $event),
|
||||
f: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: _ctx.value1
|
||||
placeholder: "请输入",
|
||||
disabled: !canEdit.value,
|
||||
modelValue: formData.responsibleDeptName
|
||||
}),
|
||||
g: common_vendor.o(($event) => _ctx.value1 = $event),
|
||||
g: common_vendor.o(($event) => formData.responsiblePerson = $event),
|
||||
h: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: _ctx.value1
|
||||
placeholder: "请输入",
|
||||
disabled: !canEdit.value,
|
||||
modelValue: formData.responsiblePerson
|
||||
}),
|
||||
i: common_vendor.o(($event) => _ctx.value1 = $event),
|
||||
i: common_vendor.o(($event) => formData.createdAt = $event),
|
||||
j: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: _ctx.value1
|
||||
})
|
||||
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, [["render", _sfc_render]]);
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-bbd4165b"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "编辑销号申请",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input"
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['padding', 'page', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius"><view class="flex margin-bottom"><view class="text-gray">隐患</view><view class="text-red">*</view></view><up-input wx:if="{{a}}" u-i="df29223c-0" bind:__l="__l" u-p="{{a}}"></up-input><view class="flex margin-bottom margin-top"><view class="text-gray">整改时限</view><view class="text-red">*</view></view><up-input wx:if="{{b}}" u-i="df29223c-1" bind:__l="__l" u-p="{{b}}"></up-input><view class="text-gray margin-bottom margin-top">隐患治理责任单位</view><up-input wx:if="{{c}}" u-i="df29223c-2" bind:__l="__l" u-p="{{c}}"></up-input><view class="text-gray margin-bottom margin-top">主要负责人</view><up-input wx:if="{{d}}" u-i="df29223c-3" bind:__l="__l" u-p="{{d}}"></up-input><view class="margin-bottom text-gray margin-top">主要治理内容</view><up-textarea wx:if="{{f}}" u-i="df29223c-4" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-textarea><view class="margin-bottom text-gray margin-top">隐患治理完成情况</view><up-textarea wx:if="{{h}}" u-i="df29223c-5" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-textarea><view class="margin-bottom text-gray margin-top">隐患治理责任单位自行验收的情况</view><up-textarea wx:if="{{j}}" u-i="df29223c-6" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-textarea><view class="flex justify-center margin-top-xl"><button class="lg round cu-btn lg margin-right">取消</button><button class="bg-blue round cu-btn lg">确定</button></view></view></view>
|
||||
<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,6 +1,30 @@
|
||||
|
||||
.page {
|
||||
/**
|
||||
* 这里是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;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,17 +6,17 @@ 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_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
(_easycom_up_upload2 + _easycom_up_input2 + _easycom_up_choose2 + _easycom_u_popup2 + _easycom_up_textarea2)();
|
||||
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_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.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_u_popup + _easycom_up_textarea)();
|
||||
(_easycom_up_upload + _easycom_up_input + _easycom_up_choose + _easycom_up_textarea + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "Inspection",
|
||||
@@ -51,39 +51,53 @@ const _sfc_main = {
|
||||
// 隐患等级索引
|
||||
description: "",
|
||||
// 隐患描述
|
||||
tagIndex: 0
|
||||
tagIndex: 0,
|
||||
// 隐患标签索引
|
||||
source: ""
|
||||
// 隐患来源
|
||||
});
|
||||
const lng = common_vendor.ref(0);
|
||||
const lat = common_vendor.ref(0);
|
||||
const showAddressPopup = common_vendor.ref(false);
|
||||
const addressKeyword = common_vendor.ref("");
|
||||
const selectedAddress = common_vendor.ref("");
|
||||
const tempSelectedAddress = common_vendor.ref("");
|
||||
const addressList = common_vendor.ref([
|
||||
"湖南省湘西土家族苗族自治州吉首市人民北路105号",
|
||||
"湖南省湘西土家族苗族自治州吉首市人民南路100号",
|
||||
"湖南省湘西土家族苗族自治州吉首市团结广场",
|
||||
"湖南省湘西土家族苗族自治州吉首市火车站"
|
||||
]);
|
||||
const filteredAddressList = common_vendor.computed(() => {
|
||||
if (!addressKeyword.value)
|
||||
return addressList.value;
|
||||
return addressList.value.filter((item) => item.includes(addressKeyword.value));
|
||||
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"
|
||||
});
|
||||
const confirmAddress = () => {
|
||||
if (tempSelectedAddress.value) {
|
||||
selectedAddress.value = tempSelectedAddress.value;
|
||||
}
|
||||
showAddressPopup.value = false;
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
};
|
||||
const handleAdd = async () => {
|
||||
var _a;
|
||||
if (!formData.title) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患标题", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入隐患标题",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (fileList1.value.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请上传隐患图片/视频", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: "请上传隐患图片/视频",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
fileList1.value.map((file) => {
|
||||
@@ -103,6 +117,7 @@ const _sfc_main = {
|
||||
});
|
||||
const selectedTag = tagOptions.value[formData.tagIndex];
|
||||
const tagId = selectedTag ? selectedTag.id : null;
|
||||
console.log("innnn", sourceOptions);
|
||||
const params = {
|
||||
title: formData.title,
|
||||
//标题
|
||||
@@ -122,8 +137,8 @@ const _sfc_main = {
|
||||
//关联任务ID
|
||||
checkPointId: checkPointId.value,
|
||||
//关联检查点ID
|
||||
source: "cillum labore veniam"
|
||||
//隐患来源
|
||||
source: ((_a = sourceOptions.value[formData.source]) == null ? void 0 : _a.title) || ""
|
||||
//隐患来源(随手拍、企业自查、行业互查、专家诊查)
|
||||
};
|
||||
try {
|
||||
const res = await request_api.addHiddenDanger(params);
|
||||
@@ -139,12 +154,19 @@ const _sfc_main = {
|
||||
formData.tagIndex = 0;
|
||||
selectedAddress.value = "";
|
||||
fileList1.value = [];
|
||||
fetchHiddenDangerList();
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "新增失败", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "新增失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const hiddenDangerList = common_vendor.ref([]);
|
||||
@@ -152,16 +174,24 @@ const _sfc_main = {
|
||||
try {
|
||||
const res = await request_api.getMyHiddenDangerList();
|
||||
if (res.code === 0) {
|
||||
hiddenDangerList.value = res.data;
|
||||
hiddenDangerList.value = res.data.records;
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取隐患列表失败", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "获取隐患列表失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
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}`
|
||||
@@ -172,9 +202,14 @@ const _sfc_main = {
|
||||
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
};
|
||||
const acceptance = () => {
|
||||
const acceptance = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/hiddendanger/acceptance"
|
||||
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([]);
|
||||
@@ -210,7 +245,7 @@ const _sfc_main = {
|
||||
filePath,
|
||||
name: "file",
|
||||
header: {
|
||||
"Authorization": request_request.AUTH_TOKEN
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
@@ -237,33 +272,88 @@ const _sfc_main = {
|
||||
title: item.name
|
||||
}));
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取标签列表失败", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "获取标签列表失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
fetchTagOptions();
|
||||
const levelOptions = common_vendor.ref([
|
||||
{ id: 1, title: "轻微隐患" },
|
||||
{ id: 2, title: "一般隐患" },
|
||||
{ id: 3, title: "重大隐患" }
|
||||
{
|
||||
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 {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.t(item.statusName),
|
||||
c: common_vendor.t(item.levelName),
|
||||
d: common_vendor.t(item.address),
|
||||
e: common_vendor.t(item.createdAt),
|
||||
f: common_vendor.o(($event) => details(item), item.hazardId),
|
||||
g: common_vendor.o(($event) => Rectification(item), item.hazardId),
|
||||
h: common_vendor.o(($event) => acceptance(), item.hazardId),
|
||||
i: item.hazardId
|
||||
};
|
||||
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),
|
||||
@@ -289,43 +379,32 @@ const _sfc_main = {
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: formData.level
|
||||
}),
|
||||
k: common_vendor.t(selectedAddress.value || "请选择地址"),
|
||||
l: common_vendor.n(selectedAddress.value ? "" : "text-gray"),
|
||||
m: common_vendor.o(($event) => showAddressPopup.value = true),
|
||||
n: common_vendor.o(($event) => showAddressPopup.value = true),
|
||||
o: common_vendor.o(($event) => showAddressPopup.value = false),
|
||||
p: addressKeyword.value,
|
||||
q: common_vendor.o(($event) => addressKeyword.value = $event.detail.value),
|
||||
r: common_vendor.f(filteredAddressList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: index,
|
||||
c: common_vendor.o(($event) => tempSelectedAddress.value = item, index),
|
||||
d: tempSelectedAddress.value === item ? 1 : ""
|
||||
};
|
||||
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
|
||||
}),
|
||||
s: common_vendor.o(($event) => showAddressPopup.value = false),
|
||||
t: common_vendor.o(confirmAddress),
|
||||
v: common_vendor.o(($event) => showAddressPopup.value = false),
|
||||
w: common_vendor.p({
|
||||
show: showAddressPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
x: common_vendor.o(($event) => formData.description = $event),
|
||||
y: common_vendor.p({
|
||||
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
|
||||
}),
|
||||
z: common_vendor.o(($event) => formData.tagIndex = $event),
|
||||
A: common_vendor.p({
|
||||
s: common_vendor.o(($event) => formData.tagIndex = $event),
|
||||
t: common_vendor.p({
|
||||
options: tagOptions.value,
|
||||
modelValue: formData.tagIndex
|
||||
}),
|
||||
B: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
C: common_vendor.o(handleAdd),
|
||||
D: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
E: common_vendor.p({
|
||||
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"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"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",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,25 @@
|
||||
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;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"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");
|
||||
@@ -13,7 +15,132 @@ if (!Math) {
|
||||
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);
|
||||
};
|
||||
@@ -39,45 +166,64 @@ const _sfc_main = {
|
||||
fileListLen++;
|
||||
}
|
||||
};
|
||||
const uploadFilePromise = (url) => {
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
url: "http://192.168.2.21:7001/upload",
|
||||
// 仅为示例,非真实的接口地址
|
||||
filePath: url,
|
||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
||||
filePath,
|
||||
name: "file",
|
||||
formData: {
|
||||
user: "test"
|
||||
header: {
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
setTimeout(() => {
|
||||
resolve(res.data.data);
|
||||
}, 1e3);
|
||||
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: common_vendor.o(($event) => _ctx.value1 = $event),
|
||||
b: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: _ctx.value1
|
||||
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
|
||||
}),
|
||||
c: common_vendor.o(($event) => _ctx.value1 = $event),
|
||||
d: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: _ctx.value1
|
||||
}),
|
||||
e: common_vendor.o(afterRead),
|
||||
f: common_vendor.o(deletePic),
|
||||
g: common_vendor.p({
|
||||
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)
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
<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><up-textarea wx:if="{{b}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" u-i="39f9b795-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"></up-textarea><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><up-textarea wx:if="{{d}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" u-i="39f9b795-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"></up-textarea><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><up-upload wx:if="{{g}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" bindafterRead="{{e}}" binddelete="{{f}}" u-i="39f9b795-2" bind:__l="__l" u-p="{{g}}"></up-upload><button class="bg-blue round margin-top-xl data-v-39f9b795"> 提交验收</button></view></view>
|
||||
<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>
|
||||
@@ -28,3 +28,19 @@
|
||||
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;
|
||||
}
|
||||
149
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.js
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
"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);
|
||||
7
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"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
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<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>
|
||||
63
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.wxss
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* 这里是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;
|
||||
}
|
||||
@@ -5,20 +5,18 @@ 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_calendar2 = common_vendor.resolveComponent("up-calendar");
|
||||
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
|
||||
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
|
||||
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_calendar2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_up_upload2)();
|
||||
(_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_calendar = () => "../../uni_modules/uview-plus/components/u-calendar/u-calendar.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_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_calendar + _easycom_up_radio + _easycom_up_radio_group + _easycom_up_upload)();
|
||||
(_easycom_up_textarea + _easycom_up_input + _easycom_up_datetime_picker + _easycom_up_select + _easycom_up_upload)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "rectification",
|
||||
@@ -36,27 +34,34 @@ const _sfc_main = {
|
||||
// 投资资金(实际)
|
||||
});
|
||||
const show = common_vendor.ref(false);
|
||||
const mode = common_vendor.ref("single");
|
||||
const value1 = common_vendor.ref(Date.now());
|
||||
const selectedDate = common_vendor.ref("");
|
||||
const radiovalue1 = common_vendor.ref("");
|
||||
const radiolist1 = common_vendor.reactive([
|
||||
{
|
||||
name: "孙致远",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "符友成",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "向彪",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "向纪荣",
|
||||
disabled: false
|
||||
common_vendor.ref("");
|
||||
const cateId = common_vendor.ref("");
|
||||
const cateList = 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);
|
||||
@@ -83,10 +88,6 @@ const _sfc_main = {
|
||||
fileListLen++;
|
||||
}
|
||||
};
|
||||
const confirmDate = (e) => {
|
||||
selectedDate.value = e[0];
|
||||
show.value = false;
|
||||
};
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
@@ -94,7 +95,7 @@ const _sfc_main = {
|
||||
filePath,
|
||||
name: "file",
|
||||
header: {
|
||||
"Authorization": request_request.AUTH_TOKEN
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
@@ -113,11 +114,17 @@ const _sfc_main = {
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
if (!formData.rectifyPlan) {
|
||||
common_vendor.index.showToast({ title: "请输入整改方案", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入整改方案",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!formData.rectifyResult) {
|
||||
common_vendor.index.showToast({ title: "请输入整改完成情况", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入整改完成情况",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const attachments = fileList1.value.map((file) => {
|
||||
@@ -147,16 +154,25 @@ const _sfc_main = {
|
||||
try {
|
||||
const res = await request_api.submitRectification(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({ title: "提交成功", icon: "success" });
|
||||
common_vendor.index.showToast({
|
||||
title: "提交成功",
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "提交失败", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "提交失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("提交整改失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
@@ -167,6 +183,10 @@ const _sfc_main = {
|
||||
assignId.value = options.assignId;
|
||||
}
|
||||
});
|
||||
const selectItem = (item) => {
|
||||
console.log("选择的整改人员:", item);
|
||||
cateId.value = item.id;
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => formData.rectifyPlan = $event),
|
||||
@@ -194,42 +214,29 @@ const _sfc_main = {
|
||||
i: common_vendor.t(selectedDate.value || "请选择日期"),
|
||||
j: common_vendor.n(selectedDate.value ? "" : "text-gray"),
|
||||
k: common_vendor.o(($event) => show.value = true),
|
||||
l: common_vendor.o(confirmDate),
|
||||
m: common_vendor.o(($event) => show.value = false),
|
||||
n: common_vendor.p({
|
||||
l: common_vendor.o(($event) => value1.value = $event),
|
||||
m: common_vendor.p({
|
||||
hasInput: true,
|
||||
show: show.value,
|
||||
mode: mode.value
|
||||
mode: "date",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
o: common_vendor.f(radiolist1, (item, index, i0) => {
|
||||
return {
|
||||
a: index,
|
||||
b: common_vendor.o(_ctx.radioChange, index),
|
||||
c: "f18ba0ce-6-" + i0 + ",f18ba0ce-5",
|
||||
d: common_vendor.p({
|
||||
shape: "square",
|
||||
customStyle: {
|
||||
marginBottom: "8px"
|
||||
},
|
||||
label: item.name,
|
||||
name: item.name
|
||||
})
|
||||
};
|
||||
n: common_vendor.o(selectItem),
|
||||
o: common_vendor.o(($event) => cateId.value = $event),
|
||||
p: common_vendor.p({
|
||||
label: "整改人员",
|
||||
options: cateList.value,
|
||||
current: cateId.value
|
||||
}),
|
||||
p: common_vendor.o(_ctx.groupChange),
|
||||
q: common_vendor.o(($event) => radiovalue1.value = $event),
|
||||
r: common_vendor.p({
|
||||
placement: "column",
|
||||
modelValue: radiovalue1.value
|
||||
}),
|
||||
s: common_vendor.o(afterRead),
|
||||
t: common_vendor.o(deletePic),
|
||||
v: common_vendor.p({
|
||||
q: common_vendor.o(afterRead),
|
||||
r: common_vendor.o(deletePic),
|
||||
s: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
maxCount: 10
|
||||
}),
|
||||
w: common_vendor.o(handleSubmit)
|
||||
t: common_vendor.o(handleSubmit)
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
"usingComponents": {
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-calendar": "../../uni_modules/uview-plus/components/u-calendar/u-calendar",
|
||||
"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-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"
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['page', 'padding', 'data-v-f18ba0ce', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-f18ba0ce"><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改方案</view><view class="text-red data-v-f18ba0ce">*</view></view><up-textarea wx:if="{{b}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"></up-textarea><view class="flex margin-bottom margin-top data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改完成情况</view><view class="text-red data-v-f18ba0ce">*</view></view><up-textarea wx:if="{{d}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"></up-textarea><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray margin-top data-v-f18ba0ce">投资资金(计划)</view><view class="text-red data-v-f18ba0ce">*</view></view><up-input wx:if="{{f}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-2" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-input><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray margin-top data-v-f18ba0ce">投资资金(实际)</view><view class="text-red data-v-f18ba0ce">*</view></view><up-input wx:if="{{h}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-3" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-input><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray margin-top data-v-f18ba0ce">限定整改时间</view><view class="text-red data-v-f18ba0ce">*</view></view><view class="date-input data-v-f18ba0ce" bindtap="{{k}}"><text class="{{['data-v-f18ba0ce', j]}}">{{i}}</text></view><up-calendar wx:if="{{n}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindconfirm="{{l}}" bindclose="{{m}}" u-i="f18ba0ce-4" bind:__l="__l" u-p="{{n}}"></up-calendar><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改人员</view><view class="text-red data-v-f18ba0ce">*</view></view><up-radio-group wx:if="{{r}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-s="{{['d']}}" bindchange="{{p}}" u-i="f18ba0ce-5" bind:__l="__l" bindupdateModelValue="{{q}}" u-p="{{r}}"><up-radio wx:for="{{o}}" wx:for-item="item" wx:key="a" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindchange="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d}}"></up-radio></up-radio-group><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改图片/视频</view><view class="text-red data-v-f18ba0ce">*</view></view><up-upload wx:if="{{v}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindafterRead="{{s}}" binddelete="{{t}}" u-i="f18ba0ce-7" bind:__l="__l" u-p="{{v}}"></up-upload><button class="bg-blue round margin-top-xl data-v-f18ba0ce" bindtap="{{w}}">提交整改</button></view></view>
|
||||
<view class="{{['page', 'padding', 'data-v-f18ba0ce', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-f18ba0ce"><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改方案</view><view class="text-red data-v-f18ba0ce">*</view></view><up-textarea wx:if="{{b}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"></up-textarea><view class="flex margin-bottom margin-top data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改完成情况</view><view class="text-red data-v-f18ba0ce">*</view></view><up-textarea wx:if="{{d}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"></up-textarea><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray margin-top data-v-f18ba0ce">投资资金(计划)</view><view class="text-red data-v-f18ba0ce">*</view></view><up-input wx:if="{{f}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-2" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-input><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray margin-top data-v-f18ba0ce">投资资金(实际)</view><view class="text-red data-v-f18ba0ce">*</view></view><up-input wx:if="{{h}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-3" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-input><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray margin-top data-v-f18ba0ce">限定整改时间</view><view class="text-red data-v-f18ba0ce">*</view></view><view class="date-input data-v-f18ba0ce" bindtap="{{k}}"><text class="{{['data-v-f18ba0ce', j]}}">{{i}}</text></view><up-datetime-picker wx:if="{{m}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-4" bind:__l="__l" bindupdateModelValue="{{l}}" u-p="{{m}}"></up-datetime-picker><view class="margin-bottom margin-top data-v-f18ba0ce"><up-select wx:if="{{p}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindselect="{{n}}" u-i="f18ba0ce-5" bind:__l="__l" bindupdateCurrent="{{o}}" u-p="{{p}}"></up-select></view><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改图片/视频</view><view class="text-red data-v-f18ba0ce">*</view></view><up-upload wx:if="{{s}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindafterRead="{{q}}" binddelete="{{r}}" u-i="f18ba0ce-6" bind:__l="__l" u-p="{{s}}"></up-upload><button class="bg-blue round margin-top-xl data-v-f18ba0ce" bindtap="{{t}}">提交整改</button></view></view>
|
||||
@@ -1,6 +1,7 @@
|
||||
"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_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
@@ -26,11 +27,34 @@ const _sfc_main = {
|
||||
createdAt: "",
|
||||
attachments: []
|
||||
});
|
||||
const rectifyAttachments = common_vendor.ref([]);
|
||||
const getFullPath = (filePath) => {
|
||||
if (!filePath)
|
||||
return "";
|
||||
if (filePath.startsWith("http://") || filePath.startsWith("https://")) {
|
||||
return filePath;
|
||||
}
|
||||
return request_request.baseUrl + filePath;
|
||||
};
|
||||
const previewRectifyImage = (index) => {
|
||||
const urls = rectifyAttachments.value.map((item) => getFullPath(item.filePath));
|
||||
common_vendor.index.previewImage({
|
||||
current: index,
|
||||
urls
|
||||
});
|
||||
};
|
||||
const fetchDetail = async (hazardId, assignId) => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerDetail({ hazardId, assignId });
|
||||
if (res.code === 0 && res.data) {
|
||||
Object.assign(detailData, res.data);
|
||||
if (res.data.assigns && res.data.assigns.length > 0) {
|
||||
const assign = res.data.assigns[0];
|
||||
if (assign.rectify && assign.rectify.attachments) {
|
||||
rectifyAttachments.value = assign.rectify.attachments;
|
||||
console.log("整改附件:", rectifyAttachments.value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
@@ -46,12 +70,13 @@ const _sfc_main = {
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: (detailData == null ? void 0 : detailData.attachments) && detailData.attachments.length > 0
|
||||
}, (detailData == null ? void 0 : detailData.attachments) && detailData.attachments.length > 0 ? {
|
||||
b: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
a: rectifyAttachments.value.length > 0
|
||||
}, rectifyAttachments.value.length > 0 ? {
|
||||
b: common_vendor.f(rectifyAttachments.value, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: img.filePath
|
||||
b: getFullPath(img.filePath),
|
||||
c: common_vendor.o(($event) => previewRectifyImage(idx), idx)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-4d631e68', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-4d631e68"><view class="flex data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患图片/视频</view><view class="text-red data-v-4d631e68">*</view></view><view class="margin-bottom data-v-4d631e68"><view wx:if="{{a}}" class="flex data-v-4d631e68" style="flex-wrap:wrap;gap:10rpx"><image wx:for="{{b}}" wx:for-item="img" wx:key="a" class="data-v-4d631e68" src="{{img.b}}" style="width:136rpx;height:136rpx;border-radius:16rpx" mode="aspectFill"></image></view><view wx:else class="text-gray text-sm data-v-4d631e68">暂无图片</view><view class="text-gray text-sm margin-top-xs data-v-4d631e68">必填:请上传现场照片或者视频作为隐患证据</view></view><view class="flex margin-bottom data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患标题</view><view class="text-red data-v-4d631e68">*</view></view><up-input wx:if="{{d}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-0" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"/><view class="margin-bottom text-gray text-sm margin-top-xs data-v-4d631e68">请用简洁的语言概括隐患要点</view><view class="flex margin-bottom data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患等级</view><view class="text-red data-v-4d631e68">*</view></view><view class="flex col-3 data-v-4d631e68" style="gap:10rpx"><view class="{{['data-v-4d631e68', e]}}" style="padding:16rpx 40rpx">轻微隐患</view><view class="{{['data-v-4d631e68', f]}}" style="padding:16rpx 40rpx">一般隐患</view><view class="{{['data-v-4d631e68', g]}}" style="padding:16rpx 40rpx">重大隐患</view></view><view class="text-gray text-sm margin-top-xs margin-bottom data-v-4d631e68">请用隐患可能造成的危害程度选择等级</view><view class="flex data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患位置</view><view class="text-red data-v-4d631e68">*</view></view><view class="address-box margin-top-sm margin-bottom-sm data-v-4d631e68"><input class="address-input data-v-4d631e68" placeholder="暂无地址" disabled value="{{h}}" bindinput="{{i}}"/><button class="address-btn bg-blue data-v-4d631e68">选择地址</button></view><view class="text-gray text-sm data-v-4d631e68">如:办公楼3层东侧消防通道,生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view><view class="flex margin-bottom data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患描述</view><view class="text-red data-v-4d631e68">*</view></view><up-textarea wx:if="{{k}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-1" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"></up-textarea><view class="text-gray text-sm margin-top-xs margin-bottom data-v-4d631e68">请详细说明隐患现状、潜在风险及影响范围</view><view class="text-gray margin-bottom data-v-4d631e68">隐患来源</view><view class="bg-gray padding radius data-v-4d631e68">{{l}}</view><view class="text-gray margin-top margin-bottom data-v-4d631e68">创建时间</view><view class="bg-gray padding radius data-v-4d631e68">{{m}}</view></view></view>
|
||||
<view class="{{['padding', 'page', 'data-v-4d631e68', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-4d631e68"><view class="flex data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患图片/视频</view><view class="text-red data-v-4d631e68">*</view></view><view class="margin-bottom data-v-4d631e68"><view wx:if="{{a}}" class="margin-top data-v-4d631e68"><view class="flex data-v-4d631e68" style="flex-wrap:wrap;gap:10rpx"><image wx:for="{{b}}" wx:for-item="img" wx:key="a" class="data-v-4d631e68" src="{{img.b}}" style="width:136rpx;height:136rpx;border-radius:16rpx" mode="aspectFill" bindtap="{{img.c}}"></image></view></view><view wx:else class="text-gray text-sm data-v-4d631e68">暂无图片</view><view class="text-gray text-sm margin-top-xs data-v-4d631e68">必填:请上传现场照片或者视频作为隐患证据</view></view><view class="flex margin-bottom data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患标题</view><view class="text-red data-v-4d631e68">*</view></view><up-input wx:if="{{d}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-0" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"/><view class="margin-bottom text-gray text-sm margin-top-xs data-v-4d631e68">请用简洁的语言概括隐患要点</view><view class="flex margin-bottom data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患等级</view><view class="text-red data-v-4d631e68">*</view></view><view class="flex col-3 data-v-4d631e68" style="gap:10rpx"><view class="{{['data-v-4d631e68', e]}}" style="padding:16rpx 40rpx">轻微隐患</view><view class="{{['data-v-4d631e68', f]}}" style="padding:16rpx 40rpx">一般隐患</view><view class="{{['data-v-4d631e68', g]}}" style="padding:16rpx 40rpx">重大隐患</view></view><view class="text-gray text-sm margin-top-xs margin-bottom data-v-4d631e68">请用隐患可能造成的危害程度选择等级</view><view class="flex data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患位置</view><view class="text-red data-v-4d631e68">*</view></view><view class="address-box margin-top-sm margin-bottom-sm data-v-4d631e68"><input class="address-input data-v-4d631e68" placeholder="暂无地址" disabled value="{{h}}" bindinput="{{i}}"/><button class="address-btn bg-blue data-v-4d631e68">选择地址</button></view><view class="text-gray text-sm data-v-4d631e68">如:办公楼3层东侧消防通道,生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view><view class="flex margin-bottom data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患描述</view><view class="text-red data-v-4d631e68">*</view></view><up-textarea wx:if="{{k}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-1" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"></up-textarea><view class="text-gray text-sm margin-top-xs margin-bottom data-v-4d631e68">请详细说明隐患现状、潜在风险及影响范围</view><view class="text-gray margin-bottom data-v-4d631e68">隐患来源</view><view class="bg-gray padding radius data-v-4d631e68">{{l}}</view><view class="text-gray margin-top margin-bottom data-v-4d631e68">创建时间</view><view class="bg-gray padding radius data-v-4d631e68">{{m}}</view></view></view>
|
||||
@@ -6,6 +6,28 @@ const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const loading = common_vendor.ref(true);
|
||||
const userInfo = common_vendor.reactive({
|
||||
userId: "",
|
||||
username: "",
|
||||
nickName: "",
|
||||
deptId: "",
|
||||
deptName: ""
|
||||
});
|
||||
const getUserInfo = () => {
|
||||
try {
|
||||
const storedUserInfo = common_vendor.index.getStorageSync("userInfo");
|
||||
if (storedUserInfo) {
|
||||
const info = JSON.parse(storedUserInfo);
|
||||
userInfo.userId = info.userId || "";
|
||||
userInfo.username = info.username || "";
|
||||
userInfo.nickName = info.nickName || "";
|
||||
userInfo.deptId = info.deptId || "";
|
||||
userInfo.deptName = info.deptName || "";
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("获取用户信息失败:", e);
|
||||
}
|
||||
};
|
||||
const infoList = common_vendor.ref([
|
||||
{
|
||||
name: "成员管理",
|
||||
@@ -54,16 +76,6 @@ const _sfc_main = {
|
||||
url: `/pages/Inspectionresult/Inspectionresult?id=${item.id}`
|
||||
});
|
||||
};
|
||||
const Inspectionwarning = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/Inspectionwarning/Inspectionwarning"
|
||||
});
|
||||
};
|
||||
const my = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/personalcenter/my"
|
||||
});
|
||||
};
|
||||
const handleMenuClick = (item) => {
|
||||
const menuRoutes = {
|
||||
"成员管理": "/pages/membermanagemen/membermanagemen",
|
||||
@@ -109,11 +121,37 @@ const _sfc_main = {
|
||||
return dateStr.split(" ")[0];
|
||||
};
|
||||
common_vendor.onLoad(() => {
|
||||
getUserInfo();
|
||||
getCheckPlanLists();
|
||||
});
|
||||
const hiddenDangerParams = common_vendor.ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: ""
|
||||
});
|
||||
const hiddenDangerData = common_vendor.ref([]);
|
||||
const getHiddenDangerLists = async () => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerList(hiddenDangerParams.value);
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
hiddenDangerData.value = res.data.records;
|
||||
console.log(hiddenDangerData.value, 1111);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad(() => {
|
||||
getHiddenDangerLists();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(infoList.value, (item, index, i0) => {
|
||||
a: common_vendor.t(userInfo.deptName || "未知部门"),
|
||||
b: common_vendor.t(userInfo.nickName || userInfo.username || "未登录"),
|
||||
c: common_vendor.f(infoList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: item.src,
|
||||
b: common_vendor.t(item.name),
|
||||
@@ -121,9 +159,9 @@ const _sfc_main = {
|
||||
d: common_vendor.o(($event) => handleMenuClick(item), index)
|
||||
};
|
||||
}),
|
||||
b: checkPlanData.value.length === 0
|
||||
d: checkPlanData.value.length === 0
|
||||
}, checkPlanData.value.length === 0 ? {} : {}, {
|
||||
c: common_vendor.f(checkPlanData.value, (item, index, i0) => {
|
||||
e: common_vendor.f(checkPlanData.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.name),
|
||||
b: common_vendor.t(item.runModeName),
|
||||
@@ -140,13 +178,19 @@ const _sfc_main = {
|
||||
m: item.id
|
||||
};
|
||||
}),
|
||||
d: common_assets._imports_0,
|
||||
e: common_assets._imports_1,
|
||||
f: common_assets._imports_2,
|
||||
g: common_assets._imports_3,
|
||||
h: common_vendor.o(($event) => Inspectionwarning()),
|
||||
i: common_assets._imports_4,
|
||||
j: common_vendor.o(($event) => my())
|
||||
f: common_assets._imports_0,
|
||||
g: common_vendor.f(hiddenDangerData.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.t(item.source),
|
||||
c: common_vendor.t(item.address),
|
||||
d: common_vendor.t(item.levelName),
|
||||
e: common_vendor.t(item.statusName),
|
||||
f: common_vendor.t(item.createdAt),
|
||||
g: item.id,
|
||||
h: common_vendor.o(($event) => _ctx.HazardList(), item.id)
|
||||
};
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.grid-list.data-v-1cf27b2a {
|
||||
gap: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.list.data-v-1cf27b2a {
|
||||
background: #F2F6FF;
|
||||
box-shadow: 0rpx 4rpx 8rpx 2rpx #CADDFC;
|
||||
|
||||
25
unpackage/dist/dev/mp-weixin/pages/login/agreement.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
__name: "agreement",
|
||||
setup(__props) {
|
||||
const articleUrl = common_vendor.ref("");
|
||||
const webviewStyles = common_vendor.ref({
|
||||
progress: {
|
||||
color: "#3D83F6"
|
||||
// 使用蓝色主题色
|
||||
}
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
articleUrl.value = "http://www.baidu.com/";
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: webviewStyles.value,
|
||||
b: articleUrl.value
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b4896b2f"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
5
unpackage/dist/dev/mp-weixin/pages/login/agreement.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "用户协议",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/agreement.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-b4896b2f', virtualHostClass]}}" style="{{virtualHostStyle}}"><web-view class="data-v-b4896b2f" webview-styles="{{a}}" src="{{b}}"></web-view></view>
|
||||
26
unpackage/dist/dev/mp-weixin/pages/login/agreement.wxss
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
152
unpackage/dist/dev/mp-weixin/pages/login/enterprise.js
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_form_item2 = common_vendor.resolveComponent("up-form-item");
|
||||
const _easycom_up_form2 = common_vendor.resolveComponent("up-form");
|
||||
const _component_lsl_protocol_popup = common_vendor.resolveComponent("lsl-protocol-popup");
|
||||
(_easycom_up_input2 + _easycom_up_form_item2 + _easycom_up_form2 + _component_lsl_protocol_popup)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_form_item = () => "../../uni_modules/uview-plus/components/u-form-item/u-form-item.js";
|
||||
const _easycom_up_form = () => "../../uni_modules/uview-plus/components/u-form/u-form.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_form_item + _easycom_up_form)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "enterprise",
|
||||
setup(__props) {
|
||||
const state = common_vendor.reactive({
|
||||
showSex: false,
|
||||
isAgreed: false,
|
||||
// 用户是否同意协议
|
||||
showProtocolPopup: false,
|
||||
// 是否显示协议弹窗
|
||||
model1: {
|
||||
userInfo: {
|
||||
name: "uview-plus UI",
|
||||
sex: ""
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
"userInfo.name": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请填写姓名",
|
||||
trigger: ["blur", "change"]
|
||||
}
|
||||
}
|
||||
});
|
||||
const toggleAgreement = () => {
|
||||
state.isAgreed = !state.isAgreed;
|
||||
};
|
||||
const showProtocol = (type) => {
|
||||
if (type === "user") {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/login/agreement"
|
||||
});
|
||||
} else if (type === "privacy") {
|
||||
state.showProtocolPopup = true;
|
||||
}
|
||||
};
|
||||
const handleRegister = () => {
|
||||
if (!state.isAgreed) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请先阅读并同意用户协议和隐私政策",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
return;
|
||||
}
|
||||
console.log("开始注册流程");
|
||||
};
|
||||
const handleAgreeProtocol = () => {
|
||||
state.isAgreed = true;
|
||||
state.showProtocolPopup = false;
|
||||
common_vendor.index.showToast({
|
||||
title: "已同意协议条款",
|
||||
icon: "success",
|
||||
duration: 1500
|
||||
});
|
||||
};
|
||||
const closeProtocolPopup = () => {
|
||||
state.showProtocolPopup = false;
|
||||
};
|
||||
const other = [
|
||||
[
|
||||
{
|
||||
tit: "《服务协议》",
|
||||
type: "page",
|
||||
// doc自行下载打开文档 page跳转页面
|
||||
content: "/pages/login/agreement"
|
||||
// 文档地址/页面跳转地址
|
||||
},
|
||||
{
|
||||
tit: "《隐私政策》",
|
||||
type: "page",
|
||||
// doc自行下载打开文档 page跳转页面
|
||||
content: "/pages/login/privacy"
|
||||
// 文档地址/页面跳转地址
|
||||
}
|
||||
]
|
||||
];
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请填写营业执照上的企业名称",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
b: common_vendor.sr("item1", "280ea37d-1,280ea37d-0"),
|
||||
c: common_vendor.p({
|
||||
required: true,
|
||||
label: "企业名称",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
d: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入管理员姓名",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
e: common_vendor.sr("item1", "280ea37d-3,280ea37d-0"),
|
||||
f: common_vendor.p({
|
||||
required: true,
|
||||
label: "管理员姓名",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "120"
|
||||
}),
|
||||
g: common_vendor.sr("form1", "280ea37d-0"),
|
||||
h: common_vendor.p({
|
||||
labelPosition: "left",
|
||||
model: state.model1,
|
||||
rules: state.rules
|
||||
}),
|
||||
i: common_vendor.n(state.isAgreed ? "bg-blue" : "bg-gray"),
|
||||
j: !state.isAgreed,
|
||||
k: common_vendor.o(handleRegister),
|
||||
l: state.isAgreed
|
||||
}, state.isAgreed ? {} : {}, {
|
||||
m: state.isAgreed ? 1 : "",
|
||||
n: common_vendor.o(($event) => showProtocol("user")),
|
||||
o: common_vendor.o(($event) => showProtocol("privacy")),
|
||||
p: common_vendor.o(toggleAgreement),
|
||||
q: common_vendor.o(handleAgreeProtocol),
|
||||
r: common_vendor.o(closeProtocolPopup),
|
||||
s: common_vendor.p({
|
||||
title: "用户协议和隐私政策",
|
||||
predesc: "为了更好地保护您的个人信息和合法权益,在使用我们的服务前,请您务必仔细阅读并充分理解以下协议条款。",
|
||||
subdesc: '请您详细阅读各条款内容,特别是免除或限制责任的条款。如您同意以下协议条款,请点击"同意并继续"开始使用我们的服务。',
|
||||
color: "#007AFF",
|
||||
onNeed: state.showProtocolPopup,
|
||||
other,
|
||||
open_type: "getPhoneNumber|agreePrivacyAuthorization"
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-280ea37d"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
8
unpackage/dist/dev/mp-weixin/pages/login/enterprise.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "注册新企业",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-form-item": "../../uni_modules/uview-plus/components/u-form-item/u-form-item",
|
||||
"up-form": "../../uni_modules/uview-plus/components/u-form/u-form"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/enterprise.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-280ea37d', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding solid radius margin data-v-280ea37d"><up-form wx:if="{{h}}" class="r data-v-280ea37d" virtualHostClass="r data-v-280ea37d" u-s="{{['d']}}" u-r="form1" u-i="280ea37d-0" bind:__l="__l" u-p="{{h}}"><up-form-item wx:if="{{c}}" class="r data-v-280ea37d" virtualHostClass="r data-v-280ea37d" u-s="{{['d']}}" u-r="item1" u-i="280ea37d-1,280ea37d-0" bind:__l="__l" u-p="{{c}}"><up-input wx:if="{{a}}" class="data-v-280ea37d" virtualHostClass="data-v-280ea37d" u-i="280ea37d-2,280ea37d-1" bind:__l="__l" u-p="{{a}}"></up-input></up-form-item><up-form-item wx:if="{{f}}" class="r data-v-280ea37d" virtualHostClass="r data-v-280ea37d" u-s="{{['d']}}" u-r="item1" u-i="280ea37d-3,280ea37d-0" bind:__l="__l" u-p="{{f}}"><up-input wx:if="{{d}}" class="data-v-280ea37d" virtualHostClass="data-v-280ea37d" u-i="280ea37d-4,280ea37d-3" bind:__l="__l" u-p="{{d}}"></up-input></up-form-item></up-form><view class="margin-top-xl data-v-280ea37d"><button class="{{['round', 'data-v-280ea37d', i]}}" disabled="{{j}}" bindtap="{{k}}"> 申请注册 </button></view><view class="protocol-agreement data-v-280ea37d"><view class="protocol-checkbox data-v-280ea37d" bindtap="{{p}}"><view class="{{['checkbox', 'data-v-280ea37d', m && 'checked']}}"><text wx:if="{{l}}" class="checkmark data-v-280ea37d">✓</text></view><text class="protocol-text data-v-280ea37d"> 我已阅读并接受 <text class="protocol-link data-v-280ea37d" catchtap="{{n}}">《服务协议》</text> 和 <text class="protocol-link data-v-280ea37d" catchtap="{{o}}">《隐私政策》</text></text></view></view><view class="container data-v-280ea37d"><lsl-protocol-popup wx:if="{{s}}" class="data-v-280ea37d" virtualHostClass="data-v-280ea37d" bindagree="{{q}}" bindclose="{{r}}" u-i="280ea37d-5" bind:__l="__l" u-p="{{s}}"></lsl-protocol-popup></view></view></view>
|
||||
59
unpackage/dist/dev/mp-weixin/pages/login/enterprise.wxss
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
/* 协议同意区域 */
|
||||
.protocol-agreement.data-v-280ea37d {
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
.protocol-checkbox.data-v-280ea37d {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 15rpx;
|
||||
}
|
||||
.checkbox.data-v-280ea37d {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
border: 2rpx solid #ddd;
|
||||
border-radius: 6rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
transition: all 0.3s ease;
|
||||
margin-top: 2rpx;
|
||||
}
|
||||
.checkbox.checked.data-v-280ea37d {
|
||||
background-color: #007AFF;
|
||||
border-color: #007AFF;
|
||||
}
|
||||
.checkmark.data-v-280ea37d {
|
||||
color: white;
|
||||
font-size: 20rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.protocol-text.data-v-280ea37d {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
flex: 1;
|
||||
}
|
||||
.protocol-link.data-v-280ea37d {
|
||||
color: #007AFF;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 注册按钮样式 */
|
||||
.bg-gray.data-v-280ea37d {
|
||||
background-color: #ccc !important;
|
||||
color: #999 !important;
|
||||
}
|
||||
.bg-blue.data-v-280ea37d {
|
||||
background-color: #007AFF !important;
|
||||
color: white !important;
|
||||
}
|
||||
button[disabled].data-v-280ea37d {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
button.data-v-280ea37d:not([disabled]):active {
|
||||
transform: scale(0.98);
|
||||
transition: transform 0.1s ease;
|
||||
}
|
||||
168
unpackage/dist/dev/mp-weixin/pages/login/forget.js
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
if (!Array) {
|
||||
const _component_cu_custom = common_vendor.resolveComponent("cu-custom");
|
||||
_component_cu_custom();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "forget",
|
||||
setup(__props) {
|
||||
const phone = common_vendor.ref("");
|
||||
const password = common_vendor.ref("");
|
||||
const code = common_vendor.ref("");
|
||||
const second = common_vendor.ref(0);
|
||||
const showPassword = common_vendor.ref(false);
|
||||
let timer = null;
|
||||
const codeText = common_vendor.computed(() => {
|
||||
if (second.value === 0) {
|
||||
return "获取验证码";
|
||||
} else {
|
||||
const secondStr = second.value < 10 ? `0${second.value}` : second.value;
|
||||
return `重新获取${secondStr}`;
|
||||
}
|
||||
});
|
||||
const togglePassword = () => {
|
||||
showPassword.value = !showPassword.value;
|
||||
};
|
||||
const getCode = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "手机号不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (second.value > 0) {
|
||||
return;
|
||||
}
|
||||
second.value = 60;
|
||||
startCountdown();
|
||||
common_vendor.index.request({
|
||||
url: "http://example.com/api/code",
|
||||
data: {
|
||||
phone: phone.value,
|
||||
type: "forget"
|
||||
},
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "获取验证码失败",
|
||||
icon: "none"
|
||||
});
|
||||
second.value = 0;
|
||||
clearCountdown();
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "验证码已发送"
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
common_vendor.index.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
second.value = 0;
|
||||
clearCountdown();
|
||||
}
|
||||
});
|
||||
};
|
||||
const startCountdown = () => {
|
||||
clearCountdown();
|
||||
timer = setInterval(() => {
|
||||
second.value--;
|
||||
if (second.value === 0) {
|
||||
clearCountdown();
|
||||
}
|
||||
}, 1e3);
|
||||
};
|
||||
const clearCountdown = () => {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
};
|
||||
const handleReset = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "手机号不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (password.value.length < 6) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "密码不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (code.value.length !== 4) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "验证码不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.request({
|
||||
url: "http://example.com/api/forget",
|
||||
data: {
|
||||
phone: phone.value,
|
||||
password: password.value,
|
||||
code: code.value
|
||||
},
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "修改密码失败",
|
||||
icon: "none"
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "修改密码成功"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
common_vendor.index.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onUnmounted(() => {
|
||||
clearCountdown();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
isBack: true
|
||||
}),
|
||||
b: common_assets._imports_0$4,
|
||||
c: phone.value,
|
||||
d: common_vendor.o(($event) => phone.value = $event.detail.value),
|
||||
e: common_assets._imports_1$2,
|
||||
f: !showPassword.value,
|
||||
g: password.value,
|
||||
h: common_vendor.o(($event) => password.value = $event.detail.value),
|
||||
i: showPassword.value ? 1 : "",
|
||||
j: common_vendor.o(togglePassword),
|
||||
k: common_vendor.t(codeText.value),
|
||||
l: second.value > 0 ? 1 : "",
|
||||
m: common_vendor.o(getCode),
|
||||
n: common_vendor.o(handleReset)
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-79044ba6"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
5
unpackage/dist/dev/mp-weixin/pages/login/forget.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "忘记密码",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/forget.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['content', 'data-v-79044ba6', virtualHostClass]}}" style="{{virtualHostStyle}}"><cu-custom wx:if="{{a}}" class="data-v-79044ba6" virtualHostClass="data-v-79044ba6" u-s="{{['d']}}" u-i="79044ba6-0" bind:__l="__l" u-p="{{a}}"><view class="data-v-79044ba6" slot="backText">返回</view><view class="data-v-79044ba6" slot="content">忘记密码</view></cu-custom><view class="list data-v-79044ba6"><view class="tishi data-v-79044ba6">若您忘记了密码,可在此重新设置新密码。</view><view class="list-call data-v-79044ba6"><image class="img data-v-79044ba6" src="{{b}}"></image><input class="sl-input data-v-79044ba6" type="number" maxlength="11" placeholder="请输入手机号" value="{{c}}" bindinput="{{d}}"/></view><view class="list-call data-v-79044ba6"><image class="img data-v-79044ba6" src="{{e}}"></image><input class="sl-input data-v-79044ba6" type="text" maxlength="32" placeholder="请输入新密码" password="{{f}}" value="{{g}}" bindinput="{{h}}"/><text class="{{['eye-icon', 'data-v-79044ba6', i && 'eye-active']}}" bindtap="{{j}}"></text></view><view class="list-call data-v-79044ba6"><view class="{{['yzm', 'data-v-79044ba6', l && 'yzms']}}" bindtap="{{m}}">{{k}}</view></view></view><view class="padding-lr data-v-79044ba6"><view class="button-login data-v-79044ba6" hover-class="button-hover" bindtap="{{n}}"><text class="data-v-79044ba6">修改密码</text></view></view></view>
|
||||
116
unpackage/dist/dev/mp-weixin/pages/login/forget.wxss
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page.data-v-79044ba6 {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.content.data-v-79044ba6 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.tishi.data-v-79044ba6 {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
line-height: 50rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
.list.data-v-79044ba6 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 50rpx;
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
.list .list-call.data-v-79044ba6 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
color: #333333;
|
||||
background: #F5F7FB;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F5F7FB;
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.list .list-call .img.data-v-79044ba6 {
|
||||
width: 30rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.list .list-call .sl-input.data-v-79044ba6 {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
.list .list-call .eye-icon.data-v-79044ba6 {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
}
|
||||
.list .list-call .eye-icon.data-v-79044ba6::before {
|
||||
content: "\e69c";
|
||||
/* 闭眼图标的unicode */
|
||||
}
|
||||
.list .list-call .eye-icon.eye-active.data-v-79044ba6 {
|
||||
color: #3D83F6;
|
||||
}
|
||||
.list .list-call .eye-icon.eye-active.data-v-79044ba6::before {
|
||||
content: "\e69d";
|
||||
/* 睁眼图标的unicode */
|
||||
}
|
||||
.list .list-call .yzm.data-v-79044ba6 {
|
||||
width: 200rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #3D83F6;
|
||||
}
|
||||
.list .list-call .yzm.yzms.data-v-79044ba6 {
|
||||
color: #999999;
|
||||
}
|
||||
.padding-lr.data-v-79044ba6 {
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
.button-login.data-v-79044ba6 {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #3E95F1 0%, #4269F5 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 130rpx;
|
||||
}
|
||||
.button-hover.data-v-79044ba6 {
|
||||
opacity: 0.8;
|
||||
}
|
||||
99
unpackage/dist/dev/mp-weixin/pages/login/login.js
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const _sfc_main = {
|
||||
__name: "login",
|
||||
setup(__props) {
|
||||
const username = common_vendor.ref("");
|
||||
const password = common_vendor.ref("");
|
||||
const showPassword = common_vendor.ref(true);
|
||||
const changePassword = () => {
|
||||
showPassword.value = !showPassword.value;
|
||||
};
|
||||
const handleLogin = async () => {
|
||||
console.log("点击登录按钮");
|
||||
console.log("用户名:", username.value);
|
||||
console.log("密码:", password.value);
|
||||
if (!username.value) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "请输入用户名"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!password.value) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "请输入密码"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
console.log("开始调用登录接口...");
|
||||
const res = await request_api.login({
|
||||
username: username.value,
|
||||
password: password.value
|
||||
});
|
||||
console.log("登录接口返回:", res);
|
||||
if (res.code === 0) {
|
||||
if (res.data.token) {
|
||||
common_vendor.index.setStorageSync("token", res.data.token);
|
||||
}
|
||||
const userInfo = {
|
||||
userId: res.data.userId,
|
||||
username: res.data.username,
|
||||
nickName: res.data.nickName,
|
||||
deptId: res.data.deptId,
|
||||
deptName: res.data.deptName
|
||||
};
|
||||
common_vendor.index.setStorageSync("userInfo", JSON.stringify(userInfo));
|
||||
common_vendor.index.showToast({
|
||||
title: "登录成功",
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "登录失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("登录失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const goToReport = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/subpackages/suishoupai/pages/index/index"
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_assets._imports_0$3,
|
||||
b: common_assets._imports_0$4,
|
||||
c: username.value,
|
||||
d: common_vendor.o(($event) => username.value = $event.detail.value),
|
||||
e: common_assets._imports_1$2,
|
||||
f: showPassword.value,
|
||||
g: password.value,
|
||||
h: common_vendor.o(($event) => password.value = $event.detail.value),
|
||||
i: showPassword.value ? "/static/index/cl.png" : "/static/index/op.png",
|
||||
j: common_vendor.o(changePassword),
|
||||
k: common_vendor.o(handleLogin),
|
||||
l: common_assets._imports_3$1,
|
||||
m: common_vendor.o(goToReport)
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e4e4508d"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
5
unpackage/dist/dev/mp-weixin/pages/login/login.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "登录页面",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/login.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['content', 'data-v-e4e4508d', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="header data-v-e4e4508d"><image src="{{a}}" class="bg-image data-v-e4e4508d"></image><view class="padding login data-v-e4e4508d"><view class="text-xl text-black text-bold data-v-e4e4508d">账号登录</view><view class="padding-top data-v-e4e4508d">欢迎登录三查一曝光平台</view></view></view><view class="list data-v-e4e4508d"><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{b}}"></image><input class="sl-input data-v-e4e4508d" type="text" placeholder="请输入用户名" value="{{c}}" bindinput="{{d}}"/></view><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{e}}"></image><input class="sl-input data-v-e4e4508d" type="text" maxlength="32" placeholder="请输入密码" password="{{f}}" value="{{g}}" bindinput="{{h}}"/><image class="eye-img data-v-e4e4508d" src="{{i}}" bindtap="{{j}}"></image></view><view class="agreement data-v-e4e4508d"><navigator url="reg" open-type="navigate" class="link data-v-e4e4508d">注册成员账号</navigator><navigator url="forget" open-type="navigate" class="link data-v-e4e4508d">忘记密码?</navigator></view></view><view class="padding-lr data-v-e4e4508d"><button class="button-login data-v-e4e4508d" hover-class="button-hover" bindtap="{{k}}"> 登录 </button><view class="button-report margin-top data-v-e4e4508d" hover-class="button-hover" bindtap="{{m}}"><image src="{{l}}" class="icon-image data-v-e4e4508d"></image><text class="data-v-e4e4508d">随手拍举报</text></view></view></view>
|
||||
182
unpackage/dist/dev/mp-weixin/pages/login/login.wxss
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page.data-v-e4e4508d {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.content.data-v-e4e4508d {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.header.data-v-e4e4508d {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.header .bg-image.data-v-e4e4508d {
|
||||
width: 100%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.login.data-v-e4e4508d {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
color: #666666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.list.data-v-e4e4508d {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 50rpx;
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
background-color: #FFFFFF;
|
||||
margin-top: -2rpx;
|
||||
/* 消除可能的间隙 */
|
||||
}
|
||||
.list .list-call.data-v-e4e4508d {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
color: #333333;
|
||||
background: #F5F7FB;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F5F7FB;
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.list .list-call .img.data-v-e4e4508d {
|
||||
width: 30rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.list .list-call .sl-input.data-v-e4e4508d {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
.list .list-call .eye-img.data-v-e4e4508d {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.agreement.data-v-e4e4508d {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
color: #3D83F6;
|
||||
text-align: center;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.agreement .link.data-v-e4e4508d {
|
||||
font-size: 30rpx;
|
||||
color: #3D83F6;
|
||||
}
|
||||
.agreement .link.data-v-e4e4508d:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.padding-lr.data-v-e4e4508d {
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
.button-login.data-v-e4e4508d {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #3E95F1 0%, #4269F5 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 130rpx;
|
||||
border: none;
|
||||
}
|
||||
.button-login.data-v-e4e4508d::after {
|
||||
border: none;
|
||||
}
|
||||
.button-report.data-v-e4e4508d {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #FF7878 0%, #F2505B 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.margin-top.data-v-e4e4508d {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.button-hover.data-v-e4e4508d {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.text-blue.data-v-e4e4508d {
|
||||
color: #3D83F6;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.icon-image.data-v-e4e4508d {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.text-xl.data-v-e4e4508d {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.text-black.data-v-e4e4508d {
|
||||
color: #000000;
|
||||
}
|
||||
.text-bold.data-v-e4e4508d {
|
||||
font-weight: bold;
|
||||
}
|
||||
.padding.data-v-e4e4508d {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.padding-top.data-v-e4e4508d {
|
||||
padding-top: 15rpx;
|
||||
}
|
||||
.protocol-box.data-v-e4e4508d {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.protocol-box .protocol-link.data-v-e4e4508d {
|
||||
font-size: 28rpx;
|
||||
color: #3D83F6;
|
||||
text-decoration: underline;
|
||||
}
|
||||
201
unpackage/dist/dev/mp-weixin/pages/login/reg.js
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Array) {
|
||||
const _component_cu_custom = common_vendor.resolveComponent("cu-custom");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_form_item2 = common_vendor.resolveComponent("up-form-item");
|
||||
const _easycom_up_form2 = common_vendor.resolveComponent("up-form");
|
||||
(_component_cu_custom + _easycom_up_input2 + _easycom_up_form_item2 + _easycom_up_form2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_form_item = () => "../../uni_modules/uview-plus/components/u-form-item/u-form-item.js";
|
||||
const _easycom_up_form = () => "../../uni_modules/uview-plus/components/u-form/u-form.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_form_item + _easycom_up_form)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "reg",
|
||||
setup(__props) {
|
||||
const phone = common_vendor.ref("");
|
||||
const password = common_vendor.ref("");
|
||||
const code = common_vendor.ref("");
|
||||
const invitation = common_vendor.ref("");
|
||||
const second = common_vendor.ref(0);
|
||||
common_vendor.ref(false);
|
||||
const state = common_vendor.reactive({
|
||||
showSex: false,
|
||||
model1: {
|
||||
userInfo: {
|
||||
name: "uview-plus UI",
|
||||
sex: ""
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
"userInfo.name": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请填写姓名",
|
||||
trigger: ["blur", "change"]
|
||||
}
|
||||
}
|
||||
});
|
||||
common_vendor.computed(() => {
|
||||
if (second.value === 0) {
|
||||
return "获取验证码";
|
||||
} else {
|
||||
const secondStr = second.value < 10 ? `0${second.value}` : second.value;
|
||||
return `重新获取${secondStr}`;
|
||||
}
|
||||
});
|
||||
const handleRegister = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "手机号不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (password.value.length < 6) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "密码不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (code.value.length !== 4) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "验证码不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.request({
|
||||
url: "http://example.com/api/register",
|
||||
data: {
|
||||
phone: phone.value,
|
||||
password: password.value,
|
||||
code: code.value,
|
||||
invitation: invitation.value
|
||||
},
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "注册失败",
|
||||
icon: "none"
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "注册成功"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
common_vendor.index.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onUnmounted(() => {
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
isBack: true
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入企业名称",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
c: common_vendor.sr("item1", "561d431d-2,561d431d-1"),
|
||||
d: common_vendor.p({
|
||||
label: "加入企业",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
e: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
f: common_vendor.sr("item1", "561d431d-4,561d431d-1"),
|
||||
g: common_vendor.p({
|
||||
required: true,
|
||||
label: "真实姓名",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
h: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "选择",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
i: common_vendor.sr("item1", "561d431d-6,561d431d-1"),
|
||||
j: common_vendor.p({
|
||||
required: true,
|
||||
label: "选择分组/部门",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "120"
|
||||
}),
|
||||
k: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入手机号码",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
l: common_vendor.sr("item1", "561d431d-8,561d431d-1"),
|
||||
m: common_vendor.p({
|
||||
required: true,
|
||||
label: "手机号码",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
n: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入密码",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
o: common_vendor.sr("item1", "561d431d-10,561d431d-1"),
|
||||
p: common_vendor.p({
|
||||
required: true,
|
||||
label: "密码",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
q: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入密码",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
r: common_vendor.sr("item1", "561d431d-12,561d431d-1"),
|
||||
s: common_vendor.p({
|
||||
required: true,
|
||||
label: "确认密码",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
t: common_vendor.sr("form1", "561d431d-1"),
|
||||
v: common_vendor.p({
|
||||
labelPosition: "left",
|
||||
model: state.model1,
|
||||
rules: state.rules
|
||||
}),
|
||||
w: common_vendor.o(handleRegister)
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-561d431d"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
9
unpackage/dist/dev/mp-weixin/pages/login/reg.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "注册账号",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-form-item": "../../uni_modules/uview-plus/components/u-form-item/u-form-item",
|
||||
"up-form": "../../uni_modules/uview-plus/components/u-form/u-form"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/reg.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['content', 'data-v-561d431d', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="header data-v-561d431d"><cu-custom wx:if="{{a}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-s="{{['d']}}" u-i="561d431d-0" bind:__l="__l" u-p="{{a}}"><view class="data-v-561d431d" slot="backText">返回</view><view class="data-v-561d431d" slot="content">注册新成员账号</view></cu-custom></view><view class="padding solid radius margin data-v-561d431d"><up-form wx:if="{{v}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="form1" u-i="561d431d-1" bind:__l="__l" u-p="{{v}}"><up-form-item wx:if="{{d}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-2,561d431d-1" bind:__l="__l" u-p="{{d}}"><up-input wx:if="{{b}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-3,561d431d-2" bind:__l="__l" u-p="{{b}}"></up-input></up-form-item><up-form-item wx:if="{{g}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-4,561d431d-1" bind:__l="__l" u-p="{{g}}"><up-input wx:if="{{e}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-5,561d431d-4" bind:__l="__l" u-p="{{e}}"></up-input></up-form-item><up-form-item wx:if="{{j}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-6,561d431d-1" bind:__l="__l" u-p="{{j}}"><up-input wx:if="{{h}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-7,561d431d-6" bind:__l="__l" u-p="{{h}}"></up-input></up-form-item><up-form-item wx:if="{{m}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-8,561d431d-1" bind:__l="__l" u-p="{{m}}"><up-input wx:if="{{k}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-9,561d431d-8" bind:__l="__l" u-p="{{k}}"></up-input></up-form-item><up-form-item wx:if="{{p}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-10,561d431d-1" bind:__l="__l" u-p="{{p}}"><up-input wx:if="{{n}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-11,561d431d-10" bind:__l="__l" u-p="{{n}}"></up-input></up-form-item><up-form-item wx:if="{{s}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-12,561d431d-1" bind:__l="__l" u-p="{{s}}"><up-input wx:if="{{q}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-13,561d431d-12" bind:__l="__l" u-p="{{q}}"></up-input></up-form-item></up-form><view class=" data-v-561d431d"><view class="button-login data-v-561d431d" hover-class="button-hover" bindtap="{{w}}"><text class="data-v-561d431d">申请加入</text></view></view></view></view>
|
||||
128
unpackage/dist/dev/mp-weixin/pages/login/reg.wxss
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page.data-v-561d431d {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.content.data-v-561d431d {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.header.data-v-561d431d {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.header image.data-v-561d431d {
|
||||
width: 100%;
|
||||
}
|
||||
.list.data-v-561d431d {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 50rpx;
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
.list .list-call.data-v-561d431d {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
color: #333333;
|
||||
background: #F5F7FB;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F5F7FB;
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.list .list-call .img.data-v-561d431d {
|
||||
width: 30rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.list .list-call .sl-input.data-v-561d431d {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
.list .list-call .eye-icon.data-v-561d431d {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
}
|
||||
.list .list-call .eye-icon.data-v-561d431d::before {
|
||||
content: "\e69c";
|
||||
/* 闭眼图标的unicode */
|
||||
}
|
||||
.list .list-call .eye-icon.eye-active.data-v-561d431d {
|
||||
color: #3D83F6;
|
||||
}
|
||||
.list .list-call .eye-icon.eye-active.data-v-561d431d::before {
|
||||
content: "\e69d";
|
||||
/* 睁眼图标的unicode */
|
||||
}
|
||||
.list .list-call .yzm.data-v-561d431d {
|
||||
width: 200rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #3D83F6;
|
||||
}
|
||||
.list .list-call .yzm.yzms.data-v-561d431d {
|
||||
color: #999999;
|
||||
}
|
||||
.code-icon.data-v-561d431d::before {
|
||||
content: "\e682";
|
||||
/* 验证码图标的unicode */
|
||||
color: #999;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.invite-icon.data-v-561d431d::before {
|
||||
content: "\e683";
|
||||
/* 邀请码图标的unicode */
|
||||
color: #999;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.button-login.data-v-561d431d {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #3E95F1 0%, #4269F5 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 130rpx;
|
||||
}
|
||||
.button-hover.data-v-561d431d {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.data-v-561d431d .up-input__input {
|
||||
color: #3D83F6;
|
||||
}
|
||||
18
unpackage/dist/dev/mp-weixin/pages/login/success.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const success = true;
|
||||
const _sfc_main = {
|
||||
__name: "success",
|
||||
setup(__props) {
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: success
|
||||
}, {
|
||||
b: common_assets._imports_0$5
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b27d95ff"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
4
unpackage/dist/dev/mp-weixin/pages/login/success.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "注册成功",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/success.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-b27d95ff', virtualHostClass]}}" style="{{virtualHostStyle}}"><view wx:if="{{a}}" class="text-center data-v-b27d95ff"><image class="data-v-b27d95ff" src="{{b}}" style="width:160rpx;height:160rpx;margin-top:140rpx"></image><view class="text-bold margin-bottom-xl margin-top-xl data-v-b27d95ff">注册成功</view><view class="text-gray data-v-b27d95ff">等待管理员确认后,才能进行账号登录</view><button class="bg-blue round lg but data-v-b27d95ff">返回首页</button></view><view wx:else class="text-center data-v-b27d95ff"><image class="data-v-b27d95ff" src="{{c}}" style="width:160rpx;height:160rpx;margin-top:140rpx"></image><view class="text-bold margin-bottom-xl margin-top-xl data-v-b27d95ff">注册异常</view><view class="text-gray data-v-b27d95ff">员工已注册,如账号异常请联系管理员</view><button class="bg-blue round lg but data-v-b27d95ff">返回首页</button></view></view>
|
||||
6
unpackage/dist/dev/mp-weixin/pages/login/success.wxss
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
.but.data-v-b27d95ff {
|
||||
width: 248rpx;
|
||||
height: 88rpx;
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
8
unpackage/dist/dev/mp-weixin/pages/map/map.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"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], ["__scopeId", "data-v-e06b858f"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
4
unpackage/dist/dev/mp-weixin/pages/map/map.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "一张图",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/map/map.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['content', 'data-v-e06b858f', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="text-center padding-top-xl data-v-e06b858f"><text class="text-xl text-gray data-v-e06b858f">一张图功能开发中...</text></view></view>
|
||||
30
unpackage/dist/dev/mp-weixin/pages/map/map.wxss
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.content.data-v-e06b858f {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
"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_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_picker2 + _easycom_u_popup2)();
|
||||
const _component_TabBar = common_vendor.resolveComponent("TabBar");
|
||||
(_easycom_up_picker2 + _easycom_u_popup2 + _component_TabBar)();
|
||||
}
|
||||
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
@@ -13,6 +15,10 @@ if (!Math) {
|
||||
const _sfc_main = {
|
||||
__name: "membermanagemen",
|
||||
setup(__props) {
|
||||
const list = common_vendor.ref([]);
|
||||
request_api.getMemberList().then((res) => {
|
||||
list.value = res.data;
|
||||
});
|
||||
const showPopup = common_vendor.ref(false);
|
||||
const showDeptPicker = common_vendor.ref(false);
|
||||
const formData = common_vendor.reactive({
|
||||
@@ -22,34 +28,90 @@ const _sfc_main = {
|
||||
password: "",
|
||||
department: ""
|
||||
});
|
||||
const handleSubmit = () => {
|
||||
const handleSubmit = async () => {
|
||||
if (!formData.username) {
|
||||
common_vendor.index.showToast({ title: "请输入用户名", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入用户名",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!formData.password || formData.password.length < 6 || formData.password.length > 16) {
|
||||
common_vendor.index.showToast({ title: "请输入6-16位密码", icon: "none" });
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入6-16位密码",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!formData.department) {
|
||||
common_vendor.index.showToast({ title: "请选择主部门", icon: "none" });
|
||||
return;
|
||||
}
|
||||
console.log("提交数据:", formData);
|
||||
common_vendor.index.showToast({ title: "添加成功", icon: "success" });
|
||||
showPopup.value = false;
|
||||
const params = {
|
||||
userName: formData.username,
|
||||
nickName: formData.nickname || "",
|
||||
phonenumber: formData.phone || "",
|
||||
password: formData.password,
|
||||
roleType: "common"
|
||||
};
|
||||
const Lock = () => {
|
||||
try {
|
||||
const res = await request_api.addMember(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "添加成功",
|
||||
icon: "success"
|
||||
});
|
||||
showPopup.value = false;
|
||||
formData.username = "";
|
||||
formData.nickname = "";
|
||||
formData.phone = "";
|
||||
formData.password = "";
|
||||
formData.department = "";
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "添加失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("添加成员失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const Lock = (item) => {
|
||||
const isLocked = item.lockStatus === 1;
|
||||
const actionText = isLocked ? "解锁" : "锁定";
|
||||
const newLockStatus = isLocked ? 0 : 1;
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: "确定要锁定该成员吗?",
|
||||
content: `确定要${actionText}该成员吗?`,
|
||||
confirmColor: "#2667E9",
|
||||
success: (res) => {
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
console.log("用户点击确定");
|
||||
common_vendor.index.showToast({ title: "锁定成功", icon: "success" });
|
||||
} else if (res.cancel) {
|
||||
console.log("用户点击取消");
|
||||
try {
|
||||
const result = await request_api.lockOrUnlockMember({
|
||||
userId: item.userId,
|
||||
lockStatus: newLockStatus
|
||||
});
|
||||
if (result.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: `${actionText}成功`,
|
||||
icon: "success"
|
||||
});
|
||||
item.lockStatus = newLockStatus;
|
||||
item.statusName = newLockStatus === 1 ? "已锁定" : "正常";
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: result.msg || `${actionText}失败`,
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`${actionText}成员失败:`, error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -58,31 +120,58 @@ const _sfc_main = {
|
||||
const columns = common_vendor.reactive([
|
||||
["湘西自治州和谐网络科技有限公司", "湘西自治州和谐云科技有限公司"]
|
||||
]);
|
||||
const deptColumns = common_vendor.reactive([
|
||||
["湘西自治州和谐网络科技有限公司", "湘西自治州和谐云科技有限公司", "研发部门", "深圳总公司", "若依科技"]
|
||||
]);
|
||||
const onDeptConfirm = (e) => {
|
||||
console.log("选择的部门:", e);
|
||||
if (e.value && e.value.length > 0) {
|
||||
formData.department = e.value[0];
|
||||
}
|
||||
showDeptPicker.value = false;
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => show.value = true),
|
||||
a: common_vendor.f(list.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => show.value = true, item.id),
|
||||
b: "06d9f81b-0-" + i0,
|
||||
c: common_vendor.t(item.nickName),
|
||||
d: common_vendor.t(item.statusName),
|
||||
e: common_vendor.t(item.phonenumber),
|
||||
f: common_vendor.t(item.lockStatus === 1 ? "解锁" : "锁定"),
|
||||
g: common_vendor.o(($event) => Lock(item), item.id),
|
||||
h: item.id
|
||||
};
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
show: show.value,
|
||||
columns
|
||||
}),
|
||||
c: common_vendor.o(($event) => Lock()),
|
||||
d: common_vendor.o(($event) => showPopup.value = true),
|
||||
e: common_vendor.o(($event) => showPopup.value = false),
|
||||
f: formData.username,
|
||||
g: common_vendor.o(($event) => formData.username = $event.detail.value),
|
||||
h: formData.nickname,
|
||||
i: common_vendor.o(($event) => formData.nickname = $event.detail.value),
|
||||
j: formData.phone,
|
||||
k: common_vendor.o(($event) => formData.phone = $event.detail.value),
|
||||
l: formData.password,
|
||||
m: common_vendor.o(($event) => formData.password = $event.detail.value),
|
||||
n: common_vendor.t(formData.department || "请选择主部门"),
|
||||
o: common_vendor.n(formData.department ? "" : "text-gray"),
|
||||
p: common_vendor.o(($event) => showDeptPicker.value = true),
|
||||
q: common_vendor.o(($event) => showPopup.value = false),
|
||||
r: common_vendor.o(handleSubmit),
|
||||
s: common_vendor.o(($event) => showPopup.value = false),
|
||||
t: common_vendor.p({
|
||||
c: common_vendor.o(($event) => showPopup.value = true),
|
||||
d: common_vendor.o(($event) => showPopup.value = false),
|
||||
e: formData.username,
|
||||
f: common_vendor.o(($event) => formData.username = $event.detail.value),
|
||||
g: formData.nickname,
|
||||
h: common_vendor.o(($event) => formData.nickname = $event.detail.value),
|
||||
i: formData.phone,
|
||||
j: common_vendor.o(($event) => formData.phone = $event.detail.value),
|
||||
k: formData.password,
|
||||
l: common_vendor.o(($event) => formData.password = $event.detail.value),
|
||||
m: common_vendor.t(formData.department || "请选择主部门"),
|
||||
n: common_vendor.n(formData.department ? "" : "text-gray"),
|
||||
o: common_vendor.o(($event) => showDeptPicker.value = true),
|
||||
p: common_vendor.o(onDeptConfirm),
|
||||
q: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
r: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
s: common_vendor.p({
|
||||
show: showDeptPicker.value,
|
||||
columns: deptColumns
|
||||
}),
|
||||
t: common_vendor.o(($event) => showPopup.value = false),
|
||||
v: common_vendor.o(handleSubmit),
|
||||
w: common_vendor.o(($event) => showPopup.value = false),
|
||||
x: common_vendor.p({
|
||||
show: showPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['page', 'padding', 'data-v-06d9f81b', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-06d9f81b"><view class="flex justify-between align-center data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><view class="border-tite data-v-06d9f81b"></view><view class="text-bold margin-left-xs data-v-06d9f81b" bindtap="{{a}}">湘西自治州和谐网络科技有限公司</view><up-picker wx:if="{{b}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-0" bind:__l="__l" u-p="{{b}}"></up-picker></view><view class="tag-outline data-v-06d9f81b">负责人</view></view><view class="flex margin-top data-v-06d9f81b"><view class="cu-avatar radius lg data-v-06d9f81b" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg)"></view><view class="margin-left data-v-06d9f81b"><view class="flex data-v-06d9f81b"><view class="data-v-06d9f81b">罗燚</view><view class="margin-left-xs light bg-olive padding-left-xs padding-right-xs data-v-06d9f81b">正常</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">手机设置:</view><view class="data-v-06d9f81b">未设置</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">登录IP:</view><view class="data-v-06d9f81b">45.135.228.172</view></view></view><button class="bg-blue btn-lock data-v-06d9f81b" bindtap="{{c}}">锁定</button></view></view><button class="lg cuIcon-add bg-blue round margin-top-xl data-v-06d9f81b" bindtap="{{d}}">添加成员</button><u-popup wx:if="{{t}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-s="{{['d']}}" bindclose="{{s}}" u-i="06d9f81b-1" bind:__l="__l" u-p="{{t}}"><view class="popup-content data-v-06d9f81b"><view class="popup-header data-v-06d9f81b"><view class="popup-title text-bold data-v-06d9f81b">添加成员</view><view class="popup-close data-v-06d9f81b" bindtap="{{e}}">×</view></view><view class="popup-body data-v-06d9f81b"><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">用户名<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入用户名" value="{{f}}" bindinput="{{g}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">昵称</view><input class="form-input data-v-06d9f81b" placeholder="请输入昵称" value="{{h}}" bindinput="{{i}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">手机号</view><input class="form-input data-v-06d9f81b" placeholder="请输入手机号" type="number" value="{{j}}" bindinput="{{k}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">密码<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入密码(6-16位)" password value="{{l}}" bindinput="{{m}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">主部门<text class="text-red data-v-06d9f81b">*</text></view><view class="form-input form-select data-v-06d9f81b" bindtap="{{p}}"><text class="{{['data-v-06d9f81b', o]}}">{{n}}</text></view></view></view><view class="popup-footer data-v-06d9f81b"><button class="btn-cancel data-v-06d9f81b" bindtap="{{q}}">取消</button><button class="btn-confirm bg-blue data-v-06d9f81b" bindtap="{{r}}">确定</button></view></view></u-popup></view>
|
||||
<view class="{{['page', 'padding', 'data-v-06d9f81b', virtualHostClass]}}" style="{{virtualHostStyle}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="h" class="padding bg-white radius margin-bottom data-v-06d9f81b"><view class="flex justify-between align-center data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><view class="border-tite data-v-06d9f81b"></view><view class="text-bold margin-left-xs data-v-06d9f81b" bindtap="{{item.a}}">湘西自治州和谐网络科技有限公司</view><up-picker wx:if="{{b}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="{{item.b}}" bind:__l="__l" u-p="{{b}}"></up-picker></view><view class="tag-outline data-v-06d9f81b">负责人</view></view><view class="flex margin-top data-v-06d9f81b"><view class="cu-avatar radius lg data-v-06d9f81b" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg)"></view><view class="margin-left data-v-06d9f81b"><view class="flex data-v-06d9f81b"><view class="data-v-06d9f81b">{{item.c}}</view><view class="margin-left-xs light bg-olive padding-left-xs padding-right-xs data-v-06d9f81b">{{item.d}}</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">手机设置:</view><view class="data-v-06d9f81b">{{item.e}}</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">登录IP:</view><view class="data-v-06d9f81b">45.135.228.172</view></view></view><button class="bg-blue btn-lock data-v-06d9f81b" bindtap="{{item.g}}">{{item.f}}</button></view></view><button class="lg cuIcon-add bg-blue round margin-top-xl data-v-06d9f81b" bindtap="{{c}}">添加成员</button><u-popup wx:if="{{x}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-s="{{['d']}}" bindclose="{{w}}" u-i="06d9f81b-1" bind:__l="__l" u-p="{{x}}"><view class="popup-content data-v-06d9f81b"><view class="popup-header data-v-06d9f81b"><view class="popup-title text-bold data-v-06d9f81b">添加成员</view><view class="popup-close data-v-06d9f81b" bindtap="{{d}}">×</view></view><view class="popup-body data-v-06d9f81b"><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">用户名<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入用户名" value="{{e}}" bindinput="{{f}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">昵称</view><input class="form-input data-v-06d9f81b" placeholder="请输入昵称" value="{{g}}" bindinput="{{h}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">手机号</view><input class="form-input data-v-06d9f81b" placeholder="请输入手机号" type="number" value="{{i}}" bindinput="{{j}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">密码<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入密码(6-16位)" password value="{{k}}" bindinput="{{l}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">主部门<text class="text-red data-v-06d9f81b">*</text></view><view class="form-input form-select data-v-06d9f81b" bindtap="{{o}}"><text class="{{['data-v-06d9f81b', n]}}">{{m}}</text></view><up-picker wx:if="{{s}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" bindconfirm="{{p}}" bindcancel="{{q}}" bindclose="{{r}}" u-i="06d9f81b-2,06d9f81b-1" bind:__l="__l" u-p="{{s}}"></up-picker></view></view><view class="popup-footer data-v-06d9f81b"><button class="btn-cancel data-v-06d9f81b" bindtap="{{t}}">取消</button><button class="btn-confirm bg-blue data-v-06d9f81b" bindtap="{{v}}">确定</button></view></view></u-popup><tab-bar class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-3" bind:__l="__l"/></view>
|
||||
@@ -5,7 +5,7 @@ const _sfc_main = {};
|
||||
function _sfc_render(_ctx, _cache) {
|
||||
return {
|
||||
a: common_assets._imports_0$2,
|
||||
b: common_assets._imports_1$2
|
||||
b: common_assets._imports_1$1
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -24,19 +24,37 @@ const _sfc_main = {
|
||||
url: "/pages/personalcenter/account"
|
||||
});
|
||||
};
|
||||
const handleLogout = () => {
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: "确定要退出登录吗?",
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log("用户点击确定");
|
||||
common_vendor.index.clearStorageSync();
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/login/login"
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log("用户点击取消");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_assets._imports_0$1,
|
||||
b: common_vendor.o(($event) => Helpcenter()),
|
||||
c: common_assets._imports_1$1,
|
||||
d: common_assets._imports_2$1,
|
||||
c: common_assets._imports_1,
|
||||
d: common_assets._imports_2,
|
||||
e: common_vendor.o(($event) => Account()),
|
||||
f: common_assets._imports_3$1,
|
||||
f: common_assets._imports_3,
|
||||
g: common_vendor.o(($event) => notification()),
|
||||
h: common_assets._imports_4$1,
|
||||
h: common_assets._imports_4,
|
||||
i: common_assets._imports_5,
|
||||
j: common_vendor.o(($event) => Settings()),
|
||||
k: common_assets._imports_0$1
|
||||
k: common_assets._imports_0$1,
|
||||
l: common_vendor.o(($event) => handleLogout())
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||