|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: wanglj 471442253@qq.com
|
|
|
* @Date: 2022-12-26 16:34:37
|
|
|
* @LastEditors: wanglj
|
|
|
- * @LastEditTime: 2023-01-11 18:06:32
|
|
|
+ * @LastEditTime: 2023-01-05 13:39:44
|
|
|
* @Description: file content
|
|
|
* @FilePath: \opms_frontend\src\views\customer\list.vue
|
|
|
-->
|
|
|
@@ -13,75 +13,45 @@
|
|
|
<el-tab-pane label="我的客户" name="second" />
|
|
|
<el-tab-pane label="下属的客户" name="third" />
|
|
|
</el-tabs>
|
|
|
+ <el-row :gutter="10" style="margin-bottom: 10px">
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input v-model="queryForm.custCode" placeholder="客户编码" />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input v-model="queryForm.custName" placeholder="客户名称" />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-select v-model="queryForm.custIndustry" placeholder="客户行业" style="width: 100%">
|
|
|
+ <el-option v-for="item in industryOptions" :key="item.value" :label="item.value" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-select v-model="queryForm.custLevel" placeholder="客户级别" style="width: 100%">
|
|
|
+ <el-option v-for="item in levelOptions" :key="item.value" :label="item.value" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryForm.followUpDate"
|
|
|
+ placeholder="最后跟进时间"
|
|
|
+ style="width: 100%"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd" />
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button icon="el-icon-plus" type="primary" @click="fetchData">查询</el-button>
|
|
|
+ <el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<vab-query-form>
|
|
|
- <vab-query-form-top-panel>
|
|
|
- <el-form :inline="true" :model="queryForm" @submit.native.prevent>
|
|
|
- <el-form-item>
|
|
|
- <el-input v-model="queryForm.custCode" placeholder="客户编码" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-input v-model="queryForm.custName" placeholder="客户名称" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-select v-model="queryForm.custIndustry" placeholder="客户行业" style="width: 100%">
|
|
|
- <el-option v-for="item in industryOptions" :key="item.value" :label="item.value" :value="item.value" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-select v-model="queryForm.custLevel" placeholder="客户级别" style="width: 100%">
|
|
|
- <el-option v-for="item in levelOptions" :key="item.value" :label="item.value" :value="item.value" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-date-picker
|
|
|
- v-model="queryForm.followUpDate"
|
|
|
- placeholder="最后跟进时间"
|
|
|
- style="width: 100%"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button icon="el-icon-plus" type="primary" @click="fetchData">查询</el-button>
|
|
|
- <el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </vab-query-form-top-panel>
|
|
|
<vab-query-form-left-panel :span="12">
|
|
|
- <el-button
|
|
|
- v-permissions="['customer:add']"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="$refs.edit.init()">
|
|
|
- 新建
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-permissions="['customer:shift']"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="handleShift">
|
|
|
- 转移客户
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-permissions="['customer:open']"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="handleToOpen">
|
|
|
- 移入公海
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-permissions="['customer:merge']"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="handleMerge">
|
|
|
- 合并客户
|
|
|
- </el-button>
|
|
|
+ <el-button icon="el-icon-plus" size="mini" type="primary" @click="$refs.edit.init()">新建</el-button>
|
|
|
+ <el-button icon="el-icon-plus" size="mini" type="primary" @click="handleShift">转移客户</el-button>
|
|
|
+ <el-button icon="el-icon-plus" size="mini" type="primary" @click="handleToOpen">移入公海</el-button>
|
|
|
+ <el-button icon="el-icon-plus" size="mini" type="primary" @click="handleMerge">合并客户</el-button>
|
|
|
</vab-query-form-left-panel>
|
|
|
<vab-query-form-right-panel :span="12">
|
|
|
- <el-button icon="el-icon-download" @click="exportData" />
|
|
|
+ <el-button icon="el-icon-download" />
|
|
|
<table-tool :check-list.sync="checkList" :columns="columns" />
|
|
|
</vab-query-form-right-panel>
|
|
|
</vab-query-form>
|
|
|
@@ -89,9 +59,24 @@
|
|
|
v-loading="listLoading"
|
|
|
border
|
|
|
:data="list"
|
|
|
- :height="$baseTableHeight(3)"
|
|
|
+ height="calc(100vh - 394px)"
|
|
|
@selection-change="setSelectRows">
|
|
|
<el-table-column align="center" show-overflow-tooltip type="selection" />
|
|
|
+
|
|
|
+ <el-table-column align="center" label="客户编码" prop="custCode" />
|
|
|
+ <el-table-column align="center" label="客户名称" prop="custName" />
|
|
|
+ <el-table-column align="center" label="助记名" prop="abbrName" />
|
|
|
+ <el-table-column align="center" label="所在地区" prop="custLocation" />
|
|
|
+
|
|
|
+ <el-table-column align="center" label="客户行业" prop="custIndustry" />
|
|
|
+
|
|
|
+ <el-table-column align="center" label="客户级别" prop="custLevel" />
|
|
|
+ <el-table-column align="center" label="客户状态" prop="custStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.custStatus == 10 ? '正常' : '异常' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
v-for="(item, index) in finallyColumns"
|
|
|
:key="index"
|
|
|
@@ -108,16 +93,13 @@
|
|
|
<span v-else-if="item.prop === 'custStatus'">
|
|
|
{{ row.custStatus == 10 ? '正常' : '异常' }}
|
|
|
</span>
|
|
|
- <span v-else-if="item.prop === 'followUpDate'">
|
|
|
- {{ parseTime(row.followUpDate, '{y}-{m}-{d} {h}:{i}') }}
|
|
|
- </span>
|
|
|
<span v-else>{{ row[item.prop] }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-permissions="['customer:edit']" type="text" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
- <el-button v-permissions="['customer:delete']" type="text" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
+ <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
+ <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -151,7 +133,6 @@
|
|
|
import ToOpen from './components/ToOpen'
|
|
|
import Merge from './components/Merge'
|
|
|
import TableTool from '@/components/table/TableTool'
|
|
|
- import downloadFileByByte from '@/utils/base64ToFile'
|
|
|
export default {
|
|
|
components: {
|
|
|
Edit,
|
|
|
@@ -238,13 +219,6 @@
|
|
|
sortable: false,
|
|
|
disableCheck: false,
|
|
|
},
|
|
|
- {
|
|
|
- label: '创建人',
|
|
|
- width: '140px',
|
|
|
- prop: 'createdName',
|
|
|
- sortable: false,
|
|
|
- disableCheck: false,
|
|
|
- },
|
|
|
{
|
|
|
label: '创建时间',
|
|
|
width: '140px',
|
|
|
@@ -286,21 +260,6 @@
|
|
|
this.total = res.data.total
|
|
|
this.listLoading = false
|
|
|
},
|
|
|
-
|
|
|
- exportData() {
|
|
|
- let exportFrom = JSON.parse(JSON.stringify(this.queryForm))
|
|
|
- exportFrom.columns = this.finallyColumns.map((item) => item.label)
|
|
|
- api
|
|
|
- .deriveList(exportFrom)
|
|
|
- .then((res) => {
|
|
|
- if (res.data.list.content) {
|
|
|
- downloadFileByByte(res.data.list.content, '客户数据.xlsx')
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
reset() {
|
|
|
this.queryForm = {
|
|
|
pageNum: 1,
|
|
|
@@ -339,14 +298,13 @@
|
|
|
type: 'warning',
|
|
|
})
|
|
|
.then(async () => {
|
|
|
- const [err, res] = await to(api.deleteCustomer({ Ids: [row.id] }))
|
|
|
+ const [err, res] = await to(api.deleteCustomer({ Ids: row.id }))
|
|
|
if (err) return
|
|
|
if (res.code == 200) {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '删除成功!',
|
|
|
})
|
|
|
- this.fetchData()
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {})
|