diff --git a/pages/projectEnd/safeManage/riskRanking/addRiskRanking.vue b/pages/projectEnd/safeManage/riskRanking/addRiskRanking.vue index 152f7b65..61ef22a1 100644 --- a/pages/projectEnd/safeManage/riskRanking/addRiskRanking.vue +++ b/pages/projectEnd/safeManage/riskRanking/addRiskRanking.vue @@ -30,318 +30,259 @@ --> - - *检查部位: - - - 请选择 + @@ -425,14 +366,28 @@ - + + + + + + + + @@ -481,9 +436,11 @@ pageTitle: '新增检查', projectSn: '', checkType: 1, //分包商类型 1专业分包 6劳务分包 + form: { - regionId: "", // 检查部位 + regionIds: [], // 检查部位 regionName: "", + priorityNameDic: "", dangerItemContent: "", dangerItemId: "", dangerTypeId: "", @@ -491,15 +448,18 @@ remark: "", routineId: 0, level: "", + reviewNames: "", + verifyManNames: "", urgentLevel: "", inspectManId: "", - inspectTime: dateformat(new Date()), - enterpriseSn: "", + enterpriseIds: [], + inspectTime: "", + enterpriseSns: "", enterpriseName: "", changeLimitTime: "", changeId: "", - reviewId: "", - verifyManId: "", + reviewIds: [], + verifyManIds: [], notifyPerson: [], status: 2, // 现场整改状态 2未完成 5已完成 measurePoints: [], @@ -512,7 +472,9 @@ floor: '', //巡检楼层 addedDescription: '', //事件描述 taskId: '', //任务ID - itemId: '' // 任务子ID + itemId: '', // 任务子ID + dutyMajor: "", + rectifyAfterImage: "", }, checkPointList: [], //获取检查部位数据 checkPointName: '', @@ -561,6 +523,7 @@ subpackageLsit: [], //分包商数据列表 videoFileList: [], imgFileList: [], + rectifyAfterImageList: [], mapImgList: [], basicInfo: {}, selectIndex: null, @@ -580,6 +543,13 @@ type: '', // 问题描述 issuedata: "", + securityDangerList: [], + addForm1Rules: [], + priorityNameDicIndex: 0, + dangerItemList: [], // 问题等级二 + dutyMajorIndex: 0, + majorItemList: [], // 责任专业 + dangerReviewInfo: {}, regionPointList: [], sourceIdList: [], } @@ -594,26 +564,29 @@ // this.getReviewPeopleList(); // this.getPersonUpdateList(); this.getProgressListData() - console.log('lll', option.taskId, option.itemId) - this.taskId = option.taskId; - this.itemId = option.itemId; - this.form.taskId = option.taskId; - this.form.itemId = option.itemId; - if(option.regionPointList) { + console.log('lll', option, option.itemId) + this.taskId = option.taskId + this.itemId = option.itemId + this.form.taskId = option.taskId + this.form.itemId = option.itemId + if (option.regionPointList) { this.regionPointList = JSON.parse(option.regionPointList); - if(option.typeId == 1) { + if (option.typeId == 1) { this.radioChange('type2'); } } - if(option.sourceIdList) { + if (option.sourceIdList) { this.sourceIdList = JSON.parse(option.sourceIdList); - if(option.typeId == 1) { + if (option.typeId == 1) { this.radioChange('type2'); } } console.log(dateformat(new Date()), 777888) if (option.engineeringId) this.engineeringId = option.engineeringId if (option.type) this.type = Number(option.type) + this.getSecurityDangerFieldPage(); + this.getDicProjectTypeList(); + this.getXzSecurityDangerReviewVerifyList(); }, mounted() { var that = this @@ -626,13 +599,165 @@ }) console.log('this.mobileTopHeight', this.mobileTopHeight) }, + computed: { + dictionaryItemName() { + return (dataList, value, key, name) => { + const find = dataList.find( + (item) => item[key] == value + ); + return find ? find[name] : ""; + } + } + }, methods: { + getXzSecurityDangerReviewVerifyList() { + this.sendRequest({ + url: 'xmgl/xzSecurityDangerReviewVerify/getEffectiveConfig', + method: 'post', + data: { + sn: this.projectSn, + companyProjectType: 2, + }, + success: res => { + if (res.code == 200) { + const data = res.result; + this.dangerReviewInfo = { + ...data + }; + } + } + }) + }, // 取消 onNavigateBack() { uni.navigateBack({ delta: 1 }) }, + getDicProjectTypeList() { + this.sendRequest({ + url: 'xmgl/dictionaryItem/list', + method: 'get', + data: { + dictionaryEncoding: "xz_security_danger_item_record_priority_name_dic", + projectSn: this.projectSn, + }, + success: res => { + console.log(res.result) + if (res.code == 200) { + this.dangerItemList = res.result; + } + } + }) + this.sendRequest({ + url: 'xmgl/dictionaryItem/list', + method: 'get', + data: { + dictionaryEncoding: "xz_security_quality_inspection_record_duty_major", + projectSn: this.projectSn, + }, + success: res => { + console.log(res.result) + if (res.code == 200) { + this.majorItemList = res.result; + } + } + }) + }, + // 获取安全隐患 + getSecurityDangerFieldPage(recordType) { + this.sendRequest({ + url: 'xmgl/xzSecurityDangerField/getEffectiveConfig', + method: 'post', + data: { + pageNo: 1, + pageSize: -1, + sn: this.projectSn, + companyProjectType: 2, + recordType: recordType ? recordType : this.form.recordType, + }, + success: res => { + console.log(res.result) + if (res.code == 200) { + this.securityDangerList = res.result + .filter((item) => item.isEnabled == 1) + .sort((a, b) => a.sort - b.sort); + this.addForm1Rules = res.result + .filter((item) => item.isEnabled == 1 && item.isRequired == 1) + .map((item) => { + const tipName = item.displayFieldName ? + item.displayFieldName : + item.originalFieldName; + return { + required: true, + originalFieldName: item.originalFieldName, + fieldName: item.fieldName, + message: `${tipName}必填`, + trigger: "change", + } + }); + this.$nextTick(() => { + setTimeout(() => { + this.securityDangerListFn(this.form, this.form.recordType) + }, 800) + }) + } + } + }) + }, + getAllIds(tree, result = []) { + //遍历树 获取id数组 + for (const i in tree) { + result.push(tree[i]); // 遍历项目满足条件后的操作 + if (tree[i].children) { + //存在子节点就递归 + this.getAllIds(tree[i].children, result); + } + } + return result; + }, + securityDangerListFn(obj, recordType) { + this.securityDangerList.forEach((item) => { + if (!item.defaultDataType) return; + if (item.originalFieldName == "责任区域") { + this.$nextTick(() => { + const resultList = this.getAllIds(this.checkPointList); + obj[item.fieldName] = resultList.map(item => item.id); + console.log("责任区域", item.fieldName, resultList); + this.editCheckPointBtn(resultList, 1); + }); + } else if ( + item.originalFieldName == "问题等级" || + item.originalFieldName == "问题等级二" || + item.originalFieldName == "紧急程度" + ) { + obj[item.fieldName] = item.defaultDataType; + } else if (item.originalFieldName == "检查时间") { + let nowDate = dateformat(new Date()); + obj[item.fieldName] = nowDate; + } else if (item.originalFieldName == "分包单位") { + this.$nextTick(() => { + obj[item.fieldName] = this.subpackageLsit.map((item) => item.id); + console.log(item.fieldName, this.subpackageLsit) + this.checkedSubcontractListUp(); + }); + } else if (item.originalFieldName == "核验人") { + // 默认选择核验人逻辑 + let index = this.personList.findIndex((item) => { + return item.userId == this.userInfo.userId; + }); + if (index != -1) { + this.form.verifyManIds = [this.personList[index].userId]; + this.form.verifyManNames = this.personList[index].realName; + } else { + this.form.verifyManIds = [this.userInfo.userId]; + this.form.verifyManNames = this.userInfo.realName; + } + } else if (item.originalFieldName == "现场整改") { + obj[item.fieldName] = item.defaultDataType; + } + }); + }, // 筛选数据-问题描述 onClick() { if (this.issuedata.length > 0) { @@ -648,20 +773,39 @@ }, //获取复查人 getReviewPeopleList() { + let data = { + projectSn: this.projectSn, + // enterpriseTypeId: 7, + qualityRegionId: this.form.regionIds.join(','), + // qualityRegionBindType: 2, + // isSupervisingRoleName: 1 + } + if (this.dangerReviewInfo.enableReview == 1) { + data.roleName = this.dangerReviewInfo.reviewRoleName; + data.enterpriseId = this.unitEnterpriseId.join(","); + } this.sendRequest({ url: 'xmgl/systemUser/getProjectChilderSystemUserList', method: 'post', data: { - projectSn: this.projectSn, - // enterpriseTypeId: 7, - qualityRegionId: this.form.regionId, - qualityRegionBindType: 2, - isSupervisingRoleName: 1 + ...data, }, success: res => { console.log(res.result) if (res.result.length > 0) { this.reviewList = res.result; + const find = this.securityDangerList.find( + (item) => item.originalFieldName == "复查人" && item.defaultDataType + ); + console.log(find); + if (find) { + this.form[find.fieldName] = this.reviewList.map( + (item) => item.userId + ); + this.form.reviewNames = this.reviewList.map( + (item) => item.realName + ).join(','); + } } else { this.reviewList = []; } @@ -812,15 +956,17 @@ //获取检查部位 列表 getCheckPointList() { this.sendRequest({ - url: 'xmgl/qualityRegion/list', + url: 'xmgl/qualityRegion/tree/page', method: 'post', data: { projectSn: this.projectSn, - notSupervisingUnit: 1 + notSupervisingUnit: 1, + pageNo: 1, + pageSize: -1, }, success: res => { if (res.code == 200) { - this.checkPointList = res.result; + this.checkPointList = res.result.records; console.log('-----------', this.checkPointList) } } @@ -838,40 +984,136 @@ } }) }, + //确定选中--编辑回显 + editCheckPointBtn(val, type) { + console.log(val, 888999) + console.log(this.form, 101010) + // type==1 检查部位 ; 2 问题分类 3,通知人 + if (type == 1) { + this.form.enterpriseSns = ""; + this.form.enterpriseName = ""; + this.form.changeId = ""; + // console.log(val, type) + this.changePeopleIndex = null; + console.log(val); + this.form.regionIds = val.map(item => item.id); + let data = {}; + val.forEach((item) => { + data = { + ...item, + intendanceIds: data.intendanceIds ? + data.intendanceIds + "," + item.intendanceIds : item.intendanceIds, + intendanceNames: data.intendanceNames ? + data.intendanceNames + "," + item.intendanceNames : item.intendanceNames, + securityDutyIds: data.securityDutyIds ? + data.securityDutyIds + "," + item.securityDutyIds : item.securityDutyIds, + securityEnterpriseIds: data.securityEnterpriseIds ? + data.securityEnterpriseIds + "," + item.securityEnterpriseIds : item + .securityEnterpriseIds, + }; + }); + this.areaData = data; + console.log(val[0].parents) + const dataName = val.reduce((prev, item) => { + const arr = item.parents ? JSON.parse(JSON.stringify(item.parents)) : []; + arr.push({ + id: item.id, + regionName: item.regionName + }); + const regionName = arr.map(ele => ele.regionName).join("/"); + prev.push(regionName); + return prev + }, []); + this.checkPointName = dataName.join(','); + this.form.regionName = dataName.join(','); + + this.form.regionIds = val.map(item => item.id); + this.notifier = data.intendanceNames; + this.form.notifyPerson = data.intendanceIds; + // 重置检查部位 + this.dealFalseCheck(this.checkPointList); + this.$refs.locationTree._reTreeList(); + console.log(11223344, data) + if (data.securityEnterpriseIds) { + this.getSubpackageLsit(data.securityEnterpriseIds); + } else { + this.subpackageLsit = []; + } + + // 分包单位数据拿取 + // this.subpackageLsit = data.enterpriseInfos.reduce((prev, item) => { + // const findIndex = prev.findIndex((ele) => ele.id === item.id); + // if (findIndex == -1) { + // prev.push(item); + // } + // return prev; + // }, []); + this.personUpdateList = [] + this.reviewList = []; + this.reviewIndex = null + this.form.reviewIds = [] + // this.getReviewPeopleList() + } + + }, //确定选中--回显 checkPointBtn(val, type) { this.form.level = '' // type==1 检查部位 ; 2 问题分类 3,通知人 if (type == 1) { - this.form.enterpriseSn = ""; + this.form.enterpriseSns = ""; this.form.enterpriseName = ""; this.form.changeId = ""; // console.log(val, type) - this.changePeopleIndex = null - this.areaData = val[0]; - console.log(this.checkPointList, val, this.personList) - this.form.regionId = val[0].id; - let arr = JSON.parse(JSON.stringify(val[0].parents)); - let obj = { - id: val[0].id, - regionName: val[0].regionName - }; - arr.push(obj); - //获取选中的字符串 名称 - var regionName = arr.map(function(item, index) { - return item.regionName; - }).join("/"); - this.checkPointName = regionName; - this.form.regionName = regionName; + this.changePeopleIndex = null; + console.log(val); + let data = {}; + val.forEach((item) => { + console.log(item); + data = { + ...item, + intendanceIds: data.intendanceIds ? + data.intendanceIds + "," + item.intendanceIds : item.intendanceIds, + intendanceNames: data.intendanceNames ? + data.intendanceNames + "," + item.intendanceNames : item.intendanceNames, + securityDutyIds: data.securityDutyIds ? + data.securityDutyIds + "," + item.securityDutyIds : item.securityDutyIds, + securityEnterpriseIds: data.securityEnterpriseIds ? + data.securityEnterpriseIds + "," + item.securityEnterpriseIds : item + .securityEnterpriseIds, + }; + }); + console.log(222, data) + this.areaData = data; + console.log(this.checkPointList, data, this.personList) + this.form.regionIds = val.map(item => item.id); + console.log(val[0].parents) + const dataName = val.reduce((prev, item) => { + const arr = JSON.parse(JSON.stringify(item.parents)); + arr.push({ + id: item.id, + regionName: item.regionName + }); + const regionName = arr.map(ele => ele.regionName).join("/"); + prev.push(regionName); + return prev + }, []); + this.checkPointName = dataName.join(','); + this.form.regionName = dataName.join(','); this.form.changeId = val[0].dutyId; - this.notifier = val[0].intendanceNames; - this.form.notifyPerson = val[0].intendanceIds; + this.notifier = data.intendanceNames; + this.form.notifyPerson = data.intendanceIds; // 重置检查部位 this.dealFalseCheck(this.checkPointList); this.$refs.locationTree._reTreeList(); + console.log(data); // 分包单位数据拿取 - this.subpackageLsit = val[0].enterpriseInfos + if (data.securityEnterpriseIds) { + this.getSubpackageLsit(data.securityEnterpriseIds); + } else { + this.subpackageLsit = []; + } this.personUpdateList = [] // 整改人数据拿取 // this.personUpdateList = val[0].systemUsers @@ -882,8 +1124,8 @@ // }); this.reviewList = []; this.reviewIndex = null - this.form.reviewId = '' - this.getReviewPeopleList() + this.form.reviewIds = [] + // this.getReviewPeopleList() } else if (type == 2) { console.log('选择问题描述的数据', val); //设置问题描述 @@ -901,6 +1143,15 @@ .dangerName; this.form.dangerName = val[0].dangerName } + const find = this.securityDangerList.find( + (item) => + item.originalFieldName == "整改时限" && item.defaultDataType + ); + if (find) { + this.form.changeLimitTime = this.$dayjs() + .add(val[0].changeLimit, "day") + .format("YYYY-MM-DD HH:mm:ss"); + } } else if (type == 3) { console.log(val) this.notifier = val.map((item, index) => { @@ -909,6 +1160,18 @@ this.form.notifyPerson = val.map((item, index) => { return item.workerName }).join(',') + } else if (type == 4) { + console.log(val) + this.form.enterpriseIds = val.map(item => item.id); + this.checkedSubcontractListUp(val); + } else if (type == 5) { + console.log(val) + this.form.reviewIds = val.map(item => item.userId); + this.form.reviewNames = val.map(item => item.realName).join(','); + } else if (type == 6) { + console.log(val) + this.form.verifyManIds = val.map(item => item.userId); + this.form.verifyManNames = val.map(item => item.realName).join(','); } }, @@ -964,9 +1227,11 @@ this.form.floor = parseInt(input); // 或者 this.form.floor = parseInt(input); }, //获取分包公司 - getSubpackageLsit() { + getSubpackageLsit(securityEnterpriseIds) { let data = { // enterpriseTypeId: this.checkType, + enterpriseIds: securityEnterpriseIds ? + securityEnterpriseIds.split(",") : [], pageNo: 1, pageSize: 999, projectSn: this.projectSn, @@ -1018,34 +1283,48 @@ if (this.personList.length == 0) return; this.verifyManIndex = e.detail.value; this.form.verifyManId = this.personList[e.detail.value].userId; + } else if (type == 9) { + if (this.dangerItemList.length == 0) return; + this.priorityNameDicIndex = e.detail.value; + this.form.priorityNameDic = this.dangerItemList[e.detail.value].data; + } else if (type == 10) { + if (this.majorItemList.length == 0) return; + this.dutyMajorIndex = e.detail.value; + this.form.dutyMajor = this.majorItemList[e.detail.value].data; } - }, //获取人员列表--- 检查人、整改人、复查人、核验人、通知人 getPersonList() { + let data = { + projectSn: this.projectSn + } + if (this.dangerReviewInfo.enableVerify == 1) { + data.roleName = this.dangerReviewInfo.verifyRoleName; + data.enterpriseId = this.unitEnterpriseId.join(","); + } this.sendRequest({ url: 'xmgl/systemUser/getProjectChilderSystemUserList', method: 'post', data: { - projectSn: this.projectSn + ...data }, success: res => { console.log(res.result) if (res.result.length > 0) { console.log('检查人员列表', this.personList); this.personList = res.result; - let index = this.personList.findIndex(item => { - return item.userId == this.userInfo.userId; - }) - if (index != -1) { - this.verifyManIndex = index; - this.form.verifyManId = this.personList[index].userId; - } else { - this.defaultAuditPerson = this.userInfo.realName; - this.form.verifyManId = this.userInfo.userId; - } + // let index = this.personList.findIndex(item => { + // return item.userId == this.userInfo.userId; + // }) + // if (index != -1) { + // // this.verifyManIndex = index; + // this.form.verifyManIds = [this.personList[index].userId]; + // } else { + // // this.defaultAuditPerson = this.userInfo.realName; + // this.form.verifyManIds = [this.userInfo.userId]; + // } } else { this.personList = []; } @@ -1060,13 +1339,19 @@ method: 'post', data: { projectSn: this.projectSn, - enterpriseId: this.unitEnterpriseId + enterpriseId: this.unitEnterpriseId.join(','), + safeQualityRegionIdForDuty: this.form.regionIds.join(","), }, success: res => { console.log(res.result) if (res.result.length > 0) { console.log('检查人员列表', this.personList); this.personUpdateList = res.result; + this.personUpdateList.forEach((item, index) => { + if (item.userId == this.form.changeId) { + this.changePeopleIndex = index + } + }); } else { this.personUpdateList = []; } @@ -1075,11 +1360,41 @@ }, + checkedSubcontractListUp(val) { + const resultList = this.subpackageLsit.filter((item) => { + return this.form.enterpriseIds.includes(item.id); + }); + this.form.enterpriseSns = resultList + .map((item) => item.enterpriseSn) + .join(","); + this.form.enterpriseName = resultList + .map((item) => item.enterpriseName) + .join(","); + this.unitEnterpriseId = resultList.map((item) => item.id); + this.form.changeId = ""; + this.changePeopleIndex = null; + this.isShowPicker = false; + this.$nextTick(() => { + this.isShowPicker = true; + }); + this.getPersonUpdateList(); + this.getPersonList(); + this.getReviewPeopleList(); + // let newArr = []; + // if (this.areaData.systemUsers) { + // this.areaData.systemUsers.filter((item) => { + // if (item.userId && this.unitEnterpriseId.includes(item.enterpriseId)) { + // newArr.push(item); + // } + // }); + // this.personUpdateList = newArr; + // } + }, //选择的分包公司 checkSubpackage(val) { // if (this.checkType == 1) { - this.form.enterpriseSn = val.enterpriseSn; + this.form.enterpriseSns = val.enterpriseSn; this.form.enterpriseName = val.enterpriseName; this.unitEnterpriseId = val.id; this.form.changeId = ""; @@ -1099,7 +1414,7 @@ } // this.getPersonUpdateList(); // } else { - // this.form.enterpriseSn = val.enterpriseSn; + // this.form.enterpriseSns = val.enterpriseSns; // this.form.enterpriseName = val.enterpriseName; // } this.unitDialog = false; @@ -1111,7 +1426,7 @@ window.event.stopPropagation(); //type==1 分包单位 if (type == 1) { - this.form.enterpriseSn = ''; + this.form.enterpriseSns = ''; this.form.enterpriseName = ''; } }, @@ -1200,6 +1515,25 @@ }); } }) + } else if (type == 3) { + this.$chooseImage({ + count: 5 - that.rectifyAfterImageList.length, + success(res) { + const tempFilePaths = res.tempFilePaths; + uni.uploadFile({ + url: that.url_config + 'upload/image', //仅为示例,非真实的接口地址 + filePath: tempFilePaths[0], + name: 'files', + success: (uploadFileRes) => { + let data = { + name: JSON.parse(uploadFileRes.data).data[0].filename, + url: JSON.parse(uploadFileRes.data).data[0].imageUrl + }; + that.rectifyAfterImageList.push(data) + } + }); + } + }) } else { this.$chooseImage({ count: 1 - that.mapImgList.length, @@ -1248,6 +1582,14 @@ } }) that.videoFileList = fileArr; + } else if (type == 3) { + let fileArr = JSON.parse(JSON.stringify(that.rectifyAfterImageList)); + fileArr.forEach((item, index) => { + if (item.url == val.url) { + fileArr.splice(index, 1) + } + }) + that.rectifyAfterImageList = fileArr; } } else if (res.cancel) { @@ -1286,7 +1628,7 @@ //查看视频 playVideo(url, type) { uni.navigateTo({ - url: '/pages/projectEnd/carWashManage/mediaPlay?url=' + url + '&type=' + type + url: '../carWashManage/mediaPlay?url=' + url + '&type=' + type }) }, //预览图片 @@ -1300,7 +1642,8 @@ //新增保存 async addSaveBtn() { let arr = [], - arr2 = []; + arr2 = [], + arr3 = []; this.videoFileList.forEach(item => { @@ -1309,100 +1652,52 @@ this.imgFileList.forEach(item => { arr2.push(item.name + "*" + this.url_config + 'image/' + item.url) }) + this.rectifyAfterImageList.forEach(item => { + arr3.push(item.name + "*" + this.url_config + 'image/' + item.url) + }) + // this.form.fileUrl = this.videoFileList.length>0?JSON.stringify(this.videoFileList):''; // this.form.imageUrl = this.imgFileList.length>0?JSON.stringify(this.imgFileList):''; this.form.fileUrl = arr.join(',') this.form.imageUrl = arr2.join(',') - let data = JSON.parse(JSON.stringify(this.form)); - if (!data.regionId) { - uni.showToast({ - title: '请选择检查部位', - icon: 'none' - }) - return - } - if (!data.dangerItemContent && this.typeCheck == "type1") { - uni.showToast({ - title: '请选择问题描述', - icon: 'none' - }) - return - } else if (!data.dangerItemContent) { - uni.showToast({ - title: '请选择排查分类', - icon: 'none' - }) - return - } - if (!data.dangerTypeId && this.typeCheck == "type1") { - uni.showToast({ - title: '请选择问题分类', - icon: 'none' - }) - return - } - // if (data.inspectManId == '') { - // uni.showToast({ - // title: '请选择检查人', - // icon: 'none' - // }) - // return - // } - if (!data.inspectTime) { - uni.showToast({ - title: '请选择检查时间', - icon: 'none' - }) - return - } - if (!data.enterpriseName) { - uni.showToast({ - title: '请选择分包单位', - icon: 'none' - }) - return - } - if (!data.changeLimitTime && this.typeCheck == "type1") { - uni.showToast({ - title: '请选择整改时限', - icon: 'none' - }) - return - } - if (!data.changeId && this.typeCheck == "type1") { - uni.showToast({ - title: '请选择整改人', - icon: 'none' - }) - return - } - if (!data.reviewId && this.typeCheck == "type1") { - uni.showToast({ - title: '请选择复查人', - icon: 'none' - }) - return - } - if (!data.verifyManId && this.typeCheck == "type1") { - uni.showToast({ - title: '请选择核查人', - icon: 'none' - }) - return + this.form.rectifyAfterImage = arr3.join(',') + let data = { + ...this.form, + regionIds: this.form.regionIds.join(","), + enterpriseIds: this.form.enterpriseIds.join(","), + reviewIds: this.form.reviewIds.join(","), + verifyManIds: this.form.verifyManIds.join(","), + level: this.form.level == 0 ? Number(this.form.level) + 1 : this.form.level, + urgentLevel: this.form.urgentLevel == 0 ? Number(this.form.urgentLevel) + 1 : this.form + .urgentLevel, + dangerItemContent: this.issueName, }; - data.level = data.level == 0 ? Number(data.level) + 1 : data.level; - data.urgentLevel = data.urgentLevel == 0 ? Number(data.urgentLevel) + 1 : data.urgentLevel; + const every = this.addForm1Rules.every(item => { + if (!data[item.fieldName] || Array.isArray(this.form[item.fieldName]) && this.form[ + item.fieldName].length == 0) { + if (item.originalFieldName == '责任专业' || item.originalFieldName == '整改后图片') { + if (this.form.status == 5) { + uni.showToast({ + title: item.message, + icon: 'none' + }) + return false + } + return true + } + uni.showToast({ + title: item.message, + icon: 'none' + }) + return false + } + return true + }) + console.log(333344, every) + if (!every) return data.projectSn = this.projectSn; data.inspectManId = this.userInfo.userId data.creatorId = this.userInfo.userId - data.dangerItemContent = this.issueName; - if(this.regionPointList.length > 0){ - data.regionPointList = this.regionPointList; - } - if(this.sourceIdList.length > 0) { - data.sourceIdList = this.sourceIdList; - } - if (this.engineeringId) data.engineeringId = this.engineeringId if (this.type) data.type = this.type let pointArr = [] @@ -1419,7 +1714,7 @@ console.log(data); // 安全问题 this.sendRequest({ - url: 'xmgl/xzSecurityQualityInspectionRecord/addSecurityRecords', + url: 'xmgl/xzSecurityQualityInspectionRecord/add', method: 'post', data: data, success: (res) => { @@ -1446,39 +1741,18 @@ console.log(this.itemId); // 排查记录 let data2 = { - dangerDesc: data.dangerDesc, - dangerItemContent: this.issueName, - dangerItemId: data.dangerItemId, - dangerTypeId: data.dangerTypeId, - enterpriseName: data.enterpriseName, - enterpriseSn: data.enterpriseSn, - fileUrl: data.fileUrl, - imageUrl: data.imageUrl, - inspectManId: data.inspectManId, - inspectTime: data.inspectTime, - projectSn: data.projectSn, + ...data, recordType: 2, - regionId: data.regionId, - regionName: data.regionName, routineInspect: 0, - subsectionId: data.subsectionId, //分部工程 - subentryId: data.subentryId, //分项工程 - floor: data.floor, //巡检楼层 - addedDescription: data.addedDescription, //事件描述 taskId: this.taskId || null, // 任务ID itemId: this.itemId || null, // 任务子ID } - if(this.regionPointList.length > 0){ - data2.regionPointList = this.regionPointList; - } - if(this.sourceIdList.length > 0) { - data2.sourceIdList = this.sourceIdList; - } + if (this.engineeringId) data2.engineeringId = this.engineeringId if (this.type) data2.type = this.type console.log(data.taskId); await this.sendRequest({ - url: 'xmgl/xzSecurityQualityInspectionRecord/addSecurityRecords', + url: 'xmgl/xzSecurityQualityInspectionRecord/add', method: 'post', data: data2, success: (res) => { @@ -1487,11 +1761,11 @@ uni.showToast({ title: '保存成功' }) - // setTimeout(() => { - // uni.navigateBack({ - // delta: 1 - // }) - // }, 1200) + setTimeout(() => { + uni.navigateBack({ + delta: 1 + }) + }, 1200) } else { uni.showToast({ title: res.message, @@ -1511,37 +1785,49 @@ console.log('切换tab', this.form); // 重制内容 this.form = { - regionId: "", // 检查部位 + regionIds: [], // 检查部位 regionName: "", + priorityNameDic: "", dangerItemContent: "", dangerItemId: "", dangerTypeId: "", dangerDesc: "", remark: "", routineId: 0, - level: 0, - urgentLevel: 0, + level: "", + reviewNames: "", + verifyManNames: "", + urgentLevel: "", inspectManId: "", - inspectTime: dateformat(new Date()), - enterpriseSn: "", + enterpriseIds: [], + inspectTime: "", + enterpriseSns: "", enterpriseName: "", changeLimitTime: "", changeId: "", - reviewId: "", - verifyManId: "", + reviewIds: [], + verifyManIds: [], notifyPerson: [], status: 2, // 现场整改状态 2未完成 5已完成 measurePoints: [], imageUrl: "", fileUrl: "", + rectifyAfterImage: "", recordType: 1, - // taskId:'', - // itemId:'' + dangerName: '', + subsectionId: '', //分部工程 + subentryId: '', //分项工程 + floor: '', //巡检楼层 + addedDescription: '', //事件描述 + taskId: '', //任务ID + itemId: '', // 任务子ID + dutyMajor: "", }; this.issueName = '' this.checkPointName = "" this.videoFileList = []; this.imgFileList = []; + this.rectifyAfterImageList = []; this.subsectionIndex = -1 this.subentryIndex = -1 this.changePeopleIndex = null @@ -1552,13 +1838,17 @@ let index = this.personList.findIndex(item => { return item.userId == this.userInfo.userId; }) - if (index != -1) { - this.verifyManIndex = index; - this.form.verifyManId = this.personList[index].userId; - } else { - this.defaultAuditPerson = this.userInfo.realName; - this.form.verifyManId = this.userInfo.userId; + if (value) { + this.form.recordType = value == 'type1' ? 1 : 2; + this.getSecurityDangerFieldPage(); } + // if (index != -1) { + // this.verifyManIndex = index; + // this.form.verifyManId = this.personList[index].userId; + // } else { + // this.defaultAuditPerson = this.userInfo.realName; + // this.form.verifyManId = this.userInfo.userId; + // } } } } @@ -1573,7 +1863,7 @@ width: 100%; position: fixed; bottom: 0; - + >view { width: 50%; height: 76rpx; @@ -1583,19 +1873,20 @@ align-items: center; justify-content: center; } - + >view:first-child { background-color: rgba(81, 129, 246, 0.1); border-radius: 6rpx 0rpx 0rpx 6rpx; color: #5181F6; } - + >view:last-child { background-color: #5181F6; border-radius: 0rpx 6rpx 6rpx 0rpx; color: #FFFFFF; } } + .fixedheader { position: fixed; top: 0; @@ -1689,7 +1980,7 @@ .type .name { margin-right: 6px; - width: 176rpx; + width: 204rpx; text-align: right; font-size: 28rpx; color: #808080; @@ -1723,7 +2014,7 @@ padding: 0px 30rpx; box-sizing: border-box; border-radius: 10rpx; - width: calc(100% - 182rpx); + width: calc(100% - 204rpx); height: 68rpx; } @@ -1732,7 +2023,7 @@ border: 2rpx solid rgba(42, 43, 91, 0.3); box-sizing: border-box; border-radius: 10rpx; - width: calc(100% - 182rpx); + width: calc(100% - 204rpx); @@ -1750,7 +2041,7 @@ } } } - + /deep/ .uni-easyinput__placeholder-class { font-size: 28rpx; color: #A2A4AF; @@ -1762,7 +2053,7 @@ .textarea { // width: calc(79% - 32px); - width: calc(100% - 182rpx); + width: calc(100% - 204rpx); border-radius: 10rpx; border: 2rpx solid rgba(42, 43, 91, 0.3); padding: 16rpx 28rpx; @@ -1780,7 +2071,7 @@ height: 35px; color: #000; } - + .uni-input { font-size: 28rpx; } @@ -1805,13 +2096,13 @@ display: inline-flex; position: relative; border-radius: 8rpx; - + .img { width: 100%; height: 100%; border-radius: 8rpx; } - + .deleteImg { position: absolute; right: -20rpx; @@ -1822,7 +2113,7 @@ background-image: url('@/static/workTicketManage/index-icon9.png'); background-repeat: no-repeat; background-size: 100% 100%; - + } } @@ -1837,7 +2128,7 @@ align-items: center; justify-content: center; font-size: 24rpx; - + .icon-add { width: 40rpx; height: 40rpx; @@ -1969,7 +2260,7 @@ border-radius: 10rpx; // width: 67%; padding-left: 20rpx; - width: calc(100% - 182rpx); + width: calc(100% - 204rpx); font-size: 28rpx; height: 68rpx; line-height: 68rpx; diff --git a/pages/projectEnd/safeManage/riskRanking/oldaddRiskRanking.vue b/pages/projectEnd/safeManage/riskRanking/oldaddRiskRanking.vue new file mode 100644 index 00000000..c1a171c2 --- /dev/null +++ b/pages/projectEnd/safeManage/riskRanking/oldaddRiskRanking.vue @@ -0,0 +1,1978 @@ + + + + + \ No newline at end of file