query.vue 65.6 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2
<template>
  <div>
332784038@qq.com's avatar
332784038@qq.com committed
3
    <el-row type="flex" style="margin-top: 15px; margin-bottom: 15px" justify="center">
lanbaoming's avatar
lanbaoming committed
4
      <el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="16">
332784038@qq.com's avatar
332784038@qq.com committed
5 6
        <div style="display: flex; justify-content: space-between; align-items: flex-end">
          <h2>{{ $t("查看") }}</h2>
lanbaoming's avatar
lanbaoming committed
7
          <div>
332784038@qq.com's avatar
332784038@qq.com committed
8
            <el-button type="primary" size="small" v-has-permi="['ecw:customer:query-edit']" @click="$router.push('/customer/add-edit/' + id)">{{ $t("编辑") }} </el-button>
9
            <el-button v-has-permi="['ecw:customer:query-quoted-price']" @click="quote" type="primary" size="small">
332784038@qq.com's avatar
332784038@qq.com committed
10
              {{ $t("报价") }}
11
            </el-button>
332784038@qq.com's avatar
332784038@qq.com committed
12 13 14
            <el-button v-has-permi="['ecw:customer:query-follow-up']" type="primary" size="small" @click="customerFollowFn('follow')">{{ $t("跟进") }} </el-button>
            <el-button v-has-permi="['ecw:customer:query-customer-complaint']" type="primary" size="small" @click="customerFollowFn('complain')">{{ $t("客诉") }} </el-button>
            <el-button v-has-permi="['ecw:customer:query-delete']" type="danger" size="small" @click="deleteCustomerFn()">{{ $t("删除") }} </el-button>
lanbaoming's avatar
lanbaoming committed
15 16
          </div>
        </div>
17

332784038@qq.com's avatar
332784038@qq.com committed
18
        <el-card style="margin-top: 15px">
19 20
          <el-descriptions :title="$t('基本')" :column="3" border>
            <template slot="extra">
21
              <el-button type="primary" size="small" @click="showMore = !showMore">
332784038@qq.com's avatar
332784038@qq.com committed
22
                {{ showMore ? $t("隐藏") : $t("更多") }}
23
              </el-button>
24 25
            </template>
            <el-descriptions-item :label="$t('客户编号')">{{ customer.number }}</el-descriptions-item>
332784038@qq.com's avatar
332784038@qq.com committed
26 27 28 29
            <el-descriptions-item :label="$t('客户名称')"
              ><span style="white-space: pre-wrap">{{ customer.name }}</span></el-descriptions-item
            >
            <el-descriptions-item :label="$t('国籍')">{{ $l(customer, "countryName") }}</el-descriptions-item>
30 31 32 33 34 35
            <el-descriptions-item :label="$t('客户来源')">
              {{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('客户状态')">
              {{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status) }}
            </el-descriptions-item>
zs嵩's avatar
zs嵩 committed
36
            <el-descriptions-item :label="$t('客户经理')">{{ customer.customerServiceName }}</el-descriptions-item>
37
            <el-descriptions-item :label="$t('询盘信息')">{{ customer.inquiry }}</el-descriptions-item>
38
            <el-descriptions-item :label="$t('备注')">{{ customer.remarks }}</el-descriptions-item>
39
            <el-descriptions-item :label="$t('图片')">
40 41
              <image-display :picture-urls="customer.picture ? customer.picture.split(',') : []">
                <el-button type="text"> 查看图片</el-button>
42 43
              </image-display>
            </el-descriptions-item>
余金瑶's avatar
余金瑶 committed
44

45 46 47 48 49
            <el-descriptions-item :label="$t('客户等级')">
              {{ getDictDataLabel(DICT_TYPE.CUSTOMER_LEVEL, customer.level) }}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('推介人')">{{ customer.promoterName }}</el-descriptions-item>
            <el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, "{y}-{m}-{d}") }} </el-descriptions-item>
zs嵩's avatar
zs嵩 committed
50
            <el-descriptions-item :label="$t('业绩类型')">{{ customer.isNew ? $t("新客户") : $t("老客户") }} </el-descriptions-item>
51 52 53 54 55 56 57 58 59 60
            <el-descriptions-item :label="$t('资源类型')">
              <dict-tag :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" :value="customer.resourceType"></dict-tag>
            </el-descriptions-item>
            <el-descriptions-item :label="$t('客户英文名称')">{{ customer.nameEn }}</el-descriptions-item>
            <el-descriptions-item :label="$t('联系地址')">{{ customer.address }}</el-descriptions-item>
            <el-descriptions-item :label="$t('首次成交时间')">{{ customer.firstDealTime }}</el-descriptions-item>
            <el-descriptions-item :label="$t('掉入公海时间')">
              {{ customer.estimateEnterOpenSeaTime || customer.enterOpenSeaTime }}
            </el-descriptions-item>

61
            <template v-if="showMore">
62 63 64 65 66 67 68
              <el-descriptions-item :label="$t('获取方式')">
                {{ getDictDataLabel(DICT_TYPE.CUSTOMER_GET_METHOD, customer.getMethod) }}
              </el-descriptions-item>
              <el-descriptions-item :label="$t('创建入口')">
                {{ getDictDataLabel(DICT_TYPE.CUSTOMER_FROM, customer.createFrom) }}
              </el-descriptions-item>
              <el-descriptions-item :label="$t('捞取时间')">{{ customer.catchTime }}</el-descriptions-item>
332784038@qq.com's avatar
332784038@qq.com committed
69
              <el-descriptions-item :label="$t('归属时间')">{{ customer.customerServiceConfirmedTime }} </el-descriptions-item>
70 71 72 73
              <el-descriptions-item :label="$t('创建人')">{{ customer.founderName }}</el-descriptions-item>
              <el-descriptions-item :label="$t('创建时间')">{{ parseTime(customer.createTime) }}</el-descriptions-item>
              <el-descriptions-item :label="$t('最后更新人')">{{ customer.updaterName }}</el-descriptions-item>
              <el-descriptions-item :label="$t('最后更新时间')">{{ customer.updateTime }}</el-descriptions-item>
lanbaoming's avatar
lanbaoming committed
74
            </template>
75
          </el-descriptions>
lanbaoming's avatar
lanbaoming committed
76 77 78
        </el-card>

        <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
yujinyao's avatar
yujinyao committed
79
          <el-tab-pane name="contact" :label="$t('联系人')">
332784038@qq.com's avatar
332784038@qq.com committed
80 81 82 83 84 85 86
            <el-table :data="customerContacts" style="width: 100%" border>
              <el-table-column prop="department" :label="$t('部门')"> </el-table-column>
              <el-table-column prop="position" :label="$t('职位')"> </el-table-column>
              <el-table-column prop="name" :label="$t('联系人')"> </el-table-column>
              <el-table-column prop="nameEn" :label="$t('联系人英文名称')"> </el-table-column>
              <el-table-column prop="phoneNew" :label="$t('联系方式')">
                <template v-slot="{ row }"> +{{ row.areaCode }} {{ row.phoneNew }} </template>
yujinyao's avatar
yujinyao committed
87
              </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
88 89 90 91
              <el-table-column prop="userid" :label="$t('关联账号')" :formatter="userIdFormatter"> </el-table-column>
              <el-table-column prop="social" :label="$t('社交软件')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.SOCIAL, cellValue)"> </el-table-column>
              <el-table-column prop="socialNumber" :label="$t('社交软件号码')"> </el-table-column>
              <el-table-column prop="email" :label="$t('邮箱')"> </el-table-column>
yujinyao's avatar
yujinyao committed
92 93
            </el-table>
          </el-tab-pane>
lanbaoming's avatar
lanbaoming committed
94 95 96
          <el-tab-pane name="order" :label="$t('订单')">
            <el-card class="box-card">
              <div slot="header" class="clearfix">
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
                <el-form :inline="true" size="small" label-width="100px">
                  <div class="search-z">
                    <el-form-item :label="$t('运输方式:')">
                      <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" formatter="number" />
                    </el-form-item>
                    <el-form-item :label="$t('订单状态:')">
                      <dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" />
                    </el-form-item>
                    <el-form-item :label="$t('报关方式:')">
                      <dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsTypes" multiple />
                    </el-form-item>
                    <el-form-item :label="$t('控货:')">
                      <dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.isCargoControl" />
                    </el-form-item>
                    <el-form-item :label="$t('始发仓:')" prop="startWarehouseIds">
                      <el-select v-model="queryParams.startWarehouseIds" multiple :placeholder="$t('请选择始发仓')" clearable @change="handleQuery">
                        <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item :label="$t('目的国:')" prop="destCountryId">
                      <el-select v-model="destCountryId" multiple :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
                        <el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item :label="$t('目的城市:')" prop="objectiveId">
                      <el-select v-model="objectiveId" multiple :placeholder="$t('请选择目的城市')" style="width: 200px" clearable @change="handleQuery">
                        <el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item :label="$t('目的仓:')" prop="destWarehouseId">
                      <el-select v-model="destWarehouseId" multiple :placeholder="$t('请选择目的仓')" style="width: 200px" clearable @change="handleQuery">
                        <el-option v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
                      </el-select>
                    </el-form-item>
                  </div>
                  <div class="search-time">
                    <el-form-item :label="$t('入仓时间:')">
                      <el-date-picker v-model="rucangtime" @change="changeDate" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
                    </el-form-item>
                    <el-form-item style="padding-left: 20px">
                      <el-button type="primary" @click="getorderList">{{ $t("搜索") }}</el-button>
                      <el-button type="primary" @click="handleOrderReset">{{ $t("重置") }}</el-button>
                    </el-form-item>
                  </div>
lanbaoming's avatar
lanbaoming committed
141
                </el-form>
142 143 144 145 146 147
                <el-row :gutter="10" class="mb8">
                  <el-col :span="15" v-if="statisticsOrder">
                    <!-- 订单列表显示搜索条件对应箱数、仓库实测、收款方数、重量 -->
                    {{ $t("合计:{totalNum}箱,{totalVolume}m³(测) {totalChargeVolume}m³(重) {totalWeight}KG(测), {totalChargeWeight}kg(收费)", statisticsOrder) }}
                  </el-col>
                </el-row>
lanbaoming's avatar
lanbaoming committed
148
              </div>
yujinyao's avatar
yujinyao committed
149
              <el-descriptions :column="2">
