index.vue 63.9 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2
<template>
  <div class="app-container">
3
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
zs嵩's avatar
zs嵩 committed
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
      <div class="search-z">
        <el-form-item :label="$t('客户编号')" prop="number">
          <el-input v-model.trim="queryParams.number" :placeholder="$t('请输入客户编号')" clearable @keyup.enter.native="handleQuery" @input="queryParams.number = queryParams.number.replace(/\s+/g, '')" />
        </el-form-item>
        <el-form-item :label="$t('客户名称')" prop="name">
          <el-input v-model.trim="queryParams.name" :placeholder="$t('请输入客户名称')" clearable @keyup.enter.native="handleQuery" @input="queryParams.name = queryParams.name.replace(/\s+/g, '')" />
        </el-form-item>
        <el-form-item :label="$t('区号')">
          <el-select v-model="queryParams.areaCode" :placeholder="$t('请选择区号')">
            <el-option v-for="(item, index) in countryList" :key="index" :label="item.nameShort + (isChinese ? item.nameZh : item.nameEn) + ' +' + item.tel" :value="item.tel" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('联系方式')">
          <el-input :placeholder="$t('请输入联系方式')" clearable v-model.trim="queryParams.defaultContactPhone" @input="queryParams.defaultContactPhone = queryParams.defaultContactPhone.replace(/\s+/g, '')"></el-input>
        </el-form-item>
        <el-form-item :label="$t('部门')" v-if="path != '/customer/department-customers'">
          <el-select v-model="queryParams.deptIds" :placeholder="$t('请选择部门')">
            <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('客户经理')" prop="customerService">
          <el-select multiple clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" size="small" @change="handleQuery">
            <el-option v-for="dict in customerServiceList" :key="dict.id" :label="dict.nickname" :value="dict.id" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('客户来源')" prop="source">
          <el-select multiple clearable v-model="queryParams.source" :placeholder="$t('请选择客户来源')" size="small" @change="handleQuery">
            <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('客户类别')" prop="level">
          <dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_TYPE" v-model="queryParams.type" @change="handleQuery"></dict-selector>
        </el-form-item>
        <el-form-item :label="$t('角色')">
          <dict-selector multiple clearable :type="DICT_TYPE.CUSTOMER_ROLE" v-model="queryParams.role" formatter="number" @change="handleQuery" :placeholder="$t('请选择')"></dict-selector>
        </el-form-item>
        <el-form-item :label="$t('客户状态')" prop="status">
          <el-select multiple clearable v-model="queryParams.status" :placeholder="$t('请选择客户状态')" size="small" @change="handleQuery">
            <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('国籍')" prop="country">
          <el-select multiple clearable v-model="queryParams.country" :placeholder="$t('请选择')" @change="handleQuery">
            <el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('出货渠道')">
          <dict-selector multiple clearable :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" @change="handleQuery"></dict-selector>
        </el-form-item>
yujinyao's avatar
yujinyao committed
53

zs嵩's avatar
zs嵩 committed
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
        <el-form-item :label="$t('业务国家')" v-show="showSearch">
          <el-select multiple clearable v-model="queryParams.busiCountryIds" :placeholder="$t('请选择')" @change="handleQuery">
            <el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('常用提货网点')" v-show="showSearch">
          <el-select multiple v-model="queryParams.pickupPoints">
            <el-option v-for="item in getNodeLists" :key="item.id" :value="item.id" :label="isChinese ? item.titleZh : item.titleEn"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('创建人')" v-show="showSearch">
          <el-select v-model="queryParams.founder">
            <el-option v-for="item in allSimplList" :key="item.id" :label="item.nickname" :value="item.id"> </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('业绩类型')" v-show="showSearch">
          <el-select clearable v-model="queryParams.isNew">
            <el-option :label="$t('新客户')" :value="true" />
            <el-option :label="$t('老客户')" :value="false" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('年度发货量')" v-show="showSearch">
          <el-input v-model.trim="weightYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="weightYearly.value = weightYearly.value.replace(/\s+/g, '')">
            <template slot="prepend">
              <dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="weightYearly.key" />
            </template>
          </el-input>
        </el-form-item>
        <el-form-item :label="$t('商品类别')" v-show="showSearch">
          <el-select @change="handleSelectProductType" multiple v-model="queryParams.productTypes" :placeholder="$t('请选择')">
            <el-option :label="item.titleZh" :value="item.id" v-for="item in productTypeList" :key="item.id" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('商品名称')" v-show="showSearch">
          <el-select multiple filterable clearable v-model="queryParams.productIds" :placeholder="$t('请选择商品名称')">
            <el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="item in productList" :key="item.id" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
93 94 95
          <el-select multiple filterable clearable v-model="queryParams.competitorIds" :placeholder="$t('请选择竞争对手')" size="small" @change="handleQuery">
            <el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
          </el-select>
zs嵩's avatar
zs嵩 committed
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
        </el-form-item>
        <el-form-item :label="$t('年度发货次数')" v-show="showSearch">
          <el-input v-model.trim="numYearly.value" :placeholder="$t('请输入数字')" clearable @keyup.enter.native="handleQuery" @input="numYearly.value = numYearly.value.replace(/\s+/g, '')">
            <template slot="prepend">
              <dict-selector :type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD" defaultable v-model="numYearly.key" />
            </template>
          </el-input>
        </el-form-item>
        <el-form-item :label="$t('推介人')" v-show="showSearch">
          <el-select clearable remote :remote-method="remoteMethod" v-model="queryParams.promoter" :placeholder="$t('请输入推介人')" filterable>
            <el-option v-for="item in customerSelectFn" :key="item.id" :label="item.name" :value="item.id"> </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('获取方式')" v-show="showSearch">
          <el-select v-model="queryParams.getMethod" multiple :placeholder="$t('请选择')">
            <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('创建入口')" v-show="showSearch">
          <el-select v-model="queryParams.createFroms" multiple :placeholder="$t('请选择')">
            <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('结算方式')" v-show="showSearch">
          <el-select v-model="queryParams.balances" multiple :placeholder="$t('请选择结算方式')">
            <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('入仓确认')" v-show="showSearch">
          <el-select clearable v-model="queryParams.arrivalConfirm">
            <el-option :label="$t('是')" :value="1" />
            <el-option :label="$t('否')" :value="0" />
          </el-select>
        </el-form-item>
130
        <el-form-item :label="$t('控货无收货人')" v-show="showSearch" label-width="100px">
zs嵩's avatar
zs嵩 committed
131 132 133 134
          <div style="width: 194px">
            <el-switch v-model="queryParams.noConsignee" />
          </div>
        </el-form-item>
135
        <el-form-item :label="$t('默认付款')" v-show="showSearch" label-width="70px">
zs嵩's avatar
zs嵩 committed
136 137 138 139
          <div style="width: 194px">
            <el-switch v-model="queryParams.defaultPay" />
          </div>
        </el-form-item>
140
        <el-form-item :label="$t('是否显示提单价格')" v-show="showSearch" label-width="130px">
zs嵩's avatar
zs嵩 committed
141 142 143 144 145 146
          <div style="width: 194px">
            <el-switch v-model="queryParams.isShowTidanPrice" />
          </div>
        </el-form-item>
      </div>
      <div class="search-time">
147
        <el-form-item :label="$t('入公海时间')" v-show="showSearch">
zs嵩's avatar
zs嵩 committed
148
          <el-date-picker type="datetimerange" clearable v-model="enterOpenSeaTime" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
149 150
        </el-form-item>
        <el-form-item :label="$t('归属时间')" v-show="showSearch">
zs嵩's avatar
zs嵩 committed
151
          <el-date-picker type="datetimerange" clearable v-model="customerServiceConfirmedTime" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
152 153
        </el-form-item>
        <el-form-item :label="$t('首次成交时间')" v-show="showSearch">
zs嵩's avatar
zs嵩 committed
154
          <el-date-picker type="datetimerange" clearable v-model="firstDealTime" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
155 156 157
        </el-form-item>

        <el-form-item :label="$t('创建时间')" v-show="showSearch">
zs嵩's avatar
zs嵩 committed
158
          <el-date-picker type="datetimerange" clearable v-model="dateRangeCreateTime" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
159
        </el-form-item>
zs嵩's avatar
zs嵩 committed
160
        <el-form-item style="padding-left: 20px">
161 162 163 164
          <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>
      </div>
lanbaoming's avatar
lanbaoming committed
165 166 167
    </el-form>

    <!-- 操作工具栏 -->
332784038@qq.com's avatar
332784038@qq.com committed
168
    <div v-if="path === '/customer/customer'" style="color: red; margin-bottom: 5px">注意:创建的客户需接收</div>
lanbaoming's avatar
lanbaoming committed
169 170
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
332784038@qq.com's avatar
332784038@qq.com committed
171 172
        <el-button v-if="path === '/customer/potential'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPotential">{{ $t("新增潜在客户") }}</el-button>
        <el-button v-else type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="[selectAuthorityFn('ecw:customer:create')]">{{ $t("新增") }} </el-button>
lanbaoming's avatar
lanbaoming committed
173
      </el-col>
lanbaoming's avatar
lanbaoming committed
174
      <el-col :span="1.5">
332784038@qq.com's avatar
332784038@qq.com committed
175
        <el-button :disabled="selectCustomerList.length === 0" type="primary" size="mini" @click="transferShow = true" v-hasPermi="[selectAuthorityFn('ecw:customer:batch-transfer')]">{{ $t("批量移交") }}</el-button>
lanbaoming's avatar
lanbaoming committed
176 177
      </el-col>
      <el-col :span="1.5">
332784038@qq.com's avatar
332784038@qq.com committed
178
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" v-hasPermi="[selectAuthorityFn('ecw:customer:export')]">{{ $t("导出") }}</el-button>
lanbaoming's avatar
lanbaoming committed
179 180
      </el-col>
      <el-col :span="1.5">
lanbaoming's avatar
lanbaoming committed
181 182
        <!--        <el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(true)" v-if="$route.path === '/customer/customer'" type="primary" plain  size="mini"  :loading="exportLoading"-->
        <!--                   v-hasPermi="['ecw:customer:transport']" >{{$t('设为空运客户')}}</el-button>-->
lanbaoming's avatar
lanbaoming committed
183 184
      </el-col>
      <el-col :span="1.5">
lanbaoming's avatar
lanbaoming committed
185 186
        <!--        <el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(false)" v-if="$route.path === '/customer/customer'" type="primary" plain  size="mini"  :loading="exportLoading"-->
        <!--                   v-hasPermi="['ecw:customer:transport']">{{$t('设为非空运客户')}}</el-button>-->
