diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js
index 7763f2f..9be5001 100644
--- a/miniprogram/pages/index/index.js
+++ b/miniprogram/pages/index/index.js
@@ -3,289 +3,305 @@ const app = getApp()
import Notify from '@vant/weapp/notify/notify';
import {
- callScanUrl
+ callScanUrl
} from "../../api/common/scan.js"
import {
- userProfile,
- getUserInfoRq
+ userProfile,
+ getUserInfoRq
} from "../../api/user/user.js"
import {
- getParkRq
+ getParkRq
} from "../../api/index/index.js"
import {
- repairRemindLatestListRq,
- repairRemindReadRq
+ repairRemindLatestListRq,
+ repairRemindReadRq
} from "../../api/repair/repair.js"
import {
- getUrlParamsObj
+ getUrlParamsObj
} from "../../utils/util.js"
Page({
- data: {
- // tabBar param
- tabBarParam: {
- selected: 0,
- color: "#515151",
- selectedColor: "#217CFF",
- backgroundColor: "#ffffff",
- },
- // tabBar menu
- tabBarList: [{
- "pagePath": "/pages/index/index",
- "iconPath": "/images/tabbar/home.png",
- "selectedIconPath": "/images/tabbar/home-select.png",
- "text": "首页"
- },
- {
- "pagePath": "/pages/reportRepair/report/report",
- "iconPath": "/images/tabbar/center.png",
- "selectedIconPath": "/images/tabbar/center.png",
- "text": "报修",
- "bulge": true,
- },
- {
- "pagePath": "/pages/my/my",
- "iconPath": "/images/tabbar/my.png",
- "selectedIconPath": "/images/tabbar/my-select.png",
- "text": "我的"
- },
- ],
- IMG_NAME: app.IMG_NAME,
- menuList: [
- // {
- // name: "创业活动",
- // img: "/images/hicon/chuangyehuodong.png",
- // path: "/pages/community/community"
- // },
- // {
- // name: "政策信息",
- // img: "/images/hicon/zhengcexinxi.png",
- // path: "/pages/notice/notice"
- // },
- // {
- // name: "党建园地",
- // img: "/images/hicon/zhaozhengce.png",
- // path: "/pages/party/party"
- // },
- // {
- // name: "租办公室",
- // img: "/images/hicon/zubangongshi.png",
- // path: "/pages/office/office"
- // },
- // {
- // name: "项目入孵",
- // img: "/images/hicon/xiangmurufu.png",
- // path: "/pages/applyType/applyType"
- // },
- // {
- // name: "企业入驻",
- // img: "/images/hicon/qiyeruzhu.png",
- // path: "/pages/applyType/applyType"
- // },
- // {
- // name: "厂房申请",
- // img: "/images/hicon/qianrushenqing.png",
- // path: "/pages/applyType/applyType"
- // },
- // {
- // name: "园区建议",
- // img: "/images/hicon/yuanqujianyi.png",
- // path: "/pages/complaint/complaint"
- // },
- // {
- // name: "商业计划书",
- // img: "/images/hicon/wenjuandiaocha.png",
- // path: "/pages/outer/outer"
- // },
- /*
- {
- name: "园区报修",
- img: "/images/hicon/zhaozhuanli.png",
- path: "/pages/parkRepair/parkRepair"
- },
- */
- {
- name: "随手拍",
- img: "/profile/static/index/menu-bxfw.png",
- path: "/pages/reportRepair/index/index"
- },
- {
- name: "会议预约",
- img: "/profile/static/index/menu-hyyy.png",
- // path: "/pages/meeting/meetingReservation/meetingReservation"
- },
- // {
- // name: "展厅预约",
- // img: "/profile/static/index/menu-ztyy.png",
- // path: "/pages/meeting/exhibition/list/list"
- // },
- // {
- // name: "访客预约",
- // img: "/profile/static/index/menu-fkyy.png",
- // path: "/pages/meeting/visitorIinvitation/list/list"
- // },
- // {
- // name: "预约记录",
- // img: "/profile/static/index/menu-yyjl.png",
- // path: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord"
- // },
-
- // {
- // name: "远程门禁",
- // img: "/profile/static/index/menu-ycmj.png",
- // path: "/pages/meeting/accessControl/accessControl"
- // },
- // {
- // name: "报修服务",
- // img: "/profile/static/index/menu-bxfw.png",
- // path: "/pages/parkRepair/parkRepair"
- // },
- // {
- // name: "投诉建议",
- // img: "/profile/static/index/menu-tsjy.png",
- // path: "/pages/complaint/complaint"
- // },
- // {
- // name: "社群活动",
- // img: "/profile/static/index/menu-sqhd.png",
- // path: "/pages/community/community"
- // },
- // {
- // name: "政策中心",
- // img: "/profile/static/index/menu-zczx.png",
- // path: "/pages/notice/notice"
- // },
- // {
- // name: "入住申请",
- // img: "/profile/static/index/menu-rzsq.png",
- // path: "/pages/applyType/applyType"
- // },
-
- ],
- bannerList: [],
- userDetail: {},
- parkName: app.parkName,
- qrcodeParam: null,
- infoList: [],
+ data: {
+ // tabBar param
+ tabBarParam: {
+ selected: 0,
+ color: "#515151",
+ selectedColor: "#217CFF",
+ backgroundColor: "#ffffff",
},
+ // tabBar menu
+ tabBarList: [{
+ "pagePath": "/pages/index/index",
+ "iconPath": "/images/tabbar/home.png",
+ "selectedIconPath": "/images/tabbar/home-select.png",
+ "text": "首页"
+ },
+ {
+ "pagePath": "/pages/reportRepair/report/report",
+ "iconPath": "/images/tabbar/center.png",
+ "selectedIconPath": "/images/tabbar/center.png",
+ "text": "报修",
+ "bulge": true,
+ },
+ {
+ "pagePath": "/pages/my/my",
+ "iconPath": "/images/tabbar/my.png",
+ "selectedIconPath": "/images/tabbar/my-select.png",
+ "text": "我的"
+ },
+ ],
+ IMG_NAME: app.IMG_NAME,
+ menuList: [
+ // {
+ // name: "创业活动",
+ // img: "/images/hicon/chuangyehuodong.png",
+ // path: "/pages/community/community"
+ // },
+ // {
+ // name: "政策信息",
+ // img: "/images/hicon/zhengcexinxi.png",
+ // path: "/pages/notice/notice"
+ // },
+ // {
+ // name: "党建园地",
+ // img: "/images/hicon/zhaozhengce.png",
+ // path: "/pages/party/party"
+ // },
+ // {
+ // name: "租办公室",
+ // img: "/images/hicon/zubangongshi.png",
+ // path: "/pages/office/office"
+ // },
+ // {
+ // name: "项目入孵",
+ // img: "/images/hicon/xiangmurufu.png",
+ // path: "/pages/applyType/applyType"
+ // },
+ // {
+ // name: "企业入驻",
+ // img: "/images/hicon/qiyeruzhu.png",
+ // path: "/pages/applyType/applyType"
+ // },
+ // {
+ // name: "厂房申请",
+ // img: "/images/hicon/qianrushenqing.png",
+ // path: "/pages/applyType/applyType"
+ // },
+ // {
+ // name: "园区建议",
+ // img: "/images/hicon/yuanqujianyi.png",
+ // path: "/pages/complaint/complaint"
+ // },
+ // {
+ // name: "商业计划书",
+ // img: "/images/hicon/wenjuandiaocha.png",
+ // path: "/pages/outer/outer"
+ // },
+ /*
+ {
+ name: "园区报修",
+ img: "/images/hicon/zhaozhuanli.png",
+ path: "/pages/parkRepair/parkRepair"
+ },
+ */
+ {
+ name: "随手拍",
+ img: "/profile/static/index/menu-bxfw.png",
+ path: "/pages/reportRepair/index/index"
+ },
+ {
+ name: "会议预约",
+ img: "/profile/static/index/menu-hyyy.png",
+ // path: "/pages/meeting/meetingReservation/meetingReservation"
+ },
+ // {
+ // name: "展厅预约",
+ // img: "/profile/static/index/menu-ztyy.png",
+ // path: "/pages/meeting/exhibition/list/list"
+ // },
+ // {
+ // name: "访客预约",
+ // img: "/profile/static/index/menu-fkyy.png",
+ // path: "/pages/meeting/visitorIinvitation/list/list"
+ // },
+ // {
+ // name: "预约记录",
+ // img: "/profile/static/index/menu-yyjl.png",
+ // path: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord"
+ // },
- onLoad(options) {
- console.log('onLoad options', options);
- let _this = this;
- },
+ // {
+ // name: "远程门禁",
+ // img: "/profile/static/index/menu-ycmj.png",
+ // path: "/pages/meeting/accessControl/accessControl"
+ // },
+ // {
+ // name: "报修服务",
+ // img: "/profile/static/index/menu-bxfw.png",
+ // path: "/pages/parkRepair/parkRepair"
+ // },
+ // {
+ // name: "投诉建议",
+ // img: "/profile/static/index/menu-tsjy.png",
+ // path: "/pages/complaint/complaint"
+ // },
+ // {
+ // name: "社群活动",
+ // img: "/profile/static/index/menu-sqhd.png",
+ // path: "/pages/community/community"
+ // },
+ // {
+ // name: "政策中心",
+ // img: "/profile/static/index/menu-zczx.png",
+ // path: "/pages/notice/notice"
+ // },
+ // {
+ // name: "入住申请",
+ // img: "/profile/static/index/menu-rzsq.png",
+ // path: "/pages/applyType/applyType"
+ // },
- // 切换tabbar
- switchTab(e) {
- const data = e.currentTarget.dataset
- console.log('switchTab', data)
- const url = data.path
- if (url == '/pages/reportRepair/report/report') {
- wx.navigateTo({
- url
+ ],
+ bannerList: [],
+ userDetail: {},
+ parkName: app.parkName,
+ qrcodeParam: null,
+ infoList: [],
+ },
+
+ onLoad(options) {
+ console.log('onLoad options', options);
+ let _this = this;
+ },
+
+ // 切换tabbar
+ switchTab(e) {
+ const data = e.currentTarget.dataset
+ console.log('switchTab', data)
+ const url = data.path
+ if (url == '/pages/reportRepair/report/report') {
+ wx.navigateTo({
+ url
+ })
+ } else {
+ wx.switchTab({
+ url
+ })
+ }
+ },
+
+ onShow() {
+ let _this = this
+ let userId = wx.getStorageSync('userId');
+ if (userId) {
+ getUserInfoRq(userId).then(res => {
+ console.log('getUserInfoRq', res);
+ if (res.code == 0) {
+ let userDetail = res.data;
+ // 存储用户信息
+ wx.setStorageSync('openid', userDetail.openid)
+ wx.setStorageSync('user', userDetail)
+ wx.setStorageSync('userId', userDetail.id)
+ _this.setData({
+ userDetail
+ })
+ // 查询轮播图
+ getParkRq(userDetail.parkId).then(res => {
+ console.log('getParkRq', res);
+ let bannerList = res.bannerImages.map(item => item.url)
+ _this.setData({
+ bannerList
})
- } else {
- wx.switchTab({
- url
- })
- }
- },
-
- onShow() {
- let _this = this
- let userId = wx.getStorageSync('userId');
- if (userId) {
- getUserInfoRq(userId).then(res => {
- console.log('getUserInfoRq', res);
- if (res.code == 0) {
- let userDetail = res.data;
- // 存储用户信息
- wx.setStorageSync('openid', userDetail.openid)
- wx.setStorageSync('user', userDetail)
- wx.setStorageSync('userId', userDetail.id)
- _this.setData({
- userDetail
- })
- // 查询轮播图
- getParkRq(userDetail.parkId).then(res => {
- console.log('getParkRq', res);
- let bannerList = res.bannerImages.map(item => item.url)
- _this.setData({
- bannerList
- })
- })
- // 查询消息列表
- repairRemindLatestListRq().then(res => {
- console.log('repairRemindLatestListRq', res);
- _this.setData({
- infoList: res.data
- })
- })
- } else {
- app.selfShowMsg(res.msg, '/pages/login/login')
- }
+ })
+ // 查询消息列表
+ repairRemindLatestListRq().then(res => {
+ console.log('repairRemindLatestListRq', res);
+ _this.setData({
+ infoList: res.data
})
+ })
} else {
- app.selfShowMsg('请登录账号', '/pages/login/login')
+ app.selfShowMsg(res.msg, '/pages/login/login')
}
- },
+ })
+ } else {
+ app.selfShowMsg('请登录账号', '/pages/login/login')
+ }
+ },
- navapply(e) {
- if (wx.getStorageSync('token')) {
- if (e.currentTarget.dataset.path) {
- wx.navigateTo({
- url: e.currentTarget.dataset.path + '?name=' + e.currentTarget.dataset.name,
- })
- } else {
- wx.showModal({
- content: `"${e.currentTarget.dataset.name}"暂未开放`,
- showCancel: false,
- })
- }
- } else {
- app.getlogin()
- }
- },
-
- jumpInfo() {
+ navapply(e) {
+ if (wx.getStorageSync('token')) {
+ if (e.currentTarget.dataset.path) {
wx.navigateTo({
- url: '/pages/my/info/info',
+ url: e.currentTarget.dataset.path + '?name=' + e.currentTarget.dataset.name,
})
- },
-
- jumpInfoDetail(e) {
- console.log('detail', e);
- let id = e.currentTarget.dataset.obj.id
- let repairId = e.currentTarget.dataset.obj.repairId
- repairRemindReadRq({
- id
- }).then(res => {
- wx.navigateTo({
- url: `/pages/reportRepair/assign/detail/detail?id=${repairId}`,
- })
+ } else {
+ wx.showModal({
+ content: `"${e.currentTarget.dataset.name}"暂未开放`,
+ showCancel: false,
})
- },
+ }
+ } else {
+ app.getlogin()
+ }
+ },
- // 成功通知
- showSuccessMsg(msg) {
- Notify({
- type: 'success',
- top: '160rpx',
- message: msg
- });
- },
+ jumpInfo() {
+ wx.navigateTo({
+ url: '/pages/my/info/info',
+ })
+ },
- // 危险通知
- showErrMsg(msg) {
- Notify({
- type: 'danger',
- top: '160rpx',
- message: msg
- });
- },
+ removeNotice(id) {
+ let _this = this
+ repairRemindReadRq({
+ id
+ }).then(res => {
+ // 查询消息列表
+ repairRemindLatestListRq().then(res => {
+ console.log('repairRemindLatestListRq', res);
+ _this.setData({
+ infoList: res.data
+ })
+ })
+ })
+ },
+
+ jumpInfoDetail(e) {
+ console.log('detail', e);
+ let id = e.currentTarget.dataset.obj.id
+ let repairId = e.currentTarget.dataset.obj.repairId
+ repairRemindReadRq({
+ id
+ }).then(res => {
+ wx.navigateTo({
+ url: `/pages/reportRepair/assign/detail/detail?id=${repairId}`,
+ })
+ })
+
+ },
+
+ // 成功通知
+ showSuccessMsg(msg) {
+ Notify({
+ type: 'success',
+ top: '160rpx',
+ message: msg
+ });
+ },
+
+ // 危险通知
+ showErrMsg(msg) {
+ Notify({
+ type: 'danger',
+ top: '160rpx',
+ message: msg
+ });
+ },
})
\ No newline at end of file
diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml
index d4d4658..87ecf53 100644
--- a/miniprogram/pages/index/index.wxml
+++ b/miniprogram/pages/index/index.wxml
@@ -24,7 +24,6 @@
-
消息通知
diff --git a/miniprogram/pages/reportRepair/assign/affirm/affirm.js b/miniprogram/pages/reportRepair/assign/affirm/affirm.js
index df01866..370b14b 100644
--- a/miniprogram/pages/reportRepair/assign/affirm/affirm.js
+++ b/miniprogram/pages/reportRepair/assign/affirm/affirm.js
@@ -3,231 +3,270 @@ const app = getApp()
import Notify from '@vant/weapp/notify/notify';
import {
- selfFormatTimeYMDHMS,
+ selfFormatTimeYMDHMS,
} from "../../../../utils/util.js"
import {
- getDetailRq,
- getStatusName,
- flowHandleRq,
- selectWorkerIdByTypeIdRq
+ getDetailRq,
+ getStatusName,
+ flowHandleRq,
+ selectWorkerIdByTypeIdRq
} from "../../../../api/repair/repair.js"
Page({
- /**
- * 页面的初始数据
- */
- data: {
- IMG_NAME: app.IMG_NAME,
- id: '',
- detail: {},
- form: {
- repairUserId: null,
- repairUserName: null,
- preDate: '',
- },
- preDateVisible: false,
- preDateTime: new Date().getTime(),
- userVisible: false,
- userColumns: [{
- values: [],
- className: 'column1',
- }],
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ IMG_NAME: app.IMG_NAME,
+ id: '',
+ detail: {},
+ form: {
+ repairUserId: null,
+ repairUserName: null,
+ preDate: '',
+ repairLevel: '',
},
+ levelVisible: false,
+ levelColumns: [{
+ values: ['一级', '二级', '三级'],
+ className: 'column1',
+ }],
+ preDateVisible: false,
+ preDateTime: new Date().getTime(),
+ userVisible: false,
+ userColumns: [{
+ values: [],
+ className: 'column1',
+ }],
+ },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- console.log('onLoad', options);
- let _this = this
- _this.setData({
- ...options
- })
- _this.getDetail(options.id)
- },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ console.log('onLoad', options);
+ let _this = this
+ _this.setData({
+ ...options
+ })
+ _this.getDetail(options.id)
+ },
- back() {
- wx.navigateBack()
- },
+ back() {
+ wx.navigateBack()
+ },
- getDetail(id) {
- let _this = this
- getDetailRq({
- id
- }).then(res => {
- console.log("getDetailRq", res);
- // 详情
- let detail = res.repair
- detail.statusName = getStatusName(detail.status)
- //
- _this.setData({
- detail,
- })
- // 查询维修员
- _this.queryWorkUser(detail.typeId)
- })
- },
+ getDetail(id) {
+ let _this = this
+ getDetailRq({
+ id
+ }).then(res => {
+ console.log("getDetailRq", res);
+ // 详情
+ let detail = res.repair
+ detail.statusName = getStatusName(detail.status)
+ //
+ _this.setData({
+ detail,
+ })
+ // 查询维修员
+ _this.queryWorkUser(detail.typeId)
+ })
+ },
- // 显示-完成时间
- showPreDate() {
- let _this = this;
- _this.setData({
- preDateVisible: true
- })
- },
+ showLevel() {
+ this.setData({
+ levelVisible: true,
+ })
+ },
+ hideLevel() {
+ this.setData({
+ levelVisible: false,
+ })
+ },
+ // 确认-故障等级
+ levelConfirm(e) {
+ console.log('levelConfirm', e);
+ let _this = this;
+ const {
+ picker,
+ value,
+ index
+ } = e.detail;
+ let form = _this.data.form
+ form.repairLevel = value[0]
+
+ _this.setData({
+ form,
+ levelVisible: false
+ })
+ },
- // 关闭-完成时间
- hidePreDate() {
- let _this = this;
- _this.setData({
- preDateVisible: false
- })
- },
+ // 显示-完成时间
+ showPreDate() {
+ let _this = this;
+ _this.setData({
+ preDateVisible: true
+ })
+ },
- // 确认-完成时间
- confirmPreDate(e) {
- console.log('confirmPreDate', e);
- let _this = this;
- let form = _this.data.form;
- form.preDate = selfFormatTimeYMDHMS(e.detail);
- _this.setData({
- preDateVisible: false,
- preDateTime: e.detail,
- form
- })
- },
+ // 关闭-完成时间
+ hidePreDate() {
+ let _this = this;
+ _this.setData({
+ preDateVisible: false
+ })
+ },
- // 查询维修员
- queryWorkUser(id) {
- let _this = this
- selectWorkerIdByTypeIdRq(id).then(res => {
- console.log('selectWorkerIdByTypeIdRq', res);
- let list = res.rows.map(item => {
- return {
- id: item.userId,
- userName: item.userName,
- text: item.userPhone + '-' + item.userName
- }
- })
- let userColumns = _this.data.userColumns
- userColumns[0].values = list
- _this.setData({
- userColumns
- })
- })
- },
+ // 确认-完成时间
+ confirmPreDate(e) {
+ console.log('confirmPreDate', e);
+ let _this = this;
+ let form = _this.data.form;
+ form.preDate = selfFormatTimeYMDHMS(e.detail);
+ _this.setData({
+ preDateVisible: false,
+ preDateTime: e.detail,
+ form
+ })
+ },
- showUser() {
- this.setData({
- userVisible: true,
- })
- },
-
- hideUser() {
- this.setData({
- userVisible: false,
- })
- },
-
- // 确认用户
- userColumnsConfirm(e) {
- console.log('userColumnsConfirm', e.detail);
- let _this = this
- const {
- picker,
- value,
- index
- } = e.detail;
- let form = _this.data.form
- form.repairUserId = value[0].id
- form.repairUserName = value[0].text
- _this.setData({
- form,
- userVisible: false
- })
- },
-
- submit() {
- let _this = this
- // 参数校验
- if (!_this.data.form.repairUserId) {
- // 危险通知
- app.vantNotifyErrTop(Notify, '请选择维修人员!')
- return
+ // 查询维修员
+ queryWorkUser(id) {
+ let _this = this
+ selectWorkerIdByTypeIdRq(id).then(res => {
+ console.log('selectWorkerIdByTypeIdRq', res);
+ let list = res.rows.map(item => {
+ return {
+ id: item.userId,
+ userName: item.userName,
+ text: item.userPhone + '-' + item.userName
}
- if (!_this.data.form.preDate) {
- // 危险通知
- app.vantNotifyErrTop(Notify, '请选择预计完成时间!')
- return
- }
- // 提交参数
- let data = {
- "repair": {
- id: _this.data.id,
- ..._this.data.form
- },
- "content": '指派维修员',
- "operate": "NEXT"
- }
- flowHandleRq(data).then(res => {
- console.log('flowHandleRq', res);
- if (res.code == 0) {
- app.vantNotifySuccessTop(Notify, res.msg)
- app.selfBackPage(2)
- } else {
- app.vantNotifyErrTop(Notify, res.msg)
- }
- })
- },
+ })
+ let userColumns = _this.data.userColumns
+ userColumns[0].values = list
+ _this.setData({
+ userColumns
+ })
+ })
+ },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
+ showUser() {
+ this.setData({
+ userVisible: true,
+ })
+ },
- },
+ hideUser() {
+ this.setData({
+ userVisible: false,
+ })
+ },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
+ // 确认用户
+ userColumnsConfirm(e) {
+ console.log('userColumnsConfirm', e.detail);
+ let _this = this
+ const {
+ picker,
+ value,
+ index
+ } = e.detail;
+ let form = _this.data.form
+ form.repairUserId = value[0].id
+ form.repairUserName = value[0].text
+ _this.setData({
+ form,
+ userVisible: false
+ })
+ },
+ submit() {
+ let _this = this
+ // 参数校验
+ if (!_this.data.form.repairLevel) {
+ // 危险通知
+ app.vantNotifyErrTop(Notify, '请选择故障等级!')
+ return
}
+ if (!_this.data.form.repairUserId) {
+ // 危险通知
+ app.vantNotifyErrTop(Notify, '请选择维修人员!')
+ return
+ }
+ // if (!_this.data.form.preDate) {
+ // // 危险通知
+ // app.vantNotifyErrTop(Notify, '请选择预计完成时间!')
+ // return
+ // }
+ // 提交参数
+ let data = {
+ "repair": {
+ id: _this.data.id,
+ ..._this.data.form
+ },
+ "content": '指派维修员',
+ "operate": "NEXT"
+ }
+ flowHandleRq(data).then(res => {
+ console.log('flowHandleRq', res);
+ if (res.code == 0) {
+ app.vantNotifySuccessTop(Notify, res.msg)
+ app.selfBackPage(2)
+ } else {
+ app.vantNotifyErrTop(Notify, res.msg)
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
})
\ No newline at end of file
diff --git a/miniprogram/pages/reportRepair/assign/affirm/affirm.wxml b/miniprogram/pages/reportRepair/assign/affirm/affirm.wxml
index dfc28ed..cc77509 100644
--- a/miniprogram/pages/reportRepair/assign/affirm/affirm.wxml
+++ b/miniprogram/pages/reportRepair/assign/affirm/affirm.wxml
@@ -24,11 +24,15 @@
派单
+
+ {{form.repairLevel ? form.repairLevel : '请选择故障等级'}}
+
+
{{form.repairUserName ? form.repairUserName : '请选择维修人员'}}
-
+
{{form.preDate ? form.preDate : '请选择预计完成时间'}}
@@ -39,6 +43,11 @@
+
+
+
+
+
diff --git a/miniprogram/pages/reportRepair/assign/detail/detail.js b/miniprogram/pages/reportRepair/assign/detail/detail.js
index 44d6bbc..64802af 100644
--- a/miniprogram/pages/reportRepair/assign/detail/detail.js
+++ b/miniprogram/pages/reportRepair/assign/detail/detail.js
@@ -91,6 +91,10 @@ Page({
if (detail.status == 11) {
log.invalid = _this.findLog(res.log, detail.logId, 1)
}
+ if (detail.status == 1) {
+ log.back = _this.findLog(res.log, detail.logId, 1)
+ }
+ console.log(log)
_this.setData({
log
})
@@ -146,7 +150,7 @@ Page({
//
if (status == 1) { // 1 待派单
if ((dataType == 3 && detail.typeId == userDetail.typeId) || dataType == 7) { // 派单员 or 管理员
- operatorBtn.invalid = true //无效申请
+ operatorBtn.invalid = true // 无效申请
operatorBtn.affirm = true // 确认损坏
operatorBtn.feedback = true // 提交反馈
}
diff --git a/miniprogram/pages/reportRepair/assign/detail/detail.wxml b/miniprogram/pages/reportRepair/assign/detail/detail.wxml
index f69e599..fbaa141 100644
--- a/miniprogram/pages/reportRepair/assign/detail/detail.wxml
+++ b/miniprogram/pages/reportRepair/assign/detail/detail.wxml
@@ -23,19 +23,20 @@
报修信息
-
+
+ 故障等级
+ {{detail.repairLevel}}
+
+
故障类型
{{detail.typeName + '/' + detail.deviceName}}
@@ -45,7 +46,7 @@
{{detail.address + '/' + detail.floor}}
- 门牌号
+ 门牌号(地点)
{{detail.room}}
@@ -60,15 +61,15 @@
故障描述
{{detail.explain ? detail.explain : ''}}
-
+
+ {{detail.voiceObj.time}} s
-
+ -->
图片/视频
@@ -92,6 +93,13 @@
+
+ 维修员反馈
+
+
+ {{log.back.content ? log.back.content :''}}
+
+
维修反馈
@@ -168,7 +176,7 @@
无效申请
确认损坏
- 提交反馈
+ 故障有误
重新派单
分享
diff --git a/miniprogram/pages/reportRepair/assign/feedback/feedback.js b/miniprogram/pages/reportRepair/assign/feedback/feedback.js
index 31114f7..502147d 100644
--- a/miniprogram/pages/reportRepair/assign/feedback/feedback.js
+++ b/miniprogram/pages/reportRepair/assign/feedback/feedback.js
@@ -3,109 +3,115 @@ let app = getApp();
import Notify from '@vant/weapp/notify/notify';
import {
- flowHandleRq
+ flowHandleRq
} from "../../../../api/repair/repair.js"
Page({
- /**
- * 页面的初始数据
- */
- data: {
- IMG_NAME: app.IMG_NAME,
- id: null,
- content: '',
- },
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ IMG_NAME: app.IMG_NAME,
+ id: null,
+ content: '',
+ },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- let _this = this;
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ let _this = this;
- _this.setData({
- ...options,
- })
- },
+ _this.setData({
+ ...options,
+ })
+ },
- // input输入内容监听
- fieldInput(e) {
- console.log('fieldInput', e);
- let _this = this;
- let detail = _this.data;
- detail[e.currentTarget.dataset.name] = e.detail
- _this.setData({
- ...detail
- })
- },
-
- // 提交
- submit() {
- let _this = this
- let data = {
- "repair": {
- "id": _this.data.id
- },
- "content": _this.data.content,
- "operate": "BACK"
- }
- flowHandleRq(data).then(res => {
- console.log('flowHandleRq', res);
- if (res.code == 0) {
- app.vantNotifySuccess(Notify, res.msg)
- app.selfBackPage(2)
- } else {
- app.vantNotifyErr(Notify, res.msg)
- }
- })
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
+ // input输入内容监听
+ fieldInput(e) {
+ console.log('fieldInput', e);
+ let _this = this;
+ let detail = _this.data;
+ detail[e.currentTarget.dataset.name] = e.detail
+ _this.setData({
+ ...detail
+ })
+ },
+ // 提交
+ submit() {
+ let _this = this
+ // 参数校验
+ if (!_this.data.content) {
+ // 危险通知
+ app.vantNotifyErrTop(Notify, '请输入描述信息!')
+ return
}
+ let data = {
+ "repair": {
+ "id": _this.data.id
+ },
+ "content": _this.data.content,
+ "operate": "BACK"
+ }
+ flowHandleRq(data).then(res => {
+ console.log('flowHandleRq', res);
+ if (res.code == 0) {
+ app.vantNotifySuccess(Notify, res.msg)
+ app.selfBackPage(2)
+ } else {
+ app.vantNotifyErr(Notify, res.msg)
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
})
\ No newline at end of file
diff --git a/miniprogram/pages/reportRepair/assign/nullify/nullify.js b/miniprogram/pages/reportRepair/assign/nullify/nullify.js
index a3cf582..9301508 100644
--- a/miniprogram/pages/reportRepair/assign/nullify/nullify.js
+++ b/miniprogram/pages/reportRepair/assign/nullify/nullify.js
@@ -3,109 +3,115 @@ let app = getApp();
import Notify from '@vant/weapp/notify/notify';
import {
- flowHandleRq
+ flowHandleRq
} from "../../../../api/repair/repair.js"
Page({
- /**
- * 页面的初始数据
- */
- data: {
- IMG_NAME: app.IMG_NAME,
- id: null,
- content: '',
- },
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ IMG_NAME: app.IMG_NAME,
+ id: null,
+ content: '',
+ },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- let _this = this;
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ let _this = this;
- _this.setData({
- ...options,
- })
- },
+ _this.setData({
+ ...options,
+ })
+ },
- // input输入内容监听
- fieldInput(e) {
- console.log('fieldInput', e);
- let _this = this;
- let detail = _this.data;
- detail[e.currentTarget.dataset.name] = e.detail
- _this.setData({
- ...detail
- })
- },
-
- // 提交
- submit() {
- let _this = this
- let data = {
- "repair": {
- "id": _this.data.id
- },
- "content": _this.data.content,
- "operate": "END"
- }
- flowHandleRq(data).then(res => {
- console.log('flowHandleRq', res);
- if (res.code == 0) {
- app.vantNotifySuccess(Notify, res.msg)
- app.selfBackPage(2)
- } else {
- app.vantNotifyErr(Notify, res.msg)
- }
- })
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
+ // input输入内容监听
+ fieldInput(e) {
+ console.log('fieldInput', e);
+ let _this = this;
+ let detail = _this.data;
+ detail[e.currentTarget.dataset.name] = e.detail
+ _this.setData({
+ ...detail
+ })
+ },
+ // 提交
+ submit() {
+ let _this = this
+ // 参数校验
+ if (!_this.data.content) {
+ // 危险通知
+ app.vantNotifyErrTop(Notify, '请输入描述信息!')
+ return
}
+ let data = {
+ "repair": {
+ "id": _this.data.id
+ },
+ "content": _this.data.content,
+ "operate": "END"
+ }
+ flowHandleRq(data).then(res => {
+ console.log('flowHandleRq', res);
+ if (res.code == 0) {
+ app.vantNotifySuccess(Notify, res.msg)
+ app.selfBackPage(2)
+ } else {
+ app.vantNotifyErr(Notify, res.msg)
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
})
\ No newline at end of file
diff --git a/miniprogram/pages/reportRepair/assign/nullify/nullify.wxml b/miniprogram/pages/reportRepair/assign/nullify/nullify.wxml
index e3bdc39..17378df 100644
--- a/miniprogram/pages/reportRepair/assign/nullify/nullify.wxml
+++ b/miniprogram/pages/reportRepair/assign/nullify/nullify.wxml
@@ -7,6 +7,8 @@
提交
-
-
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/reportRepair/assign/record/record.js b/miniprogram/pages/reportRepair/assign/record/record.js
index 3943a2d..e7e5de8 100644
--- a/miniprogram/pages/reportRepair/assign/record/record.js
+++ b/miniprogram/pages/reportRepair/assign/record/record.js
@@ -186,6 +186,7 @@ Page({
pageSize,
menu: _this.data.userData.dataType, // 角色
type,
+ role: _this.data.userData.dataType,
}
// 查询数据
repairListRq(param).then(res => {
@@ -313,7 +314,7 @@ Page({
closeOrder: {
pageNum: 1,
pageSize: 10,
- type: 'close',
+ type: 'invalid',
dataList: [],
isDataAll: false,
},
diff --git a/miniprogram/pages/reportRepair/assign/record/record.wxml b/miniprogram/pages/reportRepair/assign/record/record.wxml
index db374e8..115c111 100644
--- a/miniprogram/pages/reportRepair/assign/record/record.wxml
+++ b/miniprogram/pages/reportRepair/assign/record/record.wxml
@@ -1,137 +1,145 @@
-
-
-
- 编号: {{item.sn}}
-
-
-
-
- {{item.repairName}}
+
+
+
+ 编号: {{item.sn}}
+
+
+
+
+ {{item.address + '/' + item.floor}} {{item.room ? item.room : ''}}
+ {{item.explain}}
+
-
-
-
-
- {{item.text}}
+ 门牌号: {{item.room ? item.room : ''}}-->
+
-
+
+
+
+
+ {{item.name}}({{item.phone}})
+
+
+
+ {{item.createTime}}
+
+
+
+
+ 数据已全部加载
+
+
-
-
-
-
+
+
+ 编号: {{item.sn}}
+
+
+
+
+ {{item.address + '/' + item.floor}} {{item.room ? item.room : ''}}
+ {{item.explain}}
+
+
+
+
+
+
+
+ {{item.name}}({{item.phone}})
+
+
+
+ {{item.createTime}}
+
+
+
+
+ 数据已全部加载
+
+
+
+
+
+ 编号: {{item.sn}}
+
+
+
+
+ {{item.address + '/' + item.floor}} {{item.room ? item.room : ''}}
+ {{item.explain}}
+
+
+
+
+
+
+
+ {{item.name}}({{item.phone}})
+
+
+
+ {{item.createTime}}
+
+
+
+
+ 数据已全部加载
+
+
+
+
+ 编号: {{item.sn}}
+
+
+
+
+ {{item.address + '/' + item.floor}} {{item.room ? item.room : ''}}
+ {{item.explain}}
+
+
+
+
+
+
+
+ {{item.name}}({{item.phone}})
+
+
+
+ {{item.createTime}}
+
+
+
+
+ 数据已全部加载
+
+
+
+
+
+
+
+
+
+ {{item.text}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/reportRepair/assign/record/record.wxss b/miniprogram/pages/reportRepair/assign/record/record.wxss
index 02a98a4..a38c547 100644
--- a/miniprogram/pages/reportRepair/assign/record/record.wxss
+++ b/miniprogram/pages/reportRepair/assign/record/record.wxss
@@ -54,7 +54,7 @@
}
.itemView .centerView .rightView .labelContent2 {
- line-height: 1;
+ line-height: 1.5;
margin-top: 10rpx;
font-size: 24rpx;
color: gray;
diff --git a/miniprogram/pages/reportRepair/index/index.js b/miniprogram/pages/reportRepair/index/index.js
index c91cd6a..2b4ede0 100644
--- a/miniprogram/pages/reportRepair/index/index.js
+++ b/miniprogram/pages/reportRepair/index/index.js
@@ -33,7 +33,7 @@ Page({
name: "维修入口",
img: "/profile/static/repair/index/repair.png",
path: "/pages/reportRepair/repair/index/index",
- visible: false
+ visible: true
}]
},
diff --git a/miniprogram/pages/reportRepair/query/record/record.js b/miniprogram/pages/reportRepair/query/record/record.js
index de03ea6..cd9fda3 100644
--- a/miniprogram/pages/reportRepair/query/record/record.js
+++ b/miniprogram/pages/reportRepair/query/record/record.js
@@ -96,6 +96,7 @@ Page({
_this.setData({
userData: wx.getStorageSync('user'),
})
+ console.log(_this.data.userData)
// 获取数据
let userId = _this.data.userData.id
},
@@ -127,6 +128,7 @@ Page({
// 获取数据
getDataList(transferTabTitle) {
+ console.log(transferTabTitle)
// 获取参数
let _this = this;
let tabTitle = _this.data.tabTitle
@@ -193,20 +195,21 @@ Page({
pageSize,
menu: _this.data.userData.dataType, // 角色
type,
+ role: _this.data.userData.dataType, // 角色
}
// 查询数据
repairListRq(param).then(res => {
- console.log('repairListRq', res);
+ // console.log('repairListRq', res);
let dataList = res.rows
- let isDataAll = false
+ let _isDataAll = false
if (pageNum * pageSize >= res.total) {
- isDataAll = true
+ _isDataAll = true
}
//
if (tabTitle == '全部') {
allOrder.dataList = allOrder.dataList.concat(_this.formartData(dataList))
allOrder.pageNum = allOrder.pageNum + 1
- allOrder.isDataAll = isDataAll
+ allOrder.isDataAll = _isDataAll
_this.setData({
allOrder
})
@@ -214,7 +217,7 @@ Page({
} else if (tabTitle == '处理中') {
processOrder.dataList = processOrder.dataList.concat(_this.formartData(dataList))
processOrder.pageNum = processOrder.pageNum + 1
- processOrder.isDataAll = isDataAll
+ processOrder.isDataAll = _isDataAll
_this.setData({
processOrder
})
@@ -222,7 +225,7 @@ Page({
} else if (tabTitle == '待评价') {
evalingOrder.dataList = evalingOrder.dataList.concat(_this.formartData(dataList))
evalingOrder.pageNum = evalingOrder.pageNum + 1
- evalingOrder.isDataAll = isDataAll
+ evalingOrder.isDataAll = _isDataAll
_this.setData({
evalingOrder
})
@@ -230,7 +233,7 @@ Page({
} else if (tabTitle == '已评价') {
evaledOrder.dataList = evaledOrder.dataList.concat(_this.formartData(dataList))
evaledOrder.pageNum = evaledOrder.pageNum + 1
- evaledOrder.isDataAll = isDataAll
+ evaledOrder.isDataAll = _isDataAll
_this.setData({
evaledOrder
})
@@ -238,7 +241,7 @@ Page({
} else if (tabTitle == '无效单') {
invalidOrder.dataList = invalidOrder.dataList.concat(_this.formartData(dataList))
invalidOrder.pageNum = invalidOrder.pageNum + 1
- invalidOrder.isDataAll = isDataAll
+ invalidOrder.isDataAll = _isDataAll
_this.setData({
invalidOrder
})
@@ -272,8 +275,8 @@ Page({
},
jumpEvaluate(e) {
- console.log('jumpEvaluate', e);
let obj = e.currentTarget.dataset.obj
+ console.log('jumpEvaluate', obj);
wx.navigateTo({
url: `/pages/reportRepair/assign/evaluate/evaluate?id=${obj.id}&back=1`,
})
@@ -370,7 +373,8 @@ Page({
console.log('onReachBottom', '页面上拉触底事件的处理函数');
let _this = this;
// 获取数据
- _this.getDataList()
+ let tabTitle = _this.data.tabTitle
+ _this.getDataList(tabTitle)
},
/**
diff --git a/miniprogram/pages/reportRepair/query/record/record.wxml b/miniprogram/pages/reportRepair/query/record/record.wxml
index 0d6ec0f..4d653d8 100644
--- a/miniprogram/pages/reportRepair/query/record/record.wxml
+++ b/miniprogram/pages/reportRepair/query/record/record.wxml
@@ -2,7 +2,7 @@
- {{item.repairName}}
+
@@ -28,7 +28,7 @@
- {{item.repairName}}
+
@@ -53,7 +53,7 @@
- {{item.repairName}}
+
@@ -69,7 +69,7 @@
分享
- 评价
+ 评价
@@ -79,7 +79,7 @@
- {{item.repairName}}
+
@@ -104,7 +104,7 @@
- {{item.repairName}}
+
diff --git a/miniprogram/pages/reportRepair/repair/case/case.js b/miniprogram/pages/reportRepair/repair/case/case.js
index 01bb46b..d7c2fa9 100644
--- a/miniprogram/pages/reportRepair/repair/case/case.js
+++ b/miniprogram/pages/reportRepair/repair/case/case.js
@@ -1,381 +1,408 @@
const app = getApp()
import Notify from '@vant/weapp/notify/notify';
+import Dialog from '@vant/weapp/dialog/dialog';
import {
- selfFormatTimeYMDHMS,
- repairAttachUpload,
+ selfFormatTimeYMDHMS,
+ repairAttachUpload,
} from "../../../../utils/util.js"
import {
- getDetailRq,
- getStatusName,
- flowHandleRq,
- faultTypeListRq
+ getDetailRq,
+ getStatusName,
+ flowHandleRq,
+ faultTypeListRq
} from "../../../../api/repair/repair.js"
Page({
- /**
- * 页面的初始数据
- */
- data: {
- IMG_NAME: app.IMG_NAME,
- id: '',
- detail: {},
- files: [],
- innerAudioContext: null, // 音频对象
- innerAudioContextIsPlay: false, // 音频对象-是否播放
- form: {
- cause: "",
- solution: "",
- failureTypeId: null,
- failureTypeName: "",
- resolve: null,
- fileList: [],
- },
- solveList: [{
- name: '已解决',
- status: 1,
- isSelect: false,
- },
- {
- name: '未解决',
- status: 0,
- isSelect: false,
- }
- ],
- failureTypeList: []
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- console.log('onLoad', options);
- let _this = this
- _this.setData({
- ...options
- })
- // 详情
- _this.getDetail(options.id)
- // 查询故障原因-字典
- _this.getFaultTypeList()
- },
-
- getDetail(id) {
- let _this = this
- getDetailRq({
- id
- }).then(res => {
- console.log("getDetailRq", res);
- // 详情
- let detail = res.repair
- detail.statusName = getStatusName(detail.status)
- // 附件
- let files = res.files
- files.repair = files.repair.map(item => {
- item.url = app.IMG_NAME + item.url
- return item
- })
- files.voice = files.voice.map(item => {
- item.url = app.IMG_NAME + item.url
- return item
- })
- _this.setData({
- detail,
- files
- })
- })
- },
-
- // 播放语音
- startAudio() {
- console.log('startAudio');
- let _this = this
- // 获取innerAudioContext实例
- let innerAudioContext = _this.data.innerAudioContext
- let innerAudioContextIsPlay = _this.data.innerAudioContextIsPlay
- if (!innerAudioContext) {
- // 全局设置播放声音
- wx.setInnerAudioOption({
- obeyMuteSwitch: false
- });
- innerAudioContext = wx.createInnerAudioContext()
- // 设置音频文件的路径
- innerAudioContext.src = _this.data.files.voice[0].url
- innerAudioContextIsPlay = false
- innerAudioContext.onEnded(() => {
- _this.setData({
- innerAudioContextIsPlay: false
- })
- })
- }
- if (innerAudioContextIsPlay) { // 播放中
- innerAudioContext.stop()
- innerAudioContextIsPlay = false
- } else { // 未播放
- innerAudioContext.play()
- innerAudioContextIsPlay = true
- }
- //
- _this.setData({
- innerAudioContext,
- innerAudioContextIsPlay
- })
- },
-
- // 接收/退回-提交
- receiveSubmit(e) {
- console.log('receiveSubmit', e);
- let _this = this
- let status = e.currentTarget.dataset.status
- let data = {
- "repair": {
- "id": _this.data.id
- },
- "content": "",
- "operate": ""
- }
- if (status == 'yes') {
- data.content = "接收工单"
- data.operate = "NEXT"
- } else {
- data.content = "退回工单"
- data.operate = "BACK"
- }
- flowHandleRq(data).then(res => {
- console.log('flowHandleRq', res);
- if (res.code == 0) {
- app.vantNotifySuccess(Notify, res.msg)
- _this.getDetail(_this.data.id)
- } else {
- app.vantNotifyErr(Notify, res.msg)
- }
- })
- },
-
- // input输入内容监听
- fieldInput(e) {
- console.log('fieldInput', e);
- let _this = this;
- let form = _this.data.form;
- form[e.currentTarget.dataset.name] = e.detail
- _this.setData({
- form
- })
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ IMG_NAME: app.IMG_NAME,
+ id: '',
+ detail: {},
+ files: [],
+ innerAudioContext: null, // 音频对象
+ innerAudioContextIsPlay: false, // 音频对象-是否播放
+ form: {
+ cause: "",
+ solution: "",
+ failureTypeId: null,
+ failureTypeName: "",
+ resolve: null,
+ fileList: [],
},
+ solveList: [{
+ name: '已解决',
+ status: 1,
+ isSelect: false,
+ },
+ {
+ name: '未解决',
+ status: 0,
+ isSelect: false,
+ }
+ ],
+ failureTypeList: []
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ console.log('onLoad', options);
+ let _this = this
+ _this.setData({
+ ...options
+ })
+ // 详情
+ _this.getDetail(options.id)
// 查询故障原因-字典
- getFaultTypeList() {
- let _this = this
- faultTypeListRq().then(res => {
- console.log('getFaultTypeList', res);
- let failureTypeList = res.rows.map(item => {
- return {
- id: item.id,
- name: item.name,
- isSelect: false,
- }
- })
- _this.setData({
- failureTypeList
- })
- })
- },
+ _this.getFaultTypeList()
+ },
- // 选择故障类型
- selectFaultType(e) {
- console.log('selectFaultType', e);
- let _this = this
- let obj = e.currentTarget.dataset.obj
- let failureTypeList = _this.data.failureTypeList.map(item => {
- if (item.id == obj.id) {
- item.isSelect = !item.isSelect
- let form = _this.data.form
- if (item.isSelect) {
- form.failureTypeId = item.id
- form.failureTypeName = item.name
- } else {
- form.failureTypeId = null
- form.failureTypeName = ''
- }
- _this.setData(form)
- } else {
- item.isSelect = false
- }
- return item
- })
+ getDetail(id) {
+ let _this = this
+ getDetailRq({
+ id
+ }).then(res => {
+ console.log("getDetailRq", res);
+ // 详情
+ let detail = res.repair
+ detail.statusName = getStatusName(detail.status)
+ // 附件
+ let files = res.files
+ files.repair = files.repair.map(item => {
+ item.url = app.IMG_NAME + item.url
+ return item
+ })
+ files.voice = files.voice.map(item => {
+ item.url = app.IMG_NAME + item.url
+ return item
+ })
+ _this.setData({
+ detail,
+ files
+ })
+ })
+ },
+
+ // 播放语音
+ startAudio() {
+ console.log('startAudio');
+ let _this = this
+ // 获取innerAudioContext实例
+ let innerAudioContext = _this.data.innerAudioContext
+ let innerAudioContextIsPlay = _this.data.innerAudioContextIsPlay
+ if (!innerAudioContext) {
+ // 全局设置播放声音
+ wx.setInnerAudioOption({
+ obeyMuteSwitch: false
+ });
+ innerAudioContext = wx.createInnerAudioContext()
+ // 设置音频文件的路径
+ innerAudioContext.src = _this.data.files.voice[0].url
+ innerAudioContextIsPlay = false
+ innerAudioContext.onEnded(() => {
_this.setData({
- failureTypeList
+ innerAudioContextIsPlay: false
})
- },
-
- // 选择-是否解决
- selectSolve(e) {
- console.log('selectSolve', e);
- let _this = this
- let obj = e.currentTarget.dataset.obj
- let solveList = _this.data.solveList.map(item => {
- if (item.status == obj.status) {
- item.isSelect = !item.isSelect
- let form = _this.data.form
- if (item.isSelect) {
- form.resolve = item.status
- } else {
- form.resolve = null
- }
- _this.setData(form)
- } else {
- item.isSelect = false
- }
- return item
- })
- _this.setData({
- solveList
- })
- },
-
- // 文件-上传后
- async fileAfterRead(event) {
- let _this = this;
- console.log('fileAfterRead', event);
- // 上传完成需要更新 fileList
- let fileList = _this.data.form.fileList;
- //
- const {
- file
- } = event.detail;
- // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
- for (let i = 0; i < file.length; i++) {
- let url = file[i].url;
- await repairAttachUpload({
- url,
- repairId: _this.data.id,
- operate: 'feedback',
- }).then(res => {
- console.log('upload file ', res);
- fileList.push({
- id: res.id,
- relativeUrl: res.url,
- url: app.IMG_NAME + res.url,
- deletable: true,
- })
- })
- }
- let form = _this.data.form
- form.fileList = fileList
- _this.setData({
- form
- })
- },
-
-
- // 删除图片
- deleteImg(event) {
- console.log('deleteImg', event);
- let _this = this;
- let fileList = _this.data.form.fileList;
- fileList.splice(event.detail.index, 1);
- //
- let form = _this.data.form
- form.fileList = fileList
- _this.setData({
- form
- })
- },
-
- // 反馈-提交
- feedbackSubmit() {
- console.log('feedbackSubmit');
- let _this = this
- let form = _this.data.form
- // 校验数据
- //
- // 报修名称
- if (form.resolve == null) {
- app.vantNotifyErr(Notify, '请选择是否解决!')
- return;
- }
- //
- let files = form.fileList.map(item => item.id)
- let data = {
- "repair": {
- "id": _this.data.id,
- ...form,
- },
- files,
- "content": "维修-提交反馈",
- "operate": "NEXT"
- }
- flowHandleRq(data).then(res => {
- console.log('flowHandleRq', res);
- if (res.code == 0) {
- app.vantNotifySuccess(Notify, res.msg)
- _this.getDetail(_this.data.id)
- } else {
- app.vantNotifyErr(Notify, res.msg)
- }
- })
- },
-
- back(){
- wx.navigateBack()
- },
-
- jumpDetail(){
- let _this = this
- wx.navigateTo({
- url: `/pages/reportRepair/assign/detail/detail?id=${_this.data.id}`,
- })
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
-
+ })
}
+ if (innerAudioContextIsPlay) { // 播放中
+ innerAudioContext.stop()
+ innerAudioContextIsPlay = false
+ } else { // 未播放
+ innerAudioContext.play()
+ innerAudioContextIsPlay = true
+ }
+ //
+ _this.setData({
+ innerAudioContext,
+ innerAudioContextIsPlay
+ })
+ },
+
+ // 接收/退回-提交
+ receiveSubmit(e) {
+ console.log('receiveSubmit', e);
+ let _this = this
+ let status = e.currentTarget.dataset.status
+ let data = {
+ "repair": {
+ "id": _this.data.id
+ },
+ "content": "",
+ "operate": ""
+ }
+ if (status == 'yes') {
+ data.content = "接收工单"
+ data.operate = "NEXT"
+ flowHandleRq(data).then(res => {
+ console.log('flowHandleRq', res);
+ if (res.code == 0) {
+ app.vantNotifySuccess(Notify, res.msg)
+ _this.getDetail(_this.data.id)
+ } else {
+ app.vantNotifyErr(Notify, res.msg)
+ }
+ })
+
+ } else {
+ data.content = "退回工单"
+ data.operate = "BACK"
+ let _this = this
+ wx.navigateTo({
+ url: `/pages/reportRepair/assign/feedback/feedback?id=${_this.data.id}`,
+ })
+
+ // 退回工单
+ // Dialog.confirm({
+ // title: '请确认',
+ // message: '退回工单后将由派单员重新派单,请确认是否退回?',
+ // })
+ // .then(() => {
+ // // 确认退回
+ // flowHandleRq(data).then(res => {
+ // console.log('flowHandleRq', res);
+ // if (res.code == 0) {
+ // // 跳回维修入口页面
+ // wx.navigateBack()
+ // } else {
+ // app.vantNotifyErr(Notify, res.msg)
+ // }
+ // })
+ // })
+ // .catch(() => {
+ // // on cancel
+ // })
+ }
+ },
+
+ // input输入内容监听
+ fieldInput(e) {
+ console.log('fieldInput', e);
+ let _this = this;
+ let form = _this.data.form;
+ form[e.currentTarget.dataset.name] = e.detail
+ _this.setData({
+ form
+ })
+ },
+
+ // 查询故障原因-字典
+ getFaultTypeList() {
+ let _this = this
+ faultTypeListRq().then(res => {
+ console.log('getFaultTypeList', res);
+ let failureTypeList = res.rows.map(item => {
+ return {
+ id: item.id,
+ name: item.name,
+ isSelect: false,
+ }
+ })
+ _this.setData({
+ failureTypeList
+ })
+ })
+ },
+
+ // 选择故障类型
+ selectFaultType(e) {
+ console.log('selectFaultType', e);
+ let _this = this
+ let obj = e.currentTarget.dataset.obj
+ let failureTypeList = _this.data.failureTypeList.map(item => {
+ if (item.id == obj.id) {
+ item.isSelect = !item.isSelect
+ let form = _this.data.form
+ if (item.isSelect) {
+ form.failureTypeId = item.id
+ form.failureTypeName = item.name
+ } else {
+ form.failureTypeId = null
+ form.failureTypeName = ''
+ }
+ _this.setData(form)
+ } else {
+ item.isSelect = false
+ }
+ return item
+ })
+ _this.setData({
+ failureTypeList
+ })
+ },
+
+ // 选择-是否解决
+ selectSolve(e) {
+ console.log('selectSolve', e);
+ let _this = this
+ let obj = e.currentTarget.dataset.obj
+ let solveList = _this.data.solveList.map(item => {
+ if (item.status == obj.status) {
+ item.isSelect = !item.isSelect
+ let form = _this.data.form
+ if (item.isSelect) {
+ form.resolve = item.status
+ } else {
+ form.resolve = null
+ }
+ _this.setData(form)
+ } else {
+ item.isSelect = false
+ }
+ return item
+ })
+ _this.setData({
+ solveList
+ })
+ },
+
+ // 文件-上传后
+ async fileAfterRead(event) {
+ let _this = this;
+ console.log('fileAfterRead', event);
+ // 上传完成需要更新 fileList
+ let fileList = _this.data.form.fileList;
+ //
+ const {
+ file
+ } = event.detail;
+ // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+ for (let i = 0; i < file.length; i++) {
+ let url = file[i].url;
+ await repairAttachUpload({
+ url,
+ repairId: _this.data.id,
+ operate: 'feedback',
+ }).then(res => {
+ console.log('upload file ', res);
+ fileList.push({
+ id: res.id,
+ relativeUrl: res.url,
+ url: app.IMG_NAME + res.url,
+ deletable: true,
+ })
+ })
+ }
+ let form = _this.data.form
+ form.fileList = fileList
+ _this.setData({
+ form
+ })
+ },
+
+
+ // 删除图片
+ deleteImg(event) {
+ console.log('deleteImg', event);
+ let _this = this;
+ let fileList = _this.data.form.fileList;
+ fileList.splice(event.detail.index, 1);
+ //
+ let form = _this.data.form
+ form.fileList = fileList
+ _this.setData({
+ form
+ })
+ },
+
+ // 反馈-提交
+ feedbackSubmit() {
+ console.log('feedbackSubmit');
+ let _this = this
+ let form = _this.data.form
+ // 校验数据
+ //
+ // 报修名称
+ if (form.resolve == null) {
+ app.vantNotifyErr(Notify, '请选择是否解决!')
+ return;
+ }
+ //
+ let files = form.fileList.map(item => item.id)
+ let data = {
+ "repair": {
+ "id": _this.data.id,
+ ...form,
+ },
+ files,
+ "content": "维修-提交反馈",
+ "operate": "NEXT"
+ }
+ flowHandleRq(data).then(res => {
+ console.log('flowHandleRq', res);
+ if (res.code == 0) {
+ app.vantNotifySuccess(Notify, res.msg)
+ _this.getDetail(_this.data.id)
+ } else {
+ app.vantNotifyErr(Notify, res.msg)
+ }
+ })
+ },
+
+ back() {
+ wx.navigateBack()
+ },
+
+ jumpDetail() {
+ let _this = this
+ wx.navigateTo({
+ url: `/pages/reportRepair/assign/detail/detail?id=${_this.data.id}`,
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
})
\ No newline at end of file
diff --git a/miniprogram/pages/reportRepair/repair/case/case.json b/miniprogram/pages/reportRepair/repair/case/case.json
index b93498a..cf5e297 100644
--- a/miniprogram/pages/reportRepair/repair/case/case.json
+++ b/miniprogram/pages/reportRepair/repair/case/case.json
@@ -6,6 +6,7 @@
"van-uploader": "@vant/weapp/uploader/index",
"van-checkbox": "@vant/weapp/checkbox/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index",
- "van-notify": "@vant/weapp/notify/index"
+ "van-notify": "@vant/weapp/notify/index",
+ "van-dialog": "@vant/weapp/dialog/index"
}
}
\ No newline at end of file
diff --git a/miniprogram/pages/reportRepair/repair/case/case.wxml b/miniprogram/pages/reportRepair/repair/case/case.wxml
index f9101f1..a0a9267 100644
--- a/miniprogram/pages/reportRepair/repair/case/case.wxml
+++ b/miniprogram/pages/reportRepair/repair/case/case.wxml
@@ -26,18 +26,18 @@
报修单信息
-
+
故障等级
{{detail.repairLevel}}
-
+
故障类型
{{detail.typeName + '/' + detail.deviceName}}
@@ -47,7 +47,7 @@
{{detail.address + '/' + detail.floor}}
- 门牌号
+ 门牌号(地点)
{{detail.room}}
@@ -62,14 +62,14 @@
故障描述
{{detail.explain ? detail.explain : ''}}
-
+
报修图片:
@@ -139,6 +139,6 @@
-
+
\ No newline at end of file
diff --git a/miniprogram/pages/reportRepair/repair/index/index.js b/miniprogram/pages/reportRepair/repair/index/index.js
index 08b8714..dfbc2d2 100644
--- a/miniprogram/pages/reportRepair/repair/index/index.js
+++ b/miniprogram/pages/reportRepair/repair/index/index.js
@@ -163,7 +163,8 @@ Page({
let param = {
pageNum,
pageSize,
- menu: '5', // 维修
+ // menu: '5', // 维修
+ role: '5',
type,
}
// 查询数据
@@ -245,7 +246,7 @@ Page({
workOrder: {
pageNum: 1,
pageSize: 10,
- type: 'working',
+ type: 'process',
dataList: [],
isDataAll: false,
},
@@ -253,7 +254,7 @@ Page({
closeOrder: {
pageNum: 1,
pageSize: 10,
- type: 'close',
+ type: 'end',
dataList: [],
isDataAll: false,
},
diff --git a/miniprogram/pages/reportRepair/repair/index/index.wxml b/miniprogram/pages/reportRepair/repair/index/index.wxml
index e092a38..ff632f4 100644
--- a/miniprogram/pages/reportRepair/repair/index/index.wxml
+++ b/miniprogram/pages/reportRepair/repair/index/index.wxml
@@ -41,7 +41,7 @@
- {{item.name}}发起一个订单
+ {{item.name}}发起一个工单
{{item.createTime}}
@@ -52,7 +52,7 @@
- {{item.name}}发起一个订单
+ {{item.name}}发起一个工单
{{item.createTime}}
@@ -63,7 +63,7 @@
- {{item.name}}发起一个订单
+ {{item.name}}发起一个工单
{{item.createTime}}
diff --git a/miniprogram/pages/reportRepair/report/report.js b/miniprogram/pages/reportRepair/report/report.js
index 9d8b455..7394b2e 100644
--- a/miniprogram/pages/reportRepair/report/report.js
+++ b/miniprogram/pages/reportRepair/report/report.js
@@ -520,20 +520,20 @@ Page({
//
// 校验数据
//
- // 报修名称
+ // 报修名称,去掉
if (!detail.repairName) {
- app.vantNotifyErr(Notify, '输入报修名称!')
- return;
+ // app.vantNotifyErr(Notify, '输入报修名称!')
+ // return;
}
- // 故障等级
+ // 故障等级,去掉
if (!detail.repairLevel) {
- app.vantNotifyErr(Notify, '请选择故障等级!')
- return;
+ // app.vantNotifyErr(Notify, '请选择故障等级!')
+ // return;
}
- // 故障时间
+ // 故障时间,去掉
if (!detail.repairTime) {
- app.vantNotifyErr(Notify, '请选择故障时间!')
- return;
+ // app.vantNotifyErr(Notify, '请选择故障时间!')
+ // return;
}
// 故障类型
if (!detail.typeId) {
@@ -547,7 +547,7 @@ Page({
}
// 门牌号
if (!detail.room) {
- app.vantNotifyErr(Notify, '请输入门牌号!')
+ app.vantNotifyErr(Notify, '请输入门牌号(地点)!')
return;
}
// 联系电话
@@ -566,8 +566,8 @@ Page({
return;
}
// 故障描述
- if (!detail.explain && !voiceObj.tempFilePath) {
- app.vantNotifyErr(Notify, '请输入故障描述或录音!')
+ if (!detail.explain) {
+ app.vantNotifyErr(Notify, '请输入故障描述!')
return;
}
//
diff --git a/miniprogram/pages/reportRepair/report/report.wxml b/miniprogram/pages/reportRepair/report/report.wxml
index 19d14a2..95700b7 100644
--- a/miniprogram/pages/reportRepair/report/report.wxml
+++ b/miniprogram/pages/reportRepair/report/report.wxml
@@ -1,14 +1,14 @@
-
+
报修名称
-
+
故障等级
-
+
故障时间
@@ -21,7 +21,7 @@
- 门牌号
+ 门牌号(地点)
@@ -34,22 +34,7 @@
故障描述
-
-
-
-
-
-
-
-
-
-
- 语音
-
-
- {{voiceObj.duration}} s
-
-
+
故障图片/视频
diff --git a/miniprogram/pages/reportRepair/report/report.wxss b/miniprogram/pages/reportRepair/report/report.wxss
index 579e5c5..3da0288 100644
--- a/miniprogram/pages/reportRepair/report/report.wxss
+++ b/miniprogram/pages/reportRepair/report/report.wxss
@@ -186,5 +186,5 @@
.selfTextarea {
min-height: 140rpx !important;
max-height: 140rpx !important;
- width: 450rpx !important;
+ width: 650rpx !important;
}
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 23e5294..c5d0505 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,5 +1,5 @@
{
- "name": "dbd-meeting-wx-small",
+ "name": "haLogistics",
"lockfileVersion": 3,
"requires": true,
"packages": {