2025-09-13 15:08:32 +08:00
|
|
|
|
import config from "../../config";
|
2024-12-17 20:25:21 +08:00
|
|
|
|
import {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
setToken,
|
|
|
|
|
setUserInfo,
|
2025-02-16 17:19:52 +08:00
|
|
|
|
getUserInfo,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
getOpenId,
|
|
|
|
|
setOpenId,
|
|
|
|
|
getSessionKey,
|
|
|
|
|
setSessionKey,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
} from "../../utils/auth";
|
2024-12-17 20:25:21 +08:00
|
|
|
|
import {
|
2025-02-16 10:30:12 +08:00
|
|
|
|
wxNumberLogin,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
getMaOpenId,
|
|
|
|
|
getMaPhoneNumber,
|
2025-02-15 14:20:43 +08:00
|
|
|
|
findUserInfoByCache,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
} from "../../api/login";
|
2024-12-17 20:25:21 +08:00
|
|
|
|
import {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
findProjectInfo,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
registerSubDepts,
|
2025-02-15 14:20:43 +08:00
|
|
|
|
findMyProjectList,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
registerSubDeptsUsers,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
findProSubDeptsUser,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
findProSubDeptsInfo,
|
2025-02-16 17:19:52 +08:00
|
|
|
|
findProSubDeptsUserById,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findProSubDeptsUserInfo,
|
|
|
|
|
} from "../../api/project";
|
2024-12-17 20:25:21 +08:00
|
|
|
|
import {
|
|
|
|
|
findBusExamInfos,
|
|
|
|
|
findBusTrainingVideos,
|
|
|
|
|
startPlayUserEduVideo,
|
|
|
|
|
endPlayUserEduVideo,
|
|
|
|
|
finishEduVideo,
|
|
|
|
|
submitBusExamUser,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
submitUserSignets,
|
|
|
|
|
} from "../../api/busEdu";
|
2024-12-17 20:25:21 +08:00
|
|
|
|
import {
|
2025-02-05 23:44:09 +08:00
|
|
|
|
findDictCache,
|
|
|
|
|
findCardOcrBack,
|
|
|
|
|
findCardOcrFront,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
} from "../../api/publics";
|
2024-12-20 20:24:08 +08:00
|
|
|
|
import {
|
|
|
|
|
securityFileUpload,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
securitySignFileUpload,
|
|
|
|
|
} from "../../utils/request";
|
2024-12-17 20:25:21 +08:00
|
|
|
|
const app = getApp();
|
2024-11-02 11:07:07 +08:00
|
|
|
|
Page({
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 页面的初始数据
|
|
|
|
|
*/
|
|
|
|
|
data: {
|
|
|
|
|
form: {
|
|
|
|
|
subDeptType: null,
|
|
|
|
|
craftType: null,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
craftPost: null,
|
|
|
|
|
leaderDegreeGrade: null,
|
2025-02-22 19:04:51 +08:00
|
|
|
|
userInfos: {},
|
2025-09-13 15:08:32 +08:00
|
|
|
|
degreeGrade: null,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
2024-12-20 20:24:08 +08:00
|
|
|
|
parForm: {},
|
2024-12-17 20:25:21 +08:00
|
|
|
|
limit: 1,
|
|
|
|
|
maxDate: new Date(2088, 1, 1).getTime(),
|
|
|
|
|
currentDate: new Date().getTime(),
|
|
|
|
|
title: "",
|
|
|
|
|
proId: null,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
userPost: null,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
initProject: {},
|
|
|
|
|
userPhoneNumber: null,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
userPostList: [],
|
2025-09-13 15:08:32 +08:00
|
|
|
|
deptTypeList: [
|
|
|
|
|
{
|
|
|
|
|
id: "4",
|
|
|
|
|
text: "劳务分包",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "5",
|
|
|
|
|
text: "专业分包",
|
|
|
|
|
},
|
|
|
|
|
],
|
2024-12-20 20:24:08 +08:00
|
|
|
|
craftTypeList: [],
|
|
|
|
|
craftPostList: [],
|
|
|
|
|
craftPostAllOrginList: [],
|
2025-09-13 15:08:32 +08:00
|
|
|
|
flowNodes: [
|
|
|
|
|
{
|
|
|
|
|
id: "1",
|
|
|
|
|
name: "信息登记",
|
|
|
|
|
text: "信息登记",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "2",
|
|
|
|
|
name: "视频学习",
|
|
|
|
|
text: "视频学习",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "3",
|
|
|
|
|
name: "在线考试",
|
|
|
|
|
text: "在线考试",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "4",
|
|
|
|
|
name: "文件签署",
|
|
|
|
|
text: "文件签署",
|
|
|
|
|
},
|
|
|
|
|
],
|
2024-12-17 20:25:21 +08:00
|
|
|
|
active: 0,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
posDataList: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
text: "测试",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
id: "2",
|
|
|
|
|
text: "测试111",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "3",
|
|
|
|
|
text: "测试222",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
2024-12-20 20:24:08 +08:00
|
|
|
|
eduCationalType: [],
|
2024-12-17 20:25:21 +08:00
|
|
|
|
showDetailsName: "",
|
|
|
|
|
showDetailsPopup: false,
|
|
|
|
|
mainActiveIndex: null,
|
|
|
|
|
chidActiveIndex: null,
|
|
|
|
|
imgBase: config.baseImgUrl,
|
|
|
|
|
videoIdx: 0,
|
|
|
|
|
videoUrl: "",
|
|
|
|
|
videoTitle: "",
|
|
|
|
|
eduVideoMenu: [],
|
|
|
|
|
eduVideoItem: [],
|
|
|
|
|
busExamInfos: {},
|
|
|
|
|
busExamQuestions: [],
|
|
|
|
|
time: 3600, // 初始倒计时为 3600 秒
|
|
|
|
|
timer: null,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
timeStr: "",
|
2024-12-17 20:25:21 +08:00
|
|
|
|
isPapers: false,
|
|
|
|
|
fileForm: {},
|
2025-01-05 23:27:05 +08:00
|
|
|
|
signTime: 120,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
signTimer: null,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
signPath: "",
|
|
|
|
|
youWuList: [
|
|
|
|
|
{
|
|
|
|
|
id: "0",
|
|
|
|
|
text: "无",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "1",
|
|
|
|
|
text: "有",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
illnessStatus: "",
|
|
|
|
|
supIllnessStatus: "",
|
|
|
|
|
loadShow: false,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
|
*/
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
console.log(options);
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (options && options.SIGID && options.QRPID) {
|
|
|
|
|
this.getDictCache(options.SIGID);
|
2024-12-22 19:55:21 +08:00
|
|
|
|
this.getMaOpenId();
|
2024-12-20 20:24:08 +08:00
|
|
|
|
this.getProjectInfo(options.QRPID);
|
|
|
|
|
if (options.PARID) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
this.setData({
|
2024-12-20 20:24:08 +08:00
|
|
|
|
"form.parId": options.PARID,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
2025-02-05 21:34:18 +08:00
|
|
|
|
this.getProSubDeptsUser(options.PARID);
|
2024-12-20 20:24:08 +08:00
|
|
|
|
}
|
|
|
|
|
let title = "";
|
|
|
|
|
let _userPostList = [];
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (options.SIGID == "1") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
title = "参建单位信息登记";
|
|
|
|
|
_userPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: "1",
|
|
|
|
|
text: "委托代理人",
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
} else if (options.SIGID == "2" || options.SIGID == "3") {
|
|
|
|
|
if (options.SIGID == "2") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
_userPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: "2",
|
|
|
|
|
text: "项目经理",
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
_userPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: "3",
|
|
|
|
|
text: "班组长",
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
2025-02-09 23:21:26 +08:00
|
|
|
|
_userPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: "5",
|
|
|
|
|
text: "特殊工种",
|
2025-02-09 23:21:26 +08:00
|
|
|
|
});
|
2025-01-19 00:59:43 +08:00
|
|
|
|
_userPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: "6",
|
|
|
|
|
text: "材料员",
|
2025-01-19 00:59:43 +08:00
|
|
|
|
});
|
|
|
|
|
_userPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: "8",
|
|
|
|
|
text: "安全员",
|
2025-01-19 00:59:43 +08:00
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
}
|
|
|
|
|
title = "参建单位管理人员信息登记";
|
2025-09-13 15:08:32 +08:00
|
|
|
|
} else if (options.SIGID == "4") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
title = "参建单位劳务人员信息登记";
|
2025-02-05 21:34:18 +08:00
|
|
|
|
_userPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: "4",
|
|
|
|
|
text: "劳务人员",
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
2025-02-22 19:04:51 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.craftType": "1",
|
2025-02-22 19:04:51 +08:00
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
title,
|
2025-02-22 19:04:51 +08:00
|
|
|
|
active: 0,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
proId: options.QRPID,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
userPost: options.SIGID,
|
|
|
|
|
"form.userPost": options.SIGID,
|
|
|
|
|
userPostList: _userPostList,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
"form.projectId": options.QRPID,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
app.toast("请求参数异常,请重新扫码...");
|
|
|
|
|
// wx.redirectTo({
|
2025-05-18 10:49:15 +08:00
|
|
|
|
// url: '/pages/login/login',
|
2024-12-17 20:25:21 +08:00
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-20 20:24:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 获取字典缓存数据
|
|
|
|
|
*/
|
|
|
|
|
getDictCache(signId) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (signId == "3") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
// 初始化工种类型
|
2025-02-09 23:21:26 +08:00
|
|
|
|
// findDictCache("pro_craft_type").then(res => {
|
|
|
|
|
// if (res.code == 200) {
|
|
|
|
|
// let craftTypeList = [];
|
|
|
|
|
// res.data.forEach(item => {
|
|
|
|
|
// if (item.dictValue != "3") {
|
|
|
|
|
// craftTypeList.push({
|
|
|
|
|
// "id": item.dictValue,
|
|
|
|
|
// "text": item.dictLabel
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// this.setData({
|
|
|
|
|
// craftTypeList
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// 初始化工种岗位
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findDictCache("pro_craft_post").then((res) => {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (res.code == 200) {
|
2025-02-09 23:21:26 +08:00
|
|
|
|
let list = [];
|
2025-09-13 15:08:32 +08:00
|
|
|
|
res.data.forEach((item) => {
|
|
|
|
|
if (item.cssClass == "1") {
|
2025-02-09 23:21:26 +08:00
|
|
|
|
list.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: item.dictValue,
|
|
|
|
|
text: item.dictLabel,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.setData({
|
2025-02-22 19:04:51 +08:00
|
|
|
|
craftPostList: list,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
craftPostAllOrginList: res.data,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
}
|
|
|
|
|
// 初始化学历类型
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findDictCache("educational_type").then((res) => {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
let eduCationalType = [];
|
2025-09-13 15:08:32 +08:00
|
|
|
|
res.data.forEach((item) => {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
eduCationalType.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: item.dictValue,
|
|
|
|
|
text: item.dictLabel,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
eduCationalType,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 授权登录
|
|
|
|
|
*/
|
|
|
|
|
getMaOpenId: function () {
|
|
|
|
|
wx.login({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
success: (res) => {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
getMaOpenId({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
code: res.code,
|
|
|
|
|
}).then((response) => {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
setOpenId(response.data.openid);
|
|
|
|
|
setSessionKey(response.data.sessionKey);
|
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-20 20:24:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 查询单位上级人员信息
|
|
|
|
|
*/
|
2025-02-05 21:34:18 +08:00
|
|
|
|
getProSubDeptsUser(parId) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findProSubDeptsUserById(parId).then((res) => {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
parForm: res.data,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 获取手机号码
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
getPhoneNumber(e) {
|
2024-12-22 19:55:21 +08:00
|
|
|
|
if (e.detail.code) {
|
|
|
|
|
let data = {
|
|
|
|
|
openId: getOpenId(),
|
|
|
|
|
sessionKey: getSessionKey(),
|
|
|
|
|
iv: e.detail.iv,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
encryptedData: e.detail.encryptedData,
|
|
|
|
|
};
|
|
|
|
|
getMaPhoneNumber(data).then((res) => {
|
2024-12-22 19:55:21 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
let phoneNumber = res.data;
|
2025-02-11 15:01:51 +08:00
|
|
|
|
this.initData(phoneNumber);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
} else {
|
2024-12-22 19:55:21 +08:00
|
|
|
|
//用户决绝授权
|
|
|
|
|
app.toast("请允许微信手机号一键登录");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2025-02-22 19:04:51 +08:00
|
|
|
|
initData(phoneNumber) {
|
|
|
|
|
//使用手机号码查询详情
|
|
|
|
|
if (this.data.userPost == "1") {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findProSubDeptsInfo(this.data.proId, phoneNumber).then((deptRes) => {
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (deptRes.code == 200 && deptRes.data) {
|
|
|
|
|
deptRes.data.subDeptLeaderPhone = phoneNumber;
|
|
|
|
|
if (deptRes.data.proProjectInfoSubdeptsUsers) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
deptRes.data.leaderDegreeGrade =
|
|
|
|
|
deptRes.data.proProjectInfoSubdeptsUsers.degreeGrade;
|
|
|
|
|
deptRes.data.eduFilePath =
|
|
|
|
|
deptRes.data.proProjectInfoSubdeptsUsers.eduFilePath;
|
|
|
|
|
deptRes.data.subStep =
|
|
|
|
|
deptRes.data.proProjectInfoSubdeptsUsers.subStep;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
if (deptRes.data.businessLicensePath) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
deptRes.data.businessLicensePath = (
|
|
|
|
|
this.data.imgBase + deptRes.data.businessLicensePath
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
if (deptRes.data.subDeptInfos) {
|
|
|
|
|
let subDeptInfosJSON = JSON.parse(deptRes.data.subDeptInfos);
|
|
|
|
|
deptRes.data.subDeptInfos = subDeptInfosJSON;
|
|
|
|
|
if (deptRes.data.subDeptInfos.legalPersonCardImgPos) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
deptRes.data.subDeptInfos.legalPersonCardImgPos = (
|
|
|
|
|
this.data.imgBase +
|
|
|
|
|
deptRes.data.subDeptInfos.legalPersonCardImgPos
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
if (deptRes.data.subDeptInfos.legalPersonCardImgInv) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
deptRes.data.subDeptInfos.legalPersonCardImgInv = (
|
|
|
|
|
this.data.imgBase +
|
|
|
|
|
deptRes.data.subDeptInfos.legalPersonCardImgInv
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (deptRes.data.proProjectInfoSubdeptsUsers.userInfos) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let userInfosJSON = JSON.parse(
|
|
|
|
|
deptRes.data.proProjectInfoSubdeptsUsers.userInfos
|
|
|
|
|
);
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (userInfosJSON.cardImgPos) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
deptRes.data.leaderCardImgPos = (
|
|
|
|
|
this.data.imgBase + userInfosJSON.cardImgPos
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
if (userInfosJSON.cardImgInv) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
deptRes.data.leaderCardImgInv = (
|
|
|
|
|
this.data.imgBase + userInfosJSON.cardImgInv
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
deptRes.data.proProjectInfoSubdeptsUsers.userInfos = userInfosJSON;
|
|
|
|
|
deptRes.data.nativePlace = userInfosJSON.nativePlace;
|
|
|
|
|
deptRes.data.nation = userInfosJSON.nation;
|
|
|
|
|
deptRes.data.address = userInfosJSON.address;
|
|
|
|
|
deptRes.data.emergencyContact = userInfosJSON.emergencyContact;
|
|
|
|
|
deptRes.data.contactPhone = userInfosJSON.contactPhone;
|
|
|
|
|
}
|
|
|
|
|
if (deptRes.data.proProjectInfoSubdeptsUsers.userPicture) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
deptRes.data.leaderUserPicture = (
|
|
|
|
|
this.data.imgBase +
|
|
|
|
|
deptRes.data.proProjectInfoSubdeptsUsers.userPicture
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
if (deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
deptRes.data.subDeptLeaderPowerPath = (
|
|
|
|
|
this.data.imgBase +
|
|
|
|
|
deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
form: deptRes.data,
|
|
|
|
|
userPhoneNumber: phoneNumber,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
active: deptRes.data.subStep,
|
2025-02-22 19:04:51 +08:00
|
|
|
|
});
|
|
|
|
|
if (deptRes.data.proProjectInfoSubdeptsUsers.subStep == 1) {
|
|
|
|
|
this.initBusEduVideos(false);
|
|
|
|
|
} else if (deptRes.data.proProjectInfoSubdeptsUsers.subStep == 2) {
|
|
|
|
|
this.initBusEduQuestion(false);
|
|
|
|
|
} else if (deptRes.data.proProjectInfoSubdeptsUsers.subStep == 3) {
|
|
|
|
|
this.startSignFile(false);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.setData({
|
|
|
|
|
userPhoneNumber: phoneNumber,
|
|
|
|
|
"form.subDeptLeaderPhone": phoneNumber,
|
|
|
|
|
});
|
2025-02-11 15:01:51 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findProSubDeptsUser(this.data.proId, phoneNumber).then((userRes) => {
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (userRes.code == 200 && userRes.data) {
|
|
|
|
|
if (userRes.data.userInfos) {
|
|
|
|
|
let userInfosJSON = JSON.parse(userRes.data.userInfos);
|
|
|
|
|
userRes.data.nativePlace = userInfosJSON.nativePlace;
|
|
|
|
|
userRes.data.nation = userInfosJSON.nation;
|
|
|
|
|
userRes.data.address = userInfosJSON.address;
|
|
|
|
|
userRes.data.emergencyContact = userInfosJSON.emergencyContact;
|
|
|
|
|
userRes.data.contactPhone = userInfosJSON.contactPhone;
|
|
|
|
|
userRes.data.bankName = userInfosJSON.bankName;
|
|
|
|
|
userRes.data.bankOffice = userInfosJSON.bankOffice;
|
|
|
|
|
userRes.data.bankCardNo = userInfosJSON.bankCardNo;
|
2025-03-22 18:48:51 +08:00
|
|
|
|
userRes.data.cardImgPos = userInfosJSON.cardImgPos;
|
|
|
|
|
userRes.data.cardImgInv = userInfosJSON.cardImgInv;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
if (userRes.data.cardImgPos) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
userRes.data.cardImgPos = (
|
|
|
|
|
this.data.imgBase + userRes.data.cardImgPos
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
if (userRes.data.cardImgInv) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
userRes.data.cardImgInv = (
|
|
|
|
|
this.data.imgBase + userRes.data.cardImgInv
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
if (userRes.data.userPicture) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
userRes.data.userPicture = (
|
|
|
|
|
this.data.imgBase + userRes.data.userPicture
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
if (userRes.data.subDeptPowerPath) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
userRes.data.subDeptPowerPath = (
|
|
|
|
|
this.data.imgBase + userRes.data.subDeptPowerPath
|
|
|
|
|
).split(",");
|
2025-02-22 19:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
form: userRes.data,
|
|
|
|
|
userPhoneNumber: phoneNumber,
|
|
|
|
|
"form.userPhone": phoneNumber,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
active: userRes.data.subStep,
|
2025-02-22 19:04:51 +08:00
|
|
|
|
});
|
|
|
|
|
if (userRes.data.subStep == 1) {
|
|
|
|
|
this.initBusEduVideos(false);
|
|
|
|
|
} else if (userRes.data.subStep == 2) {
|
|
|
|
|
this.initBusEduQuestion(false);
|
|
|
|
|
} else if (userRes.data.subStep == 3) {
|
|
|
|
|
this.startSignFile(false);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.setData({
|
|
|
|
|
userPhoneNumber: phoneNumber,
|
|
|
|
|
"form.userPhone": phoneNumber,
|
|
|
|
|
});
|
2025-02-11 15:01:51 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 初始化学习视频
|
|
|
|
|
*/
|
|
|
|
|
initBusEduVideos: function (skip) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
active: skip ? this.data.active + 1 : this.data.active,
|
|
|
|
|
});
|
|
|
|
|
findBusTrainingVideos(this.data.proId, this.data.userPhoneNumber).then(
|
|
|
|
|
(res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
if (res.data && res.data.length > 0) {
|
|
|
|
|
let videoMenus = [];
|
|
|
|
|
let videoItems = [];
|
|
|
|
|
res.data.forEach((menuItem) => {
|
|
|
|
|
videoMenus.push({
|
|
|
|
|
menuId: menuItem.menuId,
|
|
|
|
|
menuName: menuItem.menuName,
|
|
|
|
|
});
|
|
|
|
|
menuItem.busTrainingVideos.forEach((videoItem) => {
|
|
|
|
|
videoItem.menuId = menuItem.menuId;
|
|
|
|
|
videoItem.menuName = menuItem.menuName;
|
|
|
|
|
videoItems.push(videoItem);
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
startPlayUserEduVideo(videoItems[0].remark);
|
|
|
|
|
this.setData({
|
|
|
|
|
videoActive: res.data[0].menuId,
|
|
|
|
|
eduVideoMenu: videoMenus,
|
|
|
|
|
eduVideoItem: videoItems,
|
|
|
|
|
videoIdx: 0,
|
|
|
|
|
videoUrl: this.data.imgBase + videoItems[0].trainFilePath,
|
|
|
|
|
videoTitle: videoItems[0].trainTitle,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
} else {
|
|
|
|
|
//没有视频时跳过学习...
|
|
|
|
|
this.initBusEduQuestion();
|
|
|
|
|
}
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 上一个学习视频
|
|
|
|
|
*/
|
|
|
|
|
onClickPrevsVideo: function () {
|
|
|
|
|
if (this.data.videoIdx == 0) {
|
|
|
|
|
app.toast("播放失败,这已经是第一个视频了。");
|
|
|
|
|
} else {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
videoIdx: this.data.videoIdx - 1,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
this.data.eduVideoItem.forEach((item, idx) => {
|
|
|
|
|
if (this.data.videoIdx == idx) {
|
|
|
|
|
this.setData({
|
|
|
|
|
videoActive: item.menuId,
|
|
|
|
|
videoUrl: this.data.imgBase + item.trainFilePath,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
videoTitle: item.trainTitle,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 下一个学习视频
|
|
|
|
|
*/
|
|
|
|
|
onClickAfterVideo: function (event) {
|
|
|
|
|
let videoSize = this.data.eduVideoItem.length;
|
|
|
|
|
let currentVideo = this.data.videoIdx + 1;
|
|
|
|
|
if (currentVideo >= videoSize) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
finishEduVideo(this.data.eduVideoItem[this.data.videoIdx].remark).then(
|
|
|
|
|
(res) => {
|
|
|
|
|
//视频学习完成...
|
|
|
|
|
app.toast("学习完成,您可以开始考试了。", "none", 3000);
|
|
|
|
|
}
|
|
|
|
|
);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
} else {
|
|
|
|
|
endPlayUserEduVideo(this.data.eduVideoItem[this.data.videoIdx].remark);
|
|
|
|
|
startPlayUserEduVideo(this.data.eduVideoItem[currentVideo].remark);
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let msg =
|
|
|
|
|
"正在学习第 " +
|
|
|
|
|
currentVideo +
|
|
|
|
|
"个视频,还有 " +
|
|
|
|
|
(videoSize - currentVideo) +
|
|
|
|
|
"个视频待学习。";
|
2025-02-16 10:30:12 +08:00
|
|
|
|
app.toast(msg, "none", 1500);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
videoIdx: this.data.videoIdx + 1,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
this.data.eduVideoItem.forEach((item, idx) => {
|
|
|
|
|
if (this.data.videoIdx == idx) {
|
|
|
|
|
this.setData({
|
|
|
|
|
videoActive: item.menuId,
|
|
|
|
|
videoUrl: this.data.imgBase + item.trainFilePath,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
videoTitle: item.trainTitle,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 初始化学习考试
|
|
|
|
|
*/
|
|
|
|
|
startBusEduExamNode: function () {
|
|
|
|
|
let videoSize = this.data.eduVideoItem.length;
|
|
|
|
|
let currentVideo = this.data.videoIdx + 1;
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (this.data.form.subStep > 1 || currentVideo >= videoSize) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
this.initBusEduQuestion(true);
|
|
|
|
|
} else {
|
2025-02-16 10:30:12 +08:00
|
|
|
|
app.toast("请学习完所有视频后再进行考试。", "none", 1500);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 重新开始考试
|
|
|
|
|
*/
|
|
|
|
|
anewBusEduQuestion() {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
isPapers: false,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
this.initBusEduQuestion(false);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 初始化学习考试
|
|
|
|
|
*/
|
|
|
|
|
initBusEduQuestion: function (skip) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
active: skip ? this.data.active + 1 : this.data.active,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
clearInterval(this.data.timer);
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
time: 3600,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
this.startCountdown(); // 页面加载时开始倒计时
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findBusExamInfos(this.data.proId, this.data.userPhoneNumber).then((res) => {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
if (res.data && res.data && res.data.busExamUserResultList) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
res.data.busExamUserResultList.forEach((item) => {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
item.questionOption = JSON.parse(item.questionOption);
|
|
|
|
|
});
|
|
|
|
|
this.setData({
|
|
|
|
|
busExamInfos: res.data,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
busExamQuestions: res.data.busExamUserResultList,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
//没有答题时跳过学习...
|
|
|
|
|
//this.initBusEduQuestion();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 选中单选框
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
toggleRadio(e) {
|
|
|
|
|
if (!this.data.isPapers) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let idxs = e.currentTarget.dataset.id.split("_");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let _busExamQuestions = this.data.busExamQuestions;
|
2025-09-13 15:08:32 +08:00
|
|
|
|
_busExamQuestions[idxs[0]].questionOption.forEach((item) => {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
item.selected = false;
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
_busExamQuestions[idxs[0]].questionOption[idxs[1]].selected = true;
|
2025-01-19 00:59:43 +08:00
|
|
|
|
let _userAnswer = [];
|
2025-09-13 15:08:32 +08:00
|
|
|
|
_busExamQuestions[idxs[0]].questionOption.forEach((item) => {
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (item.selected) {
|
2025-01-19 00:59:43 +08:00
|
|
|
|
_userAnswer.push(item.opt);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
_busExamQuestions[idxs[0]].userAnswer = _userAnswer.toString();
|
2024-12-17 20:25:21 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
busExamQuestions: _busExamQuestions,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 选中复选框
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
toggleCheckbox(e) {
|
|
|
|
|
if (!this.data.isPapers) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let idxs = e.currentTarget.dataset.id.split("_");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let _busExamQuestions = this.data.busExamQuestions;
|
2025-09-13 15:08:32 +08:00
|
|
|
|
_busExamQuestions[idxs[0]].questionOption[idxs[1]].selected =
|
|
|
|
|
!_busExamQuestions[idxs[0]].questionOption[idxs[1]].selected;
|
2025-01-19 00:59:43 +08:00
|
|
|
|
let _userAnswer = [];
|
2025-09-13 15:08:32 +08:00
|
|
|
|
_busExamQuestions[idxs[0]].questionOption.forEach((item) => {
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (item.selected) {
|
2025-01-19 00:59:43 +08:00
|
|
|
|
_userAnswer.push(item.opt);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
_busExamQuestions[idxs[0]].userAnswer = _userAnswer.toString();
|
2024-12-17 20:25:21 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
busExamQuestions: _busExamQuestions,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 提交试卷
|
|
|
|
|
*/
|
|
|
|
|
submitThePapers(skip) {
|
|
|
|
|
let _busExamQuestions = this.data.busExamQuestions;
|
|
|
|
|
for (let i = 0; i < _busExamQuestions.length; i++) {
|
|
|
|
|
let ck = false;
|
|
|
|
|
let _userAnswer = [];
|
|
|
|
|
for (let y = 0; y < _busExamQuestions[i].questionOption.length; y++) {
|
|
|
|
|
if (_busExamQuestions[i].questionOption[y].selected) {
|
|
|
|
|
ck = true;
|
|
|
|
|
_userAnswer.push(_busExamQuestions[i].questionOption[y].opt);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!ck) {
|
|
|
|
|
if (skip == "skip") {
|
|
|
|
|
_busExamQuestions[i].userAnswer = "";
|
|
|
|
|
} else {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
app.toast(
|
|
|
|
|
"第" + (i + 1) + "题还未答,请完成考试后再提交试卷!",
|
|
|
|
|
"none",
|
|
|
|
|
1500
|
|
|
|
|
);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
_busExamQuestions[i].userAnswer = _userAnswer.toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
busExamQuestions: _busExamQuestions,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
let that = this;
|
|
|
|
|
//弹出确认
|
|
|
|
|
wx.showModal({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
title: "提示",
|
|
|
|
|
content: "是否确认提交试卷信息?",
|
2024-12-17 20:25:21 +08:00
|
|
|
|
success: function (sm) {
|
|
|
|
|
if (sm.confirm) {
|
|
|
|
|
that.submitThePapersValues();
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 提交试卷答案
|
|
|
|
|
*/
|
|
|
|
|
submitThePapersValues() {
|
|
|
|
|
let examForm = this.data.busExamInfos;
|
|
|
|
|
let busExamQuestions = this.data.busExamQuestions;
|
2025-09-13 15:08:32 +08:00
|
|
|
|
busExamQuestions.forEach((item) => {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
item.questionOption = null;
|
|
|
|
|
});
|
|
|
|
|
examForm.busExamUserResultList = busExamQuestions;
|
2025-09-13 15:08:32 +08:00
|
|
|
|
submitBusExamUser(examForm).then((res) => {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
this.setData({
|
|
|
|
|
isPapers: true,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
busExamInfos: res.data,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
wx.pageScrollTo({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
scrollTop: 0,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 开始签署文件
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} skip
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
startSignFile(skip) {
|
|
|
|
|
let _fileForm = {};
|
2025-02-13 00:20:07 +08:00
|
|
|
|
_fileForm.fName = "";
|
|
|
|
|
_fileForm.fCardId = "";
|
|
|
|
|
_fileForm.fSex = "";
|
|
|
|
|
_fileForm.fPost = "";
|
|
|
|
|
_fileForm.fDate = "";
|
2024-12-17 20:25:21 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
active: skip ? this.data.active + 1 : this.data.active,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
fileForm: _fileForm,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
signTime: 120,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
clearInterval(this.data.signTimer);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
this.startSignCountdown();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 准备开始签名
|
|
|
|
|
* 跳转签名页面
|
|
|
|
|
*/
|
|
|
|
|
startSignFiles() {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let { signTime, illnessStatus, supIllnessStatus } = this.data;
|
2024-12-18 22:34:51 +08:00
|
|
|
|
if (signTime > 0) {
|
|
|
|
|
app.toast("请仔细阅读各项承诺书及三级安全教育!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (illnessStatus == "") {
|
|
|
|
|
app.toast("请选择健康情况!");
|
|
|
|
|
wx.pageScrollTo({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
scrollTop: 99999,
|
2024-12-18 22:34:51 +08:00
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (supIllnessStatus == "") {
|
|
|
|
|
app.toast("请选择严重疾病情况!");
|
|
|
|
|
wx.pageScrollTo({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
scrollTop: 99999,
|
2024-12-18 22:34:51 +08:00
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let myCanvas = this.selectComponent(".myCanvas");
|
|
|
|
|
myCanvas.showSign();
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
2024-12-18 22:34:51 +08:00
|
|
|
|
* 确认签名
|
|
|
|
|
*/
|
|
|
|
|
sign(e) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let tempFilePath = e.detail;
|
|
|
|
|
securitySignFileUpload(tempFilePath).then((res) => {
|
2024-12-18 22:34:51 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
signPath: res.data.url,
|
2024-12-18 22:34:51 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 提交签名
|
|
|
|
|
*/
|
|
|
|
|
submitSignFiles() {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let { proId, signPath, userPhoneNumber, illnessStatus, supIllnessStatus } =
|
|
|
|
|
this.data;
|
2024-12-18 22:34:51 +08:00
|
|
|
|
if (illnessStatus == "") {
|
|
|
|
|
app.toast("请选择身体健康情况!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (supIllnessStatus == "") {
|
|
|
|
|
app.toast("请选择身体严重疾病情况!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (signPath == "") {
|
|
|
|
|
app.toast("请填入受教育人手写签名!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (proId && userPhoneNumber && signPath) {
|
2024-12-18 22:34:51 +08:00
|
|
|
|
let that = this;
|
|
|
|
|
//弹出确认
|
|
|
|
|
wx.showModal({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
title: "提示",
|
|
|
|
|
content: "是否确认提交文件签署信息?",
|
2024-12-18 22:34:51 +08:00
|
|
|
|
success: function (sm) {
|
|
|
|
|
if (sm.confirm) {
|
|
|
|
|
that.submitSignFilesValues();
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-12-18 22:34:51 +08:00
|
|
|
|
} else {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
app.toast("信息异常...请刷新页面后重新操作!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-18 22:34:51 +08:00
|
|
|
|
/**
|
|
|
|
|
* 提交文件签署表单
|
|
|
|
|
*/
|
|
|
|
|
submitSignFilesValues() {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let { proId, signPath, userPhoneNumber, illnessStatus, supIllnessStatus } =
|
|
|
|
|
this.data;
|
2024-12-18 22:34:51 +08:00
|
|
|
|
let param = {};
|
|
|
|
|
param.proId = proId;
|
2024-12-20 20:24:08 +08:00
|
|
|
|
param.userPhone = userPhoneNumber;
|
2024-12-18 22:34:51 +08:00
|
|
|
|
param.imgPath = signPath;
|
|
|
|
|
param.illnessStatus = illnessStatus;
|
|
|
|
|
param.supIllnessStatus = supIllnessStatus;
|
2025-09-13 15:08:32 +08:00
|
|
|
|
submitUserSignets(param).then((res) => {
|
2024-12-18 22:34:51 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.setData({
|
2024-12-20 20:24:08 +08:00
|
|
|
|
active: res.data.subStep,
|
|
|
|
|
"form.subStep": res.data.subStep,
|
|
|
|
|
"form.approveStatus": res.data.approveStatus,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.eduFilePath": res.data.eduFilePath,
|
2024-12-18 22:34:51 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-20 20:24:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 下载签名文件
|
|
|
|
|
*/
|
|
|
|
|
downloadSignetFiles() {
|
2025-01-04 18:20:48 +08:00
|
|
|
|
let _baseUrl = config.baseUrl;
|
|
|
|
|
let _eduFilePath = this.data.form.eduFilePath;
|
2024-12-20 20:24:08 +08:00
|
|
|
|
wx.downloadFile({
|
|
|
|
|
// 示例 url,并非真实存在
|
2025-09-13 15:08:32 +08:00
|
|
|
|
url: _baseUrl + "/file/NoSecurity/download?fileName=" + _eduFilePath,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
success: function (res) {
|
2025-02-15 14:58:19 +08:00
|
|
|
|
const filePath = res.tempFilePath;
|
|
|
|
|
const fileTypes = _eduFilePath.split(".");
|
2024-12-20 20:24:08 +08:00
|
|
|
|
wx.openDocument({
|
|
|
|
|
filePath: filePath,
|
2025-01-04 18:20:48 +08:00
|
|
|
|
fileType: fileTypes[fileTypes.length - 1],
|
2024-12-20 20:24:08 +08:00
|
|
|
|
success: function (res) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
console.log("打开文档成功");
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
fail: function (res) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
console.log(res);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 根据身份证号获取性别
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} idCard
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
getGenderFromIdCard: function (idCard) {
|
|
|
|
|
// 先判断是否是有效的身份证号码(18位或15位)
|
|
|
|
|
const isValid = this.validateIdCard(idCard);
|
|
|
|
|
if (!isValid) {
|
|
|
|
|
return "未知";
|
|
|
|
|
}
|
|
|
|
|
// 如果是18位身份证,倒数第二位是性别标志
|
2025-09-13 15:08:32 +08:00
|
|
|
|
const genderDigit =
|
|
|
|
|
idCard.length === 18
|
|
|
|
|
? parseInt(idCard.charAt(16))
|
|
|
|
|
: parseInt(idCard.charAt(14));
|
2024-12-17 20:25:21 +08:00
|
|
|
|
// 根据性别标志判断男女
|
|
|
|
|
if (genderDigit % 2 === 0) {
|
|
|
|
|
return "女"; // 偶数为女性
|
|
|
|
|
} else {
|
|
|
|
|
return "男"; // 奇数为男性
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 验证身份证号码是否有效(15位或18位)
|
|
|
|
|
validateIdCard: function (idCard) {
|
|
|
|
|
const reg15 = /^[1-9]\d{14}$/; // 15位身份证号的正则
|
|
|
|
|
const reg18 = /^[1-9]\d{17}(\d|X|x)$/; // 18位身份证号的正则
|
|
|
|
|
return reg15.test(idCard) || reg18.test(idCard);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 授权登录
|
|
|
|
|
*/
|
2024-12-20 20:24:08 +08:00
|
|
|
|
getProjectInfo: function (proId) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findProjectInfo(proId).then((res) => {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let list = [];
|
|
|
|
|
list.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: res.data.id,
|
|
|
|
|
text: res.data.projectName,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
app.globalData.projectInfoList = list;
|
|
|
|
|
app.globalData.useProjectId = res.data.id;
|
|
|
|
|
app.globalData.useProjectName = res.data.projectName;
|
|
|
|
|
this.setData({
|
|
|
|
|
initProject: {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: res.data.id,
|
|
|
|
|
text: res.data.projectName,
|
|
|
|
|
},
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 选中单位类型
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
onSubDeptType(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptType": e.detail.id,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 参建单位名称
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
onSubDeptName(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptName": e.detail.value,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 社会信用代码
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
onSubDeptCode(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptCode": e.detail.value,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 营业执照副本
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUpload0(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.businessLicensePath": file,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 法人身份证正面
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUpload1(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptInfos.legalPersonCardImgPos": file,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
2025-02-05 23:44:09 +08:00
|
|
|
|
file.forEach(async (item, idx) => {
|
|
|
|
|
let obj = await this.syncUploadImage(item);
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findCardOcrFront(obj.data.data.url).then((res) => {
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (res.code == 200) {
|
2025-02-05 23:44:09 +08:00
|
|
|
|
this.setData({
|
|
|
|
|
"form.subDeptInfos.legalPerson": res.data.name,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptInfos.legalPersonCard": res.data.cardId,
|
|
|
|
|
});
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (!res.data.name || !res.data.cardId) {
|
2025-02-05 23:44:09 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptInfos.legalPersonCardImgPos": [],
|
2025-02-05 23:44:09 +08:00
|
|
|
|
});
|
|
|
|
|
app.toast("身份证正面照识别失败!请重新上传");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 法人身份证反面
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUpload2(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptInfos.legalPersonCardImgInv": file,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 单位法人姓名 */
|
|
|
|
|
inputInfoslegalPerson(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptInfos.legalPerson": e.detail.value,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 单位法人身份证号 */
|
|
|
|
|
inputInfoslegalPersonCard(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptInfos.legalPersonCard": e.detail.value,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 合同约定的承包范围 */
|
|
|
|
|
inputContractInfos(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.contractInfos": e.detail.value,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 进入场地时间 */
|
|
|
|
|
onInputTime0(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.useDates": e.detail,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
2024-11-02 11:07:07 +08:00
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/** 计划开工时间 */
|
|
|
|
|
onInputTime1(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.startWorkDates": e.detail,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 计划完工时间 */
|
|
|
|
|
onInputTime2(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.endWorkDates": e.detail,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 委托人身份证反面
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUpload3(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.leaderCardImgPos": file,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
2025-02-05 23:44:09 +08:00
|
|
|
|
file.forEach(async (item, idx) => {
|
|
|
|
|
let obj = await this.syncUploadImage(item);
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findCardOcrFront(obj.data.data.url).then((res) => {
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (res.code == 200) {
|
2025-02-05 23:44:09 +08:00
|
|
|
|
this.setData({
|
|
|
|
|
"form.subDeptLeaderName": res.data.name,
|
2025-02-21 00:44:42 +08:00
|
|
|
|
"form.subDeptLeaderCode": res.data.cardId,
|
|
|
|
|
"form.nation": res.data.nation,
|
|
|
|
|
"form.nativePlace": res.data.native,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.address": res.data.address,
|
|
|
|
|
});
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (!res.data.name || !res.data.cardId) {
|
2025-02-05 23:44:09 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.leaderCardImgPos": [],
|
2025-02-05 23:44:09 +08:00
|
|
|
|
});
|
|
|
|
|
app.toast("身份证正面照识别失败!请重新上传");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 委托人身份证反面
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUpload4(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.leaderCardImgInv": file,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 委托人半身照
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUpload5(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.leaderUserPicture": file,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 委托人委托书
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUpload6(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptLeaderPowerPath": file,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 输入负责人姓名
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
inputLeaderName(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptLeaderName": e.detail.value,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 输入负责人身份证号
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
inputLeaderCode(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptLeaderCode": e.detail.value,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 输入负责人联系电话
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
subDeptLeaderPhone(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptLeaderPhone": e.detail.value,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
2024-12-20 20:24:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 负责人学历
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
onLeaderDegreeGrade(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.leaderDegreeGrade": e.detail.id,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
2025-01-19 00:59:43 +08:00
|
|
|
|
/**
|
|
|
|
|
* 选中岗位级别
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2025-01-19 00:59:43 +08:00
|
|
|
|
*/
|
|
|
|
|
onChageUserPost(e) {
|
|
|
|
|
this.setData({
|
2025-02-22 19:04:51 +08:00
|
|
|
|
userPost: e.detail.id,
|
2025-02-09 23:21:26 +08:00
|
|
|
|
"form.userPost": e.detail.id,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.craftPost": null,
|
|
|
|
|
});
|
|
|
|
|
if (e.detail.id == "3") {
|
2025-02-09 23:21:26 +08:00
|
|
|
|
let craftPostList = [];
|
2025-09-13 15:08:32 +08:00
|
|
|
|
this.data.craftPostAllOrginList.forEach((item) => {
|
|
|
|
|
if (item.cssClass == "1") {
|
2025-02-09 23:21:26 +08:00
|
|
|
|
craftPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: item.dictValue,
|
|
|
|
|
text: item.dictLabel,
|
2025-02-09 23:21:26 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2025-02-09 23:21:26 +08:00
|
|
|
|
this.setData({
|
|
|
|
|
craftPostList,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.craftType": "1",
|
|
|
|
|
"form.craftPost": null,
|
|
|
|
|
});
|
|
|
|
|
} else if (e.detail.id == "5") {
|
2025-02-09 23:21:26 +08:00
|
|
|
|
let craftPostList = [];
|
2025-09-13 15:08:32 +08:00
|
|
|
|
this.data.craftPostAllOrginList.forEach((item) => {
|
|
|
|
|
if (item.cssClass == "2") {
|
2025-02-09 23:21:26 +08:00
|
|
|
|
craftPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: item.dictValue,
|
|
|
|
|
text: item.dictLabel,
|
2025-02-09 23:21:26 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2025-02-09 23:21:26 +08:00
|
|
|
|
this.setData({
|
|
|
|
|
craftPostList,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.craftType": "2",
|
|
|
|
|
"form.craftPost": null,
|
|
|
|
|
});
|
2025-02-09 23:21:26 +08:00
|
|
|
|
}
|
2025-01-19 00:59:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
2024-12-20 20:24:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 选中工种类型
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
onChageCraftType(e) {
|
|
|
|
|
//设置工种岗位
|
|
|
|
|
let craftPostList = [];
|
2025-09-13 15:08:32 +08:00
|
|
|
|
this.data.craftPostAllOrginList.forEach((item) => {
|
2025-01-19 00:59:43 +08:00
|
|
|
|
if (item.cssClass == e.detail.id) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
craftPostList.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
id: item.dictValue,
|
|
|
|
|
text: item.dictLabel,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
this.setData({
|
|
|
|
|
craftPostList,
|
|
|
|
|
"form.craftType": e.detail.id,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.craftPost": null,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 选中工种岗位
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
onChageCraftPost(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.craftPost": e.detail.id,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 个人身份证正面照
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUploadCardImgPos(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.cardImgPos": file,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
2025-02-05 23:44:09 +08:00
|
|
|
|
file.forEach(async (item, idx) => {
|
|
|
|
|
let obj = await this.syncUploadImage(item);
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findCardOcrFront(obj.data.data.url).then((res) => {
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
if (res.data.nation.indexOf("族") < 0) {
|
|
|
|
|
res.data.nation = res.data.nation + "族";
|
2025-02-15 14:58:19 +08:00
|
|
|
|
}
|
2025-02-05 23:44:09 +08:00
|
|
|
|
this.setData({
|
|
|
|
|
"form.userName": res.data.name,
|
|
|
|
|
"form.cardCode": res.data.cardId,
|
2025-02-15 14:58:19 +08:00
|
|
|
|
"form.nation": res.data.nation,
|
|
|
|
|
"form.nativePlace": res.data.native,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.address": res.data.address,
|
|
|
|
|
});
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (!res.data.name || !res.data.cardId) {
|
2025-02-05 23:44:09 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.cardImgPos": [],
|
2025-02-05 23:44:09 +08:00
|
|
|
|
});
|
|
|
|
|
app.toast("身份证正面照识别失败!请重新上传");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 个人身份证反面照
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUploadCardImgInv(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.cardImgInv": file,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 个人半身近照
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUploadUserPicture(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.userPicture": file,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 单位委托书
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUploadDeptPower(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptPowerPath": file,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 输入个人姓名
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
inputUserName(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.userName": e.detail.value,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 输入个人身份证号
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
inputUserCode(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.cardCode": e.detail.value,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
2025-02-15 14:20:43 +08:00
|
|
|
|
* 个人籍贯
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
inputOriginNative(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.nativePlace": e.detail.value,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
2025-02-15 14:20:43 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 个人民族
|
|
|
|
|
* @param {*} e
|
|
|
|
|
*/
|
2025-02-22 19:04:51 +08:00
|
|
|
|
inputOriginNation(e) {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.nation": e.detail.value,
|
|
|
|
|
});
|
2025-02-15 14:20:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
2024-12-20 20:24:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 个人籍贯地址
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
inputOriginAddress(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.address": e.detail.value,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 紧急联系人
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
inputUrgentUser(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.emergencyContact": e.detail.value,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 紧急联系人电话
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
inputUrgentUserPhone(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.contactPhone": e.detail.value,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 个人文化程度
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
onDegreeGrade(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.degreeGrade": e.detail.id,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开户行名称
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
inputBankName(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.bankName": e.detail.value,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开户行网点
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
inputBankOffice(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.bankOffice": e.detail.value,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开户行卡号
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-20 20:24:08 +08:00
|
|
|
|
*/
|
|
|
|
|
inputBankCardNo(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.bankCardNo": e.detail.value,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 委托代理提交参建单位信息
|
|
|
|
|
*/
|
|
|
|
|
submitSubDeptValues() {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let { form } = this.data;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let subDeptInfos = form.subDeptInfos;
|
|
|
|
|
if (!subDeptInfos) {
|
|
|
|
|
subDeptInfos = {};
|
|
|
|
|
}
|
|
|
|
|
//数据效验
|
|
|
|
|
if (!form.subDeptType) {
|
|
|
|
|
app.toast("请选择单位类型!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.subDeptName) {
|
|
|
|
|
app.toast("请填写单位名称!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.subDeptCode) {
|
|
|
|
|
app.toast("请填写单位社会信用代码!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.businessLicensePath || form.businessLicensePath.length == 0) {
|
|
|
|
|
app.toast("请上传营业执照副本!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (
|
|
|
|
|
!subDeptInfos.legalPersonCardImgPos ||
|
|
|
|
|
subDeptInfos.legalPersonCardImgPos.length == 0
|
|
|
|
|
) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
app.toast("请上传法人身份证正面照!");
|
|
|
|
|
return false;
|
2024-11-02 11:07:07 +08:00
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (
|
|
|
|
|
!subDeptInfos.legalPersonCardImgInv ||
|
|
|
|
|
subDeptInfos.legalPersonCardImgInv.length == 0
|
|
|
|
|
) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
app.toast("请上传法人身份证反面照!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!subDeptInfos.legalPerson) {
|
|
|
|
|
app.toast("请填写法人姓名!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!subDeptInfos.legalPersonCard) {
|
|
|
|
|
app.toast("请填写法人身份证号!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.contractInfos) {
|
|
|
|
|
app.toast("请填写合同约定的承包范围!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
// 验证计划完工时间不能早于计划开工时间
|
2025-03-20 00:53:06 +08:00
|
|
|
|
if (!form.useDates) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请选择进入场地时间!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-17 20:25:21 +08:00
|
|
|
|
if (!form.startWorkDates) {
|
|
|
|
|
app.toast("请选择计划开工时间!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.endWorkDates) {
|
|
|
|
|
app.toast("请选择计划完工时间!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
const enterDate = new Date(form.useDates);
|
|
|
|
|
const startDate = new Date(form.startWorkDates);
|
|
|
|
|
const endDate = new Date(form.endWorkDates);
|
|
|
|
|
if (enterDate < startDate) {
|
|
|
|
|
app.toast("入场地时间不能早于计划开工时间!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (enterDate > endDate) {
|
|
|
|
|
app.toast("入场地时间不能晚于计划完工时间!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (endDate < startDate) {
|
|
|
|
|
app.toast("计划完工时间不能早于计划开工时间!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-17 20:25:21 +08:00
|
|
|
|
if (!form.leaderCardImgPos || form.leaderCardImgPos.length == 0) {
|
|
|
|
|
app.toast("请上传委托人身份证正面照!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.leaderCardImgInv || form.leaderCardImgInv.length == 0) {
|
|
|
|
|
app.toast("请上传委托人身份证反面照!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.leaderUserPicture || form.leaderUserPicture.length == 0) {
|
|
|
|
|
app.toast("请上传委托人半身近照!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (
|
|
|
|
|
!form.subDeptLeaderPowerPath ||
|
|
|
|
|
form.subDeptLeaderPowerPath.length == 0
|
|
|
|
|
) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
app.toast("请上传委托人单位委托书!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.subDeptLeaderName) {
|
|
|
|
|
app.toast("请填写委托人姓名!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.subDeptLeaderCode) {
|
|
|
|
|
app.toast("请填写委托人身份证号!");
|
|
|
|
|
return false;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
} else {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
const cardCodePattern =
|
|
|
|
|
/^[1-9]\d{5}(18|19|20|21|22)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|[Xx])$/;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (!cardCodePattern.test(form.subDeptLeaderCode)) {
|
2025-01-22 00:20:58 +08:00
|
|
|
|
app.toast("身份证号码不正确!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
if (!form.subDeptLeaderPhone) {
|
|
|
|
|
app.toast("请填写委托人联系电话!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-02-21 00:44:42 +08:00
|
|
|
|
if (!form.nativePlace) {
|
|
|
|
|
app.toast("请填写籍贯!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.nation) {
|
|
|
|
|
app.toast("请填写民族!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.address) {
|
|
|
|
|
app.toast("请填写地址!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.emergencyContact) {
|
|
|
|
|
app.toast("请填写紧急联系人!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.contactPhone) {
|
|
|
|
|
app.toast("请填写紧急联系人电话!");
|
|
|
|
|
return false;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
} else {
|
2025-02-21 00:44:42 +08:00
|
|
|
|
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (!phonePattern.test(form.contactPhone)) {
|
2025-02-21 00:44:42 +08:00
|
|
|
|
app.toast("紧急联系人电话不正确!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (!form.leaderDegreeGrade) {
|
|
|
|
|
app.toast("请选择委托人学历信息!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let that = this;
|
|
|
|
|
//弹出确认
|
|
|
|
|
wx.showModal({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
title: "提示",
|
|
|
|
|
content: "是否确认保存参建单位信息登记?",
|
2024-12-17 20:25:21 +08:00
|
|
|
|
success: function (sm) {
|
|
|
|
|
if (sm.confirm) {
|
|
|
|
|
that.submitSubDeptForm();
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 委托代理提交参建单位表单
|
|
|
|
|
*/
|
|
|
|
|
submitSubDeptForm() {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
let _form = {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
...this.data.form,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
};
|
|
|
|
|
let subDeptInfos = {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
..._form.subDeptInfos,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
};
|
2025-03-08 02:00:56 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
loadShow: true,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let uploadFiles = [];
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (_form.businessLicensePath && _form.businessLicensePath.length > 0) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "businessLicensePath",
|
|
|
|
|
path: _form.businessLicensePath[0],
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (
|
|
|
|
|
subDeptInfos.legalPersonCardImgPos &&
|
|
|
|
|
subDeptInfos.legalPersonCardImgPos.length > 0
|
|
|
|
|
) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "legalPersonCardImgPos",
|
|
|
|
|
path: subDeptInfos.legalPersonCardImgPos[0],
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (
|
|
|
|
|
subDeptInfos.legalPersonCardImgInv &&
|
|
|
|
|
subDeptInfos.legalPersonCardImgInv.length > 0
|
|
|
|
|
) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "legalPersonCardImgInv",
|
|
|
|
|
path: subDeptInfos.legalPersonCardImgInv[0],
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (_form.leaderCardImgPos && _form.leaderCardImgPos.length > 0) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "leaderCardImgPos",
|
|
|
|
|
path: _form.leaderCardImgPos[0],
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (_form.leaderCardImgInv && _form.leaderCardImgInv.length > 0) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "leaderCardImgInv",
|
|
|
|
|
path: _form.leaderCardImgInv[0],
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (_form.leaderUserPicture && _form.leaderUserPicture.length > 0) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "leaderUserPicture",
|
|
|
|
|
path: _form.leaderUserPicture[0],
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (
|
|
|
|
|
_form.subDeptLeaderPowerPath &&
|
|
|
|
|
_form.subDeptLeaderPowerPath.length > 0
|
|
|
|
|
) {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "subDeptLeaderPowerPath",
|
|
|
|
|
path: _form.subDeptLeaderPowerPath[0],
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2024-12-20 20:24:08 +08:00
|
|
|
|
let that = this;
|
|
|
|
|
let uploads = [];
|
|
|
|
|
uploadFiles.forEach(async (item) => {
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let obj;
|
|
|
|
|
if (item.path.indexOf(this.data.imgBase) > -1) {
|
|
|
|
|
obj = {
|
|
|
|
|
data: {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
data: {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
url: item.path.replace(this.data.imgBase, ""),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
2024-12-17 20:25:21 +08:00
|
|
|
|
} else {
|
|
|
|
|
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
|
2024-12-20 20:24:08 +08:00
|
|
|
|
obj = await that.syncUploadImage(item.path);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "businessLicensePath") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
_form.businessLicensePath = obj.data.data.url;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "legalPersonCardImgPos") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
subDeptInfos.legalPersonCardImgPos = obj.data.data.url;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "legalPersonCardImgInv") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
subDeptInfos.legalPersonCardImgInv = obj.data.data.url;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "leaderCardImgPos") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
_form.leaderCardImgPos = obj.data.data.url;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "leaderCardImgInv") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
_form.leaderCardImgInv = obj.data.data.url;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "leaderUserPicture") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
_form.leaderUserPicture = obj.data.data.url;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "subDeptLeaderPowerPath") {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
_form.subDeptLeaderPowerPath = obj.data.data.url;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
2024-12-20 20:24:08 +08:00
|
|
|
|
uploads.push(obj.data.data.url);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
//验证图片上传完毕
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (uploads.length == uploadFiles.length) {
|
|
|
|
|
_form.subDeptInfos = JSON.stringify(subDeptInfos);
|
2025-01-05 23:27:05 +08:00
|
|
|
|
let leaderUserInfos = {};
|
2025-02-21 00:44:42 +08:00
|
|
|
|
leaderUserInfos.nation = _form.nation;
|
|
|
|
|
leaderUserInfos.nativePlace = _form.nativePlace;
|
|
|
|
|
leaderUserInfos.address = _form.address;
|
|
|
|
|
leaderUserInfos.emergencyContact = _form.emergencyContact;
|
|
|
|
|
leaderUserInfos.contactPhone = _form.contactPhone;
|
2025-01-05 23:27:05 +08:00
|
|
|
|
leaderUserInfos.cardImgPos = _form.leaderCardImgPos;
|
|
|
|
|
leaderUserInfos.cardImgInv = _form.leaderCardImgInv;
|
|
|
|
|
_form.leaderUserInfos = JSON.stringify(leaderUserInfos);
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (
|
|
|
|
|
_form.proProjectInfoSubdeptsUsers &&
|
|
|
|
|
_form.proProjectInfoSubdeptsUsers.userInfos
|
|
|
|
|
) {
|
|
|
|
|
_form.proProjectInfoSubdeptsUsers.userInfos = JSON.stringify(
|
|
|
|
|
_form.proProjectInfoSubdeptsUsers.userInfos
|
|
|
|
|
);
|
2025-01-05 23:27:05 +08:00
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
registerSubDepts(_form).then((res) => {
|
2025-03-08 02:00:56 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
loadShow: false,
|
2025-02-22 19:04:51 +08:00
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
if (res.code == 200) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
this.setData({
|
|
|
|
|
"form.id": res.data.id,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subStep": res.data.subStep,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
//跳转视频页面...
|
2024-12-20 20:24:08 +08:00
|
|
|
|
that.initBusEduVideos(true);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 单位人员信息验证
|
|
|
|
|
*/
|
|
|
|
|
submitSubUserValues() {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let { form, userPost } = this.data;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
//数据效验
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (userPost == "3" || userPost == "5") {
|
2025-02-09 23:21:26 +08:00
|
|
|
|
// if (!form.craftType) {
|
|
|
|
|
// app.toast("请选择工种类型!");
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
2024-12-17 20:25:21 +08:00
|
|
|
|
if (!form.craftPost) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请选择工种岗位!");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (!form.cardImgPos || form.cardImgPos.length == 0) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请上传身份证正面照!");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (!form.cardImgInv || form.cardImgInv.length == 0) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请上传身份证反面照!");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (!form.userPicture || form.userPicture.length == 0) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请上传进场半身近照!");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
if (userPost == "2" || userPost == "6") {
|
2025-02-05 21:34:18 +08:00
|
|
|
|
if (!form.subDeptPowerPath || form.subDeptPowerPath.length == 0) {
|
|
|
|
|
app.toast("请上传委托人单位委托书!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (!form.userName) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请填写姓名!");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (!form.cardCode) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请填写身份证号!");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
return false;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
} else {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
const cardCodePattern =
|
|
|
|
|
/^[1-9]\d{5}(18|19|20|21|22)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|[Xx])$/;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (!cardCodePattern.test(form.cardCode)) {
|
2025-01-22 00:20:58 +08:00
|
|
|
|
app.toast("身份证号码不正确!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
2025-01-19 00:59:43 +08:00
|
|
|
|
if (!form.userPhone) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请填写联系电话!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (!form.nativePlace) {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
app.toast("请填写籍贯!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!form.nation) {
|
|
|
|
|
app.toast("请填写民族!");
|
2024-12-17 20:25:21 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (!form.address) {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
app.toast("请填写地址!");
|
2024-12-20 20:24:08 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (!form.emergencyContact) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请填写紧急联系人!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (!form.contactPhone) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
app.toast("请填写紧急联系人电话!");
|
|
|
|
|
return false;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
} else {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (!phonePattern.test(form.contactPhone)) {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
app.toast("紧急联系人电话不正确!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-20 20:24:08 +08:00
|
|
|
|
}
|
|
|
|
|
if (!form.degreeGrade) {
|
|
|
|
|
app.toast("请选择文化程度!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let that = this;
|
2025-08-20 09:47:48 +08:00
|
|
|
|
//弹出确认
|
|
|
|
|
wx.showModal({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
title: "提示",
|
|
|
|
|
content: "是否确认保存参建人员信息登记?",
|
2025-08-20 09:47:48 +08:00
|
|
|
|
success: function (sm) {
|
|
|
|
|
if (sm.confirm) {
|
|
|
|
|
that.submitSubUserForm();
|
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
2024-12-20 20:24:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 单位人员信息登记
|
|
|
|
|
*/
|
|
|
|
|
submitSubUserForm() {
|
|
|
|
|
let _form = {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
...this.data.form,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
};
|
2025-03-08 02:00:56 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
loadShow: true,
|
2025-03-08 02:00:56 +08:00
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
let uploadFiles = [];
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (_form.cardImgPos && _form.cardImgPos.length > 0) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "cardImgPos",
|
|
|
|
|
path: _form.cardImgPos[0],
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (_form.cardImgInv && _form.cardImgInv.length > 0) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "cardImgInv",
|
|
|
|
|
path: _form.cardImgInv[0],
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2025-01-05 23:27:05 +08:00
|
|
|
|
if (_form.userPicture && _form.userPicture.length > 0) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "userPicture",
|
|
|
|
|
path: _form.userPicture[0],
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (_form.subDeptPowerPath && _form.subDeptPowerPath.length > 0) {
|
|
|
|
|
uploadFiles.push({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
type: "subDeptPowerPath",
|
|
|
|
|
path: _form.subDeptPowerPath[0],
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
let that = this;
|
|
|
|
|
let uploads = [];
|
|
|
|
|
uploadFiles.forEach(async (item, idx) => {
|
|
|
|
|
let obj;
|
|
|
|
|
if (item.path.indexOf(this.data.imgBase) > -1) {
|
|
|
|
|
obj = {
|
|
|
|
|
data: {
|
|
|
|
|
data: {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
url: item.path.replace(this.data.imgBase, ""),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
2024-12-20 20:24:08 +08:00
|
|
|
|
} else {
|
|
|
|
|
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
|
|
|
|
|
obj = await that.syncUploadImage(item.path);
|
|
|
|
|
}
|
|
|
|
|
if (item.type == "cardImgPos") {
|
2025-01-05 23:27:05 +08:00
|
|
|
|
_form.cardImgPos = obj.data.data.url;
|
2024-12-20 20:24:08 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "cardImgInv") {
|
2025-01-05 23:27:05 +08:00
|
|
|
|
_form.cardImgInv = obj.data.data.url;
|
2024-12-20 20:24:08 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "userPicture") {
|
2025-01-05 23:27:05 +08:00
|
|
|
|
_form.userPicture = obj.data.data.url;
|
2024-12-20 20:24:08 +08:00
|
|
|
|
}
|
|
|
|
|
if (item.type == "subDeptPowerPath") {
|
|
|
|
|
_form.subDeptPowerPath = obj.data.data.url;
|
|
|
|
|
}
|
|
|
|
|
uploads.push(obj.data.data.url);
|
|
|
|
|
//验证图片上传完毕
|
|
|
|
|
if (uploads.length == uploadFiles.length) {
|
|
|
|
|
let userInfos = {};
|
2025-02-15 14:20:43 +08:00
|
|
|
|
userInfos.nation = _form.nation;
|
2025-01-05 23:27:05 +08:00
|
|
|
|
userInfos.nativePlace = _form.nativePlace;
|
|
|
|
|
userInfos.address = _form.address;
|
|
|
|
|
userInfos.emergencyContact = _form.emergencyContact;
|
|
|
|
|
userInfos.contactPhone = _form.contactPhone;
|
|
|
|
|
userInfos.bankName = _form.bankName;
|
|
|
|
|
userInfos.bankOffice = _form.bankOffice;
|
|
|
|
|
userInfos.bankCardNo = _form.bankCardNo;
|
2025-02-05 21:34:18 +08:00
|
|
|
|
userInfos.cardImgPos = _form.cardImgPos;
|
|
|
|
|
userInfos.cardImgInv = _form.cardImgInv;
|
2025-01-05 23:27:05 +08:00
|
|
|
|
_form.userInfos = JSON.stringify(userInfos);
|
2025-09-13 15:08:32 +08:00
|
|
|
|
registerSubDeptsUsers(_form).then((res) => {
|
2025-03-08 02:00:56 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
loadShow: false,
|
2025-02-22 19:04:51 +08:00
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.setData({
|
|
|
|
|
"form.id": res.data.id,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subStep": res.data.subStep,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
|
|
|
|
//跳转视频页面...
|
|
|
|
|
this.initBusEduVideos(true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 委托人半身照
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUpload7(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.leaderUserPicture": file,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 委托人委托书
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} options
|
2024-12-17 20:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
fileUpload8(options) {
|
|
|
|
|
let file = options.detail;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"form.subDeptLeaderPowerPath": file,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//显示选择
|
|
|
|
|
onShowPopup(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
showDetailsPopup: true,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//关闭选择
|
|
|
|
|
onClosePopup(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
showDetailsPopup: false,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 栏目触发事件
|
|
|
|
|
*/
|
|
|
|
|
onClickNav(e) {
|
|
|
|
|
this.setData({
|
|
|
|
|
chidActiveIndex: null,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
mainActiveIndex: e.detail.index,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 选项触发事件
|
|
|
|
|
*/
|
|
|
|
|
onClickItem(e) {
|
|
|
|
|
this.setData({
|
|
|
|
|
chidActiveIndex: e.detail.id,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
showDetailsName: e.detail.detailName,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
2024-12-18 22:34:51 +08:00
|
|
|
|
/**
|
|
|
|
|
* 选中健康问题1
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-18 22:34:51 +08:00
|
|
|
|
*/
|
|
|
|
|
onChangeFileRadio1(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
illnessStatus: e.detail.id,
|
|
|
|
|
});
|
2024-12-18 22:34:51 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 选中健康问题2
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2024-12-18 22:34:51 +08:00
|
|
|
|
*/
|
|
|
|
|
onChangeFileRadio2(e) {
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
supIllnessStatus: e.detail.id,
|
|
|
|
|
});
|
2024-12-18 22:34:51 +08:00
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 返回上一步
|
|
|
|
|
*/
|
|
|
|
|
onClickPreviousNode() {
|
|
|
|
|
if (this.data.active == 2) {
|
2024-12-20 20:24:08 +08:00
|
|
|
|
this.initBusEduVideos(false);
|
2024-12-17 20:25:21 +08:00
|
|
|
|
}
|
2024-12-20 20:24:08 +08:00
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
active: this.data.active - 1,
|
|
|
|
|
});
|
2024-12-17 20:25:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
|
*/
|
2025-09-13 15:08:32 +08:00
|
|
|
|
onReady() {},
|
2024-12-17 20:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
|
*/
|
2025-09-13 15:08:32 +08:00
|
|
|
|
onShow() {},
|
2024-12-17 20:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
|
*/
|
2025-09-13 15:08:32 +08:00
|
|
|
|
onHide() {},
|
2024-12-17 20:25:21 +08:00
|
|
|
|
|
|
|
|
|
// 启动倒计时
|
|
|
|
|
startCountdown() {
|
|
|
|
|
let that = this;
|
|
|
|
|
this.setData({
|
|
|
|
|
timer: setInterval(() => {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let { time } = this.data;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
let minutes = Math.floor(time / 60);
|
|
|
|
|
let seconds = time % 60;
|
|
|
|
|
if (minutes < 10) minutes = "0" + minutes;
|
|
|
|
|
if (seconds < 10) seconds = "0" + seconds;
|
|
|
|
|
if (time > 0) {
|
|
|
|
|
time--;
|
|
|
|
|
this.setData({
|
|
|
|
|
time,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
timeStr: minutes + " 分钟 " + seconds + " 秒",
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
clearInterval(this.data.timer); // 倒计时结束,清除定时器
|
|
|
|
|
//考试结束...
|
|
|
|
|
that.submitThePapers("skip");
|
|
|
|
|
}
|
|
|
|
|
}, 1000),
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 启动签署时
|
|
|
|
|
startSignCountdown() {
|
|
|
|
|
this.setData({
|
|
|
|
|
signTimer: setInterval(() => {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
let { signTime } = this.data;
|
2024-12-17 20:25:21 +08:00
|
|
|
|
if (signTime > 0) {
|
|
|
|
|
signTime--;
|
|
|
|
|
this.setData({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
signTime,
|
2024-12-17 20:25:21 +08:00
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
clearInterval(this.data.signTimer); // 倒计时结束,清除定时器
|
|
|
|
|
}
|
|
|
|
|
}, 1000),
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-20 20:24:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 这里考虑上传图片异步问题,封装为同步
|
|
|
|
|
*/
|
|
|
|
|
syncUploadImage(file) {
|
2025-01-04 18:20:48 +08:00
|
|
|
|
let _baseUrl = config.baseUrl;
|
2024-12-20 20:24:08 +08:00
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
wx.uploadFile({
|
2025-01-04 18:20:48 +08:00
|
|
|
|
url: _baseUrl + "/file/NoSecurity/upload", // 上传的服务器接口地址
|
2024-12-20 20:24:08 +08:00
|
|
|
|
filePath: file,
|
|
|
|
|
header: {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
name: "file", //上传的所需字段,后端提供
|
|
|
|
|
formData: {},
|
|
|
|
|
success: (res) => {
|
|
|
|
|
// 上传完成操作
|
2025-09-13 15:08:32 +08:00
|
|
|
|
const data = JSON.parse(res.data);
|
2024-12-20 20:24:08 +08:00
|
|
|
|
resolve({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
data: data,
|
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
//上传失败:修改pedding为reject
|
|
|
|
|
console.log("访问接口失败", err);
|
|
|
|
|
wx.showToast({
|
|
|
|
|
title: "网络出错,上传失败",
|
2025-09-13 15:08:32 +08:00
|
|
|
|
icon: "none",
|
|
|
|
|
duration: 1000,
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
reject(err);
|
|
|
|
|
},
|
2024-12-20 20:24:08 +08:00
|
|
|
|
});
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2024-12-20 20:24:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
2025-02-15 14:20:43 +08:00
|
|
|
|
/**
|
|
|
|
|
* 立即登录
|
|
|
|
|
*/
|
2025-02-22 19:04:51 +08:00
|
|
|
|
wxSignLogin() {
|
|
|
|
|
wxNumberLogin({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
username: this.data.userPhoneNumber,
|
|
|
|
|
}).then((res) => {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
setToken(res.data.access_token);
|
|
|
|
|
this.getUserInfoByCache();
|
2025-09-13 15:08:32 +08:00
|
|
|
|
});
|
2025-02-15 14:20:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
2025-03-14 00:14:41 +08:00
|
|
|
|
/**
|
|
|
|
|
* 重新登记
|
|
|
|
|
*/
|
|
|
|
|
wxSignBack() {
|
2025-08-01 18:25:02 +08:00
|
|
|
|
let _form = {
|
2025-03-20 00:53:06 +08:00
|
|
|
|
subDeptType: null,
|
|
|
|
|
craftType: null,
|
|
|
|
|
craftPost: null,
|
|
|
|
|
leaderDegreeGrade: null,
|
|
|
|
|
userInfos: {},
|
2025-04-13 22:39:54 +08:00
|
|
|
|
degreeGrade: null,
|
|
|
|
|
userPhone: this.data.userPhoneNumber,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
subDeptLeaderPhone: this.data.userPhoneNumber,
|
2025-03-20 00:53:06 +08:00
|
|
|
|
};
|
2025-04-13 22:39:54 +08:00
|
|
|
|
let _subDeptNameTemp = this.data.form.subDeptName;
|
2025-03-14 00:14:41 +08:00
|
|
|
|
this.setData({
|
2025-08-01 18:25:02 +08:00
|
|
|
|
form: _form,
|
2025-03-14 00:14:41 +08:00
|
|
|
|
active: 0,
|
2025-09-13 15:08:32 +08:00
|
|
|
|
"parForm.subDeptName": _subDeptNameTemp,
|
2025-03-14 00:14:41 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2025-02-15 14:20:43 +08:00
|
|
|
|
/**
|
|
|
|
|
* 查询
|
|
|
|
|
* 用户详细信息
|
2025-09-13 15:08:32 +08:00
|
|
|
|
* @param {*} e
|
2025-02-15 14:20:43 +08:00
|
|
|
|
*/
|
|
|
|
|
getUserInfoByCache: function () {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findUserInfoByCache().then((res) => {
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (res.code == 200) {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
res.user.isTechnician =
|
|
|
|
|
(res.user.roles || []).find(
|
|
|
|
|
(role) => role.roleKey.indexOf("zbjsy_") >= 0
|
|
|
|
|
) != null;
|
2025-02-15 14:20:43 +08:00
|
|
|
|
setUserInfo(res.user);
|
|
|
|
|
app.globalData.userData = res.user;
|
|
|
|
|
this.getMyProjectList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询
|
|
|
|
|
* 用户项目信息
|
|
|
|
|
* 根据项目配置进入不同页面...
|
|
|
|
|
*/
|
|
|
|
|
getMyProjectList: function () {
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findMyProjectList().then((res) => {
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (res.code == 200) {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
app.globalData.projectInfoList = res.rows;
|
2025-02-22 19:04:51 +08:00
|
|
|
|
if (res.rows.length > 0) {
|
|
|
|
|
if (res.rows.length == 1) {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
app.globalData.useProjectId = res.rows[0].id;
|
|
|
|
|
app.globalData.useProjectName = res.rows[0].projectName;
|
2025-09-13 15:08:32 +08:00
|
|
|
|
findProSubDeptsUserInfo(app.globalData.useProjectId).then(
|
|
|
|
|
(detail) => {
|
|
|
|
|
if (detail.code == 200) {
|
|
|
|
|
let userInfo = getUserInfo();
|
|
|
|
|
userInfo.projectUserInfo = detail.data;
|
|
|
|
|
setUserInfo(userInfo);
|
|
|
|
|
//单项目直接进入项目页面
|
|
|
|
|
wx.redirectTo({
|
|
|
|
|
url: "../../pageage/project_info/index",
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-02-16 17:19:52 +08:00
|
|
|
|
}
|
2025-09-13 15:08:32 +08:00
|
|
|
|
);
|
2025-02-22 19:04:51 +08:00
|
|
|
|
} else {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
//多项目进入项目切换页面
|
|
|
|
|
wx.redirectTo({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
url: "../../pageage/project_list/index",
|
|
|
|
|
});
|
2025-02-15 14:20:43 +08:00
|
|
|
|
}
|
2025-02-22 19:04:51 +08:00
|
|
|
|
} else {
|
2025-02-15 14:20:43 +08:00
|
|
|
|
app.toast("未查询到当前用户项目,信息审核中或人员已离场");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 20:25:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
|
*/
|
|
|
|
|
onUnload() {
|
|
|
|
|
clearInterval(this.data.timer);
|
|
|
|
|
clearInterval(this.data.signTimer);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
|
*/
|
2025-09-13 15:08:32 +08:00
|
|
|
|
onPullDownRefresh() {},
|
2024-12-17 20:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
|
*/
|
2025-09-13 15:08:32 +08:00
|
|
|
|
onReachBottom() {},
|
2024-12-17 20:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 用户点击右上角分享
|
|
|
|
|
*/
|
2025-09-13 15:08:32 +08:00
|
|
|
|
onShareAppMessage() {},
|
2024-12-17 20:25:21 +08:00
|
|
|
|
|
|
|
|
|
handleOpenPrivacyContract() {
|
|
|
|
|
// 打开隐私协议页面
|
|
|
|
|
wx.openPrivacyContract({
|
2025-09-13 15:08:32 +08:00
|
|
|
|
success: () => {}, // 打开成功
|
|
|
|
|
fail: () => {}, // 打开失败
|
|
|
|
|
complete: () => {},
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
});
|