lanbaoming's avatar
lanbaoming committed
187 188
      </el-col>
      <el-col :span="1.5">
332784038@qq.com's avatar
332784038@qq.com committed
189
        <el-button v-hasPermi="['ecw:customer:fcl']" :disabled="!selectCustomerList.length" @click="setFullContainerLoad(true)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading">{{ $t("设置海运整柜客户") }}</el-button>
lanbaoming's avatar
lanbaoming committed
190
      </el-col>
191
      <el-col :span="1.5">
332784038@qq.com's avatar
332784038@qq.com committed
192
        <el-button v-hasPermi="['ecw:customer:fcl-mistake']" :disabled="!selectCustomerList.length" @click="setFullContainerLoad(false)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading">{{ $t("设置海运非整柜客户") }}</el-button>
193 194
      </el-col>
      <el-col :span="1.5">
332784038@qq.com's avatar
332784038@qq.com committed
195
        <el-button v-has-permi="[selectAuthorityFn('ecw:customer:create-potential')]" v-if="path === '/customer/customer'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPotential">{{ $t("新增潜在客户") }}</el-button>
196
      </el-col>
yujinyao's avatar
yujinyao committed
197
      <el-col :span="1.5">
332784038@qq.com's avatar
332784038@qq.com committed
198
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleMergeCus" v-has-permi="[selectAuthorityFn('ecw:customer:merge')]" v-if="path === '/customer/customer'">{{ $t("合并客户") }}</el-button>
yujinyao's avatar
yujinyao committed
199
      </el-col>
332784038@qq.com's avatar
332784038@qq.com committed
200
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
lanbaoming's avatar
lanbaoming committed
201 202 203
    </el-row>

    <!-- 列表 -->
332784038@qq.com's avatar
332784038@qq.com committed
204
    <el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange">
yujinyao's avatar
yujinyao committed
205
      <el-table-column type="selection" width="55" fixed></el-table-column>
余金瑶's avatar
余金瑶 committed
206
      <el-table-column :label="$t('客户编号')" align="center" fixed>
lanbaoming's avatar
lanbaoming committed
207
        <template v-slot="{ row }">
余金瑶's avatar
余金瑶 committed
208 209 210
          <router-link :to="`/customer/query/${row.id}`" class="link-type">
            {{ row.number }}
          </router-link>
lanbaoming's avatar
lanbaoming committed
211 212
        </template>
      </el-table-column>
余金瑶's avatar
余金瑶 committed
213
      <el-table-column :label="$t('客户名称')" align="center" fixed>
lanbaoming's avatar
lanbaoming committed
214 215 216 217 218
        <template slot-scope="{ row }">
          <p style="display: inline-block; white-space: pre-wrap">
            {{ $l(row, "name") }}
          </p>
          <el-tag v-if="row.isInOpenSea" size="mini">{{ $t("") }}</el-tag>
lanbaoming's avatar
lanbaoming committed
219 220
        </template>
      </el-table-column>
余金瑶's avatar
余金瑶 committed
221 222
      <!--
      <el-table-column :label="$t('客户等级')" align="center">
lanbaoming's avatar
lanbaoming committed
223 224 225 226
        <template slot-scope="scope">
          <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
        </template>
      </el-table-column>
余金瑶's avatar
余金瑶 committed
227 228
      <el-table-column :label="$t('信用等级')" :prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn'"></el-table-column>
      -->
229

332784038@qq.com's avatar
332784038@qq.com committed
230
      <el-table-column :label="$t('主联系人')" prop="defaultContactName"></el-table-column>
zs嵩's avatar
zs嵩 committed
231 232 233 234 235 236 237 238
      <!--      <el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">-->
      <!--        <template v-slot="{ row }">-->
      <!--          +{{ row.defaultContactPhone }} <br />-->
      <!--          <contacts :id="row.id">-->
      <!--            <el-button type="text">更多</el-button>-->
      <!--          </contacts>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
239
      <el-table-column :label="$t('最新跟进时间')" width="120">
zs嵩's avatar
zs嵩 committed
240
        <template slot-scope="scope" v-if="scope.row.followupBackVO">
241 242 243 244
          {{ parseTime(scope.row.followupBackVO.followTime) }}
        </template>
      </el-table-column>
      <el-table-column :label="$t('最新跟进记录')" width="120">
zs嵩's avatar
zs嵩 committed
245
        <template slot-scope="scope" v-if="scope.row.followupBackVO">
246
          <a href="javascript:void(0)" @click="handleCustomerFollowLink(scope.row.followupBackVO)" class="link-type">{{ scope.row.followupBackVO.number }}</a>
lanbaoming's avatar
lanbaoming committed
247 248
        </template>
      </el-table-column>
249

余金瑶's avatar
余金瑶 committed
250
      <el-table-column :label="$t('客户类别')" align="center" prop="status">
251
        <template slot-scope="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
252 253 254 255 256 257 258 259 260
          {{
            getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (row.type || "").split(","))
              .map((e) => (isChinese ? e.label : e.labelEn))
              .join(", ")
          }}
          <!--          <dict-tag-->
          <!--            :type="DICT_TYPE.CUSTOMER_TYPE"-->
          <!--            :value="scope.row.type"-->
          <!--          />-->
lanbaoming's avatar
lanbaoming committed
261 262
        </template>
      </el-table-column>
余金瑶's avatar
余金瑶 committed
263
      <el-table-column :label="$t('角色')" align="center" prop="status">
zhengyi's avatar
zhengyi committed
264
        <template slot-scope="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
265 266 267 268 269 270 271 272 273 274
          {{
            getDictDatas2(DICT_TYPE.CUSTOMER_ROLE, (row.roles || "").split(","))
              .map((e) => (isChinese ? e.label : e.labelEn))
              .join(", ")
          }}
          <!--          {{ getCustomerRoles(row.roles) }}-->
          <!--          <dict-tag-->
          <!--            :type="DICT_TYPE.CUSTOMER_ROLE"-->
          <!--            :value="scope.row.roles"-->
          <!--          />-->
lanbaoming's avatar
lanbaoming committed
275 276
        </template>
      </el-table-column>
277 278
      <el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName"></el-table-column>
      <el-table-column :label="$t('国籍')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
余金瑶's avatar
余金瑶 committed
279
      <el-table-column :label="$t('出货渠道')" align="center">
lanbaoming's avatar
lanbaoming committed
280 281
        <template slot-scope="{ row }">
          {{ channel(row.transportType) }}
lanbaoming's avatar
lanbaoming committed
282 283
        </template>
      </el-table-column>
余金瑶's avatar
余金瑶 committed
284 285
      <el-table-column :label="$t('客户来源')">
        <template slot-scope="scope">
332784038@qq.com's avatar
332784038@qq.com committed
286
          <dict-tag :type="DICT_TYPE.CUSTOMER_SOURCE" :value="scope.row.source" />
余金瑶's avatar
余金瑶 committed
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
        </template>
      </el-table-column>
      <el-table-column :label="$t('业务国家')">
        <template slot-scope="{ row }">
          {{ getBusiCountryNames(row.busiCountryIds) }}
        </template>
      </el-table-column>
      <el-table-column :label="$t('常用提货网点')">
        <template slot-scope="{ row }">
          {{ getPickupPointNames(row.pickupPoints) }}
        </template>
      </el-table-column>
      <el-table-column :label="$t('年度发货量')" align="center">
        <template slot-scope="{ row }">
          {{ row.weightYearly }}
        </template>
      </el-table-column>
      <el-table-column :label="$t('主营类别')">
        <template slot-scope="{ row }">
306
          {{ getProductTypeNames(row.productTypes) }}
余金瑶's avatar
余金瑶 committed
307 308
        </template>
      </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
309
      <el-table-column :label="$t('主要竞争对手')" prop="competitorNames"> </el-table-column>
余金瑶's avatar
余金瑶 committed
310 311 312 313 314 315 316 317 318 319 320 321
      <el-table-column :label="$t('年度发货次数')" align="center">
        <template slot-scope="{ row }">
          {{ row.numYearly }}
        </template>
      </el-table-column>
      <el-table-column :label="$t('推介人')">
        <template slot-scope="{ row }">
          {{ getPromoterName(row.promoter) }}
        </template>
      </el-table-column>
      <el-table-column :label="$t('入公海时间')" align="center" width="160">
        <template v-slot="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
322
          {{ parseTime(row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime) }}
余金瑶's avatar
余金瑶 committed
323 324 325 326
        </template>
      </el-table-column>
      <el-table-column :label="$t('入仓确认')" align="center">
        <template slot-scope="scope">
332784038@qq.com's avatar
332784038@qq.com committed
327 328
          <el-tag type="success" v-if="scope.row.arrivalConfirm == 1">{{ $t("") }}</el-tag>
          <el-tag type="info" v-else>{{ $t("") }}</el-tag>
余金瑶's avatar
余金瑶 committed
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
        </template>
      </el-table-column>
      <el-table-column :label="$t('控货无收货人')" align="center">
        <template slot-scope="scope">
          <el-switch v-model="scope.row.noConsignee" disabled />
        </template>
      </el-table-column>
      <el-table-column :label="$t('默认付款')" align="center">
        <template slot-scope="scope">
          <el-switch v-model="scope.row.defaultPay" disabled />
        </template>
      </el-table-column>
      <el-table-column :label="$t('归属时间')" width="160" align="center">
        <template slot-scope="scope">
          {{ parseTime(scope.row.customerServiceConfirmedTime) }}
        </template>
      </el-table-column>
      <el-table-column :label="$t('首次成交时间')" width="160" align="center">
        <template slot-scope="scope">
          {{ parseTime(scope.row.firstDealTime) }}
        </template>
      </el-table-column>
      <el-table-column :label="$t('获取方式')" align="center">
        <template slot-scope="scope">
332784038@qq.com's avatar
332784038@qq.com committed
353
          <dict-tag :type="DICT_TYPE.CUSTOMER_GET_METHOD" :value="scope.row.getMethod" />
余金瑶's avatar
余金瑶 committed
354 355
        </template>
      </el-table-column>
332784038@qq.com's avatar
332784038@qq.com committed
356
      <el-table-column :label="$t('创建人')" prop="createUsername" align="center"> </el-table-column>
余金瑶's avatar
余金瑶 committed
357 358 359 360 361 362 363
      <el-table-column :label="$t('创建时间')" align="center" width="160">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column :label="$t('最后更新时间')" align="center" width="160">
        <template slot-scope="scope">
