Commit a5530224 by zhangxw

bug修复

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