332784038@qq.com's avatar
332784038@qq.com committed
150 151 152 153 154
                <el-descriptions-item :label="$t('海空联运/海运拼柜/海运整柜/专线空运')"> {{ orderStatisticsObj.hklyTotal || 0 }}/{{ orderStatisticsObj.hypgTotal || 0 }}/{{ orderStatisticsObj.hyzgTotal || 0 }}/{{ orderStatisticsObj.zxkyTotal || 0 }} </el-descriptions-item>
                <el-descriptions-item :label="$t('最后交易日期')">{{ orderStatisticsObj.lastBusinessDate }} </el-descriptions-item>
                <el-descriptions-item :label="$t('全部订单/控货订单')"> {{ orderStatisticsObj.allOrderTotal || 0 }}/{{ orderStatisticsObj.controlOrderTotal || 0 }} </el-descriptions-item>
                <el-descriptions-item :label="$t('最后交易单号')">{{ orderStatisticsObj.lastBusinessOrderNo }} </el-descriptions-item>
                <el-descriptions-item :label="$t('报价/下单/入仓')"> {{ orderStatisticsObj.offerOrderTotal || 0 }}/{{ orderStatisticsObj.pickOrderTotal || 0 }}/{{ orderStatisticsObj.wareHousingTotal || 0 }} </el-descriptions-item>
155
                <el-descriptions-item :label="$t('储存量')">{{ orderStatisticsObj.stock || 0 }}</el-descriptions-item>
332784038@qq.com's avatar
332784038@qq.com committed
156
                <el-descriptions-item :label="$t('已出货订单')">{{ orderStatisticsObj.shipmentTotal || 0 }} </el-descriptions-item>
yujinyao's avatar
yujinyao committed
157
              </el-descriptions>
lanbaoming's avatar
lanbaoming committed
158
              <el-table :data="orderList">
159
                <el-table-column :label="$t('订单编号')" width="120px" align="center">
332784038@qq.com's avatar
332784038@qq.com committed
160
                  <template slot-scope="{ row }">
161 162 163
                    <el-link type="primary" @click.native="$router.push('/order/detail?orderId=' + row.orderId)">
                      {{ row.orderNo }}
                    </el-link>
164 165 166
                  </template>
                </el-table-column>
                <el-table-column :label="$t('报价单号')" align="center" width="120px">
332784038@qq.com's avatar
332784038@qq.com committed
167
                  <template slot-scope="{ row }">
168 169 170
                    <el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">
                      {{ row.offerNo }}
                    </el-link>
lanbaoming's avatar
lanbaoming committed
171 172
                  </template>
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
173
                <el-table-column :label="$t('唛头')" align="center" prop="marks" />
lanbaoming's avatar
lanbaoming committed
174
                <el-table-column :label="$t('总箱数/入仓箱数')" align="center" prop="sumNum">
332784038@qq.com's avatar
332784038@qq.com committed
175
                  <template slot-scope="{ row }"> {{ row.totalNum }}{{ $t("") }}/{{ row.sumNum }}{{ $t("") }} </template>
lanbaoming's avatar
lanbaoming committed
176 177
                </el-table-column>
                <el-table-column :label="$t('体积/重量')" align="center" prop="sumWeight">
332784038@qq.com's avatar
332784038@qq.com committed
178
                  <template slot-scope="{ row }">
lanbaoming's avatar
lanbaoming committed
179
                    <!--入仓前是填单数据,入仓后是入仓数据-->
180 181
                    <!--                    <template v-if="row.inWarehouseState <= 1">{{row.costVO.totalVolume}}m³ /{{row.costVO.totalWeight}}Kg</template>-->
                    <!--                    <template v-else>{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</template>-->
lanbaoming's avatar
lanbaoming committed
182
                    <component
332784038@qq.com's avatar
332784038@qq.com committed
183
                      :is="row.orderType == 2 ? 'el-tooltip' : 'div'"
lanbaoming's avatar
lanbaoming committed
184 185
                      class="item"
                      :style="{
332784038@qq.com's avatar
332784038@qq.com committed
186
                        color: row.orderType == 2 ? 'red' : null
yujinyao's avatar
yujinyao committed
187
                      }"
lanbaoming's avatar
lanbaoming committed
188
                      effect="dark"
332784038@qq.com's avatar
332784038@qq.com committed
189 190 191
                      :content="(row.wvolume || 0) + 'm³'"
                      placement="bottom"
                    >
192 193
                      <div v-if="row.sumNum > 0">{{ row.sumVolume }}m³ /{{ row.sumWeight }}Kg</div>
                      <div v-else>{{ row.costVO.totalVolume }}m³ /{{ row.costVO.totalWeight }}Kg</div>
lanbaoming's avatar
lanbaoming committed
194 195 196 197
                    </component>
                  </template>
                </el-table-column>
                <el-table-column :label="$t('始发仓')" align="center" prop="startWarehouseName">
332784038@qq.com's avatar
332784038@qq.com committed
198
                  <template slot-scope="{ row }">
199
                    {{ row.startWarehouseName }}
332784038@qq.com's avatar
332784038@qq.com committed
200
                    <span style="color: red" v-if="row.isExternalWarehouse">({{ $t("外部仓") }})</span>
lanbaoming's avatar
lanbaoming committed
201 202
                  </template>
                </el-table-column>
203
                <el-table-column :label="$t('运输方式-渠道/目的仓')" align="center" prop="transportId">
332784038@qq.com's avatar
332784038@qq.com committed
204 205
                  <template slot-scope="{ row }">
                    <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" />
206 207
                    <template v-if="row.channelName"> - {{ row.channelName }} </template>
                    / {{ row.dstWarehouseName }}
lanbaoming's avatar
lanbaoming committed
208 209 210
                  </template>
                </el-table-column>
                <el-table-column :label="$t('控货')" align="center" prop="transportId">
332784038@qq.com's avatar
332784038@qq.com committed
211 212
                  <template slot-scope="{ row }">
                    <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="row.isCargoControl" />
lanbaoming's avatar
lanbaoming committed
213 214 215
                  </template>
                </el-table-column>
                <el-table-column :label="$t('订单状态')" align="center" prop="statusMsg">
216 217 218
                  <!--                  <template slot-scope="scope">-->
                  <!--                    <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />-->
                  <!--                  </template>-->
lanbaoming's avatar
lanbaoming committed
219
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
220
                <el-table-column :label="$t('创建时间')" align="center" prop="createTime" />
lanbaoming's avatar
lanbaoming committed
221
                <el-table-column :label="$t('入仓时间')">
332784038@qq.com's avatar
332784038@qq.com committed
222
                  <template v-slot="{ row }">
223
                    {{ parseTime(row.rucangTime) }}
lanbaoming's avatar
lanbaoming committed
224 225
                  </template>
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
226 227
                <el-table-column :label="$t('装柜/出仓时间')" align="center" prop="loadTime" />
                <el-table-column :label="$t('卸柜/到仓时间')" align="center" prop="unloadTime" />
yujinyao's avatar
yujinyao committed
228
                <el-table-column :label="$t('提货率')" align="center">
332784038@qq.com's avatar
332784038@qq.com committed
229
                  <template v-slot="{ row }">
230
                    {{ row.pickNum | deliveryRate(row.sumNum) }}
yujinyao's avatar
yujinyao committed
231 232
                  </template>
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
233 234
                <el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName" />
                <el-table-column :label="$t('业绩归属客户方')" align="center" prop="customerName" />
yujinyao's avatar
yujinyao committed
235
              </el-table>
332784038@qq.com's avatar
332784038@qq.com committed
236
              <pagination @pagination="getorderList" :page.sync="queryParams.page" :limit.sync="queryParams.rows" :total="orderTotal"></pagination>
lanbaoming's avatar
lanbaoming committed
237 238 239
            </el-card>
          </el-tab-pane>
          <el-tab-pane name="quote" :label="$t('报价')">
240 241
            <el-card class="box-card">
              <div slot="header" class="clearfix">
242 243 244 245 246
                <el-form :inline="true" size="small" ref="handleOffer" label-width="100px">
                  <div class="search-z">
                    <el-form-item :label="$t('编号')" prop="searchNumber">
                      <el-input v-model.trim="queryOfferParams.searchNumber" :placeholder="$t('请输入报价单号、订单号')" clearable @keyup.enter.native="handleQuery" />
                    </el-form-item>
1483922988@qq.com's avatar
1483922988@qq.com committed
247

248 249 250
                    <el-form-item :label="$t('客户')" prop="searchCustomer">
                      <el-input v-model.trim="queryOfferParams.searchCustomer" clearable @keyup.enter.native="handleQuery" />
                    </el-form-item>
1483922988@qq.com's avatar
1483922988@qq.com committed
251

252 253 254
                    <el-form-item :label="$t('联系方式')" prop="relationPhone">
                      <el-input v-model.trim="queryOfferParams.relationPhone" clearable @keyup.enter.native="handleQuery" @input="queryOfferParams.relationPhone = queryOfferParams.relationPhone.replace(/\s+/g, '')" />
                    </el-form-item>
1483922988@qq.com's avatar
1483922988@qq.com committed
255

256 257 258
                    <el-form-item :label="$t('区号')" prop="relationAreaCode">
                      <el-input v-model.trim="queryOfferParams.relationAreaCode" :placeholder="$t('请输入客户')" clearable @keyup.enter.native="handleQuery" @input="queryOfferParams.relationAreaCode = queryOfferParams.relationAreaCode.replace(/\s+/g, '')" />
                    </el-form-item>
1483922988@qq.com's avatar
1483922988@qq.com committed
259

260 261 262 263 264
                    <el-form-item :label="$t('始发仓')" prop="startWarehouseIds">
                      <el-select v-model="queryParams.startWarehouseIds" multiple :placeholder="$t('请选择始发仓')" clearable @change="handleQuery">
                        <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
                      </el-select>
                    </el-form-item>
1483922988@qq.com's avatar
1483922988@qq.com committed
265

266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
                    <el-form-item :label="$t('目的国')" prop="destCountryId">
                      <el-select v-model="destCountryId" multiple :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
                        <el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item :label="$t('目的城市')" prop="objectiveId">
                      <el-select v-model="objectiveId" multiple :placeholder="$t('请选择目的城市')" style="width: 200px" clearable @change="handleQuery">
                        <el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item :label="$t('目的仓')" prop="destWarehouseId">
                      <el-select v-model="destWarehouseId" multiple :placeholder="$t('请选择目的仓')" style="width: 200px" clearable @change="handleQuery">
                        <el-option v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
                      </el-select>
                    </el-form-item>
1483922988@qq.com's avatar
1483922988@qq.com committed
281