332784038@qq.com's avatar
0  
332784038@qq.com committed
364
          <span>{{ parseTime(scope.row.updateTime) }}</span>
余金瑶's avatar
余金瑶 committed
365 366
        </template>
      </el-table-column>
367
      <el-table-column width="200px" :label="$t('操作')" align="center" fixed="right">
lanbaoming's avatar
lanbaoming committed
368
        <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
369 370
          <!--          <el-button size="mini" type="text" v-show="'development' === env && scope.row.isInOpenSea"  @click="seasPond(scope.row)"-->
          <!--                     v-hasPermi="['ecw:customer:query']">{{$t('掉入公海池')}}</el-button>-->
332784038@qq.com's avatar
332784038@qq.com committed
371 372 373 374 375 376 377
          <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)" v-hasPermi="[selectAuthorityFn('ecw:customer:index-query')]">{{ $t("查看") }}</el-button>
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="[selectAuthorityFn('ecw:customer:update')]">{{ $t("修改") }}</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="[selectAuthorityFn('ecw:customer:delete')]">{{ $t("删除") }}</el-button>
          <el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:follow-up')]" type="text" icon="el-icon-collection" @click="followUp(scope.row)">{{ $t("跟进") }}</el-button>
          <el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:customer-complaint')]" type="text" icon="el-icon-user" @click="complaint(scope.row)">{{ $t("客诉") }}</el-button>
          <el-button :disabled="scope.row.isInOpenSea" v-has-permi="[selectAuthorityFn('ecw:customer:postpone')]" size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{ $t("延期") }}</el-button>
          <el-button v-has-permi="['ecw:customer:treat-recovery']" v-if="scope.row.customerService !== null && scope.row.customerServiceAssignedTime !== null && !scope.row.isCustomerServiceConfirmed && !scope.row.isInOpenSea && path === '/customer/customer'" size="mini" type="text" @click="recovery(scope.row)">
lanbaoming's avatar
lanbaoming committed
378 379 380 381 382 383 384 385
            {{ $t("回收客户") }}
          </el-button>
          <el-button
            v-has-permi="['ecw:customer:performanceType']"
            v-if="path === '/customer/customer'"
            size="mini"
            type="text"
            @click="
332784038@qq.com's avatar
332784038@qq.com committed
386 387 388
              dialogVisible = true
              customData = scope.row
              currentisNew = scope.row.isNew
lanbaoming's avatar
lanbaoming committed
389 390 391 392 393
            "
          >
            {{ $t("业绩类型") }}
          </el-button>
          <!--lanbm 2024-05-23 添加报价按钮逻辑控制-->
332784038@qq.com's avatar
332784038@qq.com committed
394 395
          <el-button v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]" size="mini" type="text" icon="el-icon-user" @click="quote(scope.row)">{{ $t("报价") }}</el-button>
          <el-button v-has-permi="['ecw:customer:setting']" size="mini" type="text" icon="el-icon-user" @click="handleSetting(scope.row)">{{ $t("设置") }}</el-button>
lanbaoming's avatar
lanbaoming committed
396 397 398 399
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
332784038@qq.com's avatar
332784038@qq.com committed
400
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" />
lanbaoming's avatar
lanbaoming committed
401 402

    <!-- 对话框(添加 / 修改) -->
332784038@qq.com's avatar
332784038@qq.com committed
403
    <el-dialog :title="title" :visible.sync="open" width="90%" append-to-body :close-on-click-modal="false">
lanbaoming's avatar
lanbaoming committed
404 405 406 407
      <el-form ref="form" :model="form" :rules="rules" label-width="150px">
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item :label="$t('客户名称')" prop="name">
332784038@qq.com's avatar
332784038@qq.com committed
408
              <el-input v-model="form.name" :placeholder="$t('请输入客户名称')" />
lanbaoming's avatar
lanbaoming committed
409 410 411 412 413
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('国家')" prop="country">
              <el-select v-model="form.country" :placeholder="$t('请选择国家')">
332784038@qq.com's avatar
332784038@qq.com committed
414
                <el-option v-for="dict in getDictDatas(DICT_TYPE.COUNTRY)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
lanbaoming's avatar
lanbaoming committed
415 416 417 418 419
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('客户等级')" prop="level">
332784038@qq.com's avatar
332784038@qq.com committed
420 421
              <el-select v-model="form.level" :placeholder="$t('请选择客户等级')">
                <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
lanbaoming's avatar
lanbaoming committed
422 423 424 425 426
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('联系地址')" prop="address">
332784038@qq.com's avatar
332784038@qq.com committed
427
              <el-input v-model="form.address" :placeholder="$t('请输入联系地址')" />
lanbaoming's avatar
lanbaoming committed
428 429 430 431
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('客户类别')" prop="type">
332784038@qq.com's avatar
332784038@qq.com committed
432 433
              <el-select v-model="form.type" :placeholder="$t('请选择客户类别')">
                <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
lanbaoming's avatar
lanbaoming committed
434 435 436
              </el-select>
            </el-form-item>
          </el-col>
lanbaoming's avatar
lanbaoming committed
437 438 439 440 441 442 443 444
          <!--          <el-col :span="12">-->
          <!--            <el-form-item :label="$t('所属代理')" prop="agentId">-->
          <!--              <el-select v-model="form.agentId" :placeholder="$t('请选择所属代理')">-->
          <!--                <el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"-->
          <!--                           :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />-->
          <!--              </el-select>-->
          <!--            </el-form-item>-->
          <!--          </el-col>-->
lanbaoming's avatar
lanbaoming committed
445 446
          <el-col :span="12">
            <el-form-item :label="$t('常用提货网点')" prop="pickupPoint">
332784038@qq.com's avatar
332784038@qq.com committed
447 448
              <el-select v-model="form.pickupPoint" :placeholder="$t('请输入常用提货网点')">
                <el-option v-for="node in nodeList" :key="node.value" :label="node.label" :value="node.value" />
lanbaoming's avatar
lanbaoming committed
449 450 451 452 453
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('公司名称')" prop="company">
332784038@qq.com's avatar
332784038@qq.com committed
454
              <el-input v-model="form.company" :placeholder="$t('请输入公司名称')" />
lanbaoming's avatar
lanbaoming committed
455 456 457 458
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('客户生日')" prop="birthday">
332784038@qq.com's avatar
332784038@qq.com committed
459
              <el-date-picker v-model="form.birthday" type="date" value-format="timestamp" :placeholder="$t('请输入客户生日')"> </el-date-picker>
lanbaoming's avatar
lanbaoming committed
460 461 462
            </el-form-item>
          </el-col>
          <el-col :span="12">
463
            <el-form-item :label="$t('主营类别')" prop="productTypes">
lanbaoming's avatar
lanbaoming committed
464 465
              <el-row :gutter="10">
                <el-col :span="11">
466
                  <el-select v-model="form.productTypes" :placeholder="$t('请选择产品类别')">
lanbaoming's avatar
lanbaoming committed
467 468 469 470
                    <!--                   <el-option :label="$t('请选择字典生成')" value="" />-->
                  </el-select>
                </el-col>
                <el-col :span="11">
471
                  <el-select v-model="form.productTypes" :placeholder="$t('请选择主营类别')">
lanbaoming's avatar
lanbaoming committed
472
                    <!--                    <el-option :label="$t('请选择字典生成')" value="" />-->
lanbaoming's avatar
lanbaoming committed
473 474 475 476 477 478 479
                  </el-select>
                </el-col>
              </el-row>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('客户来源')" prop="source">
332784038@qq.com's avatar
332784038@qq.com committed
480 481
              <el-select v-model="form.source" :placeholder="$t('请选择客户来源')">
                <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
lanbaoming's avatar
lanbaoming committed
482 483 484 485 486
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('结算方式')" prop="balance">
332784038@qq.com's avatar
332784038@qq.com committed
487 488
              <el-select v-model="form.balance" :placeholder="$t('请选择结算方式')">
                <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
lanbaoming's avatar
lanbaoming committed
489 490 491 492 493
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('客户经理')" prop="customerService">
332784038@qq.com's avatar
332784038@qq.com committed
494 495
              <el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')">
                <el-option v-for="dict in customerServiceList" :key="dict.id" :label="dict.nickname" :value="dict.id" />
lanbaoming's avatar
lanbaoming committed
496 497 498 499 500 501 502 503 504 505
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('图片')" prop="picture">
              <upload v-model="form.picture" :limit="1"></upload>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('客户状态')" prop="status">
332784038@qq.com's avatar
332784038@qq.com committed
506 507
              <el-select v-model="form.status" :placeholder="$t('请选择客户状态')">
                <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
lanbaoming's avatar
lanbaoming committed
508 509 510 511 512
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('推介人')" prop="promoter">
332784038@qq.com's avatar
332784038@qq.com committed
513
              <el-input v-model="form.promoter" :placeholder="$t('请输入推介人')" />
lanbaoming's avatar
lanbaoming committed
514 515 516 517
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('创建人')" prop="founder">
332784038@qq.com's avatar
332784038@qq.com committed
518
              <el-input v-model="form.founder" :placeholder="$t('请输入创建人')" />
lanbaoming's avatar
lanbaoming committed
519 520 521 522
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('创建时间')" prop="founder">
332784038@qq.com's avatar
332784038@qq.com committed
523
              <el-date-picker v-model="form.createTime" type="datetime" value-format="timestamp" :placeholder="$t('选择创建时间')"> </el-date-picker>
lanbaoming's avatar
lanbaoming committed
524 525 526 527
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('备注')" prop="remarks">
332784038@qq.com's avatar
332784038@qq.com committed
528
              <el-input v-model="form.remarks" :placeholder="$t('请输入备注')" />
lanbaoming's avatar
lanbaoming committed
529 530 531 532
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
332784038@qq.com's avatar
332784038@qq.com committed
533
              <el-switch v-model="form.arrivalConfirm" :active-value="0" :inactive-value="1" />
lanbaoming's avatar
lanbaoming committed
534 535 536 537
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item :label="$t('重货标准(CBM)')" prop="weightUnit">
332784038@qq.com's avatar
332784038@qq.com committed
538
              <el-input v-model="form.weightUnit" :placeholder="$t('请输入重货标准(CBM)')" />
lanbaoming's avatar
lanbaoming committed
539 540 541 542 543
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item :label="$t('指定线路')" prop="line">
              <el-switch v-model="showLine"></el-switch>
