diff --git a/common/util.js b/common/util.js index e24e1aa..c2eee71 100644 --- a/common/util.js +++ b/common/util.js @@ -218,6 +218,30 @@ function loginOut() { }) } +/** + * 获取字典值,带1小时缓存 + * @param {String} dictKey 字典key + * @returns {Promise} + */ +async function getDict(dictKey) { + const cacheKey = `dict_${dictKey}`; + const cache = uni.getStorageSync(cacheKey); + const now = Date.now(); + if (cache && cache.data && cache.expire > now) { + return cache.data; + } + // 缓存无效,请求接口 + const res = await marketApi.common_Dictionary({ dictKey }); + if (res && res.code === 1) { + uni.setStorageSync(cacheKey, { + data: res.data, + expire: now + 3600 * 1000 + }); + return res.data; + } else { + return []; + } +} module.exports = { loginOut, @@ -228,5 +252,6 @@ module.exports = { dateUtils, hexToRgba, img, - formatToDateTime + formatToDateTime, + getDict } diff --git a/pages.json b/pages.json index 5290500..5ef9784 100644 --- a/pages.json +++ b/pages.json @@ -511,10 +511,7 @@ { "path": "pages/market/index/index", "style": { - "navigationBarTitleText": "首页", - "navigationStyle": "custom", - "navigationBarBackgroundColor": "#fff", - "navigationBarTextStyle": "black" + "navigationBarTitleText": "首页" } }, { @@ -597,6 +594,30 @@ "navigationBarBackgroundColor": "#232323", "navigationBarTextStyle": "white" } + }, + { + "path": "pages/market/reimbursement/list", + "style": { + "navigationBarTitleText": "报销列表", + "navigationBarBackgroundColor": "#292929", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/market/reimbursement/add", + "style": { + "navigationBarTitleText": "新增报销", + "navigationBarBackgroundColor": "#292929", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/market/reimbursement/detail", + "style": { + "navigationBarTitleText": "报销详情", + "navigationBarBackgroundColor": "#292929", + "navigationBarTextStyle": "white" + } } @@ -604,7 +625,7 @@ "globalStyle": { "navigationBarTextStyle": "white", "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#f7f7f7", + "navigationBarBackgroundColor": "#181A20", "backgroundColor": "#FDFDFD", "enablePullDownRefresh": true }, diff --git a/pages/market/clue/add_clues.vue b/pages/market/clue/add_clues.vue index 0735c70..5530eea 100644 --- a/pages/market/clue/add_clues.vue +++ b/pages/market/clue/add_clues.vue @@ -526,6 +526,7 @@ import apiRoute from '@/api/apiRoute.js'; import commonApi from '@/api/common.js'; import marketApi from '@/api/market.js'; import memberApi from '@/api/member.js'; +import util from '@/common/util.js'; const rules = [ @@ -886,63 +887,27 @@ export default { async getDict(inputName){ let key = '' switch (inputName){ - //来源渠道 - case 'source_channel': - key = 'SourceChannel' - break; - //来源 - case 'source': - key = 'source' - break; - //购买力 - case 'purchasing_power': - key = 'customer_purchasing_power' - break; - //认知理念 - case 'cognitive_idea': - key = 'cognitive_concept' - break; - //决策人 - case 'decision_maker': - key = 'decision_maker' - break; - //客户初步意向度 - case 'initial_intent': - key = 'preliminarycustomerintention' - break; - //客户状态 - case 'status': - key = 'kh_status' - break; - //距离 - case 'distance': - key = 'distance' - break; - + case 'source_channel': key = 'SourceChannel'; break; + case 'source': key = 'source'; break; + case 'purchasing_power': key = 'customer_purchasing_power'; break; + case 'cognitive_idea': key = 'cognitive_concept'; break; + case 'decision_maker': key = 'decision_maker'; break; + case 'initial_intent': key = 'preliminarycustomerintention'; break; + case 'status': key = 'kh_status'; break; + case 'distance': key = 'distance'; break; } - if(!key){ - return - } - - - let res = await apiRoute.common_Dictionary({key:key}) - if(res.code != 1){ - uni.showToast({ - title: res.msg, - icon: 'none' - }) + if(!key){ return } + // 使用 util.getDict 获取并缓存字典 + let dictionary = await util.getDict(key) + if(!dictionary || !Array.isArray(dictionary) || dictionary.length === 0){ + uni.showToast({ title: '暂无选项', icon: 'none' }) return } - - let dictionary = res.data.dictionary let arr = [] - dictionary.forEach((v,k)=>{ - arr.push({ - text: v.name, - value: v.value, - }) + // 兼容后端返回格式 + (dictionary.dictionary || dictionary).forEach((v)=>{ + arr.push({ text: v.name, value: v.value }) }) - this.picker_config[inputName].options = arr }, diff --git a/pages/market/clue/clue_info.vue b/pages/market/clue/clue_info.vue index 55594a4..830f99c 100644 --- a/pages/market/clue/clue_info.vue +++ b/pages/market/clue/clue_info.vue @@ -37,7 +37,7 @@ - + @@ -433,41 +433,28 @@ //拨打电话 async callTel(tel) { - - if (!tel) { - uni.showToast({ - title: '电话号码为空', - icon: 'none' - }); - return; - } - let param = { - sales_id:this.resource_sharing_id//线索id - } - let res = await marketApi.setCallUp(param)//添加通过记录 - if(res.code != 1){ - uni.showToast({ - title: res.msg, - icon: 'none' - }) - return - } - - uni.makePhoneCall({ - phoneNumber: tel, - success: function () { - // console.log('拨打电话成功'); - }, - fail: function (err) { - console.log('拨打电话失败', err); - uni.showToast({ - title: '拨打电话失败', - icon: 'none' - }); - return; - } - }); + staff_id: this.userInfo.id, //员工id + resource_id: this.clientInfo.resource_id, //资源ID + resource_type: '', //资源类型(如设备、文件、系统等) + communication_type: 'phone', //沟通类型: phone-电话, email-邮件, meeting-会议, other-其他 + communication_result: 'success', //沟通结果: success-成功, failure-失败, pending-待定 + remarks: null, //备注 + tag: null, //标签 + } + + let res = await apiRoute.xs_communicationRecordsAdd(param) //添加通过记录 + if (res.code != 1) { + uni.showToast({ + title: res.msg, + icon: 'none' + }) + return + } + + uni.makePhoneCall({ + phoneNumber: tel + }) }, // 拨打电话 diff --git a/pages/market/clue/edit_clues.vue b/pages/market/clue/edit_clues.vue index e4c0a9e..447c635 100644 --- a/pages/market/clue/edit_clues.vue +++ b/pages/market/clue/edit_clues.vue @@ -5,81 +5,36 @@ type="text" activeColor="#29d3b4" color="#fff" @click="segmented"> - - - - - - - - - - + + - 基础信息 - - - - - - - - + + - - - - - - - - {{ (formData.source) ? picker_config.source.text : '点击选择' }} + + {{ formData.campus ? picker_config.campus.text : '点击选择' }} - - - + + - - {{ (formData.source_channel) ? picker_config.source_channel.text : '点击选择' }} + + {{ formData.source ? picker_config.source.text : '点击选择' }} - - - - - - - - - - + + - + - - + + @@ -99,256 +54,188 @@ - - - + + - + - - + + - - {{ (formData.decision_maker) ? picker_config.decision_maker.text : '点击选择' }} - + - - - - 下一步 - - - + + - 六要素信息 - - + + - - {{ (formData.initial_intent) ? picker_config.initial_intent.text : '点击选择' }} + + {{ formData.demand ? picker_config.demand.text : '点击选择' }} - - + + - - {{ (formData.status) ? picker_config.status.text : '点击选择' }} + + {{ formData.cognitive_idea ? picker_config.cognitive_idea.text : '点击选择' }} - - + + - - {{ (formData.purchasing_power) ? picker_config.purchasing_power.text : '点击选择' }} + + {{ formData.optional_class_time ? formData.optional_class_time : '点击选择' }} - - + + - - {{ (formData.cognitive_idea) ? picker_config.cognitive_idea.text : '点击选择' }} + + {{ formData.distance ? picker_config.distance.text : '点击选择' }} - - + + - - {{ (formData.optional_class_time) ? formData.optional_class_time : '点击选择' }} + + {{ formData.decision_maker ? picker_config.decision_maker.text : '点击选择' }} - - + + - - {{ (formData.promised_visit_time) ? formData.promised_visit_time : '点击选择' }} + + {{ formData.customer_type ? picker_config.customer_type.text : '点击选择' }} - - + + - - {{ (formData.distance) ? picker_config.distance.text : '点击选择' }} - + 预约体验课 - - + + - + - - + + - + - - + + - + - - - - - - - - - - - - 有效 - - - - - - 无效 - - - - - - - - 保存 - - - - - - - - - - - - - - - - 查重结果 - - - - - - - - - - 暂无重复客户 - - - - - - - - - - {{v.student_name}} - {{ v.is_status == 1 ? '试听' : '成交' }} + + + + + 跟进与面咨 + + + + + + {{ formData.status ? picker_config.status.text : '点击选择' }} - - - 首选联系人:{{v.contact_name}} - - + + + + + + + {{ formData.first_visit_time ? formData.first_visit_time : '点击选择' }} - - - {{ $util.formatToDateTime((v.follow && v.follow.follow_up_time || ''), 'm-d H:i') }} - 跟进 - - - - - - - - 意向:{{ v.follow && v.follow.initial_customer_intent || '' }} - + + + + + + + + + + + + + {{ formData.second_visit_time ? formData.second_visit_time : '点击选择' }} - - - + + + + + + + + + + + + + + + + + + + + + + 有效 + + + + + + 无效 + + + + - + - - - + - + + + + + + + + 保存 + @@ -553,11 +440,14 @@ optionTableId: 0, optionTable: [{ id: 0, - name: '编辑客户' + name: '基础信息' }, { id: 1, - name: '编辑六要素' + name: '电话六要素' + },{ + id: 2, + name: '面咨记录' } ], } @@ -1379,4 +1269,15 @@ } } + + .save-btn-box { + position: fixed; + left: 0; + right: 0; + bottom: 0; + z-index: 100; + background: #292929; + padding: 20rpx 40rpx 40rpx 40rpx; + box-shadow: 0 -2rpx 8rpx rgba(0,0,0,0.12); + } \ No newline at end of file diff --git a/pages/market/clue/index.vue b/pages/market/clue/index.vue index 23a92b4..7b5c2ab 100644 --- a/pages/market/clue/index.vue +++ b/pages/market/clue/index.vue @@ -25,8 +25,7 @@ {{ v.customerResource.phone_number }} - 首联系人:{{ v.customerResource.name }} {{ v.customerResource.decision_maker }} + 所属校区:{{ v.customerResource.name }} @@ -51,7 +50,7 @@ class="drop-image-x"> - 意向:{{ v.customerResource && v.customerResource.initial_intent_name || '' }} + 是否有效:{{ v.customerResource && v.customerResource.initial_intent_name || '' }} @@ -82,7 +81,7 @@ - + @@ -112,16 +111,13 @@ class="drop-image-x"> - 意向:{{ v.customerResource && v.customerResource.initial_intent_name || '' }} + 是否有效:{{ v.customerResource && v.customerResource.initial_intent_name || '' }} - - - - - + + 分配 @@ -579,13 +575,9 @@ return } - uni.makePhoneCall({ phoneNumber: tel }) - - - }, //客户详情 @@ -834,10 +826,10 @@ display: flex; justify-content: center; align-items: center; - border-radius: 50%; + border-radius: 10rpx; color: #fff; - width: 50rpx; - height: 50rpx; + width: 100rpx; + padding: 10rpx 0; background-color: #F59A23; } diff --git a/pages/market/index/index.vue b/pages/market/index/index.vue index bd6c8a4..85108fd 100644 --- a/pages/market/index/index.vue +++ b/pages/market/index/index.vue @@ -19,7 +19,7 @@ - 续费体测记录 + 续费提成 时间 @@ -187,29 +187,29 @@ \ No newline at end of file diff --git a/pages/market/my/index.vue b/pages/market/my/index.vue index 542ebfe..b668f50 100644 --- a/pages/market/my/index.vue +++ b/pages/market/my/index.vue @@ -32,47 +32,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 已签客户 - {{signedClientListCount}} - - - - 企业信息 + + 报销记录 @@ -88,10 +55,6 @@ - - - - 设置 @@ -255,6 +218,13 @@ export default { url: '/pages/common/my_message' }) }, + + //跳转页面-报销记录 + openViewReimbursementList(){ + this.$navigateTo({ + url: '/pages/market/reimbursement/list' + }) + }, } } diff --git a/pages/market/reimbursement/add.vue b/pages/market/reimbursement/add.vue new file mode 100644 index 0000000..d300ea8 --- /dev/null +++ b/pages/market/reimbursement/add.vue @@ -0,0 +1,222 @@ +