282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
                    <el-form-item :label="$t('客户经理')" prop="salesmanIds">
                      <user-selector v-model="queryOfferParams.salesmanIds" multiple clearable @change="handleQuery" />
                    </el-form-item>
                    <el-form-item :label="$t('销售阶段')" prop="statusList">
                      <dict-selector :type="DICT_TYPE.ECW_OFFER_STATUS" multiple v-model="queryOfferParams.statusList" clearable @change="handleQuery" />
                    </el-form-item>
                    <el-form-item :label="$t('重要程度')" prop="importances">
                      <el-select v-model="queryOfferParams.importances" multiple :placeholder="$t('请选择')" clearable @change="handleQuery">
                        <el-option v-for="item in [1, 2, 3, 4, 5]" :label="item" :value="item" :key="item"></el-option>
                      </el-select>
                    </el-form-item>
                  </div>
                  <div class="search-time">
                    <el-form-item :label="$t('创建时间')">
                      <el-date-picker v-model="queryTmp.createTime" type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd HH:mm:ss" @change="handleQuery"> </el-date-picker>
                    </el-form-item>
1483922988@qq.com's avatar
1483922988@qq.com committed
298

299 300 301 302 303
                    <el-form-item style="padding-left: 20px">
                      <el-button type="primary" @click="getInfoListOfferPage">{{ $t("搜索") }}</el-button>
                      <el-button type="primary" @click="handleOfferReset">{{ $t("重置") }}</el-button>
                    </el-form-item>
                  </div>
304 305
                </el-form>
              </div>
332784038@qq.com's avatar
332784038@qq.com committed
306 307 308 309
              <el-table :data="infoListOfferList" style="width: 100%">
                <el-table-column type="index" :label="$t('序号')"> </el-table-column>
                <el-table-column :label="$t('报价单号')" width="160px">
                  <template slot-scope="{ row }">
310 311 312
                    <el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">
                      {{ row.number }}
                    </el-link>
yujinyao's avatar
yujinyao committed
313
                  </template>
314
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
315
                <el-table-column prop="orderNo" :label="$t('订单号')"> </el-table-column>
316 317 318 319 320 321 322 323 324 325
                <!--
                <el-table-column
                  prop="consignorName"
                  :label="$t('客户名称')"
                >
                  <template v-slot>
                    {{customer.name}}
                  </template>
                </el-table-column>
                -->
332784038@qq.com's avatar
332784038@qq.com committed
326 327 328
                <el-table-column prop="relationName" :label="$t('联系人')"> </el-table-column>
                <el-table-column :label="$t('联系方式')">
                  <template v-slot="{ row }"> +{{ row.relationAreaCode }}{{ row.relationPhone }} </template>
329
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
330
                <el-table-column :label="$t('始发仓')">
331 332
                  <template slot-scope="{ row }">
                    {{ row.startWarehouseName }}
333 334
                  </template>
                </el-table-column>
335
                <el-table-column :label="$t('运输方式-渠道/目的仓')">
332784038@qq.com's avatar
332784038@qq.com committed
336
                  <template slot-scope="{ row }">
337 338 339
                    <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" />
                    <template v-if="row.channelName"> - {{ row.channelName }} </template>
                    / {{ row.destWarehouseName }}
余金瑶's avatar
余金瑶 committed
340
                  </template>
341
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
342 343
                <el-table-column :label="$t('销售阶段')">
                  <template v-slot="{ row }">
344
                    {{ STATUS[row.status] }}
345 346
                  </template>
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
347 348
                <el-table-column :label="$t('预计销售额')">
                  <template slot-scope="{ row }" v-if="row.estCostVO">
yujinyao's avatar
yujinyao committed
349
                    <div class="" v-for="(item, feeIndex) in row.estCostVO.feeDtoList" :key="feeIndex">
332784038@qq.com's avatar
332784038@qq.com committed
350
                      <dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" />
351
                      {{ item.amount }} {{ currencyMap[item.currencyId] }}
yujinyao's avatar
yujinyao committed
352 353 354
                    </div>
                  </template>
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
355 356 357 358 359
                <el-table-column prop="stopTime" :label="$t('预计结束时间')"> </el-table-column>
                <el-table-column prop="businessManagerName" :label="$t('负责人')"> </el-table-column>
                <el-table-column prop="importance" :label="$t('重要程度')"> </el-table-column>
                <el-table-column prop="importance" :label="$t('报价有效期')">
                  <template v-slot="{ row }"> {{ row.startTime }} - {{ row.endTime }} </template>
360
                </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
361 362 363
                <el-table-column prop="businessManagerName" :label="$t('客户经理')"> </el-table-column>
                <el-table-column prop="createTime" :label="$t('创建时间')"> </el-table-column>
                <el-table-column :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
yujinyao's avatar
yujinyao committed
364 365 366 367 368 369 370 371 372 373 374 375 376 377
                  <template slot-scope="scope">
                    <!--
                    0 取消                                        恢复
                    1 特价审批    编辑、跟进、          取消    删除
                    2 草稿        编辑、                       删除
                    3 需求确认    编辑、跟进、结果、特价、取消   删除
                    4 赢单                                    删除
                    5 输单                                    删除
                    6 完成                                    删除
                    7 跟进中      编辑、跟进、结果、特价、取消、 删除
                    -->
                    <el-dropdown>
                      <el-button icon="el-icon-plus" circle type="primary"></el-button>
                      <el-dropdown-menu slot="dropdown">
332784038@qq.com's avatar
332784038@qq.com committed
378 379 380 381 382 383 384 385
                        <el-dropdown-item @click.native="$router.push('/offer/detail?offerId=' + scope.row.offerId)" v-hasPermi="['ecw:offer:show']">{{ $t("详情") }} </el-dropdown-item>
                        <el-dropdown-item @click.native="$router.push('/offer/edit?id=' + scope.row.offerId)" v-if="[1, 2, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:update']">{{ $t("编辑") }} </el-dropdown-item>
                        <el-dropdown-item @click.native="$router.push('/offer/logList?offerId=' + scope.row.offerId)" v-if="[1, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:loglist']">{{ $t("跟进") }} </el-dropdown-item>
                        <el-dropdown-item @click.native="$router.push(`/offer/result?offerId=${scope.row.offerId}&number=${scope.row.number}`)" v-if="[3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:result']">{{ $t("结果") }} </el-dropdown-item>
                        <el-dropdown-item @click.native="$router.push('/offer/special?offerId=' + scope.row.offerId)" v-if="[1, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:discount', 'ecw:offer:commission']">{{ $t("特价") }} </el-dropdown-item>
                        <el-dropdown-item @click.native="cancel(scope.row.offerId)" v-if="[1, 3, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:cancel']">{{ $t("取消") }} </el-dropdown-item>
                        <el-dropdown-item @click.native="recovery(scope.row.offerId)" v-if="[0].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:recovery']">
                          {{ $t("恢复") }}
386
                        </el-dropdown-item>
332784038@qq.com's avatar
332784038@qq.com committed
387
                        <el-dropdown-item @click.native="deleteOffer(scope.row.offerId)" v-if="[0, 1, 2, 3, 4, 5, 6, 7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:delete']">{{ $t("删除") }} </el-dropdown-item>
yujinyao's avatar
yujinyao committed
388 389 390 391
                      </el-dropdown-menu>
                    </el-dropdown>
                  </template>
                </el-table-column>
392
              </el-table>
332784038@qq.com's avatar
332784038@qq.com committed
393
              <pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal"></pagination>
394
            </el-card>
lanbaoming's avatar
lanbaoming committed
395 396
          </el-tab-pane>
          <el-tab-pane name="follow" :label="$t('跟进')">
397
            <logListCommon ref="logListCommon" :customerService="customer.customerService" :customerNumber="customer.number" v-if="activeName === 'follow'" :customerId="id" />
lanbaoming's avatar
lanbaoming committed
398 399
          </el-tab-pane>
          <el-tab-pane name="complain" :label="$t('客户投诉')">
332784038@qq.com's avatar
332784038@qq.com committed
400
            <customer-complaint v-if="activeName === 'complain'" ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
lanbaoming's avatar
lanbaoming committed
401 402 403 404 405 406 407
          </el-tab-pane>
          <el-tab-pane name="bill" :label="$t('账单')">
            <el-table style="width: 100%" :data="infoListReceiptList">
              <el-table-column :label="$t('序号')" type="index"></el-table-column>
              <el-table-column :label="$t('账单')" prop="receiptNo"></el-table-column>
              <el-table-column :label="$t('订单号')" prop="orderNo"></el-table-column>
              <el-table-column :label="$t('箱数')" prop="num"></el-table-column>
408 409
              <el-table-column :label="$t('方数')" prop="volume"></el-table-column>
              <el-table-column :label="$t('重量')" prop="weight"></el-table-column>
lanbaoming's avatar
lanbaoming committed
410
              <el-table-column :label="$t('类型')">
332784038@qq.com's avatar
332784038@qq.com committed
411 412
                <template v-slot="{ row }">
                  <dict-tag :type="DICT_TYPE.PAYMENT_TYPE" :value="row.collectionType" />
lanbaoming's avatar
lanbaoming committed
413 414 415
                </template>
              </el-table-column>
              <el-table-column :label="$t('费用类型')">
332784038@qq.com's avatar
332784038@qq.com committed
416 417
                <template v-slot="{ row }">
                  <dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" />
lanbaoming's avatar
lanbaoming committed
418 419
                </template>
              </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
420
              <el-table-column :label="$t('金额')" prop="totalAmount"> </el-table-column>
lanbaoming's avatar
lanbaoming committed
421 422
              <el-table-column :label="$t('已核销比例')" prop="writeOffScale"></el-table-column>
              <el-table-column :label="$t('实收日期')">
332784038@qq.com's avatar
332784038@qq.com committed
423
                <template v-slot="{ row }">
424
                  {{ parseTime(row.writeOffAt) }}
lanbaoming's avatar
lanbaoming committed
425 426 427 428
                </template>
              </el-table-column>
              <el-table-column :label="$t('业务员')" prop="salesmanName"></el-table-column>
            </el-table>
332784038@qq.com's avatar
332784038@qq.com committed
429
            <pagination v-show="infoListReceiptList.length" :total="infoListReceiptTotal" :page.sync="infoListReceiptFrom.pageNo" :limit.sync="infoListReceiptFrom.pageSize" @pagination="infoListReceiptFn" />
lanbaoming's avatar
lanbaoming committed
430
          </el-tab-pane>
yujinyao's avatar
yujinyao committed
431
          <el-tab-pane name="empower" :label="$t('品牌授权')">
332784038@qq.com's avatar
332784038@qq.com committed
432
            <el-table border style="width: 100%" :data="brandAuthorizationList">
