举牌验收功能开发

dev_xd
lj7788@126.com 2025-08-04 17:50:25 +08:00
parent 4e127bf4cf
commit 10685555ec
18 changed files with 1145 additions and 753 deletions

View File

@ -55,8 +55,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workingPositionType != null and workingPositionType != ''"> and ppc.working_position_type = #{workingPositionType}</if>
<if test="checkResult != null and checkResult != ''">
<choose>
<when test="checkResult == '99'"> and approve_status=100 and check_result=1</when>
<when test="checkResult == '100'"> and not (approve_status=100 and check_result=1)</when>
<when test="checkResult == '99'"> and approve_status in (4,100) and check_result=1</when>
<when test="checkResult == '100'"> and not (approve_status in (4,100) and check_result=1)</when>
<otherwise> and ppc.check_result = #{checkResult}</otherwise>
</choose>
</if>
@ -67,8 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null "> and ppc.is_del = #{isDel}</if>
<if test="approveStatus != null and approveStatus != ''"> and ppc.approve_status = #{approveStatus}</if>
<if test="activeTags != null">
<if test='activeTags == "jxz"'> and not (ppc.approve_status = '100' and ppc.check_result = '1')</if>
<if test='activeTags == "jwc"'> and ppc.approve_status = '100' and ppc.check_result = '1'</if>
<if test='activeTags == "jxz"'> and not (ppc.approve_status in (4,100) and ppc.check_result = '1')</if>
<if test='activeTags == "ywc"'> and ppc.approve_status in (4,100) and ppc.check_result = '1'</if>
</if>
<if test="remark!=null and remark=='lastWeek'">
and ppc.checking_date BETWEEN

View File

