diff --git a/pages/mbwa/mbwa.vue b/pages/mbwa/mbwa.vue index eb57510..57aa1fb 100644 --- a/pages/mbwa/mbwa.vue +++ b/pages/mbwa/mbwa.vue @@ -10,180 +10,137 @@ --> - + " @handleClick="handleChangeSelect(item.id)"> - + - + {{ index + 1 }} {{ item.template.title || "-" }} - + : item.errorStatus === 2 + ? '#139942' + : '', + }"> {{ - item.extendObj.errorStatus === 0 + item.errorStatus === 0 ? "待处理" - : item.extendObj.errorStatus === 1 - ? "处理中" - : item.extendObj.errorStatus === 2 - ? "已处理" - : "" - }} + : item.errorStatus === 1 + ? "处理中" + : item.errorStatus === 2 + ? "已处理" + : "" + }} - {{ item.extendObj.uploadResult || "-" }} + {{ item.uploadResult || "-" }} - {{ - item.extendObj.errorStatus === 2 - ? "" - : item.extendObj.situation === 0 - ? "正常情况" - : item.extendObj.situation === 1 + {{ + item.errorStatus === 2 + ? "" + : item.situation === 0 + ? "正常情况" + : item.situation === 1 ? "急需处理" : "-" - }} + }} - {{ item.userName || "-" }} + {{ item.userName || "-" }} - {{ - item.createdAt - ? $moment(item.createdAt).format("YYYY-MM-DD HH:mm:ss") - : "-" - }} + {{ + item.createdAt + ? $moment(item.createdAt).format("YYYY-MM-DD HH:mm:ss") + : "-" + }} - + {{ item.template.title || "-" }} - + : item.errorStatus === 2 + ? '#139942' + : '', + }"> {{ - item.extendObj.errorStatus === 0 + item.errorStatus === 0 ? "待处理" - : item.extendObj.errorStatus === 1 - ? "处理中" - : item.extendObj.errorStatus === 2 - ? "已处理" - : "" + : item.errorStatus === 1 + ? "处理中" + : item.errorStatus === 2 + ? "已处理" + : "" }} - {{ - item.extendObj.situation === 0 - ? "正常情况" - : item.extendObj.situation === 1 + }">{{ + item.situation === 0 + ? "正常情况" + : item.situation === 1 ? "急需处理" : "-" - }} + }} {{ - item.extendObj.uploadResult || "-" + item.uploadResult || "-" }} @@ -275,12 +232,12 @@ export default { handleGoDetail(obj) { console.log("obj", obj); // 判断是否是异常的 - if (obj.extendObj.situation === 1) { + if (obj.situation === 1) { this.$util.toNextRoute( "navigateTo", `/pages/walkAroundManager/detail?id=${obj.id}&pageType=error` ); - } else if (obj.extendObj.situation === 0) { + } else if (obj.situation === 0) { // 正常的 查看详情 this.$util.toNextRoute( "navigateTo", @@ -328,40 +285,40 @@ export default { title: "加载中...", }); const req = { - serverPartId: undefined, - startTime: undefined, - endTime: undefined, - page: this.PageIndex, + // serverPartId: 0, + startTime: "", + endTime: "", + pageNum: this.PageIndex, pageSize: 10, // serverPartId: this.selectServiceList[this.selectIndex].value, // startTime: `${this.searchTime} 00:00:00`, // endTime: `${this.searchTime} 23:59:59`, extend: this.selectFilter === 1 - ? undefined + ? null : this.selectFilter === 2 - ? [ + ? [ { key: "situation", value: 0, }, ] - : this.selectFilter === 3 - ? [ - { - key: "situation", - value: 1, - }, - ] - : this.selectFilter === 4 - ? [ - { - key: "person.STAFF_NAME", - value: this.useInfo.userData.UserName, - // this.useInfo.userData.UserId - }, - ] - : undefined, + : this.selectFilter === 3 + ? [ + { + key: "situation", + value: 1, + }, + ] + : this.selectFilter === 4 + ? [ + { + key: "person.STAFF_NAME", + value: this.useInfo.userData.UserName, + // this.useInfo.userData.UserId + }, + ] + : null, // any: // this.selectFilter === 4 @@ -383,23 +340,24 @@ export default { }; console.log("req", req); - const data = await this.$request.$webNodePOST( - `questionnaire-responses/search/many`, + const data = await this.$request.$webJavaPOST( + `questionnaire-responses/getList`, req ); - let list = data.data; + console.log("datadatadatadata", data); + let list = data.Result_Data.List; if (list && list.length > 0) { if (list.length < 10) { this.isEnd = true; } - list.forEach((item) => { - let extendObj = {}; - if (item.extend) { - extendObj = JSON.parse(item.extend); - } - item.extendObj = extendObj; - }); + // list.forEach((item) => { + // let extendObj = {}; + // if (item.extend) { + // extendObj = JSON.parse(item.extend); + // } + // item.extendObj = extendObj; + // }); } else { this.isEnd = true; } diff --git a/pages/walkAroundManager/detail.vue b/pages/walkAroundManager/detail.vue index 196e28d..923b302 100644 --- a/pages/walkAroundManager/detail.vue +++ b/pages/walkAroundManager/detail.vue @@ -1,43 +1,35 @@ - + {{ detailObj.template.title || "-" }} - {{ - extendObj.situation === 0 - ? "正常情况" - : extendObj.situation === 1 + }">{{ + extendObj.situation === 0 + ? "正常情况" + : extendObj.situation === 1 ? "急需处理" : "-" - }} + }} - + - - {{ item.question.title - }}* + + {{ item.question.title + }}* - - - {{ subItem || "" }} + + + {{ subItem || "" }} @@ -215,15 +172,8 @@ /> --> - - + + {{ subItem.text || "" }} + @@ -360,75 +286,93 @@ extendObj.errorStatus === 0 || feedbackStatus === 1 ? "指派" : extendObj.errorStatus === 1 || feedbackStatus === 2 - ? "反馈" - : "" + ? "反馈" + : "" }} - - 异常处理人* + + 异常处理人* - - - - {{ item.STAFF_NAME || "" }} + + + + {{ item.STAFF_NAME || "" }} - {{ extendObj.person.MEMBERSHIP_NAME || "" }} + {{ extendObj.personMemberShipName || "" }} + + + + + + 更换指派人 - + 整改意见* - + {{ extendObj.suggestion || "" }} - + + + {{ item.isChecked[0] || "" + }}* + + + + + + + + + + + + + + + + + + + + + + + - + 反馈结果* - + {{ extendObj.feedbackContent || "-" @@ -495,24 +430,41 @@ - 确定 + 确定 - + 确定 + + + + + + + 更换异常处理人* + + + + + {{ item.STAFF_NAME || "" }} + + + + + + + 确定 + + + + + @@ -526,16 +478,11 @@ - + {{ detailObj.template.title || "-" }} - 巡查时间:{{ + 巡查时间:{{ detailObj.createdAt ? $moment(detailObj.createdAt).format("YYYY-MM-DD HH:mm:ss") : "-" @@ -552,39 +499,25 @@ - + *巡查内容 - + - + {{ tags.question.title || "" }} * - + {{ tag }} @@ -606,60 +539,34 @@ - - + + *现场图片 - - + + - + - + - + {{ item.name }} @@ -680,13 +587,8 @@ - + {{ selectPersonIndex === -1 ? "--请选择处理人--" @@ -702,31 +604,20 @@ - + *整改意见 - + - + 提交 @@ -737,44 +628,22 @@ - - + + *反馈图片 - - × - + + × + - + + @@ -788,30 +657,19 @@ - + *反馈内容 - + - + 提交 @@ -869,6 +727,9 @@ export default { feedbackStatus: 0, // 回显的状态 1 为 管理员选整改的人 2 为反馈 isManager: false, // 判断是否出现指派按钮 isFeedback: false, // 判断是否为反馈人 + + canChangePerson: false,// 判断是否可以更换指派人 + showChangePopup: false }; }, components: { @@ -892,16 +753,62 @@ export default { } }, methods: { + // 更换指派人的实际方法 + async handleChangePersonConfirm() { + let newPerson = { + ...this.selectPersonObj, + personIsChecked: this.extendObj.personIsChecked + } + let newExtendObj = JSON.parse(JSON.stringify(this.extendObj)) + newExtendObj.person = newPerson + + console.log('newExtendObj', newExtendObj); + + + const data = await this.$request.$webJavaPOST( + `questionnaire-responses/update`, + { + id: this.detailObj.id, + extend: JSON.stringify(newExtendObj) + } + ) + + if (data.Result_Code === 100) { + uni.showToast({ + title: "修改成功!", + icon: "success", + }); + setTimeout(() => { + uni.navigateBack({ + delta: 1, + }); + }, 1000); + } else { + uni.showToast({ + title: data.Result_Desc, + icon: "none", + }); + } + }, // 回显内容 handleShowPopup(value) { this.isShowPopup = true; this.feedbackStatus = value; - console.log("this.feedbackStatus", this.feedbackStatus); + // 里面的 suggestTime 就是上一次选择处理人的时间 + // 选择判断一下 当前时间 跟 这个时间 是否在天数上已经不是同一天了 那么就可以重新选择人 + // let nowTime = this.$util.cutDate(new Date(), "YYYY-MM-DD") + let nowTime = '2025-04-23' + let suggestTime = this.$util.cutDate(this.extendObj.suggestTime, "YYYY-MM-DD") + // 因为上面都转成了 年月日格式 当对不上的时候 就说明天数不是同一天 即第二天或以后 那么这个时候就可以显示更换指派人 + if (nowTime !== suggestTime && this.extendObj.errorStatus === 1) { + this.canChangePerson = true + } this.$forceUpdate(); }, // 新的选指派人 handleSelectPerson(obj) { + // 如果更换指派人的悬浮框出现了 那么就是更换指派人 不然就是第一次指派人 console.log("obj", obj); let list = JSON.parse(JSON.stringify(this.selectPersonList)); let personObj = {}; @@ -917,6 +824,28 @@ export default { this.selectPersonObj = personObj; console.log("this.selectPersonList", this.selectPersonList); }, + // 显示更换指派人的悬浮框 + async handleOpenChangePopup() { + // 被指派的人 + const req = { + SERVERPART_ID: this.detailObj.serverPartId, + PROVINCE_CODE: this.user.ProvinceCode, + }; + + const data = await this.$request.$getMp("GetDealerList", req); + console.log("handleGetPersonList", data); + + const list = data.Data.List + console.log("listlistlistlist", list); + this.selectPersonList = list; + + this.showChangePopup = true; + this.$forceUpdate(); + }, + // 关闭更换指派人的悬浮框 + handleCloseChangePopup() { + this.showChangePopup = false; + }, // 指派 handleAssign() { this.isShowPopup = true; @@ -943,11 +872,25 @@ export default { indicator: "number", }); }, + // 删除答案里面的图片 + deleteImgFuncResponse(item, index) { + console.log("item", item); + item = item.splice(index, 1); + this.$forceUpdate(); + }, async handleGetDetail(id) { - const data = await this.$request.$webNodeGet( - `questionnaire-responses/${id}` + // const data = await this.$request.$webNodeGet( + // `questionnaire-responses/${id}` + // ); + const data = await this.$request.$webJavaGet( + 'questionnaire-responses/get', + { + id: id + } ); - let obj = data.data; + + + let obj = data.Result_Data; this.detailObj = obj; console.log("this.detailObj", this.detailObj); @@ -1010,28 +953,89 @@ export default { // this.tagList = obj.questionResponses; console.log("this.tagList", this.tagList); - if (obj.extend) { - let extend = JSON.parse(obj.extend); + let extend = { + questionnaireResponsesId: obj.questionnaireResponsesId, + uploadResult: obj.uploadResult, + situation: obj.situation, + errorStatus: obj.errorStatus, + + suggestion: obj.suggestion, + suggestTime: obj.suggestTime, + + suggestPersonId: obj.suggestPersonId, + suggestPersonName: obj.suggestPersonName, + suggestMemberShipId: obj.suggestMemberShipId, + suggestMemberShipName: obj.suggestMemberShipName, + + + personMemberShipId: obj.personMemberShipId, + personMemberShipName: obj.personMemberShipName, + personIsChecked: obj.personIsChecked, + personId: obj.personId, + personName: obj.personName, + + imgsList: obj.imgsList, + feedbackContent: obj.feedbackContent, + feedbackTime: obj.feedbackTime, + feedbackImgList: obj.feedbackImgList, + newFeedbackImgList: obj.newFeedbackImgList + } + if (extend.situation === 1) { this.uploadResult = extend.uploadResult; this.imgsList = extend.imgsList; this.current = extend.situation; this.extendObj = extend; + console.log("this.extendObj", this.extendObj); if (extend.errorStatus === 1) { - this.suggestion = extend.suggestion; - this.showPersonName = extend.person.MEMBERSHIP_NAME; + this.suggestion = { + STAFF_NAME: extend.personName, + STAFF_ID: extend.personId, + MEMBERSHIP_NAME: extend.personMemberShipName, + MEMBERSHIP_ID: extend.personMemberShipId, + }; + this.showPersonName = extend.personName; } if (extend.errorStatus > 1) { this.feedbackContent = extend.feedbackContent; this.feedbackImgList = extend.feedbackImgList; } - if (extend.person.MEMBERSHIP_ID === this.user.Membership_Id) { + if ( + extend.personName && + extend.personId === this.user.UserId + ) { // 判断是不是反馈人 this.isFeedback = true; } } - console.log("this.extendObj", this.extendObj); + + // if (obj.extend) { + // let extend = JSON.parse(obj.extend); + // console.log("extendObj", extend); + + // this.uploadResult = extend.uploadResult; + // this.imgsList = extend.imgsList; + // this.current = extend.situation; + // this.extendObj = extend; + // if (extend.errorStatus === 1) { + // this.suggestion = extend.suggestion; + // this.showPersonName = extend.person.MEMBERSHIP_NAME; + // } + // if (extend.errorStatus > 1) { + // this.feedbackContent = extend.feedbackContent; + // this.feedbackImgList = extend.feedbackImgList; + // } + + // if ( + // extend.person && + // extend.person.MEMBERSHIP_ID === this.user.Membership_Id + // ) { + // // 判断是不是反馈人 + // this.isFeedback = true; + // } + // } + console.log('this.isFeedback', this.isFeedback); // 获取处理人列表 if (this.extendObj.errorStatus === 0) { this.handleGetPersonList(); @@ -1077,11 +1081,18 @@ export default { this.isManager = false; } - // isManager + console.log('this.isManager', this.isManager); + + // isManager this.selectPersonList = list; }, async handleGetUpdate() { + console.log('this.extendObj', this.extendObj); + console.log('this.selectPersonObj', this.selectPersonObj); + console.log('this.suggestion', this.suggestion); + console.log('this.detailObj', this.detailObj); + let req = {}; if (this.extendObj.errorStatus === 0) { if (!this.selectPersonObj) { @@ -1103,25 +1114,76 @@ export default { console.log("personObj", personObj); req = { ...this.extendObj, - person: personObj, + questionnaireResponsesId: this.detailObj.id, + // person: personObj, errorStatus: 1, suggestion: this.suggestion, suggestTime: this.$util.cutDate(new Date(), "YYYY-MM-DD hh:mm:ss"), // 选处理人的时间 - suggestPerson: { - STAFF_NAME: this.user.UserName, - STAFF_ID: this.user.UserId, - MEMBERSHIP_NAME: this.user.Membership_Name, - MEMBERSHIP_ID: this.user.Membership_Id, - }, + personMemberShipId: this.user.Membership_Id, + personMemberShipName: this.user.Membership_Name, + personId: this.user.UserId, + personName: this.user.UserName, + // suggestPerson: { + // STAFF_NAME: this.user.UserName, + // STAFF_ID: this.user.UserId, + // MEMBERSHIP_NAME: this.user.Membership_Name, + // MEMBERSHIP_ID: this.user.Membership_Id, + // }, }; } else if (this.extendObj.errorStatus === 1) { - if (!(this.feedbackImgList && this.feedbackImgList.length > 0)) { + console.log("this.detailObj321321312", this.detailObj); + // 判断是不是全部的反馈照片都传了 + let haveAllFeedbackImg = true; + let feedBackTitle = ""; + // 为了兼容老的数据 这个数组 只传反馈的照片 + let resImgList = []; + // 这个是新的 要带上key 回显的时候好匹配 + let newResImgList = {}; + let list = this.detailObj.questionResponses; + if (list && list.length > 0) { + list.forEach((item) => { + if (!(item.score > 0)) { + if (item.feedbackImg && item.feedbackImg.length > 0) { + item.feedbackImg.forEach((subItem) => { + resImgList.push({ + keyName: item.id, + imageUrl: subItem + }); + }); + newResImgList[item.id] = item.feedbackImg; + } else { + haveAllFeedbackImg = false; + if (feedBackTitle) { + feedBackTitle += `、${item.isChecked[0]}`; + } else { + feedBackTitle = `${item.isChecked[0]}`; + } + } + } + }); + } + if (!haveAllFeedbackImg) { uni.showToast({ - title: "请选择上传反馈图片!", + title: `${feedBackTitle}缺少反馈图片!`, icon: "none", }); return; } + + console.log("resImgListresImgListresImgList", resImgList); + console.log( + "newResImgListnewResImgListnewResImgListnewResImgList", + newResImgList + ); + + // if (!(this.feedbackImgList && this.feedbackImgList.length > 0)) { + // uni.showToast({ + // title: "请选择上传反馈图片!", + // icon: "none", + // }); + // return; + // } + if (!this.feedbackContent) { uni.showToast({ title: "请输入反馈内容!", @@ -1130,24 +1192,42 @@ export default { return; } - console.log("this.feedbackImgList", this.feedbackImgList); - console.log("his.feedbackContent", this.feedbackContent); - req = { ...this.extendObj, - feedbackImgList: this.feedbackImgList, + // feedbackImgList: this.feedbackImgList, + feedbackImgList: resImgList, + newFeedbackImgList: newResImgList, feedbackContent: this.feedbackContent, feedbackTime: this.$util.cutDate(new Date(), "YYYY-MM-DD hh:mm:ss"), // 反馈时间 errorStatus: 2, }; } - const data = await this.$request.$webNodePOST( - `questionnaire-responses/${this.detailObj.id}/extend`, - { extend: JSON.stringify(req) } - ); + // const data = await this.$request.$webNodePOST( + // `questionnaire-responses/${this.detailObj.id}/extend`, + // { extend: JSON.stringify(req) } + // ); + // const data = await this.$request.$webJavaPOST( + // `questionnaire-responses/update`, + // { + // ...req + // // id: this.detailObj.id, + // // extend: JSON.stringify(req) + // } + // ) + console.log('req', req); + + const data = await this.$request.$webJavaPOST( + `questionnaire-responses/extend/update`, + { + ...req, + questionnaireResponsesId: this.detailObj.id, + } + ) + + console.log("data", data); - if (data.code === 200) { + if (data.Result_Code === 100) { uni.showToast({ title: "提交成功!", icon: "success", @@ -1159,12 +1239,12 @@ export default { }, 1000); } else { uni.showToast({ - title: data.message, + title: data.Result_Desc, icon: "none", }); } }, - submitImg(e) { + submitImg(e, obj, type) { this.imgfocus = true; let _this = this; uni.chooseImage({ @@ -1212,9 +1292,23 @@ export default { } console.log("data", data); uni.hideLoading(); - _this.feedbackImgList.push( - `https://es.eshangtech.com/${data.data.path}` - ); + if (type === "feedback") { + if (obj.feedbackImg && obj.feedbackImg.length > 0) { + obj.feedbackImg.push( + `https://es.eshangtech.com/${data.data.path}` + ); + } else { + obj.feedbackImg = [ + `https://es.eshangtech.com/${data.data.path}`, + ]; + } + _this.$forceUpdate(); + console.log("objobjobjobj21321", obj); + } else { + _this.feedbackImgList.push( + `https://es.eshangtech.com/${data.data.path}` + ); + } }, fail(error) { console.log("error", error); @@ -1249,9 +1343,23 @@ export default { } console.log("data", data); uni.hideLoading(); - _this.feedbackImgList.push( - `https://es.eshangtech.com/${data.data.path}` - ); + if (type === "feedback") { + if (obj.feedbackImg && obj.feedbackImg.length > 0) { + obj.feedbackImg.push( + `https://es.eshangtech.com/${data.data.path}` + ); + } else { + obj.feedbackImg = [ + `https://es.eshangtech.com/${data.data.path}`, + ]; + } + console.log("objobjobjobj21321", obj); + } else { + _this.feedbackImgList.push( + `https://es.eshangtech.com/${data.data.path}` + ); + } + _this.$forceUpdate(); // path; }, fail(error) { @@ -1261,7 +1369,7 @@ export default { }); } }, - fail: function (err) {}, + fail: function (err) { }, }); }, }, @@ -1559,6 +1667,38 @@ export default { } } } + + .imgItem { + width: 148rpx; + height: 148rpx; + margin-right: 16rpx; + position: relative; + border-radius: 8rpx; + overflow: hidden; + + image { + width: 100%; + height: 100%; + } + + .closeBox { + width: 32rpx; + height: 32rpx; + border-radius: 0rpx 8rpx 0rpx 8rpx; + background: rgba(6, 10, 25, 0.5); + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + right: 0; + + .closeIcon { + width: 24rpx; + height: 24rpx; + } + } + } } .requestionCheckedItem { @@ -1645,6 +1785,38 @@ export default { } } } + + .imgItem { + width: 148rpx; + height: 148rpx; + margin-right: 16rpx; + position: relative; + border-radius: 8rpx; + overflow: hidden; + + image { + width: 100%; + height: 100%; + } + + .closeBox { + width: 32rpx; + height: 32rpx; + border-radius: 0rpx 8rpx 0rpx 8rpx; + background: rgba(6, 10, 25, 0.5); + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + right: 0; + + .closeIcon { + width: 24rpx; + height: 24rpx; + } + } + } } } @@ -1821,7 +1993,7 @@ export default { .popupBox { width: 100%; - height: 60vh; + height: 80vh; box-sizing: border-box; padding-bottom: env(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom); @@ -1869,6 +2041,7 @@ export default { .itemContent { width: 100%; margin-top: 16rpx; + .title { font-family: "PingFangSC"; font-weight: 400; @@ -1910,6 +2083,21 @@ export default { } } + .changePersonBox { + width: 100%; + margin-top: 16rpx; + display: flex; + align-items: center; + justify-content: flex-start; + + .changePersonBtn { + color: #F75031; + background: #FEF0ED; + padding: 2rpx 8rpx; + border-radius: 8rpx; + } + } + .descBox { width: 100%; background: #f6f6f7; @@ -1976,6 +2164,82 @@ export default { } } } + + .NewItemContent { + margin-top: 24rpx; + + .newItem { + margin-bottom: 16rpx; + + .feedbackTitle { + font-family: "PingFangSC"; + font-weight: 400; + font-size: 30rpx; + color: #010b18; + line-height: 40rpx; + text-align: justify; + font-style: normal; + margin-bottom: 16rpx; + } + + .uploadImgBox { + width: 100%; + margin-top: 16rpx; + display: flex; + align-items: center; + flex-wrap: wrap; + + .submitImgBox { + width: 148rpx; + height: 148rpx; + background: #f7f7f8; + border-radius: 8rpx; + display: flex; + align-items: center; + justify-content: center; + margin-right: 16rpx; + + .addIcon { + width: 48rpx; + height: 48rpx; + color: #b4b5ba; + } + } + + .imgItem { + width: 148rpx; + height: 148rpx; + margin-right: 16rpx; + position: relative; + border-radius: 8rpx; + overflow: hidden; + + image { + width: 100%; + height: 100%; + } + + .closeBox { + width: 32rpx; + height: 32rpx; + border-radius: 0rpx 8rpx 0rpx 8rpx; + background: rgba(6, 10, 25, 0.5); + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + right: 0; + + .closeIcon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + } } .bottomBtnBox { @@ -2003,6 +2267,180 @@ export default { } } + .changePersonPopupBox { + width: 100%; + height: 60vh; + box-sizing: border-box; + padding-bottom: env(safe-area-inset-bottom); + padding-bottom: constant(safe-area-inset-bottom); + border-radius: 24rpx 24rpx 0rpx 0rpx; + + .changePersonContent { + width: 100%; + height: 100%; + background-color: #fff; + box-sizing: border-box; + padding: 32rpx; + + .changePersonContentBox { + width: 100%; + height: calc(100% - 140rpx); + + .itemContent { + width: 100%; + margin-top: 16rpx; + + .title { + font-family: "PingFangSC"; + font-weight: 400; + font-size: 30rpx; + color: #010b18; + line-height: 40rpx; + text-align: justify; + font-style: normal; + } + + .anwersList { + width: 100%; + display: flex; + align-items: center; + flex-wrap: wrap; + margin-top: 16rpx; + + .anwersItem { + .anwers { + min-width: calc((100% - 48rpx) / 3); + background: #f6f6f7; + border-radius: 6rpx; + text-align: center; + padding: 14rpx; + margin-right: 16rpx; + margin-bottom: 16rpx; + font-family: "PingFangSC"; + font-weight: 400; + font-size: 28rpx; + color: #010b18; + line-height: 40rpx; + font-style: normal; + } + + .selectAnwersItem { + background: #e7eeff; + color: #3b72ff; + } + } + } + + .changePersonBox { + width: 100%; + margin-top: 16rpx; + display: flex; + align-items: center; + justify-content: flex-start; + + .changePersonBtn { + color: #F75031; + background: #FEF0ED; + padding: 2rpx 8rpx; + border-radius: 8rpx; + } + } + + .descBox { + width: 100%; + background: #f6f6f7; + border-radius: 6rpx; + box-sizing: border-box; + padding: 16rpx 24rpx; + margin-top: 12rpx; + } + + .uploadImgBox { + width: 100%; + margin-top: 16rpx; + display: flex; + align-items: center; + flex-wrap: wrap; + + .submitImgBox { + width: 148rpx; + height: 148rpx; + background: #f7f7f8; + border-radius: 8rpx; + display: flex; + align-items: center; + justify-content: center; + margin-right: 16rpx; + + .addIcon { + width: 48rpx; + height: 48rpx; + color: #b4b5ba; + } + } + + .imgItem { + width: 148rpx; + height: 148rpx; + margin-right: 16rpx; + position: relative; + border-radius: 8rpx; + overflow: hidden; + + image { + width: 100%; + height: 100%; + } + + .closeBox { + width: 32rpx; + height: 32rpx; + border-radius: 0rpx 8rpx 0rpx 8rpx; + background: rgba(6, 10, 25, 0.5); + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + right: 0; + + .closeIcon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + } + + + + .bottomBtnBox { + width: 100%; + height: 120rpx; + box-sizing: border-box; + padding: 16rpx 40rpx; + background: #fff; + + .bottomBtn { + width: 100%; + height: 100%; + font-family: "PingFangSC"; + font-weight: 400; + font-size: 32rpx; + color: #ffffff; + font-style: normal; + background: #3b72ff; + border-radius: 6rpx; + display: flex; + align-items: center; + justify-content: center; + } + } + } + } + // width: 100%; // // height: 100vh; // background-color: #fff; diff --git a/pages/walkAroundManager/index.vue b/pages/walkAroundManager/index.vue index 2c4ac1c..a57d3a9 100644 --- a/pages/walkAroundManager/index.vue +++ b/pages/walkAroundManager/index.vue @@ -21,32 +21,17 @@ 巡检内容* - + - + - + - + @@ -59,96 +44,63 @@ - - + + {{ item.question.title }}* - 请选择 - + 请选择 + - - + + {{ subItem || "" }} - + + + + + + + + + + + + + + - - + + {{ item.question.title || "" }}* - 请选择 - + 请选择 + - - + + {{ subItem.text || "" }} - + @@ -170,9 +122,7 @@ - 情况类型* + 情况类型* @@ -209,11 +159,7 @@ - + {{ detailObj.title || "-" }} @@ -226,51 +172,33 @@ - + - + *巡查内容 - + - + {{ tags.question.title || "" }} * - + {{ tag.text }} @@ -282,32 +210,15 @@ - - + + *请上传现场图片 - - × - + + × + @@ -319,33 +230,17 @@ - + - - + + - + {{ item.name }} @@ -358,52 +253,29 @@ - + - - - {{ item.text || "" }} + + + {{ item.text || "" }} - - + + - + {{ subItem.text @@ -479,6 +351,12 @@ export default { deleteImgFunc(item, index) { this.imgsList.splice(index, 1); }, + // 删除答案里面的图片 + deleteImgFuncResponse(item, index) { + console.log("item", item); + item = item.splice(index, 1); + this.$forceUpdate(); + }, // 提交表单内容 async submitUpload() { if (this.submiting) { @@ -505,11 +383,14 @@ export default { } let AllOK = true; + // 判断有没有 异常项选择了 + let haveError = false; let questionResponsesList = []; console.log("this.requestionRadioList", this.requestionRadioList); console.log("this.requestionCheckedList", this.requestionCheckedList); + // 看单选题中是否有必填的没填 if (this.requestionRadioList && this.requestionRadioList.length > 0) { this.requestionRadioList.forEach((item) => { @@ -525,9 +406,14 @@ export default { questionId: item.questionId, textResponse: "", choiceResponse: item.choiceResponse, - imageResponse: "", + imageResponse: item.imageResponse, score: item.choiceResponse[0].mark || (item.mark ? item.mark : 0), }); + let mark = + item.choiceResponse[0].mark || (item.mark ? item.mark : 0); + if (mark === 0) { + haveError = true; + } } }); } @@ -546,7 +432,7 @@ export default { questionId: item.questionId, textResponse: "", choiceResponse: item.isChecked, - imageResponse: "", + imageResponse: item.imageResponse, score: item.isChecked[0].mark || (item.mark ? item.mark : 0), }); } @@ -560,10 +446,21 @@ export default { }); return; } - this.submiting = true; console.log("requestionRadioList", this.requestionRadioList); console.log("requestionCheckedList", this.requestionCheckedList); + console.log("haveError", haveError); + if (!haveError && this.current === 1) { + uni.showToast({ + title: "考核过程均为正常,请检查!", + icon: "none", + }); + return; + } + + + + this.submiting = true; let extendObj = { uploadResult: this.uploadResult, imgsList: this.imgsList, @@ -572,10 +469,11 @@ export default { }; const req = { + ...extendObj, templateId: this.detailObj.id, userId: this.user.UserId, userName: this.user.UserName, - extend: extendObj ? JSON.stringify(extendObj) : "", + // extend: extendObj ? extendObj : "", completed: true, placeId: 0, placeName: this.detailObj.title, @@ -587,28 +485,36 @@ export default { }; console.log("req", req); - const data = await this.$request.$webNodePOST( - `questionnaire-responses`, + // 原node接口 + // const data = await this.$request.$webNodePOST( + // `questionnaire-responses`, + // req + // ); + // 新java接口 + const data = await this.$request.$webJavaPOST( + `questionnaire-responses/save`, req - ); + ) + console.log("data", data); + this.submiting = false; console.log("data", data); - if (data.code === 200) { + if (data.Result_Code === 100) { this.submit = true; uni.showToast({ - title: data.message, + title: '提交成功!', icon: "none", }); let _this = this; setTimeout(() => { _this.$util.toNextRoute( "redirectTo", - `/pages/walkAroundManager/statusPage?id=${data.data.id}` + `/pages/walkAroundManager/statusPage?id=${data.Result_Data.id}` ); }, 1000); } else { uni.showToast({ - title: data.message, + title: data.Result_Desc, icon: "error", }); } @@ -648,7 +554,7 @@ export default { questionId: detailItem.id, textResponse: "", choiceResponse: [item.text], - imageResponse: "", + imageResponse: item.imageResponse, score: item.mark ? item.mark : 0, }; this.selectAnwersObj[detailItem.id] = [item]; @@ -729,7 +635,7 @@ export default { questionId: detailItem.id, textResponse: "", choiceResponse: [item.text], - imageResponse: "", + imageResponse: item.imageResponse, score: item.mark ? item.mark : 0, }; this.selectAnwersObj[detailItem.id] = [item]; @@ -740,10 +646,18 @@ export default { }, // 获取单个的模版数据 async handleGetModalData(id) { - const data = await this.$request.$webNodeGet( - `questionnaire-templates/${id}` + // const data = await this.$request.$webNodePOST( + // `questionnaire-templates/${id}` + // ); + + const data = await this.$request.$webJavaGet( + 'questionnaire-templates/get', + { + id: id + } ); - let obj = data.data; + + let obj = data.Result_Data; console.log("obj", obj); this.detailObj = obj; @@ -816,15 +730,38 @@ export default { if (obj.question.options && obj.question.options.length > 0) { obj.question.options.forEach((item) => { if (item.text === evt.detail.value) { - obj.mark = item.mark; + obj.mark = item.mark || 0; } }); - } + } + // 判断 只要在这里点击了 那就不可能能变回默认了 那么就可以给他赋值显示图片了 + // 只有分数不是1 的时候 才让它显示添加图片 + if (obj.mark !== 1) { + obj.showAddImg = true; + } else { + obj.showAddImg = false; + } + // if(!(obj.mark>0)){ // this.current = 1; // } console.log("requestionRadioList", this.requestionRadioList); + if (this.requestionRadioList && this.requestionRadioList.length > 0) { + // 判断有没有选择了 0分的 因为 单选 只要选了就不能改 + // 且 不选之前 mark的值为undefined 选了 就是0 或 1 + let haveError = false; + this.requestionRadioList.forEach((item) => { + if (item.mark === 0) { + haveError = true; + } + }); + if (haveError) { + this.current = 1; + } else { + this.current = 0; + } + } // this.value = evt.target.value; // for (let i = 0; i < this.options.length; i++) { @@ -837,7 +774,7 @@ export default { handleChangeCheck(e) { console.log("e", e); }, - submitImg(e) { + submitImg(e, obj, type) { this.imgfocus = true; let _this = this; uni.chooseImage({ @@ -885,9 +822,27 @@ export default { } console.log("data", data); uni.hideLoading(); - _this.imgsList.push( - `https://es.eshangtech.com/${data.data.path}` - ); + + if (type === "response") { + if (obj.imageResponse && obj.imageResponse.length > 0) { + obj.imageResponse.push( + `https://es.eshangtech.com/${data.data.path}` + ); + } else { + obj.imageResponse = [ + `https://es.eshangtech.com/${data.data.path}`, + ]; + } + console.log( + "objobjobjobjobjobjobjobj", + _this.requestionRadioList + ); + _this.$forceUpdate(); + } else { + _this.imgsList.push( + `https://es.eshangtech.com/${data.data.path}` + ); + } }, fail(error) { console.log("error", error); @@ -922,9 +877,30 @@ export default { } console.log("data", data); uni.hideLoading(); - _this.imgsList.push( - `https://es.eshangtech.com/${data.data.path}` - ); + if (type === "response") { + if (obj.imageResponse && obj.imageResponse.length > 0) { + obj.imageResponse.push( + `https://es.eshangtech.com/${data.data.path}` + ); + } else { + obj.imageResponse = [ + `https://es.eshangtech.com/${data.data.path}`, + ]; + } + console.log( + "objobjobjobjobjobjobjobj", + _this.requestionRadioList + ); + _this.$forceUpdate(); + } else { + _this.imgsList.push( + `https://es.eshangtech.com/${data.data.path}` + ); + } + + // _this.imgsList.push( + // `https://es.eshangtech.com/${data.data.path}` + // ); // path; }, fail(error) { @@ -953,12 +929,11 @@ export default { // }, // }); }, - fail: function (err) {}, + fail: function (err) { }, }); }, // 显示多选的弹出框 handleShowCheckPopup(obj, type) { - console.log("obj", obj); this.questionType = type; this.isShowPopup = true; this.popupShowObj = obj; @@ -1020,6 +995,8 @@ export default { this.$forceUpdate(); } else { obj.choiceResponse = []; + obj.imageResponse = []; + obj.showAddImg = false; this.$forceUpdate(); } }, @@ -1049,17 +1026,20 @@ export default { box-sizing: border-box; padding-bottom: env(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom); + .pageScroll { width: 100%; height: calc(100% - 120rpx); background-color: #f6f7f9; box-sizing: border-box; padding-bottom: 32rpx; + .topContent { width: 100%; box-sizing: border-box; padding: 16rpx 32rpx 0; background: linear-gradient(#e6eefd 0%, #f6f7f9 100%); + .placeBox { width: 100%; box-sizing: border-box; @@ -1070,6 +1050,7 @@ export default { background-size: 100% 100%; background-position: 2rpx 2rpx; background-repeat: no-repeat; + .placeName { font-family: "PingFangSC"; font-weight: 400; @@ -1083,6 +1064,7 @@ export default { .userBox { width: 100%; margin-top: 12rpx; + .userTop { .userName { font-family: "PingFangSC"; @@ -1094,6 +1076,7 @@ export default { font-style: normal; margin-right: 12rpx; } + .labelBox { font-family: "PingFangSC"; font-weight: 400; @@ -1112,11 +1095,13 @@ export default { display: flex; align-items: center; margin-top: 8rpx; + .timeIcon { width: 32rpx; height: 32rpx; margin-right: 4rpx; } + .nowTime { font-family: "PingFangSC"; font-weight: 400; @@ -1137,6 +1122,7 @@ export default { border-radius: 16rpx; box-sizing: border-box; padding: 24rpx; + .contentTop { font-family: "PingFangSC"; font-weight: 400; @@ -1145,6 +1131,7 @@ export default { line-height: 40rpx; text-align: left; font-style: normal; + .required { font-family: "PingFangSC"; font-weight: 400; @@ -1156,16 +1143,19 @@ export default { margin-left: 4rpx; } } + .contentBox { width: 100%; margin-top: 16rpx; } + .uploadImgBox { width: 100%; margin-top: 16rpx; display: flex; align-items: center; flex-wrap: wrap; + .submitImgBox { width: 148rpx; height: 148rpx; @@ -1175,12 +1165,14 @@ export default { align-items: center; justify-content: center; margin-right: 16rpx; + .addIcon { width: 48rpx; height: 48rpx; color: #b4b5ba; } } + .imgItem { width: 148rpx; height: 148rpx; @@ -1188,10 +1180,12 @@ export default { position: relative; border-radius: 8rpx; overflow: hidden; + image { width: 100%; height: 100%; } + .closeBox { width: 32rpx; height: 32rpx; @@ -1203,6 +1197,7 @@ export default { position: absolute; top: 0; right: 0; + .closeIcon { width: 24rpx; height: 24rpx; @@ -1218,6 +1213,7 @@ export default { margin-top: 24rpx; box-sizing: border-box; padding: 0 32rpx; + .questionItem { width: 100%; background: #fff; @@ -1225,10 +1221,12 @@ export default { padding: 24rpx; border-radius: 16rpx; margin-bottom: 24rpx; + .quetionTitle { display: flex; align-items: center; justify-content: space-between; + .quetionLeft { font-family: "PingFangSC"; font-weight: 400; @@ -1237,6 +1235,7 @@ export default { line-height: 40rpx; text-align: left; font-style: normal; + .required { font-family: "PingFangSC"; font-weight: 400; @@ -1252,6 +1251,7 @@ export default { .quetionRight { display: flex; align-items: center; + .placeSelect { font-family: "PingFangSC"; font-weight: 400; @@ -1261,6 +1261,7 @@ export default { text-align: left; font-style: normal; } + .rightArrow { width: 32rpx; height: 32rpx; @@ -1268,12 +1269,14 @@ export default { } } } + .checkedBottom { width: 100%; display: flex; align-items: center; flex-wrap: wrap; margin-top: 16rpx; + .bottomItem { font-family: "PingFangSC"; font-weight: 400; @@ -1287,6 +1290,7 @@ export default { background: #f6f6f7; margin-right: 16rpx; margin-bottom: 16rpx; + .closeIcon { width: 24rpx; height: 24rpx; @@ -1294,10 +1298,12 @@ export default { } } } + .radioGroup { display: flex; align-items: center; flex-wrap: wrap; + .radioItem { display: flex; align-items: center; @@ -1305,6 +1311,63 @@ export default { font-size: 24rpx; } } + + .uploadImgBox { + width: 100%; + margin-top: 16rpx; + display: flex; + align-items: center; + flex-wrap: wrap; + + .submitImgBox { + width: 148rpx; + height: 148rpx; + background: #f7f7f8; + border-radius: 8rpx; + display: flex; + align-items: center; + justify-content: center; + margin-right: 16rpx; + + .addIcon { + width: 48rpx; + height: 48rpx; + color: #b4b5ba; + } + } + + .imgItem { + width: 148rpx; + height: 148rpx; + margin-right: 16rpx; + position: relative; + border-radius: 8rpx; + overflow: hidden; + + image { + width: 100%; + height: 100%; + } + + .closeBox { + width: 32rpx; + height: 32rpx; + border-radius: 0rpx 8rpx 0rpx 8rpx; + background: rgba(6, 10, 25, 0.5); + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + right: 0; + + .closeIcon { + width: 24rpx; + height: 24rpx; + } + } + } + } } .requestionCheckedItem { @@ -1314,10 +1377,12 @@ export default { background: #ffffff; border-radius: 16rpx; margin-bottom: 24rpx; + .checkedTop { display: flex; align-items: center; justify-content: space-between; + .topLeft { font-family: "PingFangSC"; font-weight: 400; @@ -1326,6 +1391,7 @@ export default { line-height: 40rpx; text-align: left; font-style: normal; + .required { font-family: "PingFangSC"; font-weight: 400; @@ -1337,9 +1403,11 @@ export default { margin-left: 4rpx; } } + .topRight { display: flex; align-items: center; + .placeSelect { font-family: "PingFangSC"; font-weight: 400; @@ -1349,6 +1417,7 @@ export default { text-align: left; font-style: normal; } + .rightArrow { width: 32rpx; height: 32rpx; @@ -1363,6 +1432,7 @@ export default { align-items: center; flex-wrap: wrap; margin-top: 16rpx; + .bottomItem { font-family: "PingFangSC"; font-weight: 400; @@ -1376,6 +1446,7 @@ export default { background: #f6f6f7; margin-right: 16rpx; margin-bottom: 16rpx; + .closeIcon { width: 24rpx; height: 24rpx; @@ -1383,6 +1454,63 @@ export default { } } } + + .uploadImgBox { + width: 100%; + margin-top: 16rpx; + display: flex; + align-items: center; + flex-wrap: wrap; + + .submitImgBox { + width: 148rpx; + height: 148rpx; + background: #f7f7f8; + border-radius: 8rpx; + display: flex; + align-items: center; + justify-content: center; + margin-right: 16rpx; + + .addIcon { + width: 48rpx; + height: 48rpx; + color: #b4b5ba; + } + } + + .imgItem { + width: 148rpx; + height: 148rpx; + margin-right: 16rpx; + position: relative; + border-radius: 8rpx; + overflow: hidden; + + image { + width: 100%; + height: 100%; + } + + .closeBox { + width: 32rpx; + height: 32rpx; + border-radius: 0rpx 8rpx 0rpx 8rpx; + background: rgba(6, 10, 25, 0.5); + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + right: 0; + + .closeIcon { + width: 24rpx; + height: 24rpx; + } + } + } + } } } @@ -1390,6 +1518,7 @@ export default { width: 100%; box-sizing: border-box; padding: 16rpx 32rpx 0; + .questionItem { width: 100%; background: #fff; @@ -1397,6 +1526,7 @@ export default { padding: 24rpx; border-radius: 16rpx; margin-bottom: 24rpx; + .quetionTitle { font-family: "PingFangSC"; font-weight: 400; @@ -1405,6 +1535,7 @@ export default { line-height: 40rpx; text-align: left; font-style: normal; + .required { font-family: "PingFangSC"; font-weight: 400; @@ -1416,10 +1547,12 @@ export default { margin-left: 4rpx; } } + .radioGroup { display: flex; align-items: center; flex-wrap: wrap; + .radioItem { display: flex; align-items: center; @@ -1437,6 +1570,7 @@ export default { box-sizing: border-box; padding: 16rpx 40rpx; background: #fff; + .bottomBtn { width: 100%; height: 100%; @@ -1459,6 +1593,7 @@ export default { box-sizing: border-box; padding-bottom: env(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom); + .checkPopupContent { width: 100%; height: calc(100% - 100rpx); @@ -1466,11 +1601,13 @@ export default { border-radius: 24rpx 24rpx 0rpx 0rpx; box-sizing: border-box; padding: 32rpx; + .anwersList { width: 100%; display: flex; align-items: center; flex-wrap: wrap; + .anwersItem { .anwers { min-width: calc((100% - 48rpx) / 3); @@ -1487,16 +1624,19 @@ export default { line-height: 40rpx; font-style: normal; } + .selectAnwersItem { background: #e7eeff; color: #3b72ff; } } } + .radioGroup { display: flex; align-items: center; flex-wrap: wrap; + .radioItem { display: flex; align-items: center; @@ -1512,6 +1652,7 @@ export default { box-sizing: border-box; padding: 12rpx 40rpx 0; background: #fff; + .bottomBtn { width: 100%; height: 88rpx; diff --git a/util/apiPath.js b/util/apiPath.js index 773c518..b7391df 100644 --- a/util/apiPath.js +++ b/util/apiPath.js @@ -26,4 +26,8 @@ export default { testURL2: 'http://192.168.12.121:8010', // 测试ip testApiName: '/MobileServicePlatform/Handler/handler_ajax.ashx', // 接口 + + + // JavaApiurl: 'http://10.104.1.161:8070/platform/', // web api测试接口地址 + JavaApiurl: 'http://10.104.1.175:8070/platform/', // web api测试接口地址 } \ No newline at end of file diff --git a/util/index.js b/util/index.js index 6c58280..e9fe1a6 100644 --- a/util/index.js +++ b/util/index.js @@ -47,8 +47,14 @@ export default { $webNodeGet: function (controller, data) { return Api.request('GET', ApiPath.NodeApiurl + controller, data || {}, true) }, - $webNodePOST: function (controller, data) { return Api.request('POST', ApiPath.NodeApiurl + controller, data || {}, true) + }, + // 最新的java接口 + $webJavaGet: function (controller, data) { + return Api.request('GET', ApiPath.JavaApiurl + controller, data || {}, true) + }, + $webJavaPOST: function (controller, data) { + return Api.request('POST', ApiPath.JavaApiurl + controller, data || {}, true) } } \ No newline at end of file
{{ detailObj.template.title || "-" }}
{{ detailObj.title || "-" }}