332784038@qq.com's avatar
332784038@qq.com committed
544 545 546
              <el-table v-show="showLine" border :data="form.customerLines" style="width: 500px">
                <el-table-column prop="departureId" :label="$t('始发地')"> </el-table-column>
                <el-table-column prop="objectiveId" :label="$t('目的地')"> </el-table-column>
lanbaoming's avatar
lanbaoming committed
547 548 549 550 551 552 553
              </el-table>
            </el-form-item>
          </el-col>
        </el-row>

        <el-card class="box-card">
          <div slot="header" class="clearfix">
lanbaoming's avatar
lanbaoming committed
554
            <span>{{ $t("联系人") }}</span>
332784038@qq.com's avatar
332784038@qq.com committed
555
            <el-button style="float: right" size="small" type="primary" @click="form.customerContacts.push({ department: undefined })">+</el-button>
lanbaoming's avatar
lanbaoming committed
556 557 558
          </div>
          <el-table :data="form.customerContacts" style="width: 100%">
            <el-table-column prop="department" :label="$t('部门')" width="">
lanbaoming's avatar
lanbaoming committed
559
              <template v-slot="{ row, column, $index }">
332784038@qq.com's avatar
332784038@qq.com committed
560
                <el-input v-model="row.department" :placeholder="$t('请输入部门')" size="mini" />
lanbaoming's avatar
lanbaoming committed
561 562
              </template>
            </el-table-column>
lanbaoming's avatar
lanbaoming committed
563 564
            <el-table-column prop="position" :label="$t('职位')" width="">
              <template v-slot="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
565
                <el-input v-model="row.position" :placeholder="$t('请输入职位')" size="mini" />
lanbaoming's avatar
lanbaoming committed
566 567
              </template>
            </el-table-column>
lanbaoming's avatar
lanbaoming committed
568
            <el-table-column prop="name" :label="$t('联系人')">
332784038@qq.com's avatar
332784038@qq.com committed
569
              <template v-slot:header>{{ $t("联系人") }}<span style="color: #ff0000">*</span> </template>
lanbaoming's avatar
lanbaoming committed
570
              <template v-slot="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
571
                <el-input v-model="row.name" :placeholder="$t('请输入联系人')" size="mini" />
lanbaoming's avatar
lanbaoming committed
572 573
              </template>
            </el-table-column>
lanbaoming's avatar
lanbaoming committed
574
            <el-table-column prop="areaCode" :label="$t('区号')">
332784038@qq.com's avatar
332784038@qq.com committed
575
              <template v-slot:header>{{ $t("区号") }}<span style="color: #ff0000">*</span> </template>
lanbaoming's avatar
lanbaoming committed
576
              <template v-slot="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
577 578
                <el-select v-model="row.areaCode" :placeholder="$t('请选择区号')">
                  <el-option v-for="dict in getDictDatas(DICT_TYPE.AREA_CODE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
lanbaoming's avatar
lanbaoming committed
579 580 581
                </el-select>
              </template>
            </el-table-column>
lanbaoming's avatar
lanbaoming committed
582
            <el-table-column prop="phoneNew" :label="$t('联系方式')">
332784038@qq.com's avatar
332784038@qq.com committed
583
              <template v-slot:header>{{ $t("联系方式") }}<span style="color: #ff0000">*</span> </template>
lanbaoming's avatar
lanbaoming committed
584
              <template v-slot="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
585
                <el-input v-model="row.phoneNew" :placeholder="$t('请输入联系方式')" size="mini" />
lanbaoming's avatar
lanbaoming committed
586 587
              </template>
            </el-table-column>
lanbaoming's avatar
lanbaoming committed
588 589 590
            <el-table-column prop="" :label="$t('关联账号')"> </el-table-column>
            <el-table-column prop="social" :label="$t('社交软件')">
              <template v-slot="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
591 592
                <el-select v-model="row.social" :placeholder="$t('请选择社交软件')">
                  <el-option v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
lanbaoming's avatar
lanbaoming committed
593 594 595
                </el-select>
              </template>
            </el-table-column>
lanbaoming's avatar
lanbaoming committed
596 597
            <el-table-column prop="socialNumber" :label="$t('社交软件号码')">
              <template v-slot="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
598
                <el-input v-model="row.socialNumber" :placeholder="$t('请输入社交软件号码')" size="mini" />
lanbaoming's avatar
lanbaoming committed
599 600
              </template>
            </el-table-column>
lanbaoming's avatar
lanbaoming committed
601 602
            <el-table-column prop="email" :label="$t('邮箱')">
              <template v-slot="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
603
                <el-input v-model="row.email" :placeholder="$t('请输入邮箱')" size="mini" />
lanbaoming's avatar
lanbaoming committed
604 605
              </template>
            </el-table-column>
lanbaoming's avatar
lanbaoming committed
606 607
            <el-table-column prop="isDefault" :label="$t('设为默认')">
              <template v-slot="{ row }">
332784038@qq.com's avatar
332784038@qq.com committed
608 609
                <el-select v-model="row.isDefault" :placeholder="$t('设为默认')">
                  <el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)" :key="dict.value" :label="dict.label" :value="parseInt(dict.isDefault)" />
lanbaoming's avatar
lanbaoming committed
610 611 612
                </el-select>
              </template>
            </el-table-column>
lanbaoming's avatar
lanbaoming committed
613
            <el-table-column prop="name" :label="$t('操作')">
lanbaoming's avatar
lanbaoming committed
614
              <template v-slot="{ row, column, $index }">
332784038@qq.com's avatar
332784038@qq.com committed
615
                <el-button type="danger" @click="form.customerContacts.splice($index, 1)">{{ $t("删除") }}</el-button>
lanbaoming's avatar
lanbaoming committed
616 617 618 619 620 621 622 623
              </template>
            </el-table-column>
          </el-table>
        </el-card>

        <el-row :gutter="10" style="margin-top: 15px">
          <el-col :span="12">
            <el-form-item :label="$t('发票抬头')" prop="invoiceTitle">
332784038@qq.com's avatar
332784038@qq.com committed
624
              <el-input v-model="form.invoiceTitle" :placeholder="$t('请输入发票抬头')" />
lanbaoming's avatar
lanbaoming committed
625 626 627 628
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('纳税人识别号')" prop="licenseNumber">
332784038@qq.com's avatar
332784038@qq.com committed
629
              <el-input v-model="form.licenseNumber" :placeholder="$t('请输入纳税人识别号')" />
lanbaoming's avatar
lanbaoming committed
630 631 632 633 634 635 636 637 638
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('开户行')" prop="bank">
              <el-input v-model="form.bank" :placeholder="$t('请输入开户行')" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('账户')" prop="bankNumber">
332784038@qq.com's avatar
332784038@qq.com committed
639
              <el-input v-model="form.bankNumber" :placeholder="$t('请输入账户')" />
lanbaoming's avatar
lanbaoming committed
640 641 642 643
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('项目')" prop="project">
332784038@qq.com's avatar
332784038@qq.com committed
644
              <el-input v-model="form.project" :placeholder="$t('请输入项目')" />
lanbaoming's avatar
lanbaoming committed
645 646 647 648
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('开票地址')" prop="billingAddress">
332784038@qq.com's avatar
332784038@qq.com committed
649
              <el-input v-model="form.billingAddress" :placeholder="$t('请输入开票地址')" />
lanbaoming's avatar
lanbaoming committed
650 651 652 653
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('开票电话')" prop="billingTell">
332784038@qq.com's avatar
332784038@qq.com committed
654
              <el-input v-model="form.billingTell" :placeholder="$t('请输入开票电话')" />
lanbaoming's avatar
lanbaoming committed
655 656 657 658
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('税率')" prop="taxRate">
332784038@qq.com's avatar
332784038@qq.com committed
659
              <el-input v-model="form.taxRate" :placeholder="$t('请输入税率')" />
lanbaoming's avatar
lanbaoming committed
660 661 662 663 664
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
332784038@qq.com's avatar
332784038@qq.com committed
665
        <el-button type="primary" @click="submitForm">{{ $t("确 定") }}</el-button>
lanbaoming's avatar
lanbaoming committed
666
        <el-button @click="cancel">{{ $t("取 消") }}</el-button>
lanbaoming's avatar
lanbaoming committed
667 668
      </div>
    </el-dialog>
332784038@qq.com's avatar
332784038@qq.com committed
669
    <customer-follow-list :customer-id="customerId" :id="customerId" :customer-service="customerService" :customer-number="customerNumber" ref="CustomerFollowList" v-if="customerFollowVisible"></customer-follow-list>
zs嵩's avatar
zs嵩 committed
670
    <customer-follow ref="customerFollow" @refresh="handleQuery" @close="customerFollowVisible = false" v-if="customerFollowVisible" />
332784038@qq.com's avatar
332784038@qq.com committed
671 672 673 674 675
    <customer-complaints :customer-id="customerId" ref="customerComplaints"></customer-complaints>
    <transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer>
    <add-potential-custom ref="potentialCustom" @change="getList"></add-potential-custom>
    <customer-setting ref="customerSetting" @refresh="getList"></customer-setting>
    <customer-merge ref="customerMerge" @refresh="getList" :countryList="countryList" :getNodeLists="getNodeLists" :productTypeList="getNodeLists" :customerSelectFn="customerSelectFn" v-if="customerMergeVisible"></customer-merge>
lanbaoming's avatar
lanbaoming committed
676
    <!--业绩类型   -->
lanbaoming's avatar
lanbaoming committed
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
    <el-dialog title="业绩类型" :visible.sync="dialogVisible" width="30%">
      <div>
        <el-form>
          <el-form-item label="客户编号">{{ customData.number }}</el-form-item>
          <el-form-item label="客户名称">{{ customData.name }}</el-form-item>
          <el-form-item label="业绩类型">
            <el-radio-group v-model="currentisNew">
              <el-radio :label="true">{{ $t("新客户") }}</el-radio>
              <el-radio :label="false">{{ $t("老客户") }}</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
332784038@qq.com's avatar
332784038@qq.com committed
692
        <el-button :disabled="customData.isNew === currentisNew" type="primary" @click="modifyCustomer">修改</el-button>
lanbaoming's avatar
lanbaoming committed
693 694
      </span>
    </el-dialog>
lanbaoming's avatar
lanbaoming committed
695 696 697 698
  </div>
</template>

