From fb531d17bafc89ca6327af634a030f076c61db84 Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Tue, 26 Nov 2024 11:51:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E7=99=BB=E8=AE=B0=20?= =?UTF-8?q?=E6=96=B0=E9=97=AE=E9=A2=98=20=E6=8F=90=E7=A4=BA=E8=AF=AD=20?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=8C=BA=E5=9F=9F=20=E8=A7=A6=E5=BA=95?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/apply/subPages/BS/safeCheckSignDIY.vue | 136 +++++++++++++------ services/apply/subPages/BS/safeCheck.js | 26 +++- 2 files changed, 116 insertions(+), 46 deletions(-) diff --git a/pages/apply/subPages/BS/safeCheckSignDIY.vue b/pages/apply/subPages/BS/safeCheckSignDIY.vue index a17e4e9..abda2cf 100644 --- a/pages/apply/subPages/BS/safeCheckSignDIY.vue +++ b/pages/apply/subPages/BS/safeCheckSignDIY.vue @@ -92,7 +92,8 @@ + @search="handleShowSheet" @select="handleSelected" @close="selectorInfo.showPopup=false" + :total="selectorInfo.totalCount" /> @@ -117,8 +118,8 @@ AddCheckRecord, CheckTypeOrderPaged, CheckTypeLevelOrderPaged, - OrderPagedAreaMineType, - CheckProjectOrderPaged, + OrderPagedAreaMineType2, + CheckProjectOrderPaged2, OrderPagedProjectCategory, OrderPagedSafeCheckDetail, OrderPagedSuitAll, @@ -193,6 +194,7 @@ }, selectorInfo: { + totalCount: 0, showPopup: false, isMultiple: false, title: '隐患原因', @@ -209,6 +211,12 @@ showPopup: false, showDelModalIndex: undefined, rules: { + 'RiskAreaNAME': { + type: 'string', + required: true, + trigger: ['blur', 'change'], + message: '请选择检查区域' + }, 'CHECKOBJECT_DESCRIPTION': { type: 'string', required: true, @@ -217,7 +225,8 @@ 'CHECKCONTENT': { type: 'string', required: true, - trigger: ['blur', 'change'] + trigger: ['blur', 'change'], + message: '请填写检查内容' } }, } @@ -295,44 +304,70 @@ const ele = this.$refs if (this.model.Nav_ListCheckDetail == null || this.model.Nav_ListCheckDetail.length < 1) { uni.$showErrorInfo('请新增检查信息后再提交'); - } else if (this.model.Nav_ListCheckDetail[0].DESCREPTION == '' || this.model.Nav_ListCheckDetail[0] - .DEMAND == '') { - uni.$showErrorInfo('请完善检查信息'); - } else { - ele['wForm'].validate().then(res => { - this.model.Nav_ListCheckDetail.forEach(e => { - e.Nav_CheckProject = null; - e.Nav_CheckProjectCategory = null - if (e.Nav_ListCheckDetailReason != null && e.Nav_ListCheckDetailReason.length > - 0) { - e.Nav_ListCheckDetailReason.forEach(ec => { - ec.Nav_RiskReason = null - }) - } - }) - AddCheckRecord(this.model).then(res => { - - uni.$showMsgFunc('操作成功!', () => { - var linkToUrl = 'safeCheckSign?tableKey=' + this.tableKey + - '&ID=' + this.model.ID + '&taskID=' + this.TaskID //Url 传参 - uni.navigateTo({ - url: linkToUrl - }) - }, 'success', 1000) - }) - }).catch(err => { - console.log('校验失败', err) - }) } + // else if (this.model.Nav_ListCheckDetail[0].DESCREPTION == '' || this.model.Nav_ListCheckDetail[0] + // .DEMAND == '') { + // uni.$showErrorInfo('请完善检查信息'); + // } + var isOK = true + this.model.Nav_ListCheckDetail.forEach(e => { + if (!e.Nav_CheckProject.NAME || e.Nav_CheckProject.NAME.length < 1) { + uni.$showErrorInfo('请选择检查项目' + e.ROW_NO) + isOK = false + } else if (!e.DESCREPTION || e.DESCREPTION.length < 1) { + uni.$showErrorInfo('请填写检查问题描述' + e.ROW_NO) + isOK = false + } else if (!e.DEMAND || e.DEMAND.length < 1) { + uni.$showErrorInfo('请填写整改建议与措施' + e.ROW_NO) + isOK = false + } else if (!e.QUESTION_LEVEL_SHOW || e.QUESTION_LEVEL_SHOW.length < 1) { + uni.$showErrorInfo('请选择问题等级' + e.ROW_NO) + isOK = false + } else if (!e.ADDRESS || e.ADDRESS.length < 1) { + uni.$showErrorInfo('请填写隐患地点' + e.ROW_NO) + isOK = false + } + }) + if (!isOK) + return false + ele['wForm'].validate().then(res => { + this.model.Nav_ListCheckDetail.forEach(e => { + e.Nav_CheckProject = null; + e.Nav_CheckProjectCategory = null + if (e.Nav_ListCheckDetailReason != null && e.Nav_ListCheckDetailReason.length > + 0) { + e.Nav_ListCheckDetailReason.forEach(ec => { + ec.Nav_RiskReason = null + }) + } + }) + AddCheckRecord(this.model).then(res => { + + uni.$showMsgFunc('操作成功!', () => { + var linkToUrl = 'safeCheckSign?tableKey=' + this.tableKey + + '&ID=' + this.model.ID + '&taskID=' + this.TaskID //Url 传参 + uni.navigateTo({ + url: linkToUrl + }) + }, 'success', 1000) + }) + }).catch(err => { + if (err.length > 0) { + uni.$showErrorInfo(err[0].message) + } else { + uni.$showErrorInfo('校验失败!') + } + }) }, // 下拉数据加载 - async handleShowSheet(p) { + async handleShowSheet(p, pageIndex) { if (p.name == undefined) { // 搜索 var val = p p = this.selectorInfo p.val = val + p.pageIndex = pageIndex } const orgId = uni.getStorageSync('orgId') @@ -345,6 +380,11 @@ if (p.val) { extendRule(json, 'NAME', 9, p.val); } + json.Limit = 20 + if (p.pageIndex) { + json.Start = (p.pageIndex - 1) * json.Limit; + json.PageIndex = p.pageIndex + } // this.selectorInfo.isMultiple = true json.FilterGroup.Groups.push({ 'IsAnd': false, @@ -356,14 +396,15 @@ }) json.Sort = 'NAME' // extendRule(json, 'CHECKOBJECT', 1, this.model.CHECKOBJECT); - dataSelect = await OrderPagedAreaMineType(json).then(res => { - if (res != undefined && res.length > 0) { - for (let i = 0; i < res.length; i++) { - res[i].name = res[i].NAME + dataSelect = await OrderPagedAreaMineType2(json).then(res => { + this.selectorInfo.totalCount = res.TotalCount + if (res != undefined && res.Data.length > 0) { + for (let i = 0; i < res.Data.length; i++) { + res.Data[i].name = res.Data[i].NAME // res[i].code = res[i].CODE } } - return res + return res.Data }) } else if (p.name == 'CheckProjectNAME') { this.selectorInfo.isMultiple = false @@ -372,14 +413,20 @@ if (p.val) { extendRule(json, 'NAME', 9, p.val); } - dataSelect = await CheckProjectOrderPaged(json).then(res => { - if (res != undefined && res.length > 0) { - for (let i = 0; i < res.length; i++) { - res[i].name = res[i].NAME, - res[i].code = res[i].CODE + json.Limit = 20 + if (p.pageIndex) { + json.Start = (p.pageIndex - 1) * json.Limit; + json.PageIndex = p.pageIndex + } + dataSelect = await CheckProjectOrderPaged2(json).then(res => { + this.selectorInfo.totalCount = res.TotalCount + if (res != undefined && res.Data.length > 0) { + for (let i = 0; i < res.Data.length; i++) { + res.Data[i].name = res.Data[i].NAME + res.Data[i].code = res.Data[i].CODE } } - return res + return res.Data }) } else if (p.name == 'CheckProjectCategoryNAME') { if (this.model.CHECKOBJECT == null || this.model.CHECKOBJECT.length < 1) { @@ -431,6 +478,7 @@ defaultChecked = [] if (dataSelect.length) { this.selectorInfo = { + totalCount: this.selectorInfo.totalCount, itemData: p.itemData, isMultiple: this.selectorInfo.isMultiple, showPopup: true, diff --git a/services/apply/subPages/BS/safeCheck.js b/services/apply/subPages/BS/safeCheck.js index 14fdfb2..ce7fc68 100644 --- a/services/apply/subPages/BS/safeCheck.js +++ b/services/apply/subPages/BS/safeCheck.js @@ -235,6 +235,17 @@ export function OrderPagedAreaMineType(params) { }) }) } +export function OrderPagedAreaMineType2(params) { + return new Promise((resolve, reject) => { + request.post("/BS/BSSafeCheck/OrderPagedAreaMineType", params).then((result) => { + if (result.IsSuccessful) { + resolve(result); + } + }).catch((error) => { + reject(error) + }) + }) +} //获取检查项目 export function CheckProjectOrderPaged(params) { @@ -248,6 +259,17 @@ export function CheckProjectOrderPaged(params) { }) }) } +export function CheckProjectOrderPaged2(params) { + return new Promise((resolve, reject) => { + request.post("/BS/BSCheckProject/OrderPagedSTATUS", params).then((result) => { + if (result.IsSuccessful) { + resolve(result); + } + }).catch((error) => { + reject(error) + }) + }) +} //获取检查项目分类 export function OrderPagedProjectCategory(params) { @@ -291,7 +313,7 @@ export function OrderPagedSuitAll(params) { //检查任务制定 获取检查依据 export function LawOrderPaged(params) { return new Promise((resolve, reject) => { - request.post("/SC/StandardCreate/OrderPaged", params).then((result) => {///LR/Law/OrderPaged + request.post("/SC/StandardCreate/OrderPaged", params).then((result) => { ///LR/Law/OrderPaged if (result.IsSuccessful) { resolve(result.Data); } @@ -325,4 +347,4 @@ export function AddCheckRecord(params) { reject(error) }) }) -} +} \ No newline at end of file