金五联管理系统PC前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jwl-manage-web/src/views/zs/clue/components/DistributeFormDialog.vue

231 lines
8.3 KiB

2 years ago
<template>
2 years ago
<el-dialog title="分发" :close-on-click-modal="false" append-to-body :visible.sync="visible" width="600px" @close="closeDialog" style="min-height: 400px;">
<el-tabs v-model="activeTab" >
<el-tab-pane label="邀约信息" name="first" >
<div v-if="invitationForm.invitationId != undefined">
<el-form ref="invitationForm" :model="invitationForm" label-width="110px" :disabled="true">
<el-form-item label="姓名" prop="name">
<span>{{invitationForm.name}}</span>
</el-form-item>
<el-form-item label="联系方式" prop="phone">
<span>{{invitationForm.phone}}</span>
</el-form-item>
<el-form-item label="场地" prop="placeId">
<span>{{invitationForm.placeName}}</span>
</el-form-item>
<el-form-item label="约定时间" prop="invitationTime">
<span>{{invitationForm.invitationTime}}</span>
</el-form-item>
<el-form-item label="备注" prop="remark">
<span>{{invitationForm.remark}}</span>
</el-form-item>
</el-form>
</div>
</el-tab-pane>
<el-tab-pane label="分发" name="second">
<el-form ref="dialogForm" :model="dialogForm" :rules="rules" label-width="110px" :disabled="dialogForm.orderId != undefined">
2 years ago
<el-row>
<el-col :span="24">
2 years ago
<el-form-item label="场地" prop="placeId">
2 years ago
<el-select v-model="dialogForm.placeId" filterable placeholder="请选择" clearable style="width: 100%;" @change="getCoaChes">
2 years ago
<el-option v-for="dict in placeOptions" :key="dict.placeId" :label="dict.name" :value="dict.placeId" />
</el-select>
</el-form-item>
</el-col>
2 years ago
<el-col :span="24">
2 years ago
<el-form-item label="接待人" prop="coachId">
2 years ago
<el-select v-model="dialogForm.coachId" filterable placeholder="请选择" clearable style="width: 100%;">
<el-option v-for="dict in coachOptions" :key="dict.coachId" :label="dict.coachName" :value="dict.coachId" />
</el-select>
</el-form-item>
</el-col>
2 years ago
<el-col :span="24">
<el-form-item label="抄送" prop="copyUserList">
<el-select v-model="dialogForm.copyUserList" filterable multiple placeholder="请选择" clearable style="width: 100%;">
<el-option v-for="dict in coachOptions" :key="dict.coachId" :label="dict.coachName" :value="dict.coachId" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="跟进信息">
<div style="max-height: 200px; overflow-y: auto;">
<div v-for="item in feedbackDetail" :key="item.feedbackId">
<el-timeline-item :timestamp="item.updateTime == undefined ? item.createTime : item.updateTime" placement="top">
2 years ago
<el-card>
2 years ago
<div v-if="item.feedbackType == 1">
<div>是否联系<span style="font-size: 12px;">{{ item.isContact ? '已联系' : '未联系' }}</span></div>
<div>到场时间<span style="font-size: 12px;">{{ item.arrivalTime }}</span></div>
<div>备注<span style="font-size: 12px;" v-html="item.remark" /></div>
</div>
<div v-if="item.feedbackType == 2">
<div>状态
<span v-if="item.arrivalStatus == 1">未到场</span>
<span v-if="item.arrivalStatus == 2">到场未成交</span>
<span v-if="item.arrivalStatus == 3">到场已成交</span>
</div>
<div>备注<span style="font-size: 12px;" v-html="item.remark" /></div>
</div>
</el-card>
</el-timeline-item>
</div>
</div>
</el-form-item>
</el-col>
2 years ago
</el-row>
</el-form>
2 years ago
</el-tab-pane>
</el-tabs>
2 years ago
<span slot="footer" class="dialog-footer" :disabled="dialogForm.orderId">
2 years ago
<el-button plain @click="(visible = false)">取消</el-button>
2 years ago
<el-button v-jclick type="primary" :disabled="!canSubmit || dialogForm.orderId != undefined" @click="dialogFormSubmit()">确定</el-button>
2 years ago
</span>
</el-dialog>
</template>
2 years ago
<script>
2 years ago
import { listFeedbackOrder, addFeedbackOrder } from '@/api/zs/feedbackOrder';
import { listFeedbackDetail } from '@/api/zs/feedbackDetail';
2 years ago
import { getInvitationByClue } from '@/api/zs/invitation';
2 years ago
2 years ago
import { getAllPlaces } from '@/api/sch/place';
2 years ago
import { getAllCoaches } from '@/api/sch/coach';
2 years ago
export default {
name: 'DistributeFormDialog',
2 years ago
data () {
2 years ago
return {
visible: false,
canSubmit: true,
2 years ago
dialogForm: {
placeId: undefined,
clueId: undefined,
coachId: undefined,
copyUserList: []
},
2 years ago
rules: {
2 years ago
placeId: { required: true, message: '场地不能为空', trigger: 'blur, change' },
coachId: { required: true, message: '教练不能为空', trigger: 'blur, change' }
2 years ago
},
2 years ago
placeOptions: [],
coachOptions: [],
2 years ago
feedbackDetail: [],
invitationForm: {
invitationId:undefined,
clueId: undefined,
name: undefined,
phone: undefined,
address: undefined,
placeId: undefined,
invitationTime: undefined,
remark: undefined
},
activeTab: 'first'
2 years ago
};
},
methods: {
2 years ago
init (info = undefined) {
2 years ago
this.activeTab = 'first'
2 years ago
this.getPlaces();
2 years ago
this.visible = true;
this.$nextTick(() => {
this.resetDialogForm();
this.$refs['dialogForm'].resetFields();
if (info) {
this.dialogForm.clueId = info;
2 years ago
//查询线索的邀约情况
this.getInvitationByClue(info);
2 years ago
// 查询该线索的分发情况
2 years ago
this.getFeedbackOrder(info);
2 years ago
}
});
},
2 years ago
resetDialogForm () {
2 years ago
this.dialogForm = {
2 years ago
placeId: undefined,
clueId: undefined,
2 years ago
coachId: undefined,
copyUserList: []
2 years ago
};
2 years ago
this.feedbackDetail=[]
2 years ago
},
2 years ago
closeDialog () {
2 years ago
this.$emit('update:dialog.batchUpdateVisible', false);
},
2 years ago
getInvitationByClue(clueId){
this.invitationForm = {
invitationId:undefined,
clueId: undefined,
name: undefined,
phone: undefined,
address: undefined,
placeId: undefined,
invitationTime: undefined,
remark: undefined
}
getInvitationByClue({ clueId: clueId }).then(resp => {
if (resp.code == 200 && resp.data) {
this.invitationForm = resp.data;
}
});
},
2 years ago
getFeedbackOrder (clueId) {
listFeedbackOrder({ clueId: clueId }).then(resp => {
if (resp.code == 200 && resp.rows && resp.rows.length > 0) {
this.dialogForm = resp.rows.filter(item => item.feedbackStatus != 0)[0];
if (this.dialogForm != undefined && this.dialogForm.placeId != undefined) {
this.getCoaChes(this.dialogForm.placeId);
}
if (this.dialogForm.orderId) {
this.getFeedbackDetail(this.dialogForm.orderId);
2 years ago
}
}
2 years ago
});
2 years ago
},
2 years ago
getFeedbackDetail (orderId) {
listFeedbackDetail({ orderId: orderId }).then(resp => {
this.feedbackDetail = resp.rows;
});
},
2 years ago
// 表单提交
2 years ago
dialogFormSubmit () {
2 years ago
this.$refs.dialogForm.validate((valid) => {
if (valid) {
this.canSubmit = false;
// 校验完成,调接口
2 years ago
addFeedbackOrder(this.dialogForm)
2 years ago
.then((resp) => {
this.canSubmit = true;
if (resp.code == 200) {
this.$message.success('分发成功');
this.$emit('refreshDataList');
this.visible = false;
}
})
.catch(() => {
this.canSubmit = true;
});
}
});
},
2 years ago
getPlaces () {
2 years ago
getAllPlaces({ status: '0' }).then((resp) => {
this.placeOptions = resp.data;
});
2 years ago
},
getCoaChes (placeId) {
console.log(placeId);
getAllCoaches({ placeId: placeId }).then(resp => {
if (resp.code == 200) { this.coachOptions = resp.data; }
});
2 years ago
}
2 years ago
}
};
2 years ago
</script>