Commit 4508c11c by 前端

Merge branch 'SAAS+V5.8.5' into 'master'

上线合并

See merge request !102
2 parents f9fe7ce2 6c7563bc
Showing 42 changed files with 1429 additions and 594 deletions
......@@ -221,14 +221,14 @@ export default {
pageDirect: true,
noInterception: true
},
{
icon: 'negotiation-detail',
name: 'NegotiationDetail',
label: '洽谈明细',
page: '/pages/common/dailyNewspaper/index',
eventCode: 'negotiation_detail_page',
noInterception: true
},
// {
// icon: 'negotiation-detail',
// name: 'NegotiationDetail',
// label: '洽谈明细',
// page: '/pages/common/dailyNewspaper/index',
// eventCode: 'negotiation_detail_page',
// noInterception: true
// },
]
try {
let userInfo = uni.$storage.get('userInfo'),
......@@ -236,14 +236,15 @@ export default {
newReport = await this.isNewVersionNeed(shopMerchantId)
if (newReport && sceneType != 7) {
let [staffDailyReport] = entranceList
entranceList[0] = {
...staffDailyReport,
name: 'staffDailyReport',
page: '/pages/common/dailyNewspaper/index',
eventCode: 'staff_daily_report_page',
}
// entranceList[0] = {
// ...staffDailyReport,
// name: 'staffDailyReport',
// page: '/pages/common/dailyNewspaper/index',
// eventCode: 'staff_daily_report_page',
// }
delete entranceList[0]
entranceList.map(e => {
if (['staffDailyReport', 'storeDailyReport', 'NegotiationDetail'].includes(e.name)) e.sceneType = [0, 1]
if (['storeDailyReport'].includes(e.name)) e.sceneType = [0, 1]
})
}
this.$store.dispatch('setNewReport', newReport)
......
......@@ -517,7 +517,7 @@ export default {
/**
* 获取员工场景小分类
*/
this.getStaffBaseSceneCodeList()
// this.getStaffBaseSceneCodeList()
/**
* 获取门店场景小分类
*/
......
......@@ -69,6 +69,7 @@
<insurance-table
:isPreview="isPreview"
:show="show"
@equity-products-change="handleEquityProductList"
/>
</view>
</template>
......@@ -80,7 +81,9 @@
/>
<carBuyers
ref="carBuyersVisible"
@select="handleSelect($event,'carBuyersVisible')"
:productList="equityProductList"
@confirm="handleEquityProductsConfirm"
@cancel="resetFocusIndex"
@close="resetFocusIndex"
/>
</view>
......@@ -136,15 +139,15 @@ export default {
unit: '元',
},
{
placeholder: '购车方式',
key: 'carBuyers',
placeholder: '权益产品',
key: 'equityProducts',
type: 'select',
popKey: 'carBuyersVisible',
}
],
customerInfo: {},
focusIndex: -1,
insuranceList: []
equityProductList: []
}
},
watch: {
......@@ -172,9 +175,6 @@ export default {
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.staffName = item.staffName
} else if (popkey == 'carBuyersVisible') {
this.customerInfo.carBuyers = item.name
this.customerInfo.carPurchaseMethod = item.id
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
......@@ -183,12 +183,29 @@ export default {
this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
handleEquityProductList (list) {
this.equityProductList = Array.isArray(list) ? list : []
const selectedProducts = this.$store.state.user.insuranceEquityProducts || []
const productMap = this.equityProductList.reduce((result, item) => {
result[item.itemName] = item
return result
}, {})
const availableSelectedProducts = selectedProducts
.map(item => productMap[item.itemName])
.filter(Boolean)
this.$store.dispatch('setInsuranceEquityProducts', availableSelectedProducts)
},
handleEquityProductsConfirm (list) {
this.$store.dispatch('setInsuranceEquityProducts', list)
this.resetFocusIndex()
},
showPopup (e, index) {
this.focusIndex = index
this.$refs[e].open()
},
closeAllPopup () {
this.$refs.carBrandListVisible.close()
this.$refs.carBuyersVisible.close()
this.resetFocusIndex()
},
resetFocusIndex (e) {
......
......@@ -49,8 +49,14 @@
class="range row-2"
@click="showDetail(i)"
>
<view class="text-two-line">
<rich-text :nodes="i.itemDesc"></rich-text>
<view class="description-list">
<view
v-for="(itemDesc, descIndex) in getDescriptionList(i)"
:key="`${i.id}-${descIndex}`"
class="description-item"
>
<rich-text :nodes="itemDesc"></rich-text>
</view>
</view>
</view>
<view class="cost row-3">
......@@ -123,7 +129,7 @@ export default {
watch: {
watchStatus: {
immediate: true,
handler (newval) {
handler () {
this.$refs.popupRef?.close()
this.flag = false
this.scrollTop = -1
......@@ -133,18 +139,33 @@ export default {
const storageKey = this.getStorageKey(),
insuranceList = uni.getStorageSync(storageKey)
if (insuranceList) {
insuranceList.map(e => e.cost = '')
this.insuranceList = JSON.parse(JSON.stringify(insuranceList))
const vehicleInsuranceList = insuranceList.filter(item => this.isVehicleInsurance(item))
vehicleInsuranceList.forEach(item => {
item.cost = ''
item.checked = true
item.originalItemDesc = item.itemDesc || ''
})
this.insuranceList = JSON.parse(JSON.stringify(vehicleInsuranceList))
this.applyEquityProducts()
this.flag = true
}
}
},
show (n) {
if (n) {
this.getMerchantInsuranceList()
show: {
immediate: true,
handler(n) {
if (n) {
this.getMerchantInsuranceList()
}
}
},
selectedEquityProducts: {
deep: true,
handler () {
this.applyEquityProducts()
}
}
},
computed: {
watchStatus () {
......@@ -152,11 +173,15 @@ export default {
},
total () {
return this.insuranceList.reduce((pre, cur) => {
return NP.plus(pre, NP.times(cur.cost, (this.isPreview ? cur.show : cur.checked) ? 1 : 0))
const included = this.showInsurance(cur) && (this.isPreview ? cur.show : cur.checked)
return NP.plus(pre, NP.times(cur.cost, included ? 1 : 0))
}, 0)
},
check () {
return this.isPreview ? this.insuranceList.length : this.insuranceList.filter(item => item.show).length
return this.insuranceList.filter(item => this.showInsurance(item)).length
},
selectedEquityProducts () {
return this.$store.state.user.insuranceEquityProducts || []
}
},
mounted () {
......@@ -196,26 +221,37 @@ export default {
setItemDisabled (item, index) {
const { storageKey } = this
this.insuranceList[index].show = !item.show
uni.setStorageSync(storageKey, this.insuranceList);
this.saveInsuranceConfig(storageKey)
},
/**
* 查询门店保险权益
*/
async getMerchantInsuranceList () {
try {
const { storageKey } = this,
const storageKey = this.getStorageKey(),
{ shopMerchantId } = uni.$storage.get("userInfo"),
storageInsuranceList = uni.getStorageSync(storageKey),
list = await uni.$api.userApi.getMerchantInsuranceList({
responseList = await uni.$api.userApi.getMerchantInsuranceList({
merchantId: shopMerchantId,
})
list?.map(e => {
e.cost = ''
e.checked = true
e.main = e.itemName == '交强险' ? '交强险' : '商业险'
e.show = false
e.itemDesc = e.itemDesc ? this.processHtmlString(e.itemDesc) : ''
const sourceList = Array.isArray(responseList) ? responseList : []
const normalizedList = sourceList.map(item => {
const itemDesc = item.itemDesc ? this.processHtmlString(item.itemDesc) : ''
return {
...item,
cost: '',
checked: true,
main: item.itemName == '交强险' ? '交强险' : '商业险',
show: false,
itemDesc,
originalItemDesc: itemDesc
}
})
const list = normalizedList.filter(item => this.isVehicleInsurance(item))
const equityProductList = this.dedupeEquityProducts(
normalizedList.filter(item => this.isEquityProduct(item))
)
this.$emit('equity-products-change', equityProductList)
if (!storageInsuranceList) {
uni.showLoading({
mask: true
......@@ -223,23 +259,21 @@ export default {
this.setInsuranceList(storageKey, list || [])
}
else {
let { insuranceList } = this,
combinedList = [...insuranceList, ...list]
const deduplicatedList = combinedList.reduce((acc, item) => {
const existingItem = acc.find(existing => String(existing.id) === String(item.id));
if (existingItem) {
existingItem.itemName = item.itemName || ''
existingItem.itemDesc = item.itemDesc || ''
if (this.currentItem.id == existingItem.id) this.currentItem = existingItem
} else acc.push(item)
return acc;
}, [])
let arr = []
deduplicatedList.map(e => {
let index = list.findIndex(item => String(item.id) === String(e.id))
if (index != -1) arr.push(e)
const cachedList = Array.isArray(storageInsuranceList)
? storageInsuranceList.filter(item => this.isVehicleInsurance(item))
: []
const currentList = this.insuranceList.length ? this.insuranceList : cachedList
const mergedList = list.map(item => {
const existingItem = currentList.find(existing => String(existing.id) === String(item.id))
if (!existingItem) return item
return {
...item,
cost: existingItem.cost || '',
checked: existingItem.checked !== false,
show: !!existingItem.show
}
})
this.setInsuranceList(storageKey, arr)
this.setInsuranceList(storageKey, mergedList)
}
} catch (error) {
this.flag = true
......@@ -248,10 +282,72 @@ export default {
setInsuranceList (storageKey, value) {
uni.hideLoading()
this.insuranceList = JSON.parse(JSON.stringify(value))
value.map(e => e.checked = true)
uni.setStorageSync(storageKey, value);
this.applyEquityProducts()
this.saveInsuranceConfig(storageKey)
this.flag = true
},
saveInsuranceConfig (storageKey) {
const insuranceList = this.insuranceList.map(item => {
const result = {
...item,
cost: '',
checked: true,
itemDesc: item.originalItemDesc || ''
}
delete result.originalItemDesc
return result
})
uni.setStorageSync(storageKey, insuranceList)
},
dedupeEquityProducts (list) {
const productNames = new Set()
return list.filter(item => {
const itemName = String(item.itemName || '').trim()
if (!itemName || productNames.has(itemName)) return false
productNames.add(itemName)
return true
})
},
isNewEnergyInsurance (item) {
return String(item.id) === '-10' || item.itemName === '新能源险'
},
isVehicleInsurance (item) {
return Number(item.id) < 0
},
isEquityProduct (item) {
return Number(item.id) > 0
},
getDescriptionList (item) {
if (!this.isNewEnergyInsurance(item)) {
return [item.originalItemDesc || item.itemDesc].filter(Boolean)
}
return [
item.originalItemDesc || '',
...this.selectedEquityProducts.map(product => product.itemDesc || '')
].filter(Boolean)
},
applyEquityProducts () {
const newEnergyInsurance = this.insuranceList.find(item => this.isNewEnergyInsurance(item))
if (!newEnergyInsurance) return
const itemDesc = this.buildNewEnergyDesc(
newEnergyInsurance.originalItemDesc || '',
this.selectedEquityProducts
)
this.$set(newEnergyInsurance, 'itemDesc', itemDesc)
if (String(this.currentItem.id) === String(newEnergyInsurance.id)) {
this.currentItem = newEnergyInsurance
}
},
buildNewEnergyDesc (originalItemDesc, products) {
const sections = [
originalItemDesc,
...products.map(item => item.itemDesc || '')
].filter(Boolean)
return sections.map((itemDesc, index) => {
const borderStyle = index ? 'border-top:2rpx solid #fff;' : ''
return `<div style="${borderStyle}padding:32rpx 0;">${itemDesc}</div>`
}).join('')
},
processHtmlString (htmlString) {
// 移除 `<br>` 及其变体,并用 `<div></div>` 替换
let processedString = htmlString.replace(/<\/?br\s*\/?>|\n/g, '<div></div>')
......@@ -387,9 +483,20 @@ export default {
}
}
.range {
padding: toRpx(40) toRpx(64);
padding: 0 toRpx(40);
box-sizing: border-box;
text-align: center;
.description-list {
width: 100%;
.description-item {
padding: toRpx(32) 0;
line-height: toRpx(44);
box-sizing: border-box;
&:not(:first-child) {
border-top: toRpx(4) solid #ffffff;
}
}
}
}
.cost {
&-input {
......@@ -569,4 +676,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<MessageBox
<Popup
ref="carBuyersVisible"
position="bottom"
:isFooter="false"
:title="`请选择${title}`"
:maxHeight="1000"
@close="$emit('close')"
@onCancel="handleCancel"
@onConfirm="handleConfirm"
>
<view class="select-box">
<view class="popup-title flex">
请选择{{ title }}
<view
class="select-item"
:class="{ checked: carBuyers == item.name }"
@click="handleSelect(item)"
v-for="(item, index) in carBuyersList"
:key="index"
class="popup-close flex"
@click="handleClose"
>
{{ item.name }}
<uni-icons
type="closeempty"
size="16"
></uni-icons>
</view>
</view>
</MessageBox>
<view class="popup-search">
<input
v-model="keyword"
class="input"
type="text"
placeholder="查找"
placeholder-class="placeholder"
confirm-type="search"
/>
<view
v-if="keyword"
class="clear flex"
@click="keyword = ''"
>
<uni-icons
type="closeempty"
size="16"
></uni-icons>
</view>
</view>
<scroll-view
scroll-y
class="popup-body"
>
<view
v-if="filteredProductList.length"
class="select-box"
>
<view
v-for="item in filteredProductList"
:key="item.itemName"
:class="['select-item flex', { checked: isSelected(item) }]"
@click="toggleSelect(item)"
>
<view class="sprite-icon icon-tag-checked"></view>
<view class="product-name text-hide">{{ item.itemName }}</view>
</view>
</view>
<view
v-else
class="empty flex"
>{{ productList.length ? '未找到相关权益产品' : '当前门店暂无可选权益产品' }}</view>
</scroll-view>
</Popup>
</template>
<script type="text/ecmascript-6">
import Popup from '@/components/Popup.vue'
export default {
name: 'carBuyers',
components: { Popup },
props: {
title: {
type: String,
default: '购车方式'
default: '权益产品'
},
salesPropsUuid: {
type: String,
default: ''
productList: {
type: Array,
default: () => []
}
},
data () {
return {
carBuyersList: [
{
name: '全款',
id: 1
},
{
name: '按揭',
id: 2
}
]
selectedNames: [],
keyword: ''
}
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
handler () {
this.resetSelection()
this.close()
}
},
......@@ -60,19 +97,46 @@ export default {
watchStatus () {
return this.$store.state.user.historyStatus
},
carBuyers () {
return this.$store.state.user.customerInfo.carBuyers
selectedProducts () {
return this.$store.state.user.insuranceEquityProducts || []
},
},
mounted () {
filteredProductList () {
const keyword = this.keyword.trim()
if (!keyword) return this.productList
return this.productList.filter(item => String(item.itemName || '').includes(keyword))
}
},
methods: {
open () {
this.resetSelection()
this.keyword = ''
this.$refs.carBuyersVisible.open()
},
handleSelect (item) {
this.close();
this.$emit('select', item)
resetSelection () {
this.selectedNames = this.selectedProducts.map(item => item.itemName)
},
isSelected (item) {
return this.selectedNames.includes(item.itemName)
},
toggleSelect (item) {
const index = this.selectedNames.indexOf(item.itemName)
if (index === -1) this.selectedNames.push(item.itemName)
else this.selectedNames.splice(index, 1)
},
handleConfirm () {
const selectedProducts = this.productList.filter(item => this.isSelected(item))
this.close()
this.$emit('confirm', selectedProducts)
},
handleCancel () {
this.resetSelection()
this.close()
this.$emit('cancel')
},
handleClose () {
this.resetSelection()
this.close()
this.$emit('close')
},
close () {
this.$refs?.carBuyersVisible?.close()
......@@ -82,26 +146,101 @@ export default {
</script>
<style scoped lang="scss">
.popup-title {
height: toRpx(104);
justify-content: center;
position: relative;
color: #333333;
font-size: toRpx(36);
font-weight: 500;
.popup-close {
position: absolute;
height: 100%;
top: 0;
right: 0;
padding: 0 toRpx(48);
font-weight: 400;
color: #1a1a1a;
}
}
.popup-search {
height: toRpx(80);
border-radius: toRpx(40);
background: #f5f7fa;
margin: 0 toRpx(48);
position: relative;
.input {
height: 100%;
width: 100%;
text-align: center;
color: #333;
font-size: toRpx(32);
}
.placeholder {
height: 100%;
color: #999ea8;
font-family: uniicons;
display: flex;
align-items: center;
justify-content: center;
&::after {
display: block;
content: '\e654';
margin-left: toRpx(8);
height: 100%;
display: flex;
align-items: center;
font-size: toRpx(36);
}
}
.clear {
position: absolute;
right: 0;
top: 0;
height: 100%;
padding: 0 toRpx(48);
}
}
.popup-body {
height: calc(70vh - #{toRpx(392)});
padding-top: toRpx(32);
box-sizing: border-box;
}
.select-box {
margin: toRpx(40) 0;
margin: 0 toRpx(48);
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: toRpx(32);
overflow-y: scroll;
max-height: 50vh;
padding-bottom: toRpx(60);
.select-item {
text-align: center;
height: toRpx(68);
line-height: toRpx(44);
opacity: 1;
height: toRpx(72);
border: toRpx(2) solid #dce0e6;
color: #333;
color: #333333;
font-size: toRpx(32);
border-radius: toRpx(8);
box-sizing: border-box;
justify-content: center;
position: relative;
padding: 0 toRpx(24);
&.checked {
border: toRpx(2) solid #292d33;
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
}
.empty {
height: 100%;
justify-content: center;
color: #808291;
font-size: toRpx(28);
}
</style>
<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>
<view class="info flex text-hide">
<template v-if="i.customerName || (i.customer && i.customer.customerName)">
{{ i.customerName || (i.customer && i.customer.customerName) }}
</template>
<template v-if="i.carSeriesName || i.carType">
<view class="car-model text-hide">({{ i.carType ? i.carType : i.carChildsBrandName + '-' + i.carSeriesName || '' }})</view>
<view>
<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>
<view class="info flex text-hide">
<template v-if="i.customerName || (i.customer && i.customer.customerName)">
{{ i.customerName || (i.customer && i.customer.customerName) }}
</template>
<template v-if="i.carSeriesName || i.carType">
<view class="car-model text-hide">({{ i.carType ? i.carType : i.carChildsBrandName + '-' +
i.carSeriesName
|| '' }})</view>
</template>
</view>
<template v-if="i.customerPhone || i.customer.customerPhone">
<view class="phone">|{{ i.customerPhone || (i.customer && i.customer.customerPhone) }}</view>
</template>
</view>
<template v-if="i.customerPhone || i.customer.customerPhone">
<view class="phone">|{{ i.customerPhone || (i.customer && i.customer.customerPhone) }}</view>
</template>
</view>
</template>
</template>
</view>
<view v-if="nothing" class="no-data">没有更多了</view>
</view>
</template>
......@@ -29,14 +30,14 @@ export default {
mixins: [popupmixin],
name: 'Customer',
inject: ['userInfo'],
data () {
data() {
return {
}
},
mounted () {
mounted() {
},
methods: {
async getList (searchValue, search) {
async getList(searchValue, search) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentId = ''
......@@ -48,37 +49,36 @@ export default {
const { shopMerchantId } = userInfo
const isOrderSearch = !params.defeat && userInfo.sceneType == 1
const useWorkPackageGoods = params.defeat || isOrderSearch
let apiTargetName = useWorkPackageGoods ? 'getWorkPackageGoodsList' : 'getQuotationCustomerList'
let apiParams = useWorkPackageGoods
? {
let apiTargetName = useWorkPackageGoods ? 'getWorkPackageGoodsList' : 'getQuotationCustomerList',
useWorkPackageGoodsParams = {
merchantId: shopMerchantId,
pageSize: 20,
pageNum: 1,
statusList: [1],
sceneType: 1,
keyword: searchValue || ''
keyword: searchValue || '',
lowPriceFlag: 1 //过滤低价单
}
let apiParams = useWorkPackageGoods
? useWorkPackageGoodsParams
: {
merchantId: shopMerchantId,
pageSize: 999999,
currentPage: 1,
search: searchValue
}
const { list } = await uni.$api.popupApi[apiTargetName](apiParams)
const { list, total } = await uni.$api.popupApi[apiTargetName](apiParams)
let customerList = list
if (useWorkPackageGoods) {
const listArray = list.map(item => {
if (item.customer && item.customer.carSeriesName) {
item.carType = `${item.customer.carBrand || ''}-${item.customer.carChildsBrandName || ''}-${item.customer.carSeriesName || ''}`
}
return item
})
customerList = listArray
customerList = this.formatList(list)
params.requestParams = useWorkPackageGoodsParams
params.apiTargetName = apiTargetName
params.total = total || 0
}
console.log(customerList, 'customerList')
this.updateParams(params, customerList || [])
},
initData (list) {
initData(list) {
const { params: { idKey, defeat }, data, userInfo } = this
const isOrderSearch = !defeat && userInfo.sceneType == 1
let key = defeat || isOrderSearch ? 'id' : 'customerPhone'
......@@ -91,23 +91,51 @@ export default {
this.list = list
this.$emit('onComplete')
},
handleSearch (searchValue) {
handleSearch(searchValue) {
this.nothing = false
this.list = []
this.getList(searchValue, true)
},
choose (i) {
choose(i) {
let { params, userInfo } = this
const isOrderSearch = !params.defeat && userInfo.sceneType == 1
let key = params.defeat || isOrderSearch ? 'id' : 'customerPhone'
this.currentId = i[key]
this.$emit('choose', i)
},
checkActive (i) {
formatList(list) {
return list.map(item => {
if (item.customer && item.customer.carSeriesName) {
item.carType = `${item.customer.carBrand || ''}-${item.customer.carChildsBrandName || ''}-${item.customer.carSeriesName || ''}`
}
return item
})
},
checkActive(i) {
let { currentId, data, params, userInfo } = this
const isOrderSearch = !params.defeat && userInfo.sceneType == 1
let key = params.defeat || isOrderSearch ? 'id' : 'customerPhone'
return currentId ? (i[key] == currentId) : (i[key]) == data[params.idKey]
}
},
async loadMore() {
this.nothing = false
let { params } = this,
{ requestParams, total, apiTargetName, cacheData } = params,
{ pageNum, pageSize } = requestParams
if (Math.ceil(total / pageSize) > pageNum) {
requestParams.pageNum += 1
uni.showLoading({
title: '加载中'
})
const res = await uni.$api.popupApi[apiTargetName](requestParams)
uni.hideLoading()
params.apiTargetName = apiTargetName
params.total = res.total || total
params.requestParams = requestParams
let list = this.formatList(res.list || [])
this.updateParams(params, [...cacheData, ...list])
} else this.nothing = true
},
}
}
</script>
......@@ -135,10 +163,12 @@ export default {
top: 0;
right: 0;
}
.info{
.info {
max-width: 70%;
}
.phone{
.phone {
flex-shrink: 0;
}
}
......@@ -152,5 +182,14 @@ export default {
display: block;
}
}
}
.no-data {
color: #999;
text-align: center;
padding: toRpx(50) 0;
font-size: toRpx(24);
}
</style>
......@@ -5,7 +5,7 @@ export default {
userInfo: { default: () => ({}) },
baseConfigData: { default: () => ({}) }
},
data () {
data() {
return {
list: [],
searchStatus: false,
......@@ -13,6 +13,7 @@ export default {
chooseList: [],
currentId: '',
currentIds: [],
nothing: false
}
},
props: {
......@@ -31,19 +32,19 @@ export default {
}
},
computed: {
listData () {
listData() {
return this.searchStatus ? this.searchList : this.list
},
noData () {
noData() {
return !this.listData.length
},
sceneType(){
sceneType() {
return uni.$storage.get('userInfo').sceneType
}
},
watch: {
noData: {
handler (val) {
handler(val) {
let { params } = this
params.noData = val
this.updateParams(params)
......@@ -52,14 +53,14 @@ export default {
}
},
methods: {
updateParams (params, data) {
updateParams(params, data) {
if (data) {
this.initData && this.initData(data)
params.cacheData = data
}
this.$emit('update:params', params)
},
componentLoading (params) {
componentLoading(params) {
params.loadComplete = false
this.$emit('update:params', this.params)
},
......@@ -67,5 +68,4 @@ export default {
return checkMarketingIcon(item, this.showMarketingIcon)
}
}
}
\ No newline at end of file
}
......@@ -16,7 +16,7 @@
</view>
</template>
<view v-if="componentObject[popupType]" :class="['popup-body', { 'hide-footer': componentObject[popupType].hideFooter }, { 'hide-search': componentObject[popupType].hideSearch }, { 'hide-footer-search': componentObject[popupType].hideFooter && componentObject[popupType].hideSearch }]">
<scroll-view scroll-y :class="['popup-scroll-view', { show: componentObject[popupType].loadComplete }]">
<scroll-view scroll-y :class="['popup-scroll-view', { show: componentObject[popupType].loadComplete }]" @scrolltolower="loadMore">
<component :is="componentObject[popupType].name" :params.sync="componentObject[popupType]" :data="data" :dataKey="dataKey" :isDefeatOrder="isDefeatOrder" :defaultTime="datePickerDefaultTime" :positionTypeList="positionTypeList" :show-marketing-icon="showMarketingIcon" :boutique-order-types-only="boutiqueOrderTypesOnly" ref="componentRef" @choose="chooseContent = $event" @openSkuPopup="openSkuPopup" @onComplete="componentObject[popupType].loadComplete = true" @confirm="confirm"></component>
<template v-if="componentObject[popupType].noData">
<view class="nothing flex">暂无数据</view>
......@@ -295,6 +295,14 @@ export default {
else componentRef.reset()
this.chooseContent = null
},
loadMore () {
let componentRef = this.componentRef()
if (!componentRef) uni.showToast({
title: '请稍后再试',
icon: 'none'
})
else componentRef.loadMore()
}
}
}
</script>
......
......@@ -44,10 +44,10 @@ uni.signHttpConfig = {
sessionParamName: 'sessionId',
sessionId: _ => uni.$storage?.get('sessionId')
},
sentry: {
enable: true, // 是否启用Sentry错误上报
dsn: 'https://cce6491788ff4b8899d8f912e6982a96@sentry.glsx.com.cn/42'
},
// sentry: {
// enable: true, // 是否启用Sentry错误上报
// dsn: 'https://cce6491788ff4b8899d8f912e6982a96@sentry.glsx.com.cn/42'
// },
response: {
code_key: 'code',
code_success_value: '0',
......
{
"name": "展业助手",
"appid": "__UNI__D3BD3DF",
"description": "",
"versionName": "2.26.3",
"versionCode": 2263,
"transformPx": false,
"sassImplementationName": "node-sass",
/* 5+App特有相关 */
"app-plus": {
"cache": {
"mode": "noCache"
"name" : "展业助手",
"appid" : "__UNI__D3BD3DF",
"description" : "",
"versionName" : "2.26.4",
"versionCode" : 2264,
"transformPx" : false,
"sassImplementationName" : "node-sass",
/* 5+App特有相关 */
"app-plus" : {
"cache" : {
"mode" : "noCache"
},
"webview" : {
"cacheMode" : "noCache"
},
"bounce" : "none",
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"compatible" : {
"ignoreVersion" : true
},
"screenOrientation" : "landscape",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {
"Camera" : {},
"VideoPlayer" : {},
"AudioPlayer" : {},
"SQLite" : {},
"Maps" : {},
"Geolocation" : {}
},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"targetSdkVersion" : 30,
"minSdkVersion" : 21,
"excludePermissions" : [
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>"
]
},
/* ios打包配置 */
"ios" : {
"dSYMs" : false,
"UIBackgroundModes" : "audio"
},
/* SDK配置 */
"sdkConfigs" : {
"ad" : {},
"speech" : {},
"geolocation" : {
"baidu" : {
"__platform__" : [ "android" ],
"appkey_ios" : "",
"appkey_android" : "rfN7u5gCi0KyCGIWWBYGXlmKrVQsKH8z"
}
},
"maps" : {}
},
"icons" : {
"android" : {
"hdpi" : "static/72.png",
"xhdpi" : "static/96.png",
"xxhdpi" : "static/144.png"
}
},
"plugins" : {
"audio" : {
"mp3" : {
"description" : "Android平台录音支持MP3格式文件"
}
}
}
},
"nativePlugins" : {
"Ba-KeepAliveSuit" : {
"__plugin_info__" : {
"name" : "安卓保活套装(通用、常驻通知、电池优化、自启管理、后台运行等)",
"description" : "在Ba-KeepAlive的基础上,新增了忽略电池优化、自启管理、常驻通知。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航(**注意:**不保证支持所有机型和场景,建议先试用再购买)",
"platforms" : "Android",
"url" : "https://ext.dcloud.net.cn/plugin?id=11765",
"android_package_name" : "uni.gltap",
"ios_bundle_id" : "",
"isCloud" : true,
"bought" : 1,
"pid" : "11765",
"parameters" : {}
}
}
}
},
"webview": {
"cacheMode": "noCache"
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx79d1ff39bee3d047",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"bounce": "none",
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"compatible": {
"ignoreVersion": true
"mp-alipay" : {
"usingComponents" : true
},
"screenOrientation": "landscape",
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
"mp-baidu" : {
"usingComponents" : true
},
/* 模块配置 */
"modules": {
"Camera": {},
"VideoPlayer": {},
"AudioPlayer": {},
"SQLite": {},
"Maps": {},
"Geolocation": {}
"mp-toutiao" : {
"usingComponents" : true
},
/* 应用发布信息 */
"distribute": {
/* android打包配置 */
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>"
],
"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"],
"targetSdkVersion": 30,
"minSdkVersion": 21,
"excludePermissions": ["<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>"]
},
/* ios打包配置 */
"ios": {
"dSYMs": false,
"UIBackgroundModes": "audio"
},
/* SDK配置 */
"sdkConfigs": {
"ad": {},
"speech": {},
"geolocation": {
"baidu": {
"__platform__": ["android"],
"appkey_ios": "",
"appkey_android": "rfN7u5gCi0KyCGIWWBYGXlmKrVQsKH8z"
}
},
"maps": {}
},
"icons": {
"android": {
"hdpi": "static/72.png",
"xhdpi": "static/96.png",
"xxhdpi": "static/144.png"
}
},
"plugins": {
"audio": {
"mp3": {
"description": "Android平台录音支持MP3格式文件"
}
}
}
"uniStatistics" : {
"enable" : false
},
"nativePlugins": {
"Ba-KeepAliveSuit": {
"__plugin_info__": {
"name": "安卓保活套装(通用、常驻通知、电池优化、自启管理、后台运行等)",
"description": "在Ba-KeepAlive的基础上,新增了忽略电池优化、自启管理、常驻通知。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航(**注意:**不保证支持所有机型和场景,建议先试用再购买)",
"platforms": "Android",
"url": "https://ext.dcloud.net.cn/plugin?id=11765",
"android_package_name": "uni.gltap",
"ios_bundle_id": "",
"isCloud": true,
"bought": 1,
"pid": "11765",
"parameters": {}
"vueVersion" : "2",
"h5" : {
"devServer" : {
"port" : 8080,
"https" : false
}
}
}
},
/* 快应用特有相关 */
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "wx79d1ff39bee3d047",
"setting": {
"urlCheck": false
},
"usingComponents": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "2",
"h5": {
"devServer": {
"port": 8080,
"https": false
}
}
}
......@@ -98,13 +98,13 @@ export default {
if (currentPage.route == 'pages/boutique/tool/index') {
if (isNewReport)
uni.redirectTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}`
url: `/pages/common/dailyNewspaper/index?componentName=StoreDailyReport&currentDate=${formattedDate}`
})
else uni.$emit('jumpToDailyReport', formattedDate)
} else {
if (isNewReport)
uni.navigateTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}`
url: `/pages/common/dailyNewspaper/index?componentName=StoreDailyReport&currentDate=${formattedDate}`
})
else
uni.navigateTo({
......@@ -207,6 +207,7 @@ export default {
sceneType: 0
})
.then(data => {
return resolve(false)
if (data) {
// 获取当前日期
let currentDate = new Date()
......@@ -226,13 +227,13 @@ export default {
if (currentPage.route == 'pages/equity/tool/index') {
if (isNewReport)
uni.redirectTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}`
url: `/pages/common/dailyNewspaper/index?componentName=StoreDailyReport&currentDate=${formattedDate}`
})
else uni.$emit('jumpToDailyReport', formattedDate)
} else {
if (isNewReport)
uni.navigateTo({
url: `/pages/common/dailyNewspaper/index?componentName=StaffDailyReport&currentDate=${formattedDate}`
url: `/pages/common/dailyNewspaper/index?componentName=StoreDailyReport&currentDate=${formattedDate}`
})
else
uni.navigateTo({
......
......@@ -80,7 +80,7 @@ export default {
i.status = UPLOAD_STATUS.success;
i.file = config.OSS_DOMAIN + "/" + config.FOLDER + filePath;
} else {
this.sendSentry(result.detail.data[0].error);
// this.sendSentry(result.detail.data[0].error);
throw "上传失败";
}
getResult = "";
......@@ -116,14 +116,14 @@ export default {
}
}
},
sendSentry(msg) {
const { customerName, phoneNumber, carModel, staffName } =
this.$store.state.user.customerInfo;
const { name } = uni.$storage.get("userInfo");
this.$sendSentry(
`上传失败:手机号-${phoneNumber} 姓名-${customerName} 销售-${staffName} 车型-${carModel} 员工-${name},失败原因-${msg}`
);
},
// sendSentry(msg) {
// const { customerName, phoneNumber, carModel, staffName } =
// this.$store.state.user.customerInfo;
// const { name } = uni.$storage.get("userInfo");
// this.$sendSentry(
// `上传失败:手机号-${phoneNumber} 姓名-${customerName} 销售-${staffName} 车型-${carModel} 员工-${name},失败原因-${msg}`
// );
// },
async checkFileUpload(tempFilePath) {
console.log(tempFilePath);
let attempt = 0;
......
import dayjs from 'dayjs'
const CUSTOMER_TAGS = {
1: '已触客',
2: '已拉群',
3: '已交付引荐',
4: '首保维保客户 ',
5: '事故车客户'
}
module.exports = {
data: {
CUSTOMER_TAGS,
orderObj: [
{
label: '工单编号',
......@@ -29,6 +38,18 @@ module.exports = {
key: 'customerName'
},
{
label: '日报标签',
key: 'customerTags',
format: (data) => {
return data ? data.split(',').map(item => CUSTOMER_TAGS[item]).join('/') : ''
}
},
{
label: '实际交付日期',
key: 'actualDeliveryDate',
format: (val) => val ? dayjs(val).format('YYYY-MM-DD') : ''
},
{
label: '性别',
key: 'customerSex',
enum: {
......@@ -202,7 +223,7 @@ module.exports = {
3: '买赠策略',
4: '冲量活动',
5: '组合付款',
6:'内部结算'
6: '内部结算'
}
}
}
import dayjs from 'dayjs'
const FORM_LIST = [
[
{
......@@ -75,6 +76,21 @@ const FORM_LIST = [
required: true
},
{
hidden: false,
label: '日报标签',
value:'customerTags',
type:'radio',
multiple: true,
},
{
hidden: false,
label:'实际交付日期',
value:'actualDeliveryDate',
type:"single-calendar",
required: true,
endDate: dayjs().format('YYYY-MM-DD')
},
{
label: '性别',
value: 'customerSex',
type: 'radio',
......
......@@ -193,7 +193,7 @@ export default {
},
async entranceClick (item) {
if (this.toolComponentName == item.name) return
const noInterceptPage = ['DailyReport']
const noInterceptPage = ['DailyReport','storeDailyReport']
// 原禁止提单inspectionOfProhibitionBill方法被替换getLimitRecord
// if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
if (!noInterceptPage.includes(item.name) && (await this.checkDailyReport())) return
......
......@@ -47,11 +47,14 @@
</view>
<view class="footer">
<Footer>
<view :class="['btn default-btn', { w50: !saveBtn || !showPushBtn }]" @click="$emit('showNegotiationList')">查看洽谈明细表汇总</view>
<view :class="['btn default-btn',{w50:!saveBtn || !showPushBtn}]" @click="saveBtn = true" v-if="!saveBtn">编辑</view>
<!-- <view :class="['btn default-btn', { w100: !saveBtn || !showPushBtn }]" @click="$emit('showNegotiationList')">
查看洽谈明细表汇总</view> -->
<template v-if="!saveBtn">
<view :class="['btn default-btn', { w100: !showPushBtn }]" @click="saveBtn = true">编辑</view>
<view class="btn" @click="$emit('submitReport')" v-if="showPushBtn">上报数据</view>
</template>
<template v-else>
<view :class="['btn default-btn',{w50:!showPushBtn}]" @click="$emit('saveReport', list)">保存</view>
<view class="btn" @click="$emit('submitReport', list )" v-if="showPushBtn">上报数据</view>
<view class="btn w100" @click="$emit('saveReport', list)">保存</view>
</template>
</Footer>
</view>
......@@ -75,7 +78,7 @@ import DailyPopup from '../components/DailyPopup/index.vue'
export default {
name: 'StoreDailyReport',
components: { Table, Nothing, Footer, EditForm, FormItem, DailyPopup },
inject: ['userInfo', 'sceneType'],
inject: ['userInfo', 'sceneType', 'dailyReportRecordId'],
props: {
templateData: {
type: Array,
......@@ -83,8 +86,8 @@ export default {
},
reportDate: String,
ReportStatus: null,
isToday:Boolean,
SubmissionStatus:null
isToday: Boolean,
SubmissionStatus: null
},
data() {
return {
......@@ -94,8 +97,8 @@ export default {
}
},
computed: {
showPushBtn(){
return this.SubmissionStatus != 1 && this.isToday
showPushBtn() {
return this.SubmissionStatus == 2 && this.isToday && this.dailyReportRecordId()
}
},
watch: {
......@@ -129,12 +132,22 @@ export default {
mounted() {
},
methods: {
getCurrentStaff() {
const { name, uuid } = uni.$storage.get("userInfo"),
key = 'F2-107-6'
return {
name,
uuid,
key
}
},
itemShow(i) {
if (i.rules) {
let { keys, result } = i.rules,
{ list } = this
if (keys && result) {
console.log(result, keys)
let params = keys.map((c, index) => `val${index + 1}`),
// 将 new Function 改为 eval 方式
func = eval(`(function(${params.join(',')}) { return ${result}; })`),
......@@ -165,11 +178,22 @@ export default {
addItem(index) {
let { templateData, saveBtn } = this
if (!saveBtn) return
this.list[index].children.push(templateData[index].origin_children)
let data = this.list[index].children[this.list[index].children.length - 1],
c_index = this.list[index].children.length - 1,
parent = this.list[index]
this.$refs.editForm.open(data, c_index, index, parent)
try {
this.list[index].children.push(templateData[index].origin_children)
let data = this.list[index].children[this.list[index].children.length - 1],
c_index = this.list[index].children.length - 1,
parent = this.list[index]
let { name, uuid, key } = this.getCurrentStaff()
data.forEach(item => {
if (item.key == key) {
item.value = name
item[key] = uuid
}
})
this.$refs.editForm.open(data, c_index, index, parent)
} catch (error) {
console.log(error)
}
},
confirm(data, c_index, index) {
this.$set(this.list[index].children, c_index, utils.deepClone(data))
......@@ -222,16 +246,20 @@ export default {
async getMonthlyPendingCount() {
let { reportDate, userInfo, list, sceneType } = this,
{ shopMerchantId } = userInfo
const res = await uni.$api.dailyTemplateApi.getMonthlyPendingCount({
merchantId: shopMerchantId,
sceneType,
reportDate
})
let index = list.findIndex(i => i.key == 'F2-24')
let index = list.findIndex(i => i.key == 'F2-102')
if (index == -1) return
if (this.list[index].value == null || this.list[index].value == '' || this.list[index].value == undefined) {
if (res) this.$set(this.list[index], 'value', res.pendingCount)
let item = list[index]
if (item.value == null || item.value == '' || item.value == undefined) {
const res = await uni.$api.dailyTemplateApi.getMonthlyPendingCount({
merchantId: shopMerchantId,
sceneType,
reportDate
})
if (res) this.$set(item, 'value', res.pendingCount)
}
},
save() {
this.$emit('checkReportDetail', this.list)
}
}
}
......@@ -385,7 +413,7 @@ export default {
}
.btn {
width: calc(100% / 3 - #{toRpx(32)});
width: calc(100% / 2 - #{toRpx(32)});
height: toRpx(80);
display: flex;
justify-content: center;
......@@ -401,8 +429,9 @@ export default {
background: #3b73ff1a;
color: #4673ff;
}
.w50{
width: calc(100% / 2 - #{toRpx(32)});
.w100 {
width: 100%;
}
}
}
......
......@@ -5,7 +5,7 @@
<Detail :templateData="templateData" />
</template>
<template v-else>
<Edit :templateData="templateData" @showNegotiationList="changeComponent(true)" @saveReport="saveReport"
<Edit :templateData="templateData" @showNegotiationList="changeComponent(true)" @saveReport="saveReport($event, true)"
@submitReport="submitReport" :reportDate="currentDate" :ReportStatus="ReportStatus"
@getSaveBtnStatus="saveBtnStatus = $event" :SubmissionStatus="SubmissionStatus" :isToday="isToday" />
</template>
......
<template>
<view class="car-model-box">
<scroll-view
class="scroll-view"
scroll-y
:scroll-into-view="letter"
>
<scroll-view class="scroll-view" scroll-y :scroll-into-view="letter">
<template v-if="listData.length">
<template v-for="(i, index) in listData">
<view
class="item-box"
:key="index"
:id="i.letter"
>
<view class="letter-title flex">{{i.letter}}</view>
<template v-for="(c,cindex) in i.list">
<view
class="car-model"
:key="cindex"
>
<view class="brand-name">{{c.name}}</view>
<view class="item-box" :key="index" :id="i.letter">
<view class="letter-title flex">{{ i.letter }}</view>
<template v-for="(c, cindex) in i.list">
<view class="car-model" :key="cindex">
<view class="brand-name">{{ c.name }}</view>
<template v-for="(j, jindex) in c.childs">
<view
:key="jindex"
class="car-block"
>
<view
class="sub-brand-name"
@click="getCarSeries(j,c)"
>
{{j.name}}
<view :key="jindex" class="car-block">
<view class="sub-brand-name" @click="getCarSeries(j, c)">
{{ j.name }}
</view>
<view class="series-list">
<template v-for="(k, kindex) in j.childs">
<view
class="series-name"
:key="kindex"
>
<view
class="series-name flex"
@click="getCarTypeList(k)"
>
{{k.name}}
<uni-icons
:type="`${k.childs && k.childs.length && k.open ?'down':'right'}`"
size="18"
></uni-icons>
<view class="series-name" :key="kindex">
<view :class="['series-name flex']" >
<view class="left flex" @click="chooseSeries(c, j, k)">
<uni-icons :type="`${checkActive(k) ? 'circle-filled' : 'circle'}`" size="20"
class="series-icon" :color="checkActive(k) ? '#347BFF' : '#292D33'"></uni-icons>
{{ k.name }}
</view>
<uni-icons :type="`${k.childs && k.childs.length && k.open ? 'up' : 'down'}`"
size="18" class="arrow" @click="getCarTypeList(k)" color="#BEC1C7"></uni-icons>
</view>
<view
class="brand-list"
v-if="k.open"
>
<template v-for="(s,sindex) in k.childs">
<view
:class="['item flex',{active: checkActive(s)}]"
:key="`${s.id}_${sindex}`"
@click.stop="chooseCarType(s,c)"
>
{{s.name}}
<view class="brand-list" v-if="k.open">
<template v-for="(s, sindex) in k.childs">
<view :class="['item flex', { active: checkActive(s) }]" :key="`${s.id}_${sindex}`"
@click.stop="chooseCarType(s, c)">
{{ s.name }}
<view class="sprite-icon icon-tag-checked"></view>
</view>
</template>
......@@ -76,12 +49,8 @@
</scroll-view>
<view class="letter-list">
<template v-for="(i, index) in listData">
<view
class="letter-item"
:key="index"
@click="letter = i.letter"
>
{{i.letter}}
<view class="letter-item" :key="index" @click="letter = i.letter">
{{ i.letter }}
</view>
</template>
</view>
......@@ -93,15 +62,15 @@ import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'CarModelList',
data () {
data() {
return {
letter: 'A',
}
},
mounted () {
mounted() {
},
methods: {
async getList (searchValue) {
async getList(searchValue) {
const { userInfo, params } = this,
{ cacheData } = params
this.currentId = ''
......@@ -115,7 +84,7 @@ export default {
{ carBrandList } = data[0]
this.updateParams(params, carBrandList || [])
},
initData (carData) {
initData(carData) {
let { params: { idKey }, data: { customer, carInfo } } = this,
letterList = Array.from(new Set([...carData.map((e) => e.letter)])),
carModelList = letterList.map(e => {
......@@ -134,7 +103,7 @@ export default {
this.list = carModelList
this.$emit('onComplete')
},
handleSearch (searchValue) {
handleSearch(searchValue) {
if (!searchValue) {
this.searchStatus = false
this.letter = 'A'
......@@ -178,7 +147,7 @@ export default {
}
},
async getCarSeries (j, c) {
async getCarSeries(j, c) {
if (j.childs && j.childs.length) return
uni.showLoading({
mask: true
......@@ -191,7 +160,8 @@ export default {
j.childs = data
this.$forceUpdate()
},
async getCarTypeList (k) {
async getCarTypeList(k) {
if (k.childs && k.childs.length) {
k.open = !k.open
this.$forceUpdate()
......@@ -215,7 +185,19 @@ export default {
})
},
chooseCarType (s, c) {
chooseSeries(c, j, k) {
let chooseItem = {
vehicleBrandId: c.id,
vehicleBrandName: c.name,
vehicleSubBrandId: j.id,
vehicleSubBrandName: j.name,
vehicleSeriesId: k.id,
vehicleSeriesName: k.name
}
this.currentId = k.id
this.$emit('choose', chooseItem)
},
chooseCarType(s, c) {
let chooseItem = {
vehicleBrandId: c.id,
vehicleBrandName: c.name,
......@@ -229,11 +211,11 @@ export default {
this.currentId = s.id
this.$emit('choose', chooseItem)
},
checkActive (s) {
checkActive(s) {
let { currentId, data, params, data: { key } } = this,
carInfo = data[key] || {}
return (currentId ? s.id == currentId : s.id == carInfo[params.idKey] || '' )
return (currentId ? s.id == currentId : s.id == carInfo[params.idKey] || '')
},
}
}
......@@ -244,9 +226,11 @@ export default {
position: relative;
height: 100%;
width: 100%;
.scroll-view {
height: 100%;
}
.letter-list {
position: absolute;
top: 50%;
......@@ -258,8 +242,10 @@ export default {
padding: 0 toRpx(18);
text-align: center;
}
.item-box {
margin-bottom: toRpx(32);
.letter-title {
color: #888888;
font-size: toRpx(28);
......@@ -267,20 +253,24 @@ export default {
background: #f5f7fa;
padding-left: toRpx(48);
}
.car-model {
margin: 0 toRpx(48);
.brand-name {
color: #000;
color: #333;
font-size: toRpx(40);
line-height: toRpx(40);
margin: toRpx(20) 0;
font-weight: 500;
}
.car-block {
border-bottom: toRpx(2) solid #dce0e6;
}
.sub-brand-name {
color: #333;
color: #888;
font-size: toRpx(32);
line-height: toRpx(40);
width: 100%;
......@@ -288,17 +278,28 @@ export default {
margin: toRpx(16) 0;
padding-left: toRpx(10);
}
.series-name {
color: #555;
font-size: toRpx(28);
color: #888;
font-size: toRpx(30);
line-height: toRpx(40);
width: 100%;
flex-shrink: 0;
margin-bottom: toRpx(16);
padding-left: toRpx(20);
.left,.arrow{
width: 50%;
}
.arrow{
text-align: right;
}
.series-icon {
margin-right: toRpx(12);
}
}
}
}
.brand-list {
// display: grid;
// grid-template-columns: repeat(4, 1fr);
......@@ -307,18 +308,20 @@ export default {
// gap: toRpx(32) 0;
flex-wrap: wrap;
padding: 0 toRpx(20);
.item {
width: calc((100% - #{toRpx(96)}) / 4);
justify-content: center;
min-height: toRpx(72);
min-height: toRpx(64);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
padding: toRpx(10) toRpx(20);
font-size: toRpx(26);
padding: toRpx(6) toRpx(14);
box-sizing: border-box;
.sprite-icon {
display: none;
position: absolute;
......@@ -326,10 +329,12 @@ export default {
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
......
......@@ -126,6 +126,7 @@ export default {
grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
padding-bottom: toRpx(2);
.item {
justify-content: center;
height: toRpx(72);
......
<template>
<view class="options-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>
{{ i.label }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'OptionsComponent',
inject: ['userInfo'],
data() {
return {
}
},
computed: {
},
mounted() {
},
methods: {
async getList() {
const hasCommonElement = (arrA, arrB) => {
return arrA.some(item => arrB.includes(item))
}
const isSubset = (arrA, arrB) => {
// 检查arrB的每个元素是否都在arrA中
const setA = new Set(arrA)
return arrB.every(item => setA.has(item))
}
let { params, data: { options }, STORE_BASE_SCENE_CODE, CAR_BRAND_ID } = this
this.currentId = ''
this.currentIds = []
this.chooseList = []
this.componentLoading(params)
options = options.filter(item => {
// 品牌过滤
let filterBrand = true,
filterScene = true,
brandId = true,
flag = true
if (item.filterBrandId && item.filterBrandId.length) {
filterBrand = !isSubset(item.filterBrandId, CAR_BRAND_ID)
} else {
brandId = item.brandId && item.brandId.length ? hasCommonElement(item.brandId, CAR_BRAND_ID) : true
}
filterScene = item.baseSceneCode&& item.baseSceneCode?.length ? hasCommonElement(item.baseSceneCode, STORE_BASE_SCENE_CODE) : true
flag = filterBrand && brandId && filterScene
if(item.matchEffect ) {
flag = !flag
}
return flag
})
this.updateParams(params, options || [])
},
initData(list) {
const { data, data: { key }, params: { multiple } } = this
if (data[key]) {
if (!multiple) {
this.currentId = data[key]
let item = list.find(i => i.value == this.currentId)
this.$emit('choose', item)
} else {
let arr = data[key]
if (typeof arr == 'string') arr = arr.split(',')
this.chooseList = arr.map(i => list.find(e => e.value == i))
this.currentIds = arr
this.$emit('choose', this.chooseList)
}
}
this.list = list
this.$emit('onComplete')
},
choose(i) {
let { params: { multiple }, currentIds } = this
if (!multiple) {
this.currentId = i.value
this.$emit('choose', i)
} else {
let index = currentIds.indexOf(i.value)
if (index == -1) {
this.currentIds.push(i.value)
this.chooseList.push(i)
} else {
this.currentIds.splice(index, 1)
this.chooseList.splice(index, 1)
}
this.$emit('choose', this.chooseList)
}
},
checkActive(i) {
let { currentId, currentIds, data: { key }, data } = this
if (currentIds && currentIds.length) return currentIds.includes(i.value)
return currentId ? i.value == currentId : i.value == data[key]
}
}
}
</script>
<style scoped lang="scss">
.options-list {
display: grid;
grid-template-columns: repeat(4, 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>
export default {
inject: ['userInfo', 'baseConfigData'],
data () {
data() {
return {
list: [],
searchStatus: false,
searchList: [],
chooseList: [],
currentId: '',
currentIds: [],
currentIds: []
}
},
props: {
......@@ -16,22 +16,31 @@ export default {
dataKey: String,
isDefeatOrder: Boolean,
positionTypeList: Array,
reqParams: Object,
reqParams: Object
},
computed: {
listData () {
listData() {
return this.searchStatus ? this.searchList : this.list
},
noData () {
noData() {
return !this.listData.length
},
sceneType(){
sceneType() {
return uni.$storage.get('userInfo').sceneType
},
CAR_BRAND_ID() {
const carBrandList = uni.$storage.get('carBrandList'),
carBrandId = carBrandList.map(item => item.id)
return carBrandId
},
STORE_BASE_SCENE_CODE() {
const storeBaseSceneCode = uni.$storage.get('storeBaseSceneCode')
return storeBaseSceneCode
}
},
watch: {
noData: {
handler (val) {
handler(val) {
let { params } = this
params.noData = val
this.updateParams(params)
......@@ -40,17 +49,16 @@ export default {
}
},
methods: {
updateParams (params, data) {
updateParams(params, data) {
if (data) {
this.initData && this.initData(data)
params.cacheData = data
}
this.$emit('update:params', params)
},
componentLoading (params) {
componentLoading(params) {
params.loadComplete = false
this.$emit('update:params', this.params)
}
}
}
\ No newline at end of file
}
......@@ -12,6 +12,7 @@ const componentConfig = {
name: 'EmployeeList',
title: '选择人员',
placeholder: '请输入姓名',
nullTips: '请选择',
idKey: ['userId'],
cacheData: [],
loadComplete: false,
......@@ -22,6 +23,7 @@ const componentConfig = {
name: 'EmployeeList',
title: '选择人员',
placeholder: '请输入姓名',
nullTips: '请选择',
idKey: ['userId'],
cacheData: [],
loadComplete: false,
......@@ -33,7 +35,7 @@ const componentConfig = {
title: '多选',
multiple: true,
placeholder: '请输入姓名',
nullTips: '请选择交付专员',
nullTips: '请选择',
idKey: ['userId'],
cacheData: [],
loadComplete: false,
......@@ -45,7 +47,7 @@ const componentConfig = {
title: '选择车型',
placeholder: '查找',
idKey: 'vehicleShapeId',
nullTips: '请选择车型',
nullTips: '请选择',
cacheData: [],
loadComplete: false,
searchValue: '',
......@@ -55,6 +57,7 @@ const componentConfig = {
name: 'OrderList',
title: '选择订单',
placeholder: '请输入订单号',
nullTips: '请选择',
idKey: ['orderCode'],
cacheData: [],
loadComplete: false,
......@@ -71,6 +74,18 @@ const componentConfig = {
loadComplete: false,
searchValue: '',
noData: false
},
7: {
name: 'OptionsComponent',
title: '多选',
multiple: true,
placeholder: '请输入选项',
nullTips: '请选择',
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false,
hideSearch: true
}
}
......
......@@ -77,6 +77,15 @@ export default {
return rules?.maxDate ? dayjs(eval(rules.maxDate)).format('YYYY-MM-DD') : '2099-12-31'
}
},
STORE_BASE_SCENE_CODE() {
const storeBaseSceneCode = uni.$storage.get('storeBaseSceneCode')
return storeBaseSceneCode.map(item => String(item)) || []
},
CAR_BRAND_ID() {
const carBrandList = uni.$storage.get('carBrandList'),
carBrandId = carBrandList.map(item => String(item.id))
return carBrandId || []
},
},
mounted() {
},
......@@ -95,7 +104,21 @@ export default {
* @param parent 父级数据
*/
open(data, c_index, index, parent) {
this.data = utils.deepClone(data) || {}
let _data = utils.deepClone(data) || {}
const hasCommonElement = (arrA, arrB) => {
arrA = arrA.map(item => String(item))
arrB = arrB.map(item => String(item))
return arrA.some(i => arrB.includes(i))
}
_data.forEach(item => {
if (item.type == 'select' && !item.optionsKey) {
item.options = item.options.filter(i => i.baseSceneCode && i.baseSceneCode?.length ? hasCommonElement(i.baseSceneCode, this.STORE_BASE_SCENE_CODE) : true)
}
})
_data.$sceneCodes = this.STORE_BASE_SCENE_CODE
_data.$brandIds = this.CAR_BRAND_ID || []
this.data = _data || {}
this.c_index = c_index || 0
this.index = index || 0
this.parent = utils.deepClone(parent) || {}
......@@ -131,12 +154,16 @@ export default {
func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = []
keys.map(key => {
let item = data.find(i => i.key == key)
if (item) value.push(item.value || null)
let i = data.find(i => i.key == key)
if (data[key]) value.push(data[key])
if (i) value.push(i[i.key] || null)
})
let show = func(...value)
item.show = show
if (!item.show && item.value) item.value = null
if (!item.show && item.value) {
item.value = null
item[item.key] = null
}
return show
} else {
item.show = true
......@@ -150,8 +177,10 @@ export default {
onInput(val, index) {
this.$set(this.data[index], 'value', val)
},
onSelect(val, index) {
this.$set(this.data[index], 'value', val)
onSelect(item, index) {
let { key } = this.data[index]
this.$set(this.data[index], key, item.value || item)
this.$set(this.data[index], 'value', item.label || item)
},
openSelect(item, type, index) {
let list = this.data || []
......@@ -169,18 +198,21 @@ export default {
/** 根据 popupType 处理数据
* 5: 日期时间选择
* 6: 日历
* 7: 多选
*/
if (popupType == 6 || popupType == 5) {
this.$set(this.data[itemIndex], 'value', chooseContent)
this.$set(this.data[itemIndex], 'value', chooseContent || '')
} else if (popupType == 3) {
const { vehicleBrandName, vehicleSubBrandName, vehicleSeriesName, vehicleShapeName } = chooseContent
this.$set(this.data[itemIndex], 'value', `${vehicleBrandName}-${vehicleSubBrandName}-${vehicleSeriesName}-${vehicleShapeName}`)
let carName = `${vehicleBrandName}-${vehicleSubBrandName}-${vehicleSeriesName}`
if (vehicleShapeName) carName += `-${vehicleShapeName}`
this.$set(this.data[itemIndex], 'value', carName)
this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent)
} else if (popupType == 4) {
this.$set(this.data[itemIndex], 'value', chooseContent.orderCode)
this.$set(this.data[itemIndex], 'value', chooseContent?.orderCode || '')
let completeFun = this.data[itemIndex].completeFun
if (completeFun) {
if (completeFun && chooseContent) {
let { keys, resultKeys } = completeFun
keys.map((key, index) => {
let ind = this.data.findIndex(i => i.key == key),
......@@ -189,9 +221,14 @@ export default {
})
}
} else if (popupType == 7) {
let label = chooseContent?.map(item => item.label).join('/') || '',
value = chooseContent?.map(item => item.value) || []
this.$set(this.data[itemIndex], 'value', label)
this.$set(this.data[itemIndex], this.data[itemIndex].key, value)
} else {
this.$set(this.data[itemIndex], 'value', chooseContent.staffName)
this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent.uuid)
this.$set(this.data[itemIndex], 'value', chooseContent?.staffName || '')
this.$set(this.data[itemIndex], this.data[itemIndex].key, chooseContent?.uuid || '')
}
let clearkeys = this.data[itemIndex].clearkeys
if (clearkeys) {
......
......@@ -31,8 +31,8 @@
</template>
<template v-else>
<picker class="picker" mode="selector" @change="select" :range="item.options || []" range-key="label">
<view :class="['select flex', { 'placeholderStyle': !item.value }]" ><text
class="text-hide">{{ item.value || item.placeholder || '请选择' }}</text>
<view :class="['select flex', { 'placeholderStyle': !item.value }]"><text class="text-hide">{{ item.value
|| item.placeholder || '请选择' }}</text>
<view class="sprite-icon icon-icon-select"></view>
</view>
</picker>
......@@ -75,10 +75,7 @@
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs';
import utils from '@/utils/utils'
import permision from '@/js_sdk/wa-permission/permission.js'
export default {
name: 'FormItem',
props: {
......@@ -142,10 +139,10 @@ export default {
if (item.optionsKey || ['date', 'datetime', 'carBrandSelect'].includes(item.type)) {
if (item.optionsKey == 'storeStaffList' && item.type == 'select') popupType = 1
if (item.optionsKey == 'orderList') popupType = 4
if (item.optionsKey == 'options') popupType = 7
this.$emit('openSelect', item, popupType)
} else {
this.$emit('onSelect', item.options[e.detail.value].value)
this.$emit('onSelect', item.options[e.detail.value])
}
},
async clickPrefix() {
......@@ -197,30 +194,100 @@ export default {
},
getBase64FromImagePath(imagePath) {
return new Promise((resolve, reject) => {
// APP 平台使用 plus.io 来读取文件
plus.io.resolveLocalFileSystemURL(imagePath, (entry) => {
entry.file((file) => {
const reader = new plus.io.FileReader()
reader.onloadend = (e) => {
const base64 = e.target.result
let prefix = 'data:image/png;base64,'
if (imagePath.toLowerCase().endsWith('.jpg') || imagePath.toLowerCase().endsWith('.jpeg')) {
prefix = 'data:image/jpeg;base64,'
} else if (imagePath.toLowerCase().endsWith('.gif')) {
prefix = 'data:image/gif;base64,'
}
resolve(prefix + base64.split(',')[1]) // 去掉 data URL 前缀,因为我们自己添加
// #ifdef APP-PLUS
// 1. 优先使用 plus.nativeObj.Bitmap,它专门处理图片且对 Android 10+ 路径兼容性较好
const bitmap = new plus.nativeObj.Bitmap('scan_vin_' + Date.now());
bitmap.load(imagePath, () => {
const base64 = bitmap.toBase64Data();
bitmap.clear();
// Bitmap.toBase64Data() 返回的已经是完整的 data URL
resolve(base64);
}, (err) => {
bitmap.clear();
console.error('Bitmap 加载失败,尝试 plus.io:', err);
// 2. 备选方案:plus.io
this.plusReadBase64(imagePath, resolve, (err2) => {
console.error('plus.io 读取失败,尝试原生 Java 读取:', err2);
// 3. 终极方案:针对 Android 10+ 的原生 Java 读取 (绕过 Scoped Storage 限制)
if (plus.os.name === 'Android') {
this.readBase64ByAndroid(imagePath).then(base64 => {
let prefix = 'data:image/png;base64,'
const lowerPath = imagePath.toLowerCase()
if (lowerPath.endsWith('.jpg') || lowerPath.endsWith('.jpeg')) {
prefix = 'data:image/jpeg;base64,'
} else if (lowerPath.endsWith('.gif')) {
prefix = 'data:image/gif;base64,'
}
resolve(prefix + base64);
}).catch(err3 => {
reject(err3);
});
} else {
reject(err2);
}
reader.onerror = (err) => {
reject(err)
});
});
// #endif
// #ifndef APP-PLUS
reject(new Error('当前环境不支持该操作'))
// #endif
})
},
readBase64ByAndroid(absPath) {
return new Promise((resolve, reject) => {
try {
// 清洗路径
let path = absPath.replace(/^file:\/\//, '');
const File = plus.android.importClass('java.io.File');
const FileInputStream = plus.android.importClass('java.io.FileInputStream');
const Base64 = plus.android.importClass('android.util.Base64');
const file = new File(path);
if (!file.exists()) {
return reject('文件不存在: ' + path);
}
const fis = new FileInputStream(file);
const length = file.length();
const buffer = plus.android.newObject('byte[]', length);
fis.read(buffer);
fis.close();
// Base64.NO_WRAP 避免换行符
const base64 = Base64.encodeToString(buffer, 2);
resolve(base64);
} catch (e) {
reject('原生读取异常: ' + e);
}
});
},
plusReadBase64(imagePath, resolve, reject) {
// 兼容性回退:尝试使用 plus.io
plus.io.resolveLocalFileSystemURL(imagePath, (entry) => {
entry.file((file) => {
const reader = new plus.io.FileReader()
reader.onloadend = (e) => {
const base64 = e.target.result
let prefix = 'data:image/png;base64,'
if (imagePath.toLowerCase().endsWith('.jpg') || imagePath.toLowerCase().endsWith('.jpeg')) {
prefix = 'data:image/jpeg;base64,'
} else if (imagePath.toLowerCase().endsWith('.gif')) {
prefix = 'data:image/gif;base64,'
}
reader.readAsDataURL(file)
}, (err) => {
resolve(prefix + base64.split(',')[1])
}
reader.onerror = (err) => {
reject(err)
})
}
reader.readAsDataURL(file)
}, (err) => {
reject(err)
})
}, (err) => {
reject(err)
})
},
async orcRecogintion(imgBase64) {
......@@ -415,7 +482,8 @@ export default {
background: #f4f5f7;
padding: toRpx(24);
box-sizing: border-box;
.select{
.select {
width: 100%;
height: 100%;
display: block;
......
......@@ -235,6 +235,10 @@ export default {
background-color: #f0f4ff;
border-bottom: toRpx(2) solid #fff;
border-right: toRpx(2) solid #fff;
font-size: 0;
.cell-text {
font-weight: 500;
}
}
.required-text {
......@@ -251,9 +255,9 @@ export default {
.header-cell {
background-color: #f0f4ff;
color: #000;
font-size: toRpx(28);
font-weight: 500;
border-bottom: toRpx(2) solid #fff;
font-size: 0;
}
.fixed-header {
......@@ -313,6 +317,7 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: toRpx(28);
}
.footer-row {
......
......@@ -26,7 +26,8 @@
<component :ref="`ref-${componentName}`" :is="componentName" :templateData="templateData"
:currentDate="currentDate" @changeComponent="changeComponent" @submitReport="submitReport"
@saveReportStatus="saveReportStatus" :ReportStatus="reportStatus" @maxLengthError="maxLengthError"
:SubmissionStatus="submissionStatus" :submissionDate="submissionDate" />
:SubmissionStatus="submissionStatus" :submissionDate="submissionDate"
@checkReportDetail="checkReportDetail" />
</view>
</view>
<NoticePopup ref="notice" :title="noticeObj.title" :text="noticeObj.text" :type="noticeObj.type || 'success'"
......@@ -78,7 +79,7 @@ export default {
dailyReportRecordId: '',
reportStatus: '',
submissionStatus: '',
submissionDate:''
submissionDate: ''
}
},
onBackPress(options) {
......@@ -104,10 +105,10 @@ export default {
carBrandId = carBrandList.map(item => item.id)
return carBrandId
},
BASE_SCENE_CODE() {
const baseSceneCode = uni.$storage.get('baseSceneCode')
return baseSceneCode
},
// BASE_SCENE_CODE() {
// const baseSceneCode = uni.$storage.get('baseSceneCode')
// return baseSceneCode
// },
STORE_BASE_SCENE_CODE() {
const storeBaseSceneCode = uni.$storage.get('storeBaseSceneCode')
return storeBaseSceneCode
......@@ -212,14 +213,10 @@ export default {
const setA = new Set(arrA)
return arrB.every(item => setA.has(item))
}
const { templateType, CAR_BRAND_ID, BASE_SCENE_CODE, STORE_BASE_SCENE_CODE } = this,
const { templateType, CAR_BRAND_ID, STORE_BASE_SCENE_CODE } = this,
data = await uni.$api.dailyTemplateApi.getDailyTemplate(templateType),
baseCode = templateType == 2 ? STORE_BASE_SCENE_CODE : BASE_SCENE_CODE
baseCode = STORE_BASE_SCENE_CODE
let templateData = Object.values(data)
// .filter(item => {
// // 场景类型过滤
// return item.sceneType.length ? item.sceneType.includes(SCENE_TYPE) : true
// })
.filter(item => {
// 品牌过滤
if (item.filterBrandId && item.filterBrandId.length) {
......@@ -231,7 +228,11 @@ export default {
.filter(item => {
if (item.type == 'subform' && item.children.length) {
item.children[0] = item.children[0].filter(child => {
return child.brandId?.length ? hasCommonElement(child.brandId, CAR_BRAND_ID) : true
if (child.filterBrandId && child.filterBrandId.length) {
return !isSubset(child.filterBrandId, CAR_BRAND_ID)
} else {
return child.brandId?.length ? hasCommonElement(child.brandId, CAR_BRAND_ID) : true
}
}).filter(child => {
return child.baseSceneCode?.length ? hasCommonElement(child.baseSceneCode, baseCode) : true
})
......@@ -270,6 +271,7 @@ export default {
}
})
uni.hideLoading()
console.log(templateData)
this.templateData = templateData
},
setCurrentDate(currentDate) {
......@@ -283,13 +285,9 @@ export default {
},
async checkReport() {
let componentRef = this.$refs[`ref-${this.componentName}`],
{ templateData, templateType, currentDate } = this
// if (templateType != 1) {
// if (!componentRef.isToday) return false
// } else {
{ templateData, currentDate } = this
let lastDay = dayjs().subtract(30, 'day')
if (!lastDay.isBefore(dayjs(currentDate), 'day')) return false
// }
return templateData.length ? componentRef.saveBtnStatus : false
},
......@@ -334,14 +332,44 @@ export default {
this.noticeObj = noticeObj
this.$refs.notice.open()
},
async checkReportDetail(data) {
let new_daily_report_record_id = await this.getReportDetail(true)
if (new_daily_report_record_id != this.dailyReportRecordId) {
this.openNotice(
{
title: '数据已被他人更新',
text: '在你编辑期间,其他用户已完成保存操作。若直接保存,将覆盖对方的最新修改。',
buttons: {
cancelText: '取消',
confirmText: '直接保存'
}
},
false,
_ => {
this.saveReport(data)
}
)
} else this.saveReport(data)
},
async saveReport(params) {
uni.showLoading({ title: '保存中...', mask: true })
const data = await uni.$api.dailyTemplateApi.saveDraft(params)
uni.hideLoading()
if (data) {
uni.showToast({ title: '操作成功', icon: 'success', mask: true })
this.saveReportStatus(data)
} else uni.showToast({ title: '操作失败', icon: 'none', mask: true })
},
async getReportDetail(getDailyReportRecordId = false) {
this.reportStatus = ''
this.dailyReportRecordId = ''
this.submissionDate = ''
if (!getDailyReportRecordId) {
this.reportStatus = ''
this.dailyReportRecordId = ''
this.submissionDate = ''
this.submissionStatus = ''
}
uni.showLoading({ title: '加载中...', mask: true })
try {
const { uuid, shopMerchantId } = this.userInfo,
nowDate = dayjs().format('YYYY-MM-DD'),
{ templateType, currentDate, SCENE_TYPE: sceneType } = this,
data = await uni.$api.dailyTemplateApi.getReportDetail({
merchantId: shopMerchantId,
......@@ -353,9 +381,9 @@ export default {
if (data) {
uni.hideLoading()
this.dailyReportRecordId = data.id
if (getDailyReportRecordId) return Promise.resolve(data.id)
else {
this.dailyReportRecordId = data.id
this.reportStatus = data.reportStatus
let templateData = JSON.parse(data.jsonContent || '[]')
templateData.forEach(e => {
......@@ -386,15 +414,10 @@ export default {
this.submissionDate = data.submissionDate
}
} else {
// if (this.templateType == 1) {
if (getDailyReportRecordId) return Promise.resolve('')
let lastDay = dayjs().subtract(30, 'day')
if (lastDay.isBefore(dayjs(currentDate), 'day')) this.getDailyTemplate()
else uni.hideLoading()
// } else {
// if (nowDate == currentDate) this.getDailyTemplate()
// else uni.hideLoading()
// }
}
} catch (error) {
uni.showToast({ title: error, icon: 'none', mask: true })
......@@ -418,12 +441,12 @@ export default {
this.assignTitle = val.title
this.assignIcon = val.icon
},
async submitReport(reportParams, skip) {
async submitReport(skip) {
if (this.templateType == 2 && !skip) {
uni.hideLoading()
this.noticeObj = {
title: '确定上报数据?',
text: '请确认驻店人员在当前场景下已完成所有个人的驻店日报及洽谈明细。门店日报上报后,将立即发送相关门店经营统计数据到指定消息群。',
text: '请确认已记录今日所有非成交客户信息,并确保成交客户已完成录单。门店日报上报后,将立即发送相关门店经营统计数据到指定消息群。',
type: 'warning',
buttons: [
{
......@@ -438,7 +461,7 @@ export default {
text: '确定',
type: 'primary',
callback: _ => {
this.submitReport(reportParams, true)
this.submitReport(true)
}
}
]
......@@ -448,15 +471,12 @@ export default {
}
this.$refs.notice.close()
uni.showLoading({ title: '提交中...', mask: true })
const saveData = await uni.$api.dailyTemplateApi.saveDraft(reportParams)
if (saveData) {
const dailyReportRecordId = await this.getReportDetail(true),
data = await uni.$api.dailyTemplateApi.submitReport({ dailyReportRecordId })
uni.hideLoading()
if (data) {
uni.showToast({ title: '操作成功', icon: 'success', mask: true })
this.saveReportStatus(data)
} else uni.showToast({ title: '操作失败', icon: 'none', mask: true })
const { dailyReportRecordId } = this,
data = await uni.$api.dailyTemplateApi.submitReport({ dailyReportRecordId })
uni.hideLoading()
if (data) {
uni.showToast({ title: '操作成功', icon: 'success', mask: true })
this.saveReportStatus(data)
} else uni.showToast({ title: '操作失败', icon: 'none', mask: true })
},
......
......@@ -19,7 +19,7 @@ export default {
},
ReportStatus: null,
SubmissionStatus: null,
submissionDate:[String, Number]
submissionDate: [String, Number]
},
computed: {
/**可编辑日期 */
......@@ -33,7 +33,7 @@ export default {
},
reportParams() {
let { shopMerchantId, shopMerchantName, uuid, name, merchantId, merchantName } = this.userInfo,
{ currentDate, templateType, dailyReportRecordId, sceneType, SubmissionStatus , submissionDate} = this,
{ currentDate, templateType, dailyReportRecordId, sceneType, SubmissionStatus, submissionDate } = this,
params = {
merchantId: shopMerchantId,
merchantName: shopMerchantName,
......@@ -44,11 +44,11 @@ export default {
templateType: templateType(),
yqMerchantId: merchantId,
yqMerchantName: merchantName,
sceneType,
sceneType
}
if (!SubmissionStatus) params.submissionStatus = 2
else params.submissionStatus = SubmissionStatus
if(!submissionDate) params.submissionDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
if (!submissionDate) params.submissionDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
else params.submissionDate = dayjs(submissionDate).format('YYYY-MM-DD HH:mm:ss')
if (dailyReportRecordId()) params.dailyReportRecordId = dailyReportRecordId()
return params
......@@ -67,8 +67,9 @@ export default {
func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = []
keys.map(key => {
let item = data.find(i => i.key == key)
if (item) value.push(item.value || null)
let i = data.find(i => i.key == key)
if (data[key]) value.push(data[key])
if (i) value.push(i[i.key] || null)
})
let show = func(...value)
return show
......@@ -82,7 +83,7 @@ export default {
console.log(error)
}
},
async saveReport(res, isPush = false) {
async saveReport(res, check) {
try {
const phoneRegex = /^1[3456789]\d{9}$/
uni.showLoading({ title: '提交中...', mask: true })
......@@ -92,7 +93,27 @@ export default {
let requestJson = buildAppNormalizedListsFromJsonContent(jsonContent)
list.map(e => {
let childrenValue = []
if (e.children && e.children.length)
if (e.children && e.children.length) {
if (e.validateDuplicates && e.validateDuplicates.length) {
e.validateDuplicates.forEach(key => {
const seen = new Map()
const duplicateRows = []
let label = ''
e.children.forEach((row, rowIndex) => {
const field = row.find(j => j.key === key)
if (field && field.label) label = field.label
if (field && field.value) {
if (seen.has(field.value)) {
duplicateRows.push(rowIndex + 1)
} else {
seen.set(field.value, true)
}
}
})
if (duplicateRows.length) throw `第${duplicateRows.join(',')}行${label}重复`
})
}
e.children.map((c, cIndex) => {
let isArray = Array.isArray(c)
if (isArray) {
......@@ -128,6 +149,7 @@ export default {
}
}
})
}
e.childrenValue = childrenValue
if (e.show && e.required && e.type != 'subform') {
if (e.value == null || e.value == undefined || e.value === '') throw `${e.label}不能为空`
......@@ -141,10 +163,11 @@ export default {
})
const { shopMerchantId } = this.userInfo,
{ sceneType } = this,
carBrandList = await uni.$api.boutiqueApi.getDailyReportCarBrand({
merchantId: shopMerchantId,
sceneType
}) || []
carBrandList =
(await uni.$api.boutiqueApi.getDailyReportCarBrand({
merchantId: shopMerchantId,
sceneType
})) || []
requestJson.carBrandList = carBrandList.map(({ firstBrandId, firstBrandName, brandId, brandName }) => ({
firstBrandId,
firstBrandName,
......@@ -155,7 +178,7 @@ export default {
reportParams.requestJson = JSON.stringify(requestJson)
console.log('提交日报', reportParams)
uni.hideLoading()
if (isPush) return Promise.resolve(reportParams)
if (check) return this.$emit('checkReportDetail', reportParams)
const data = await uni.$api.dailyTemplateApi.saveDraft(reportParams)
uni.hideLoading()
if (data) {
......@@ -168,9 +191,8 @@ export default {
uni.showToast({ title: error, icon: 'none', mask: true })
}
},
async submitReport(res) {
let reportParams = await this.saveReport(res, true)
this.$emit('submitReport', reportParams)
async submitReport() {
this.$emit('submitReport')
}
}
}
......@@ -531,8 +531,7 @@ function extractSelectStorageValueFromRowField(field = {}) {
}
return obj
}
const v = field.value
const v = field[field.key]
if (v === undefined || v === null || v === '') {
return undefined
}
......@@ -650,7 +649,7 @@ function resolveStorageFieldValue(field = {}, fieldValue) {
return { value, storageType: 'JSON' }
}
if (field.type === 'multipleSelect') {
const value = buildMultipleSelectSubmitValue(field, fieldValue)
const value = buildSelectSubmitValue(field, fieldValue)
if (value === undefined || value == null || (Array.isArray(value) && !value.length)) {
return { value: undefined, storageType: 'JSON' }
}
......@@ -940,7 +939,6 @@ export function buildAppCarBrandDisplayString(carInfo = {}) {
/** 从 App 形态 FormField 解析引擎 valueMap 用的值 */
export function resolveAppRowFieldEngineValue(field = {}) {
if (!field?.key) return undefined
if (field.type === 'carBrandSelect') {
const meta = field[field.key]
if (meta && typeof meta === 'object') {
......@@ -967,7 +965,16 @@ export function resolveAppRowFieldEngineValue(field = {}) {
if (isRemoteMultipleSelectField(field)) {
return resolveMultipleSelectEngineValueFromAppField(field)
}
if(field.type == 'multipleSelect'){
const meta = field[field.key]
if (meta != null && meta.length) {
return {
id: meta.join('/'),
name: field.value
}
}
return field.value
}
return field.value
}
......
......@@ -568,6 +568,7 @@ export default {
}
let storageName = `source_${sceneType}_${shopMerchantId}_${carBrandId}_${carChildsBrandId}`
let data = uni.getStorageSync(storageName)
if(data) this.setViewInfo(data) // 先从缓存中获取数据
try {
let requestData = await uni.$api.systemApi.getSoureData(shopMerchantId, sceneType, params)
if (requestData) this.setViewInfo(requestData)
......
const CUSTOMER_TAGS = {
1: '已触客',
2: '已拉群',
3: '已交付引荐',
4: '首保维保客户 ',
5: '事故车客户'
}
module.exports = {
data: {
CUSTOMER_TAGS,
orderObj: [
{
label: '工单编号',
......@@ -29,6 +37,21 @@ module.exports = {
key: 'customerName'
},
{
label: '日报标签',
key: 'customerTags',
format: data => {
return data ? data
.split(',')
.map(item => CUSTOMER_TAGS[item])
.join('/') : ''
}
},
{
label: '实际交付日期',
key: 'actualDeliveryDate',
format: val => val ? dayjs(val).format('YYYY-MM-DD') : ''
},
{
label: '性别',
key: 'customerSex',
enum: {
......@@ -220,7 +243,7 @@ module.exports = {
goodsOrderApplyStatus: {
0: '审批中', //区域运营待审核
1: '审批通过', //线上运营待审核
2: '审批驳回',
2: '审批驳回'
},
orderType: {
1: '正常订单',
......@@ -228,7 +251,7 @@ module.exports = {
3: '买赠策略',
4: '冲量活动',
5: '组合付款',
6:'内部结算'
6: '内部结算'
}
}
}
......@@ -5,18 +5,16 @@
<view class="box">
<scroll-view class="scroll-view" scroll-y="true">
<view class="box-content">
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur" @handleCell="handleCell" :titleList="titleList">
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur"
@handleCell="handleCell" :titleList="titleList" @confirmCalendar="confirmCalendar">
<template slot="customer">
<view class="customer-title flex">
客户信息
<view
class="customer-file flex"
@click="
handleCell({
key: 'customer'
})
"
>
<view class="customer-file flex" @click="
handleCell({
key: 'customer'
})
">
<view class="sprite-icon icon-customer-list"></view>
客户档案
</view>
......@@ -24,7 +22,9 @@
</template>
<template slot="skuGoods">
<template v-if="orderObj.skuGoods.length">
<SkuGoods :list="orderObj.skuGoods" @changeTotalPrice="changeTotalPrice" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData" :orderTypeCode="orderObj.orderTypeCode"></SkuGoods>
<SkuGoods :list="orderObj.skuGoods" @changeTotalPrice="changeTotalPrice"
:positionTypeList="positionTypeList" :baseConfigData="baseConfigData"
:orderTypeCode="orderObj.orderTypeCode"></SkuGoods>
</template>
<template v-if="orderObj.total > 0">
<view class="total">
......@@ -46,7 +46,8 @@
</view>
</view>
<!-- 弹窗 -->
<order-popup ref="orderPopup" :data="orderObj" :dataKey="valueKey" @onConfirm="onConfirm" :externalData="externalData" :popupType="popupType" :popupTitle="popupTitle" />
<order-popup ref="orderPopup" :data="orderObj" :dataKey="valueKey" @onConfirm="onConfirm"
:externalData="externalData" :popupType="popupType" :popupTitle="popupTitle" />
<template v-if="showUpload">
<view class="upload-box">
<upload-proof-of-payment @back="clearPayMentDocList" @confirm="uploadConfirm" />
......@@ -120,6 +121,20 @@ export default {
},
deep: true,
immediate: true
},
"orderObj.baseSceneCode": {
handler(newVal) {
this.customerTagsAndActualDeliveryDateHidden()
},
immediate: true,
deep: true
},
"orderObj.salesType": {
handler(newVal) {
this.customerTagsAndActualDeliveryDateHidden()
},
immediate: true,
deep: true
}
},
data() {
......@@ -149,7 +164,9 @@ export default {
ownerGender: '男',
salesType: '0',
carInfo: {},
price: ''
price: '',
customerTags: [], // 日报标签
actualDeliveryDate: '', // 实际交付日期
}, // 弹窗传入的数据},
popupType: 0,
popupTypeEnum,
......@@ -184,11 +201,31 @@ export default {
this.initData()
},
methods: {
updateSceneGate () {
customerTagsAndActualDeliveryDateHidden() {
let {salesType} = this.orderObj
const selected = Boolean(this.orderObj && (this.orderObj.baseSceneCodeValue || this.orderObj.baseSceneCode))
let formList = this.formList
formList.map(item => {
item.map(child => {
if (child.value == 'customerTags') {
let hidden = !selected || salesType == 2
child.hidden = hidden
if (hidden) this.$set(this.orderObj, 'customerTags', [])
}
if (child.value == 'actualDeliveryDate') {
let hidden = ![0].includes(+salesType) || !selected
child.hidden = hidden
if (hidden) this.$set(this.orderObj, 'actualDeliveryDate', '')
}
})
})
this.formList = formList
},
updateSceneGate() {
const selected = Boolean(this.orderObj && (this.orderObj.baseSceneCodeValue || this.orderObj.baseSceneCode))
const list = this.formList || []
list.forEach(group => {
;(group || []).forEach(item => {
; (group || []).forEach(item => {
if (!item) return
if (item._originHidden === undefined) item._originHidden = Boolean(item.hidden)
if (!selected) {
......@@ -201,7 +238,7 @@ export default {
this.formList = list
return selected
},
async initRecentSceneEcho () {
async initRecentSceneEcho() {
try {
const userInfo = this.userInfo || (uni.$storage.get('userInfo') || {})
const phone = userInfo.phone
......@@ -231,7 +268,7 @@ export default {
// 同步表单展示(GlCell 部分字段依赖 current)
const sceneCell = this.formList?.[0]?.find(v => v && v.value === 'baseSceneCode')
if (sceneCell) sceneCell.current = item.name || item.staffName || ''
} catch (e) {}
} catch (e) { }
},
async getQuotationInfoById(id) {
try {
......@@ -584,7 +621,7 @@ export default {
0: pointsMultiRole == 'Y' ? '销售顾问/录单员' : '推荐人',
4: '车型',
13: payType == 2 ? '4S店收款时间' : '嘀加收款时间',
29:'确认业务场景名称'
29: '确认业务场景名称'
}[this.popupType]
// 确保 orderPopup 引用存在后再调用 open 方法
if (this.$refs.orderPopup && this.$refs.orderPopup.open) {
......@@ -595,8 +632,19 @@ export default {
},
// 单选框change事件
radioChange(e, val) {
this.$set(this.orderObj, val.value, e.detail.value)
if (val.value == 'payee') this.changePayee()
if (val.multiple) {
let key = val.value,
value = this.orderObj[key] || []
if (value.includes(e)) {
value = value.filter(item => item !== e)
} else {
value.push(e)
}
this.$set(this.orderObj, key, value)
} else {
this.$set(this.orderObj, val.value, e.detail.value)
if (val.value == 'payee') this.changePayee()
}
},
// 弹窗确认回调
onConfirm(val, flag) {
......@@ -1184,12 +1232,19 @@ export default {
return pre
}, [])
let keyList = ['mode', 'payee', 'payType', 'referrerId', 'referrer', 'deliveryId', 'deliveryName', 'total', 'notes', 'tradeNo', 'transactionNo', 'paymentDocList', 'id', 'orderId', 'pay2Time'],
customerKeyList = ['owner', 'phone', 'certificateNo', 'carVin', 'seat', 'price', 'ownerGender', 'city', 'ageRange', 'hobby', 'companion', 'carColor', 'salesType']
customerKeyList = ['owner', 'phone', 'certificateNo', 'carVin', 'seat', 'price', 'ownerGender', 'city', 'ageRange', 'hobby', 'companion', 'carColor', 'salesType', 'customerTags', 'actualDeliveryDate']
keyList.map(key => {
if (orderInfo[key] != null) params[key] = orderInfo[key]
})
customerKeyList.map(key => {
if (orderInfo[key] != null) params.owner[key] = orderInfo[key]
if (orderInfo[key] != null) {
if (key == 'customerTags') {
if (orderInfo[key].length > 0) orderInfo[key] = orderInfo[key].join(',')
else orderInfo[key] = ''
}
if (orderInfo[key] && key == 'actualDeliveryDate') orderInfo[key] += ' 00:00:00'
params.owner[key] = orderInfo[key]
}
})
if (orderInfo.ownerId) params.owner.id = orderInfo.ownerId
return params
......@@ -1394,7 +1449,9 @@ export default {
certificateNo: customerInfo.customerCertificateNo || '',
salesType,
carVin: customerInfo.carVin || '',
carColor: customerInfo.carColor || ''
carColor: customerInfo.carColor || '',
customerTags: customerInfo.customerTags || [],
actualDeliveryDate: customerInfo.actualDeliveryDate ? dayjs(customerInfo.actualDeliveryDate).format('YYYY-MM-DD') : ''
})
this.formList[1].map(e => {
if (e.value == 'salesType') e.current = salesType
......@@ -1465,7 +1522,12 @@ export default {
this.showUpload = false
this.orderObj.paymentDocList = []
this.orderObj.transactionNo = ''
}
},
// 选择日期事件
confirmCalendar(e, key) {
let value = e.fulldate
this.$set(this.orderObj, key, value)
},
}
}
</script>
......@@ -1474,14 +1536,17 @@ export default {
.order {
height: 100%;
position: relative;
&-box {
visibility: visible;
height: 100%;
}
.hide {
opacity: 0;
visibility: hidden;
}
.upload-box {
position: absolute;
left: 0;
......@@ -1528,9 +1593,11 @@ export default {
font-size: toRpx(24);
color: #999;
}
.btns {
padding: toRpx(24) toRpx(128);
gap: toRpx(32);
.save {
background: #3b73ff1a;
color: #4673ff;
......@@ -1538,6 +1605,7 @@ export default {
font-weight: 500;
}
}
.btn {
display: flex;
align-items: center;
......@@ -1548,11 +1616,13 @@ export default {
border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
}
.customer-title {
.customer-file {
margin-left: toRpx(20);
color: #347bff;
font-size: toRpx(24);
.sprite-icon {
margin-right: toRpx(4);
}
......
import dayjs from 'dayjs'
const FORM_LIST = [
[
{
......@@ -60,6 +61,31 @@ const FORM_LIST = [
required: true
},
{
hidden: false,
label: '日报标签',
value: 'customerTags',
type: 'radio',
multiple: true,
radioList: [
{
value: '1',
name: '已触客'
},
{
value: '3',
name: '已交付引荐'
},
]
},
{
hidden: false,
label: '实际交付日期',
value: 'actualDeliveryDate',
type:"single-calendar",
required: true,
endDate: dayjs().format('YYYY-MM-DD')
},
{
label: '性别',
value: 'ownerGender',
type: 'radio',
......
......@@ -203,7 +203,7 @@ export default {
},
async entranceClick (item) {
if (this.toolComponentName == item.name) return
const noInterceptPage = ['DailyReport']
const noInterceptPage = ['DailyReport','storeDailyReport']
// if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
if (!noInterceptPage.includes(item.name) && (await this.checkDailyReport())) return
// 提示去学习中心弹窗
......
......@@ -20,11 +20,10 @@ export default {
staffName: "",
newCarFare: '',
carModelId: '',
carBuyers: '',
carPurchaseMethod: '',
oneCarBrand: '',
oneCarBrandId: ''
},
insuranceEquityProducts: [], // 当前接待已选择的保险权益产品
historyStatus: Date.now(),
carBrands: [],
employeeList: [],
......@@ -53,6 +52,9 @@ export default {
state.customerInfo = data
state.customerKey = Date.now()
},
setInsuranceEquityProducts (state, value = []) {
state.insuranceEquityProducts = Array.isArray(value) ? value : []
},
setReceptionTrack (state, { key, value }) {
state.receptionTrack[key] = value
state.receptionKey = Date.now()
......@@ -86,13 +88,12 @@ export default {
staffName: "",
newCarFare: '',
carModelId: '',
carBuyers: '',
carPurchaseMethod: '',
oneCarBrand: '',
oneCarBrandId: ''
};
uni.$storage.set("customerInfo", JSON.stringify(info));
state.customerInfo = info
state.insuranceEquityProducts = []
state.customerKey = Date.now()
},
setCarBrandOpenStatus (state, value) {
......@@ -112,6 +113,9 @@ export default {
// uni.$logger.local.info(`当前接待客户信息: ${JSON.stringify(value)}`)
commit("setCustomerInfo", value);
},
setInsuranceEquityProducts ({ commit }, value) {
commit('setInsuranceEquityProducts', value)
},
clearCustomerInfo ({ commit }) {
commit("clearCustomerInfo");
},
......
......@@ -7,13 +7,13 @@
* @LastEditTime: 2026-01-22 16:21:17
* @FilePath: \gl_tape\utils\logger\RemoteLog.js
*/
import sentryInit from '@/utils/sentryConfig/sentryInit'
// import sentryInit from '@/utils/sentryConfig/sentryInit'
import { LogLevel , RemoteExtraDataKey} from './constants'
class RemoteLog {
sentry = null
constructor(user) {
this.sentry = sentryInit()
this.sentry.setUser(user)
// this.sentry = sentryInit()
// this.sentry.setUser(user)
}
debug(info) {
this.send(LogLevel.DEBUG, info)
......@@ -28,45 +28,45 @@ class RemoteLog {
this.send(LogLevel.ERROR, info)
}
send(level, { extra = {}, msg, tag = { key: '', value: '' } }) {
this.sentry.withScope(scope => {
// 1. 设置 Tag
if (tag && tag.key) {
scope.setTag(tag.key, tag.value)
}
// this.sentry.withScope(scope => {
// // 1. 设置 Tag
// if (tag && tag.key) {
// scope.setTag(tag.key, tag.value)
// }
// 2. 自动补充环境信息到 Extra
const systemInfo = uni.getSystemInfoSync()
const enhancedExtra = {
...extra,
device_brand: systemInfo.brand,
device_model: systemInfo.model,
os_name: systemInfo.osName, // uni-app x 支持,或用 platform
os_version: systemInfo.osVersion,
uni_platform: systemInfo.uniPlatform,
app_version: systemInfo.appVersion,
network_type: 'unknown' // 可选:尝试获取网络状态
}
// // 2. 自动补充环境信息到 Extra
// const systemInfo = uni.getSystemInfoSync()
// const enhancedExtra = {
// ...extra,
// device_brand: systemInfo.brand,
// device_model: systemInfo.model,
// os_name: systemInfo.osName, // uni-app x 支持,或用 platform
// os_version: systemInfo.osVersion,
// uni_platform: systemInfo.uniPlatform,
// app_version: systemInfo.appVersion,
// network_type: 'unknown' // 可选:尝试获取网络状态
// }
// 尝试获取网络状态(如果允许异步)
// uni.getNetworkType({ success: (res) => enhancedExtra.network_type = res.networkType })
// // 尝试获取网络状态(如果允许异步)
// // uni.getNetworkType({ success: (res) => enhancedExtra.network_type = res.networkType })
scope.setExtra(RemoteExtraDataKey, enhancedExtra)
// scope.setExtra(RemoteExtraDataKey, enhancedExtra)
// 3. 设置级别
scope.setLevel(level)
// // 3. 设置级别
// scope.setLevel(level)
// 4. 上报 (区分 Error 对象和普通消息)
// 如果 msg 本身就是 Error 对象,直接上报以保留堆栈信息
// 如果是字符串,则包装成 Error
if (msg instanceof Error) {
this.sentry.captureException(msg)
} else {
// 将字符串消息作为 Error 的 message,这样在 Sentry 面板中更直观
const error = new Error(String(msg))
// 可以手动尝试附加调用栈(虽然 new Error 已经有了)
this.sentry.captureException(error)
}
})
// // 4. 上报 (区分 Error 对象和普通消息)
// // 如果 msg 本身就是 Error 对象,直接上报以保留堆栈信息
// // 如果是字符串,则包装成 Error
// if (msg instanceof Error) {
// this.sentry.captureException(msg)
// } else {
// // 将字符串消息作为 Error 的 message,这样在 Sentry 面板中更直观
// const error = new Error(String(msg))
// // 可以手动尝试附加调用栈(虽然 new Error 已经有了)
// this.sentry.captureException(error)
// }
// })
}
}
export default RemoteLog
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!