433 434
              <el-table-column type="index" :prop="$t('序号')"></el-table-column>
              <el-table-column :label="$t('中文标题')" prop="titleZh"></el-table-column>
yujinyao's avatar
yujinyao committed
435 436
              <el-table-column prop="titleEn" :label="$t('英文标题')"></el-table-column>
              <el-table-column :label="$t('有无备案')">
332784038@qq.com's avatar
332784038@qq.com committed
437 438
                <template v-slot="{ row }">
                  <dict-tag :type="DICT_TYPE.BRAND_REG_TYPE" :value="row.filing" />
439
                </template>
yujinyao's avatar
yujinyao committed
440 441
              </el-table-column>
              <el-table-column :label="$t('授权开始')">
332784038@qq.com's avatar
332784038@qq.com committed
442
                <template v-slot="{ row }">
443
                  {{ parseTime(row.startTime) }}
yujinyao's avatar
yujinyao committed
444 445 446
                </template>
              </el-table-column>
              <el-table-column :label="$t('授权结束')">
332784038@qq.com's avatar
332784038@qq.com committed
447
                <template v-slot="{ row }">
448
                  {{ parseTime(row.endTime) }}
yujinyao's avatar
yujinyao committed
449 450 451
                </template>
              </el-table-column>
              <el-table-column :label="$t('授权证明')">
332784038@qq.com's avatar
332784038@qq.com committed
452
                <template v-slot="{ row }">
yujinyao's avatar
yujinyao committed
453
                  <div v-if="!!row.fileUrl && row.fileUrl.length > 0">
332784038@qq.com's avatar
332784038@qq.com committed
454 455 456 457
                    <span v-for="(item, index) in (row.fileUrl || '').split(',')">
                      <a :href="item" target="_blank">{{ $t("附件") }}{{ index + 1 }}</a
                      >,
                    </span>
yujinyao's avatar
yujinyao committed
458 459 460
                  </div>
                </template>
              </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
461 462
              <el-table-column prop="feeScale" :formatter="(row) => getDictDataLabel(DICT_TYPE.BRAND_CUSTOMER_CHARGING_MODEL, row.feeScale)" :label="$t('收费标准')"> </el-table-column>
              <el-table-column prop="createUsername" :label="$t('添加人')"> </el-table-column>
yujinyao's avatar
yujinyao committed
463
              <el-table-column :label="$t('创建时间')">
332784038@qq.com's avatar
332784038@qq.com committed
464
                <template v-slot="{ row }">
465
                  {{ parseTime(row.createTime) }}
yujinyao's avatar
yujinyao committed
466 467 468
                </template>
              </el-table-column>
            </el-table>
332784038@qq.com's avatar
332784038@qq.com committed
469
            <pagination v-show="brandAuthorizationTotal.length" :total="brandAuthorizationTotal" :page.sync="brandAuthorizationFrom.pageNo" :limit.sync="brandAuthorizationFrom.pageSize" @pagination="getBrankByCustomerList" />
yujinyao's avatar
yujinyao committed
470
          </el-tab-pane>
yujinyao's avatar
yujinyao committed
471
          <el-tab-pane name="deliver" :label="$t('发货评估')">
lanbaoming's avatar
lanbaoming committed
472
            <el-descriptions :column="2">
473
              <el-descriptions-item :label="$t('客户类别')">
332784038@qq.com's avatar
332784038@qq.com committed
474 475 476 477 478
                {{
                  getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (customer.type || "").split(","))
                    .map((e) => (isChinese ? e.label : e.labelEn))
                    .join(", ")
                }}
479
              </el-descriptions-item>
yujinyao's avatar
yujinyao committed
480
              <el-descriptions-item :label="$t('角色')">
332784038@qq.com's avatar
332784038@qq.com committed
481 482 483 484 485
                {{
                  getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (customer.roles || "").split(","))
                    .map((e) => (isChinese ? e.label : e.labelEn))
                    .join(", ")
                }}
yujinyao's avatar
yujinyao committed
486
              </el-descriptions-item>
487
              <el-descriptions-item :label="$t('出货渠道')">
488
                {{
332784038@qq.com's avatar
332784038@qq.com committed
489 490 491
                  getDictDatas2(DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE, (customer.transportType || "").split(","))
                    .map((e) => (isChinese ? e.label : e.labelEn))
                    .join(", ")
492 493 494
                }}
                <!--              <dict-tag v-if="customer.transportType" v-for="item in (customer.transportType || '').split(',')" :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" :value="item"></dict-tag>-->
              </el-descriptions-item>
332784038@qq.com's avatar
332784038@qq.com committed
495
              <el-descriptions-item :label="$t('常提货网点')">{{ $l(customer, "pickupPointName") }} </el-descriptions-item>
yujinyao's avatar
yujinyao committed
496
              <el-descriptions-item :label="$t('业务国家')">
497
                {{ isChinese ? customer.busiCountryNameZh : customer.busiCountryNameEn }}
yujinyao's avatar
yujinyao committed
498
              </el-descriptions-item>
zs嵩's avatar
zs嵩 committed
499 500 501 502 503 504 505
              <el-descriptions-item :label="$t('主营类别')">
                <div>
                  <div v-for="(item, index) in productTypeName" :key="index">
                    <b>{{ $l(item, "title") }}:</b><span>{{ item.productList || "-" }}</span>
                  </div>
                </div>
              </el-descriptions-item>
yujinyao's avatar
yujinyao committed
506
              <el-descriptions-item :label="$t('年度发货量')">{{ customer.weightYearly }}</el-descriptions-item>
507
              <el-descriptions-item :label="$t('主要竞争对手')">{{ customer.competitorNames }}</el-descriptions-item>
yujinyao's avatar
yujinyao committed
508
              <el-descriptions-item :label="$t('年度发货次数')">{{ customer.numYearly }}</el-descriptions-item>
lanbaoming's avatar
lanbaoming committed
509 510
            </el-descriptions>
          </el-tab-pane>
yujinyao's avatar
yujinyao committed
511
          <el-tab-pane name="financial" :label="$t('财务资料')">
512
            <el-card class="box-card">
332784038@qq.com's avatar
332784038@qq.com committed
513
              <div slot="header">{{ $t("公司信息") }}</div>
余金瑶's avatar
余金瑶 committed
514 515 516
              <el-descriptions :column="2">
                <el-descriptions-item :label="$t('公司名称')">{{ customer.company }}</el-descriptions-item>
                <el-descriptions-item :label="$t('公司英文名称')">{{ customer.companyEn }}</el-descriptions-item>