@ -1,360 +1,397 @@
import {
request
request
} from '../utils/request'
// 查询项目信息详细
export function findProjectInfo(id) {
return request({
url: '/manage/wxApi/findProject/' + id,
method: 'get'
})
return request({
url: '/manage/wxApi/findProject/' + id,
method: 'get'
})
}
// 新增项目参建单位信息
export function registerSubDepts(data) {
return request({
url: '/manage/wxApi/registerSubDepts',
method: 'post',
data: data
})
return request({
url: '/manage/wxApi/registerSubDepts',
method: 'post',
data: data
})
}
// 查询项目参建单位信息
export function findProSubDeptsInfo(proId, phoneNumber) {
return request({
url: '/manage/wxApi/findProSubDeptsInfo?proId=' + proId + '&phoneNumber=' + phoneNumber,
method: 'get'
})
return request({
url: '/manage/wxApi/findProSubDeptsInfo?proId=' + proId + '&phoneNumber=' + phoneNumber,
method: 'get'
})
}
// 查询项目参建单位信息
export function findProSubDeptsInfoById(id) {
return request({
url: '/manage/proProjectInfoSubdepts/' + id,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdepts/' + id,
method: 'get'
})
}
// 查询项目参建人员信息
export function findProSubDeptsUser(proId, phoneNumber) {
return request({
url: '/manage/wxApi/findProSubDeptsUser?proId=' + proId + '&phoneNumber=' + phoneNumber,
method: 'get'
})
return request({
url: '/manage/wxApi/findProSubDeptsUser?proId=' + proId + '&phoneNumber=' + phoneNumber,
method: 'get'
})
}
// 查询项目参建单位人员
export function findProSubDeptsUserInfo(proId) {
return request({
url: '/manage/wxApi/findProSubDeptsUserInfo/' + proId,
method: 'get'
})
return request({
url: '/manage/wxApi/findProSubDeptsUserInfo/' + proId,
method: 'get'
})
}
// 查询项目参建单位人员
export function findProSubDeptsUserById(id) {
return request({
url: '/manage/wxApi/findProSubDeptsUser/' + id,
method: 'get'
})
return request({
url: '/manage/wxApi/findProSubDeptsUser/' + id,
method: 'get'
})
}
// 查询项目参建单位人员
export function findProSubDeptsUserInfoById(id) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/' + id,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/' + id,
method: 'get'
})
}
// 查询项目参建单位人员
export function findProSubDeptsUserByParams(proId) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findProSubDeptsUser/' + proId,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findProSubDeptsUser/' + proId,
method: 'get'
})
}
// 新增项目参建单位人员
export function registerSubDeptsUsers(data) {
return request({
url: '/manage/wxApi/registerSubDeptsUsers',
method: 'post',
data: data
})
return request({
url: '/manage/wxApi/registerSubDeptsUsers',
method: 'post',
data: data
})
}
// 查询我的项目信息
export function findMyProjectList() {
return request({
url: '/manage/proProjectInfo/findMyProjectList',
method: 'get'
})
return request({
url: '/manage/proProjectInfo/findMyProjectList',
method: 'get'
})
}
// 查询项目参建单位
export function findProjectDepts(proId) {
return request({
url: '/manage/proProjectInfoDepts/findAllDepts/' + proId,
method: 'get'
})
return request({
url: '/manage/proProjectInfoDepts/findAllDepts/' + proId,
method: 'get'
})
}
// 查询项目参建单位
export function findProjectDeptUsers(proId) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findAllSendUsers/' + proId,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findAllSendUsers/' + proId,
method: 'get'
})
}
// 修改人员审核状态
export function editApproveStatus(proUserId) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/editApproveStatus/' + proUserId,
method: 'post',
data: {}
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/editApproveStatus/' + proUserId,
method: 'post',
data: {}
})
}
// 查询参建单位列表
export function subdeptsList(query) {
return request({
url: '/manage/proProjectInfoSubdepts/list',
method: 'get',
params: query
})
return request({
url: '/manage/proProjectInfoSubdepts/list',
method: 'get',
params: query
})
}
// 统计参建单位信息
export function subdeptsCount(query) {
return request({
url: '/manage/proProjectInfoSubdepts/findWxCount',
method: 'get',
params: query
})
return request({
url: '/manage/proProjectInfoSubdepts/findWxCount',
method: 'get',
params: query
})
}
// 管理人员新增参建单位信息
export function registerSubDeptsGL(data) {
return request({
url: '/manage/proProjectInfoSubdepts/registerSubDepts',
method: 'post',
data: data
})
return request({
url: '/manage/proProjectInfoSubdepts/registerSubDepts',
method: 'post',
data: data
})
}
// 修改参建单位入场状态
export function editSubDeptsUseStatus(id, status) {
return request({
url: '/manage/proProjectInfoSubdepts/editUseStatus/' + id + '?status=' + status,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdepts/editUseStatus/' + id + '?status=' + status,
method: 'get'
})
}
// 查询单位班组列表
export function findSubGroupsList(query) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/list',
method: 'get',
params: query
})
return request({
url: '/manage/proProjectInfoSubdeptsGroup/list',
method: 'get',
params: query
})
}
// 查询单位班组列表
export function subgroupsList(query) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/findWxList',
method: 'get',
params: query
})
return request({
url: '/manage/proProjectInfoSubdeptsGroup/findWxList',
method: 'get',
params: query
})
}
// 统计单位班组信息
export function subgroupsCount(query) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/findWxCount',
method: 'get',
params: query
})
return request({
url: '/manage/proProjectInfoSubdeptsGroup/findWxCount',
method: 'get',
params: query
})
}
// 查看单位班组详情
export function findSubdeptsGroupById(id) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/' + id,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdeptsGroup/' + id,
method: 'get'
})
}
// 修改单位班组入场状态
export function editSubGroupsUseStatus(id, status) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/editUseStatus/' + id + '?status=' + status,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdeptsGroup/editUseStatus/' + id + '?status=' + status,
method: 'get'
})
}
// 查看可选班组长列表
export function fileGroupLeaderUsers(subDeptId, craftPost) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/fileGroupLeaderUsers/' + subDeptId + '?craftPost=' + craftPost,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/fileGroupLeaderUsers/' + subDeptId + '?craftPost=' + craftPost,
method: 'get'
})
}
// 确认变更班组长信息
export function updateGroupLeader(data) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/updateGroupLeader',
method: 'post',
data: data
})
return request({
url: '/manage/proProjectInfoSubdeptsGroup/updateGroupLeader',
method: 'post',
data: data
})
}
// 管理人员新增单位班组信息
export function registerSubDeptsGroupGL(data) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/registerSubDeptsGroup',
method: 'post',
data: data
})
return request({
url: '/manage/proProjectInfoSubdeptsGroup/registerSubDeptsGroup',
method: 'post',
data: data
})
}
// 查询班组人员列表
export function subusersList(query) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findWxList',
method: 'get',
params: query
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findWxList',
method: 'get',
params: query
})
}
// 统计班组人员信息
export function subusersCount(query) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findWxCount',
method: 'get',
params: query
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findWxCount',
method: 'get',
params: query
})
}
// 管理人员新增班组人员信息
export function registerSubUsersGL(data) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/registerSubDeptsUsers',
method: 'post',
data: data
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/registerSubDeptsUsers',
method: 'post',
data: data
})
}
// 查询班组人员详情
export function findProSubUsersInfoById(id) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/' + id,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/' + id,
method: 'get'
})
}
// 修改班组人员入场状态
export function editSubUsersUseStatus(id, status) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/editUseStatus/' + id + '?status=' + status,
method: 'get'
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/editUseStatus/' + id + '?status=' + status,
method: 'get'
})
}
// 修改班组人员手机号码
export function editSubUsersPhone(data) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/editPhone',
method: 'post',
data: data
})
return request({
url: '/manage/proProjectInfoSubdeptsUsers/editPhone',
method: 'post',
data: data
})
}
// 查询进度计划管理列表
export function planScheduleList(query) {
return request({
url: '/manage/schedule/list',
method: 'get',
params: query
})
return request({
url: '/manage/schedule/list',
method: 'get',
params: query
})
}
// 查询进度计划管理详情
export function planScheduleInfo(id) {
return request({
url: '/manage/schedule/' + id,
method: 'get'
})
return request({
url: '/manage/schedule/' + id,
method: 'get'
})
}
// 查询之前项目进度
export function findPreviousSchedule(planId) {
return request({
url: '/manage/schedule/findPreviousSchedule/' + planId,
method: 'get'
})
return request({
url: '/manage/schedule/findPreviousSchedule/' + planId,
method: 'get'
})
}
// 查询计划管理
export function findPlanDatas(proId) {
return request({
url: '/manage/plan/findPlanDatas/' + proId,
method: 'get'
})
return request({
url: '/manage/plan/findPlanDatas/' + proId,
method: 'get'
})
}
// 递归查询计划
export function findRecursionPlan(planId) {
return request({
url: '/manage/plan/findRecursionPlan/' + planId,
method: 'get'
})
return request({
url: '/manage/plan/findRecursionPlan/' + planId,
method: 'get'
})
}
// 保存计划进度
export function submitPlanSchedule(data) {
return request({
url: '/manage/schedule',
method: 'post',
data: data
})
return request({
url: '/manage/schedule',
method: 'post',
data: data
})
}
// 视频监控管理
export function proVideoList(query) {
return request({
url: '/manage/videoMonitor/list',
method: 'get',
params: query
})
return request({
url: '/manage/videoMonitor/list',
method: 'get',
params: query
})
}
export function getYsToken(id){
return request({
url: '/manage/videoMonitor/getYsToken/' + id,
method: 'get'
})
}
export function getYsToken(id) {
return request({
url: '/manage/videoMonitor/getYsToken/' + id,
method: 'get'
})
}
// 举牌验收管理
// 举牌验收管理
export function projectCheckedList(query) {
return request({
url: '/manage/projectChecked/list',
method: 'get',
params: query
})
return request({
url: '/manage/projectChecked/list',
method: 'get',
params: query
})
}
// 举牌验收管理
export function projectCheckedListCount(query) {
return request({
url: '/manage/projectChecked/listCount',
method: 'get',
params: query
})
// 举牌验收管理
export function projectCheckedListCount(query) {
return request({
url: '/manage/projectChecked/listCount',
method: 'get',
params: query
})
}
// 查询分包单位工人列表
export function listProProjectInfoSubdeptsUsers(query) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/list',
method: 'get',
data: query
})
}
// 新增项目举牌验收
export function addProjectChecked(data) {
return request({
url: '/manage/projectChecked',
method: 'post',
data: data
})
}
// 修改项目举牌验收
export function updateProjectChecked(data) {
return request({
url: '/manage/projectChecked',
method: 'put',
data: data
})
}
// 获取项目举牌验收
export function getProjectChecked(id) {
return request({
url: '/manage/projectChecked/' + id,
method: 'get'
})
}

View File

