Commit fdfbb6a6 by 李伟康

Merge branch 'v1.0.1' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.1

2 parents 1b9aaa4f fe6c8b12
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-04-07 14:54:28 * @Date: 2024-04-07 14:54:28
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-04-09 18:43:19 * @LastEditTime: 2024-04-09 19:22:47
--> -->
<template> <template>
<view class="information-entry"> <view class="information-entry">
...@@ -17,7 +17,12 @@ ...@@ -17,7 +17,12 @@
:key="item.title" :key="item.title"
> >
<view class="upload-img" v-if="item.imgUrl"> <view class="upload-img" v-if="item.imgUrl">
<image class="img" :src="item.imgUrl" mode="top" @click="preview(index)" /> <image
class="img"
:src="item.imgUrl"
mode="top"
@click="preview(index)"
/>
<uni-icons <uni-icons
class="upload-close" class="upload-close"
type="clear" type="clear"
...@@ -37,11 +42,7 @@ ...@@ -37,11 +42,7 @@
</view> </view>
<view class="information-done" @click="done()">完成接待</view> <view class="information-done" @click="done()">完成接待</view>
<uni-popup ref="preview" type="center" border-radius="10px 10px 0 0"> <uni-popup ref="preview" type="center" border-radius="10px 10px 0 0">
<image <image class="preview-img" :src="previewImg" mode="aspectFit" />
class="preview-img"
:src="previewImg"
mode="aspectFit"
/>
</uni-popup> </uni-popup>
<MessageBox <MessageBox
v-if="messageBoxVisible" v-if="messageBoxVisible"
...@@ -49,7 +50,7 @@ ...@@ -49,7 +50,7 @@
@confirm="submit" @confirm="submit"
confirmBtnText="保存" confirmBtnText="保存"
:popupW="704" :popupW="704"
:popupH="800" :popupH="820"
> >
<view name="content"> <view name="content">
<view class="pop-tips" <view class="pop-tips"
...@@ -59,12 +60,20 @@ ...@@ -59,12 +60,20 @@
<template v-for="(i, index) in formObject"> <template v-for="(i, index) in formObject">
<view class="form-item" :key="index"> <view class="form-item" :key="index">
<view class="label">{{ i.label }}</view> <view class="label">{{ i.label }}</view>
<view> <view class="value">
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
<uni-easyinput v-model="formData[i.key]" class="value" placeholder="请输入内容" :maxlength="i.maxlength"></uni-easyinput> <input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="formData[i.key]"
class="input"
/>
</template> </template>
<template v-else> <template v-else>
<uni-easyinput class="uni-mt-5 value" suffixIcon="down" v-model="formData[i.key]" @focus="showPop(i.key)" clearable placeholder="请选择内容"></uni-easyinput> <view class="select" @click="showPopup(i.popKey)">
{{ formData[i.key] }}
<uni-icons class="arrow" type="down" :size="16"></uni-icons>
</view>
</template> </template>
</view> </view>
</view> </view>
...@@ -80,6 +89,46 @@ ...@@ -80,6 +89,46 @@
cancelBtnText="否" cancelBtnText="否"
confirmBtnText="是" confirmBtnText="是"
></MessageBox> ></MessageBox>
<MessageBox
position="bottom"
v-if="carBoxVisible"
:isFooter="false"
title="请选择车型"
@cancel="carBoxVisible = false"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked: selectId == item.id }"
@click="handleSelect(item, 'carBoxVisible')"
v-for="(item, index) in carlist"
:key="index"
>
{{ item.name }}
</view>
</view>
</MessageBox>
<template v-if="employeeBoxVisible">
<MessageBox
position="bottom"
:popupH="480"
:isFooter="false"
title="请选择销售"
@cancel="employeeBoxVisible = false"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked: selectId == item.id }"
@click="handleSelect(item, 'employeeBoxVisible')"
v-for="(item, index) in employeeList"
:key="index"
>
{{ item.staffName }}
</view>
</view>
</MessageBox>
</template>
</view> </view>
</template> </template>
<script> <script>
...@@ -100,6 +149,7 @@ const INFO_LIST = [ ...@@ -100,6 +149,7 @@ const INFO_LIST = [
}, },
]; ];
import myClick from "@/mixin/click"; import myClick from "@/mixin/click";
import env from "../../env";
export default { export default {
mixins: [myClick], mixins: [myClick],
data() { data() {
...@@ -125,21 +175,29 @@ export default { ...@@ -125,21 +175,29 @@ export default {
label: "车型", label: "车型",
key: "carModel", key: "carModel",
type: "select", type: "select",
popKey: "carBoxVisible",
}, },
{ {
label: "销售姓名", label: "销售姓名",
key: "sales", key: "staffName",
type: "select", type: "select",
popKey: "employeeBoxVisible",
}, },
], ],
formData: { formData: {
customerName: '', customerName: '',
phoneNumber: '',
carModel: '', carModel: '',
sales: '' phoneNumber: '',
salesUuid: '',
staffName: ''
}, },
carBoxVisible: false, carBoxVisible: false,
previewImg: '' previewImg: "",
isPass: false,
carBoxVisible: false,
employeeBoxVisible: false,
carlist: [],
employeeList: [],
}; };
}, },
onLoad(options) { onLoad(options) {
...@@ -147,6 +205,10 @@ export default { ...@@ -147,6 +205,10 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: text, title: text,
}); });
this.$store.dispatch("getCustomerInfo").then((customerInfo) => {
this.isPass = Object.values(customerInfo).every((value) => !!value);
});
}, },
watch: { watch: {
infoList: { infoList: {
...@@ -178,28 +240,61 @@ export default { ...@@ -178,28 +240,61 @@ export default {
}, },
// 完成接待按钮 // 完成接待按钮
done() { done() {
this.messageBoxVisible = true if (this.isPass) {
this.stopAudio();
} else {
let userInfo = uni.$storage.get("userInfo");
uni.$api.commonApi
.getCarBrandsList({
brandId: env.index == 3 ? 2365 : 2978,
childBrandId: env.index == 3 ? 2695 : 3454,
})
.then((res) => {
this.carlist = res;
});
uni.$api.commonApi
.getEmployeeList({
merchantId: userInfo.shopMerchantId,
})
.then((res) => {
this.employeeList = res;
});
this.messageBoxVisible = true; // 打开完善用户信息弹窗
}
}, },
// 保存 // 保存
submit() { submit() {
console.log(this.formData) console.log(this.formData);
this.messageBoxVisible = false this.messageBoxVisible = false;
this.stopAudio(); this.stopAudio();
}, },
// 选择车型与销售 // 选择车型与销售
showPop(key) { showPop(key) {
console.log(key) console.log(key);
// this.carBoxVisible = true // this.carBoxVisible = true
}, },
// 取消 // 取消
cancel() { cancel() {
this.messageBoxVisible = false this.messageBoxVisible = false;
}, },
// 预览图片 // 预览图片
preview(index) { preview(index) {
this.previewImg = this.infoList[index].imgUrl; this.previewImg = this.infoList[index].imgUrl;
this.$refs.preview.open('center') this.$refs.preview.open("center");
} },
handleSelect(item, popkey) {
console.log(item)
this[popkey] = false;
if (popkey == "employeeBoxVisible") {
this.formData.salesUuid = item.uuid;
this.formData.staffName = item.staffName;
} else this.formData.carModel = item.name;
this.$store.dispatch("setCustomerInfo", this.formData);
console.log(this.formData)
},
showPopup(e) {
this[e] = true;
},
}, },
}; };
</script> </script>
...@@ -308,7 +403,7 @@ export default { ...@@ -308,7 +403,7 @@ export default {
// flex: 50%; // flex: 50%;
display: flex; display: flex;
align-items: center; align-items: center;
color: #6C6C70; color: #6c6c70;
font-size: 30rpx; font-size: 30rpx;
box-sizing: border-box; box-sizing: border-box;
.label { .label {
...@@ -317,7 +412,7 @@ export default { ...@@ -317,7 +412,7 @@ export default {
flex-shrink: 0; flex-shrink: 0;
width: 124rpx; width: 124rpx;
&::before { &::before {
content: '*'; content: "*";
color: #ff0000; color: #ff0000;
position: absolute; position: absolute;
left: -20rpx; left: -20rpx;
...@@ -326,14 +421,22 @@ export default { ...@@ -326,14 +421,22 @@ export default {
} }
} }
.value { .value {
width: 468rpx; width: 428rpx;
margin-left: 16rpx; height: 80rpx;
border: 2rpx solid #e8e8ea;
background: #ffffff;
margin-left: 32rpx;
box-sizing: border-box; box-sizing: border-box;
// padding: 0 40rpx; padding: 0 40rpx;
input, .input,
.select { .select {
width: 100%; width: 100%;
height: 100%; height: 100%;
border: none !important;
outline: none;
}
.input {
height: 70rpx;
} }
.select { .select {
display: flex; display: flex;
...@@ -345,7 +448,24 @@ export default { ...@@ -345,7 +448,24 @@ export default {
} }
} }
} }
.preview-img { .select-box {
// width: 100%; margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
overflow-y: scroll;
height: 100%;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
&.checked {
border: 2rpx solid #292d33;
}
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!