描述:重新派单

This commit is contained in:
SelfRidicule 2024-08-14 15:12:02 +08:00
parent fbd901a3e7
commit 31773e156f
6 changed files with 209 additions and 36 deletions

View File

@ -303,14 +303,18 @@ App({
})
},
// 消息提示
vantNotify(Notify, msg, type) {
if (!type) {
type = 'primary'
}
Notify({
vantNotify(Notify, msg, type, top) {
let data = {
type,
message: msg
});
message: msg,
}
if (!type) {
data.type = 'primary'
}
if (top) {
data.top = top
}
Notify(data);
},
// 消息提示
vantNotifySuccess(Notify, msg) {
@ -320,4 +324,12 @@ App({
vantNotifyErr(Notify, msg) {
this.vantNotify(Notify, msg, 'danger')
},
// 消息提示
vantNotifySuccessTop(Notify, msg) {
this.vantNotify(Notify, msg, 'primary', 90)
},
// 消息提示
vantNotifyErrTop(Notify, msg) {
this.vantNotify(Notify, msg, 'danger', 90)
},
})

View File

@ -1,8 +1,13 @@
const app = getApp()
import Notify from '@vant/weapp/notify/notify';
import {
deviceTypeListRq,
deviceListRq,
getDetailRq,
getStatusName
getStatusName,
flowHandleRq
} from "../../../../api/repair/repair.js"
Page({
@ -14,6 +19,21 @@ Page({
IMG_NAME: app.IMG_NAME,
id: '',
detail: {},
currentLog: {},
typeVisible: false,
typeColumns: [{
values: [],
className: 'column1',
},
{
values: [],
className: 'column2',
},
],
"typeId": null, //故障类型
"typeName": "", //故障名称
"deviceId": null, //设备
"deviceName": "", //设备名称
},
/**
@ -26,6 +46,8 @@ Page({
...options
})
_this.getDetail(options.id)
// 查询设备类型
_this.queryDeviceType()
},
back() {
@ -42,30 +64,146 @@ Page({
let detail = res.repair
detail.statusName = getStatusName(detail.status)
// 日志
if (detail.logId) {
let firstLog = res.log.find(item => item.id == detail.logId)
if (firstLog) {
let preLog = res.log.find(item => item.id == firstLog.pid)
_this.setData({
currentLog: preLog
})
}
}
_this.setData({
detail,
})
})
},
// 确认损坏
jumpAffirm(){
wx.navigateTo({
url: '/pages/reportRepair/assign/affirm/affirm',
showType() {
this.setData({
typeVisible: true,
})
},
// 提交反馈
jumpFeedback(){
wx.navigateTo({
url: '/pages/reportRepair/assign/feedback/feedback',
hideType() {
this.setData({
typeVisible: false,
})
},
// 无效
invalid(){
wx.navigateBack()
// 查询设备类型
queryDeviceType() {
let _this = this
deviceTypeListRq().then(res => {
console.log('deviceTypeListRq', res);
let list = res.rows.map(item => {
return {
id: item.id,
text: item.name
}
})
let typeColumns = _this.data.typeColumns
typeColumns[0].values = list
_this.setData({
typeColumns
})
// 查询设备
_this.queryDevice(list[0].id)
})
},
// 查询设备
queryDevice(id) {
let _this = this
deviceListRq({
typeId: id
}).then(res => {
console.log('deviceListRq', res);
let list = res.rows.map(item => {
return {
id: item.id,
text: item.name
}
})
let typeColumns = _this.data.typeColumns
typeColumns[1].values = list
_this.setData({
typeColumns
})
})
},
// 选择设备类型
typeColumnsChange(e) {
console.log('typeColumnsChange', e.detail);
let _this = this
const {
picker,
value,
index
} = e.detail;
if (index == 0) { // 选择类型
let obj = value[index]
_this.queryDevice(obj.id)
} else if (index == 1) { // 选择设备
let obj = value[index]
}
},
// 确认设备
typeColumnsConfirm(e) {
console.log('typeColumnsConfirm', e.detail);
let _this = this
const {
picker,
value,
index
} = e.detail;
_this.setData({
typeId: value[0].id,
typeName: value[0].text,
deviceId: value[1].id,
deviceName: value[1].text,
typeVisible: false
})
},
submit() {
let _this = this
// 参数校验
if (!_this.data.typeId) {
// 危险通知
app.vantNotifyErrTop(Notify, '请选择故障类型!')
return
}
// 提交参数
let data = {
"repair": {
id: _this.data.id,
typeId: _this.data.typeId,
typeName: _this.data.typeName,
deviceId: _this.data.deviceId,
deviceName: _this.data.deviceName,
},
"content": '重新指派设备类型',
"operate": "NEXT"
}
flowHandleRq(data).then(res => {
console.log('flowHandleRq', res);
if (res.code == 0) {
app.vantNotifySuccessTop(Notify, res.msg)
wx.navigateBack({
delta: 2
})
} else {
app.vantNotifyErrTop(Notify, res.msg)
}
})
},
/**

View File

@ -1,6 +1,9 @@
{
"navigationStyle": "custom",
"usingComponents": {
"van-icon": "@vant/weapp/icon/index"
"van-icon": "@vant/weapp/icon/index",
"van-popup": "@vant/weapp/popup/index",
"van-notify": "@vant/weapp/notify/index",
"van-picker": "@vant/weapp/picker/index"
}
}

View File

@ -22,28 +22,36 @@
</view>
<view class="reportView">
<view class="topTitle">反馈</view>
<view class="topTitle">派单反馈</view>
<view class="selfLine"></view>
<view class="itemLineView">
<view class="label">反馈人员</view>
<view class="content">王军</view>
<view class="content">{{currentLog.recUserName}}</view>
</view>
<view class="itemLineView">
<view class="label">反馈描述</view>
<view class="content">类型不一致类型不一致类型不一致类型不一致类型不一致</view>
<view class="content">{{currentLog.content}}</view>
</view>
</view>
<view class="reportView">
<view class="topTitle">故障类型</view>
<view class="selfLine"></view>
<view class="itemLineCenterView">
<view class="label">请选择重新选择故障类型</view>
<view class="itemLineCenterView" bind:tap="showType">
<view class="label">{{ typeName ? typeName + '/' + deviceName : '请选择故障类型' }}</view>
<van-icon name="arrow" color="gray" size="34rpx" />
</view>
<view class="tijiaoBtn">提交</view>
</view>
</view>
<view class="tijiaoBtn" bind:tap="submit">提交</view>
</view>
<!-- 故障类型 -->
<van-popup show="{{ typeVisible }}" position="bottom" custom-style="height: 50vh;" bind:close="hideType">
<van-picker show-toolbar columns="{{ typeColumns }}" bind:change="typeColumnsChange" bind:confirm="typeColumnsConfirm" bind:cancel="hideType" />
</van-popup>
<!-- 在页面内添加对应的节点 -->
<van-notify id="van-notify" />

View File

@ -17,6 +17,7 @@ Page({
id: '',
detail: {},
files: {},
currentLog: {},
innerAudioContext: null, // 音频对象
innerAudioContextIsPlay: false, // 音频对象-是否播放
},
@ -56,6 +57,17 @@ Page({
item.url = app.IMG_NAME + item.url
return item
})
// 日志
if (detail.logId) {
let firstLog = res.log.find(item => item.id == detail.logId)
if (firstLog) {
let preLog = res.log.find(item => item.id == firstLog.pid)
_this.setData({
currentLog: preLog
})
}
}
_this.setData({
detail,
files

View File

@ -84,11 +84,11 @@
<view class="selfLine"></view>
<view class="itemLineView">
<view class="label">反馈人员</view>
<view class="content">王军</view>
<view class="content">{{currentLog.recUserName}}</view>
</view>
<view class="itemLineView">
<view class="label">反馈描述</view>
<view class="content">类型不一致类型不一致类型不一致类型不一致类型不一致</view>
<view class="content">{{currentLog.content}}</view>
</view>
</view>