diff --git a/miniprogram/api/projectFunVerify.js b/miniprogram/api/projectFunVerify.js new file mode 100644 index 0000000..362ec66 --- /dev/null +++ b/miniprogram/api/projectFunVerify.js @@ -0,0 +1,55 @@ +import { + request +} from '../utils/request' + +// 查询工程功能检验列表 +export function listProjectFunVerify(data,pageNum,pageSize) { + return request({ + url: '/wechat/projectFunVerify/list?pageNum='+pageNum+'pageSize'+pageSize, + method: 'get', + data: data + }) +} + +// 统计工程功能检验 +export function findGroupCountByApprove(data) { + return request({ + url: '/wechat/projectFunVerify/findGroupCountByApprove', + method: 'get', + data: data + }) +} + +// 查询工程功能检验详细 +export function getProjectFunVerify(id) { + return request({ + url: '/wechat/projectFunVerify/info/' + id, + method: 'get' + }) +} + +// 新增工程功能检验 +export function addProjectFunVerify(data) { + return request({ + url: '/wechat/projectFunVerify/add', + method: 'post', + data: data + }) +} + +// 修改工程功能检验 +export function updateProjectFunVerify(data) { + return request({ + url: '/wechat/projectFunVerify/edit', + method: 'post', + data: data + }) +} + +// 删除工程功能检验 +export function delProjectFunVerify(id) { + return request({ + url: '/wechat/projectFunVerify/remove/' + id, + method: 'get' + }) +} \ No newline at end of file diff --git a/miniprogram/api/publics.js b/miniprogram/api/publics.js index a58078d..3e3bee4 100644 --- a/miniprogram/api/publics.js +++ b/miniprogram/api/publics.js @@ -64,4 +64,13 @@ export function getDictCache(type){ url: '/wechat/publics/v1/getDictCache/'+type, method: 'get' }) -} \ No newline at end of file +} + +// 获取审批流程信息 +export function selectProjectAuditinfoList(data){ + return request({ + url: '/wechat/projectAuditinfo/selectProjectAuditinfo', + method: 'get', + data:data + }) +} diff --git a/miniprogram/app.js b/miniprogram/app.js index de68e76..b47fde9 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -34,7 +34,7 @@ App({ reqUrl:'https://szgcwx.jhncidg.com', //reqUrl:'http://127.0.0.1:8091', uploadUrl:"https://szgcwx.jhncidg.com/wechat", - //uploadUrl:'http://127.0.0.1:8082/wechat', + //uploadUrl:'http://127.0.0.1:8091/wechat', //御景路数字化集成管控平台接口访问域名 szhUrl:'https://szh.makalu.cc', diff --git a/miniprogram/app.json b/miniprogram/app.json index 356651c..fef7706 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -31,7 +31,8 @@ "pages/project_approve/approveCheckDetection/index", "pages/project_approve/approveChecking/index", "pages/project_approve/approveMaterialSeal/index", - "pages/project_approve/approveMeasure/index" + "pages/project_approve/approveMeasure/index", + "pages/project_approve/approveFunVerify/index" ], "subpackages": [ { @@ -68,6 +69,10 @@ "project_checking/list/index", "project_checking/edit/index", "project_checking/info/index", + "project_funVerify/add/index", + "project_funVerify/list/index", + "project_funVerify/edit/index", + "project_funVerify/info/index", "project_problemmodify/security/list/index", "project_problemmodify/security/info/index", "project_problemmodify/security/modify/index", @@ -148,7 +153,7 @@ "voucher-date": "pages/components/voucher-date/index", "voucher-datetime": "pages/components/voucher-datetime/index", "file-uploader": "pages/components/file-uploader/index", - "file-uploader-all":"pages/components/file-uploader-all/index", + "file-uploader-all": "pages/components/file-uploader-all/index", "project-select": "pages/components/project-select/index", "safety-pie-chart": "./newComponents/safety-pie-chart/index", "safety-pie-charts": "./newComponents/safety-pie-charts/index", @@ -163,7 +168,7 @@ "van-dropdown-menu": "@vant/weapp/dropdown-menu/index", "van-dropdown-item": "@vant/weapp/dropdown-item/index", "curve-echarts": "pages/components/curve-echarts/index", - "user-infos":"pages/components/user-infos/index" + "user-infos": "pages/components/user-infos/index" }, "window": { "backgroundTextStyle": "light", diff --git a/miniprogram/pageage/project_funVerify/add/index.js b/miniprogram/pageage/project_funVerify/add/index.js new file mode 100644 index 0000000..70a89ec --- /dev/null +++ b/miniprogram/pageage/project_funVerify/add/index.js @@ -0,0 +1,408 @@ +import { + syncFileUpload +} from '../../../utils/request' +import { + getDictCache +} from '../../../api/publics' +import { + addProjectFunVerify +} from '../../../api/projectFunVerify' +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + maxDate: new Date(2088, 1, 1).getTime(), + minDate: new Date(2001, 1, 1).getTime(), + deptId: "", + projectId: "", + projectName: "", + loginName: "", + userName: "", + rectifierData: [], + rectifierData2: [], + imageInfoData: [], + checkingResult: "1", + //验收时间 + checkTime: '', + qualityUser: "", + qualityUserName: "", + superviseUser: "", + superviseUserName: "", + checkName: "", + intro: "", + checkType: "1", + dataTypeList: [], + list: [{ + id: 1, + text: "合格" + }, { + id: 2, + text: "不合格" + }], + flowNodes: [{ + text: '开始' + }, { + text: '提交申请' + }, { + text: '监理审批' + }, { + text: '结束' + }], + limit: 999, + active: 0, + checkFiles: "", + fileType: ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "png", "jpg", "jpeg"] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + let { + projectId, + projectName + } = options + //获取缓存数据 + wx.getStorage({ + key: 'userinfo', + success: res => { + this.setData({ + projectId, + projectName, + deptId: res.data.deptId, + loginName: res.data.loginName, + userName: res.data.nickName + }) + this.getProjectUserData(); + this.getDataTypeList(); + } + }) + }, + + //查询项目人员数据 + getProjectUserData() { + let that = this + wx.request({ + url: app.globalData.reqUrl + '/wechat/projectuserinfo/selectProjectUnitUser', + method: "get", + data: { + unitType: "4", + projectId: that.data.projectId + }, + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, + success(res) { + res = res.data + if (res.code == 200) { + that.setData({ + rectifierData: res.data, + }) + } + } + }) + + wx.request({ + url: app.globalData.reqUrl + '/wechat/projectuserinfo/selectProjectUnitUser', + method: "get", + data: { + unitType: "2", + projectId: that.data.projectId + }, + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, + success(res) { + res = res.data + if (res.code == 200) { + that.setData({ + rectifierData2: res.data, + }) + } + } + }) + }, + + //查询验收类型数据 + getDataTypeList() { + getDictCache('project_fun_verify_type').then(res => { + if (res.code == 200) { + let list = []; + res.data.forEach(item =>{ + list.push({id:item.dictValue,text:item.dictLabel}); + }); + this.setData({ + dataTypeList: list + }) + } + }); + }, + + //切换验收结果 + onSelectType(e) { + this.setData({ + checkingResult: e.detail.id + }) + }, + + //验收类型 + onSelectType(e) { + this.setData({ + checkType: e.detail.id + }) + }, + + //工序部位 + onInputCheckName(e) { + this.setData({ + checkName: e.detail.value + }) + }, + //验收描述 + onInputIntroValue(e) { + let intro = e.detail.value + this.setData({ + intro + }) + }, + + //验收时间 + onInputTime(e) { + let checkTime = e.detail + this.setData({ + checkTime + }) + }, + + // list 上传图片 + onImagesArr(e) { + var data = this.data.imageInfoData + data = e.detail + this.setData({ + imageInfoData: data + }) + }, + + //添加质量专员 + onAddQualityUser(e) { + if (e.detail.length > 0) { + this.setData({ + qualityUser: e.detail[0].phoneNumber, + qualityUserName: e.detail[0].userName + }) + } + }, + + //添加监理专员 + onAddSuperviseUser(e) { + if (e.detail.length > 0) { + this.setData({ + superviseUser: e.detail[0].phoneNumber, + superviseUserName: e.detail[0].userName + }) + } + }, + + //取消页面 + cancelSaveView() { + this.returnToPage() + }, + + //保存 + onProblemSubmitSave() { + let that = this + let { + projectId, + deptId, + qualityUser, + qualityUserName, + superviseUser, + superviseUserName, + checkName, + intro, + checkTime, + checkingResult, + imageInfoData, + loginName, + checkType, + checkFiles + } = that.data; + //数据效验 + if (projectId == "" || deptId == "") { + app.toast("数据异常,请刷新页面重试!") + return; + } + if (imageInfoData.length == 0) { + app.toast("请上传检验报告!") + return; + } + if (checkType == "") { + app.toast("请选择检验类型!") + return; + } + if (qualityUser == "" || qualityUserName == "") { + app.toast("请选择质量专员!") + return; + } + if (superviseUser == "" || superviseUserName == "") { + app.toast("请选择监理专员!") + return; + } + if (checkName == "") { + app.toast("请填写检验名称!") + return; + } + if (checkTime == "") { + app.toast("请选择检验时间!") + return; + } + if (intro == "") { + app.toast("请填写检验描述!") + return; + } + // if(checkingResult==""){ + // app.toast("请选择验收结果!") + // that.setData({ + // loadShow:false + // }) + // return; + // } + if (checkFiles.length > 0) { + for (let i = 0; i < checkFiles.length; i++) { + let _fileType = checkFiles[i].path.split('.'); + _fileType = _fileType[_fileType.length - 1].toLowerCase(); + //判断附件类型,如果是图片直接展示,非图片则显示附件 + if (that.data.fileType.indexOf(_fileType) == -1) { + app.toast("当前 [ " + _fileType + " ] 文件不支持上传!") + return; + } + } + } + let _images = []; + let _files = []; + imageInfoData.forEach(item => { + syncFileUpload(item).then(res => { + _images.push(res.fileName); + //验证图片上传完毕 + if (_images.length == imageInfoData.length) { + let params = { + projectId, + deptId: deptId, + qualityUser, + qualityUserName, + superviseUser, + superviseUserName, + checkType, + checkName, + checkDate: checkTime, + intro, + //checkResult:checkingResult, + approveStatus: "1", + createBy: loginName, + imageUrls: _images.toString() + } + if (checkFiles.length > 0) { + checkFiles.forEach(file => { + syncFileUpload(file.path).then(res => { + _files.push(res.fileName); + if (checkFiles.length == _files.length) { + params.checkFiles = _files.toString(); + that.submitForm(params); + } + }); + }); + } else { + that.submitForm(params); + } + } + }); + }) + }, + + /** + * 提交表单 + * @param {*} params + */ + submitForm(params) { + addProjectFunVerify(params).then(res => { + if (res.code == 200) { + app.toast("新增工程功能检验成功!") + setTimeout(() => { + wx.redirectTo({ + url: '../list/index', + }) + }, 300) + } + }); + }, + + /** + * 相关附件上传 + * @param {*} options + */ + otherFileUpload(options) { + let file = options.detail; + this.setData({ + checkFiles: file + }); + }, + + returnToPage: function () { + /*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/ + wx.redirectTo({ + url: '../list/index', + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram/pageage/project_funVerify/add/index.json b/miniprogram/pageage/project_funVerify/add/index.json new file mode 100644 index 0000000..9003141 --- /dev/null +++ b/miniprogram/pageage/project_funVerify/add/index.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "van-steps": "@vant/weapp/steps/index", + "van-overlay": "@vant/weapp/overlay/index" + }, + "navigationStyle":"custom", + "navigationBarTitleText": "新增工程功能检验" +} \ No newline at end of file diff --git a/miniprogram/pageage/project_funVerify/add/index.wxml b/miniprogram/pageage/project_funVerify/add/index.wxml new file mode 100644 index 0000000..9657ad5 --- /dev/null +++ b/miniprogram/pageage/project_funVerify/add/index.wxml @@ -0,0 +1,83 @@ + + + + + + + + + + + 新增工程功能检验 + + + + + + + + + {{projectName}} + + + 检验报告 + + + + + + 检验类型 + + + + + + 检验名称 + + + + + + 质量专员 + + + + + + + 监理专员 + + + + + + + 检验时间 + + + + + + 检验描述 + +