517 518 519 520 521 522 523 524 525 526
                <el-descriptions-item v-if="permissions.includes('ecw:customer:query-card')" :label="$t('身份证号码')">
                  {{ customer.carNo }}
                </el-descriptions-item>
                <el-descriptions-item v-if="permissions.includes('ecw:customer:query-card')" :label="$t('身份证姓名')">
                  {{ customer.carName }}
                </el-descriptions-item>
                <el-descriptions-item :label="$t('结算方式')">
                  {{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}
                </el-descriptions-item>
                <el-descriptions-item :label="$t('付款人姓名')">{{ customer.payerName }}</el-descriptions-item>
余金瑶's avatar
余金瑶 committed
527 528
              </el-descriptions>
            </el-card>
332784038@qq.com's avatar
332784038@qq.com committed
529 530
            <el-card class="box-card" style="margin-top: 15px">
              <div slot="header">{{ $t("开票信息") }}</div>
531 532 533 534 535 536
              <el-descriptions :column="2">
                <el-descriptions-item :label="$t('发票抬头')">{{ customer.invoiceTitle }}</el-descriptions-item>
                <el-descriptions-item :label="$t('纳税人识别号')">{{ customer.licenseNumber }}</el-descriptions-item>
                <el-descriptions-item :label="$t('开户行')">{{ customer.bank }}</el-descriptions-item>
                <el-descriptions-item :label="$t('账户')">{{ customer.bankNumber }}</el-descriptions-item>
                <el-descriptions-item :label="$t('项目')">{{ customer.project }}</el-descriptions-item>
537 538 539
                <el-descriptions-item :label="$t('开票地址')">{{ customer.billingAddress }}</el-descriptions-item>
                <el-descriptions-item :label="$t('开票电话')">{{ customer.billingTell }}</el-descriptions-item>
                <el-descriptions-item :label="$t('税率')">{{ customer.taxRate }}</el-descriptions-item>
540 541
              </el-descriptions>
            </el-card>
332784038@qq.com's avatar
332784038@qq.com committed
542 543
            <el-card style="margin-top: 15px">
              <div slot="header">{{ $t("银行账户") }}</div>
yujinyao's avatar
yujinyao committed
544 545 546 547
              <el-table :data="customer.customerBankBackVOList" border>
                <el-table-column :label="$t('编号')" type="index"></el-table-column>
                <el-table-column :label="$t('账户名称')" prop="accountName"></el-table-column>
                <el-table-column :label="$t('币别')">
332784038@qq.com's avatar
332784038@qq.com committed
548 549 550 551 552 553 554
                  <template v-slot="{ row }">
                    {{
                      $l(
                        currecyList.find((i) => row.currency == i.id),
                        "title"
                      )
                    }}
yujinyao's avatar
yujinyao committed
555 556 557 558 559 560
                  </template>
                </el-table-column>
                <el-table-column :label="$t('银行名称')" prop="bankName"></el-table-column>
                <el-table-column :label="$t('银行账户')" prop="bankAccount"></el-table-column>
                <el-table-column :label="$t('银行代码')" prop="bankCode"></el-table-column>
                <el-table-column :label="$t('账户类型')">
332784038@qq.com's avatar
332784038@qq.com committed
561 562
                  <template v-slot="{ row }">
                    {{ Number(row.accountType) === 1 ? $t("公账") : $t("私账") }}
yujinyao's avatar
yujinyao committed
563 564 565
                  </template>
                </el-table-column>
                <el-table-column :label="$t('状态')">
332784038@qq.com's avatar
332784038@qq.com committed
566 567
                  <template v-slot="{ row }">
                    {{ row.status ? $t("正常") : $t("停用") }}
568
                  </template>
yujinyao's avatar
yujinyao committed
569 570 571 572
                </el-table-column>
                <el-table-column :label="$t('银行地址')" prop="bankAddress"></el-table-column>
              </el-table>
            </el-card>
573
          </el-tab-pane>
余金瑶's avatar
余金瑶 committed
574

yujinyao's avatar
yujinyao committed
575
          <el-tab-pane name="special" :label="$t('特殊设置')">
576 577
            <el-descriptions :column="2">
              <el-descriptions-item :label="$t('是否显示提单价格')">
332784038@qq.com's avatar
332784038@qq.com committed
578
                <el-switch v-model="customer.isShowTidanPrice" disabled />
579
              </el-descriptions-item>
580
              <el-descriptions-item :label="$t('到仓确认')">
332784038@qq.com's avatar
332784038@qq.com committed
581
                <el-switch v-model="customer.arrivalConfirm" :active-value="1" :inactive-value="0" disabled />
582
              </el-descriptions-item>
332784038@qq.com's avatar
332784038@qq.com committed
583
              <el-descriptions-item :label="$t('重货标准')">{{ customer.weightUnit ? `${customer.weightUnit}kg/cbm` : "" }} </el-descriptions-item>
584
              <el-descriptions-item :label="$t('泡货标准')">
332784038@qq.com's avatar
332784038@qq.com committed
585
                {{ customer.lightUnit ? `${customer.lightUnit}kg/cbm` : "" }}
586
              </el-descriptions-item>
zhengyi's avatar
zhengyi committed
587
              <el-descriptions-item :label="$t('控货无收货人')">
332784038@qq.com's avatar
332784038@qq.com committed
588
                <el-switch v-model="customer.noConsignee" disabled />
yujinyao's avatar
yujinyao committed
589 590
              </el-descriptions-item>
              <el-descriptions-item :label="$t('默认付款')">
332784038@qq.com's avatar
332784038@qq.com committed
591
                <el-switch v-model="customer.defaultPay" disabled />
yujinyao's avatar
yujinyao committed
592 593
              </el-descriptions-item>
              <el-descriptions-item :label="$t('默认开票')">
332784038@qq.com's avatar
332784038@qq.com committed
594
                <el-switch v-model="customer.defaultBilling" disabled />
yujinyao's avatar
yujinyao committed
595
              </el-descriptions-item>
596 597
            </el-descriptions>
          </el-tab-pane>
lanbaoming's avatar
lanbaoming committed
598 599 600
          <el-tab-pane name="credit" :label="$t('信用日志')">
            <el-card class="box-card">
              <div slot="header" class="clearfix">
332784038@qq.com's avatar
332784038@qq.com committed
601
                <el-button style="float: right" type="primary" @click="dialogVisible = true">{{ $t("添加信用日志") }} </el-button>
lanbaoming's avatar
lanbaoming committed
602
                <el-descriptions :column="5" border>
332784038@qq.com's avatar
332784038@qq.com committed
603
                  <el-descriptions-item v-for="(item, index) in creditScoreStatisticObj" :key="index" :label="creditScoreCalculation(item.type)">{{ item.score }} </el-descriptions-item>
lanbaoming's avatar
lanbaoming committed
604 605 606 607
                </el-descriptions>
              </div>
              <el-table :data="customerCreditLogList">
                <el-table-column :label="$t('序号')" type="index"></el-table-column>
608
                <el-table-column :label="$t('规则名称')">
332784038@qq.com's avatar
332784038@qq.com committed
609
                  <template v-slot="{ row }">
610
                    {{ isChinese ? row.name : row.nameEn }}
lanbaoming's avatar
lanbaoming committed
611 612 613
                  </template>
                </el-table-column>
                <el-table-column prop="type" :label="$t('规则分类')">
332784038@qq.com's avatar
332784038@qq.com committed
614 615
                  <template v-slot="{ row }">
                    <dict-tag :type="DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE" :value="row.type" />
lanbaoming's avatar
lanbaoming committed
616 617 618 619 620 621
                  </template>
                </el-table-column>
                <el-table-column prop="score" :label="$t('规则得分')"></el-table-column>
                <el-table-column prop="remark" :label="$t('备注')"></el-table-column>
                <el-table-column :label="$t('添加人')" prop="createName"></el-table-column>
                <el-table-column :label="$t('时间')">
332784038@qq.com's avatar
332784038@qq.com committed
622
                  <template v-slot="{ row }">
623
                    {{ parseTime(row.createTime) }}
lanbaoming's avatar
lanbaoming committed
624 625 626
                  </template>
                </el-table-column>
              </el-table>
332784038@qq.com's avatar
332784038@qq.com committed
627
              <pagination @pagination="creditLogPage" :page.sync="customerCreditLogFrom.pageNo" :limit.sync="customerCreditLogFrom.pageSize" :total="customerCreditLogFrom.total"></pagination>
lanbaoming's avatar
lanbaoming committed
628 629 630
            </el-card>
          </el-tab-pane>
          <el-tab-pane name="grade" :label="$t('等级日志')">
631 632 633 634
            <el-table style="width: 100%" :data="getCustomerGradeList">
              <el-table-column :label="$t('序号')" type="index"></el-table-column>
              <el-table-column :label="$t('规则名称')" prop="name"></el-table-column>
              <el-table-column :label="$t('规则分类')" prop="type">
332784038@qq.com's avatar
332784038@qq.com committed
635 636
                <template v-slot="{ row }">
                  <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL_RULE_TYPE" :value="row.type" />
637 638 639 640 641
                </template>
              </el-table-column>
              <el-table-column :label="$t('规则得分')" prop="score"></el-table-column>
              <el-table-column :label="$t('备注')" prop="remark"></el-table-column>
              <el-table-column :label="$t('时间')">
332784038@qq.com's avatar
332784038@qq.com committed
642
                <template v-slot="{ row }">
643 644 645 646
                  {{ parseTime(row.createTime) }}
                </template>
              </el-table-column>
            </el-table>
332784038@qq.com's avatar
332784038@qq.com committed
647
            <pagination @pagination="getCustomerGrade" :page.sync="getCustomerGradeFrom.pageNo" :limit.sync="getCustomerGradeFrom.pageSize" :total="getCustomerGradeFrom.total"></pagination>
lanbaoming's avatar
lanbaoming committed
648
          </el-tab-pane>
649 650
          <el-tab-pane name="operationLog" v-if="checkPermi(['customer:operate-log:query'])" :label="$t('操作日志')">
            <customer-log :customerId="id" v-if="'operationLog' === activeName"></customer-log>
lanbaoming's avatar
lanbaoming committed
651 652 653 654
          </el-tab-pane>
        </el-tabs>
      </el-col>
    </el-row>
332784038@qq.com's avatar
332784038@qq.com committed
655 656
    <el-dialog :visible.sync="dialogVisible" width="30%">
      <h1 slot="title">{{ $t("给客户") }}【{{ customer.name }}】{{ $t("添加信用日志") }}</h1>
lanbaoming's avatar
lanbaoming committed
657
      <el-form label-width="100">
658
        <el-form-item :label="$t('客户编号:')">{{ customer.number }}</el-form-item>
lanbaoming's avatar
lanbaoming committed
659 660
        <el-form-item :label="$t('信用类别')">
          <el-select v-model="creditFrom.ruleId">
332784038@qq.com's avatar
332784038@qq.com committed
661
            <el-option v-for="(item, index) in creditTypeList" :key="index" :value="item.id" :label="isChinese ? item.name : item.nameEn"></el-option>
lanbaoming's avatar
lanbaoming committed
662 663
          </el-select>
        </el-form-item>
332784038@qq.com's avatar
332784038@qq.com committed
664
        <el-form-item v-if="creditTypeList.length > 0" :label="$t('信用分')"> {{ (creditTypeList.find((r) => creditFrom.ruleId === r.id) || {}).score }}{{ $t("分") }} </el-form-item>
lanbaoming's avatar
lanbaoming committed
665
        <el-form-item :label="$t('备注')">
666
          <el-input type="textarea" v-model="creditFrom.remark"></el-input>
lanbaoming's avatar
lanbaoming committed
667 668
        </el-form-item>
      </el-form>
669
      <div slot="footer" class="dialog-footer">
332784038@qq.com's avatar
332784038@qq.com committed
670 671
        <el-button @click="submit">{{ $t("提交") }}</el-button>
        <el-button @click="dialogVisible = false">{{ $t("取消") }}</el-button>
672
      </div>
lanbaoming's avatar
lanbaoming committed
673
    </el-dialog>
yujinyao's avatar
yujinyao committed
674

zs嵩's avatar
zs嵩 committed
675
    <customer-follow ref="customerFollow" v-if="customerFollowVisible" @close="customerFollowVisible = false" :customer-id="id" :customer-service="customer.customerService" :customer-number="customer.number" @refresh="logListCommonRefresh" />
lanbaoming's avatar
lanbaoming committed
676 677 678 679
  </div>
</template>

<script>
zs嵩's avatar
zs嵩 committed
680
import { getCustomer, getCustomerSelect, getBrankByCustomer, levelLogPage, customerCreditLogPage, infoListOrderPage, orderStatistics, creditLogCreate, creditScoreStatistic, infoListReceiptPage, memberUserList, deleteCustomer, infoListStatisticsOrder } from "@/api/ecw/customer"
332784038@qq.com's avatar
332784038@qq.com committed
681 682 683 684
import { getOfferPage as infoListOfferPage } from "@/api/ecw/offer"
import { DICT_TYPE, getDictDataLabel, getDictDatas2 } from "@/utils/dict"
import { getProductTypeList } from "@/api/ecw/productType"
import { getNodeList } from "@/api/ecw/node"
yujinyao's avatar
yujinyao committed
685
import CustomerFollow from "./components/customerFollow"
332784038@qq.com's avatar
332784038@qq.com committed
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700
import { parseTime } from "@/utils/ruoyi"
import CustomerComplaint from "@/views/ecw/customerComplaint"
import { listServiceUser, getUserProfile } from "@/api/system/user"
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import { getOrderPage, getRegionList } from "@/api/ecw/order"
import Template from "@/views/cms/template"
import { getCreditRulePage } from "@/api/customer/creditRule"
import { getCountry } from "@/api/ecw/country"
import { getCurrencyList } from "@/api/ecw/currency"
import customerLog from "@/views/ecw/customer/customerLog.vue"
import { checkPermi } from "@/utils/permission"
import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue"
import { getListTree } from "@/api/ecw/region"
import { getWarehouseList } from "@/api/ecw/warehouse"
import { deleteOffer, cancel, recovery } from "@/api/ecw/offer"
701 702

import logListCommon from "@/views/ecw/offer/logListCommon"
1483922988@qq.com's avatar
1483922988@qq.com committed
703 704 705
import { getTradeCityList } from "@/api/ecw/region"

import UserSelector from "@/components/UserSelector"
706

lanbaoming's avatar
lanbaoming committed
707
export default {
332784038@qq.com's avatar
332784038@qq.com committed
708
  name: "query",
lanbaoming's avatar
lanbaoming committed
709
  components: {
1483922988@qq.com's avatar
1483922988@qq.com committed
710
    UserSelector,
lanbaoming's avatar
lanbaoming committed
711 712 713 714
    ImageDisplay,
    Template,
    CustomerFollow,
    CustomerComplaint,
715 716
    customerLog,
    logListCommon
lanbaoming's avatar
lanbaoming committed
717 718 719
  },
  created() {
    // 获取币种
332784038@qq.com's avatar
332784038@qq.com committed
720 721
    getCurrencyList().then((response) => {
      this.currecyList = response.data
lanbaoming's avatar
lanbaoming committed
722
    })
723 724 725 726 727
    getWarehouseList().then((res) => {
      this.tradeCityList = res.data
      this.warehouseList = res.data
    })
    // getTradeCityList().then((res) => (this.tradeCityList = res.data))
lanbaoming's avatar
lanbaoming committed
728
    //获取信用类型
332784038@qq.com's avatar
332784038@qq.com committed
729
    getCreditRulePage({ page: 1, rows: 999, type: 2 }).then((r) => {
730
      this.creditTypeList = r.data.list
lanbaoming's avatar
lanbaoming committed
731 732 733 734
    })
    // getNodeList().then(r => {
    //   this.nodeList = r.data
    // })
332784038@qq.com's avatar
332784038@qq.com committed
735 736 737
    getCustomer(this.id).then((response) => {
      this.customer = { ...this.customer, ...response.data }
      console.log(this.customer, "this.customer")
lanbaoming's avatar
lanbaoming committed
738

332784038@qq.com's avatar
332784038@qq.com committed
739
      getCustomerContactsListByCustomer({ customerId: this.id }).then((r) => {
lanbaoming's avatar
lanbaoming committed
740
        this.customerContacts = r.data
741
        if (this.customerContacts.length > 0) {
332784038@qq.com's avatar
332784038@qq.com committed
742
          const contacts = this.customerContacts.findIndex((contacts) => contacts.isDefault === 1)
743
          if (contacts.isDefault === 1) {
332784038@qq.com's avatar
332784038@qq.com committed
744 745 746 747 748
            this.customer.defaultContactName = this.isChinese ? contacts.nameZh : contacts.nameEn
            this.customer.defaultContactId = contacts.id
            this.customer.defaultContactPhone = contacts.phoneNew
            this.customer.defaultCountryCode = contacts.areaCode
            this.customer.defaultEmail = contacts.email
749
          }
332784038@qq.com's avatar
332784038@qq.com committed
750
          let list = this.customerContacts.filter((r) => r.userid)
751
          if (list.length > 0) {
332784038@qq.com's avatar
332784038@qq.com committed
752
            memberUserList({ ids: list.map((i) => i.userid).join(",") }).then((r) => {
753 754 755
              this.memberList = r.data
            })
          }
lanbaoming's avatar
lanbaoming committed
756 757 758 759 760 761 762 763 764 765 766
        }
      })
    })

    // getCustomerSelect({pageSize:1000,pageNo:1}).then(r => {
    //   this.customerSelect = r.data.list
    // })

    // this.getBrankByCustomerList()//品牌授权
    // this.getCustomerGrade()
    // this.creditLogPage()//等级日志
332784038@qq.com's avatar
332784038@qq.com committed
767
    this.getorderList() //订单
lanbaoming's avatar
lanbaoming committed
768
    // this.getInfoListOfferPage()//报价
332784038@qq.com's avatar
332784038@qq.com committed
769
    this.getOrderStatistics() //数据
lanbaoming's avatar
lanbaoming committed
770 771
    // this.creditScoreStatisticFn() //信用日志
    // this.infoListReceiptFn()//账单
772
    this.getData()
773
    this.getWarehouseList()
774
    this.getUserProfile()
lanbaoming's avatar
lanbaoming committed
775
  },
776 777
  watch: {
    activeName(val) {
lanbaoming's avatar
lanbaoming committed
778
      switch (val) {
332784038@qq.com's avatar
332784038@qq.com committed
779 780 781 782 783
        case "order":
          this.destCountryId = ""
          this.destWarehouseId = ""
          this.objectiveId = ""
          this.getorderList() //订单
lanbaoming's avatar
lanbaoming committed
784
          break
332784038@qq.com's avatar
332784038@qq.com committed
785 786 787 788 789
        case "quote":
          this.destCountryId = ""
          this.destWarehouseId = ""
          this.objectiveId = ""
          this.getInfoListOfferPage() //报价
lanbaoming's avatar
lanbaoming committed
790
          break
332784038@qq.com's avatar
332784038@qq.com committed
791 792 793
        case "follow":
        case "bill":
          this.infoListReceiptFn() //账单
lanbaoming's avatar
lanbaoming committed
794
          break
332784038@qq.com's avatar
332784038@qq.com committed
795 796
        case "data":
          this.getOrderStatistics() //数据
lanbaoming's avatar
lanbaoming committed
797
          break
332784038@qq.com's avatar
332784038@qq.com committed
798 799
        case "empower":
          this.getBrankByCustomerList() //品牌授权
lanbaoming's avatar
lanbaoming committed
800
          break
332784038@qq.com's avatar
332784038@qq.com committed
801
        case "credit":
lanbaoming's avatar
lanbaoming committed
802 803 804
          this.creditScoreStatisticFn() //信用日志
          this.creditLogPage()
          break
332784038@qq.com's avatar
332784038@qq.com committed
805
        case "grade":
lanbaoming's avatar
lanbaoming committed
806 807 808 809
          this.getCustomerGrade()
          //等级日志
          break
      }
810 811 812 813 814 815
    },
    destCountryId: {
      //监听当前地区值的变化,于与上方地区值进行了双向绑定
      deep: true, //深度监听
      handler() {
        //每当值省份值改变时其下地区值进行清空
332784038@qq.com's avatar
332784038@qq.com committed
816 817 818 819
        this.AddressCity = []
        this.AddressTown = []
        this.objectiveId = ""
        this.destWarehouseId = ""
余金瑶's avatar
余金瑶 committed
820

821
        if (this.destCountryId == "") {
822 823
          this.getAddressCity()
          this.getAddressTown()
332784038@qq.com's avatar
332784038@qq.com committed
824
        } else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
825 826
          this.findByprovinceCode()
          this.getAddressTown()
827
        }
332784038@qq.com's avatar
332784038@qq.com committed
828
      }
829
    },
yujinyao's avatar
yujinyao committed
830 831
    objectiveId: {
      deep: true, //深度监听
832
      handler() {
332784038@qq.com's avatar
332784038@qq.com committed
833 834
        this.AddressTown = []
        this.destWarehouseId = ""
835
        this.findBycityCode()
332784038@qq.com's avatar
332784038@qq.com committed
836
        if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
837
          //获取当前城市值id,获取该城市下区域
332784038@qq.com's avatar
332784038@qq.com committed
838
        } else if (this.destCountryId == "" && this.objectiveId == "" && this.destWarehouseId == "") {
839
          this.getAddressTown()
332784038@qq.com's avatar
332784038@qq.com committed
840
        } else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
yujinyao's avatar
yujinyao committed
841
          this.findByprovinceCode()
842
          this.getAddressTown()
843
        }
332784038@qq.com's avatar
332784038@qq.com committed
844
      }
845 846 847 848
    },
    destWarehouseId: {
      deep: true, //深度监听
      handler() {
332784038@qq.com's avatar
332784038@qq.com committed
849
        if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
850
          //获取当前城市值id,获取该城市下区域
851
          this.findBycityCode()
332784038@qq.com's avatar
332784038@qq.com committed
852
        } else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
853
          this.getAddressTown()
854
        }
