Commit c2156f73 by 李伟康

refactor(ReceptionCenter): 优化接待中心组件结构和功能

- 在 CustomerFile 组件中添加 show 属性和相应的 watch 监听
- 调整 RecordList 组件的事件跟踪逻辑
- 重构 ReceptionCenter 的子组件结构
- 优化 receptionDetail 页面的聊天重置逻辑
1 parent 3aa24a6f
...@@ -130,6 +130,9 @@ export default { ...@@ -130,6 +130,9 @@ export default {
PageTabs PageTabs
}, },
name: '', name: '',
props: {
show: Boolean
},
data () { data () {
return { return {
dateList: [ dateList: [
...@@ -151,8 +154,7 @@ export default { ...@@ -151,8 +154,7 @@ export default {
flag: false, flag: false,
nothing: false, nothing: false,
pageSize: 10, pageSize: 10,
loaded: false
} }
}, },
computed: { computed: {
...@@ -164,8 +166,19 @@ export default { ...@@ -164,8 +166,19 @@ export default {
} }
}, },
}, },
watch: {
show: {
immediate: true,
handler (newval) {
if (newval && !this.loaded) {
this.init()
this.loaded = true
}
}
}
},
mounted () { mounted () {
this.init();
}, },
methods: { methods: {
refresh () { refresh () {
......
...@@ -219,12 +219,12 @@ export default { ...@@ -219,12 +219,12 @@ export default {
}, },
jumpDetail (item) { jumpDetail (item) {
if (this.tabIndex == 0) { // 已上传 && 新质检 if (this.tabIndex == 0) { // 已上传 && 新质检
uni.$track.add({ eventCode: item.orderFinishFlag ? 'app_reception_deal' : 'app_reception_defeat' })
const { sceneType } = uni.$storage.get("userInfo"); const { sceneType } = uni.$storage.get("userInfo");
if (sceneType == 1 || item.checkHistoryFlag != 0) return uni.showToast({ if (sceneType == 1 || item.checkHistoryFlag != 0) return uni.showToast({
title: '该接待尚不支持复盘', title: '该接待尚不支持复盘',
icon: "none" icon: "none"
}) })
uni.$track.add({ eventCode: item.orderFinishFlag ? 'app_reception_deal' : 'app_reception_defeat' })
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/receptionDetail/index`, url: `/pages/common/receptionDetail/index`,
success (res) { success (res) {
......
...@@ -68,17 +68,17 @@ ...@@ -68,17 +68,17 @@
:tabIndex.sync="tabIndex" :tabIndex.sync="tabIndex"
></type-tab-component> ></type-tab-component>
<view :class="['right-content',`${tabIndex != 0?'hide-record':'show-record'}`]"> <view :class="['right-content',`${tabIndex != 0?'hide-record':'show-record'}`]">
<customer-file <record-list
@showSuccess="$refs.successRef.open()" @openRecordPage="openRecordPage"
ref="customerFile" ref="recordListRef"
@editCustomer="editCustomer"
:show="tabIndex == 0" :show="tabIndex == 0"
/> />
</view> </view>
<view :class="['right-content',`${tabIndex != 1?'hide-record':'show-record'}`]"> <view :class="['right-content',`${tabIndex != 1?'hide-record':'show-record'}`]">
<record-list <customer-file
@openRecordPage="openRecordPage" @showSuccess="$refs.successRef.open()"
ref="recordListRef" ref="customerFile"
@editCustomer="editCustomer"
:show="tabIndex == 1" :show="tabIndex == 1"
/> />
</view> </view>
...@@ -148,8 +148,8 @@ export default { ...@@ -148,8 +148,8 @@ export default {
timeProgress: '', timeProgress: '',
tabIndex: 0, tabIndex: 0,
typeList: Object.freeze([ typeList: Object.freeze([
{ tabName: '客户预录' },
{ tabName: '接待复盘' }, { tabName: '接待复盘' },
{ tabName: '客户预录' },
]), ]),
showInfo: false, showInfo: false,
customerId: '', customerId: '',
......
...@@ -429,7 +429,7 @@ export default { ...@@ -429,7 +429,7 @@ export default {
setTimeout(retrySetWebviewStyle, 100); setTimeout(retrySetWebviewStyle, 100);
}, },
tabClick (item) { tabClick (item) {
if (item.sumScore > item.score && this.wv) { if (this.wv) {
if (this.loading) return uni.showToast({ if (this.loading) return uni.showToast({
title: '请勿频繁操作', title: '请勿频繁操作',
icon: 'none', icon: 'none',
...@@ -437,7 +437,8 @@ export default { ...@@ -437,7 +437,8 @@ export default {
duration: 500 duration: 500
}) })
this.loading = true this.loading = true
this.wv.evalJS(`sendMessage({type:'reset_chat',payload:{message:'${item.tagGroupName}'}})`) let message = item.sumScore > item.score ? item.tagGroupName : ''
this.wv.evalJS(`sendMessage({type:'reset_chat',payload:{message:'${message}'}})`)
setTimeout(() => { setTimeout(() => {
this.loading = false this.loading = false
}, 500) }, 500)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!