customerFollowSelectOffer.vue 6.15 KB
Newer Older
yujinyao's avatar
yujinyao committed
1
<template>
2
  <el-dialog append-to-body :title="$t('报价单')" :visible.sync="offerDialogVisible" :close-on-click-modal="false" width="80%" @close="$emit('close')">
yujinyao's avatar
yujinyao committed
3 4
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
      <el-form-item :label="$t('编号')" prop="searchNumber">
5
        <el-input v-model="queryParams.searchNumber" :placeholder="$t('请输入报价单号、订单号')" clearable @keyup.enter.native="handleQuery" />
yujinyao's avatar
yujinyao committed
6 7
      </el-form-item>
      <el-form-item :label="$t('客户')" prop="searchCustomer">
8
        <el-input v-model="queryParams.searchCustomer" :placeholder="$t('请输入客户')" clearable @keyup.enter.native="handleQuery" />
yujinyao's avatar
yujinyao committed
9 10 11 12 13
      </el-form-item>
      <el-form-item :label="$t('客户经理')" prop="followUpSalesmanId">
        <user-selector v-model="queryParams.followUpSalesmanId" clearable />
      </el-form-item>
      <el-form-item>
14 15
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
yujinyao's avatar
yujinyao committed
16 17 18 19
      </el-form-item>
    </el-form>
    <el-table :data="offerList" border size="mini">
      <el-table-column align="center" width="80">
20
        <template slot-scope="{ row }">
yujinyao's avatar
yujinyao committed
21 22 23
          <el-radio v-model="offerId" :label="row.offerId">&nbsp;</el-radio>
        </template>
      </el-table-column>
yujinyao's avatar
yujinyao committed
24
      <el-table-column :label="$t('报价单号')" min-width="160px">
25 26
        <template slot-scope="{ row }">
          <el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)">{{ row.number }}</el-link>
yujinyao's avatar
yujinyao committed
27 28
        </template>
      </el-table-column>
yujinyao's avatar
yujinyao committed
29
      <el-table-column :label="$t('销售阶段')" min-width="120">
30
        <template slot-scope="{ row }">
yujinyao's avatar
yujinyao committed
31 32 33
          <dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="row.status" />
        </template>
      </el-table-column>
yujinyao's avatar
yujinyao committed
34
      <el-table-column :label="$t('订单编号')" min-width="150px">
35 36
        <template slot-scope="{ row }">
          <el-link type="primary" @click.native="$router.push('/order/detail?orderId=' + row.orderId)">{{ row.orderNo }}</el-link>
yujinyao's avatar
yujinyao committed
37 38 39
        </template>
      </el-table-column>
      <el-table-column :label="$t('客户编号')" align="center" min-width="100">
40 41
        <template slot-scope="{ row }">
          <el-link type="primary" @click.native="$router.push('/customer/query/' + row.relationId)">{{ row.customerNumber }}</el-link>
42
        </template>
yujinyao's avatar
yujinyao committed
43 44 45
      </el-table-column>
      <el-table-column :label="$t('客户名称')" align="center" prop="relationName" min-width="100" />
      <el-table-column :label="$t('联系方式')">
46
        <template slot-scope="scope"> +{{ scope.row.relationAreaCode }}{{ scope.row.relationPhone }} </template>
yujinyao's avatar
yujinyao committed
47
      </el-table-column>
yujinyao's avatar
yujinyao committed
48
      <el-table-column :label="$t('运输方式')">
49
        <template slot-scope="scope">
yujinyao's avatar
yujinyao committed
50 51 52
          <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportId" />
        </template>
      </el-table-column>
53 54
      <el-table-column :label="$t('渠道')" align="center" min-width="120" prop="channelName"> </el-table-column>
      <el-table-column :label="$t('始发地')" align="center" min-width="120" prop="departureName"> </el-table-column>
yujinyao's avatar
yujinyao committed
55 56
      <el-table-column :label="$t('目的地')" align="center" prop="objectiveName" min-width="120" />
      <el-table-column :label="$t('预计销售额')" min-width="160">
