Commit 2fb76a4a by 李伟康

```

refactor(boutique-api): 统一函数空格风格并新增日报校验接口

统一了 boutique.js 中所有函数名与括号间的空格风格,新增 dailyReportCheck 接口用于日报填报前参数校验,并调整部分注释和代码结构。

feat(popup-api): 新增获取提单客户档案列表接口

在 popupApi.js 中新增 getQuotationCustomerList 接口,用于获取提单客户档案列表。

feat(sprite): 更新图标位置及新增 customer-list 图标

调整 sprite.scss 中部分图标的 background-position,并新增 icon-customer-list 图标及相关图片资源。

feat(gl-cell): 支持标题插槽与样式优化

GlCell.vue 组件支持通过 titleList 属性显示区块标题,并可插入自定义内容。同时优化输入框、单选框等组件样式与交互逻辑。

feat(order-popup): 新增年龄范围选择组件

新增 AgeRange.vue 年龄范围选择弹窗组件,提供年龄段选项并支持选中高亮反馈。
```
1 parent f10973ab
......@@ -9,7 +9,7 @@ import http from '../request/http'
module.exports = {
/**获取APP更新 */
findSoureList(data) {
findSoureList (data) {
return http.post({
method: 'dj.api.smartcarlife.recepiton.soure.findSoureList',
projectName: 'boutique',
......@@ -17,7 +17,7 @@ module.exports = {
})
},
/** 查询可发放礼券-分页查询商户券列表 */
findCouponList(data) {
findCouponList (data) {
return http.post({
method: 'dj.api.smartcarlife.merchantCoupon.pageForZYApp',
projectName: 'boutique',
......@@ -28,7 +28,7 @@ module.exports = {
})
},
/**查询用户是否领券 */
findCustomerReceivedStatus(data) {
findCustomerReceivedStatus (data) {
return http.post({
method: 'dj.api.smartcarlife.customerCoupon.pageForZYApp',
projectName: 'boutique',
......@@ -39,7 +39,7 @@ module.exports = {
})
},
/**历史成交客户 */
historyDealOrderPage(data) {
historyDealOrderPage (data) {
return http.post({
method: 'dj.api.smartcarlife.order.historyDealOrder.page',
projectName: 'boutique',
......@@ -47,7 +47,7 @@ module.exports = {
})
},
// 历史订单列表
getQuotationList(data) {
getQuotationList (data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page',
projectName: 'boutique',
......@@ -55,7 +55,7 @@ module.exports = {
})
},
// 历史订单列表
getOrderList(data) {
getOrderList (data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.for.pad.page',
projectName: 'boutique',
......@@ -63,7 +63,7 @@ module.exports = {
})
},
// 新历史订单列表
getOrderListPage(data) {
getOrderListPage (data) {
return http.post({
method: 'dj.pad.api.history.order.page',
projectName: 'pad',
......@@ -71,7 +71,7 @@ module.exports = {
})
},
// 查询延保类类目列表
getGoodsCategoryList(data) {
getGoodsCategoryList (data) {
return http.post({
method: 'dj.pad.api.goodsCategoryConfiguration.extendedWarranty',
projectName: 'pad',
......@@ -80,7 +80,7 @@ module.exports = {
},
/**客户邀约记录 */
customerInviteRecordPage(data) {
customerInviteRecordPage (data) {
return http.post({
method: 'dj.api.smartcarlife.customerInviteRecord.page',
projectName: 'boutique',
......@@ -89,7 +89,7 @@ module.exports = {
},
/**轻改素材配置 */
getBoutiqueMaterialConfig(data) {
getBoutiqueMaterialConfig (data) {
return http.post({
method: 'dj.api.boutique.recepiton.material.merchant.detail',
projectName: 'boutique',
......@@ -98,7 +98,7 @@ module.exports = {
},
/** 案例视频 */
getCaseList(data) {
getCaseList (data) {
return http.post({
method: 'dj.api.smartcarlife.recepiton.material.case.find',
projectName: 'boutique',
......@@ -106,7 +106,7 @@ module.exports = {
})
},
/** 获取类目 */
getCategory(data) {
getCategory (data) {
return http.post({
method: 'dj.api.boutique.recepiton.material.merchant.category',
projectName: 'boutique',
......@@ -116,7 +116,7 @@ module.exports = {
/**
* 客户邀约记录-邀约类型数目统计
*/
getInviteRecordCount(data) {
getInviteRecordCount (data) {
return http.post({
method: 'dj.api.smartcarlife.customerInviteRecord.inviteStatus.count',
projectName: 'boutique',
......@@ -124,7 +124,7 @@ module.exports = {
})
},
// 案例视频中心埋点
caseVideoCenter(data) {
caseVideoCenter (data) {
return http.post({
method: 'dj.api.boutique.reception.material.point.insert',
projectName: 'boutique',
......@@ -133,7 +133,7 @@ module.exports = {
},
// 权益提单相关接口
// 查询店铺配置
getShopMerchantPointConfig(data) {
getShopMerchantPointConfig (data) {
return http.post({
method: 'dj.api.smartcarlife.shopMerchantPointConfig.get',
projectName: 'boutique',
......@@ -141,7 +141,7 @@ module.exports = {
})
},
/** 根据订单状态统计订单数*/
statByStatus(data) {
statByStatus (data) {
return http.post({
method: 'dj.api.smartcarlife.order.statByStatus',
projectName: 'boutique',
......@@ -149,7 +149,7 @@ module.exports = {
})
},
// 根据4s店商户好获取二级流浪方列表
getSubShopMerchantList(data) {
getSubShopMerchantList (data) {
return http.post({
method: 'dj.api.smartcarlife.diversionMerchant.getDiversionMerchantRef',
projectName: 'boutique',
......@@ -157,7 +157,7 @@ module.exports = {
})
},
/**搜索订单(含套餐) */
getWorkPackageGoodsList(data) {
getWorkPackageGoodsList (data) {
return http.post({
method: 'dj.api.smartcarlife.order.search.containPackageGoods',
projectName: 'boutique',
......@@ -165,7 +165,7 @@ module.exports = {
})
},
// 获取商户订单设置
getMerchantRecordingSettings(data) {
getMerchantRecordingSettings (data) {
return http.post({
method: 'dj.api.smartcarlife.recordingSettings.getMerchantRecordingSettings',
projectName: 'boutique',
......@@ -173,7 +173,7 @@ module.exports = {
})
},
// 获取园区店配置
getYqStoreConfig(data) {
getYqStoreConfig (data) {
return http.post({
method: 'dj.api.smarcarlife.yqMerchantConfig.detail',
projectName: 'boutique',
......@@ -181,7 +181,7 @@ module.exports = {
})
},
/**补录订单数 */
waitinputorder(data) {
waitinputorder (data) {
return http.post({
method: 'dj.api.smartcarlife.weapp.waitinputorder.count',
projectName: 'boutique',
......@@ -189,7 +189,7 @@ module.exports = {
})
},
/**交易流水号 */
transactionSerialNumber(data) {
transactionSerialNumber (data) {
return http.post({
method: 'dj.api.smartcarlife.weapp.waitinputorder.page',
projectName: 'boutique',
......@@ -197,7 +197,7 @@ module.exports = {
})
},
// 根据商户号获取可选商品列表
getSelectOrderGoodsList(data) {
getSelectOrderGoodsList (data) {
return http.post({
method: 'dj.api.smartcarlife.selectOrderGoods.list',
projectName: 'boutique',
......@@ -205,7 +205,7 @@ module.exports = {
})
},
/**战败商品列表- upradeFlag(N为基础,Y为升级) */
getOrderBaseGoodsList(data) {
getOrderBaseGoodsList (data) {
return http.post({
method: 'dj.api.smartcarlife.orderUpgradeGoods.listByMerchantId',
projectName: 'boutique',
......@@ -213,7 +213,7 @@ module.exports = {
})
},
/** 选择支付方式下单 */
createWithPay(data) {
createWithPay (data) {
console.log(data)
return http.post({
method: 'dj.api.smartcarlife.order.createWithPay',
......@@ -222,7 +222,7 @@ module.exports = {
})
},
/** 订单补录 */
supplementOrder(data) {
supplementOrder (data) {
return http.post({
method: 'dj.api.smartcarlife.order.supplementOrder',
projectName: 'boutique',
......@@ -230,7 +230,7 @@ module.exports = {
})
},
// 获取精品升级场景 太阳膜类商品部位数据
getPositionList(data) {
getPositionList (data) {
return http.post({
method: 'dj.api.smartcarlife.goodsPosition.list',
projectName: 'boutique',
......@@ -238,30 +238,30 @@ module.exports = {
})
},
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) {
staffDailyReportMerchantValid (data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return http.post({ method: 'dj.api.smartcarlife.staff.daily.report.popup.need', projectName: 'boutique', ...data })
},
/** 校验手机号是否配置打卡和是否打卡 */
clockInConfigPhone(data) {
clockInConfigPhone (data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return http.post({ method: 'dj.api.smartcarlife.clock.in.config.phone', projectName: 'boutique', ...data })
},
/** 获取商户基本信息 */
getServiceBaseInfo(data) {
getServiceBaseInfo (data) {
return http.post({ method: 'dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo', projectName: 'boutique', ...data })
},
/** 查询园区店是否开启签名配置 */
getSignatureSwitch(data) {
getSignatureSwitch (data) {
return http.post({ method: 'dj.api.smartcarlife.serviceMerchant.getSignatureSwitch', projectName: 'boutique', ...data })
},
// 获取服务商库存管理模式(是否使用膜卷号)
getServiceFilmRollSetting(data) {
getServiceFilmRollSetting (data) {
return http.post({ method: 'dj.api.smarcarlife.stock.management.mode', projectName: 'boutique', ...data })
},
/** 获取转化员上一笔订单的销售顾问 */
getLastUserOrderInfo(data) {
getLastUserOrderInfo (data) {
return http.post({
method: 'dj.api.smartcarlife.order.getLastUser',
projectName: 'boutique',
......@@ -269,13 +269,13 @@ module.exports = {
})
},
/**根据订单号获取订单详情(含套餐) */
getPackageGoodsDetail(data) {
getPackageGoodsDetail (data) {
return http.post({ method: 'dj.api.smartcarlife.order.packageGoodsDetail', projectName: 'boutique', ...data })
},
/**
* 查询日报门店主营品牌
*/
getDailyReportCarBrand(data) {
getDailyReportCarBrand (data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.car.brand',
projectName: 'boutique',
......@@ -286,7 +286,7 @@ module.exports = {
* 查询员工日报是否填写列表
*
*/
getStaffDailyReportDetailWeeklyList(data) {
getStaffDailyReportDetailWeeklyList (data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.weekly.list',
projectName: 'boutique',
......@@ -296,7 +296,7 @@ module.exports = {
/**
* 查询日报详情
*/
getStaffDailyReportDetail(data) {
getStaffDailyReportDetail (data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.detail',
projectName: 'boutique',
......@@ -304,38 +304,38 @@ module.exports = {
})
},
/** 修改订单备注 */
updateOrderRemark(data) {
updateOrderRemark (data) {
return http.post({ method: 'dj.api.smartcarlife.order.updateRemark', projectName: 'boutique', ...data })
},
/** 修改工单时间 */
updateOrderTime(data) {
updateOrderTime (data) {
return http.post({ method: 'dj.api.smartcarlife.order.updateOrderTime', projectName: 'boutique', ...data })
},
/** 获取企微活码 */
getWorkWechatLiveQRCode(data) {
getWorkWechatLiveQRCode (data) {
return http.post({ method: 'dj.api.smartcarlife.order.getWorkWechatLiveQRCode', projectName: 'boutique', ...data })
},
/** 升级商品生成条形码 */
createBarCode(data) {
createBarCode (data) {
return http.post({ method: 'dj.api.smartcarlife.common.createBarCode', projectName: 'boutique', ...data })
},
/**撤销工单 */
revokeOrder(data) {
revokeOrder (data) {
return http.post({ method: 'dj.api.smartcarlife.order.revoke', projectName: 'boutique', ...data })
},
/** 获取园区店配置技师数据 */
getQYTechnicianList(data) {
getQYTechnicianList (data) {
return http.post({ method: 'dj.api.smartcarlife.roleTechnician.list', projectName: 'boutique', ...data })
},
// 生成生成小程序码
createQrcodeImage(data) {
createQrcodeImage (data) {
// dj.api.smartcarlife.serviceMerchant.getByMerchantId
return http.post({ method: 'dj.api.smartcarlife.common.createWeappQrcode', projectName: 'boutique', ...data })
},
/**
* 保存日报
*/
saveStaffDailyReport(data) {
saveStaffDailyReport (data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.save',
projectName: 'boutique',
......@@ -343,19 +343,19 @@ module.exports = {
})
},
/** 不升级常用字符列表 */
getConfigList(data) {
getConfigList (data) {
return http.post({ method: 'dj.api.smartcarlife.config.list', projectName: 'boutique', ...data })
},
/** 战败订单批量补录 */
notUpgradeOrder(data) {
notUpgradeOrder (data) {
return http.post({ method: 'dj.api.smartcarlife.order.notUpgrade.batchInsert', projectName: 'boutique', ...data })
},
/**改变支付订单状态 */
createPayOrder(data) {
createPayOrder (data) {
return http.post({ method: 'dj.api.smartcarlife.payOrder.create', projectName: 'boutique', ...data })
},
/** 质保价格编辑接口 */
modifyWarrantyPrice(data) {
modifyWarrantyPrice (data) {
return http.post({
method: 'dj.api.smartcarlife.customer.warrantyCard.modifyWarrantyPrice',
projectName: 'boutique',
......@@ -364,7 +364,7 @@ module.exports = {
},
/** 退款中拦截 */
refundApplyRecordIsExist(data) {
refundApplyRecordIsExist (data) {
return http.post({
method: 'dj.api.smartcarlife.refundApplyRecord.isExist',
projectName: 'boutique',
......@@ -374,11 +374,26 @@ module.exports = {
/**
* 查询商户套餐推荐配置列表
*/
getBoutiquePackageList(data){
getBoutiquePackageList (data) {
return http.post({
method: 'dj.api.smartcarlife.receptionMaterialRecommendPackageConfig.getByMerchantId',
projectName: 'boutique',
...data
})
}
},
/**
* 日报填报前参数校验
*/
dailyReportCheck (data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.data.check',
projectName: 'boutique',
...data
})
},
// // 查询店铺配置
// getShopMerchantPointConfig(data) {
// return api.post('dj.api.smartcarlife.shopMerchantPointConfig.get', data)
// },
}
......@@ -102,5 +102,16 @@ module.exports = {
projectName: 'boutique',
...data
})
},
/**
* 获取提单客户档案列表
*
*/
getQuotationCustomerList (data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.customer.page',
projectName: 'boutique',
...data
})
}
}
\ No newline at end of file
......@@ -48,7 +48,7 @@
.icon-change-account { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.44714407502131287) calc(100vmin * (1173 / 768) * -0.4113384484228474);}
.icon-clone { width: calc(100vmin * (1173 / 768) * 0.010230179028132993); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.21014492753623187) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
background-position: calc(100vmin * (1173 / 768) * -0.22847399829497017) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-coupon-arrow { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.46717817561807334) calc(100vmin * (1173 / 768) * -0.4113384484228474);}
.icon-coupon { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
......@@ -398,7 +398,7 @@
.icon-total { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.020034100596760442) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-two-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.1918158567774936) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
background-position: calc(100vmin * (1173 / 768) * -0.21014492753623187) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-upload-play { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.10230179028132992) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-uploadAdd { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
......@@ -414,4 +414,6 @@
.icon-yw-icon { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
background-position: calc(100vmin * (1173 / 768) * -0.5221653878942881) calc(100vmin * (1173 / 768) * -0.45865302642796246);}
.icon-zj-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.08013640238704177) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
\ No newline at end of file
background-position: calc(100vmin * (1173 / 768) * -0.08013640238704177) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-customer-list { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.1918158567774936) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
\ No newline at end of file

2.91 MB | W: | H:

2.91 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<view>
<view v-for="(items, boxIdx) in formList" :key="boxIdx">
<view
class="gl-cell"
v-if="formList.length"
>
<view
v-for="(items, boxIdx) in formList"
:key="boxIdx"
class="cell-box-block"
>
<view class="cell-box">
<template v-if="titleList.length">
<view
class="cell-title flex"
v-if="titleList[boxIdx] && (titleList[boxIdx].name || titleList[boxIdx].addHtml)"
>
<template v-if="titleList[boxIdx].name">
{{titleList[boxIdx].name}}
</template>
<template v-if="titleList[boxIdx].addHtml">
<slot :name="titleList[boxIdx].addHtml" />
</template>
</view>
</template>
<template v-for="(item, idx) in items">
<view v-if="!item.hidden">
<view class="cell-row" :key="idx">
<view class="cell" @click="onCellClick(item)" :class="[item.noBorder ? '' : 'border', item.onlyLabel ? 'small-height' : '', item.class]">
<view
class="cell-row"
:key="idx"
>
<view
class="cell"
@click="onCellClick(item)"
:class="[item.noBorder ? '' : 'border', item.onlyLabel ? 'small-height' : '', item.class]"
>
<view :class="['cell-label', { 'only-label': item.onlyLabel }]">
<view v-if="item.labellIcon" :class="['sprite-icon', `icon-${item.labellIcon}`]"></view>
<view
v-if="item.labellIcon"
:class="['sprite-icon', `icon-${item.labellIcon}`]"
></view>
{{ item.label }}
<view v-if="item.required" class="required">*</view>
<view
v-if="item.required"
class="required"
>*</view>
</view>
<view class="cell-value">
<!-- 输入框 -->
<template v-if="item.type === 'input'">
<view class="input-box">
<input class="input-value" v-model="formData[item.value]" :type="item.inputType || 'text'"
@blur="handleBlur($event, item)" :placeholder="item.placeholder || '请输入'"
<input
class="input-value"
v-model="formData[item.value]"
:type="item.inputType || 'text'"
@blur="handleBlur($event, item)"
:placeholder="item.placeholder || '请输入'"
:maxlength="item.maxlength ? item.maxlength : -1"
@input="item.inputType === 'number' && item.maxlength ? (formData[item.value] = String($event.target.value).slice(0, item.maxlength)) : null" />
<view v-if="item.valueIcon" :class="['sprite-icon', `icon-${item.valueIcon}`]"
@click="onValueClick(item)"></view>
placeholder-class="input-placeholder"
@input="item.inputType === 'number' && item.maxlength ? (formData[item.value] = String($event.target.value).slice(0, item.maxlength)) : null"
/>
<view
v-if="item.valueIcon"
:class="['sprite-icon', `icon-${item.valueIcon}`]"
@click="onValueClick(item)"
></view>
</view>
</template>
<!-- 下拉选择 -->
......@@ -41,20 +83,43 @@
</template>
<!-- 单选框 -->
<template v-else-if="item.type === 'radio'">
<radio-group class="radio-group value" @change="onRadioChange($event, item)">
<label class="uni-list-cell uni-list-cell-pd" v-for="radio in item.radioList" :key="radio.value + item.value">
<radio style="transform: scale(0.7)" :value="radio.value" :disabled="item.disabled || radio.disabled" :checked="radio.value == item.current" />
<radio-group
class="radio-group value"
@change="onRadioChange($event, item)"
>
<label
class="uni-list-cell uni-list-cell-pd"
v-for="radio in item.radioList"
:key="radio.value + item.value"
>
<radio
style="transform: scale(0.7)"
:value="radio.value"
:disabled="item.disabled || radio.disabled"
:checked="radio.value == item.current"
/>
<view class="radio-name">{{ radio.name }}</view>
</label>
</radio-group>
</template>
<!-- 多行文本 -->
<template v-else-if="item.type === 'textarea'">
<textarea class="textarea" v-model="formData[item.value]" :placeholder="item.placeholder || '请输入'" placeholder-class="textarea-placeholder" confirm-type="done" auto-height :maxlength="item.maxlength"></textarea>
<textarea
class="textarea"
v-model="formData[item.value]"
:placeholder="item.placeholder || '请输入'"
placeholder-class="textarea-placeholder"
confirm-type="done"
auto-height
:maxlength="item.maxlength"
></textarea>
</template>
</view>
</view>
<slot v-if="item.addHtml" :name="item.addHtml"></slot>
<slot
v-if="item.addHtml"
:name="item.addHtml"
></slot>
</view>
</view>
</template>
......@@ -86,29 +151,33 @@ export default {
formData: {
type: Object,
default: () => ({})
},
titleList: {
type: Array,
default: () => []
}
},
data() {
data () {
return {
userInfo: {}
}
},
mounted() {
mounted () {
this.userInfo = uni.$storage.get('userInfo') || {}
},
methods: {
onCellClick(item) {
onCellClick (item) {
if (item.type === 'select') {
this.$emit('handleCell', item)
}
},
onRadioChange(e, item) {
onRadioChange (e, item) {
this.$emit('radioChange', e, item)
},
onValueClick(item) {
onValueClick (item) {
this.$emit('handleValue', item)
},
handleBlur(e, item) {
handleBlur (e, item) {
this.$emit('inputBlur', e, item)
}
}
......@@ -116,13 +185,27 @@ export default {
</script>
<style scoped lang="scss">
.gl-cell {
.cell-box-block {
&:first-child {
.cell-box {
margin-top: 0;
}
}
}
}
.cell-box {
background-color: #fff;
border-radius: toRpx(16);
overflow: hidden;
margin-bottom: toRpx(18);
margin-top: toRpx(18);
}
.cell-title {
min-height: 72rpx;
padding: 0 32rpx;
color: #6c6f75;
font-size: 24rpx;
}
.cell-row {
padding-left: toRpx(32);
}
......@@ -216,14 +299,19 @@ export default {
.sprite-icon {
margin-left: toRpx(8);
}
.input-placeholder {
color: #999ea8 !important;
font-size: toRpx(28) !important;
}
}
.input-value {
height: 100%;
text-align: right;
width: 100%;
border: none;
padding: 0;
}
.input-bottom {
min-height: toRpx(100);
line-height: toRpx(56);
......
<template>
<view class="age-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: currentId ? i == currentId : i == data[params.idKey] }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ i }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'AgeRange',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList () {
const { params } = this
this.currentId = ''
let data = [
'20岁以下',
'21-30岁',
'31-40岁',
'41-50岁',
'51岁以上'
]
this.updateParams(params, data)
},
initData (data) {
this.list = data
this.$emit('onComplete')
},
handleSearch (searchValue) {
this.list = []
this.getList(searchValue, true)
},
choose (i) {
this.currentId = i
this.$emit('choose', i)
}
}
}
</script>
<style scoped lang="scss">
.age-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
......@@ -26,7 +26,7 @@
:class="[
{'sub-brand-name':j.isTitle},
{'item flex':!j.isTitle},
{active: (currentId ? j.id == currentId : j.id == data.customer[params.idKey]) && !j.isTitle}
{active: (currentId ? j.id == currentId : (j.id == (data.customer ? data.customer[params.idKey] : '') || j.id == data[params.idKey])) && !j.isTitle}
]"
@click="choose(j,c)"
>
......
<template>
<view class="city-list-box">
<view class="step-box flex">
<view
:class="['step flex',{'step-active':currentStep == 1}]"
@click="currentStep = 1"
>
{{currentIds[0] || '选择省份'}}
</view>
<view :class="['step flex',{'step-active':currentStep == 2}]">{{currentIds[1]|| '选择城市'}}</view>
</view>
<scroll-view
class="scroll-view"
scroll-y
:scroll-into-view="letter"
:scroll-top="scrollTop"
>
<template v-if="listData.length">
<template v-for="(i, index) in viewList">
<view
class="item-box"
:key="index"
:id="i.letter"
>
<view class="letter-title flex">{{i.letter}}</view>
<view class="city-list">
<template v-for="(c,cindex) in i.list">
<view
:class="['item flex',{
active: currentIds.length ? c.name == currentIds[c.level - 1] : c.name == data[params.idKeys[c.level - 1]]
}]"
:key="cindex"
@click="choose(c)"
>
{{c.name}}
<view class="sprite-icon icon-tag-checked"></view>
</view>
</template>
</view>
</view>
</template>
</template>
</scroll-view>
<view class="letter-list">
<template v-for="(i, index) in viewList">
<view
class="letter-item"
:key="index"
@click="letter = i.letter"
>
{{i.letter}}
</view>
</template>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import popupmixin from './popupmixin'
import pinyin from 'pinyin.js'
export default {
mixins: [popupmixin],
name: 'City',
data () {
return {
letter: 'A',
scrollTop: 0,
currentStep: 1
}
},
computed: {
viewList () {
let { listData, currentStep, currentIds } = this,
childList = null
if (currentStep == 2) listData.map(e => {
let item = e.list.find(i => i.name == currentIds[0])
if (!childList && item) childList = item.list
})
return currentStep == 1 ? listData : childList
},
},
mounted () {
},
methods: {
async getList () {
const { params } = this,
{ cacheData } = params
this.currentId = ''
if (cacheData && cacheData.length) {
this.initData(cacheData)
return
}
try {
const { data: {
code,
data,
msg
} } = await uni.$api.evaluationApi
.apiRegion({
keyword: '全国',
sub_admin: 3,
extensions_code: 1
})
if (code == 0) {
let { status, districts } = JSON.parse(data)
if (status === 0 && districts && districts.length) {
let provinceData = districts[0].districts
provinceData = provinceData.map(item => {
item.districts = item.districts.map(e => this.addLetterToItem(e))
return this.addLetterToItem(item)
})
this.formatCityData(provinceData)
} else throw '加载数据失败'
} else throw msg
} catch (error) {
this.updateParams(params, [])
if (error) uni.showToast({
title: error,
icon: 'none',
mask: true
})
}
},
formatCityData (data) {
const { params } = this
let letterList = Array.from(new Set([...data.map((e) => e.letter)])).sort(),
province = letterList.map(e => {
let list = []
data.map(i => {
if (i.letter == e) {
let childLetterList = Array.from(new Set([...i.districts.map((e) => e.letter)])).sort()
i.list = childLetterList.map(c => {
let districts = []
i.districts.map(d => {
if (d.letter == c) {
districts.push(d)
}
})
return {
letter: c,
list: districts
}
})
list.push(i)
}
})
return {
letter: e,
list,
}
})
this.updateParams(params, province)
},
initData (data) {
this.list = data
this.$emit('onComplete')
},
choose (item) {
let { level, name } = item,
{ currentIds } = this
if (level == 2) {
this.currentIds = [currentIds[0], name]
let chooseItem = {
province: currentIds[0],
city: name
}
this.$emit('choose', chooseItem)
} else {
this.currentIds = [name]
this.currentStep = 2
this.scrollTop = 10
setTimeout(() => {
this.scrollTop = 0
}, 100)
}
},
addLetterToItem (item) {
if (!item || !item.name) {
return { ...item, letter: '#' }
}
try {
const firstChar = item.name.charAt(0)
if (/[一-龥]/.test(firstChar)) {
let pinyinResult
try {
pinyinResult = pinyin(firstChar)
} catch (e1) {
console.warn('pinyin without options failed:', e1)
try {
pinyinResult = pinyin(firstChar, { style: 0 })
} catch (e2) {
console.warn('pinyin with simple options failed:', e2)
const simplePinyinMap = {
安: 'A',
北: 'B',
重: 'C',
川: 'C',
大: 'D',
东: 'D',
福: 'F',
甘: 'G',
广: 'G',
贵: 'G',
海: 'H',
河: 'H',
黑: 'H',
湖: 'H',
吉: 'J',
江: 'J',
辽: 'L',
内: 'N',
宁: 'N',
青: 'Q',
山: 'S',
陕: 'S',
上: 'S',
四: 'S',
台: 'T',
天: 'T',
西: 'X',
新: 'X',
云: 'Y',
浙: 'Z'
}
return {
...item,
letter: simplePinyinMap[firstChar] || '#'
}
}
}
let letter = '#'
if (pinyinResult && pinyinResult.length > 0) {
if (Array.isArray(pinyinResult[0])) {
letter = pinyinResult[0][0].charAt(0).toUpperCase()
} else if (typeof pinyinResult[0] === 'string') {
letter = pinyinResult[0].charAt(0).toUpperCase()
} else if (typeof pinyinResult === 'string') {
letter = pinyinResult.charAt(0).toUpperCase()
}
}
if (/^[A-Z]$/.test(letter)) {
return { ...item, letter }
} else {
const simplePinyinMap = {
安: 'A',
阿: 'A'
}
return {
...item,
letter: simplePinyinMap[firstChar] || '#'
}
}
} else {
const letter = firstChar.toUpperCase()
return { ...item, letter: /^[A-Z]$/.test(letter) ? letter : '#' }
}
} catch (error) {
console.error('获取首字母失败:', error)
return { ...item, letter: '#' }
}
},
}
}
</script>
<style scoped lang='scss'>
.city-list-box {
position: relative;
height: 100%;
width: 100%;
.step-box {
height: toRpx(64);
justify-content: center;
gap: 0 96rpx;
position: relative;
margin-bottom: 16rpx;
.step {
height: 64rpx;
border-radius: 12rpx;
background: #f2f2f2;
justify-content: center;
padding: 0 32rpx;
color: #666666;
font-size: 28rpx;
}
.step-active {
background: #dee7ff;
color: #347bff;
}
&::after {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
content: '';
width: 16rpx;
height: 2rpx;
background: #cccccc;
}
}
.scroll-view {
height: calc(100% - #{toRpx(80)});
}
.letter-list {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 0;
color: #888888;
font-size: toRpx(28);
line-height: toRpx(40);
padding: 0 toRpx(18);
text-align: center;
}
.item-box {
margin-bottom: toRpx(32);
.letter-title {
color: #888888;
font-size: toRpx(28);
height: toRpx(40);
background: #f5f7fa;
padding-left: toRpx(48);
margin-bottom: toRpx(16);
}
.city-list {
margin: 0 toRpx(48);
.brand-name {
color: #333333;
font-size: toRpx(32);
line-height: toRpx(44);
margin: toRpx(16) 0;
}
.sub-brand-name {
color: #888888;
font-size: toRpx(28);
line-height: toRpx(40);
width: 100%;
flex-shrink: 0;
}
}
}
.city-list {
// display: grid;
// grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
display: flex;
// gap: toRpx(32) 0;
flex-wrap: wrap;
.item {
width: calc((100% - #{toRpx(96)}) / 4);
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
}
</style>
\ No newline at end of file
<template>
<view class="customer-list">
<template v-for="(i, index) in listData">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: checkActive(i) }]"
>
<view class="sprite-icon icon-tag-checked"></view>
<template v-if="i.customerName">
{{i.customerName}}
</template>
<template v-if="i.carSeriesName">
<view class="car-model">({{i.carChildsBrandName || ''}}-{{i.carSeriesName}})</view>
</template>
<template v-if="i.customerPhone">
<view class="phone">|{{i.customerPhone}}</view>
</template>
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'Customer',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList (searchValue, search) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentId = ''
if (!search && cacheData && cacheData.length) {
this.initData(cacheData)
return
}
this.componentLoading(params)
const { shopMerchantId } = userInfo,
apiParams = {
merchantId: shopMerchantId,
pageSize: 999999,
currentPage: 1,
search: searchValue
}
const { list } = await uni.$api.popupApi.getQuotationCustomerList(apiParams)
this.updateParams(params, list || [])
},
initData (data) {
this.list = data
this.$emit('onComplete')
},
handleSearch (searchValue) {
this.list = []
this.getList(searchValue, true)
},
choose (i) {
let { params: { idKey } } = this
this.currentId = i[idKey]
this.$emit('choose', i)
},
checkActive (i) {
let { currentId, data, params } = this
return currentId ? i.customerPhone == currentId : i.customerPhone == data[params.idKey]
}
}
}
</script>
<style scoped lang="scss">
.customer-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
<template>
<view class="employee-list">
<template v-for="(i, index) in list">
<view :key="index" @click="choose(i)" :class="['item flex', { active: currentId ? i.uuid == currentId : i.uuid == data[params.idKey] }]">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: currentId ? i.uuid == currentId : i.uuid == data[params.idKey] }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ i.staffName }}
</view>
......@@ -28,16 +32,18 @@ export default {
{ cacheData } = params
this.currentId = ''
if (!search && cacheData && cacheData.length) {
console.log('getList', params,data)
this.initData(cacheData)
return
}
this.componentLoading(params)
const { shopMerchantId, sceneType, merchantId } = userInfo,
data = await uni.$api.popupApi.getEmployeeList({
apiTargetName = sceneType == 1 ? 'getEmployeeList' : 'getOrderScreenEmployeeList',
apiParams = {
merchantId: params.idKey == 'sellerUserId' ? merchantId : shopMerchantId,
sceneList: params.idKey == 'sellerUserId' ? '' : [sceneType],
name: searchValue
})
}
if (searchValue) apiParams.name = searchValue
const data = await uni.$api.popupApi[apiTargetName](apiParams)
this.updateParams(params, data || [])
},
initData (data) {
......
<template>
<view class="seat-list">
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: currentId ? i == currentId : i == data[params.idKey] }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ i }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'Seat',
inject: ['userInfo'],
data () {
return {
}
},
mounted () {
},
methods: {
async getList () {
const { params } = this
this.currentId = ''
let data = [
'1',
'2',
'3',
'4',
'5',
'6',
'7',
]
this.updateParams(params, data)
},
initData (data) {
this.list = data
this.$emit('onComplete')
},
handleSearch (searchValue) {
this.list = []
this.getList(searchValue, true)
},
choose (i) {
this.currentId = i
this.$emit('choose', i)
}
}
}
</script>
<style scoped lang="scss">
.seat-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
<template>
<view class="goods-list" :key="viewDataKey">
<view
class="goods-list"
:key="viewDataKey"
>
<template v-if="params.loadComplete">
<template v-if="list.length">
<template v-for="(i, index) in list">
<view :key="`${index}_${i.key}`" @click.stop="choose(i, index)" :class="['item', { hide: !i.show }, { active: checkActive(i) }, { single: i.goodsFlag == 1 }]">
<!-- v-if="i.goodsFlag == 3" -->
<view
:key="`${index}_${i.key}`"
@click.stop="choose(i, index)"
:class="['item', { hide: !i.show }, { active: checkActive(i) }, { single: i.goodsFlag == 1 }]"
>
<template v-if="i.goodsFlag == 1">
<view class="flex">
<view class="icon flex">
<uni-icons type="circle" :size="20" color="#8C8C8C" class="circle"></uni-icons>
<uni-icons type="checkbox-filled" :size="20" color="#2c66f7" class="filled"></uni-icons>
<uni-icons
type="circle"
:size="20"
color="#8C8C8C"
class="circle"
></uni-icons>
<uni-icons
type="checkbox-filled"
:size="20"
color="#2c66f7"
class="filled"
></uni-icons>
</view>
<text class="goods-name text-hide">
{{ replaceItemText(i.goods, 'goodsAlias') || replaceItemText(i.goods, 'upgradeGoodsName') || replaceItemText(i.goodsInfo, 'goodsName') }}
<template v-if="sceneType == 1">
{{ replaceItemText(i.goods, 'goodsAlias')
|| replaceItemText(i.goods, 'upgradeGoodsName')
|| replaceItemText(i.goodsInfo, 'goodsName') }}
</template>
<template v-else>
{{replaceItemText(i.goods, 'goodsAlias')
|| replaceItemText('','',
i.goods.upgradeGoodsName + (i.goods.specificationData? '/'+i.goods.specificationData:''))
|| replaceItemText('','',
i.goods.goodsInfo.goodsName + (i.goods.specificationData? ('/'+i.goods.specificationData):''))
}}
</template>
</text>
<template v-if="i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)">
<text>「{{ i.goods.positionStr }}」</text>
</template>
<text class="price">¥{{ i.goods.price }}</text>
</view>
<template v-if="i.goods.serveName">
<view class="base-tips">(包含{{i.goods.serveName}})</view>
</template>
</template>
<template v-if="i.goodsFlag == 2">
<view class="title flex">
<view class="icon flex">
<uni-icons type="circle" :size="20" color="#8C8C8C" class="circle"></uni-icons>
<uni-icons type="checkbox-filled" :size="20" color="#2c66f7" class="filled"></uni-icons>
<uni-icons
type="circle"
:size="20"
color="#8C8C8C"
class="circle"
></uni-icons>
<uni-icons
type="checkbox-filled"
:size="20"
color="#2c66f7"
class="filled"
></uni-icons>
</view>
{{ i.multipleSpecificationsGoods.baseGoodsName }}
<template v-if="i.multipleSpecificationsGoods.goods && i.multipleSpecificationsGoods.goods.sellPrice">
<text class="price">¥{{ i.multipleSpecificationsGoods.goods.sellPrice }}</text>
</template>
</view>
<template v-if="sceneType == 0 && i.multipleSpecificationsGoods.goods && i.multipleSpecificationsGoods.goods.serveName">
<view class="base-tips">(包含{{i.multipleSpecificationsGoods.goods.serveName}})</view>
</template>
<template v-if="i.multipleSpecificationsGoods.specificationList && i.multipleSpecificationsGoods.specificationList.length">
<view class="package-list">
<template v-for="(specific, specificIndex) in i.multipleSpecificationsGoods.specificationList">
......@@ -54,8 +101,15 @@
<template v-if="specific.value">
{{ specific.value }}
</template>
<text class="placeholder flex" v-else>请选择</text>
<uni-icons type="right" size="14" class="arrow" />
<text
class="placeholder flex"
v-else
>请选择</text>
<uni-icons
type="right"
size="14"
class="arrow"
/>
</view>
</view>
</picker>
......@@ -63,6 +117,48 @@
</view>
</template>
</template>
<template v-if="i.goodsFlag == 3 && sceneType == 0">
<view class="title flex">
<view class="icon flex">
<uni-icons
type="circle"
:size="20"
color="#8C8C8C"
class="circle"
></uni-icons>
<uni-icons
type="checkbox-filled"
:size="20"
color="#2c66f7"
class="filled"
></uni-icons>
</view>
{{ i.packageGoods.packageAlias || i.packageGoods.packageName }}
<text class="price">¥{{ i.packageGoods.sellPrice }}</text>
</view>
<view class="package-list">
<template v-for="(specific, specificIndex) in i.packageGoods.goodsList">
<view
class="package-item flex"
:key="`${index}_${specificIndex}`"
>
<view class="label">
{{
replaceItemText(specific, 'goodsAlias')
|| replaceItemText('','',
specific.upgradeGoodsName +( specific.specificationData ? ('/'+specific.specificationData): '')
)
|| replaceItemText('','',
specific.goodsInfo.goodsName+( specific.specificationData? ('/'+specific.specificationData): '')
)}}
</view>
<view class="value flex">
¥{{ specific.sellPrice }}
</view>
</view>
</template>
</view>
</template>
</view>
</template>
</template>
......@@ -72,19 +168,20 @@
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
import NP from 'number-precision'
export default {
mixins: [popupmixin],
name: 'SkuGoodsList',
data() {
data () {
return {
viewDataKey: Date.now(),
}
},
mounted() {
mounted () {
},
methods: {
async getList(searchValue) {
async getList (searchValue) {
const { userInfo, params, isDefeatOrder } = this
const { shopMerchantId, sceneType } = userInfo
const { cacheData } = params
......@@ -119,14 +216,13 @@ export default {
packageGoods: null
})
})
console.log(newArray)
this.updateParams(params, newArray || [])
} else {
this.updateParams(params, data || [])
}
},
handleSearch(searchValue) {
handleSearch (searchValue) {
let { list, params } = this,
ids = []
if (!searchValue) {
......@@ -145,6 +241,9 @@ export default {
if (c.goodsFlag == 2 && c.multipleSpecificationsGoods) {
name = c.multipleSpecificationsGoods.baseGoodsName
}
if (c.goodsFlag == 3 && c.packageGoods) {
name = c.packageGoods.packageAlias || c.packageGoods.packageName
}
if (name.indexOf(searchValue) != -1) {
c.show = true
ids.push(1)
......@@ -155,13 +254,13 @@ export default {
this.updateParams(params)
this.viewDataKey = Date.now()
},
initData(goodsData) {
console.log('goodsData', goodsData)
let { data, dataKey } = this,
initData (goodsData) {
let { data, dataKey, sceneType } = this,
arr = []
goodsData.map((val) => {
val.show = true
if (val.goodsFlag == 1) {
if (sceneType == 0) val.goods = this.setServeName(val.goods)
let subVal = val.goods
subVal.positionStr = subVal.position
subVal.upgradePrice = subVal.sellPrice
......@@ -174,63 +273,97 @@ export default {
if (val.goodsFlag == 2) {
val.active = false
val.key = Date.now()
if (val.goodsFlag == 2) {
if (val.multipleSpecificationsGoods?.goods?.sellPrice) val.multipleSpecificationsGoods.goods.sellPrice = null
val.multipleSpecificationsGoods.specificationList.forEach(item => {
item.value = ''
item.specificationSelectValueList = []
item.specificationValueList.forEach(second => {
if (second.show) {
item.specificationSelectValueList.push(second.specificationValue)
}
})
if (val.multipleSpecificationsGoods?.goods?.sellPrice) val.multipleSpecificationsGoods.goods.sellPrice = null
val.multipleSpecificationsGoods.specificationList.forEach(item => {
item.value = ''
item.specificationSelectValueList = []
item.specificationValueList.forEach(second => {
if (second.show) {
item.specificationSelectValueList.push(second.specificationValue)
}
})
}
})
arr.push(val)
}
if (val.goodsFlag == 3) {
let item = val.packageGoods
val.packageGoods.goodsList = item.goodsList.map(item => {
;
(item.specificationNameSequence =
item.specificationTypeSequence && item.specificationNameSequence ?
item.specificationNameSequence.replace(/;~;/g, '/') :
''),
(item.specificationData =
item.specificationTypeSequence && item.specificationData ?
item.specificationData.replace(/;~;/g, '/') :
'')
return item
})
val.packageGoods.sellPrice = item.goodsList.reduce((pre, item) => {
pre = NP.plus(pre, item.sellPrice)
return pre
}, 0)
arr.push(val)
}
})
let paramsData = dataKey ? data[dataKey] : data
if (paramsData && paramsData.length) paramsData.map(e => {
if (e.goodsFlag == 1) {
this.currentIds.push(e.goods.goodsId)
if (e.goodsFlag != 2) {
let id = ''
if (e.goodsFlag == 3) id = e.packageGoods.packageCode
if (e.goodsFlag == 1) id = e.goods.goodsId
this.currentIds.push(id)
this.chooseList.push(e)
}
})
console.log('arr', arr)
this.list = arr
this.$emit('onComplete')
},
async choose(i, index) {
if (i.goodsFlag == 2) {
if (!await this.watchAllChose(index, true)) {
uni.showToast({
title: '请先选择该商品规格',
icon: 'none'
})
return
}
} else {
let { goodsId } = i.goods,
{ currentIds } = this,
index = currentIds.indexOf(goodsId)
if (index == -1) {
this.currentIds.push(goodsId)
this.chooseList.push(i)
}
else {
this.currentIds.splice(index, 1)
this.chooseList.splice(index, 1)
async choose (i, index) {
try {
if (i.goodsFlag == 2) {
if (!await this.watchAllChose(index, true)) {
uni.showToast({
title: '请先选择该商品规格',
icon: 'none'
})
return
}
} else {
let id = ''
if (i.goodsFlag == 3) {
let { packageCode } = i.packageGoods
id = packageCode
} else {
let { goodsId } = i.goods
id = goodsId
}
let { currentIds } = this,
index = currentIds.indexOf(id)
if (index == -1) {
this.currentIds.push(id)
this.chooseList.push(i)
} else {
this.currentIds.splice(index, 1)
this.chooseList.splice(index, 1)
}
}
this.$emit('choose', this.chooseList)
} catch (error) {
console.log(error)
}
this.$emit('choose', this.chooseList)
},
replaceItemText(item, key) {
replaceItemText (item, key, specification) {
let reg = getRegExp(';~;', 'g'),
value = item[key]
value = item && key ? item[key] : ''
if (specification) {
return specification ? specification.replace(reg, '/') : ''
}
return value ? value.replace(reg, ' ') : ''
},
checkActive(i) {
let { goodsFlag, goods } = i,
checkActive (i) {
let { goodsFlag, goods, packageGoods } = i,
id = '',
{ currentIds, chooseList } = this,
active = false
if (goodsFlag == 2) {
......@@ -241,10 +374,12 @@ export default {
return ids.includes(i.multipleSpecificationsGoods.id)
}
if (currentIds.length) active = currentIds.includes(goods.goodsId)
if (goodsFlag == 3) id = packageGoods.packageCode
else id = goods.goodsId
if (currentIds.length) active = currentIds.includes(id)
return active
},
handlePickerChange(e, {
handlePickerChange (e, {
item, list, parent, index
}) {
let { value } = e.detail
......@@ -253,14 +388,10 @@ export default {
this.$set(this.list, index, parent)
this.watchAllChose(index)
},
replaceItemText(item, key) {
let reg = getRegExp(';~;', 'g'),
value = item[key]
return value ? value.replace(reg, ' ') : ''
},
async watchAllChose(index, cancel) {
async watchAllChose (index, cancel) {
let {
list: goodsList,
sceneType
} = this;
let result = goodsList[index].multipleSpecificationsGoods.specificationList.every(item => item.value)
if (result) {
......@@ -332,10 +463,61 @@ export default {
this.$set(this.list, index, goodsList[index])
}
}
if (sceneType == 0 && goodsList[index].multipleSpecificationsGoods.goods) this.handleGoods(index)
}
return result
},
handleGoods (index) {
let {
list: goodsList
} = this
let ele = goodsList[index]
ele.multipleSpecificationsGoods.goods = this.setServeName(ele.multipleSpecificationsGoods.goods)
this.list = goodsList
},
setServeName (item) {
let serveName = ''
if (
item?.upgradeGoodsServiceItemsList &&
item.upgradeGoodsServiceItemsList.length
) {
serveName = item.upgradeGoodsServiceItemsList.reduce(
(label, ele, index) => {
let unit = index == 0 ? '' : '/'
label = label + unit + ele?.serviceName
return label
},
''
)
}
if (item.position) {
const fieldMap = {
'4大件': '燃油车4大件服务',
'3电': '新能源3电服务',
'6大件': '新能源6大件服务'
// 在这里可以添加更多的替换规则
}
// 如果输入字段在字段映射中有匹配项,则进行替换,否则保持不变
fieldMap[item.position] && (serveName = fieldMap[item.position])
}
return {
...item,
goodsId: item.merchantGoodsId,
serveName,
goodsNameAlias: item.upgradeGoodsAlias,
appreciation: item?.appreciation,
goodsName: item?.upgradeGoodsName,
specificationNameSequence: item.specificationTypeSequence && item.specificationNameSequence ?
item.specificationNameSequence.replace(/;~;/g, '/') : '',
specificationData: item.specificationTypeSequence && item.specificationData ?
item.specificationData.replace(/;~;/g, '/') : '',
quotationGoodsServiceItemsRelationDTOList: item?.upgradeGoodsServiceItemsList,
titlePictureUrl: item.goodsInfo?.thumbUrl
}
}
}
}
</script>
......@@ -360,13 +542,20 @@ export default {
.price {
margin-left: auto;
flex-shrink: 0;
}
.title {
height: toRpx(88);
min-height: toRpx(88);
padding: toRpx(24) 0 toRpx(20);
}
.base-tips {
margin-bottom: 20rpx;
color: #999999;
font-size: 28rpx;
padding-left: 58rpx;
margin-top: -16rpx;
}
.icon {
margin-right: toRpx(16);
}
......@@ -433,12 +622,18 @@ export default {
.package-list {
background: #fff;
}
.base-tips {
color: inherit;
}
}
.single {
height: toRpx(72);
min-height: toRpx(72);
padding: toRpx(14) toRpx(32);
border-radius: toRpx(8);
.base-tips {
margin: 4rpx 0 0 !important;
}
}
}
</style>
......@@ -23,6 +23,9 @@ export default {
},
noData () {
return !this.listData.length
},
sceneType(){
return uni.$storage.get('userInfo').sceneType
}
},
watch: {
......@@ -42,7 +45,10 @@ export default {
params.cacheData = data
}
this.$emit('update:params', params)
},
componentLoading (params) {
params.loadComplete = false
this.$emit('update:params', this.params)
}
}
......
......@@ -14,6 +14,12 @@
* 11:套餐
* 12:其他精品
* 13:时间选择
* 14: 代保管人员
* 15: 商品类目
* 16: 年龄区间
* 17:所在城市
* 18: 座位数
* 19: 客户档案
*/
const componentConfig = {
......@@ -179,6 +185,41 @@ const componentConfig = {
title: '选择商品类目',
hideSearch: true,
loadComplete: false
},
16: {
name: 'AgeRange',
title: '年龄区间',
idKey: 'ageRange',
hideSearch: true,
loadComplete: false
},
17: {
name: 'City',
title: '所在城市',
hideSearch: true,
loadComplete: false,
nullTips: '请选择所在城市',
cacheData: [],
noData: false,
idKeys: ['province','city']
},
18:{
name:'Seat',
title:'座位数',
idKey: 'seat',
hideSearch: true,
loadComplete: false,
},
19:{
name:'Customer',
title:'客户档案',
loadComplete: false,
placeholder: '查找',
idKey: 'customerPhone',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false
}
}
export default { componentConfig }
......@@ -44,6 +44,10 @@ import DateTime from './components/DateTime.vue'
import DateTimeChange from './components/DateTimeChange.vue'
import AgreementList from './components/AgreementList.vue'
import GoodsCategory from './components/GoodsCategory.vue'
import AgeRange from './components/AgeRange.vue'
import City from './components/City.vue'
import Seat from './components/Seat.vue'
import Customer from './components/Customer.vue'
export default {
components: {
Popup,
......@@ -58,7 +62,11 @@ export default {
DateTime,
AgreementList,
DateTimeChange,
GoodsCategory
GoodsCategory,
AgeRange,
City,
Seat,
Customer
},
name: '',
props: {
......@@ -82,7 +90,8 @@ export default {
type: Boolean,
default: false
},
defaultTime: String
defaultTime: String,
popupTitle: String
},
provide () {
......@@ -129,7 +138,7 @@ export default {
},
computed: {
title () {
return config.componentConfig[this.popupType].title
return this.popupTitle || config.componentConfig[this.popupType].title
},
userInfo () {
return uni.$storage.get("userInfo")
......@@ -310,6 +319,9 @@ export default {
}
.hide-search {
height: calc(100% - #{toRpx(280)});
.popup-scroll-view{
padding-top: 0;
}
}
.popup-footer {
padding: toRpx(64) 0;
......
......@@ -215,11 +215,10 @@
</template>
<NoticePopup
ref="reportNotice"
title="提交成功"
text="您的日报已提交成功"
type="success"
:buttons="buttons"
@buttonClick="back"
:title="noticeObj.title"
:text="noticeObj.text"
:type="noticeObj.type || 'success'"
:buttons="noticeObj.buttons"
></NoticePopup>
</view>
</template>
......@@ -243,6 +242,7 @@ export default {
name: 'DailyReport',
data () {
return {
noticeObj: {},
tabIndex: 0,
to: '',
dateKey: {},
......@@ -608,13 +608,20 @@ export default {
orderObj.recordStaffCount != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid
) uni.showModal({
title: '预警提示',
content: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF'
})
) {
this.noticeObj = {
title: '重要提示',
text: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
}
}
},
isNotEmpty (value) {
......@@ -682,7 +689,21 @@ export default {
uni.hideLoading()
if (data) {
this.isEditReport = false
this.$refs.reportNotice.open()
this.noticeObj = {
title: '提交成功',
text: '您的日报已提交成功',
type: 'success',
buttons: [
{
text: '返回首页',
type: 'primary',
callback: _ => {
uni.navigateBack()
}
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
}
} catch (errorObj) {
uni.hideLoading()
......
<template>
<view class="order">
<view class="common-title">{{ orderCreateType == 'createWithPay' ? '新建工单' : '补录订单' }}</view>
<view class="common-title">车险信息</view>
<view class="box">
<scroll-view class="scroll-view" scroll-y="true">
<scroll-view
class="scroll-view"
scroll-y="true"
>
<view class="box-content">
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur" @handleCell="handleCell">
<template slot="frontGear">
<Product v-if="orderObj.frontGear" @changeTotalPrice="changeTotalPrice" :list="orderObj.frontGear" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="frontWindow">
<Product v-if="orderObj.frontWindow" @changeTotalPrice="changeTotalPrice" :list="orderObj.frontWindow" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="rearWindow">
<Product v-if="orderObj.rearWindow" @changeTotalPrice="changeTotalPrice" :list="orderObj.rearWindow" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="rearGear">
<Product v-if="orderObj.rearGear" @changeTotalPrice="changeTotalPrice" :list="orderObj.rearGear" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="sunRoof">
<Product v-if="orderObj.sunRoof" @changeTotalPrice="changeTotalPrice" :list="orderObj.sunRoof" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template>
<template slot="package">
<Package v-if="orderObj.package" @changeTotalPrice="changeTotalPrice" :list="orderObj.package" :positionTypeList="positionTypeList"></Package>
<GlCell
:formList="formList"
:formData="orderObj"
@radioChange="radioChange"
@inputBlur="inputBlur"
@handleCell="handleCell"
:titleList="titleList"
>
<template slot="customer">
<view class="customer-title flex">
客户信息
<view
class="customer-file flex"
@click="handleCell({
key:'customer'
})"
>
<view class="sprite-icon icon-customer-list"></view>
客户档案
</view>
</view>
</template>
<template slot="skuGoods">
<SkuGoods v-if="orderObj.skuGoods" :list="orderObj.skuGoods" @changeTotalPrice="changeTotalPrice" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></SkuGoods>
<view class="total" v-if="totalPrice > 0">
<SkuGoods
v-if="orderObj.vdQuotationGoodsList.length"
:list="orderObj.vdQuotationGoodsList"
@changeTotalPrice="changeTotalPrice"
:positionTypeList="positionTypeList"
:baseConfigData="baseConfigData"
></SkuGoods>
<view
class="total"
v-if="orderObj.total > 0"
>
<view class="total-left">总价</view>
<view class="total-right">¥{{ totalPrice }}</view>
<view class="total-right">¥{{ orderObj.total }}</view>
</view>
</template>
<template slot="otherPay">
<view v-if="showPayTips" class="pay-tips">其他收款:当客户已向嘀加付款但无法使用流水补录时,新建工单应选择收款方为「嘀加收款」且支付方为「其他收款」。</view>
<view
v-if="showPayTips"
class="pay-tips"
>其他收款:当客户已向嘀加付款但无法使用流水补录时,新建工单应选择收款方为「嘀加收款」且支付方为「其他收款」。</view>
</template>
</GlCell>
</view>
<view @click="submit" class="btn">直接下单</view>
<view class="btns flex">
<view class="btn save">存草稿</view>
<view
@click="submit"
class="btn"
>下一步·去支付</view>
</view>
</scroll-view>
</view>
<!-- 弹窗 -->
<order-popup ref="orderPopup" :data="orderObj" :dataKey="valueKey" @onConfirm="onConfirm" :externalData="externalData" :popupType="popupType" />
<order-popup
ref="orderPopup"
:data="orderObj"
:dataKey="valueKey"
@onConfirm="onConfirm"
:externalData="externalData"
:popupType="popupType"
:popupTitle="popupTitle"
/>
</view>
</template>
......@@ -50,7 +82,7 @@ import GlCell from '../../../../components/Form/GlCell.vue'
import Product from './Product.vue'
import Package from './Package.vue'
import SkuGoods from './SkuGoods.vue'
import { FORM_LIST, popupTypeEnum, payTypeList } from '../contant'
import { FORM_LIST, popupTypeEnum, payTypeList, titleList } from '../contant'
import { interceptionMixin } from '@/mixin/index'
export default {
name: 'CreateOrder',
......@@ -69,143 +101,33 @@ export default {
}
},
watch: {
transmissionOfData: {
handler(newVal) {
if (newVal) {
// 处理交易数据
const handleTransactionData = newVal => {
this.orderCreateType = newVal.type
if (this.orderCreateType === 'supplementOrder') {
// 补录订单处理
const { outTradeNo, tradeNo } = newVal.selectedItems.reduce(
(acc, item) => ({
outTradeNo: [...(acc.outTradeNo || []), item.outTradeNo],
tradeNo: [...(acc.tradeNo || []), item.tradeNo]
}),
{}
)
Object.assign(this.orderObj, {
outTradeNo: outTradeNo.join(','),
tradeNo: tradeNo.join(',')
})
return
}
// 编辑和修改订单进入这里
// 新增订单处理
const {
paramsData: { customer, customerCoupon, ...rest }
} = newVal
// 基础字段映射
const baseFields = ['id', 'orderCode', 'userId', 'employeeName', 'deliveryEmployeeName', 'deliveryUserId', 'subShopMerchantName', 'subShopMerchantId', 'sellerName', 'sellerUserId', 'sellerMerchantName', 'sellerMerchantId', 'merchantId', 'merchantName', 'customerCouponId', 'selectPayType']
Object.assign(this.orderObj, Object.fromEntries(baseFields.map(field => [field, rest[field]])))
// 设置支付类型
this.orderObj.payeeType = rest.selectPayType == '2' ? '1' : '0'
// 客户信息映射
const customerFields = ['customerName', 'customerSex', 'customerPhone', 'salesType', 'standNo', 'plateNumber', 'experienceFlag']
Object.assign(this.orderObj, Object.fromEntries(customerFields.map(field => [field, customer[field]])))
// 优惠券信息
const { couponName, customerCouponCode } = customerCoupon
Object.assign(this.orderObj, {
couponName,
customerCouponCode,
couponInfo: couponName + customerCouponCode
})
// 车辆信息
this.orderObj.customer = {
carBrand: customer.carBrand,
carBrandId: customer.carBrandId,
carChildsBrandId: customer.carChildsBrandId,
carChildsBrandName: customer.carChildsBrandName,
carSeriesId: customer.carSeriesId,
carSeriesName: customer.carSeriesName,
customerPhone: customer.customerPhone,
standNo: customer.standNo,
plateNumber: customer.plateNumber,
customerSex: customer.customerSex,
experienceFlag: customer.experienceFlag,
salesType: customer.salesType,
customerName: customer.customerName
}
this.orderObj.carBrand = `${customer.carBrand}-${customer.carChildsBrandName}-${customer.carSeriesName}`
// 更新表单状态
const updateFormCell = (formIndex, fieldName, value) => {
const cell = this.formList[formIndex].find(item => item.value === fieldName)
if (cell) cell.current = value
}
const formUpdates = [
[1, 'salesType', customer.salesType],
[1, 'customerSex', customer.customerSex],
[1, 'experienceFlag', customer.experienceFlag],
[2, 'selectPayType', this.orderObj.selectPayType],
[2, 'payeeType', this.orderObj.payeeType]
]
formUpdates.forEach(([index, field, value]) => updateFormCell(index, field, value))
// 商品回显,在获取商品列表之后
this.subOrderList = rest.subOrderList
}
console.log(this.orderObj, 'orderObj')
handleTransactionData(newVal)
} else {
this.userInfo = uni.$storage.get('userInfo') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {}
this.orderCreateType = 'createWithPay'
this.orderObj = {
customer: {},
customerSex: '1',
experienceFlag: 'Y',
payeeType: 1,
salesType: '0',
frontGear: null, // 1 ,回显upgradeGoodsPosition == 1
frontWindow: null, // 2
rearWindow: null, // 3
rearGear: null, // 4
sunRoof: null, // 5, 6,7
package: null,
skuGoods: null // upgradeGoodsPosition 为空,则是其他精品单商品
}
this.initData()
}
},
immediate: true
}
},
data() {
data () {
return {
orderCreateType: 'createWithPay', // supplementOrder(补录订单) createWithPay(新增)
titleList,
formList: utils.deepClone(FORM_LIST),
userInfo: {},
baseConfigData: {},
requiredList: [], // 录单设置的必填项
orderObj: {
customer: {},
customerSex: '1',
experienceFlag: 'Y',
payeeType: 1,
salesType: '0',
frontGear: null, // 1 ,回显upgradeGoodsPosition == 1
frontWindow: null, // 2
rearWindow: null, // 3
rearGear: null, // 4
sunRoof: null, // 5, 6,7
package: null,
skuGoods: null // upgradeGoodsPosition 为空,则是其他精品单商品
mode: 1,
payee: 0, // 收款方式
payType: 1, // 支付方式
insurancePrice: '',
vdQuotationGoodsList: [], //商品列表
referrerId: '', //销售顾问id
referrer: '',//销售顾问名称
deliveryId: '',//交付专员id
deliveryName: '',//交付专员名称
total: '',//总价
notes: '',//备注
carSeriesId: '', //车系id
seat: 5,//座位数
ownerGender: '男',
}, // 弹窗传入的数据},
popupType: 0,
popupTypeEnum,
externalData: [], //弹窗接口数据
subShopMerchantList: [], // 二级流量方列表
employeeList: [],
djPayList: [], // 嘀加收款方对应支付方式
merchantPayList: [], // 门店收款方对应支付方式
configPayTypeList: [], // 园区店配置支持的支付方式
......@@ -215,88 +137,41 @@ export default {
otherProduct: [],
positionTypeList: [],
valueKey: '',
totalPrice: 0,
// 产品槽位配置,用于循环渲染产品组件
productSlots: {
frontGear: true,
frontWindow: true,
rearGear: true,
rearWindow: true,
sunRoof: true
}
popupTitle: ''
}
},
computed: {
showPayTips() {
if (this.orderObj.payeeType == 0 && this.orderObj.selectPayType == 7) return true
showPayTips () {
if (this.orderObj.payee == 0 && this.orderObj.payType == 7) return true
else return false
}
},
mounted() {
console.log('mounted', this.orderCreateType)
mounted () {
this.userInfo = uni.$storage.get('userInfo') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {}
this.initData()
},
methods: {
initData() {
console.log('initData', this.orderCreateType, this.orderObj.id)
initData () {
console.log('initData', this.orderObj.id)
// 埋点
if (this.orderCreateType == 'createWithPay' && !this.orderObj.id) {
uni.$track.add({ eventCode: 'app_create_order' })
} else if (this.orderCreateType == 'supplementOrder') {
uni.$track.add({ eventCode: 'app_supplement_order' })
}
// uni.$track.add({ eventCode: 'app_create_order' })
const { userInfo } = this
if (!this.orderObj.id) {
// 在原有的 orderObj 对象上新增这些属性
Object.assign(this.orderObj, {
sellerMerchantName: userInfo.merchantName,
sellerName: userInfo.name,
sellerMerchantId: userInfo.merchantId,
sellerUserId: userInfo.uuid,
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName
merchantId4s: userInfo.shopMerchantId,
merchantName4s: userInfo.shopMerchantName
})
}
this.getShopMerchantPointConfig(this.orderObj.merchantId)
this.getSubShopMerchantList(this.orderObj.merchantId)
this.getSetting()
// 补录订单默认为嘀加收款,不需要获取园区店支付方式
if (this.orderCreateType == 'supplementOrder') {
this.orderObj.payeeType = 0
const cell = this.formList[2].find(item => item.value == 'payeeType')
if (cell) {
cell.current = 0
cell.radioList[1].disabled = true // 禁用4s店收款
}
this.djPayList = [
{
value: '5',
name: '嘀加收款'
}
]
this.changePayee()
} else {
// 防止从补录进来4s店收款为禁用
const cell = this.formList[2].find(item => item.value == 'payeeType')
if (cell) {
cell.current = 1
cell.radioList[1].disabled = false
}
this.getConfig()
}
// this.getEmployeeList()
this.getConfig()
this.getSelectOrderGoodsList()
this.getPositionList()
if (this.orderCreateType == 'createWithPay' && !this.orderObj.id) this.getLastUserOrderInfo() // 补录订单和有id的情况,不需要设置默认值
},
// 选择行事件
handleCell(val) {
console.log(val, this.orderObj)
handleCell (val) {
this.popupTitle = ''
// 获取当前选中的popupType
this.popupType = Object.keys(this.popupTypeEnum).find(key => this.popupTypeEnum[key].key === val.value) * 1
this.popupType = Object.keys(this.popupTypeEnum).find(key => this.popupTypeEnum[key].key === val.key) * 1
// 获取对应的list字段
const popupConfig = this.popupTypeEnum[this.popupType]
if (popupConfig && popupConfig.list) {
......@@ -305,257 +180,161 @@ export default {
this.externalData = []
}
// 定义产品相关字段数组
const productFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof', 'package', 'skuGoods']
const productFields = ['skuGoods']
if (productFields.includes(val.value)) {
this.valueKey = val.value
this.externalData = utils.deepClone(this.goodsList)
}
console.log(this.popupType, this.externalData, '-------------')
this.popupTitle = {
4: '车型',
13: '4S店收款时间'
}[this.popupType]
this.$refs.orderPopup.open()
},
// 单选框change事件
radioChange(e, val) {
console.log(e, val)
radioChange (e, val) {
this.$set(this.orderObj, val.value, e.detail.value)
if (val.value == 'payeeType') {
this.changePayee()
}
if (val.value == 'payee') this.changePayee()
},
// 弹窗确认回调
onConfirm(val, flag) {
console.log(val,flag, 'onConfirm')
onConfirm (val) {
console.log(val, 'onConfirm')
this.externalData = []
// const { chooseContent } = val
// // const { chooseContent } = val
const chooseContent = utils.deepClone(val.chooseContent)
// 根据popupTypeEnum优化处理
const _typeValue = this.popupTypeEnum[this.popupType]
console.log(_typeValue)
// 定义产品相关字段数组
const productFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof', 'package', 'skuGoods']
const productFields = ['skuGoods']
if (_typeValue.key == 'carBrand') {
// 车型
this.$set(this.orderObj, _typeValue.key, `${chooseContent.carBrand}-${chooseContent.carChildsBrandName}-${chooseContent.carSeriesName}`)
this.orderObj.customer = {
...(this.orderObj.customer || {}),
...chooseContent
}
} else if (_typeValue.key == 'couponInfo') {
// 礼券
const { couponName, merchantCouponId, customerCouponCode } = chooseContent
Object.assign(this.orderObj, {
couponName: couponName,
merchantCouponId: merchantCouponId,
customerCouponCode: customerCouponCode
})
this.$set(this.orderObj, 'couponInfo', couponName + customerCouponCode)
} else if (productFields.includes(_typeValue.key)) {
this.$set(this.orderObj, 'carBrandText', `${chooseContent.carBrand}-${chooseContent.carChildsBrandName}-${chooseContent.carSeriesName}`)
Object.assign(this.orderObj, chooseContent)
}
else if (productFields.includes(_typeValue.key)) {
if (_typeValue.key == 'skuGoods') {
if (!this.orderObj[_typeValue.key]) {
if (!this.orderObj.vdQuotationGoodsList) {
// 其他精品第一次赋值
this.$set(this.orderObj, _typeValue.key, chooseContent)
this.$set(this.orderObj, 'vdQuotationGoodsList', chooseContent)
} else {
// 过滤出已选的goodFlag为2的对象
const selectedGoods = this.orderObj[_typeValue.key].filter(item => item.goodsFlag === 2)
const singleGoods = flag ?
this.orderObj[_typeValue.key].filter(item => item.goodsFlag === 1) :
chooseContent.filter(item => item.goodsFlag === 1)
const selectedGoods = this.orderObj.vdQuotationGoodsList.filter(item => item.goodsFlag === 2)
const singleGoods = chooseContent.filter(item => item.goodsFlag != 2)
const moreGoods = chooseContent
.filter(item => item.goodsFlag === 2)
.filter(item => {
return !selectedGoods.some(selectedItem => selectedItem.multipleSpecificationsGoods.goods.goodsId === item.multipleSpecificationsGoods.goods.goodsId)
})
console.log(singleGoods, '===')
// 合并已选的goodFlag为2的对象
this.orderObj[_typeValue.key] = [...singleGoods, ...moreGoods, ...selectedGoods]
this.orderObj.vdQuotationGoodsList = [...singleGoods, ...moreGoods, ...selectedGoods]
}
} else {
this.$set(this.orderObj, _typeValue.key, chooseContent)
console.log(this.orderObj, 'this.orderObj')
}
// 商品类,需计算总价
setTimeout(() => {
this.changeTotalPrice()
}, 0)
} else if (_typeValue.key) {
this.orderObj[_typeValue.targetIdKey] = chooseContent[_typeValue.sourceIdKey]
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey])
}
else {
this.$set(this.orderObj, _typeValue.key, chooseContent)
console.log(this.orderObj, 'this.orderObj')
}
// // 商品类,需计算总价
// setTimeout(() => {
// this.changeTotalPrice()
// }, 0)
// } else if (_typeValue.key) {
// this.orderObj[_typeValue.targetIdKey] = chooseContent[_typeValue.sourceIdKey]
// this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey])
// }
console.log(this.orderObj)
},
// 输入框失去焦点事件
inputBlur(e, val) {
inputBlur (e, val) {
console.log(e, val)
this.orderObj.customer[val.value] = this.orderObj[val.value]
this.orderObj[val.value] = this.orderObj[val.value]
},
// 校验必填等规则
checkRequired() {
const phoneRex = /^[1]([3-9])[0-9]{9}$/
// 把formList中所有required为true的对象放到一个数组中
const requiredArr = []
const onlyLabelItem = []
this.formList.forEach(group => {
group.forEach(item => {
if (item.required === true && item.hidden !== true) {
if (item.onlyLabel === true) {
onlyLabelItem.push(item)
} else {
requiredArr.push(item)
checkRequired () {
try {
const phoneRex = /^[1]([3-9])[0-9]{9}$/
// 把formList中所有required为true的对象放到一个数组中
const requiredArr = []
const onlyLabelItem = []
this.formList.forEach(group => {
group.forEach(item => {
if (item.required === true && item.hidden !== true) {
if (item.onlyLabel === true) {
onlyLabelItem.push(item)
} else {
requiredArr.push(item)
}
}
}
})
})
// 遍历requiredArr,检查orderObj中是否有对应的值
for (let i = 0; i < requiredArr.length; i++) {
const item = requiredArr[i]
// 兼容嵌套customer对象的情况
let value
if (item.value === 'customerName' || item.value === 'customerPhone' || item.value === 'standNo' || item.value === 'plateNumber') {
value = this.orderObj.customer ? this.orderObj.customer[item.value] : undefined
} else {
value = this.orderObj[item.value]
}
// 0、false、'0'等视为有效,null/undefined/空字符串视为无效
if (value === undefined || value === null || value === '') {
uni.showToast({
title: `${item.label}不能为空`,
icon: 'none'
})
return false
})
// 遍历requiredArr,检查orderObj中是否有对应的值
for (let i = 0; i < requiredArr.length; i++) {
const item = requiredArr[i]
// 兼容嵌套customer对象的情况
let value = this.orderObj[item.value]
if (value === undefined || value === null || value === '') throw `${item.label}不能为空`
// 如果是customerPhone,添加phoneRex校验
if (item.value === 'phone' && !phoneRex.test(value)) throw `请输入正确的${item.label}`
}
// 如果是customerPhone,添加phoneRex校验
if (item.value === 'customerPhone' && !phoneRex.test(value)) {
uni.showToast({
title: `请输入正确的${item.label}`,
icon: 'none'
})
return false
if (this.orderObj.carVin) {
const vinRex = /^(?=.*[A-Za-z])[A-Za-z0-9]{17}$/
console.log(this.orderObj.carVin, vinRex.test(this.orderObj.carVin))
if (!vinRex.test(this.orderObj.carVin)) throw '请输入正确的车架号'
}
}
if (this.orderObj.standNo) {
const vinRex = /^(?=.*[A-Za-z])[A-Za-z0-9]{17}$/
console.log(this.orderObj.standNo, vinRex.test(this.orderObj.standNo))
if (!vinRex.test(this.orderObj.standNo)) {
uni.showToast({
title: `请输入正确的VIN码`,
icon: 'none'
// 处理onlyLabel为true的特殊校验
if (onlyLabelItem.length > 0) {
// 检查frontGear、frontWindow、rearGear、rearWindow、sunRoof和couponInfo字段中是否至少有一个不为空
const labelFields = ['skuGoods']
const hasValue = labelFields.some(field => {
console.log(field, this.orderObj[field])
const value = this.orderObj[field]
return value !== undefined && value !== null && (Array.isArray(value) ? value.length > 0 : value !== '')
})
return false
console.log(hasValue, hasValue)
if (!hasValue) throw '商品不能为空'
}
}
// 处理onlyLabel为true的特殊校验
if (onlyLabelItem.length > 0) {
// 检查frontGear、frontWindow、rearGear、rearWindow、sunRoof和couponInfo字段中是否至少有一个不为空
const labelFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof', 'package', 'skuGoods']
const hasValue = labelFields.some(field => {
console.log(field, this.orderObj[field])
const value = this.orderObj[field]
return value !== undefined && value !== null && (Array.isArray(value) ? value.length > 0 : value !== '')
return true
} catch (error) {
if (error) uni.showToast({
title: error,
icon: 'none'
})
console.log(hasValue, hasValue)
if (!hasValue) {
uni.showToast({
title: '商品不能为空',
icon: 'none'
})
return false
}
return false
}
return true
},
// 提交
async submit() {
async submit () {
console.log(this.orderObj)
if (!this.checkRequired()) return
if (!(await this.checkDailyReport())) {
const { orderCreateType } = this
const obj = utils.deepClone(this.orderObj)
const otherCustomer = ['standNo', 'plateNumber', 'customerSex', 'experienceFlag', 'salesType']
obj.customer = {
...obj.customer,
...otherCustomer.reduce((acc, key) => {
if (obj[key] !== undefined) {
acc[key] = obj[key]
delete obj[key]
}
return acc
}, {})
}
// 将 frontGear、frontWindow、rearGear、rearWindow、sunRoof 字段合并到 goodsList 中
const labelFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof', 'package', 'skuGoods']
let goodsList = []
let subGoodsList = []
labelFields.forEach(field => {
if (Array.isArray(obj[field]) && obj[field].length > 0) {
goodsList = goodsList.concat(obj[field])
}
delete obj[field]
})
if (goodsList.length > 0) {
goodsList.map(e => {
if (e.goodsFlag == 1) {
// 单商品
subGoodsList.push({
totalPrice: e.goods.sellPrice,
number: e.goods.number,
merchantGoodsId: e.goods.merchantGoodsId
})
}
// 套餐
if (e.goodsFlag == 3) {
e.packageGoods.goodsList.forEach(g => {
subGoodsList.push({
packageCode: e.packageGoods.packageCode,
packageName: e.packageGoods.packageName,
totalPrice: g.sellPrice,
number: e.packageGoods.number,
merchantGoodsId: g.merchantGoodsId,
upgradePrice: g.oldPrice
})
})
}
// 多规格
if (e.goodsFlag == 2) {
subGoodsList.push({
baseGoodsId: e.multipleSpecificationsGoods.goods.baseGoodsId,
totalPrice: Number(e.multipleSpecificationsGoods.goods.sellPrice),
number: e.multipleSpecificationsGoods.number,
merchantGoodsId: e.multipleSpecificationsGoods.goods.id || e.multipleSpecificationsGoods.goods.merchantGoodsId
})
}
})
obj.subOrderList = subGoodsList
}
delete obj.carBrand
delete obj.couponInfo
console.log(obj, 'rucan')
uni.showLoading({
title: '提交中...',
mask: true
})
const res = await uni.$api.boutiqueApi[orderCreateType](obj).finally(() => {
uni.hideLoading()
})
if (res) {
uni.showToast({
title: '保存成功',
icon: 'success'
})
if (this.orderCreateType == 'createWithPay' && !this.orderObj.id) {
uni.$track.add({ eventCode: 'app_submit_create_order' })
} else if (this.orderCreateType == 'supplementOrder') {
uni.$track.add({ eventCode: 'app_submit_supplement_order' })
}
this.$emit('jump', orderCreateType == 'supplementOrder' ? 'OrderDetail' : 'ConfirmOrder', res)
}
// uni.showLoading({
// title: '提交中...',
// mask: true
// })
// const res = await uni.$api.boutiqueApi[orderCreateType](obj).finally(() => {
// uni.hideLoading()
// })
// if (res) {
// uni.showToast({
// title: '保存成功',
// icon: 'success'
// })
// uni.$track.add({ eventCode: 'app_submit_create_order' })
// this.$emit('jump', 'ConfirmOrder', res)
// }
}
},
// 计算所有产品的总价
changeTotalPrice() {
changeTotalPrice () {
let total = 0
// 遍历所有商品
const productFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof', 'package', 'skuGoods']
......@@ -586,11 +365,11 @@ export default {
})
console.log(total, 'total')
// 更新总价
this.totalPrice = total.toFixed(2)
this.orderObj.total = total.toFixed(2)
},
// 获取上一个订单的销售顾问信息 并且不是再次下单
async getLastUserOrderInfo() {
async getLastUserOrderInfo () {
const res = await uni.$api.boutiqueApi.getLastUserOrderInfo({
sellerUserId: this.userInfo.subLoginUser.uuid
})
......@@ -603,64 +382,12 @@ export default {
this.getEmployeeList()
}
},
async getShopMerchantPointConfig(merchantId) {
const res = await uni.$api.boutiqueApi.getShopMerchantPointConfig({ merchantId })
if (res.pointsMultiRole == 'Y') {
const employeeCell = this.formList[0].find(item => item.label === '销售顾问')
if (employeeCell) employeeCell.label = '销售顾问/录单员'
// 找到formList中label为"交付专员"的对象,添加hidden: true
const deliveryCell = this.formList[0].find(item => item.label === '交付专员')
if (deliveryCell) {
deliveryCell.hidden = false
}
}
},
// 判断二级流量方
async getSubShopMerchantList(merchantId) {
const res = await uni.$api.boutiqueApi.getSubShopMerchantList({ merchantId })
if (res && res.length) {
this.subShopMerchantList = res
const cell = this.formList[0].find(item => item.label === '二级流量方')
if (cell) {
cell.hidden = false
}
}
},
// 动态获取 车型 车架 车牌 是否必填
getYQorderInfo() {
return new Promise(async (resolve, reject) => {
const YQorderSetting = uni.$storage.get('boutique_YQorderSetting')
if (YQorderSetting) return resolve(YQorderSetting)
else {
const { userInfo } = this
let { merchantId, merchantName } = userInfo.subLoginUser
const res = await uni.$api.boutiqueApi.getMerchantRecordingSettings({ merchantId, merchantName })
console.log(res)
if (res) {
uni.$storage.set('boutique_YQorderSetting', res)
resolve(res)
}
}
})
},
// 获取车型、车架号、车牌号必填规则
async getSetting() {
const res = await this.getYQorderInfo()
const dictionaryObj = {
carTypeRequiredFlag: 'carBrand',
standNoRequiredFlag: 'standNo',
plateNumRequiredFlag: 'plateNumber'
}
for (const key in dictionaryObj) {
const cell = this.formList[1].find(item => item.value === dictionaryObj[key])
if (cell) cell.required = res[key] == 'Y'
}
},
// 获取园区店支付方式
async getConfig() {
const res = await uni.$api.boutiqueApi.getYqStoreConfig({
yqMerchantId: this.orderObj.sellerMerchantId
})
async getConfig () {
const { merchantId } = this.userInfo,
res = await uni.$api.boutiqueApi.getYqStoreConfig({
yqMerchantId: merchantId
})
let m = res.supportPayTypes || []
let n = this.payTypeList
let list = n.filter(k => {
......@@ -683,37 +410,23 @@ export default {
this.changePayee()
console.log(this.djPayList, this.merchantPayList, 'list')
},
changePayee() {
const cell = this.formList[2].find(item => item.value === 'selectPayType')
changePayee () {
const cell = this.formList[4].find(item => item.value === 'payType')
if (cell) {
cell.radioList = this.orderObj.payeeType == 1 ? this.merchantPayList : this.djPayList
cell.radioList = this.orderObj.payee == 1 ? this.merchantPayList : this.djPayList
if (!this.orderObj.id && cell.radioList && cell.radioList.length > 0) {
cell.current = cell.radioList[0].value
// 使用 $set 确保响应式更新
this.$set(this.orderObj, 'selectPayType', cell.radioList[0].value)
this.$set(this.orderObj, 'payType', cell.radioList[0].value)
}
}
},
// 获取 销售顾问列表
async getEmployeeList() {
const { userInfo, orderObj } = this
const { shopMerchantId, sceneType, merchantId } = userInfo,
data = await uni.$api.popupApi.getEmployeeList({
merchantId: orderObj.idKey == 'sellerUserId' ? merchantId : shopMerchantId,
sceneList: orderObj.idKey == 'sellerUserId' ? '' : [sceneType]
})
if (data && data.length) {
this.employeeList = data
this.$set(this.orderObj, 'employeeName', data[0].staffName)
this.orderObj.userId = data[0].uuid
}
},
async getPositionList() {
async getPositionList () {
const res = await uni.$api.boutiqueApi.getPositionList({})
this.positionTypeList = res
},
// 商品列表
async getSelectOrderGoodsList() {
async getSelectOrderGoodsList () {
const { userInfo } = this
const res = await uni.$api.boutiqueApi.getSelectOrderGoodsList({
merchantId: userInfo.shopMerchantId,
......@@ -721,22 +434,6 @@ export default {
})
this.goodsList = res
// 分类映射
const posMap = {
frontGear: [1],
frontWindow: [2],
rearGear: [3],
rearWindow: [4],
sunRoof: [5, 6, 7]
}
// 初始化各类商品数组
const arrMap = {
frontGear: [],
frontWindow: [],
rearGear: [],
rearWindow: [],
sunRoof: []
}
res.forEach(val => {
if (val.goodsFlag == 1) {
......@@ -746,11 +443,6 @@ export default {
subVal.price = subVal.sellPrice
subVal.goodsId = subVal.merchantGoodsId
Object.keys(posMap).forEach(key => {
if (posMap[key].includes(subVal.merchantGoodsPosition)) {
arrMap[key].push(val)
}
})
}
//商品多规格
if (val.goodsFlag == 2) {
......@@ -764,14 +456,8 @@ export default {
})
this.otherProduct.push(val)
}
})
console.log(arrMap, 'arrMap')
// 批量设置 hidden 属性
Object.keys(arrMap).forEach(key => {
const cell = this.formList[2].find(item => item.value === key)
if (cell) cell.hidden = arrMap[key].length === 0
})
})
const subOrderList = this.subOrderList || []
console.log('subOrderList', subOrderList)
let chooseList = []
......@@ -853,33 +539,6 @@ export default {
const _skuGoods = chooseList.filter(item => item.goodsFlag == 2) || []
console.log(_singleGoods, 'singleGoods')
if (_singleGoods) {
// 回显upgradeGoodsPosition 1:前挡 2:前窗 3:后窗 4:后挡 5、6、7:天窗。 为空则是其他精品
this.$set(
this.orderObj,
'frontGear',
_singleGoods.filter(item => item.goods.upgradeGoodsPosition == 1)
)
this.$set(
this.orderObj,
'frontWindow',
_singleGoods.filter(item => item.goods.upgradeGoodsPosition == 2)
)
this.$set(
this.orderObj,
'rearWindow',
_singleGoods.filter(item => item.goods.upgradeGoodsPosition == 3)
)
this.$set(
this.orderObj,
'rearGear',
_singleGoods.filter(item => item.goods.upgradeGoodsPosition == 4)
)
this.$set(
this.orderObj,
'sunRoof',
_singleGoods.filter(item => item.goods.upgradeGoodsPosition == 5 || item.goods.upgradeGoodsPosition == 6 || item.goods.upgradeGoodsPosition == 7)
)
// 将没有upgradeGoodsPosition的商品添加到_skuGoods中
const noPositionGoods = _singleGoods.filter(item => !item.goods.upgradeGoodsPosition)
if (noPositionGoods.length > 0) {
_skuGoods.push(...noPositionGoods)
......@@ -895,7 +554,7 @@ export default {
console.log(this.orderObj, 'this.orderObj')
this.changeTotalPrice()
},
handleSpecificationsEcho(item) {
handleSpecificationsEcho (item) {
let skuArr = []
const { otherProduct } = this,
arr = item.specificationData.split('/'),
......@@ -979,16 +638,34 @@ export default {
font-size: toRpx(24);
color: #999;
}
.btns {
padding: 24rpx 128rpx;
gap: 32rpx;
.save {
background: #3b73ff1a;
color: #4673ff;
font-size: 28rpx;
font-weight: 500;
}
}
.btn {
display: flex;
align-items: center;
justify-content: center;
margin: toRpx(88) auto 0;
width: toRpx(1130);
height: toRpx(80);
color: #fff;
border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
}
.customer-title {
.customer-file {
margin-left: 20rpx;
color: #347bff;
font-size: 24rpx;
.sprite-icon {
margin-right: 4rpx;
}
}
}
</style>
......@@ -170,7 +170,7 @@
</view>
</view>
</template>
<view class="form-item flex">
<!-- <view class="form-item flex">
<view class="label flex">
未触客返店人数
</view>
......@@ -191,7 +191,7 @@
:disabled="filterDisabled(isEditReport)"
>
</view>
</view>
</view> -->
<view class="form-item flex">
<view class="label flex">
备注
......@@ -266,11 +266,10 @@
</template>
<NoticePopup
ref="reportNotice"
title="提交成功"
text="您的日报已提交成功"
type="success"
:buttons="buttons"
@buttonClick="back"
:title="noticeObj.title"
:text="noticeObj.text"
:type="noticeObj.type || 'success'"
:buttons="noticeObj.buttons"
></NoticePopup>
</view>
</template>
......@@ -297,6 +296,7 @@ export default {
name: 'DailyReport',
data () {
return {
noticeObj: {},
pickerTemplateList: Object.freeze([
{ label: '单延保', value: 1 },
{ label: '权益延保', value: 2 },
......@@ -357,7 +357,6 @@ export default {
required: true,
min: 0,
max: 100,
inputPlaceholder: '',
refId: 'equityToShopCount',
},
{
......@@ -367,16 +366,17 @@ export default {
required: false,
min: 0,
max: 100,
},
{
label: '未触客返店人数',
key: 'notDeliveryReturnCount',
type: 'number',
min: 0,
max: 100,
}
]),
weeklyList: [],
isEditReport: false,
buttons: Object.freeze([
{
text: '返回首页',
type: 'primary'
}
]),
}
},
computed: {
......@@ -388,7 +388,7 @@ export default {
},
infoObject () {
let { tabIndex, carBandList, orderObj: { templateType, totalOrderMoney } } = this,
{ brandType, firstBrandId } = carBandList[tabIndex],
{ brandType, firstBrandId } = carBandList[tabIndex],
/**模版为广联权益 */
TemplateType3 = templateType == 3,//
NotAitoAndTemplateType3 = brandType != 0 || TemplateType3, //非问界 或者 广联权益 时隐藏
......@@ -500,11 +500,9 @@ export default {
eventCode: 'app_daily_report'
}) //驻店日报埋点
this.initData()
this.isEditReport = false
},
methods: {
back () {
uni.navigateBack()
},
initData () {
const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo
this.orderObj = {
......@@ -695,13 +693,20 @@ export default {
orderObj.recordStaffCount != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid
) uni.showModal({
title: '预警提示',
content: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF'
})
) {
this.noticeObj = {
title: '重要提示',
text: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
}
}
},
isNotEmpty (value) {
......@@ -724,15 +729,11 @@ export default {
}
},
async submit () {
uni.showLoading({
title: '提交中',
mask: true
})
uni.$track.add({
eventCode: 'app_submit_daily_report'
}) //提交驻店日报埋点
try {
let { orderObj, carBandList, hwOhterObjArray } = this
let { orderObj, carBandList, hwOhterObjArray, userInfo } = this
orderObj.isAdmin = false
orderObj.oprBy = orderObj.staffUuid
orderObj.sceneType = 0
......@@ -758,11 +759,33 @@ export default {
item.equityToShopCount = item.equityToShopCount || 0
})
}
// 非调休 日报填报前参数校验
let check = await this.dailyReportCheck(orderObj)
console.log(check, 'check')
if (check && !(userInfo?.isSuper || userInfo?.loginRole == 3)) return false
uni.showLoading({
title: '提交中',
mask: true
})
const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj)
uni.hideLoading()
if (data) {
this.isEditReport = false
this.$refs.reportNotice.open()
this.noticeObj = {
title: '提交成功',
text: '您的日报已提交成功',
type: 'success',
buttons: [
{
text: '返回首页',
type: 'primary',
callback: _ => {
uni.navigateBack()
}
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
}
} catch (errorObj) {
uni.hideLoading()
......@@ -802,7 +825,55 @@ export default {
},
hideSelect () {
this.$refs?.selectComponent?.hideSelect()
}
},
async dailyReportCheck (params) {
try {
let { carBandList } = this
let data = await uni.$api.boutiqueApi.dailyReportCheck(params)
if (!data) {
return false
}
// 根据车型做对应的文字处理
let context = ''
let showModal = false
data.forEach(item => {
if (!item.isCheckPass) {
showModal = true
carBandList.forEach(el => {
if (el.brandType == item.brandType) {
context += `【${item.brandName}】 店端总未触客数+门店售前触客数与当月实际交车数不符,差异值${item.differenceValue
},请相关驻店销售对齐核销再次提交\t\n`
}
})
}
})
if (showModal) {
return new Promise(resolve => {
this.noticeObj = {
title: '重要提示',
text: context,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
callback: _ => {
resolve(true)
this.$refs.reportNotice.close()
}
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
})
} else {
return false
}
} catch (error) {
return false
}
},
}
}
</script>
......@@ -920,7 +991,7 @@ export default {
overflow: hidden;
border-radius: toRpx(32);
.car-band-form-box {
height: toRpx(384);
height: toRpx(480);
position: relative;
.box {
position: absolute;
......
<template>
<view>
<view class="shop-list">
<view class="shop-item" v-for="(item, index) in list" :key="index">
<view class="sprite-icon icon-blue-delete" @click="deleteGoods(index)"></view>
<view
class="shop-item"
v-for="(item, index) in list"
:key="index"
>
<view
class="sprite-icon icon-blue-delete"
@click="deleteGoods(index)"
></view>
<view class="right">
<view class="shop-name">商品名称:{{ item.multipleSpecificationsGoods ?
item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName ||
item.goods.goodsInfo.goodsName }}</view>
<view class="alias"
v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.goodsAlias">商品别名:{{
<view class="shop-name">{{ goodsName(item) }}</view>
<view
class="alias"
v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.goodsAlias"
>商品别名:{{
item.multipleSpecificationsGoods.goods.goodsAlias }}</view>
<view class="front-gear-box">
<view class="front-gear-input-box">
<template
v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.specificationStr">
<template v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.specificationStr">
<view class="front-gear-label">
{{item.multipleSpecificationsGoods.goods.specificationStr}}
</view>
</template>
<template v-if="item.goods">
<template
v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)">
<template v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)">
<view class="front-gear-label">
{{ formatPosition((item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition),
positionTypeList)}}
</view>
</template>
<template
v-if="(item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1) && !item.goods.merchantGoodsPosition && !item.goods.upgradeGoodsPosition">无部位属性</template>
<template v-if="(item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1) && !item.goods.merchantGoodsPosition && !item.goods.upgradeGoodsPosition">无部位属性</template>
</template>
<view class="front-gear-input">
<view class="unit">¥</view>
<template v-if="item.multipleSpecificationsGoods">
<input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格"
placeholder-style="font-size: 14px"
<input
class="uni-input"
type="digit"
maxlength="9"
placeholder="请输入价格"
placeholder-style="font-size: 14px"
v-model="item.multipleSpecificationsGoods.goods.sellPrice"
@blur="validatePrice($event, item, index)" />
@blur="validatePrice($event, item, index)"
/>
</template>
<template v-else>
<input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格"
placeholder-style="font-size: 14px"
<input
class="uni-input"
type="digit"
maxlength="9"
placeholder="请输入价格"
placeholder-style="font-size: 14px"
v-model="item.goods.sellPrice"
@blur="validatePrice($event, item, index)" />
@blur="validatePrice($event, item, index)"
/>
</template>
<!-- <input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格"
placeholder-style="font-size: 14px"
......@@ -50,21 +64,35 @@
</view>
</view>
<view class="control">
<view class="minus" @click="decreaseNumber(item)">-</view>
<view
class="minus"
@click="decreaseNumber(item)"
>-</view>
<template v-if="item.multipleSpecificationsGoods">
<input class="uni-input control-input" type="number" maxlength="3"
v-model="item.multipleSpecificationsGoods.number"
@blur="validateNumber($event, item)" />
<input
class="uni-input control-input"
type="number"
maxlength="3"
v-model="item.multipleSpecificationsGoods.number"
@blur="validateNumber($event, item)"
/>
</template>
<template v-else>
<input class="uni-input control-input" type="number" maxlength="3"
v-model="item.goods.number"
@blur="validateNumber($event, item)" />
<input
class="uni-input control-input"
type="number"
maxlength="3"
v-model="item.goods.number"
@blur="validateNumber($event, item)"
/>
</template>
<!-- <input class="uni-input control-input" type="number" maxlength="3"
:value="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods ? item.multipleSpecificationsGoods.goods.number : item.goods.number"
@blur="validateNumber($event, item)" /> -->
<view class="add" @click="increaseNumber(item)">+</view>
<view
class="add"
@click="increaseNumber(item)"
>+</view>
</view>
</view>
</view>
......@@ -90,21 +118,30 @@ export default {
default: {}
}
},
created() {
created () {
// 初始化商品数量
this.initProductNumbers()
},
mounted() {
mounted () {
// 确保每次使用组件时都检查并设置number属性
this.initProductNumbers()
},
updated() {
updated () {
// 当组件数据更新时也检查number属性
this.initProductNumbers()
},
methods: {
goodsName (item) {
let { goodsFlag } = item,
str = ''
if (goodsFlag == 3) str = ''
else str = item.multipleSpecificationsGoods ?
item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName ||
item.goods.goodsInfo.goodsName
return str
},
// 初始化商品数量方法
initProductNumbers() {
initProductNumbers () {
if (this.list && this.list.length > 0) {
this.list.forEach(item => {
if (!item.multipleSpecificationsGoods) {
......@@ -117,20 +154,22 @@ export default {
if (!item.multipleSpecificationsGoods.number) {
this.$set(item.multipleSpecificationsGoods, 'number', '1')
}
} else {
}
})
}
},
filterIncludes(item, arr) {
filterIncludes (item, arr) {
return arr.indexOf(item) > -1
},
// 格式化位置信息
formatPosition(item, positionTypeList) {
formatPosition (item, positionTypeList) {
const filterData = positionTypeList.filter(v => v.positionValue == item)
return (filterData.length && filterData[0] && filterData[0].positionName) || ''
},
// 验证价格输入
validatePrice(event, item, index) {
validatePrice (event, item, index) {
let value = event.detail.value
console.log('value', value)
// 如果为空则设置为0
......@@ -172,9 +211,9 @@ export default {
}
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
// 多规格商品的最小价格检查
if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' &&
item.multipleSpecificationsGoods.goods.minSellPrice &&
parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) {
if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' &&
item.multipleSpecificationsGoods.goods.minSellPrice &&
parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) {
console.log('最小值', item.multipleSpecificationsGoods.goods.minSellPrice)
uni.showToast({
title: '单价不可低于商品最低价',
......@@ -194,7 +233,7 @@ export default {
this.$emit('changeTotalPrice')
},
// 验证数量输入
validateNumber(event, item) {
validateNumber (event, item) {
let value = event.detail.value
// 限制只能输入整数
value = value.replace(/[^\d]/g, '')
......@@ -214,7 +253,7 @@ export default {
this.$emit('changeTotalPrice')
},
// 增加数量
increaseNumber(item) {
increaseNumber (item) {
if (!item.multipleSpecificationsGoods) {
// 处理普通商品
if (!item.goods.number) {
......@@ -239,7 +278,7 @@ export default {
this.$emit('changeTotalPrice')
},
// 减少数量
decreaseNumber(item) {
decreaseNumber (item) {
if (!item.multipleSpecificationsGoods) {
// 处理普通商品
// 如果商品数量不存在或小于等于1,设置为1
......@@ -266,7 +305,7 @@ export default {
this.$emit('changeTotalPrice')
},
// 删除商品
deleteGoods(index) {
deleteGoods (index) {
this.list.splice(index, 1)
this.$emit('changeTotalPrice')
}
......
const FORM_LIST = [
[
{
label: '销售顾问',
label: '销售顾问/录单员',
value: 'employeeName',
type: 'select',
// key: 'staffName',
key: 'employeeName',
required: true,
showText: 'shopMerchantName'
},
......@@ -13,36 +13,27 @@ const FORM_LIST = [
value: 'deliveryEmployeeName',
type: 'select',
required: true,
// key: 'staffName',
hidden: true,
key: 'deliveryEmployeeName',
showText: 'shopMerchantName'
},
{
label: '二级流量方',
value: 'subShopMerchantName',
type: 'select',
required: true,
// key: 'subMerchantName',
hidden: true
},
{
label: '转化人员',
value: 'sellerName',
type: 'select',
// key: 'staffName',
required: true,
showText: 'merchantName'
}
],
[
{
label: '车主姓名',
value: 'customerName',
label: '姓名',
value: 'owner',
maxlength: '16',
type: 'input',
required: true
},
{
label: '联系电话',
value: 'phone',
maxlength: '11',
type: 'input',
required: true,
inputType: 'number'
},
{
label: '客户来源',
value: 'salesType',
type: 'radio',
......@@ -61,139 +52,100 @@ const FORM_LIST = [
},
{
label: '性别',
value: 'customerSex',
value: 'ownerGender',
type: 'radio',
current: '1',
current: '男',
radioList: [
{
value: '1',
name: '男'
value: '男',
name: '先生'
},
{
value: '2',
name: '女'
value: '女',
name: '女士'
}
]
},
{
label: '手机号',
value: 'customerPhone',
maxlength: '11',
type: 'input',
required: true,
inputType: 'number'
label: '年龄区间',
value: 'ageRange',
type: 'select',
key: 'ageRange'
},
{
label: '选择车型',
value: 'carBrand',
label: '所在城市',
value: 'city',
type: 'select',
key: 'carInfo'
key: 'city'
},
{
label: '车架号(VIN)',
value: 'standNo',
maxlength: '17',
label: '证件号码',
value: 'certificateNo',
maxlength: '18',
type: 'input'
},
{
label: '车牌号',
value: 'plateNumber',
maxlength: '8',
label: '兴趣爱好',
value: 'hobby',
maxlength: '200',
type: 'input'
},
{
label: '是否体验',
value: 'experienceFlag',
type: 'radio',
current: 'Y',
radioList: [
{
value: 'Y',
name: '是'
},
{
value: 'N',
name: '否'
}
]
}
label: '陪伴人员',
value: 'companion',
maxlength: '200',
type: 'input'
},
],
[
{
label: '精品礼券',
value: 'couponInfo',
label: '车型',
value: 'carBrandText',
type: 'select',
key: 'name',
required: true
},
{
label: '请选择产品',
onlyLabel: true,
key: 'carBrand',
required: true,
noBorder: true
},
{
label: '前挡',
value: 'frontGear',
type: 'select',
key: 'name',
labellIcon: 'front-gear',
addHtml: 'frontGear',
hidden: true
},
{
label: '前侧窗玻璃',
value: 'frontWindow',
type: 'select',
key: 'name',
labellIcon: 'front-window',
addHtml: 'frontWindow',
hidden: true
},
{
label: '后侧窗玻璃',
value: 'rearGear',
type: 'select',
key: 'name',
labellIcon: 'rear-gear',
addHtml: 'rearGear',
hidden: true
label: '车辆颜色',
value: 'carColor',
maxlength: '20',
type: 'input'
},
{
label: '后档',
value: 'rearWindow',
type: 'select',
key: 'name',
labellIcon: 'rear-window',
addHtml: 'rearWindow',
hidden: true
label: '车架号',
value: 'carVin',
maxlength: '17',
type: 'input',
required: true
},
{
label: '天窗',
value: 'sunRoof',
label: '座位数',
value: 'seat',
type: 'select',
key: 'name',
labellIcon: 'sun-roof',
addHtml: 'sunRoof',
hidden: true
key: 'seat',
required: true
},
{
label: '套餐',
value: 'package',
type: 'select',
key: 'name',
addHtml: 'package'
label: '车辆价格',
value: 'price',
maxlength: '8',
type: 'input',
required: true,
},
],
[
{
label: '其他精品',
label: '购买商品',
value: 'skuGoods',
type: 'select',
key: 'name',
key: 'skuGoods',
addHtml: 'skuGoods'
},
],
[
{
label: '收款方式',
value: 'payeeType',
label: '收款方',
value: 'payee',
type: 'radio',
key: 'name',
current: '1',
......@@ -212,7 +164,7 @@ const FORM_LIST = [
},
{
label: '支付方式',
value: 'selectPayType',
value: 'payType',
type: 'radio',
key: 'name',
current: '0',
......@@ -231,15 +183,20 @@ const FORM_LIST = [
// }
],
addHtml: 'otherPay'
}
],
[
},
{
label: '嘀加收款时间',
value: 'successDateTime',
key: 'todayShow',
type: 'select',
required: true
},
{
label: '备注',
value: 'remark',
maxlength: '100',
value: 'notes',
maxlength: '30',
type: 'textarea',
placeholder: '请输入 (100字以内)',
placeholder: '请输入 (30字以内)',
class: 'cell-break'
}
]
......@@ -452,7 +409,7 @@ const DEFEAT_FORM_LIST = [
},
{
label: '收款方式',
value: 'payeeType',
value: 'payee',
type: 'radio',
key: 'name',
current: '1',
......@@ -472,7 +429,7 @@ const DEFEAT_FORM_LIST = [
},
{
label: '支付方式',
value: 'selectPayType',
value: 'payType',
type: 'radio',
key: 'name',
current: '0',
......@@ -612,7 +569,25 @@ const popupTypeEnum = {
13: {
key: 'todayShow',
list: ''
},
16: {
key: 'ageRange'
},
17: {
key: 'city'
},
18: {
key: 'seat'
},
19: {
key: 'customer'
}
}
export { FORM_LIST, popupTypeEnum, payTypeList, DEFEAT_FORM_LIST }
const titleList = [
null,
{ addHtml: 'customer' },
{ name: '车辆信息' },
{ name: '增值车损险' },
{ name: '其他信息' },
]
export { FORM_LIST, popupTypeEnum, payTypeList, DEFEAT_FORM_LIST, titleList }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!