Commit 5fa2c517 authored by 我在何方's avatar 我在何方

更新报表跟进

parent 1930fed3
import request from '@/utils/request'
// 创建报价单跟进日志
export function createOfferLog(data) {
return request({
url: '/ecw/offer-log/create',
method: 'post',
data: data
})
}
// 更新报价单跟进日志
export function updateOfferLog(data) {
return request({
url: '/ecw/offer-log/update',
method: 'put',
data: data
})
}
// 删除报价单跟进日志
export function deleteOfferLog(id) {
return request({
url: '/ecw/offer-log/delete?id=' + id,
method: 'delete'
})
}
// 获得报价单跟进日志
export function getOfferLog(id) {
return request({
url: '/ecw/offer-log/get?id=' + id,
method: 'get'
})
}
// 获得报价单跟进日志分页
export function getOfferLogPage(query) {
return request({
url: '/ecw/offer-log/page',
method: 'get',
params: query
})
}
// 导出报价单跟进日志 Excel
export function exportOfferLogExcel(query) {
return request({
url: '/ecw/offer-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
......@@ -10,6 +10,14 @@ export function listUser(query) {
})
}
// 根据岗位编码获取人员列表
export function userList(query) {
return request({
url: '/system/user/list-user/'+query,
method: 'get',
})
}
// 获取用户精简信息列表
export function listSimpleUsers() {
return request({
......
......@@ -93,6 +93,8 @@ export const DICT_TYPE = {
ECW_WAREHOUSING_TYPE: 'warehousing_type', // 入仓类型
ECW_OFFER_STATUS: 'offer_status', // 销售阶段(报价单)
ECW_IS_BRAND: 'is_brand', // 有无品牌
ECW_OFFER_TYPE: 'offer_type', // 跟进类型
ECW_OFFER_METHOD: 'offer_method', // 跟进方式
//--------ecw---------
CUSTOMER_STATUS: 'customer_status',
CUSTOMER_SOURCE: 'customer_source',
......@@ -123,7 +125,6 @@ export const DICT_TYPE = {
COMMISSION_UNIT:'commission_unit',//佣金货物单位
ECW_PORT_TYPE:'port_type', //港口类型
CERTIFICATE_TYPE:'certificate_type',//证件类型
//customer
CUSTOMER_CREDIT_RULE_TYPE: 'customer_credit_rule_type',
CUSTOMER_LEVEL_RULE_TYPE: 'customer_level_rule_type',
......
<template>
<div class="app-container">
<el-card>
<div slot="header" class="card-title">报表跟进</div>
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
<el-form-item label="报价单号" prop="number" style="width: 46%;display: inline-block;">
<label>{{form.number}}</label>
<!-- <el-input :value="form.number" disabled placeholder="请输入报价单号" /> -->
</el-form-item>
<el-form-item label="跟进类型" prop="type" style="width: 46%;display: inline-block;margin-left:8%">
<el-radio v-model="form.type" label="2">商务洽谈</el-radio>
</el-form-item>
<el-form-item label="跟进时间" prop="followUpTime" style="width: 46%;display: inline-block">
<el-date-picker clearable v-model="form.followUpTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="选择跟进时间" />
</el-form-item>
<el-form-item label="跟进业务员" prop="followUpSalesmanId" style="width: 46%;display: inline-block;;margin-left:8%">
<el-select v-model="form.followUpSalesmanId" placeholder="请选择跟进业务员">
<el-option v-for="item in creatorData"
:key="item.id" :label="item.nickname" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="联系人" prop="contacts" style="width: 46%;display: inline-block">
<el-select v-model="form.contacts" placeholder="请选择联系人">
<el-option v-for="item in contactsData"
:key="item.customerId" :label="item.name" :value="item.customerId"/>
</el-select>
</el-form-item>
<el-form-item label="跟进方式" prop="followUpMethod" style="width: 46%;display: inline-block;margin-left:8%">
<dict-selector
:type="DICT_TYPE.ECW_OFFER_METHOD"
placeholder="请选择跟进方式"
v-model="form.followUpMethod"
form-type="select"
/>
</el-form-item>
<el-form-item label="客户反馈" prop="customerFeedback">
<el-input type="textarea" :rows="3" v-model="form.customerFeedback" placeholder="请输入客户反馈" />
</el-form-item>
<el-form-item label="处理结果" prop="processingResults">
<el-input type="textarea" :rows="3" v-model="form.processingResults" placeholder="请输入处理结果" />
</el-form-item>
</el-form>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
</div>
</div>
</template>
<script>
import { createOfferLog } from "@/api/ecw/offerLog"
import { userList } from "@/api/system/user"
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import {DICT_TYPE} from '@/utils/dict'
export default {
name: "OfferLog",
components: {
},
data() {
return {
// 遮罩层
loading: true,
open: false,
contactsData:[],
creatorData:[],
// 表单参数
form: {
type:'2',
offerId:0,
number:0
},
relationId:0,
// 表单校验
rules: {
type: [{ required: true, message: "请选择跟进类型", trigger: "change" }],
followUpTime: [{ required: true, message: "跟进时间不能为空", trigger: "blur" }],
followUpSalesmanId: [{ required: true, message: "跟进业务员不能为空", trigger: "change" }],
contacts: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
followUpMethod: [{ required: true, message: "请选择跟进方式", trigger: "change" }],
customerFeedback: [{ required: true, message: "客户反馈不能为空", trigger: "blur" }],
processingResults: [{ required: true, message: "处理结果不能为空", trigger: "blur" }],
}
};
},
created() {
if(this.$route.query.offerId){
this.form.offerId = this.$route.query.offerId
}
if(this.$route.query.relationId){
this.relationId = this.$route.query.relationId
this.getContactsData()
}
if(this.$route.query.number){
this.form.number = this.$route.query.number
}
userList('salesman').then(res =>this.creatorData = res.data)
},
methods: {
getContactsData(){
getCustomerContactsListByCustomer({customerId:this.relationId}).then(response => {
this.contactsData = response.data
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
// 添加的提交
this.form.type = parseInt(this.form.type)
this.form.followUpMethod = parseInt(this.form.followUpMethod)
createOfferLog(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
});
});
},
}
};
</script>
<style>
.dialog-footer{
padding: 40px;
}
</style>
This diff is collapsed.
<template>
<div class="app-container">
<el-card>
<div slot="header" class="card-title">跟进记录列表</div>
<!-- 列表 -->
<div class="offer-header">
<span style="font-size: 15px;">报价单号:{{list.length>0?list[0].number:''}}</span>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
>新增</el-button>
</div>
<el-table v-loading="loading" :data="list">
<el-table-column label="序号" align="center" prop="id" type="index">
<template slot-scope="scope">
<span>{{scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="跟进类型" align="center" prop="type" >
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_OFFER_TYPE" :value="scope.row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column label="联系人" align="center" prop="contactName" />
<el-table-column label="跟进方式" align="center" prop="followUpMethod">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_OFFER_METHOD" :value="scope.row.followUpMethod"></dict-tag>
</template>
</el-table-column>
<el-table-column label="跟进时间" align="center" prop="followUpTime" width="180">
<template slot-scope="scope">
<span>{{ scope.row.followUpTime}}</span>
</template>
</el-table-column>
<el-table-column label="客户反馈" align="center" prop="customerFeedback" />
<el-table-column label="处理结果" align="center" prop="processingResults" />
<el-table-column label="跟进业务员" align="center" prop="followUpSalesmanName" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="params.page" :limit.sync="params.rows"
@pagination="getList"/>
</el-card>
</div>
</template>
<script>
import {getOfferLogPage} from "@/api/ecw/offerLog";
import {DICT_TYPE} from '@/utils/dict'
export default {
name: "OfferLog",
components: {
},
data() {
return {
// 遮罩层
loading: true,
list: [],
total:0,
params:{
page:1,
rows:20,
offerId:0,
type:2
},
relationId:0,
creatorName:'test',
};
},
created() {
if(this.$route.query.offerId){
this.params.offerId = this.$route.query.offerId
this.relationId = this.$route.query.relationId
this.getList();
}
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
let params = {...this.params};
// 执行查询
getOfferLogPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({
path: "/offer/createLog",
query:{
offerId:this.params.offerId,
number:this.list[0].number,
relationId:this.relationId,
}
});
},
}
};
</script>
<style>
.card-title{
font-size: 18px;
font-weight: bold;
}
.offer-header{
padding-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment