From 6cc3be56ce6f0063cc7c2e674430644861edf818 Mon Sep 17 00:00:00 2001 From: duxp Date: Thu, 31 Aug 2023 11:12:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../approvalForm/approvalForm.js | 96 ++++++++++++++++++- .../approvalForm/approvalForm.wxml | 31 ++++-- .../approvalForm/approvalForm.wxss | 19 +++- .../pages/approvalWarning/approvalWarning.js | 6 +- 4 files changed, 140 insertions(+), 12 deletions(-) diff --git a/miniprogram/pages/approvalWarning/approvalForm/approvalForm.js b/miniprogram/pages/approvalWarning/approvalForm/approvalForm.js index fece3ce..3c03797 100644 --- a/miniprogram/pages/approvalWarning/approvalForm/approvalForm.js +++ b/miniprogram/pages/approvalWarning/approvalForm/approvalForm.js @@ -1,5 +1,6 @@ // pages/approvalWarning/approvalForm/approvalForm.js -import {base_url} from '../../../utils/http' +import {base_url} from '../../../utils/http'; +import {API} from "../../../utils/api"; Page({ /** @@ -8,7 +9,12 @@ Page({ data: { //父组件数据 fData:null, - fileList:[] + fileList:[], + submit_form:{ + nowScore:'', + remark:'' + }, + scoreMsg:'' }, /** @@ -59,6 +65,92 @@ Page({ } }, + //公共输入方法 + handlePublicInput(e){ + let _type = e.currentTarget.dataset.type; + switch (_type) { + case "score": + let _tips = e.detail?'':'请输入评定分数'; + this.setData({ + 'submit_form.nowScore':e.detail, + scoreMsg:_tips + }) + break; + case "remark": + this.setData({ + 'submit_form.remark':e.detail + }) + break; + } + }, + + //审核 + handleApproval(){ + let _this = this; + if(!_this.data.submit_form.nowScore){ + _this.setData({ + scoreMsg:'请输入评定分数' + }); + return false; + }else{ + _this.setData({ + scoreMsg:'' + }) + } + API.reviewedSave({ + id:_this.data.fData.id, + reviewer:_this.data.fData.reviewer, + nowScore:_this.data.submit_form.nowScore, + remark:_this.data.submit_form.remark + }).then(res => { + if(res.code === 0){ + wx.showToast({ + title:'审核成功!', + duration:1500 + }); + setTimeout(function () { + wx.navigateBack(); + },1500) + }else{ + wx.showToast({ + title:res.msg, + duration:1500 + }); + } + }) + }, + + //驳回 + handleOverrule(){ + let _this = this; + wx.showModal({ + title: '温馨提示', + content: '是否驳回?', + success (res) { + if (res.confirm) { + API.reback({ + id:_this.data.fData.id + }).then(res => { + if(res.code === 0){ + wx.showToast({ + title:'驳回成功!', + duration:1500 + }); + setTimeout(function () { + wx.navigateBack(); + },1500) + }else{ + wx.showToast({ + title:res.msg, + duration:1500 + }); + } + }) + } + } + }) + }, + /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/miniprogram/pages/approvalWarning/approvalForm/approvalForm.wxml b/miniprogram/pages/approvalWarning/approvalForm/approvalForm.wxml index 0af562a..af55adc 100644 --- a/miniprogram/pages/approvalWarning/approvalForm/approvalForm.wxml +++ b/miniprogram/pages/approvalWarning/approvalForm/approvalForm.wxml @@ -7,7 +7,7 @@ 附件信息 - + + 暂无数据 审批 + + + + 审批人:{{fData.reviewer || '暂无'}} + + 审批 + 驳回 + diff --git a/miniprogram/pages/approvalWarning/approvalForm/approvalForm.wxss b/miniprogram/pages/approvalWarning/approvalForm/approvalForm.wxss index 7ca678f..9872eaf 100644 --- a/miniprogram/pages/approvalWarning/approvalForm/approvalForm.wxss +++ b/miniprogram/pages/approvalWarning/approvalForm/approvalForm.wxss @@ -16,7 +16,7 @@ } .public_content{ box-sizing: border-box; - padding: 5px 10px; + padding: 10px; background-color: #fff; border-radius: 8px; margin-top: 10px; @@ -35,4 +35,21 @@ text-decoration: underline; color: #5199ff; font-size: 30rpx; +} +.footer_wrap{ + color: #8d8d8d; + font-size: 30rpx; + margin-top: 5px; +} +.submit_btn{ + width: 100%; + text-align: center; + margin-top: 20px; +} +.no_data{ + width: 100%; + color: #8d8d8d; + font-size: 30rpx; + text-align: center; + margin-top: 10px; } \ No newline at end of file diff --git a/miniprogram/pages/approvalWarning/approvalWarning.js b/miniprogram/pages/approvalWarning/approvalWarning.js index 6f2edc0..57221e8 100644 --- a/miniprogram/pages/approvalWarning/approvalWarning.js +++ b/miniprogram/pages/approvalWarning/approvalWarning.js @@ -22,8 +22,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - this.loadListData(); - this.loadPersonData(); + }, //人员查询 @@ -141,7 +140,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - + this.loadListData(); + this.loadPersonData(); }, /**