|
|
@@ -3,23 +3,30 @@
|
|
|
<view class="title">请选客户</view>
|
|
|
<view class="app-userList_box">
|
|
|
<block v-for="(item,index) in list" :key="item.id">
|
|
|
- <block v-if="index == 12">
|
|
|
- <view class="user-list-item_box" @click.stop="fastKd()"
|
|
|
+
|
|
|
+ <view class="user-list-item_box" @click.stop="fastKd()" v-if="index == 12"
|
|
|
style="background-color:#3385FF;border:1upx solid #3385FF;text-align:center;">
|
|
|
<view class="head-box">
|
|
|
<view class="name" style="color:white;font-size:15upx;font-weight:bold;">快捷开单</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </block>
|
|
|
- <view @click="confirmCustom(item)" class="user-list-item_box" >
|
|
|
- <view class="head-box">
|
|
|
- <view class="name">{{item.name}}</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+
|
|
|
+ <view class="user-list-item_box" @click.stop="cancelChoose()" v-else-if="index == 13"
|
|
|
+ style="background-color:#a0a5ad;border:1upx solid #a0a5ad;text-align:center;">
|
|
|
+ <view class="head-box">
|
|
|
+ <view class="name" style="color:white;font-size:15upx;font-weight:bold;">取消</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view @click="confirmCustom(item)" class="user-list-item_box" v-else>
|
|
|
+ <view class="head-box">
|
|
|
+ <view class="name">{{item.name}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</block>
|
|
|
<block v-if="list.length && list.length < 6">
|
|
|
<view class="user-list-item_box" @click.stop="fastKd()"
|
|
|
- style="background-color:green;border:1upx solid green;text-align:center;">
|
|
|
+ style="background-color:#3385FF;border:1upx solid #3385FF;text-align:center;">
|
|
|
<view class="head-box">
|
|
|
<view class="name" style="color:white;font-size:15upx;font-weight:bold;">快捷开单</view>
|
|
|
</view>
|
|
|
@@ -28,7 +35,6 @@
|
|
|
</view>
|
|
|
<view style="position: relative;">
|
|
|
<input class="input-serach_box" v-model="searchUser" type="text" :focus="focusInput" @focus="clearInput" @input="changSearch" placeholder-class="input-placeholder" placeholder="请输入客户名称"/>
|
|
|
- <button class="admin-button-com mini-btn default" style="position: absolute;right:40upx;top:-5upx;font-size:15upx;" @click="cancelChoose">取消</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -36,8 +42,12 @@
|
|
|
import { customList } from '@/api/home/index'
|
|
|
export default {
|
|
|
name: "selectCustom",
|
|
|
- components: { },
|
|
|
+ components: {},
|
|
|
props: {
|
|
|
+ myCustomList: {
|
|
|
+ type: Array,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -47,8 +57,22 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.searchCustomer()
|
|
|
+
|
|
|
+ if (!this.$util.isEmpty(this.myCustomList)) {
|
|
|
+ this.list = this.myCustomList
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ myCustomList:{
|
|
|
+ handler(newList){
|
|
|
+ console.log(newList)
|
|
|
+ console.log('-----')
|
|
|
+ this.list = newList
|
|
|
+ },
|
|
|
+ immediate:true
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
fastKd(){
|
|
|
this.$util.hitVoice()
|
|
|
@@ -72,8 +96,8 @@ export default {
|
|
|
searchCustomer() {
|
|
|
customList({ name: this.searchUser,isCashier:1 }).then(res=>{
|
|
|
if(res.code == 1){
|
|
|
- if(res.data.list.length > 13){
|
|
|
- this.list = res.data.list.slice(0,13)
|
|
|
+ if(res.data.list.length > 14){
|
|
|
+ this.list = res.data.list.slice(0,14)
|
|
|
}else{
|
|
|
this.list = res.data.list
|
|
|
}
|