<script>
332784038@qq.com's avatar
332784038@qq.com committed
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721
import { createCustomer, updateCustomer, deleteCustomer, getCustomer, getCustomerPage, exportCustomerExcel, testEnterToOpenSea, getCustomerDeptPage, changeCustomerAir, getPotential, setChangeCustomerFcl, potentialExportExcel, deptExportExcel, recycleUnconfirmedCustomer, updatecustomerToOld, competitorListAll } from "@/api/ecw/customer"
import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict"
import { CommonStatusEnum } from "@/utils/constants"
import { uploadFile } from "@/api/infra/file"
import upload from "@/components/ImageUpload"
import { getNodeList } from "@/api/ecw/node"
import CustomerFollowList from "./components/customerFollow"
import customerComplaints from "@/components/customerComplaints"
import { listServiceUser, getUserProfile, listAllSimpl } from "@/api/system/user"
import { getCountryListAll } from "@/api/ecw/country"
import { getCreditPage } from "@/api/customer/credit"
import { customerExportExcel, changeCustomerDefaultPay, changeCustomerNoConsignee, changeCustomerDefaultBilling } from "@/api/ecw/customer"
import transferCustomer from "@/views/ecw/customer/transferCustomer"
import Template from "@/views/cms/template/index.vue"
import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue"
import Contacts from "@/views/ecw/customer/components/contacts.vue"
import CustomerSetting from "./components/customerSetting.vue"
import CustomerMerge from "./components/customerMerge.vue"
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue"
import { getCustomerSelect } from "@/api/ecw/customer"
import { getProductTypeList } from "@/api/ecw/productType"
import { getProductList } from "@/api/ecw/product"
import { listMySimpleDepts } from "@/api/system/dept"
zs嵩's avatar
zs嵩 committed
722 723 724 725
import UserSelector from "@/components/UserSelector/index.vue"
import CustomerFollow from "@/views/ecw/customer/components/customerFollow.vue"
import ProductSelector from "@/components/ProductSelector/index.vue"
import CompetitorSelector from "@/components/CompetitorSelector/index.vue"
lanbaoming's avatar
lanbaoming committed
726 727 728
export default {
  name: "EcwCustomerIndex",
  components: {
729 730
    ProductSelector,
    CompetitorSelector,
lanbaoming's avatar
lanbaoming committed
731 732 733 734 735 736
    Contacts,
    AddPotentialCustom,
    Template,
    upload,
    CustomerFollowList,
    customerComplaints,
lanbaoming's avatar
lanbaoming committed
737
    transferCustomer,
332784038@qq.com's avatar
0  
332784038@qq.com committed
738
    AreaCodeSelector,
yujinyao's avatar
yujinyao committed
739
    CustomerSetting,
740 741
    CustomerMerge,
    CustomerFollow
lanbaoming's avatar
lanbaoming committed
742 743 744
  },
  data() {
    return {
lanbaoming's avatar
lanbaoming committed
745
      env: process.env.NODE_ENV,
lanbaoming's avatar
lanbaoming committed
746
      getDictDatas,
zhengyi's avatar
zhengyi committed
747
      getDictDatas2,
lanbaoming's avatar
lanbaoming committed
748 749 750 751 752 753
      DICT_TYPE,
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
754
      showSearch: false,
lanbaoming's avatar
lanbaoming committed
755 756 757 758 759 760 761 762 763 764 765 766
      // 总条数
      total: 0,
      // 客户列表
      list: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      dateRangeCreateTime: [],
      // 查询参数
      queryParams: {
        pageNo: 1,
332784038@qq.com's avatar
332784038@qq.com committed
767
        pageSize: 10
余金瑶's avatar
余金瑶 committed
768
        /*number: null,
lanbaoming's avatar
lanbaoming committed
769 770 771 772 773 774
        name: null,
        level: null,
        source: null,
        customerService: null,
        status: null,
        department: null,
lanbaoming's avatar
lanbaoming committed
775 776 777
        creditLevel: null,
        country: null,
        resourceType: null,
778 779 780
        memberCode: null,
        memberName: null,
        memberMobile: null,
余金瑶's avatar
余金瑶 committed
781
        memberAreaCode: null,*/
lanbaoming's avatar
lanbaoming committed
782 783 784 785 786
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
lanbaoming's avatar
lanbaoming committed
787 788 789 790
        name: [
          {
            required: true,
            message: this.$t("客户名称不能为空"),
332784038@qq.com's avatar
332784038@qq.com committed
791 792
            trigger: "blur"
          }
lanbaoming's avatar
lanbaoming committed
793
        ],
332784038@qq.com's avatar
332784038@qq.com committed
794
        country: [{ required: true, message: this.$t("国家不能为空"), trigger: "blur" }],
lanbaoming's avatar
lanbaoming committed
795 796 797 798
        level: [
          {
            required: true,
            message: this.$t("客户等级不能为空"),
332784038@qq.com's avatar
332784038@qq.com committed
799 800
            trigger: "blur"
          }
lanbaoming's avatar
lanbaoming committed
801 802 803 804 805
        ],
        type: [
          {
            required: true,
            message: this.$t("客户类别不能为空"),
332784038@qq.com's avatar
332784038@qq.com committed
806 807
            trigger: "blur"
          }
lanbaoming's avatar
lanbaoming committed
808
        ],
lanbaoming's avatar
lanbaoming committed
809
        // createTime: [{ required: true, message: this.$t("创建时间不能为空"), trigger: "blur" }],
lanbaoming's avatar
lanbaoming committed
810 811 812 813
        source: [
          {
            required: true,
            message: this.$t("客户来源不能为空"),
332784038@qq.com's avatar
332784038@qq.com committed
814 815
            trigger: "blur"
          }
lanbaoming's avatar
lanbaoming committed
816 817 818 819 820
        ],
        customerService: [
          {
            required: true,
            message: this.$t("客户经理不能为空"),
332784038@qq.com's avatar
332784038@qq.com committed
821 822
            trigger: "blur"
          }
lanbaoming's avatar
lanbaoming committed
823 824 825 826 827
        ],
        status: [
          {
            required: true,
            message: this.$t("客户状态不能为空"),
332784038@qq.com's avatar
332784038@qq.com committed
828 829
            trigger: "blur"
          }
lanbaoming's avatar
lanbaoming committed
830 831 832 833 834
        ],
        founder: [
          {
            required: true,
            message: this.$t("创建人不能为空"),
332784038@qq.com's avatar
332784038@qq.com committed
835 836 837
            trigger: "blur"
          }
        ]
lanbaoming's avatar
lanbaoming committed
838 839 840 841
      },
      // 网点
      nodeList: [],
      showLine: false,
lanbaoming's avatar
lanbaoming committed
842 843
      customerId: undefined,
      customerServiceList: [],
lanbaoming's avatar
lanbaoming committed
844
      countryList: [],
lanbaoming's avatar
lanbaoming committed
845 846 847 848 849 850 851
      creditList: [],
      selectCustomerList: [],
      transferShow: false,
      dialogVisible: false,
      customData: {},
      currentisNew: false,
      userId: undefined, //lanbm 2024-05-23 add
852
      customerService: undefined,
853
      customerNumber: undefined,
余金瑶's avatar
余金瑶 committed
854
      customerFollowVisible: false,
yujinyao's avatar
yujinyao committed
855
      customerMergeVisible: false,
余金瑶's avatar
余金瑶 committed
856 857 858 859 860
      enterOpenSeaTime: [],
      customerServiceConfirmedTime: [],
      firstDealTime: [],
      customerSelect: [],
      recommended: [],
yujinyao's avatar
yujinyao committed
861 862 863 864
      getNodeLists: [],
      allSimplList: [],
      weightYearly: {
        key: "eqNumberKey",
332784038@qq.com's avatar
332784038@qq.com committed
865
        value: ""
yujinyao's avatar
yujinyao committed
866 867 868
      },
      numYearly: {
        key: "eqNumberKey",
332784038@qq.com's avatar
332784038@qq.com committed
869
        value: ""
yujinyao's avatar
yujinyao committed
870 871 872 873
      },
      productTypeList: [],
      productList: [],
      competitorList: [],
332784038@qq.com's avatar
332784038@qq.com committed
874 875
      deptList: []
    }
lanbaoming's avatar
lanbaoming committed
876
  },
lanbaoming's avatar
lanbaoming committed
877 878
  computed: {
    path() {
332784038@qq.com's avatar
332784038@qq.com committed
879
      return this.$route.path
lanbaoming's avatar
lanbaoming committed
880
    },
lanbaoming's avatar
lanbaoming committed
881 882 883 884 885 886 887
    channel() {
      return (val) => {
        return !!val
          ? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE)
              .filter((i) => (val.split(",") || []).includes(i.value))
              .map((i) => (this.isChinese ? i.label : i.labelEn))
              .join("")
332784038@qq.com's avatar
332784038@qq.com committed
888 889
          : ""
      }
lanbaoming's avatar
lanbaoming committed
890
    },
lanbaoming's avatar
lanbaoming committed
891
    isChinese() {
332784038@qq.com's avatar
332784038@qq.com committed
892
      return this.$i18n.locale === "zh_CN"
lanbaoming's avatar
lanbaoming committed
893
    },
lanbaoming's avatar
lanbaoming committed
894
    authorityFn() {
332784038@qq.com's avatar
332784038@qq.com committed
895
      let i = ""
lanbaoming's avatar
lanbaoming committed
896 897
      switch (this.$route.path) {
        case "/customer/department-customers":
332784038@qq.com's avatar
332784038@qq.com committed
898 899
          i = "dep-"
          break
lanbaoming's avatar
lanbaoming committed
900
        case "/customer/potential":
332784038@qq.com's avatar
332784038@qq.com committed
901 902
          i = "pot-"
          break
lanbaoming's avatar
lanbaoming committed
903
      }
332784038@qq.com's avatar
332784038@qq.com committed
904
      return i
lanbaoming's avatar
lanbaoming committed
905 906 907
    },
    selectAuthorityFn() {
      return (val) => {
332784038@qq.com's avatar
332784038@qq.com committed
908 909 910 911 912
        let t = val.split(":")
        t[t.length - 1] = this.authorityFn + t[t.length - 1]
        console.log(t.join(":"))
        return t.join(":")
      }
lanbaoming's avatar
lanbaoming committed
913
    },
余金瑶's avatar
余金瑶 committed
914 915
    customerSelectFn() {
      if (this.recommended.length > 0) {
332784038@qq.com's avatar
332784038@qq.com committed
916
        let i = this.customerSelect.find((item) => item.id === this.recommended[0].id)
余金瑶's avatar
余金瑶 committed
917
        if (!i) {
332784038@qq.com's avatar
332784038@qq.com committed
918
          this.customerSelect.push(this.recommended[0])
余金瑶's avatar
余金瑶 committed
919
        }
332784038@qq.com's avatar
332784038@qq.com committed
920
        return this.customerSelect
余金瑶's avatar
余金瑶 committed
921
      } else {
332784038@qq.com's avatar
332784038@qq.com committed
922
        return this.customerSelect
余金瑶's avatar
余金瑶 committed
923 924 925
      }
    },
    combinedQueryParams() {
926
      let queryParams = {}
余金瑶's avatar
余金瑶 committed
927
      if (this.enterOpenSeaTime && this.enterOpenSeaTime.length == 2) {
928 929
        queryParams.beginEnterOpenSeaTime = this.enterOpenSeaTime[0]
        queryParams.endEnterOpenSeaTime = this.enterOpenSeaTime[1]
余金瑶's avatar
余金瑶 committed
930 931
      }
      if (this.customerServiceConfirmedTime && this.customerServiceConfirmedTime.length == 2) {
yujinyao's avatar
yujinyao committed
932 933
        queryParams.beginCustomerServiceConfirmedTime = this.customerServiceConfirmedTime[0]
        queryParams.endCustomerServiceConfirmedTime = this.customerServiceConfirmedTime[1]
余金瑶's avatar
余金瑶 committed
934 935
      }
      if (this.dateRangeCreateTime && this.dateRangeCreateTime.length == 2) {
936 937
        queryParams.beginCreateTime = this.dateRangeCreateTime[0]
        queryParams.endCreateTime = this.dateRangeCreateTime[1]
余金瑶's avatar
余金瑶 committed
938 939
      }
      if (this.firstDealTime && this.firstDealTime.length == 2) {
940 941
        queryParams.beginFirstDealTime = this.firstDealTime[0]
        queryParams.endFirstDealTime = this.firstDealTime[1]
yujinyao's avatar
yujinyao committed
942 943
      }
      if (this.weightYearly.value) {
332784038@qq.com's avatar
332784038@qq.com committed
944
        let key = "eqWeightYearly"
332784038@qq.com's avatar
0  
332784038@qq.com committed
945
        if (this.weightYearly.key == "leNumberKey") {
332784038@qq.com's avatar
332784038@qq.com committed
946
          key = "leWeightYearly"
332784038@qq.com's avatar
0  
332784038@qq.com committed
947
        } else if (this.weightYearly.key == "geNumberKey") {
332784038@qq.com's avatar
332784038@qq.com committed
948
          key = "geWeightYearly"
yujinyao's avatar
yujinyao committed
949
        }
332784038@qq.com's avatar
332784038@qq.com committed
950
        queryParams[key] = this.weightYearly.value
yujinyao's avatar
yujinyao committed
951 952
      }
      if (this.numYearly.value) {
332784038@qq.com's avatar
332784038@qq.com committed
953
        let key = "eqNumYearly"
332784038@qq.com's avatar
0  
332784038@qq.com committed
954
        if (this.numYearly.key == "leNumberKey") {
332784038@qq.com's avatar
332784038@qq.com committed
955
          key = "leNumYearly"
332784038@qq.com's avatar
0  
332784038@qq.com committed
956
        } else if (this.numYearly.key == "geNumberKey") {
332784038@qq.com's avatar
332784038@qq.com committed
957
          key = "geNumYearly"
yujinyao's avatar
yujinyao committed
958
        }
332784038@qq.com's avatar
332784038@qq.com committed
959
        queryParams[key] = this.numYearly.value
余金瑶's avatar
余金瑶 committed
960 961
      }

332784038@qq.com's avatar
332784038@qq.com committed
962 963
      return queryParams
    }
lanbaoming's avatar
lanbaoming committed
964
  },