@ -2,8 +2,8 @@
module.exports = {
timeout: 60000,
appId: "wx46466c7828eede2b",
baseUrl: "https://xiangguan.sxyanzhu.com/wechat",
//baseUrl: 'http://127.0.0.1:8080',
//baseUrl: "https://xiangguan.sxyanzhu.com/wechat",
baseUrl: 'http://127.0.0.1:8080',
baseImgUrl: "https://xiangguan.sxyanzhu.com",
//baseImgUrl: 'http://127.0.0.1:9300',
noSecuritys: [

View File

@ -0,0 +1,14 @@
<svg
class="icon"
style="width: 1.125em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
viewBox="0 0 1152 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="4810"
>
<path
fill="#ccc"
d="M805.2 166.4l180.4 180.4c7.6 7.6 7.6 20 0 27.6L548.8 811.2l-185.6 20.6c-24.8 2.8-45.8-18.2-43-43l20.6-185.6L777.6 166.4c7.6-7.6 20-7.6 27.6 0z m324-45.8l-97.6-97.6c-30.4-30.4-79.8-30.4-110.4 0l-70.8 70.8c-7.6 7.6-7.6 20 0 27.6l180.4 180.4c7.6 7.6 20 7.6 27.6 0l70.8-70.8c30.4-30.6 30.4-80 0-110.4zM768 692.4V896H128V256h459.6c6.4 0 12.4-2.6 17-7l80-80c15.2-15.2 4.4-41-17-41H96C43 128 0 171 0 224v704c0 53 43 96 96 96h704c53 0 96-43 96-96V612.4c0-21.4-25.8-32-41-17l-80 80c-4.4 4.6-7 10.6-7 17z"
p-id="4811"
/>
</svg>

After

Width:  |  Height:  |  Size: 766 B

View File

@ -2,16 +2,14 @@
import config from "../../../config";
import fmt from "../../../utils/date.js";
import { getToken, getUserInfo } from "../../../utils/auth";
import { uploadFiles } from "../../../utils/upload.js";
import { tryToJson } from '../../../utils/tools'
import {
projectCheckedList,
projectCheckedListCount,
} from "../../../api/project";
import {
getProjectChecked,
findPlanDatas,
findRecursionPlan,
findPreviousSchedule,
submitPlanSchedule,
listProProjectInfoSubdeptsUsers,
updateProjectChecked,
addProjectChecked,
} from "../../../api/project";
const app = getApp();
@ -21,16 +19,22 @@ Page({
*/
data: {
maxDate: new Date(2088, 1, 1).getTime(),
minDate: new Date().getTime() + 3600 * 48 * 1000,
minDate: new Date().getTime(),
imageInfoData: [],
form: {
dataId: null,
taskName: "",
task: null,
intro: "", //验收描述
imageUrls: [],
groupDeptUser: "", //班组长
checkingDate: "", //验收时间
technician: '',
technicianUser: "", //技术专员
technicianUserName: "",
supervise: '',
superviseUser: "", //监理专员
superviseUserName: ""
},
projectUserInfo: {},
projectId: "",
@ -43,8 +47,10 @@ Page({
//任务计划
picker: false,
planOptions: [],
groupUserOptions: [],//班组长
technicianUserOptions: [],//技术专员
superviseUserOptions: [],//监理员
},
/**
* 生命周期函数--监听页面加载
*/
@ -68,6 +74,7 @@ Page({
listData: [],
total: 0,
form: {
...this.data.form,
taskName: "",
task: null,
intro: "",
@ -75,7 +82,24 @@ Page({
},
});
this.initPlanDatas();
// 获取编辑模式id参数
if (options.id) {
this.setData({
'form.dataId': options.id
});
this.initUserOptions(() => {
// 这里可以添加加载编辑数据的逻辑
this.loadEditData(options.id);
});//获取人员列表
} else {
this.initUserOptions();//获取人员列表
}
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
@ -84,7 +108,47 @@ Page({
app.globalData.useProjectName = projectName;
this.onLoad();
},
checkSysRole(user, role) {
let tmp = user.sysRoles;
if (!tmp) {
return false;
}
let tmps = tmp.split(",");
return tmps.find(it => it.indexOf(role) == 0);
},
/**
* 获取用户列表
*/
initUserOptions(cb) {
listProProjectInfoSubdeptsUsers({
projectId: app.globalData.useProjectId, pageNum: 1, pageSize: 1000
}).then((res) => {
let users = (res.rows || []).map(it => {
it.text = `${it.userName}(${it.userPhone})`
it.id = it.userId
return it;
});
let groupUserOptions = [];
let technicianUserOptions = [];
let superviseUserOptions = [];
users.forEach(item => {
if (item.userPost == '3') {
groupUserOptions.push(item);
} else if (this.checkSysRole(item, 'zbjsy_')) {
technicianUserOptions.push(item);
} else if (item.userPost == '71') {
superviseUserOptions.push(item);
}
});
this.setData({
groupUserOptions,
technicianUserOptions,
superviseUserOptions,
});
cb && cb();
});
},
/**
* 初始化计划
*/
@ -129,6 +193,7 @@ Page({
if (item) {
this.setData({
form: {
...this.data.form,
task: item,
taskName: item.fullPath,
},
@ -136,55 +201,177 @@ Page({
});
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: "../list/index",
});
},
onScrollToLower() {
let nal = Math.ceil(this.data.total / this.data.pageSize);
if (this.data.pageNum < nal) {
//选择监理员
onSuperviseUserSelect(e) {
let item = e.detail;
if (item) {
this.setData({
//pageNum: this.data.pageNum + 1
});
//this.getListData(this.data.activeState);
} else {
console.log("已经到底了,没有数据可加载!!!");
form: {
...this.data.form,
supervise: item.userId,
superviseUser: item.userPhone,
superviseUserName: item.userName,
}
})
}
},
//选择技术专员
onTechnicianUserSelect(e) {
let item = e.detail;
if (item) {
this.setData({
form: {
...this.data.form,
technician: item.userId,
technicianUser: item.userPhone,
technicianUserName: item.userName,
}
})
}
},
onIntroInput(e) {
this.setData({
form: {
...this.data.form,
intro: e.detail.value,
}
})
},
// 上传图片
onImagesArr(e) {
this.setData({
imageInfoData: e.detail
})
},
//验收时间
onInputTime(e) {
this.setData({
"form.checkingDate": e.detail
})
},
/**
* 加载编辑数据
* @param {string} id - 验收记录ID
*/
loadEditData(id) {
// 这里模拟加载编辑数据实际应该调用API获取详情
// 例如: const res = await getProjectCheckedDetail(id)
wx.showLoading({
title: '加载中...',
})
getProjectChecked(id).then(res => {
let data = res.data || {};
let form = this.data.form;
let task = tryToJson(data.workingPosition, {});
form.task = task;
form.taskName = task.full;
form.taskId = task.id;
let imgs = data.imageUrls ? data.imageUrls.split(",") : [];
let user = this.data.technicianUserOptions.find(it => it.userPhone == data.technicianUser);
form.technician = user?.userId || '';
user = this.data.superviseUserOptions.find(it => it.userPhone == data.superviseUser);
form.supervise = user?.userId || '';
form.intro = data.intro;
form.checkingDate = data.checkingDate;
form.dataId = data.id;
form.groupDeptUser = data.groupDeptUser;
form.groupDeptUserName = data.groupDeptUserName;
form.technicianUser = data.technicianUser;
form.technicianUserName = data.technicianUserName;
form.superviseUser = data.superviseUser;
form.superviseUserName = data.superviseUserName;
this.setData({
imageInfoData: imgs,
form: {
...form
}
})
wx.hideLoading()
})
},
//提交保存
async submitSave() {
let form = this.data.form;
if (!form.taskName) {
app.toast("请选择任务计划!");
return false;
}
if (!form.technician) {
app.toast("请选择技术专员!");
return false;
}
if (!form.supervise) {
app.toast("请选择监理员!");
return false;
}
if (!form.intro) {
app.toast("请填写结果描述!");
return false;
}
if (!form.checkingDate) {
app.toast("请选择完成时间!");
return false;
}
if (this.data.imageInfoData.length == 0) {
app.toast("请上传图片!");
return;
}
let postData = {
workingPosition: form.task.taskName,
intro: form.intro,
checkingDate: form.checkingDate,
imageUrls: "",
groupDeptUser: this.data.projectUserInfo.userPhone,
groupDeptUserName: this.data.projectUserInfo.userName,
technicianUser: form.technicianUser,
technicianUserName: form.technicianUserName,
superviseUser: form.superviseUser,
superviseUserName: form.superviseUserName,
comId: this.data.projectUserInfo.comId,
projectId: app.globalData.useProjectId,
approveStatus: 1,
}
let taskInfo = {
id: form.task.id,
name: form.task.taskName,
full: form.task.fullPath
}
postData.workingPosition = JSON.stringify(taskInfo);
let fileUrls = await uploadFiles(this.data.imageInfoData);
postData.imageUrls = fileUrls.join(",");
try {
if (form.dataId) {
postData.id = form.dataId;
await updateProjectChecked(postData);
} else {
await addProjectChecked(postData);
}
app.toast("保存成功!");
this.doBack(true);
} catch (error) {
console.error('保存失败:', error);
app.toast("保存失败,请重试");
}
},
doBack(isRefresh) {
/*返回列表页面并刷新*/
if (isRefresh) {
wx.navigateBack({
delta: 1
});
} else {
wx.redirectTo({
url: "../list/index",
})
}
},
returnToPage: function () {
this.doBack(false);
},
});

View File

@ -14,32 +14,16 @@
</van-row>
</view>
</view>
<scroll-view
class="max_content_scroll"
type="list"
scroll-y
bindscrolltolower="onScrollToLower"
style="padding: 30rpx"
>
<project-select
init="{{ initData }}"
bindchange="onProjectSelect"
id="projectSel"
></project-select>
<scroll-view class="max_content_scroll" type="list" scroll-y style="padding: 30rpx">
<project-select init="{{ initData }}" bindchange="onProjectSelect" id="projectSel"></project-select>
<view class="mt40">分包单位</view>
<view class="add-info">{{ projectUserInfo.subDeptName }}</view>
<view class="mt40 markers inspect_info_title">工程部位</view>
<view class="inspect_info_content">
<textarea
class="add_textarea"
placeholder="请填写选择工程计划"
placeholder-style="color:#6777aa;"
bindtap="openPicker"
disabled
model:value="{{ form.taskName }}"
/>
<textarea class="add_textarea" placeholder="请填写选择工程计划" placeholder-style="color:#6777aa;" bindtap="openPicker"
disabled model:value="{{ form.taskName }}" />
<van-popup show="{{ picker }}" bind:close="closePicker" position="bottom">
<view class="rectifier_max">
<view class="rectifier_title">
@ -50,125 +34,54 @@
</view>
<view class="rectifier_list">
<view class="rectifier_list_height">
<select-group-plan
dataTree="{{ planOptions }}"
isOpenAll="{{ fales }}"
showCheckBox="{{ fales }}"
multiple="{{ false }}"
bind:clickItem="handleClick"
/>
<select-group-plan dataTree="{{ planOptions }}" isOpenAll="{{ fales }}" showCheckBox="{{ fales }}"
multiple="{{ false }}" bind:clickItem="handleClick" />
</view>
</view>
</view>
</van-popup>
</view>
<view class="mt40 markers inspect_info_title">技术专员</view>
<view class="inspect_info_content">
<textarea
class="add_textarea"
placeholder="请填写选择工程计划"
placeholder-style="color:#6777aa;"
bindtap="openPicker"
disabled
model:value="{{ form.taskName }}"
/>
<van-popup show="{{ picker }}" bind:close="closePicker" position="bottom">
<view class="rectifier_max">
<view class="rectifier_title">
<view class="rectifier_text">选择工程计划</view>
<view class="rectifier_close" bindtap="closePicker">
<van-icon name="cross" />
</view>
</view>
<view class="rectifier_list">
<view class="rectifier_list_height">
<select-group-plan
dataTree="{{ planOptions }}"
isOpenAll="{{ fales }}"
showCheckBox="{{ fales }}"
multiple="{{ false }}"
bind:clickItem="handleClick"
/>
</view>
</view>
</view>
</van-popup>
<view class="markers inspect_info_title">技术专员</view>
<voucher-select columns="{{technicianUserOptions}}" placeholder="请选择技术专员" bindchange="onTechnicianUserSelect"
selectValue="{{form.technician}}">
</voucher-select>
</view>
<view class="mt40 markers inspect_info_title">监理员</view>
<view class="inspect_info_content">
<textarea
class="add_textarea"
placeholder="请填写选择工程计划"
placeholder-style="color:#6777aa;"
bindtap="openPicker"
disabled
model:value="{{ form.taskName }}"
/>
<van-popup show="{{ picker }}" bind:close="closePicker" position="bottom">
<view class="rectifier_max">
<view class="rectifier_title">
<view class="rectifier_text">选择工程计划</view>
<view class="rectifier_close" bindtap="closePicker">
<van-icon name="cross" />
</view>
</view>
<view class="rectifier_list">
<view class="rectifier_list_height">
<select-group-plan
dataTree="{{ planOptions }}"
isOpenAll="{{ fales }}"
showCheckBox="{{ fales }}"
multiple="{{ false }}"
bind:clickItem="handleClick"
/>
</view>
</view>
</view>
</van-popup>
<view class="markers inspect_info_title">监理员</view>
<voucher-select columns="{{superviseUserOptions}}" placeholder="请选择监理员" bindchange="onSuperviseUserSelect"
selectValue="{{form.supervise}}"></voucher-select>
</view>
<view class="mt40 markers inspect_info_title">结果描述</view>
<view class="inspect_info_content">
<textarea
class="add_textarea"
placeholder="请填写结果描述"
placeholder-style="color:#6777aa;"
model:value="{{ form.intro }}"
/>
<textarea class="add_textarea" placeholder="请填写结果描述" placeholder-style="color:#6777aa;"
model:value="{{ form.intro }}" maxlength="200" bindinput="onIntroInput" />
</view>
<view class="mt40 markers inspect_info_title">验收时间</view>
<view class="inspect_info_content">
<voucher-date
counts="5"
placeholder="请选择完成时间"
minDate="{{ minDate }}"
maxDate="{{ maxDate }}"
model:value="{{ form.checkingDate }}"
currentDate="{{ form.checkingDate }}"
></voucher-date>
<voucher-date counts="5" placeholder="请选择完成时间" minDate="{{ minDate }}" maxDate="{{ maxDate }}"
model:value="{{ form.checkingDate }}" bindchange="onInputTime"
currentDate="{{ form.checkingDate }}"></voucher-date>
</view>
<view class="mt40 markers inspect_info_title">验收照片</view>
<view class="inspect_info_content">
<view class="inspect_info_content" style="margin-left: 10px">
<file-uploader bindimages="onImagesArr"></file-uploader>
<file-uploader bindimages="onImagesArr" fileUrlArray="{{imageInfoData}}"></file-uploader>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">取消</view>
<view
class="problem_submit_to_btn problem_submit_to_save"
bindtap="submitSave"
>确认</view
>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSave">确认</view>
</view>
</scroll-view>
</view>
</view>

View File

@ -1,66 +1,113 @@
// pageage/project_checked/info/index.js
import config from "../../../config";
import fmt from "../../../utils/date.js";
import { getToken, getUserInfo } from "../../../utils/auth";
import { uploadFiles } from "../../../utils/upload.js";
import { tryToJson } from '../../../utils/tools'
import {
getProjectChecked,
findPlanDatas,
listProProjectInfoSubdeptsUsers,
updateProjectChecked,
addProjectChecked,
} from "../../../api/project";
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
/**
* 页面的初始数据
*/
data: {
imageInfoData: [],
rowData: {},
projectUserInfo: {},
projectId: "",
projectName: "",
initData: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: "../../../pages/login/login",
});
}
const proUserInfo = getUserInfo();
this.setData({
projectUserInfo: proUserInfo.projectUserInfo,
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
});
},
doBack(isRefresh) {
/*返回列表页面并刷新*/
if (isRefresh) {
wx.navigateBack({
delta: 1
});
} else {
wx.redirectTo({
url: "../list/index",
})
}
},
returnToPage: function (isRefresh) {
this.doBack(false)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"navigationStyle": "custom"
}

View File

@ -1,2 +1,17 @@
<!--pageage/project_checked/info/index.wxml-->
<text>pageage/project_checked/info/index.wxml</text>
<wxs module="format" src="/utils/format.wxs"></wxs>
<view class="project-checked-info">
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">项目举牌验收-详情</view>
</van-col>
</van-row>
</view>
</view>
</view>

View File

@ -7,6 +7,7 @@ import {
projectCheckedList,
projectCheckedListCount
} from '../../../api/project'
import { tryToJson } from '../../../utils/tools'
const app = getApp()
Page({
@ -68,14 +69,13 @@ Page({
isGroup: proUserInfo.projectUserInfo.userPost == "3"
});
this.getListData(this.data.activeState);
},
/**
* 添加验收信息
*/
skipAdd() {
wx.redirectTo({
wx.navigateTo({
url: `../add/index`,
})
},
@ -114,9 +114,17 @@ Page({
}
projectCheckedList(params).then(res => {
if (res.code == 200) {
let tmps = (res.rows || []).map(it => {
let task = tryToJson(it.workingPosition, {});
it.workingPositionName = task.name;
it.workingPositionFull = task.full;
it.taskId = task.id;
it.canEdit = it.approveStatus == 1 && it.groupDeptUser == this.data.projectUserInfo.userPhone;
return it;
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
listData: this.data.listData.concat(tmps)
})
}
});
@ -125,7 +133,7 @@ Page({
if (res.code == 200) {
let _qb = 0, _jxz = 0, _ywc = 0;
res.data.forEach(item => {
if (item.approve_status == '100' && item.check_result == '1') {
if (["100", "4"].includes(item.approve_status) && item.check_result == '1') {
_qb += item.total;
_ywc += item.total;
} else {
@ -142,6 +150,13 @@ Page({
});
},
editClick(e) {
let item = e.currentTarget.dataset.set
wx.navigateTo({
url: `../add/index?id=${item.id}`,
})
},
/**
* 标签切换
*/
@ -176,7 +191,12 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
// 页面显示时刷新数据
this.setData({
pageNum: 1,
listData: []
});
this.getListData(this.data.activeState);
},
returnToPage: function () {

View File

@ -0,0 +1,10 @@
.project_checked_list {
.inspect_for_bgd {
position: relative;
.edit-icon {
position: absolute;
right: 40rpx;
}
}
}

View File

@ -1,132 +1,82 @@
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">项目举牌验收</view>
</van-col>
</van-row>
<view class="project_checked_list">
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">项目举牌验收</view>
</van-col>
</van-row>
</view>
</view>
</view>
<scroll-view
class="max_content_scroll"
type="list"
scroll-y
bindscrolltolower="onScrollToLower"
>
<project-select
init="{{ initData }}"
bindchange="onProjectSelect"
id="projectSel"
></project-select>
<view class="modify_video_nav" style="margin-top: 5rpx">
<view
class="{{ activeState == 'qb' ? 'active' : '' }}"
bindtap="trainJump"
data-index="1"
><text>全部({{ qbCount }}</text></view
>
<view
class="{{ activeState == 'jxz' ? 'active' : '' }}"
bindtap="trainJump"
data-index="2"
><text>进行中({{ jxzCount }}</text></view
>
<view
class="{{ activeState == 'ywc' ? 'active' : '' }}"
bindtap="trainJump"
data-index="3"
><text>已完成({{ ywcCount }}</text></view
>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view
class="inspect_for_scroll"
wx:if="{{ listData.length > 0 }}"
wx:for="{{ listData }}"
wx:key="index"
data-set="{{ item }}"
bindtap="getInfo"
>
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{
index < 10 ? "0" + (index + 1) : index + 1
}}</view>
<view
class="module_title module_title_flex inspect_list_title_text_2"
>
{{ item.createTime }}
<scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower">
<project-select init="{{ initData }}" bindchange="onProjectSelect" id="projectSel"></project-select>
<view class="modify_video_nav" style="margin-top: 5rpx">
<view class="{{ activeState == 'qb' ? 'active' : '' }}" bindtap="trainJump" data-index="1"><text>全部({{ qbCount
}}</text></view>
<view class="{{ activeState == 'jxz' ? 'active' : '' }}" bindtap="trainJump" data-index="2"><text>进行中({{ jxzCount
}}</text></view>
<view class="{{ activeState == 'ywc' ? 'active' : '' }}" bindtap="trainJump" data-index="3"><text>已完成({{ ywcCount
}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" wx:if="{{ listData.length > 0 }}" wx:for="{{ listData }}" wx:key="index"
data-set="{{ item }}" bindtap="getInfo">
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view wx:if="item.canEdit" class="edit-icon" catchtap="editClick" data-set="{{ item }}">
<svg-icon src="edit" color="#45affb" size="80" />
</view>
<view class="inspect_list_title_number">{{
index < 10 ? "0" + (index + 1) : index + 1 }}</view>
<view class="module_title module_title_flex inspect_list_title_text_2">
{{ item.createTime }}
</view>
<!-- <text class="timeline_for_state_1">常规验收</text> -->
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_img">
<view wx:if="{{ item.approveStatus == 1 }}" class="code_label code_label_yellow">待审批</view>
<view wx:if="{{ item.approveStatus == 3 }}" class="code_label code_label_red">已驳回</view>
<view wx:if="{{ item.approveStatus == 4 || item.approveStatus == 100}}"
class="code_label code_label_green">已完成</view>
<van-image width="120rpx" height="120rpx" fit="cover"
src="{{ imgBaseUrl + item.mainImage + '.min.jpg' }}" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">工序部位:<text>{{ item.workingPositionFull }}</text>
</view>
<view class="inspect_list_info_data_prop">技术专员:<text>{{ item.technicianUserName }}</text></view>
<view class="inspect_list_info_data_prop">监理专员:<text>{{ item.superviseUserName }}</text></view>
<view class="inspect_list_info_data_prop">验收时间:<text>{{ item.checkingDate }}</text></view>
</view>
</view>
<view class="inspect_list_info_position">
验收描述:<text class="color_purple">{{ item.intro }}</text>
</view>
</view>
<!-- <text class="timeline_for_state_1">常规验收</text> -->
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_img">
<view
wx:if="{{ item.approveStatus == 1 }}"
class="code_label code_label_yellow"
>待审批</view
>
<view
wx:if="{{ item.approveStatus == 3 }}"
class="code_label code_label_red"
>已驳回</view
>
<view
wx:if="{{ item.approveStatus == 4 }}"
class="code_label code_label_green"
>已完成</view
>
<van-image
width="120rpx"
height="120rpx"
fit="cover"
src="{{ imgBaseUrl + item.mainImage + '.min.jpg' }}"
/>
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue"
>工序部位:<text>{{ item.workingPosition }}</text></view
>
<view class="inspect_list_info_data_prop"
>技术专员:<text>{{ item.technicianUserName }}</text></view
>
<view class="inspect_list_info_data_prop"
>监理专员:<text>{{ item.superviseUserName }}</text></view
>
<view class="inspect_list_info_data_prop"
>验收时间:<text>{{ item.recheckSendUser }}</text></view
>
</view>
<view wx:if="{{ listData.length == 0 }}">
<view style="padding-top: 70px; text-align: -webkit-center">
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px; height: 105px"></image>
<view style="color: #a5abbb">暂无数据</view>
</view>
<view class="inspect_list_info_position">
验收描述:<text class="color_purple">{{ item.intro }}</text>
</view>
<view wx:if="{{ isGroup }}" class="inspect_add_to" bindtap="skipAdd">
<view style="padding-top: 22rpx">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>
</view>
<view wx:if="{{ listData.length == 0 }}">
<view style="padding-top: 70px; text-align: -webkit-center">
<image
src="https://szgcwx.jhncidg.com/staticFiles/nodata.png"
style="width: 130px; height: 105px"
></image>
<view style="color: #a5abbb">暂无数据</view>
</view>
</view>
<view wx:if="{{ isGroup }}" class="inspect_add_to" bindtap="skipAdd">
<view style="padding-top: 22rpx">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>
</scroll-view>
</scroll-view>
</view>

View File

@ -1 +1,7 @@
/* pageage/project_checked/list/index.wxss */
.project_checked_list .inspect_for_bgd {
position: relative;
}
.project_checked_list .inspect_for_bgd .edit-icon {
position: absolute;
right: 40rpx;
}

View File

@ -1,160 +1,178 @@
import config from '../config'
import {
getToken,
removeToken
getToken,
removeToken
} from './auth'
const app = getApp()
function doRequest(url, method = 'GET', data, header = {}) {
//安全白名单判断
if(url.indexOf("/wxApi/")<0){
if (config.noSecuritys.indexOf(url) == -1 && !getToken()) {
removeToken();
wx.redirectTo({
url: '../login/login',
});
}
}
//POST请求设置数据来源为小程序...
if(method=='post' || method=='POST'){
data.dataSource = "1";
wx.showLoading({
mask: true,
title: url == config.noSecuritys[1] ? '登录中' : '正在处理'
})
app.securityLoading();
}
return new Promise((resolve, reject) => {
wx.request({
url: config.baseUrl + url,
method: method,
data: data,
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + getToken(),
...header
},
timeout: config.timeOut,
success: function (res) {
wx.hideLoading({success: (res) => {}});
const code = res.data.code || 200
if (code === 401) {
removeToken();
wx.redirectTo({
url: '../login/login',
});
} else if (code === 500 || code === 403) {
app.toast(res.data.msg);
setTimeout(() => {
resolve(res.data);
}, 800)
} else {
resolve(res.data);
}
},
fail: function (error) {
wx.hideLoading({success: (res) => {}});
app.toast(error);
reject(error);
}
})
})
//安全白名单判断
if (url.indexOf("/wxApi/") < 0) {
if (config.noSecuritys.indexOf(url) == -1 && !getToken()) {
removeToken();
wx.redirectTo({
url: '../login/login',
});
}
}
// 处理GET请求的params参数
let requestUrl = config.baseUrl + url;
if ((method === 'GET' || method === 'get') && data && Object.keys(data).length > 0) {
const queryParts = [];
Object.keys(data).forEach(key => {
if (data[key] !== null && data[key] !== undefined) {
const encodedKey = encodeURIComponent(key);
const encodedValue = encodeURIComponent(String(data[key]));
queryParts.push(encodedKey + '=' + encodedValue);
}
});
const queryString = queryParts.join('&');
if (queryString) {
requestUrl += (url.includes('?') ? '&' : '?') + queryString;
}
}
//POST请求设置数据来源为小程序...
if (method == 'post' || method == 'POST') {
data.dataSource = "1";
wx.showLoading({
mask: true,
title: url == config.noSecuritys[1] ? '登录中' : '正在处理'
})
app.securityLoading();
}
return new Promise((resolve, reject) => {
wx.request({
url: requestUrl,
method: method,
data: (method === 'GET' || method === 'get') ? {} : data,
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + getToken(),
...header
},
timeout: config.timeOut,
success: function (res) {
wx.hideLoading({ success: (res) => { } });
const code = res.data.code || 200
if (code === 401) {
removeToken();
wx.redirectTo({
url: '../login/login',
});
} else if (code === 500 || code === 403) {
app.toast(res.data.msg);
setTimeout(() => {
resolve(res.data);
}, 800)
} else {
resolve(res.data);
}
},
fail: function (error) {
wx.hideLoading({ success: (res) => { } });
app.toast(error);
reject(error);
}
})
})
}
/**
* 这里考虑上传异步问题封装为同步
*/
export function syncFileUpload(file) {
if (!getToken()) {
removeToken();
wx.redirectTo({
url: '../login/login',
});
}
wx.showLoading({
mask: true,
title: '正在上传资源'
})
return new Promise((resolve, reject) => {
wx.uploadFile({
url: config.baseUrl + '/common/upload', // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
'Authorization': 'Bearer ' + getToken()
},
name: "file", //上传的所需字段,后端提供
formData: {},
success: (res) => {
// 上传完成操作
wx.hideLoading()
let resJson = JSON.parse(res.data)
const code = resJson.code || 200
if (code === 401) {
removeToken();
wx.redirectTo({
url: '../login/login',
});
} else if (code === 500 || code === 403) {
app.toast(resJson.msg);
setTimeout(() => {
resolve(resJson);
}, 800)
resolve(resJson);
} else {
resolve(resJson);
}
},
fail: (error) => {
wx.hideLoading()
//上传失败修改pedding为reject
app.toast("网络出错,上传失败")
reject(error)
}
});
})
if (!getToken()) {
removeToken();
wx.redirectTo({
url: '../login/login',
});
}
wx.showLoading({
mask: true,
title: '正在上传资源'
})
return new Promise((resolve, reject) => {
wx.uploadFile({
url: config.baseUrl + '/common/upload', // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
'Authorization': 'Bearer ' + getToken()
},
name: "file", //上传的所需字段,后端提供
formData: {},
success: (res) => {
// 上传完成操作
wx.hideLoading()
let resJson = JSON.parse(res.data)
const code = resJson.code || 200
if (code === 401) {
removeToken();
wx.redirectTo({
url: '../login/login',
});
} else if (code === 500 || code === 403) {
app.toast(resJson.msg);
setTimeout(() => {
resolve(resJson);
}, 800)
resolve(resJson);
} else {
resolve(resJson);
}
},
fail: (error) => {
wx.hideLoading()
//上传失败修改pedding为reject
app.toast("网络出错,上传失败")
reject(error)
}
});
})
}
/**
* 这里考虑上传异步问题封装为同步
*/
export function securityFileUpload(file) {
wx.showLoading({
mask: true,
title: '正在上传资源'
})
return new Promise((resolve, reject) => {
wx.uploadFile({
url: config.baseUrl + '/file/NoSecurity/upload', // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
},
name: "file", //上传的所需字段,后端提供
success: (res) => {
// 上传完成操作
wx.hideLoading()
let resJson = JSON.parse(res.data)
const code = resJson.code || 200
if (code != 200) {
app.toast(resJson.msg);
setTimeout(() => {
resolve(resJson);
}, 800)
resolve(resJson);
} else {
resolve(resJson);
}
},
fail: (error) => {
wx.hideLoading()
//上传失败修改pedding为reject
app.toast("网络出错,上传失败")
reject(error)
}
});
})
wx.showLoading({
mask: true,
title: '正在上传资源'
})
return new Promise((resolve, reject) => {
wx.uploadFile({
url: config.baseUrl + '/file/NoSecurity/upload', // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
},
name: "file", //上传的所需字段,后端提供
success: (res) => {
// 上传完成操作
wx.hideLoading()
let resJson = JSON.parse(res.data)
const code = resJson.code || 200
if (code != 200) {
app.toast(resJson.msg);
setTimeout(() => {
resolve(resJson);
}, 800)
resolve(resJson);
} else {
resolve(resJson);
}
},
fail: (error) => {
wx.hideLoading()
//上传失败修改pedding为reject
app.toast("网络出错,上传失败")
reject(error)
}
});
})
}
/**
@ -164,46 +182,46 @@ export function securityFileUpload(file) {
* @param {*} file
*/
export function securitySignFileUpload(file) {
wx.showLoading({
mask: true,
title: '正在上传签名'
})
return new Promise((resolve, reject) => {
wx.uploadFile({
url: config.baseUrl + '/file/NoSecurity/signUpload', // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
},
name: "file", //上传的所需字段,后端提供
success: (res) => {
// 上传完成操作
wx.hideLoading()
let resJson = JSON.parse(res.data)
const code = resJson.code || 200
if (code != 200) {
app.toast(resJson.msg);
setTimeout(() => {
resolve(resJson);
}, 800)
resolve(resJson);
} else {
resolve(resJson);
}
},
fail: (error) => {
wx.hideLoading()
//上传失败修改pedding为reject
app.toast("网络出错,上传失败")
reject(error)
}
});
})
wx.showLoading({
mask: true,
title: '正在上传签名'
})
return new Promise((resolve, reject) => {
wx.uploadFile({
url: config.baseUrl + '/file/NoSecurity/signUpload', // 上传的服务器接口地址
filePath: file,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
},
name: "file", //上传的所需字段,后端提供
success: (res) => {
// 上传完成操作
wx.hideLoading()
let resJson = JSON.parse(res.data)
const code = resJson.code || 200
if (code != 200) {
app.toast(resJson.msg);
setTimeout(() => {
resolve(resJson);
}, 800)
resolve(resJson);
} else {
resolve(resJson);
}
},
fail: (error) => {
wx.hideLoading()
//上传失败修改pedding为reject
app.toast("网络出错,上传失败")
reject(error)
}
});
})
}
export function request(options) {
if(options.method=='get' && options.params){
options.url = options.url+"?"+options.params;
}
return doRequest(options.url, options.method, options.data, options.header)
if (options.method == 'get' && options.params) {
options.url = options.url + "?" + options.params;
}
return doRequest(options.url, options.method, options.data, options.header)
}

View File

@ -0,0 +1,10 @@
export function tryToJson(str, df) {
try {
if (!str) {
return df || {};
}
return JSON.parse(str) || df || {};
} catch {
return df || {};
}
}

View File

@ -0,0 +1,140 @@
/**
* 文件上传工具类
* 封装微信小程序文件上传功能
*/
const config = require('../config.js');
const { getToken } = require('../utils/auth.js');
/**
* 文件上传工具类
*/
class FileUploader {
constructor() {
this.baseUrl = config.baseUrl;
}
/**
* 同步上传单个文件
* @param {string} filePath - 文件路径
* @param {Object} options - 上传配置选项
* @param {string} options.uploadUrl - 上传接口地址默认为 /file/upload
* @param {string} options.name - 上传字段名默认为 'file'
* @param {Object} options.formData - 额外表单数据
* @param {Object} options.header - 额外请求头
* @returns {Promise} 返回上传结果的Promise
*/
syncUploadFile(filePath, options = {}) {
const {
uploadUrl = '/file/upload',
name = 'file',
formData = {},
header = {}
} = options;
return new Promise((resolve, reject) => {
wx.uploadFile({
url: this.baseUrl + uploadUrl,
filePath: filePath,
name: name,
formData: formData,
header: {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Authorization': 'Bearer ' + getToken(),
...header
},
success: (res) => {
try {
const data = JSON.parse(res.data);
resolve({
success: true,
data: data,
url: data.data?.url || ''
});
} catch (error) {
reject({
success: false,
error: error,
message: '服务器返回数据格式错误'
});
}
},
fail: (err) => {
console.error('文件上传失败:', err);
wx.showToast({
title: '网络出错,上传失败',
icon: 'none',
duration: 1000
});
reject({
success: false,
error: err,
message: '网络出错,上传失败'
});
}
});
});
}
/**
* 批量上传文件
* @param {Array<string>} filePaths - 文件路径数组
* @param {Object} options - 上传配置选项
* @returns {Promise<Array>} 返回上传成功的URL数组
*/
async uploadFiles(filePaths, options = {}) {
if (!Array.isArray(filePaths) || filePaths.length === 0) {
return [];
}
const fileUrls = [];
for (const filePath of filePaths) {
try {
if (filePath.indexOf("http://tmp/") === -1) {
fileUrls.push(filePath);
continue;
}
const result = await this.syncUploadFile(filePath, options);
if (result.success && result.url) {
fileUrls.push(result.url);
}
} catch (error) {
console.error('单个文件上传失败:', error);
// 继续上传其他文件,不中断整个流程
}
}
return fileUrls;
}
/**
* 上传图片兼容旧版本
* @param {string} filePath - 图片路径
* @returns {Promise} 返回上传结果的Promise
*/
syncUploadImage(filePath) {
return this.syncUploadFile(filePath);
}
/**
* 批量上传图片兼容旧版本
* @param {Array<string>} files - 图片路径数组
* @returns {Promise<Array>} 返回上传成功的URL数组
*/
uploadImages(files) {
return this.uploadFiles(files);
}
}
// 创建单例实例
const fileUploader = new FileUploader();
// 导出工具函数
module.exports = {
FileUploader,
fileUploader,
syncUploadFile: fileUploader.syncUploadFile.bind(fileUploader),
uploadFiles: fileUploader.uploadFiles.bind(fileUploader),
syncUploadImage: fileUploader.syncUploadImage.bind(fileUploader),
uploadImages: fileUploader.uploadImages.bind(fileUploader)
};

View File

@ -208,4 +208,13 @@ body.is-sapi {
}
.el-dialog.footer-center .el-dialog__footer{
text-align: center;
}
.el-tree-node{
&.is-current{
.el-select-dropdown__item{
color: rgb(32, 160, 255);
font-weight: bold;
}
}
}

View File

@ -84,7 +84,7 @@
<div v-else style="color: var(--el-color-info-light-3)"> </div>
</template>
</el-table-column>
<el-table-column label="工序部位" align="center" prop="workingPosition" />
<el-table-column label="工序部位" align="center" prop="workingPositionFull" />
<el-table-column label="验收描述" align="center" prop="intro" />
<el-table-column label="班组长" align="center">
<template #default="scope">
@ -135,7 +135,7 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['manage:projectChecked:edit']">修改</el-button>
v-hasPermi="['manage:projectChecked:edit']" v-if="scope.row.approveStatus==100">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['manage:projectChecked:remove']">删除</el-button>
</template>
@ -155,7 +155,7 @@
<image-upload v-model="form.imageUrls" :limit="3" />
</el-form-item>
<el-form-item label="工序部位" prop="workingPosition">
<el-tree-select ref="selTreePlan" v-model="form.workingPosition" :data="planOptions"
<el-tree-select ref="selTreePlan" v-model="form.workingPositionName" :data="planOptions"
:props="{ value: 'id', label: 'taskName', children: 'children' }" value-key="id" placeholder="请选择工程计划名称"
style="width: 100%" >
<template #default="{ data }">
@ -245,7 +245,6 @@ import useUserStore from "@/store/modules/user";
const { proxy } = getCurrentInstance();
const { project_checking_result, project_check_status, sys_is_del } = proxy.useDict('project_checking_result', 'project_check_status', 'sys_is_del');
const userStore = useUserStore();
const projectCheckedList = ref([]);
const open = ref(false);
@ -274,7 +273,7 @@ const data = reactive({
rules: {
projectId: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
imageUrls: [{ required: true, message: "验收图片不能为空", trigger: "change" }],
workingPosition: [{ required: true, message: "工序部位不能为空", trigger: "change" }],
workingPositionName: [{ required: true, message: "工序部位不能为空", trigger: "change" }],
intro: [{ required: true, message: "验收描述不能为空", trigger: "blur" }],
groupDeptUser: [{ required: true, message: "班组长不能为空", trigger: "change" }],
technicianUser: [{ required: true, message: "技术专员不能为空", trigger: "change" }],
@ -293,12 +292,11 @@ function getList() {
loading.value = true;
listProjectChecked(queryParams.value).then(response => {
projectCheckedList.value = (response.rows||[]).map(item=>{
if(item.checkResult){
item.appStatus=(item.checkResult==1 && item.approveStatus==100)?4:2
}else{
item.appStatus=1
}
item.appStatus=(item.checkResult==1 && (item.approveStatus==100 || item.approveStatus==4))?4: item.approveStatus
let taskInfo=proxy.$tryToJson(item.workingPosition,null);
item.workingPositionName=taskInfo.name||item.workingPosition;
item.workingPositionFull=taskInfo.full||item.workingPosition;
item.taskId=taskInfo.id;
return item;
});
total.value = response.total;
@ -385,7 +383,15 @@ function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getProjectChecked(_id).then(response => {
form.value = response.data;
let item= response.data;
let task=proxy.$tryToJson(item.workingPosition,null);
item.workingPositionName=task.name;
item.workingPositionFull=task.full;
item.taskId=task.id;
setTimeout(()=>{
proxy.$refs["selTreePlan"].setCurrentKey(task.id);
},1000)
form.value =item
open.value = true;
title.value = "修改项目举牌验收";
});
@ -393,6 +399,7 @@ function handleUpdate(row) {
/** 提交按钮 */
function submitForm() {
proxy.$refs["projectCheckedRef"].validate(valid => {
if (valid) {
if (form.value.groupDeptUser) {
@ -416,6 +423,13 @@ function submitForm() {
}
});
}
let task=proxy.$refs["selTreePlan"].getCurrentNode();
let taskInfo={
id:task.id,
name:task.taskName,
full:task.fullPath,
};
form.value.workingPosition=JSON.stringify(taskInfo);
if (form.value.id != null) {
updateProjectChecked(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
@ -423,7 +437,7 @@ function submitForm() {
getList();
});
} else {
form.value.approveStatus = "4";
form.value.approveStatus = "100";
addProjectChecked(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
@ -452,11 +466,12 @@ function handleExport() {
}, `projectChecked_${new Date().getTime()}.xlsx`)
}
function buildTree(all, id) {
function buildTree(all, id,path) {
let tmps = all.filter((d) => d.parentId == id);
if (tmps.length > 0) {
tmps.forEach((it) => {
it.children = buildTree(all, it.taskId);
it.fullPath = path ? path + "/" + it.taskName : it.taskName;
it.children = buildTree(all, it.taskId,it.fullPath);
});
}
return tmps;
@ -466,7 +481,7 @@ function buildTree(all, id) {
function initPlanDatas() {
if (userStore.currentPrjId) {
findCheckAllPlanDatas(userStore.currentPrjId).then((res) => {
let treeDatas = buildTree(res.data, 1);
let treeDatas = buildTree(res.data, 1,"");
planOptions.value = treeDatas;
});
}