Commit a5530224 by zhangxw

bug修复

1 parent 5eb6bfe5
......@@ -9,14 +9,7 @@ Component({
type: Boolean,
observer: function(n) {
if (n) {
let { artificerList, orderInfo, copyArtificerList } = this.data
artificerList.map(i => {
i.active = false
if (i.id == orderInfo?.technicianId) {
i.active = true
}
return i
})
let { copyArtificerList, orderInfo } = this.data
copyArtificerList.map(i => {
i.active = false
if (i.id == orderInfo?.technicianId) {
......@@ -25,15 +18,15 @@ Component({
return i
})
this.setData({
artificerList,
copyArtificerList
artificerList: copyArtificerList,
selectedTechnicianId: orderInfo?.technicianId,
searchValue: ''
})
}
}
},
title: String,
orderInfo: Object,
artificerList: Array,
copyArtificerList: Array
},
......@@ -42,7 +35,9 @@ Component({
*/
data: {
orderObj: {},
IMG_URL
IMG_URL,
artificerList: [],
searchValue: ''
},
/**
......@@ -50,15 +45,23 @@ Component({
*/
methods: {
search(e) {
let { artificerList, copyArtificerList } = this.data
let { copyArtificerList } = wx.$util.deepClone(this.data)
let { selectedTechnicianId } = this.data
let { value } = e.detail
if (!value) {
copyArtificerList.map(i => {
i.active = false
if (i.id == selectedTechnicianId) i.active = true
return i
})
this.setData({
artificerList: copyArtificerList
})
} else {
let arr = []
artificerList.map(i => {
copyArtificerList.map(i => {
i.active = false
if (i.id == selectedTechnicianId) i.active = true
if (i.technicianName.indexOf(value) != -1) {
arr.push(i)
}
......@@ -70,7 +73,7 @@ Component({
},
changeItem(e) {
let { target } = e.currentTarget.dataset
let { artificerList } = this.data
let { artificerList, copyArtificerList } = this.data
artificerList.map(i => {
i.active = false
if (i.id == target?.id) {
......@@ -78,8 +81,17 @@ Component({
}
return i
})
copyArtificerList.map(i => {
i.active = false
if (i.id == target?.id) {
i.active = true
}
return i
})
this.setData({
artificerList
artificerList: artificerList,
copyArtificerList: copyArtificerList,
selectedTechnicianId: target.id
})
},
cancel() {
......@@ -89,8 +101,8 @@ Component({
})
},
async confirm() {
let { artificerList, orderInfo } = this.data
let arr = artificerList?.filter(v => v.active) || []
let { copyArtificerList, orderInfo } = this.data
let arr = copyArtificerList?.filter(v => v.active) || []
if (!arr.length) {
return wx.$util.showToast('请选择技师')
}
......
......@@ -3,7 +3,7 @@
<view class="box">
<view class="sub-title text-center">{{title}}</view>
<view class="artificer-box">
<search-input bindsearch="search" />
<search-input bindsearch="search" value="{{searchValue}}" />
<view class="box-title">技师</view>
<scroll-view scroll-y style="height: calc(100% - 194rpx);" enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{artificerList}}" wx:key="index">
......
......@@ -8,7 +8,10 @@
</view>
</navigation-bar>
<order-list id="order-list" navBarHeight="{{navBarHeight}}" ActivityList="{{ActivityList}}"></order-list>
<block wx:if="{{navBarHeight && showPage}}">
<order-list id="order-list" navBarHeight="{{navBarHeight}}" ActivityList="{{ActivityList}}"></order-list>
</block>
<top-select-picker show="{{showStorePicker}}" selectObj="{{selectObj}}" bindsearch="getStoreList" defaultSelectInfo="{{defaultSelectInfo}}" items="{{storeListRange}}" bindconfirm="changePicker"></top-select-picker>
......@@ -328,8 +328,7 @@ Page({
this.setData({
customerObj,
artificerList: orderInfo?.technicianConfigDTOList,
orderInfo,
copyArtificerList: orderInfo?.technicianConfigDTOList
orderInfo
})
},
......
......@@ -200,8 +200,7 @@
<artificer-select-popup
show="{{artificerSelectPopup}}"
title="选择技师"
artificerList="{{artificerList}}"
copyArtificerList="{{artificerList}}"
orderInfo="{{orderInfo}}"
copyArtificerList="{{copyArtificerList}}"
bindconfirm="changeArtificer" />
......@@ -239,8 +239,7 @@ Page({
orderObj,
first: true,
flag: true,
artificerList: orderObj?.technicianConfigDTOList,
copyArtificerList: orderObj?.technicianConfigDTOList
artificerList: orderObj?.technicianConfigDTOList
})
},
getSetting() {
......
......@@ -236,7 +236,6 @@
<artificer-select-popup
show="{{artificerSelectPopup}}"
title="选择技师"
artificerList="{{artificerList}}"
copyArtificerList="{{artificerList}}"
orderInfo="{{orderObj}}"
bindconfirm="changeArtificer"
copyArtificerList="{{copyArtificerList}}" />
bindconfirm="changeArtificer" />
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!