lanbaoming's avatar
lanbaoming committed
965 966 967
  watch: {
    selectCustomerList(val) {
      if (val.length === 0) {
332784038@qq.com's avatar
332784038@qq.com committed
968 969
        this.getList()
        this.$refs.multipleTable.clearSelection()
lanbaoming's avatar
lanbaoming committed
970
      }
332784038@qq.com's avatar
332784038@qq.com committed
971
    }
lanbaoming's avatar
lanbaoming committed
972 973
  },
  created() {
lanbaoming's avatar
lanbaoming committed
974
    getCreditPage({ page: 1, rows: 999 }).then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
975 976 977
      this.creditList = r.data.list
    })
    this.getList()
lanbaoming's avatar
lanbaoming committed
978
    listServiceUser().then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
979 980
      this.customerServiceList = r.data
    })
lanbaoming's avatar
lanbaoming committed
981
    getCountryListAll().then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
982 983
      this.countryList = r.data
    })
lanbaoming's avatar
lanbaoming committed
984 985
    //获取用户id信息 lanbm 2024-05-23 add
    getUserProfile().then((res) => {
332784038@qq.com's avatar
332784038@qq.com committed
986 987 988
      this.userId = res.data.id
    })
    this.getCustomerSelect()
yujinyao's avatar
yujinyao committed
989
    getNodeList().then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
990 991
      this.getNodeLists = r.data
    })
yujinyao's avatar
yujinyao committed
992
    listAllSimpl().then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
993 994
      this.allSimplList = r.data
    })
yujinyao's avatar
yujinyao committed
995
    getProductTypeList().then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
996 997
      this.productTypeList = r.data
    })
yujinyao's avatar
yujinyao committed
998
    competitorListAll().then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
999
      this.competitorList = r.data
yujinyao's avatar
yujinyao committed
1000
    })
332784038@qq.com's avatar
0  
332784038@qq.com committed
1001
    listMySimpleDepts().then((response) => {
yujinyao's avatar
yujinyao committed
1002 1003
      this.deptList = response.data
    })
lanbaoming's avatar
lanbaoming committed
1004
  },
yujinyao's avatar
yujinyao committed
1005 1006 1007 1008
  updated() {
    this.$nextTick(() => {
      this.$refs.multipleTable.doLayout()
    })
lanbaoming's avatar
lanbaoming committed
1009
  },
lanbaoming's avatar
lanbaoming committed
1010
  activated() {
332784038@qq.com's avatar
332784038@qq.com committed
1011
    this.getList()
lanbaoming's avatar
lanbaoming committed
1012 1013
  },
  methods: {
1014 1015 1016 1017 1018
    onCompetitorChange(row, competitor) {
      // row.goodsType = product ? product.typeId : null
      row.id = !competitor
        ? []
        : competitor.id
zs嵩's avatar
zs嵩 committed
1019 1020 1021
            .split(",")
            .filter((item) => item !== "")
            .map((item) => +item)
1022 1023 1024 1025 1026 1027
      if (competitor) {
        this.$set(this.names, competitor.id, {
          name: competitor.name
        })
      }
    },
yujinyao's avatar
yujinyao committed
1028
    //合并客户
lanbaoming's avatar
lanbaoming committed
1029
    handleMergeCus() {
yujinyao's avatar
yujinyao committed
1030
      this.customerMergeVisible = true
332784038@qq.com's avatar
332784038@qq.com committed
1031 1032 1033
      this.$nextTick((_) => {
        this.$refs["customerMerge"].init()
        this.$refs["customerMerge"].dialogVisible = true
yujinyao's avatar
yujinyao committed
1034
      })
lanbaoming's avatar
lanbaoming committed
1035
    },
1036 1037 1038 1039 1040 1041
    handleCustomerFollowLink(row) {
      this.customerFollowVisible = true
      this.$nextTick((_) => {
        this.$refs["customerFollow"].handleView(row)
      })
    },
lanbaoming's avatar
lanbaoming committed
1042 1043 1044 1045
    recovery(row) {
      this.$confirm(this.$t("是否要回收当前{name}", row), "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
332784038@qq.com's avatar
332784038@qq.com committed
1046
        type: "warning"
lanbaoming's avatar
lanbaoming committed
1047 1048 1049
      })
        .then(() => {
          recycleUnconfirmedCustomer({ customerId: row.id }).then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
1050 1051 1052
            this.$message.success(this.$t("回收成功。"))
            this.getList()
          })
lanbaoming's avatar
lanbaoming committed
1053
        })
lanbaoming's avatar
lanbaoming committed
1054
        .catch(() => {
332784038@qq.com's avatar
332784038@qq.com committed
1055 1056
          this.$message.info(this.$t("已取消"))
        })
lanbaoming's avatar
lanbaoming committed
1057 1058
    },
    // 设置整柜
lanbaoming's avatar
lanbaoming committed
1059
    setFullContainerLoad(isFcl) {
lanbaoming's avatar
lanbaoming committed
1060
      setChangeCustomerFcl({
lanbaoming's avatar
lanbaoming committed
1061
        customerIdList: this.selectCustomerList,
332784038@qq.com's avatar
332784038@qq.com committed
1062
        isFcl
lanbaoming's avatar
lanbaoming committed
1063 1064
      }).then((r) => {
        if (r.code === 0) {
332784038@qq.com's avatar
332784038@qq.com committed
1065 1066 1067
          this.$message.success(isFcl ? "设置客户为海运整柜成功!" : "设置客户为非海运整柜成功!")
          this.selectCustomerList = []
          this.getList()
lanbaoming's avatar
lanbaoming committed
1068
        }
332784038@qq.com's avatar
332784038@qq.com committed
1069
      })
lanbaoming's avatar
lanbaoming committed
1070 1071
    },
    // 设置空运客户
lanbaoming's avatar
lanbaoming committed
1072
    setChangeCustomerAir(isAir) {
lanbaoming's avatar
lanbaoming committed
1073
      changeCustomerAir({
lanbaoming's avatar
lanbaoming committed
1074
        customerIdList: this.selectCustomerList,
332784038@qq.com's avatar
332784038@qq.com committed
1075
        isAir
lanbaoming's avatar
lanbaoming committed
1076
      }).then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
1077
        console.log(r)
lanbaoming's avatar
lanbaoming committed
1078
        if (r.code === 0) {
332784038@qq.com's avatar
332784038@qq.com committed
1079 1080 1081
          this.$message.success(isAir ? "设为空运客户成功!" : "设为非空运客户成功!")
          this.selectCustomerList = []
          this.getList()
lanbaoming's avatar
lanbaoming committed
1082
        }
332784038@qq.com's avatar
332784038@qq.com committed
1083
      })
lanbaoming's avatar
lanbaoming committed
1084 1085 1086
    },
    /** 取消按钮 */
    cancel() {
332784038@qq.com's avatar
332784038@qq.com committed
1087 1088
      this.open = false
      this.reset()
lanbaoming's avatar
lanbaoming committed
1089
    },
