1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<template>
<el-dialog append-to-body :title="$t('报价单')" :visible.sync="offerDialogVisible" :close-on-click-modal="false" width="80%">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('编号')" prop="searchNumber">
<el-input v-model="queryParams.searchNumber" :placeholder="$t('请输入报价单号、订单号')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('客户')" prop="searchCustomer">
<el-input v-model="queryParams.searchCustomer" :placeholder="$t('请输入客户')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="followUpSalesmanId">
<user-selector v-model="queryParams.followUpSalesmanId" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
</el-form-item>
</el-form>
<el-table :data="offerList" border size="mini">
<el-table-column align="center" width="80">
<template slot-scope="{row}">
<el-radio v-model="offerId" :label="row.offerId"> </el-radio>
</template>
</el-table-column>
<el-table-column :label="$t('报价单号')" min-width="160px">
<template slot-scope="{row}">
<el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">{{row.number}}</el-link>
</template>
</el-table-column>
<el-table-column :label="$t('销售阶段')" min-width="120">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="row.status" />
</template>
</el-table-column>
<el-table-column :label="$t('订单编号')" min-width="150px">
<template slot-scope="{row}">
<el-link type="primary" @click.native="$router.push('/order/detail?orderId=' + row.orderId)">{{row.orderNo}}</el-link>
</template>
</el-table-column>
<el-table-column :label="$t('客户编号')" align="center" min-width="100">
<template slot-scope="{row}">
<el-link type="primary" @click.native="$router.push('/customer/query/' + row.relationId)">{{row.customerNumber}}</el-link>
</template>
</el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="relationName" min-width="100" />
<el-table-column :label="$t('联系方式')">
<template slot-scope="scope">
+{{ scope.row.relationAreaCode }}{{ scope.row.relationPhone }}
</template>
</el-table-column>
<el-table-column :label="$t('运输方式')">
<template slot-scope="scope" >
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportId" />
</template>
</el-table-column>
<el-table-column :label="$t('渠道')" align="center" min-width="120" prop="channelName">
</el-table-column>
<el-table-column :label="$t('始发地')" align="center" min-width="120" prop="departureName">
</el-table-column>
<el-table-column :label="$t('目的地')" align="center" prop="objectiveName" min-width="120" />
<el-table-column :label="$t('预计销售额')" min-width="160">
<template slot-scope="{row}">
<div class="" v-for="(item, feeIndex) in row.estCostVO.feeDtoList" :key="feeIndex">
<dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" />
{{item.amount}} {{currencyMap[item.currencyId]}}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" prop="creatorName" align="center" min-width="100" />
<el-table-column :label="$t('创建时间')" align="center" min-width="160">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime) }}
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="offerTotal > 0" :total="offerTotal" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getOfferList"/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirm">{{$t('确 定')}}</el-button>
</div>
</el-dialog>
</template>
<script>
import { getCurrencyList } from '@/api/ecw/currency';
import { getOfferPage } from "@/api/ecw/offer"
import UserSelector from '@/components/UserSelector'
export default {
name: "CustomerFollowSelectOffer",
components: {
UserSelector
},
props: {
customerId: Number
},
data() {
return {
offerId: null,
offerDialogVisible: false,
queryParams: {
pageNo: 1,
pageSize: 6
},
offerList: [],
offerTotal: 0,
currencyList: [],
}
},
created() {
getCurrencyList().then(res => {
this.currencyList = res.data
})
this.getOfferList()
},
computed:{
currencyMap(){
let map = {}
this.currencyList.forEach(item => {
map[item.id] = this.$l(item, 'title')
})
return map
},
exportCityList() {
return this.tradeCityList.filter(item => item.type == 2)
},
importCityList() {
return this.tradeCityList.filter(item => item.type == 1)
},
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getOfferList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNo: 1,
pageSize: 10
}
this.handleQuery();
},
getOfferList() {
getOfferPage({
...this.queryParams,
customerId: this.customerId
}).then(response => {
this.offerList = response.data.list;
this.offerTotal = response.data.total;
});
},
confirm() {
if (this.offerId) {
this.$emit('select', this.offerId)
this.offerDialogVisible = false
} else {
this.$message.error(this.$t("请选择报价单"))
}
}
}
}
</script>