Commit 608fa93d by zhangxw

联调修改

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