lanbaoming's avatar
lanbaoming committed
1090
    complaint(row) {
332784038@qq.com's avatar
332784038@qq.com committed
1091
      this.customerId = row.id
lanbaoming's avatar
lanbaoming committed
1092
      this.$nextTick(() => {
332784038@qq.com's avatar
332784038@qq.com committed
1093 1094
        this.$refs.customerComplaints.handleAdd()
      })
lanbaoming's avatar
lanbaoming committed
1095 1096
    },
    countryFormatter(row, column, cellValue) {
332784038@qq.com's avatar
332784038@qq.com committed
1097 1098
      const country = this.countryList.find((e) => e.id === cellValue)
      return this.isChinese ? country?.nameZh : country?.nameEn
lanbaoming's avatar
lanbaoming committed
1099
    },
lanbaoming's avatar
lanbaoming committed
1100
    delay(row) {
332784038@qq.com's avatar
332784038@qq.com committed
1101
      this.$router.push({ path: "/customer/delay", query: { id: row.id } })
lanbaoming's avatar
lanbaoming committed
1102
    },
lanbaoming's avatar
lanbaoming committed
1103
    followUp(row) {
1104 1105 1106
      this.customerId = row.id
      this.customerService = row.customerService
      this.customerNumber = row.number
余金瑶's avatar
余金瑶 committed
1107
      this.customerFollowVisible = true
332784038@qq.com's avatar
0  
332784038@qq.com committed
1108
      this.$nextTick((_) => {
余金瑶's avatar
余金瑶 committed
1109
        // this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
332784038@qq.com's avatar
332784038@qq.com committed
1110 1111
        this.$refs["CustomerFollowList"].init()
        this.$refs["CustomerFollowList"].handleAdd()
余金瑶's avatar
余金瑶 committed
1112
      })
lanbaoming's avatar
lanbaoming committed
1113
    },
liuzeheng's avatar
liuzeheng committed
1114
    //报价
lanbaoming's avatar
lanbaoming committed
1115 1116 1117
    quote(row) {
      //lanbm 2024-05-23 添加报价是判断客户所属客户经理,不是就不能报价
      if (row.customerService != this.userId) {
332784038@qq.com's avatar
332784038@qq.com committed
1118 1119
        this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"))
        return
lanbaoming's avatar
lanbaoming committed
1120 1121
      }
      //this.$router.push({path:'/offer/create',query:{id:row.id}})
332784038@qq.com's avatar
332784038@qq.com committed
1122 1123 1124
      this.$router.push({ path: "/offer/create", query: { customerId: row.id, customerType: row.type, type: 1 } }).then({
        //this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
      })
liuzeheng's avatar
liuzeheng committed
1125
    },
lanbaoming's avatar
lanbaoming committed
1126 1127
    /** 查询列表 */
    getList() {
332784038@qq.com's avatar
332784038@qq.com committed
1128
      this.loading = true
余金瑶's avatar
余金瑶 committed
1129
      // 处理查询参数}
332784038@qq.com's avatar
332784038@qq.com committed
1130
      let params = { ...this.queryParams, ...this.combinedQueryParams }
余金瑶's avatar
余金瑶 committed
1131
      /*this.addBeginAndEndTime(
lanbaoming's avatar
lanbaoming committed
1132 1133 1134 1135
        params,
        this.dateRangeCreateTime,
        "createTime",
        false
余金瑶's avatar
余金瑶 committed
1136
      );*/
lanbaoming's avatar
lanbaoming committed
1137
      // 执行查询
lanbaoming's avatar
lanbaoming committed
1138 1139
      switch (this.$route.path) {
        case "/customer/customer":
332784038@qq.com's avatar
332784038@qq.com committed
1140 1141
          getCustomerPage(params).then(this.setData)
          break
lanbaoming's avatar
lanbaoming committed
1142
        case "/customer/department-customers":
332784038@qq.com's avatar
332784038@qq.com committed
1143 1144
          getCustomerDeptPage(params).then(this.setData)
          break
lanbaoming's avatar
lanbaoming committed
1145
        case "/customer/potential":
332784038@qq.com's avatar
332784038@qq.com committed
1146 1147
          getPotential(params).then(this.setData)
          break
lanbaoming's avatar
lanbaoming committed
1148 1149
      }
    },
余金瑶's avatar
余金瑶 committed
1150
    remoteMethod(val) {
332784038@qq.com's avatar
332784038@qq.com committed
1151
      this.getCustomerSelect(val)
余金瑶's avatar
余金瑶 committed
1152 1153
    },
    getCustomerSelect(val = "") {
332784038@qq.com's avatar
332784038@qq.com committed
1154 1155 1156
      getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then((res) => {
        this.customerSelect = res.data.list
      })
余金瑶's avatar
余金瑶 committed
1157
    },
yujinyao's avatar
yujinyao committed
1158
    handleSelectProductType(val) {
yujinyao's avatar
yujinyao committed
1159 1160 1161 1162
      if (val && val.length >= 1) {
        this.queryParams.productIds = []
        getProductList({ typeIds: val }).then((r) => {
          this.productList = r.data
332784038@qq.com's avatar
332784038@qq.com committed
1163
        })
yujinyao's avatar
yujinyao committed
1164 1165 1166 1167
      } else {
        this.queryParams.productIds = []
        this.productList = []
      }
yujinyao's avatar
yujinyao committed
1168
    },
lanbaoming's avatar
lanbaoming committed
1169 1170
    /** 新增按钮操作 */
    handleAdd() {
332784038@qq.com's avatar
332784038@qq.com committed
1171
      this.$router.push("/customer/add-edit/0")
lanbaoming's avatar
lanbaoming committed
1172 1173 1174 1175 1176
      // this.reset();
      // this.open = true;
      // this.title = this.$t("添加客户");
    },
    // 新增潜在客户
lanbaoming's avatar
lanbaoming committed
1177
    handleAddPotential() {
332784038@qq.com's avatar
332784038@qq.com committed
1178
      this.$refs.potentialCustom.dialogTableVisible = true
lanbaoming's avatar
lanbaoming committed
1179 1180 1181
    },
    /** 删除按钮操作 */
    handleDelete(row) {
332784038@qq.com's avatar
332784038@qq.com committed
1182 1183 1184
      const id = row.id
      const name = row.name
      const number = row.number
lanbaoming's avatar
lanbaoming committed
1185
      this.$modal
332784038@qq.com's avatar
332784038@qq.com committed
1186
        .confirm(this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?'))
lanbaoming's avatar
lanbaoming committed
1187
        .then(function () {
332784038@qq.com's avatar
332784038@qq.com committed
1188
          return deleteCustomer(id)
lanbaoming's avatar
lanbaoming committed
1189 1190
        })
        .then(() => {
332784038@qq.com's avatar
332784038@qq.com committed
1191 1192
          this.getList()
          this.$modal.msgSuccess(this.$t("删除成功"))
lanbaoming's avatar
lanbaoming committed
1193
        })
332784038@qq.com's avatar
332784038@qq.com committed
1194
        .catch(() => {})
lanbaoming's avatar
lanbaoming committed
1195 1196 1197
    },
    /** 导出按钮操作 */
    handleExport() {
332784038@qq.com's avatar
332784038@qq.com committed
1198 1199
      let func = null
      let title = ""
lanbaoming's avatar
lanbaoming committed
1200 1201
      switch (this.$route.path) {
        case "/customer/customer":
332784038@qq.com's avatar
332784038@qq.com committed
1202 1203 1204
          func = customerExportExcel
          title = "是否确认导出所有客户数据项?"
          break
lanbaoming's avatar
lanbaoming committed
1205
        case "/customer/department-customers":
332784038@qq.com's avatar
332784038@qq.com committed
1206 1207 1208
          func = deptExportExcel
          title = "是否确认导出部门客户数据项?"
          break
lanbaoming's avatar
lanbaoming committed
1209
        case "/customer/potential":
332784038@qq.com's avatar
332784038@qq.com committed
1210 1211 1212
          func = potentialExportExcel
          title = "是否确认导出潜在客户数据项?"
          break
lanbaoming's avatar
lanbaoming committed
1213 1214 1215
      }

      // // 执行导出
lanbaoming's avatar
lanbaoming committed
1216 1217 1218 1219
      this.$modal
        .confirm(this.$t(title))
        .then(() => {
          func().then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
1220 1221
            this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"))
          })
lanbaoming's avatar
lanbaoming committed
1222
        })
332784038@qq.com's avatar
332784038@qq.com committed
1223
        .catch(() => {})
lanbaoming's avatar
lanbaoming committed
1224 1225 1226
    },
    /** 搜索按钮操作 */
    handleQuery() {
332784038@qq.com's avatar
332784038@qq.com committed
1227 1228
      this.queryParams.pageNo = 1
      this.getList()
lanbaoming's avatar
lanbaoming committed
1229
    },
