帮扶筛选、帮扶跟进接口对接

This commit is contained in:
2025-11-08 16:21:07 +08:00
parent 270fd89371
commit 1bab91761f
3 changed files with 302 additions and 206 deletions

View File

@@ -7,7 +7,7 @@
人员姓名
</view>
<view class="info-value">
王小美
{{personInfo.name}}
</view>
</view>
<view class="info-item">
@@ -16,7 +16,7 @@
帮扶类型
</view>
<view class="info-value">
招聘岗位推荐
{{personInfo.taskType}}
</view>
</view>
</view>
@@ -32,22 +32,22 @@
<uni-forms ref="formRef" v-model="formData" :rules="rules" validate-trigger="submit" >
<!-- 跟进日期 -->
<uni-forms-item label="跟进日期:" name="followDate" required >
<uni-datetime-picker class="picker-value" type="date" placeholder="请选择跟进日期" v-model="formData.followDate" @change="onDateChange" />
<uni-datetime-picker class="picker-value" type="date" placeholder="请选择跟进日期" v-model="formData.followDate" @change="onFollowDateChange" />
</uni-forms-item>
<!-- 跟进方式 -->
<uni-forms-item label="跟进方式:" name="followMethod" required >
<uni-data-select v-model="formData.followMethod" placeholder="请选择跟进方式" :localdata="followMethods" @change="onMethodChange"></uni-data-select>
<uni-forms-item label="跟进方式:" name="followWay" required >
<uni-data-select v-model="formData.followWay" placeholder="请选择跟进方式" :localdata="followWays" @change="onMethodChange"></uni-data-select>
</uni-forms-item>
<!-- 跟进内容 -->
<uni-forms-item label="跟进内容:" name="followContent" required>
<uni-easyinput type="textarea" v-model="formData.followContent" placeholder="请输入跟进内容"></uni-easyinput>
<uni-forms-item label="跟进内容:" name="content" required>
<uni-easyinput type="textarea" v-model="formData.content" placeholder="请输入跟进内容"></uni-easyinput>
</uni-forms-item>
<!-- 跟进结果 -->
<uni-forms-item label="跟进结果:" name="followResult" required>
<uni-easyinput type="textarea" v-model="formData.followResult" placeholder="请输入跟进结果"></uni-easyinput>
<uni-forms-item label="跟进结果:" name="result" required>
<uni-easyinput type="textarea" v-model="formData.result" placeholder="请输入跟进结果"></uni-easyinput>
</uni-forms-item>
<!-- 下一步计划 -->
@@ -75,12 +75,13 @@
<view class="title-line"></view>
</view>
<view class="title-total">
<text class="total-num">7</text>条记录
<text class="total-num">{{followListNum}}</text>条记录
</view>
</view>
<view class="list-box" >
<uni-steps :options="list2" active-color="#007AFF" :active="active" direction="column" />
<view class="list-box" v-if="followListNum>0">
<uni-steps :options="followList" active-color="#007AFF" :active="active" direction="column" />
</view>
<empty v-else pdTop="200"></empty>
</view>
</AppLayout>
</template>
@@ -93,39 +94,22 @@ import config from "@/config.js"
const title = ref('');
const formData = reactive({
goalPersonId:'',
followDate: '',
followMethod: '',
followContent: '',
followResult: '',
followWay: '',
content: '',
result: '',
nextPlan: '',
nextContactDate: ''
})
const followMethods = [{
"value": 0,
"text": "电话"
}, {
"value": 1,
"text": "面谈"
}, {
"value": 2,
"text": "微信"
}, {
"value": 3,
"text": "邮件"
}]
const list2=[{
title: '买家下单',
desc: '跟进方式:电话\n跟进人新生社区管理员\n跟进内容内容内容内容'
}, {
title: '卖家发货',
desc: '跟进方式:电话\n跟进人新生社区管理员\n跟进内容内容内容内容'
}, {
title: '买家签收',
desc: '跟进方式:电话\n跟进人新生社区管理员\n跟进内容内容内容内容'
}, {
title: '交易完成',
desc: '跟进方式:电话\n跟进人新生社区管理员\n跟进内容内容内容内容'
}]
const personInfo=ref({
goalPersonId:'',
name:'',
taskType:''
})
const followWays = ref([])
const followList = ref([])
const followListNum=ref(0)
const active=ref(null)
// 表单引用
const formRef = ref(null)
@@ -138,19 +122,19 @@ const rules = {
errorMessage: '请选择跟进日期'
}]
},
followMethod: {
followWay: {
rules: [{
required: true,
errorMessage: '请选择跟进方式'
}]
},
followContent: {
content: {
rules: [{
required: true,
errorMessage: '请填写跟进内容'
}]
},
followResult: {
result: {
rules: [{
required: true,
errorMessage: '请填写跟进结果'
@@ -164,31 +148,108 @@ const getBackgroundStyle = (imageName) => ({
backgroundPosition: 'center', // 居中
backgroundRepeat: 'no-repeat'
});
const trainVideoImgUrl=config.trainVideoImgUrl
// 事件处理
const onDateChange = (field, e) => {
formData[field] = e.detail.value
const onFollowDateChange = (e)=>{
formData.followDate=e
}
const onMethodChange = (e) => {
formData.followWay=e
}
// 事件处理
const onDateChange = ( e) => {
formData.nextContactDate=e
}
function getFollowList(){
let header={
'Authorization':uni.getStorageSync('Padmin-Token'),
'Content-Type': "application/x-www-form-urlencoded"
}
let params={
goalPersonId:personInfo.value.goalPersonId
}
$api.myRequest('/dispatch/assist/records/getFollowList', params,'get',9100,header).then((resData) => {
console.log("resData",resData)
if(resData && resData.code == 200){
if(resData.data && resData.data.length>0){
followListNum.value=resData.data.length
resData.data.forEach(item=>{
const obj={
title:item.followDate,
desc:`跟进方式:${getFollowWaysLabelByValue(item.followWay)}\n跟进人${item.createByName}\n跟进内容${item.content}`
}
followList.value.push(obj)
})
}
}
});
}
function getDictionary(){
$api.myRequest('/system/public/dict/data/type/assist_follow_way').then((resData) => {
if(resData && resData.code == 200){
resData.data.forEach(item=>{
const obj = {
value: item.dictValue,
text: item.dictLabel
}
followWays.value.push(obj)
})
}
});
}
function getFollowWaysLabelByValue(value) {
if (!Array.isArray(followWays.value)) {
return ''
}
const item = followWays.value.find(item => item.value === String(value))
return item ? item.text : '暂无跟进方式'
}
const handleSubmit = () => {
formRef.value?.validate()
.then(() => {
uni.showToast({ title: '校验通过', icon: 'success' });
let header={
'Authorization':uni.getStorageSync('Padmin-Token')
}
formData.goalPersonId=personInfo.value.goalPersonId
$api.myRequest('/dispatch/assist/records/addRecords', formData,'post',9100,header).then((resData) => {
console.log("resData",resData)
if(resData && resData.code == 200){
handleReset()
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
});
}else{
uni.showToast({
title: resData.msg,
icon: 'none',
duration: 2000
});
}
});
})
.catch((errors) => {
console.log('校验失败:', errors);
uni.showToast({ title: '请填写必填项', icon: 'none' });
});
};
const handleReset = () => {
formData.followDate = '';
formData.followWay = '';
formData.content = '';
formData.result = '';
formData.nextPlan = '';
formData.nextContactDate = '';
}
onLoad(() => {
onLoad((options) => {
personInfo.value.goalPersonId=options.id
personInfo.value.name=options.name
personInfo.value.taskType=options.taskType
getDictionary()
getFollowList()
});