diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectCheckedMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectCheckedMapper.xml
index 99c34a35..06226bc7 100644
--- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectCheckedMapper.xml
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectCheckedMapper.xml
@@ -55,8 +55,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and ppc.working_position_type = #{workingPositionType}
- and approve_status=100 and check_result=1
- and not (approve_status=100 and check_result=1)
+ and approve_status in (4,100) and check_result=1
+ and not (approve_status in (4,100) and check_result=1)
and ppc.check_result = #{checkResult}
@@ -67,8 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and ppc.is_del = #{isDel}
and ppc.approve_status = #{approveStatus}
- and not (ppc.approve_status = '100' and ppc.check_result = '1')
- and ppc.approve_status = '100' and ppc.check_result = '1'
+ and not (ppc.approve_status in (4,100) and ppc.check_result = '1')
+ and ppc.approve_status in (4,100) and ppc.check_result = '1'
and ppc.checking_date BETWEEN
diff --git a/yanzhu-ui-app/miniprogram/api/project.js b/yanzhu-ui-app/miniprogram/api/project.js
index ae3d648f..4fc3dd1e 100644
--- a/yanzhu-ui-app/miniprogram/api/project.js
+++ b/yanzhu-ui-app/miniprogram/api/project.js
@@ -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'
+ })
}
diff --git a/yanzhu-ui-app/miniprogram/config.js b/yanzhu-ui-app/miniprogram/config.js
index 49db8652..a8d9c73d 100644
--- a/yanzhu-ui-app/miniprogram/config.js
+++ b/yanzhu-ui-app/miniprogram/config.js
@@ -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: [
diff --git a/yanzhu-ui-app/miniprogram/images/svg/edit.svg b/yanzhu-ui-app/miniprogram/images/svg/edit.svg
new file mode 100644
index 00000000..eae568bc
--- /dev/null
+++ b/yanzhu-ui-app/miniprogram/images/svg/edit.svg
@@ -0,0 +1,14 @@
+
\ No newline at end of file
diff --git a/yanzhu-ui-app/miniprogram/pageage/project_checked/add/index.js b/yanzhu-ui-app/miniprogram/pageage/project_checked/add/index.js
index e232a628..80e50b85 100644
--- a/yanzhu-ui-app/miniprogram/pageage/project_checked/add/index.js
+++ b/yanzhu-ui-app/miniprogram/pageage/project_checked/add/index.js
@@ -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);
+ },
+
});
diff --git a/yanzhu-ui-app/miniprogram/pageage/project_checked/add/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_checked/add/index.wxml
index fb243780..87ca061f 100644
--- a/yanzhu-ui-app/miniprogram/pageage/project_checked/add/index.wxml
+++ b/yanzhu-ui-app/miniprogram/pageage/project_checked/add/index.wxml
@@ -14,32 +14,16 @@
-
-
+
+
分包单位
{{ projectUserInfo.subDeptName }}
工程部位
-
+
@@ -50,125 +34,54 @@
-
+
- 技术专员
+
-
-
-
-
- 选择工程计划
-
-
-
-
-
-
-
-
-
-
-
+ 技术专员
+
+
- 监理员
-
-
-
-
-
- 选择工程计划
-
-
-
-
-
-
-
-
-
-
-
+ 监理员
+
结果描述
-
+
验收时间
-
+
验收照片
-
+
取消
- 确认
+ 确认
-
+
\ No newline at end of file
diff --git a/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.js b/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.js
index f71997ed..fa96c570 100644
--- a/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.js
+++ b/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.js
@@ -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() {
+
+ }
})
\ No newline at end of file
diff --git a/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.json b/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.json
index 3928faa4..965b8e80 100644
--- a/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.json
+++ b/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.json
@@ -1,3 +1,4 @@
{
- "usingComponents": {}
+ "usingComponents": {},
+ "navigationStyle": "custom"
}
\ No newline at end of file
diff --git a/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.wxml
index b4c1d93e..fe4f64cd 100644
--- a/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.wxml
+++ b/yanzhu-ui-app/miniprogram/pageage/project_checked/info/index.wxml
@@ -1,2 +1,17 @@
-
-pageage/project_checked/info/index.wxml
\ No newline at end of file
+
+
+
+
\ No newline at end of file
diff --git a/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.js b/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.js
index 2f4127ae..32cb31fc 100644
--- a/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.js
+++ b/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.js
@@ -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 () {
diff --git a/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.less b/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.less
new file mode 100644
index 00000000..782c2aef
--- /dev/null
+++ b/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.less
@@ -0,0 +1,10 @@
+.project_checked_list {
+ .inspect_for_bgd {
+ position: relative;
+
+ .edit-icon {
+ position: absolute;
+ right: 40rpx;
+ }
+ }
+}
\ No newline at end of file
diff --git a/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.wxml b/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.wxml
index 199c5ce0..38ff514d 100644
--- a/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.wxml
+++ b/yanzhu-ui-app/miniprogram/pageage/project_checked/list/index.wxml
@@ -1,132 +1,82 @@
-