lanbaoming's avatar
lanbaoming committed
1230
    handleSelectionChange(val) {
332784038@qq.com's avatar
332784038@qq.com committed
1231
      this.selectCustomerList = val.map((i) => i.id)
lanbaoming's avatar
lanbaoming committed
1232 1233 1234
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
332784038@qq.com's avatar
332784038@qq.com committed
1235 1236
      console.log(row.id)
      this.$router.push("/customer/add-edit/" + row.id)
lanbaoming's avatar
lanbaoming committed
1237 1238 1239 1240 1241 1242 1243 1244 1245 1246
      // this.reset();
      // const id = row.id;
      // getCustomer(id).then(response => {
      //   this.form = { ...this.form, ...response.data };
      //   this.open = true;
      //   this.title = this.$t("修改客户");
      // });
    },
    /** 查看按钮操作 */
    handleView(row) {
332784038@qq.com's avatar
332784038@qq.com committed
1247
      this.$router.push("/customer/query/" + row.id)
lanbaoming's avatar
lanbaoming committed
1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260
    },
    /** 表单重置 */
    reset() {
      this.form = {
        id: undefined,
        number: undefined,
        name: undefined,
        level: undefined,
        country: undefined,
        type: undefined,
        agentId: undefined,
        company: undefined,
        address: undefined,
1261 1262
        productTypes: undefined,
        productIds: undefined,
lanbaoming's avatar
lanbaoming committed
1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285
        pickupPoint: undefined,
        memberId: undefined,
        birthday: undefined,
        balance: undefined,
        source: undefined,
        picture: undefined,
        customerService: undefined,
        customerContacts: [],
        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,
332784038@qq.com's avatar
332784038@qq.com committed
1286 1287 1288
        weightUnit: undefined
      }
      this.resetForm("form")
lanbaoming's avatar
lanbaoming committed
1289 1290 1291
    },
    /** 重置按钮操作 */
    resetQuery() {
332784038@qq.com's avatar
332784038@qq.com committed
1292
      this.dateRangeCreateTime = []
yujinyao's avatar
yujinyao committed
1293 1294 1295
      this.enterOpenSeaTime = []
      this.customerServiceConfirmedTime = []
      this.firstDealTime = []
332784038@qq.com's avatar
332784038@qq.com committed
1296
      this.resetForm("queryForm")
lanbaoming's avatar
lanbaoming committed
1297 1298
      this.queryParams = {
        pageNo: 1,
332784038@qq.com's avatar
332784038@qq.com committed
1299 1300 1301 1302 1303
        pageSize: 10
      }
      this.weightYearly.value = ""
      this.numYearly.value = ""
      this.handleQuery()
lanbaoming's avatar
lanbaoming committed
1304 1305 1306
    },
    /** 调入公海池测试用 */
    seasPond(row) {
lanbaoming's avatar
lanbaoming committed
1307 1308
      testEnterToOpenSea(row.id).then((r) => {
        if (r.code === 0) {
332784038@qq.com's avatar
332784038@qq.com committed
1309 1310
          this.$t("调入公海池成功!")
          this.getList()
lanbaoming's avatar
lanbaoming committed
1311
        }
332784038@qq.com's avatar
332784038@qq.com committed
1312
      })
lanbaoming's avatar
lanbaoming committed
1313
    },
lanbaoming's avatar
lanbaoming committed
1314
    setData(response) {
332784038@qq.com's avatar
332784038@qq.com committed
1315 1316 1317 1318
      console.log(response, "response")
      this.list = response.data.list
      this.total = response.data.total
      this.loading = false
lanbaoming's avatar
lanbaoming committed
1319 1320 1321
    },
    /** 提交按钮 */
    submitForm() {
lanbaoming's avatar
lanbaoming committed
1322
      this.$refs["form"].validate((valid) => {
lanbaoming's avatar
lanbaoming committed
1323 1324 1325 1326 1327
        if (!valid) {
          // return;
        }
        // 修改的提交
        if (this.form.id != null) {
lanbaoming's avatar
lanbaoming committed
1328
          updateCustomer(this.form).then((response) => {
332784038@qq.com's avatar
332784038@qq.com committed
1329 1330 1331 1332 1333
            this.$modal.msgSuccess(this.$t("修改成功"))
            this.open = false
            this.getList()
          })
          return
lanbaoming's avatar
lanbaoming committed
1334 1335
        }
        // 添加的提交
lanbaoming's avatar
lanbaoming committed
1336
        createCustomer(this.form).then((response) => {
332784038@qq.com's avatar
332784038@qq.com committed
1337 1338 1339 1340 1341
          this.$modal.msgSuccess(this.$t("新增成功"))
          this.open = false
          this.getList()
        })
      })
lanbaoming's avatar
lanbaoming committed
1342
    },
lanbaoming's avatar
lanbaoming committed
1343 1344
    // 修改客户类型
    modifyCustomer() {
332784038@qq.com's avatar
332784038@qq.com committed
1345 1346 1347 1348 1349
      this.$confirm(this.$t("修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?"), this.$t("提示"), {
        confirmButtonText: this.$t("确定"),
        cancelButtonText: this.$t("取消"),
        type: "warning"
      })
lanbaoming's avatar
lanbaoming committed
1350 1351 1352
        .then(() => {
          updatecustomerToOld({
            customerId: this.customData.id,
332784038@qq.com's avatar
332784038@qq.com committed
1353
            isNew: this.currentisNew
lanbaoming's avatar
lanbaoming committed
1354
          }).then((r) => {
332784038@qq.com's avatar
332784038@qq.com committed
1355 1356 1357 1358
            this.$message.success(this.$t("修改成功"))
            this.dialogVisible = false
            this.getList()
          })
lanbaoming's avatar
lanbaoming committed
1359
        })
332784038@qq.com's avatar
332784038@qq.com committed
1360
        .catch(() => {})
lanbaoming's avatar
lanbaoming committed
1361
    },
1362 1363 1364 1365
    setDefaultPay() {
      changeCustomerDefaultPay({
        customerIdList: this.selectCustomerList,
        defaultPay: true
332784038@qq.com's avatar
0  
332784038@qq.com committed
1366
      }).then((_) => {
1367 1368 1369 1370 1371 1372 1373 1374
        this.$message.success(this.$t("操作成功"))
        this.getList()
      })
    },
    setNoConsignee() {
      changeCustomerNoConsignee({
        customerIdList: this.selectCustomerList,
        noConsigee: true
332784038@qq.com's avatar
0  
332784038@qq.com committed
1375
      }).then((_) => {
1376 1377 1378
        this.$message.success(this.$t("操作成功"))
        this.getList()
      })
yujinyao's avatar
yujinyao committed
1379 1380 1381 1382 1383
    },
    setDefaultBilling() {
      changeCustomerDefaultBilling({
        customerIdList: this.selectCustomerList,
        defaultBilling: true
332784038@qq.com's avatar
0  
332784038@qq.com committed
1384
      }).then((_) => {
yujinyao's avatar
yujinyao committed
1385 1386 1387
        this.$message.success(this.$t("操作成功"))
        this.getList()
      })
余金瑶's avatar
余金瑶 committed
1388
    },
yujinyao's avatar
yujinyao committed
1389
    handleSetting(row) {
332784038@qq.com's avatar
332784038@qq.com committed
1390 1391 1392
      this.$refs["customerSetting"].dialogVisible = true
      this.$nextTick((_) => {
        this.$refs["customerSetting"].init(row.id)
yujinyao's avatar
yujinyao committed
1393
      })
余金瑶's avatar
余金瑶 committed
1394 1395 1396
    },
    getBusiCountryNames(ids) {
      if (ids) {
332784038@qq.com's avatar
332784038@qq.com committed
1397
        const idsArr = ids.split(",")
余金瑶's avatar
余金瑶 committed
1398
        const strArr = []
332784038@qq.com's avatar
0  
332784038@qq.com committed
1399
        this.countryList.forEach((item) => {
余金瑶's avatar
余金瑶 committed
1400
          if (idsArr.includes(item.id.toString())) {
1401
            strArr.push(this.isChinese ? item.nameZh : item.nameEn)
余金瑶's avatar
余金瑶 committed
1402 1403
          }
        })
332784038@qq.com's avatar
332784038@qq.com committed
1404
        return strArr.length > 0 ? strArr.join(",") : null
余金瑶's avatar
余金瑶 committed
1405
      } else {
1406
        return null
余金瑶's avatar
余金瑶 committed
1407 1408 1409 1410
      }
    },
    getPickupPointNames(ids) {
      if (ids) {
332784038@qq.com's avatar
332784038@qq.com committed
1411
        const idsArr = ids.split(",")
余金瑶's avatar
余金瑶 committed
1412
        const strArr = []
332784038@qq.com's avatar
332784038@qq.com committed
1413
        this.getNodeLists.forEach((item) => {
余金瑶's avatar
余金瑶 committed
1414
          if (idsArr.includes(item.id.toString())) {
1415
            strArr.push(this.isChinese ? item.titleZh : item.titleEn)
余金瑶's avatar
余金瑶 committed
1416 1417
          }
        })
332784038@qq.com's avatar
332784038@qq.com committed
1418
        return strArr.length > 0 ? strArr.join(",") : null
余金瑶's avatar
余金瑶 committed
1419 1420 1421 1422
      } else {
        return null
      }
    },
zhengyi's avatar
zhengyi committed
1423
    getCustomerRoles(ids) {
余金瑶's avatar
余金瑶 committed
1424
      if (ids) {
332784038@qq.com's avatar
332784038@qq.com committed
1425
        const idsArr = ids.split(",")
zhengyi's avatar
zhengyi committed
1426
        const strArr = []
332784038@qq.com's avatar
332784038@qq.com committed
1427
        DICT_TYPE.CUSTOMER_ROLE.forEach((item) => {
zhengyi's avatar
zhengyi committed
1428 1429
          if (idsArr.includes(item.value.toString())) {
            strArr.push(this.isChinese ? item.label : item.labelEn)
余金瑶's avatar
余金瑶 committed
1430
          }
zhengyi's avatar
zhengyi committed
1431
        })
332784038@qq.com's avatar
332784038@qq.com committed
1432
        return strArr.length > 0 ? strArr.join(",") : null
余金瑶's avatar
余金瑶 committed
1433
      } else {
1434
        return null
余金瑶's avatar
余金瑶 committed
1435 1436 1437 1438
      }
    },
    getProductTypeNames(ids) {
      if (ids) {
332784038@qq.com's avatar
332784038@qq.com committed
1439
        const idsArr = ids.toString().split(",")
余金瑶's avatar
余金瑶 committed
1440
        const strArr = []
332784038@qq.com's avatar
0  
332784038@qq.com committed
1441
        this.productTypeList.forEach((item) => {
余金瑶's avatar
余金瑶 committed
1442
          if (idsArr.includes(item.id.toString())) {
1443
            strArr.push(this.isChinese ? item.titleZh : item.titleEn)
余金瑶's avatar
余金瑶 committed
1444 1445
          }
        })
332784038@qq.com's avatar
332784038@qq.com committed
1446
        return strArr.length > 0 ? strArr.join(",") : null
余金瑶's avatar
余金瑶 committed
1447
      } else {
1448
        return null
余金瑶's avatar
余金瑶 committed
1449 1450 1451 1452
      }
    },
    getPromoterName(id) {
      if (id) {
332784038@qq.com's avatar
332784038@qq.com committed
1453
        let strName = ""
332784038@qq.com's avatar
0  
332784038@qq.com committed
1454
        for (const item of this.customerSelectFn) {
余金瑶's avatar
余金瑶 committed
1455
          if (item.id == id) {
1456 1457
            strName = item.name
            break
余金瑶's avatar
余金瑶 committed
1458 1459
          }
        }
1460
        return strName
余金瑶's avatar
余金瑶 committed
1461
      } else {
1462
        return null
余金瑶's avatar
余金瑶 committed
1463
      }
1464
    }
332784038@qq.com's avatar
332784038@qq.com committed
1465 1466
  }
}
lanbaoming's avatar
lanbaoming committed
1467
</script>