332784038@qq.com's avatar
332784038@qq.com committed
855 856
      }
    }
lanbaoming's avatar
lanbaoming committed
857 858 859
  },
  data() {
    return {
1483922988@qq.com's avatar
1483922988@qq.com committed
860
      tradeCityList: [],
861
      warehouseList: [],
1483922988@qq.com's avatar
1483922988@qq.com committed
862 863 864
      queryTmp: {
        createTime: ["", ""]
      },
332784038@qq.com's avatar
332784038@qq.com committed
865
      activeName: "order",
866 867
      currecyList: [],
      STATUS: {
332784038@qq.com's avatar
332784038@qq.com committed
868 869 870 871 872 873 874 875
        0: this.$t("取消报价"),
        1: this.$t("特价审批中"),
        2: this.$t("需求确认"),
        3: this.$t("跟进中"),
        4: this.$t("赢单"),
        5: this.$t("输单"),
        6: this.$t("报价完成"),
        7: this.$t("跟进中")
lanbaoming's avatar
lanbaoming committed
876
      },
877
      dialogVisible: false,
lanbaoming's avatar
lanbaoming committed
878 879 880 881 882 883 884 885 886 887
      DICT_TYPE,
      getDictDataLabel,
      getDictDatas2,
      parseTime,
      nodeList: [],
      productTypeList: [],
      customerSelect: [],
      serviceUserList: [],
      customerContacts: [],
      memberList: [],
888
      relation: 1,
lanbaoming's avatar
lanbaoming committed
889 890 891 892 893 894 895 896 897 898
      customer: {
        id: undefined,
        number: undefined,
        name: undefined,
        level: undefined,
        country: undefined,
        type: undefined,
        agentId: undefined,
        company: undefined,
        address: undefined,
899 900
        productTypes: undefined,
        productIds: undefined,
lanbaoming's avatar
lanbaoming committed
901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923
        pickupPoint: undefined,
        memberId: undefined,
        birthday: undefined,
        balance: undefined,
        source: undefined,
        picture: undefined,
        customerService: undefined,
        customerLines: [],
        promoter: undefined,
        status: undefined,
        founder: undefined,
        department: undefined,
        invoiceTitle: undefined,
        licenseNumber: undefined,
        bank: undefined,
        bankNumber: undefined,
        project: undefined,
        billingAddress: undefined,
        billingTell: undefined,
        taxRate: undefined,
        remarks: undefined,
        arrivalConfirm: undefined,
        weightUnit: undefined,
zs嵩's avatar
zs嵩 committed
924 925
        createTime: undefined,
        productTypeList: []
lanbaoming's avatar
lanbaoming committed
926
      },
927 928
      brandAuthorizationFrom: {
        pageNo: 1,
332784038@qq.com's avatar
332784038@qq.com committed
929
        pageSize: 10
lanbaoming's avatar
lanbaoming committed
930
      },
931 932 933 934 935 936
      brandAuthorizationList: [],
      brandAuthorizationTotal: 0,
      getCustomerGradeFrom: {
        pageNo: 1,
        pageSize: 10,
        total: 0
937
      },
938 939 940 941 942
      getCustomerGradeList: [],
      customerCreditLogFrom: {
        pageNo: 1,
        pageSize: 10,
        total: 0
lanbaoming's avatar
lanbaoming committed
943
      },
944 945 946 947 948
      customerCreditLogList: [],
      rucangtime: [],
      queryParams: {
        rows: 10,
        page: 1
lanbaoming's avatar
lanbaoming committed
949
      },
1483922988@qq.com's avatar
1483922988@qq.com committed
950 951 952 953 954
      queryOfferParams: {
        salesmanIds: [],
        statusList: [],
        importances: []
      },
955
      orderList: [],
956
      statisticsOrder: {},
957 958 959
      orderTotal: 0,
      infoListOfferFrom: {
        pageNo: 1,
332784038@qq.com's avatar
332784038@qq.com committed
960
        pageSize: 10
lanbaoming's avatar
lanbaoming committed
961
      },
962 963 964 965
      infoListOfferTotal: 0,
      infoListOfferList: [],
      orderStatisticsObj: {},
      creditTypeList: [],
332784038@qq.com's avatar
332784038@qq.com committed
966
      creditFrom: {}, //添加信用 日志
967 968 969 970
      creditScoreStatisticObj: [],
      infoListReceiptList: [],
      infoListReceiptFrom: {
        pageNo: 1,
332784038@qq.com's avatar
332784038@qq.com committed
971
        pageSize: 10
lanbaoming's avatar
lanbaoming committed
972
      },
973
      infoListReceiptTotal: 0,
332784038@qq.com's avatar
332784038@qq.com committed
974
      country: "",
975
      showMore: false,
yujinyao's avatar
yujinyao committed
976 977 978
      AddressCity: [],
      AddressProvince: [],
      AddressTown: [],
979 980 981
      destCountryId: null,
      objectiveId: null,
      destWarehouseId: null,
余金瑶's avatar
余金瑶 committed
982
      customerFollowVisible: false,
yujinyao's avatar
yujinyao committed
983
      nextTime: [],
yujinyao's avatar
yujinyao committed
984
      currencyList: [],
332784038@qq.com's avatar
332784038@qq.com committed
985
      userId: undefined
lanbaoming's avatar
lanbaoming committed
986 987 988
    }
  },
  computed: {
zs嵩's avatar
zs嵩 committed
989 990 991 992 993 994 995 996 997 998 999
    productTypeName() {
      return this.customer.productTypeList.map((item) => {
        return {
          ...item,
          productList: this.customer.productList
            .filter((i) => i.typeId === item.id)
            .map((i) => this.$l(i, "title"))
            .join("")
        }
      })
    },
1483922988@qq.com's avatar
1483922988@qq.com committed
1000 1001 1002
    exportCityList() {
      return this.tradeCityList.filter((item) => item.type == 2)
    },
1003 1004 1005 1006
    exportWarehouseList() {
      /* tradeType 1 进口,2出口,3进出口 */
      return this.warehouseList.filter((item) => item.tradeType == 2 || item.tradeType == 3)
    },
1007
    permissions() {
lanbaoming's avatar
lanbaoming committed
1008 1009
      return this.$store.state.user.permissions
    },
1010
    customerId() {
332784038@qq.com's avatar
332784038@qq.com committed
1011
      return this.$route.params.customerId
lanbaoming's avatar
lanbaoming committed
1012
    },
1013
    isChinese() {
332784038@qq.com's avatar
332784038@qq.com committed
1014
      return this.$i18n.locale === "zh_CN"
lanbaoming's avatar
lanbaoming committed
1015
    },
1016
    pickupPoint() {
332784038@qq.com's avatar
332784038@qq.com committed
1017 1018
      const pickupPoint = this.nodeList.find((p) => p.id === parseInt(this.customer.pickupPoint))
      return pickupPoint ? pickupPoint.titleZh : ""
lanbaoming's avatar
lanbaoming committed
1019 1020 1021 1022 1023 1024 1025 1026
    },
    // promoter() {
    //   return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
    // },

    id() {
      return parseInt(this.$route.params.customerId)
    },
1027 1028
    creditScoreCalculation() {
      return (val) => {
332784038@qq.com's avatar
332784038@qq.com committed
1029 1030
        if (val === "all") {
          return this.$t("信用分")
1031
        } else {
332784038@qq.com's avatar
332784038@qq.com committed
1032 1033
          if (this.isChinese) return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find((i) => i.value === val) || {}).label
          else return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find((i) => i.value === val) || {}).labelEn
lanbaoming's avatar
lanbaoming committed
1034 1035
        }
      }
