Commit 4508c11c by 前端

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

上线合并

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