From ec75545ed1be0b5835b98d641f7369c4290eaa32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Fri, 1 Sep 2023 02:28:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/app.json | 9 +- miniprogram/app.wxss | 8 + .../project_checkDetection/add/index.js | 355 ++++++++++++++++++ .../project_checkDetection/add/index.json | 6 + .../project_checkDetection/add/index.wxml | 129 +++++++ .../project_checkDetection/add/index.wxss | 7 + .../project_checkDetection/check/index.js | 323 ++++++++++++++++ .../project_checkDetection/check/index.json | 4 + .../project_checkDetection/check/index.wxml | 126 +++++++ .../project_checkDetection/check/index.wxss | 23 ++ .../project_checkDetection/info/index.js | 190 ++++++++++ .../project_checkDetection/info/index.json | 4 + .../project_checkDetection/info/index.wxml | 139 +++++++ .../project_checkDetection/info/index.wxss | 23 ++ .../project_checkDetection/list/index.js | 201 ++++++++++ .../project_checkDetection/list/index.json | 8 + .../project_checkDetection/list/index.wxml | 63 ++++ .../project_checkDetection/list/index.wxss | 1 + .../pageage/project_materialSeal/add/index.js | 332 ++++++++++++++++ .../project_materialSeal/add/index.json | 12 + .../project_materialSeal/add/index.wxml | 130 +++++++ .../project_materialSeal/add/index.wxss | 46 +++ .../project_materialSeal/info/index.js | 288 ++++++++++++++ .../project_materialSeal/info/index.json | 7 + .../project_materialSeal/info/index.wxml | 117 ++++++ .../project_materialSeal/info/index.wxss | 23 ++ .../project_materialSeal/list/index.js | 139 +++++++ .../project_materialSeal/list/index.json | 7 + .../project_materialSeal/list/index.wxml | 60 +++ .../project_materialSeal/list/index.wxss | 1 + .../pageage/project_measure/add/index.js | 1 + .../pageage/project_measure/add/index.wxml | 2 +- .../quality/add/index.js | 4 +- .../security/add/index.js | 4 +- .../pageage/project_special/add/index.js | 4 +- .../pageage/project_special/add/index.wxml | 4 +- .../pageage/project_train/add/index.wxml | 4 +- .../pageage/samplingRetesting/index.wxml | 5 +- .../components/file-uploader-all/index.wxml | 2 +- miniprogram/pages/login/login.wxml | 4 +- miniprogram/pages/login/login.wxss | 10 + .../pages/xiangmugaikuang/xiangmugaikuang.js | 18 +- 42 files changed, 2818 insertions(+), 25 deletions(-) create mode 100644 miniprogram/pageage/project_checkDetection/add/index.js create mode 100644 miniprogram/pageage/project_checkDetection/add/index.json create mode 100644 miniprogram/pageage/project_checkDetection/add/index.wxml create mode 100644 miniprogram/pageage/project_checkDetection/add/index.wxss create mode 100644 miniprogram/pageage/project_checkDetection/check/index.js create mode 100644 miniprogram/pageage/project_checkDetection/check/index.json create mode 100644 miniprogram/pageage/project_checkDetection/check/index.wxml create mode 100644 miniprogram/pageage/project_checkDetection/check/index.wxss create mode 100644 miniprogram/pageage/project_checkDetection/info/index.js create mode 100644 miniprogram/pageage/project_checkDetection/info/index.json create mode 100644 miniprogram/pageage/project_checkDetection/info/index.wxml create mode 100644 miniprogram/pageage/project_checkDetection/info/index.wxss create mode 100644 miniprogram/pageage/project_checkDetection/list/index.js create mode 100644 miniprogram/pageage/project_checkDetection/list/index.json create mode 100644 miniprogram/pageage/project_checkDetection/list/index.wxml create mode 100644 miniprogram/pageage/project_checkDetection/list/index.wxss create mode 100644 miniprogram/pageage/project_materialSeal/add/index.js create mode 100644 miniprogram/pageage/project_materialSeal/add/index.json create mode 100644 miniprogram/pageage/project_materialSeal/add/index.wxml create mode 100644 miniprogram/pageage/project_materialSeal/add/index.wxss create mode 100644 miniprogram/pageage/project_materialSeal/info/index.js create mode 100644 miniprogram/pageage/project_materialSeal/info/index.json create mode 100644 miniprogram/pageage/project_materialSeal/info/index.wxml create mode 100644 miniprogram/pageage/project_materialSeal/info/index.wxss create mode 100644 miniprogram/pageage/project_materialSeal/list/index.js create mode 100644 miniprogram/pageage/project_materialSeal/list/index.json create mode 100644 miniprogram/pageage/project_materialSeal/list/index.wxml create mode 100644 miniprogram/pageage/project_materialSeal/list/index.wxss diff --git a/miniprogram/app.json b/miniprogram/app.json index a25a8fe..9b98116 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -96,7 +96,14 @@ "project_special/info/index", "project_measure/list/index", "project_measure/add/index", - "project_measure/info/index" + "project_measure/info/index", + "project_materialSeal/list/index", + "project_materialSeal/add/index", + "project_materialSeal/info/index", + "project_checkDetection/list/index", + "project_checkDetection/add/index", + "project_checkDetection/info/index", + "project_checkDetection/check/index" ], "independent": false } diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss index d3dd732..ef7571a 100644 --- a/miniprogram/app.wxss +++ b/miniprogram/app.wxss @@ -1499,6 +1499,14 @@ swiper-item video{ margin-bottom: 15rpx; margin-left: -3rpx; } +.code_label_2{ + font-size: 0.6rem; + width: 120rpx; + margin: auto; + text-align: center; + padding: 0.1rem; + border-radius: 0.5rem 0 0.5rem 0; +} .code_label_green{ background: green; color: #FFFFFF; diff --git a/miniprogram/pageage/project_checkDetection/add/index.js b/miniprogram/pageage/project_checkDetection/add/index.js new file mode 100644 index 0000000..55c2b9e --- /dev/null +++ b/miniprogram/pageage/project_checkDetection/add/index.js @@ -0,0 +1,355 @@ +// pageage/safetyManagement/addSafetyInspect/index.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + maxDate:new Date(2088,1,1).getTime(), + currentDate:new Date().getTime(), + deptId:"", + projectId:"", + projectName:"", + loginName:"", + rectifierData:[], + loadShow:false, + checkTypeList:[], + checkType:"1", + materialName:"", + usePosition:"", + sampleNum:"", + qualifiedFlag:"Y", + witnessUser:"", + witnessUserName:"", + checkTime:"", + laboratoryName:"", + qualifiedFlagList:[{id:'Y',text:"是"},{id:'N',text:"否"}] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + let {projectId,projectName} = options + //获取缓存数据 + wx.getStorage({ + key: 'userinfo', + success:res=>{ + this.setData({ + projectId, + projectName, + deptId:res.data.deptId, + loginName:res.data.loginName, + }) + this.getAllProjectUserData(); + this.getTypeList(); + } + }) + }, + + //查询项目人员数据 + getAllProjectUserData(){ + let that = this + wx.request({ + url: app.globalData.reqUrl+'/wechat/projectuserinfo/list', + method:"get", + data:{ + 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 + }) + } + } + }) + }, + + getTypeList(){ + let that = this + wx.request({ + url: app.globalData.reqUrl+'/wechat/projectDetection/queryType', + method:"get", + data:{}, + header:{ + 'content-type': 'application/x-www-form-urlencoded' + }, + success(res){ + res = res.data + if(res.code == 200){ + let list=[]; + res.data.forEach(it =>{ + list.push({"id":it.dictValue,"text":it.dictLabel}); + }) + that.setData({ + checkTypeList:list + }) + } + } + }) + }, + + //材料名称 + onInputMaterialNameValue(e){ + let materialName = e.detail.value + this.setData({ + materialName + }) + }, + + //使用部位 + onInputUsePositionValue(e){ + let usePosition = e.detail.value + this.setData({ + usePosition + }) + }, + //取样数量 + onInputSampleNumValue(e){ + let sampleNum = e.detail.value + this.setData({ + sampleNum + }) + }, + //送检实验室名称 + onInputLaboratoryNameValue(e){ + let laboratoryName = e.detail.value + this.setData({ + laboratoryName + }) + }, + + //验收时间 + onInputTime(e){ + let checkTime = e.detail + this.setData({ + checkTime + }) + }, + + //添加抄送人 + onAddSend(e){ + if(e.detail.length>0){ + let phoneNumbers=""; + let userNames=""; + e.detail.forEach(it =>{ + phoneNumbers+=","+it.phoneNumber; + userNames+=","+it.userName; + }); + this.setData({ + witnessUserName:userNames.substring(1), + witnessUser:phoneNumbers.substring(1) + }) + }else{ + this.setData({ + witnessUser:"", + witnessUserName:"" + }) + } + }, + + //取消页面 + cancelSaveView(){ + this.returnToPage() + }, + + //保存 + onSubmitSave(){ + this.setData({ + loadShow:true + }) + let that = this + let {projectId,deptId,checkType, + materialName, + usePosition, + sampleNum, + qualifiedFlag, + witnessUser, + witnessUserName, + checkTime, + laboratoryName,loginName} = that.data; + //数据效验 + if(projectId==""||loginName==""||deptId==""){ + app.toast("数据异常,请刷新页面重试!") + that.setData({ + loadShow:false + }) + return; + } + if(checkType==""){ + app.toast("请选择送检类型!") + that.setData({ + loadShow:false + }) + return; + } + if(materialName==""){ + app.toast("请填写材料名称!") + that.setData({ + loadShow:false + }) + return; + } + if(sampleNum==""){ + app.toast("请填写取样数量!") + that.setData({ + loadShow:false + }) + return; + } + if(usePosition==""){ + app.toast("请填写使用部位!") + that.setData({ + loadShow:false + }) + return; + } + if(qualifiedFlag==""){ + app.toast("请选择是否提供合格证!") + that.setData({ + loadShow:false + }) + return; + } + if(qualifiedFlag==""){ + app.toast("请选择是否提供合格证!") + that.setData({ + loadShow:false + }) + return; + } + if(witnessUser==""||witnessUserName==""){ + app.toast("请选择见证人!") + that.setData({ + loadShow:false + }) + return; + } + if(checkTime==""){ + app.toast("请选择送检时间!") + that.setData({ + loadShow:false + }) + return; + } + if(laboratoryName==""){ + app.toast("请填写送检实验室名称!") + that.setData({ + loadShow:false + }) + return; + } + let params = { + projectId, + deptId, + checkType, + materialName, + usePosition, + sampleNum, + qualifiedFlag, + witnessUser, + witnessUserName, + checkTime:checkTime+":00", + laboratoryName, + createBy:loginName + } + wx.request({ + url: app.globalData.reqUrl + '/wechat/projectDetection/add', + method:"POST", + data:params, + header: { + "Username": loginName, + "Content-Type": "application/json" + }, + success(res){ + that.setData({ + loadShow:false + }) + res = res.data + if(res.code == 200){ + app.toast("添加成功!") + setTimeout(()=>{ + wx.redirectTo({ + url: '../list/index', + }) + },200) + } + } + }) + }, + + //选择检测类型 + onSelectCheckType(e){ + this.setData({ + checkType:e.detail.id + }) + }, + //选择是否提供合格证 + onSelectQualifiedFlag(e){ + this.setData({ + qualified:e.detail.id + }) + }, + + 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_checkDetection/add/index.json b/miniprogram/pageage/project_checkDetection/add/index.json new file mode 100644 index 0000000..aeb0384 --- /dev/null +++ b/miniprogram/pageage/project_checkDetection/add/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "van-overlay": "@vant/weapp/overlay/index" + }, + "navigationStyle":"custom" +} \ No newline at end of file diff --git a/miniprogram/pageage/project_checkDetection/add/index.wxml b/miniprogram/pageage/project_checkDetection/add/index.wxml new file mode 100644 index 0000000..47405ef --- /dev/null +++ b/miniprogram/pageage/project_checkDetection/add/index.wxml @@ -0,0 +1,129 @@ + + + + + + + + + 新增取样复试 + + + + + + + + {{projectName}} + + + 送检类型 + + + + + + 材料名称 + + + + + + 取样数量 + + + + + + 使用部位 + +