57
        <template slot-scope="{ row }">
yujinyao's avatar
yujinyao committed
58 59
          <div class="" v-for="(item, feeIndex) in row.estCostVO.feeDtoList" :key="feeIndex">
            <dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" />
60
            {{ item.amount }} {{ currencyMap[item.currencyId] }}
yujinyao's avatar
yujinyao committed
61 62 63
          </div>
        </template>
      </el-table-column>
yujinyao's avatar
yujinyao committed
64 65
      <el-table-column :label="$t('客户经理')" prop="creatorName" align="center" min-width="100" />
      <el-table-column :label="$t('创建时间')" align="center" min-width="160">
yujinyao's avatar
yujinyao committed
66 67 68 69 70 71
        <template slot-scope="scope">
          {{ parseTime(scope.row.createTime) }}
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
72
    <pagination v-show="offerTotal > 0" :total="offerTotal" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getOfferList" />
yujinyao's avatar
yujinyao committed
73
    <div slot="footer" class="dialog-footer">
74
      <el-button type="primary" @click="confirm">{{ $t("确 定") }}</el-button>
yujinyao's avatar
yujinyao committed
75 76 77 78 79
    </div>
  </el-dialog>
</template>

<script>
80
import { getCurrencyList } from "@/api/ecw/currency"
yujinyao's avatar
yujinyao committed
81
import { getOfferPage } from "@/api/ecw/offer"
82
import UserSelector from "@/components/UserSelector"
yujinyao's avatar
yujinyao committed
83 84 85 86 87 88

export default {
  name: "CustomerFollowSelectOffer",
  components: {
    UserSelector
  },
89
  props: {
90
    customerId: Number
91
  },
yujinyao's avatar
yujinyao committed
92 93 94 95 96 97 98 99 100 101
  data() {
    return {
      offerId: null,
      offerDialogVisible: false,
      queryParams: {
        pageNo: 1,
        pageSize: 6
      },
      offerList: [],
      offerTotal: 0,
102
      currencyList: []
yujinyao's avatar
yujinyao committed
103 104 105
    }
  },
  created() {
106
    getCurrencyList().then((res) => {
yujinyao's avatar
yujinyao committed
107 108 109 110
      this.currencyList = res.data
    })

    this.getOfferList()
111
    this.offerDialogVisible = true
yujinyao's avatar
yujinyao committed
112
  },
113 114 115 116 117 118 119
  computed: {
    currencyMap() {
      let map = {}
      this.currencyList.forEach((item) => {
        map[item.id] = this.$l(item, "title")
      })
      return map
yujinyao's avatar
yujinyao committed
120 121
    },
    exportCityList() {
122
      return this.tradeCityList.filter((item) => item.type == 2)
yujinyao's avatar
yujinyao committed
123 124
    },
    importCityList() {
125 126
      return this.tradeCityList.filter((item) => item.type == 1)
    }
yujinyao's avatar
yujinyao committed
127 128 129 130
  },
  methods: {
    /** 搜索按钮操作 */
    handleQuery() {
131
      this.queryParams.pageNo = 1
132
      this.getOfferList()
yujinyao's avatar
yujinyao committed
133 134 135 136 137 138 139
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams = {
        pageNo: 1,
        pageSize: 10
      }
140
      this.handleQuery()
yujinyao's avatar
yujinyao committed
141 142
    },
    getOfferList() {
143 144 145
      getOfferPage({
        ...this.queryParams,
        customerId: this.customerId
146 147 148 149
      }).then((response) => {
        this.offerList = response.data.list
        this.offerTotal = response.data.total
      })
yujinyao's avatar
yujinyao committed
150 151 152
    },
    confirm() {
      if (this.offerId) {
153
        this.$emit("select", this.offerId)
yujinyao's avatar
yujinyao committed
154 155 156 157 158 159 160
        this.offerDialogVisible = false
      } else {
        this.$message.error(this.$t("请选择报价单"))
      }
    }
  }
}
161
</script>