yujinyao's avatar
yujinyao committed
1036
    },
1037
    currencyMap() {
yujinyao's avatar
yujinyao committed
1038
      let map = {}
332784038@qq.com's avatar
332784038@qq.com committed
1039 1040
      this.currencyList.forEach((item) => {
        map[item.id] = this.$l(item, "title")
yujinyao's avatar
yujinyao committed
1041 1042
      })
      return map
332784038@qq.com's avatar
332784038@qq.com committed
1043
    }
lanbaoming's avatar
lanbaoming committed
1044
  },
yujinyao's avatar
yujinyao committed
1045 1046
  filters: {
    deliveryRate(pickNum, sumNum) {
余金瑶's avatar
余金瑶 committed
1047
      if (pickNum == 0 || sumNum == 0) {
yujinyao's avatar
yujinyao committed
1048 1049
        return 0
      } else if (pickNum && sumNum) {
332784038@qq.com's avatar
332784038@qq.com committed
1050
        return Math.round((pickNum / sumNum) * 10000) / 100 + "%"
yujinyao's avatar
yujinyao committed
1051 1052 1053 1054
      }
      return null
    }
  },
1055
  methods: {
1056 1057
    getUserProfile() {
      getUserProfile().then((res) => {
332784038@qq.com's avatar
332784038@qq.com committed
1058
        this.userId = res.data.id
1059 1060
      })
    },
1061
    customerFollowFn(val) {
lanbaoming's avatar
lanbaoming committed
1062
      this.activeName = val
1063
      this.$nextTick(() => {
332784038@qq.com's avatar
332784038@qq.com committed
1064
        if (val === "follow") {
yujinyao's avatar
yujinyao committed
1065
          this.customerFollowVisible = true
332784038@qq.com's avatar
332784038@qq.com committed
1066 1067
          this.$nextTick((_) => {
            this.$refs["customerFollow"].handleAdd()
yujinyao's avatar
yujinyao committed
1068
          })
yujinyao's avatar
yujinyao committed
1069
        } else {
332784038@qq.com's avatar
332784038@qq.com committed
1070
          this.$refs["customerComplaint"].handleAdd()
lanbaoming's avatar
lanbaoming committed
1071 1072 1073
        }
      })
    },
1074
    quote() {
1075 1076
      const row = this.customer
      if (row.customerService != this.userId) {
332784038@qq.com's avatar
332784038@qq.com committed
1077 1078
        this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"))
        return
1079
      }
332784038@qq.com's avatar
332784038@qq.com committed
1080 1081

      this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } })
1082
    },
lanbaoming's avatar
lanbaoming committed
1083
    checkPermi,
1084
    userIdFormatter(row, column, cellValue) {
332784038@qq.com's avatar
332784038@qq.com committed
1085
      const member = this.memberList.find((e) => e.id === cellValue)
lanbaoming's avatar
lanbaoming committed
1086
      if (member) {
332784038@qq.com's avatar
332784038@qq.com committed
1087
        return member.nickname + "(" + member.mobile + ")"
lanbaoming's avatar
lanbaoming committed
1088
      } else {
332784038@qq.com's avatar
332784038@qq.com committed
1089
        return ""
lanbaoming's avatar
lanbaoming committed
1090 1091
      }
    },
1092 1093
    changeDate(val) {
      if (val) {
332784038@qq.com's avatar
332784038@qq.com committed
1094 1095
        this.queryParams.beginRucangTime = val[0]
        this.queryParams.endRucangTime = val[1]
1096
      } else {
332784038@qq.com's avatar
332784038@qq.com committed
1097 1098
        this.queryParams.beginRucangTime = undefined
        this.queryParams.endRucangTime = undefined
1099
      }
lanbaoming's avatar
lanbaoming committed
1100 1101
    },
    //品牌授权
1102
    getBrankByCustomerList() {
332784038@qq.com's avatar
332784038@qq.com committed
1103 1104
      getBrankByCustomer({ ...this.brandAuthorizationFrom, customerId: this.id }).then((r) => {
        this.brandAuthorizationList = r.data.list
1105 1106
        this.brandAuthorizationTotal = r.data.total
      })
lanbaoming's avatar
lanbaoming committed
1107 1108
    },
    // 信用等级日志
1109
    getCustomerGrade() {
332784038@qq.com's avatar
332784038@qq.com committed
1110
      levelLogPage({ ...this.getCustomerGradeFrom, customerId: this.id, total: undefined }).then((r) => {
1111
        if (r.code === 0) {
332784038@qq.com's avatar
332784038@qq.com committed
1112 1113
          this.getCustomerGradeList = r.data.list
          this.getCustomerGradeFrom.total = r.data.total
lanbaoming's avatar
lanbaoming committed
1114 1115 1116
        }
      })
    },
1117 1118
    // 信用日志
    creditLogPage() {
332784038@qq.com's avatar
332784038@qq.com committed
1119
      customerCreditLogPage({ ...this.customerCreditLogFrom, customerId: this.id }).then((r) => {
1120
        if (r.code === 0) {
332784038@qq.com's avatar
332784038@qq.com committed
1121 1122
          this.customerCreditLogList = r.data.list
          this.customerCreditLogFrom.total = r.data.total
1123 1124 1125
        }
      })
    },
lanbaoming's avatar
lanbaoming committed
1126
    //订单
1127
    getorderList() {
yujinyao's avatar
yujinyao committed
1128 1129 1130
      let queryParams = {}
      //目的国
      if (this.destCountryId != null && this.destCountryId != "") {
332784038@qq.com's avatar
332784038@qq.com committed
1131
        queryParams.destCountryIds = this.destCountryId
yujinyao's avatar
yujinyao committed
1132 1133 1134
      }
      //目的城市
      if (this.objectiveId != null && this.objectiveId != "") {
332784038@qq.com's avatar
332784038@qq.com committed
1135
        queryParams.objectiveIds = this.objectiveId
yujinyao's avatar
yujinyao committed
1136 1137 1138
      }
      //目的仓
      if (this.destWarehouseId != null && this.destWarehouseId != "") {
332784038@qq.com's avatar
332784038@qq.com committed
1139
        queryParams.destWarehouseIds = this.destWarehouseId
yujinyao's avatar
yujinyao committed
1140
      }
1141 1142 1143 1144 1145
      infoListStatisticsOrder({ customerDetailId: this.id, ...this.queryParams, ...queryParams }).then((r) => {
        if (r.code === 0) {
          this.statisticsOrder = r.data
        }
      })
332784038@qq.com's avatar
332784038@qq.com committed
1146
      infoListOrderPage({ customerDetailId: this.id, ...this.queryParams, ...queryParams }).then((r) => {
1147
        if (r.code === 0) {
lanbaoming's avatar
lanbaoming committed
1148 1149 1150 1151 1152
          this.orderList = r.data.list
          this.orderTotal = r.data.total
        }
      })
    },
