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