diff --git a/src/api/crm/customer/getCustomer.js b/src/api/crm/customer/getCustomer.js index 0c165d2..76c59c5 100644 --- a/src/api/crm/customer/getCustomer.js +++ b/src/api/crm/customer/getCustomer.js @@ -42,4 +42,13 @@ export function SearchForAllPerson(params){ url: '/app/appCrmCusUserNewController/SearchForAllPerson', data: params },{isTransformResponse: false}) +} + +// 客户人员新增审核列表 +export function getCusUserApprovalList(params) { + return request.get({ + url: '/app/appCrmCusUserNewController/getCusUserApprovalList', + data: params + }, {isTransformResponse: false} + ) } \ No newline at end of file diff --git a/src/api/crm/customer/updateCustomer.js b/src/api/crm/customer/updateCustomer.js index 76d8438..886e458 100644 --- a/src/api/crm/customer/updateCustomer.js +++ b/src/api/crm/customer/updateCustomer.js @@ -13,6 +13,20 @@ export function upadateappCrmCusUserNew (data){ data },{isTransformResponse: false}) } +// 客户人员审核通过 +export function clientPersonnelsApproval(data) { + return request.get({ + url: '/app/appCrmCusUserNewController/clientPersonnelsApproval', + data + }, {isTransformResponse: false}); +} +//客户人员驳回 +export function customerPersonnelsRejectio(data) { + return request.get({ + url: '/app/appCrmCusUserNewController/customerPersonnelsRejectio', + data + }, {isTransformResponse: false}); +} //主归属人变更提交 export function submissionOfChangeOfMainOwner (data){ return request.get({ diff --git a/src/pages.json b/src/pages.json index 3e18b86..07cd9ee 100644 --- a/src/pages.json +++ b/src/pages.json @@ -274,6 +274,13 @@ "navigationBarTitleText": "" } }, + { + "path": "pages/business/CRM/customer/customerAudit", + //客户人员审核 + "style": { + "navigationBarTitleText": "" + } + }, { "path": "pages/business/CRM/customer/customerUserBelong", //客户人员归属 @@ -281,6 +288,13 @@ "navigationBarTitleText": "" } }, + { + "path": "pages/business/CRM/customer/components/confirmForm", + //客户人员主归属人变更审核提交 + "style": { + "navigationBarTitleText": "" + } + }, { "path": "pages/business/CRM/customer/changeCustomerOwner", //客户人员主归属人变更 @@ -297,7 +311,7 @@ }, { "path": "pages/business/CRM/mainOwner/audit/confirmForm", - //客户人员主归属人变更审核意见 + //客户人员主归属人变更审核提交 "style": { "navigationBarTitleText": "" } diff --git a/src/pages/business/CRM/customer/changeCustomerOwner.vue b/src/pages/business/CRM/customer/changeCustomerOwner.vue index 19f8654..1f5d820 100644 --- a/src/pages/business/CRM/customer/changeCustomerOwner.vue +++ b/src/pages/business/CRM/customer/changeCustomerOwner.vue @@ -7,7 +7,7 @@ - + @@ -19,9 +19,8 @@ - @@ -102,7 +101,6 @@ let timerId = null; let handleSearch = () => { // 防抖搜索 console.log(searchValue.value) if (timerId) clearTimeout(timerId); - cssFlag.value = true; timerId = setTimeout(async () => { // let res = await getList(1, upOption.value.page.size) @@ -145,13 +143,17 @@ const mescrollInit = (mescroll) => { // 下拉刷新 const downCallback = async (mescroll) => { try { + uni.showLoading(); + cssFlag.value = true; setTimeout(async () => { // 重置页码为第一页 const res = await getList(1, mescroll.size || upOption.page.size); - cssFlag.value = false; list.value = res.list; + cssFlag.value = false; // 正确传递 total 参数 mescroll.endSuccess(res.list.length, res.total > (mescroll.size || upOption.page.size)); + uni.hideLoading(); + }, 500); } catch (error) { console.log(error) @@ -161,6 +163,7 @@ const downCallback = async (mescroll) => { // 上拉加载更多 const upCallback = async (mescroll) => { try { + uni.showLoading(); setTimeout(async () => { // 使用 mescroll 提供的页码和大小参数 const res = await getList(mescroll.num, mescroll.size); @@ -171,6 +174,7 @@ const upCallback = async (mescroll) => { } // 正确判断是否还有更多数据 mescroll.endSuccess(res.list.length, res.total > mescroll.num * mescroll.size); + uni.hideLoading(); }, 500); } catch (error) { console.log(error) @@ -243,18 +247,20 @@ let handleChange = (item)=>{ userName: item.userName, reasonForChange: res.content }).then(res=>{ - uni.showToast({ - title: '变更成功' - }) - }).catch(err=>{ - uni.showToast({ - title: '变更失败', - icon: 'error' - }) + if(res.code===200){ + uni.showToast({ + title: '操作成功' + }) + }else{ + uni.showToast({ + title: '操作失败', + icon: 'error' + }) + } }) }else{ uni.showToast({ - title: '变更失败,请补充变更原因', + title: '操作失败!变更原因不能为空', icon: 'none' }) } @@ -304,9 +310,7 @@ let handleCopyInfo=(item)=>{ /* #endif */ } -.search { - display: flex; -} + .search .btn-search { border: none; @@ -323,15 +327,6 @@ let handleCopyInfo=(item)=>{ display: none; } -.search .custom-search { - width: 80%; - -} - -.search .custom-search.uni-searchbar { - padding-right: 0 !important; -} - .scroll-h { /* #ifdef APP-PLUS */ height: calc(100vh - 120px); diff --git a/src/pages/business/CRM/customer/components/confirmForm.vue b/src/pages/business/CRM/customer/components/confirmForm.vue new file mode 100644 index 0000000..49c064d --- /dev/null +++ b/src/pages/business/CRM/customer/components/confirmForm.vue @@ -0,0 +1,721 @@ + + + + + + \ No newline at end of file diff --git a/src/pages/business/CRM/customer/components/customerUserEdit.vue b/src/pages/business/CRM/customer/components/customerUserEdit.vue index ca12fdf..cb3f608 100644 --- a/src/pages/business/CRM/customer/components/customerUserEdit.vue +++ b/src/pages/business/CRM/customer/components/customerUserEdit.vue @@ -455,6 +455,7 @@ let handleFunctionChange = (e) => { console.log(e.detail.value, '职能索引'); const {name} = functionalRequirementList[e.detail.value]; formData.value.functionalRequirements = name; + formData.value.function = name; getRecommendLevel(); } @@ -585,17 +586,25 @@ let submitForm = async () => { console.log(formData.value, "提交表单数据") // 请求保存 uni.showLoading() - upadateappCrmCusUserNew(formData.value).then(res=>{ + upadateappCrmCusUserNew(formData.value).then(ret=>{ uni.hideLoading(); - uni.showToast({ - title: "更新成功" - }) - setTimeout(()=>uni.navigateBack(), 1500); - }).catch(err=>{ - uni.showToast({ - icon: 'none', - title: "更新失败" - }) + if(ret.code === 200){ + uni.showToast({ + title: "更新成功" + }) + setTimeout(()=>{ + uni.navigateBack(); + const eventChannel = instance.getOpenerEventChannel(); + eventChannel.emit("refreshCusUserList"); + },1000); + + }else{ + uni.showToast({ + title: "操作失败", + icon: "error" + }) + } + }) // 重置表单 // 清除校验 diff --git a/src/pages/business/CRM/customer/customerAdd.vue b/src/pages/business/CRM/customer/customerAdd.vue index 1dc58bf..f6f3a7a 100644 --- a/src/pages/business/CRM/customer/customerAdd.vue +++ b/src/pages/business/CRM/customer/customerAdd.vue @@ -566,9 +566,15 @@ let submitForm = async () => { uni.showLoading() saveappCrmCusUserNew(formData.value).then(res=>{ uni.hideLoading(); - uni.showToast({ - title: "保存成功" - }) + if(res.code === 200){ + uni.showToast({ + title: "保存成功" + }) + }else{ + uni.showToast({ + title: "操作失败" + }) + } setTimeout(()=>uni.navigateBack(), 1500); }).catch(err=>{ uni.showToast({ diff --git a/src/pages/business/CRM/customer/customerAudit.vue b/src/pages/business/CRM/customer/customerAudit.vue new file mode 100644 index 0000000..2fa806a --- /dev/null +++ b/src/pages/business/CRM/customer/customerAudit.vue @@ -0,0 +1,242 @@ + + + + + + \ No newline at end of file diff --git a/src/pages/business/CRM/customer/customerUserBelong.vue b/src/pages/business/CRM/customer/customerUserBelong.vue index 7cb13e1..179491b 100644 --- a/src/pages/business/CRM/customer/customerUserBelong.vue +++ b/src/pages/business/CRM/customer/customerUserBelong.vue @@ -19,9 +19,9 @@ - @@ -29,11 +29,15 @@ :up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff" class="scroll-h" :class="{'loading-scroll':cssFlag}" > - + - + {{ item.cusName }} - {{ item.nodeCode }} + + {{ item.nodeCode }} + 客户人员名称 @@ -107,7 +111,7 @@ let timerId = null; let handleSearch = () => { console.log(searchValue.value) if (timerId) clearTimeout(timerId); - cssFlag.value = true; + timerId = setTimeout(async () => { // let res = await getList(1, upOption.value.page.size) await downCallback(mescrollRef.value.mescroll); @@ -119,7 +123,7 @@ let handleSearch = () => { watch(searchValue, (newValue, oldValue) => { handleSearch() }) -let clearSearchValue = ()=>{ +let clearSearchValue = () => { searchValue.value = ''; } // 查询列表 @@ -149,6 +153,8 @@ const mescrollInit = (mescroll) => { // 下拉刷新 const downCallback = async (mescroll) => { try { + cssFlag.value = true; + uni.showLoading(); setTimeout(async () => { // 重置页码为第一页 const res = await getList(1, mescroll.size || upOption.page.size); @@ -156,6 +162,7 @@ const downCallback = async (mescroll) => { list.value = res.list; // 正确传递 total 参数 mescroll.endSuccess(res.list.length, res.total > (mescroll.size || upOption.page.size)); + uni.hideLoading(); }, 500); } catch (error) { console.log(error) @@ -201,31 +208,40 @@ const getList = (pageIndex, pageSize) => { // 跳转到详情 let handleDetail = (item) => { - uni.navigateTo({ - url: "/pages/business/CRM/customer/components/customerUserEdit", - events: { - - }, - success(res){ - res.eventChannel.emit('editCusData', {param: item, isAdd: false}) - } - }) + if (item.nodeCode !== '完成') { + uni.navigateTo({ + url: "/pages/business/CRM/customer/components/customerUserEdit", + events: { + refreshCusUserList() { + handleSearch(); + } + }, + success(res) { + res.eventChannel.emit('editCusData', {param: item, isAdd: false}) + } + }) + }else{ + uni.showToast({ + title: '已完成审核,不可修改', + icon: 'none' + }) + } } // 长按定时器ID let touchTimerId = null; // 开始触摸 -let handleTouchStart = (item)=>{ - touchTimerId = setTimeout(()=>{ +let handleTouchStart = (item) => { + touchTimerId = setTimeout(() => { // console.log(item, "长按客户人员项") uni.showModal({ title: "提示", content: "是否确认删除本条消息?", - success(res){ - if(res.confirm){ + success(res) { + if (res.confirm) { handleDelete(item); - }else if(res.cancel){ + } else if (res.cancel) { } }, @@ -236,26 +252,26 @@ let handleTouchStart = (item)=>{ } // 结束触摸 -let handleTouchEnd = ()=>{ - if(touchTimerId !== null){ +let handleTouchEnd = () => { + if (touchTimerId !== null) { clearTimeout(touchTimerId); } } // 删除消息 -let handleDelete = async (item)=>{ +let handleDelete = async (item) => { // console.log(item) const visitId = item.visitId; // await removeVisit({visitId}) // uni.hideLoading(); uni.showToast({ - title: visitId?visitId:"没有visitId字段,无法删除", + title: visitId ? visitId : "没有visitId字段,无法删除", icon: 'none' }); } - \ No newline at end of file