1153 1154 1155 1156
    handleOrderReset() {
      this.destCountryId = null
      this.objectiveId = null
      this.destWarehouseId = null
332784038@qq.com's avatar
332784038@qq.com committed
1157
      this.queryParams = { rows: 10, page: 1 }
1158
      this.getorderList()
332784038@qq.com's avatar
332784038@qq.com committed
1159
      this.rucangtime = []
1160
    },
1483922988@qq.com's avatar
1483922988@qq.com committed
1161 1162
    formatQuery() {
      let obj = {}
yujinyao's avatar
yujinyao committed
1163 1164
      //目的国
      if (this.destCountryId != null && this.destCountryId != "") {
1483922988@qq.com's avatar
1483922988@qq.com committed
1165
        obj.destCountryIds = this.destCountryId
yujinyao's avatar
yujinyao committed
1166 1167 1168
      }
      //目的城市
      if (this.objectiveId != null && this.objectiveId != "") {
1483922988@qq.com's avatar
1483922988@qq.com committed
1169
        obj.objectiveIds = this.objectiveId
yujinyao's avatar
yujinyao committed
1170 1171 1172
      }
      //目的仓
      if (this.destWarehouseId != null && this.destWarehouseId != "") {
1483922988@qq.com's avatar
1483922988@qq.com committed
1173
        obj.destWarehouseIds = this.destWarehouseId
yujinyao's avatar
yujinyao committed
1174
      }
1483922988@qq.com's avatar
1483922988@qq.com committed
1175 1176 1177 1178 1179 1180 1181
      obj.beginCreateTime = this.queryTmp.createTime[0]
      obj.endCreateTime = this.queryTmp.createTime[1]
      return obj
    },
    // 客户报价
    getInfoListOfferPage() {
      infoListOfferPage({ ...this.infoListOfferFrom, customerId: this.id, ...this.queryOfferParams, ...this.formatQuery() }).then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
1182 1183
        this.infoListOfferList = r.data.list
        this.infoListOfferTotal = r.data.total
lanbaoming's avatar
lanbaoming committed
1184 1185
      })
    },
1186 1187 1188 1189
    handleOfferReset() {
      this.destCountryId = null
      this.objectiveId = null
      this.destWarehouseId = null
1483922988@qq.com's avatar
1483922988@qq.com committed
1190 1191 1192 1193 1194
      this.queryOfferParams = {
        salesmanIds: [],
        statusList: [],
        importances: []
      }
332784038@qq.com's avatar
332784038@qq.com committed
1195
      this.infoListOfferFrom = { pageNo: 1, pageSize: 10 }
1196 1197
      this.getInfoListOfferPage()
    },
1198
    //  数据
1199
    getOrderStatistics() {
332784038@qq.com's avatar
332784038@qq.com committed
1200
      orderStatistics({ customerId: this.id }).then((r) => {
1201
        if (r.code === 0) {
lanbaoming's avatar
lanbaoming committed
1202 1203 1204 1205
          this.orderStatisticsObj = r.data
        }
      })
    },
1206
    submit() {
332784038@qq.com's avatar
332784038@qq.com committed
1207
      creditLogCreate({ customerId: this.id, ...this.creditFrom }).then((r) => {
1208
        if (r.code === 0) {
332784038@qq.com's avatar
332784038@qq.com committed
1209 1210
          this.creditLogPage()
          this.creditFrom = {}
1211
          this.creditScoreStatisticFn()
332784038@qq.com's avatar
332784038@qq.com committed
1212
          this.dialogVisible = false
1213
        }
lanbaoming's avatar
lanbaoming committed
1214 1215 1216
      })
    },
    //获得信用客户统计
1217
    creditScoreStatisticFn() {
332784038@qq.com's avatar
332784038@qq.com committed
1218
      creditScoreStatistic({ customerId: this.id }).then((r) => {
1219
        if (r.code === 0) this.creditScoreStatisticObj = r.data
lanbaoming's avatar
lanbaoming committed
1220 1221
      })
    },
1222 1223
    //  获取账单数据
    infoListReceiptFn() {
332784038@qq.com's avatar
332784038@qq.com committed
1224
      infoListReceiptPage({ ...this.infoListReceiptFrom, customerId: this.id }).then((r) => {
1225
        if (r.code === 0) {
332784038@qq.com's avatar
332784038@qq.com committed
1226 1227
          this.infoListReceiptList = r.data.list
          this.infoListReceiptTotal = r.data.total
lanbaoming's avatar
lanbaoming committed
1228 1229 1230
        }
      })
    },
1231
    deleteCustomerFn() {
332784038@qq.com's avatar
332784038@qq.com committed
1232 1233 1234 1235
      this.$confirm(`${this.$t("是否要删除当前客户")}${this.customer.name}》?`, `${this.$t("提示")}`, {
        confirmButtonText: this.$t("确定"),
        cancelButtonText: this.$t("取消"),
        type: "warning"
lanbaoming's avatar
lanbaoming committed
1236
      }).then(() => {
332784038@qq.com's avatar
332784038@qq.com committed
1237 1238
        deleteCustomer(this.customerId).then((r) => {
          this.$modal.msgSuccess(this.$t("删除成功"))
lanbaoming's avatar
lanbaoming committed
1239 1240 1241
          this.$router.back()
        })
      })
1242 1243 1244
    },
    findByprovinceCode() {
      //获取当前省份值id,获取该省份下城市 destCountryId provinceCode
yujinyao's avatar
yujinyao committed
1245
      if (this.destCountryId != null && this.destCountryId != "") {
332784038@qq.com's avatar
332784038@qq.com committed
1246 1247
        getRegionList(2, this.destCountryId).then(({ data }) => {
          this.AddressCity = data
1248
        })
yujinyao's avatar
yujinyao committed
1249
      }
1250 1251 1252
    },
    findBycityCode() {
      //获取当前城市值id,获取该城市下区域
yujinyao's avatar
yujinyao committed
1253
      if (this.objectiveId != null && this.objectiveId != "") {
332784038@qq.com's avatar
332784038@qq.com committed
1254 1255
        getRegionList(3, this.objectiveId).then(({ data }) => {
          this.AddressTown = data
1256
        })
yujinyao's avatar
yujinyao committed
1257
      }
1258 1259
    },
    getData() {
1260 1261 1262 1263 1264
      this.getAddressProvince()
      this.getAddressCity()
      this.getAddressTown()
    },
    getAddressProvince() {
332784038@qq.com's avatar
332784038@qq.com committed
1265 1266
      getRegionList(1, 1).then(({ data }) => {
        this.AddressProvince = data
1267 1268 1269
      })
    },
    getAddressCity() {
332784038@qq.com's avatar
332784038@qq.com committed
1270 1271
      getRegionList(4, 4).then(({ data }) => {
        this.AddressCity = data
1272 1273 1274
      })
    },
    getAddressTown() {
332784038@qq.com's avatar
332784038@qq.com committed
1275 1276
      getRegionList(5, 5).then(({ data }) => {
        this.AddressTown = data
1277
      })
1278 1279 1280
    },
    /** 搜索按钮操作 */
    handleQuery() {
332784038@qq.com's avatar
332784038@qq.com committed
1281
      if (this.activeName == "order") {
yujinyao's avatar
yujinyao committed
1282
        this.queryParams.page = 1
1283
        this.getorderList()
332784038@qq.com's avatar
332784038@qq.com committed
1284
      } else if (this.activeName == "quote") {
yujinyao's avatar
yujinyao committed
1285
        this.infoListOfferFrom.pageNo = 1
1286
        this.getInfoListOfferPage()
1287 1288 1289
      } else if (this.activeName == "follow") {
        this.followForm.pageNo = 1
        this.getCustomerFollowList()
1290 1291 1292 1293
      }
    },
    getWarehouseList() {
      getWarehouseList().then((res) => {
332784038@qq.com's avatar
332784038@qq.com committed
1294
        this.warehouseList = res.data
1295 1296 1297
      })
    },
    getWarehouse(id) {
332784038@qq.com's avatar
332784038@qq.com committed
1298
      let warehouseName = ""
1299 1300
      for (const item of this.warehouseList) {
        if (item.id == id) {
332784038@qq.com's avatar
332784038@qq.com committed
1301
          warehouseName = this.$i18n.locale == "zh_CN" ? item.titleZh : item.titleEn
1302 1303 1304 1305
          break
        }
      }
      return warehouseName
1306
    },
1307
    cancel(id) {
332784038@qq.com's avatar
332784038@qq.com committed
1308
      this.doAction(this.$t("确定要取消此报价单么?"), cancel, id)
yujinyao's avatar
yujinyao committed
1309
    },
1310
    recovery(id) {
332784038@qq.com's avatar
332784038@qq.com committed
1311
      this.doAction(this.$t("确定要恢复此报价单么?"), recovery, id)
yujinyao's avatar
yujinyao committed
1312
    },
1313
    deleteOffer(id) {
332784038@qq.com's avatar
332784038@qq.com committed
1314
      this.doAction(this.$t("确定要删除此报价单么?"), deleteOffer, id)
yujinyao's avatar
yujinyao committed
1315
    },
1316
    doAction(tips, action, id) {
332784038@qq.com's avatar
332784038@qq.com committed
1317 1318 1319 1320
      this.$confirm(tips)
        .then((res) => {
          return action(id)
        })
1321
        .then(() => {
332784038@qq.com's avatar
332784038@qq.com committed
1322
          this.$message.success("操作成功")
1323 1324
          this.handleQuery()
        })
1325 1326 1327
    },
    logListCommonRefresh() {
      this.$refs.logListCommon && this.$refs.logListCommon.handleQuery()
332784038@qq.com's avatar
332784038@qq.com committed
1328
    }
yujinyao's avatar
yujinyao committed
1329
  }
lanbaoming's avatar
lanbaoming committed
1330 1331
}
</script>