Commit 608fa93d by zhangxw

联调修改

1 parent 3f0f239f
......@@ -60,6 +60,7 @@ Component({
val.title = `${val.categoryName}-${val.itemName}`
val.detailList = val.serviceItemList?.map(item => ({
...item,
serviceItemsId: item.id,
active: selectedIds.has(item.id)
}))
})
......
......@@ -127,8 +127,7 @@ Component({
// 根据是否是当前日期决定小时范围
const isToday = defaultTime.dateStr === today.format('yyyy/MM/dd')?.replace(/\//g, '-')
const hourLimit = isToday ? defaultTime.hour + 1 : 24
const hourLimit = isToday ? today.getHours() + 1 : 24
for (let hour = 0; hour < hourLimit; hour++) {
hours.push(hour.toString().padStart(2, '0'));
}
......@@ -142,16 +141,16 @@ Component({
const isToday = defaultTime.dateStr === today.format('yyyy/MM/dd')?.replace(/\//g, '-')
const isCurrentHour = defaultTime.hour === today.getHours()
console.log(defaultTime.hour, today.getHours())
// 分钟范围
const minuteLimit = (isToday && isCurrentHour) ? defaultTime.minute + 1 : 60
const minuteLimit = (isToday && isCurrentHour) ? today.getMinutes() + 1 : 60
for (let minute = 0; minute < minuteLimit; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
// 秒范围
const isCurrentMinute = (isToday && isCurrentHour && defaultTime.minute === today.getMinutes())
const secondLimit = isCurrentMinute ? defaultTime.second + 1 : 60
const secondLimit = isCurrentMinute ? today.getSeconds() + 1 : 60
for (let second = 0; second < secondLimit; second++) {
seconds.push(second.toString().padStart(2, '0'));
}
......@@ -201,9 +200,6 @@ Component({
const index = value[0]
this.currentDate = days[index]
// 验证时间有效性
if (!this.validateTime()) return
const today = new Date().format('yyyy/MM/dd')?.replace(/\//g, '-')
const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTime(timeType)
......@@ -214,10 +210,6 @@ Component({
const { value } = e.detail
const index = value[0]
this.currentHour = hours[index]
// 验证时间有效性
if (!this.validateTime()) return
const today = new Date().format('yyyy/MM/dd')?.replace(/\//g, '-')
const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTimeMinute(timeType)
......@@ -228,10 +220,6 @@ Component({
const { value } = e.detail
const index = value[0]
this.currentMinute = minutes[index]
// 验证时间有效性
if (!this.validateTime()) return
this.updateSecondsByMinute()
},
......@@ -240,9 +228,6 @@ Component({
const { value } = e.detail
const index = value[0]
this.currentSecond = seconds[index]
// 验证时间有效性
this.validateTime()
},
// 新增方法:验证时间有效性
......
......@@ -11,8 +11,9 @@
display: flex;
align-items: center;
justify-content: center;
font-size: var(--fontSize30);
color: #292D33;
font-size: var(--fontSize32);
font-weight: 500;
color: #222222;
}
}
.picker_max{
......
......@@ -12,21 +12,21 @@
<picker-view class="picker" value="{{hourValues}}" indicator-class="indicator" bindchange="changeHour">
<picker-view-column>
<block wx:for="{{hours}}" wx:key="index">
<view class="view">{{item}}</view>
<view class="view">{{item}}时</view>
</block>
</picker-view-column>
</picker-view>
<picker-view wx:if="{{!loading}}" class="picker" value="{{minuteValues}}" indicator-class="indicator" bindchange="changeMinutes">
<picker-view-column>
<block wx:for="{{minutes}}" wx:key="index">
<view class="view">{{item}}</view>
<view class="view">{{item}}分</view>
</block>
</picker-view-column>
</picker-view>
<picker-view wx:if="{{!loading}}" class="picker" value="{{secondValues}}" indicator-class="indicator" bindchange="changeMinutes">
<picker-view wx:if="{{!loading}}" class="picker" value="{{secondValues}}" indicator-class="indicator" bindchange="changeSeconds">
<picker-view-column>
<block wx:for="{{seconds}}" wx:key="index">
<view class="view">{{item}}</view>
<view class="view">{{item}}秒</view>
</block>
</picker-view-column>
</picker-view>
......
......@@ -329,12 +329,14 @@ Page({
const mainTechnicianList = [
...(mainSelected?.map(val => ({
id: val.id,
technicianId: val.id,
technicianName: val.staffName,
technicianUuid: val.uuid,
technicianType: 0
})) || []),
...(deputySelected?.map(val => ({
id: val.id,
technicianId: val.id,
technicianName: val.staffName,
technicianUuid: val.uuid,
technicianType: 1
......
......@@ -2,7 +2,7 @@
const IMG_URL =
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
import api from '../../api'
import { uploadImg, getSceneById } from '~/api/api'
import { uploadImg, getSceneById, staffPermissions } from '~/api/api'
import { setConfigInfo } from '~/store/index'
const app = getApp()
Page({
......@@ -12,7 +12,7 @@ Page({
data: {
IMG_URL,
detailInfo: {},
reworkVisible: true,
reworkVisible: false,
orderObj: [
{
label: '施工单编号',
......@@ -187,7 +187,6 @@ Page({
return
let { userInfo } = this.data
staffPermissions({phone: userInfo?.phone}).then(res => {
console.log(res)
let { code, data, message } = res
if (code == 0) {
this.setData({
......@@ -235,7 +234,7 @@ Page({
},
// 获取施工单详情
getDetail(toTopFlag) {
getDetail() {
let { queryOptions } = this.data
if (!queryOptions.id || !queryOptions.constructionCode) return
api
......@@ -277,11 +276,6 @@ Page({
if (data?.startTime && data?.endTime) {
this.calculateTimeDifference()
}
if (toTopFlag) {
wx.pageScrollTo({
scrollTop: 0
})
}
}
)
} else {
......@@ -499,7 +493,7 @@ Page({
const minutesDiff = Math.floor(timeDiff / (1000 * 60))
// 更新数据
this.setData({
'detailInfo.constructionDuration': minutesDiff
'detailInfo.constructionDuration': `${minutesDiff}`
})
} catch (error) {
console.error('时间计算错误:', error)
......@@ -644,11 +638,7 @@ Page({
submitFlag: false
})
if (code == 0) {
wx.showToast({
title: '完成施工',
icon: 'success'
})
this.getDetail(true)
wx.$router.redirectTo('repairOrderDetail', {id: detailInfo.id, constructionCode: detailInfo.constructionCode, orderCode: detailInfo.orderCode})
} else {
wx.$util.showToast(message)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!