Commit 7ff40264 by 岑成威

Merge branch 'saas+v5.8.3' of 192.168.3.233:glsx/gl_tape into saas+v5.8.3

2 parents 40dd0a8f e4e0e1dd
...@@ -32,10 +32,10 @@ export default { ...@@ -32,10 +32,10 @@ export default {
type: String, type: String,
default: 'uuid' default: 'uuid'
}, },
/** 转化人员(驻店零售)模式,与 OrderPopup 转化人员选择项一致 */ // default: 销售顾问;seller: 转化人员/驻店零售
sellerUser: { employeeType: {
type: Boolean, type: String,
default: false default: 'default'
} }
}, },
data () { data () {
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
selectedId () { selectedId () {
if (Array.isArray(this.list) || this.sellerUser) { if (Array.isArray(this.list) || this.employeeType === 'seller') {
return this.salesPropsUuid return this.salesPropsUuid
} }
return this.$store.state.user.customerInfo.salesUuid || this.salesPropsUuid return this.$store.state.user.customerInfo.salesUuid || this.salesPropsUuid
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
if (Array.isArray(this.list)) { if (Array.isArray(this.list)) {
return this.list return this.list
} }
if (this.sellerUser) { if (this.employeeType === 'seller') {
return this.sellerEmployeeList return this.sellerEmployeeList
} }
return this.$store.state.user.employeeList return this.$store.state.user.employeeList
...@@ -78,15 +78,16 @@ export default { ...@@ -78,15 +78,16 @@ export default {
this.$refs.employeeBoxVisible.open() this.$refs.employeeBoxVisible.open()
if (Array.isArray(this.list)) return if (Array.isArray(this.list)) return
const userInfo = uni.$storage.get("userInfo") const userInfo = uni.$storage.get("userInfo")
if (this.sellerUser) { if (this.employeeType === 'seller') {
const { sceneType, merchantId } = userInfo const { merchantId } = userInfo
const apiTargetName = sceneType == 1 ? 'getEmployeeList' : 'getOrderScreenEmployeeList' uni.$api.popupApi
uni.$api.popupApi[apiTargetName]({ .getEmployeeList({
merchantId, merchantId,
sceneList: '' sceneList: ''
}).then((res) => { })
this.sellerEmployeeList = res || [] .then((res) => {
}) this.sellerEmployeeList = res || []
})
return return
} }
const { shopMerchantId } = userInfo const { shopMerchantId } = userInfo
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
/> />
<image <image
v-if="goodsInfo.isMainPush == 1"
class="prelearn-entrance" class="prelearn-entrance"
:style="prelearnButtonStyle" :style="prelearnButtonStyle"
:src="require('@/assets/images/common/icon-prestudy-entrance.webp')" :src="require('@/assets/images/common/icon-prestudy-entrance.webp')"
......
...@@ -114,7 +114,6 @@ ...@@ -114,7 +114,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="popup"> <view class="popup">
<car-brands <car-brands
ref="carBrandVisible" ref="carBrandVisible"
...@@ -131,8 +130,8 @@ ...@@ -131,8 +130,8 @@
></reception-sence> ></reception-sence>
<employee <employee
ref="residentSaleVisible" ref="residentSaleVisible"
title="驻店零售" :title="employeeSelectKey === 'sellerUserId' ? '驻店零售' : '流量来源'"
:sellerUser="employeeSelectKey === 'sellerUserId'" :employeeType="employeeSelectKey === 'sellerUserId' ? 'seller' : 'default'"
:salesPropsUuid="employeeSelectKey ? customerInfo[employeeSelectKey] : ''" :salesPropsUuid="employeeSelectKey ? customerInfo[employeeSelectKey] : ''"
@select="handleSelect($event, 'residentSaleVisible')" @select="handleSelect($event, 'residentSaleVisible')"
/> />
...@@ -146,14 +145,12 @@ ...@@ -146,14 +145,12 @@
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue' import ReceptionSence from '@/components/HomeFrame/components/ReceptionCenter/ReceptionSence.vue'
import Employee from '@/components/Employee.vue' import Employee from '@/components/Employee.vue'
import { validateVin, formatVinInput } from '@/utils/vinVaildate' import { validateVin, formatVinInput } from '@/utils/vinVaildate'
const phoneRex = /^[1]([3-9])[0-9]{9}$/, const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{ default_customerForm = [{
label: '车主姓名', label: '车主姓名',
...@@ -217,8 +214,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -217,8 +214,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
}, },
{ {
label: '到店日期', label: '到店日期',
valueKey: 'arrivalDate', valueKey: 'inviteDate',
key: 'arrivalDate', key: 'inviteDate',
type: 'date' type: 'date'
}, },
{ {
...@@ -233,7 +230,6 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -233,7 +230,6 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
type: 'select', type: 'select',
popKey: 'residentSaleVisible' popKey: 'residentSaleVisible'
}] }]
export default { export default {
name: 'AddFiles', name: 'AddFiles',
components: { CarBrands, ReceptionSence, Employee }, components: { CarBrands, ReceptionSence, Employee },
...@@ -260,7 +256,8 @@ export default { ...@@ -260,7 +256,8 @@ export default {
startDate: '', startDate: '',
endDate: '', endDate: '',
validateState: true, validateState: true,
employeeSelectKey: '' employeeSelectKey: '',
inviteDateTouched: false
} }
}, },
onLoad (options) { onLoad (options) {
...@@ -298,8 +295,10 @@ export default { ...@@ -298,8 +295,10 @@ export default {
merchantName: '', merchantName: '',
sellerName: '', sellerName: '',
sellerUserId: '', sellerUserId: '',
inviteDate: '',
filingDate: '' filingDate: ''
} }
this.inviteDateTouched = false
if (this.customerId) this.findVisitsInfo() if (this.customerId) this.findVisitsInfo()
}, },
async findVisitsInfo () { async findVisitsInfo () {
...@@ -307,8 +306,10 @@ export default { ...@@ -307,8 +306,10 @@ export default {
id: this.customerId id: this.customerId
}) })
if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD") if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD") if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res this.customerInfo = res
this.inviteDateTouched = !!res.inviteDate
}, },
backPage () { backPage () {
uni.navigateBack({ uni.navigateBack({
...@@ -357,7 +358,14 @@ export default { ...@@ -357,7 +358,14 @@ export default {
} }
}, },
bindDateChange (e, valueKey) { bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value const value = e.detail.value
this.customerInfo[valueKey] = value
if (valueKey === 'arrivalDate' && !this.inviteDateTouched) {
this.customerInfo.inviteDate = value
}
if (valueKey === 'inviteDate') {
this.inviteDateTouched = true
}
}, },
inputBlur (e, val) { inputBlur (e, val) {
const standNoVal = this.customerInfo.standNo const standNoVal = this.customerInfo.standNo
...@@ -435,6 +443,8 @@ export default { ...@@ -435,6 +443,8 @@ export default {
merchantId:params.merchantId, merchantId:params.merchantId,
employeeName:params.employeeName, employeeName:params.employeeName,
sellerMerchantId:params.sellerMerchantId, sellerMerchantId:params.sellerMerchantId,
sellerUserId: params.sellerUserId,
sellerName: customerInfo.sellerName,
preliminaryOrders: [ preliminaryOrders: [
{ {
sceneType:1, sceneType:1,
...@@ -451,7 +461,7 @@ export default { ...@@ -451,7 +461,7 @@ export default {
employeeName:params.employeeName, employeeName:params.employeeName,
userId:params.userId, userId:params.userId,
deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期 deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期
inviteDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //到店日期 inviteDate: params.inviteDate ? params.inviteDate + ' 00:00:00' : params.inviteDate, //到店日期
createdDate: params.filingDate, //建档日期 createdDate: params.filingDate, //建档日期
sellerUserld: params.sellerUserId, sellerUserld: params.sellerUserId,
sellerName: customerInfo.sellerName, sellerName: customerInfo.sellerName,
...@@ -498,7 +508,6 @@ export default { ...@@ -498,7 +508,6 @@ export default {
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.detail-box { .detail-box {
position: relative; position: relative;
...@@ -509,7 +518,6 @@ export default { ...@@ -509,7 +518,6 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: toRpx(160) toRpx(64) 0; padding: toRpx(160) toRpx(64) 0;
} }
.nav-bar { .nav-bar {
position: fixed; position: fixed;
width: 100%; width: 100%;
...@@ -518,7 +526,6 @@ export default { ...@@ -518,7 +526,6 @@ export default {
top: toRpx(48); top: toRpx(48);
z-index: 999; z-index: 999;
pointer-events: none; pointer-events: none;
.back { .back {
height: 100%; height: 100%;
aspect-ratio: 1/1; aspect-ratio: 1/1;
...@@ -527,7 +534,6 @@ export default { ...@@ -527,7 +534,6 @@ export default {
justify-content: center; justify-content: center;
pointer-events: auto; pointer-events: auto;
} }
.title { .title {
position: absolute; position: absolute;
top: 50%; top: 50%;
...@@ -538,11 +544,9 @@ export default { ...@@ -538,11 +544,9 @@ export default {
color: #1a1a1a; color: #1a1a1a;
} }
} }
.detail-content { .detail-content {
height: calc(100vh - #{toRpx(212)}); height: calc(100vh - #{toRpx(212)});
overflow-y: auto; overflow-y: auto;
.detail-panel { .detail-panel {
width: 100%; width: 100%;
min-height: 100%; min-height: 100%;
...@@ -554,7 +558,6 @@ export default { ...@@ -554,7 +558,6 @@ export default {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.form-header { .form-header {
width: 100%; width: 100%;
height: 28px; height: 28px;
...@@ -568,7 +571,6 @@ export default { ...@@ -568,7 +571,6 @@ export default {
} }
} }
} }
.form-box { .form-box {
flex-shrink: 0; flex-shrink: 0;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -582,18 +584,15 @@ export default { ...@@ -582,18 +584,15 @@ export default {
height: toRpx(80); height: toRpx(80);
font-size: toRpx(28); font-size: toRpx(28);
} }
.label { .label {
width: toRpx(192); width: toRpx(192);
color: #292d33; color: #292d33;
justify-content: center; justify-content: center;
.required { .required {
color: #f24724; color: #f24724;
font-size: toRpx(28); font-size: toRpx(28);
} }
} }
.input, .input,
.select { .select {
width: toRpx(738); width: toRpx(738);
...@@ -607,44 +606,36 @@ export default { ...@@ -607,44 +606,36 @@ export default {
line-height: toRpx(76); line-height: toRpx(76);
padding: 0 toRpx(32) !important; padding: 0 toRpx(32) !important;
font-size: toRpx(28); font-size: toRpx(28);
&::placeholder { &::placeholder {
color: #33333333; color: #33333333;
} }
.value { .value {
max-width: toRpx(598); max-width: toRpx(598);
} }
} }
.placeholderStyle { .placeholderStyle {
color: #33333333; color: #33333333;
} }
.arrow { .arrow {
color: #999 !important; color: #999 !important;
margin-left: auto; margin-left: auto;
flex-shrink: 0; flex-shrink: 0;
} }
.calendar-icon { .calendar-icon {
width: 16px; width: 16px;
height: 16px; height: 16px;
margin-left: auto; margin-left: auto;
flex-shrink: 0; flex-shrink: 0;
} }
.error { .error {
border: toRpx(2) solid #f24724 !important; border: toRpx(2) solid #f24724 !important;
} }
} }
.btns { .btns {
justify-content: center; justify-content: center;
gap: 0 toRpx(34); gap: 0 toRpx(34);
padding-bottom: toRpx(32); padding-bottom: toRpx(32);
flex-shrink: 0; flex-shrink: 0;
.btn { .btn {
width: toRpx(718); width: toRpx(718);
height: toRpx(80); height: toRpx(80);
...@@ -657,14 +648,12 @@ export default { ...@@ -657,14 +648,12 @@ export default {
font-size: toRpx(32); font-size: toRpx(32);
color: #ffffff; color: #ffffff;
} }
.cancel { .cancel {
background: #dae9ff; background: #dae9ff;
color: #2c66f7; color: #2c66f7;
} }
.disabled { .disabled {
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%); background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -29,7 +29,7 @@ import dayjs from 'dayjs' ...@@ -29,7 +29,7 @@ import dayjs from 'dayjs'
export default { export default {
name: 'DateTime', name: 'DateTime',
inject: ['userInfo'], inject: ['userInfo'],
data () { data() {
return { return {
hours: [], hours: [],
days: [], days: [],
...@@ -44,18 +44,18 @@ export default { ...@@ -44,18 +44,18 @@ export default {
}, },
mounted () { mounted() {
this.initDate() this.initDate()
}, },
methods: { methods: {
initDate () { initDate() {
this.dateValues = [] this.dateValues = []
this.hourValues = [] this.hourValues = []
this.minuteValues = [] this.minuteValues = []
const today = new Date() const today = new Date()
this.getDateList('2019/01/01', new Date(today.getFullYear(), today.getMonth(), today.getDate())) this.getDateList('2019/01/01', new Date(today.getFullYear(), today.getMonth(), today.getDate()))
}, },
getDateList (starDay, endDay) { getDateList(starDay, endDay) {
const arr = []; const arr = [];
const dates = []; const dates = [];
...@@ -74,16 +74,19 @@ export default { ...@@ -74,16 +74,19 @@ export default {
// 获取每一天的时间 YY-MM-DD // 获取每一天的时间 YY-MM-DD
for (const j in arr) { for (const j in arr) {
const time = new Date(arr[j]); const time = dayjs(arr[j]);
const year = time.getFullYear(); if (!time.isValid()) continue; // 跳过无效日期
const mouth = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1); const year = time.year();
const day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate(); const month = time.month() + 1; // 注意:dayjs 的 month() 返回 0-11
const YYMMDD = year + '/' + mouth + '/' + day; const day = time.date();
const mouthStr = month >= 10 ? month : '0' + month;
const dayStr = day >= 10 ? day : '0' + day;
const YYMMDD = year + '/' + mouthStr + '/' + dayStr;
dates.push(YYMMDD); dates.push(YYMMDD);
} }
this.getHourList(dates) this.getHourList(dates)
}, },
getHourList (days) { getHourList(days) {
const hours = [], today = new Date(); const hours = [], today = new Date();
for (let hour = 0; hour < today.getHours() + 1; hour++) { for (let hour = 0; hour < today.getHours() + 1; hour++) {
hours.push(hour.toString().padStart(2, '0')); hours.push(hour.toString().padStart(2, '0'));
...@@ -91,7 +94,7 @@ export default { ...@@ -91,7 +94,7 @@ export default {
this.getMinuteList(days, hours) this.getMinuteList(days, hours)
}, },
getMinuteList (days, hours) { getMinuteList(days, hours) {
const minutes = []; const minutes = [];
const today = new Date() const today = new Date()
for (let minute = 0; minute < today.getMinutes() + 1; minute++) { for (let minute = 0; minute < today.getMinutes() + 1; minute++) {
...@@ -123,7 +126,7 @@ export default { ...@@ -123,7 +126,7 @@ export default {
}, 100) }, 100)
this.$emit('onComplete') this.$emit('onComplete')
}, },
changeDate (e) { changeDate(e) {
const { days } = this const { days } = this
const { value } = e.detail const { value } = e.detail
const index = value[0] const index = value[0]
...@@ -133,7 +136,7 @@ export default { ...@@ -133,7 +136,7 @@ export default {
const timeType = this.currentDate != today ? 1 : 0 const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTime(timeType) this.getAllTimeOrPartTime(timeType)
}, },
changeHour (e) { changeHour(e) {
const { hours, days, dateValues } = this const { hours, days, dateValues } = this
const { value } = e.detail const { value } = e.detail
const index = value[0] const index = value[0]
...@@ -146,13 +149,13 @@ export default { ...@@ -146,13 +149,13 @@ export default {
const timeType = this.currentDate != today ? 1 : 0 const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTimeMinute(timeType) this.getAllTimeOrPartTimeMinute(timeType)
}, },
changeMinutes (e) { changeMinutes(e) {
const { minutes } = this const { minutes } = this
const { value } = e.detail const { value } = e.detail
const index = value[0] const index = value[0]
this.currentMinute = minutes[index] this.currentMinute = minutes[index]
}, },
getAllTimeOrPartTime (type) { getAllTimeOrPartTime(type) {
const today = new Date() const today = new Date()
const hours = [], minutes = [], hour_len = type == 1 ? 24 : today.getHours() + 1, minute_len = type == 1 ? 60 : today.getMinutes() + 1; const hours = [], minutes = [], hour_len = type == 1 ? 24 : today.getHours() + 1, minute_len = type == 1 ? 60 : today.getMinutes() + 1;
for (let hour = 0; hour < hour_len; hour++) { for (let hour = 0; hour < hour_len; hour++) {
...@@ -164,7 +167,7 @@ export default { ...@@ -164,7 +167,7 @@ export default {
this.hours = hours this.hours = hours
this.minutes = minutes this.minutes = minutes
}, },
getAllTimeOrPartTimeMinute (type) { getAllTimeOrPartTimeMinute(type) {
const today = new Date() const today = new Date()
const currentHour = today.getHours() const currentHour = today.getHours()
const timeType = this.currentHour != currentHour ? 1 : 0 const timeType = this.currentHour != currentHour ? 1 : 0
...@@ -174,9 +177,9 @@ export default { ...@@ -174,9 +177,9 @@ export default {
} }
this.minutes = minutes this.minutes = minutes
}, },
getResult () { getResult() {
let str = '' let str = ''
str = this.currentDate + ' ' + this.currentHour + ':' + this.currentMinute str = this.currentDate + ' ' + this.currentHour + ':' + this.currentMinute
// + ":00" // + ":00"
const result = dayjs(str).format('YYYY-MM-DD HH:mm') const result = dayjs(str).format('YYYY-MM-DD HH:mm')
return result return result
...@@ -190,9 +193,11 @@ export default { ...@@ -190,9 +193,11 @@ export default {
height: 100%; height: 100%;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
.picker { .picker {
height: 100%; height: 100%;
text-align: center; text-align: center;
.view { .view {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -201,6 +206,7 @@ export default { ...@@ -201,6 +206,7 @@ export default {
height: toRpx(72); height: toRpx(72);
} }
} }
/deep/.indicator { /deep/.indicator {
height: toRpx(72); height: toRpx(72);
} }
......
...@@ -65,12 +65,14 @@ export default { ...@@ -65,12 +65,14 @@ export default {
confirmText: '确认', confirmText: '确认',
}, },
goodsInfo: {}, goodsInfo: {},
enteredViaRow: false,
isMainPush: null,
prelearnContext: { prelearnContext: {
activityId: '', activityId: '',
activityProductId: '', activityProductId: '',
staffUuid: uni.$storage.get('userInfo').uuid, staffUuid: uni.$storage.get('userInfo').uuid,
staffName: uni.$storage.get('userInfo').name, staffName: uni.$storage.get('userInfo').name,
merchantId: String(uni.$storage.get('userInfo').merchantId ?? ''), merchantId: String(uni.$storage.get('userInfo').shopMerchantId ?? ''),
entrySource: 'home_popup', entrySource: 'home_popup',
skipCount: 0, skipCount: 0,
}, },
...@@ -164,7 +166,9 @@ export default { ...@@ -164,7 +166,9 @@ export default {
if (options.row) { if (options.row) {
try { try {
this.goodsInfo = JSON.parse(decodeURIComponent(options.row)) this.goodsInfo = JSON.parse(decodeURIComponent(options.row))
console.log('[prelearnBridge] 商品完整数据 goodsInfo:', this.goodsInfo) this.enteredViaRow = true
this.isMainPush = this.goodsInfo.isMainPush ?? null
console.log('[prelearnBridge] 商品完整数据 goodsInfo:', this.goodsInfo, 'isMainPush:', this.isMainPush)
const productId =this.goodsInfo.productId const productId =this.goodsInfo.productId
if (productId) { if (productId) {
...@@ -735,7 +739,43 @@ export default { ...@@ -735,7 +739,43 @@ export default {
} }
// #endif // #endif
}, },
async checkMainPushStaffLearnStatus() {
const res = await uni.$api.activityApi.getPrelearnScriptBoardAPI({
activityId: this.goodsInfo.activityId || this.prelearnContext.activityId,
activityProductId: this.goodsInfo.productId || this.prelearnContext.activityProductId,
})
console.log('[prelearnBridge] getPrelearnScriptBoardAPI res:', res)
return Number(res?.staffLearnStatus) === 1
},
showMainPushBackTip() {
uni.showModal({
title: '提示',
content: '请先完成预学习后再退出',
showCancel: false,
confirmText: '知道了',
})
},
async back() { async back() {
if (this.enteredViaRow && Number(this.isMainPush) !== 1) {
this.navigateBack()
return
}
if (Number(this.isMainPush) === 1) {
try {
const learned = await this.checkMainPushStaffLearnStatus()
if (learned) {
this.navigateBack()
return
}
this.showMainPushBackTip()
} catch (error) {
console.error('[prelearnBridge] 预学习状态查询失败:', error)
this.showMainPushBackTip()
}
return
}
try { try {
const res = await uni.$api.commonApi.getPrelernHomePopupAPI() const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
console.log('[prelearnBridge] getPrelernHomePopupAPI res:', res) console.log('[prelearnBridge] getPrelernHomePopupAPI res:', res)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!