Commit ec9f22da authored by wanglianghe's avatar wanglianghe
parents d8455f96 39d03d29
......@@ -70,7 +70,7 @@ export function getCustomerList(query) {
})
}
// 导出客户 Excel
// 导出客户 Excel 全部
export function exportCustomerExcel(query) {
return request({
url: '/ecw/customer/export-excel',
......@@ -79,7 +79,55 @@ export function exportCustomerExcel(query) {
responseType: 'blob'
})
}
// 我的客户导出
export function mineExporteExcel(query) {
return request({
url: '/ecw/customer/mine-export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 我的待接收客户列表导出
export function waiteConfirmExportExcel(query) {
return request({
url: '/ecw/customer/waite-confirm-export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
/**
* // 待分配客户列表导出
* @param query
* @return {*}
*/
export function waitDistributionExportExcel(query) {
return request({
url: '/ecw/customer/wait-distribution-export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 公海池客户列表导出
export function publicExportExcel(query) {
return request({
url: '/ecw/customer/public-export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
export function indirectCustomerExportExcel(query) {
return request({
url: '/ecw/indirect-customer/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 待接收客户列表
export function getWaitForConfirmList(query) {
return request({
......
......@@ -509,7 +509,7 @@ export default {
currencyId = this.currencyList[0].id
}
this.$set(item, 'reduceCurrencyId', currencyId)
}
}else this.$set(item, 'reduceCurrencyDisabled', false)
return
}
......
......@@ -535,7 +535,7 @@ export default {
type: [{ required: true, message: this.$t('客户类别不能为空'), trigger: "blur" }],
createTime: [{ required: true, message: this.$t('创建时间不能为空'), trigger: "blur" }],
source: [{ required: true, message: this.$t('客户来源不能为空'), trigger: "blur" }],
customerService: [{ required: true, message: this.$t('客户经理不能为空'), trigger: "blur" }],
customerService: [{ required:this.customerId === '0', message: this.$t('客户经理不能为空'), trigger: "blur" }],
status: [{ required: true, message: this.$t('客户状态不能为空'), trigger: "blur" }],
......
......@@ -66,14 +66,14 @@
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:customer:create']">{{$t('新增')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:customer:export']">{{$t('导出')}}</el-button>
</el-col>
<el-col :span="1.5" >
<el-button :disabled="selectCustomerList.length === 0" type="primary" size="mini" @click="transferShow = true;"
v-hasPermi="['ecw:customer:export']">{{$t('批量移交')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:customer:export']">{{$t('导出')}}</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
......
......@@ -25,8 +25,11 @@
<el-date-picker clearable v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:customer:export']">{{$t('导出')}}</el-button>
</el-form-item>
</el-form>
......@@ -90,11 +93,14 @@ import {updateCustomer, getCustomer,
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {listServiceUser} from "@/api/system/user";
import {exportCustomerComplaintExcel} from "@/api/ecw/customerComplaint";
import {indirectCustomerExportExcel} from "@/api/ecw/customer";
export default {
name: "IndirectCustomer",
data() {
return {
exportLoading:false,
getDictDatas,
DICT_TYPE,
// 遮罩层
......@@ -132,6 +138,22 @@ export default {
})
},
methods: {
// 导出
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出间接客户数据项?')).then(() => {
this.exportLoading = true;
return indirectCustomerExportExcel(params);
}).then(response => {
this.$download.excel(response, '间接客户列表.xls');
this.exportLoading = false;
}).catch(() => {});
},
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.customerService);
......
......@@ -62,15 +62,14 @@
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:customer:export']">{{$t('导出')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="$router.push({path:'/customer/add-edit/0',query:{isCustomerServiceConfirmed:true,}})"
v-hasPermi="['ecw:customer:create']">{{$t('新增')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:customer:export']">{{$t('导出')}}</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
......@@ -332,7 +331,14 @@
</template>
<script>
import { updateCustomer, getCustomer, exportCustomerExcel, getWaitForConfirmList, confirm } from "@/api/ecw/customer";
import {
updateCustomer,
getCustomer,
exportCustomerExcel,
getWaitForConfirmList,
confirm,
waiteConfirmExportExcel
} from "@/api/ecw/customer";
import { listServiceUser } from "@/api/system/user"
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import {CommonStatusEnum} from '@/utils/constants'
......@@ -573,11 +579,11 @@ export default {
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出所有客户数据项?')).then(() => {
this.$modal.confirm(this.$t('是否确认导出我的待接受客户数据项?')).then(() => {
this.exportLoading = true;
return exportCustomerExcel(params);
return waiteConfirmExportExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.$download.excel(response, `${this.$t('我的待接收客户')}.xls`);
this.exportLoading = false;
}).catch(() => {});
},
......
......@@ -151,8 +151,10 @@
</template>
<script>
import { createCustomer, updateCustomer, deleteCustomer, getCustomer,handOverCustomer,
exportCustomerExcel,getCustomerToBeAssigned } from "@/api/ecw/customer";
import {
createCustomer, updateCustomer, deleteCustomer, getCustomer, handOverCustomer,
exportCustomerExcel, getCustomerToBeAssigned, waitDistributionExportExcel
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload'
import {listServiceUser} from "@/api/system/user";
......@@ -420,9 +422,9 @@ export default {
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出所有客户数据项?')).then(() => {
this.$modal.confirm(this.$t('是否确认导出待分配客户数据项?')).then(() => {
this.exportLoading = true;
return exportCustomerExcel(params);
return waitDistributionExportExcel(params);
}).then(response => {
this.$download.excel(response, `${this.$t('待分配客户')}.xls`);
this.exportLoading = false;
......
......@@ -516,6 +516,7 @@ export default {
},
WriteOffProportion(){
let total = 0
if(!this.form.receiptAccountList) return 0
let amountTotal = this.form.receiptAccountList.find(item=>item.type=='total').writeOffAmount
this.detailed.forEach(item => {
......@@ -609,23 +610,23 @@ export default {
var n
// 收款总计
var amountList =[]
this.currencyList.forEach((item,index)=>{
var nairaListByList = this.list.filter(v => v.currencyId === item.id)
if(nairaListByList.length>0){
var discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
var n = res.data.find(v => v.currencyId == item.id)
n = res.data.find(v => v.currencyId == item.id)
n && (n.discountTotal = discountNaira)
}
var dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id)
if(dollarList.length>0){
var dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0).toFixed(2)
if(n.discountTotal&&n.discountTotal>0){
amountList.push({currencyName:item.titleZh,amount:(dollar-n.discountTotal).toFixed(2)})
if(n && n.discountTotal&&n.discountTotal>0){
amountList.push({currencyName:item.titleZh, currencyId: item.id, amount:(dollar-n.discountTotal).toFixed(2)})
}else{
amountList.push({currencyName:item.titleZh,amount:dollar})
amountList.push({currencyName:item.titleZh, currencyId: item.id, amount:dollar})
}
}
......@@ -910,6 +911,8 @@ export default {
},
handleAddReceiptItem() {
this.surplusData = []
// 已收
let recepted = []
this.detailed.forEach(item => {
......@@ -918,13 +921,19 @@ export default {
}else recepted[item.currencyId] = NP.plus(recepted[item.currencyId], item.amount)
})
console.log('rece',recepted)
// 应收
let collom = []
this.form.receiptAccountList.forEach(item => {
/* this.form.receiptAccountList.forEach(item => {
if(item.type!='total'){
if(!collom[item.currencyId]){
collom[item.currencyId] = item.receivableAmount-item.discountTotal
}else collom[item.currencyId] = NP.plus(collom[item.currencyId], item.receivableAmount)
}
}) */
// 从期望收费金额中提取应收币种和金额
this.form.receiptAccountList.find(item => item.type == 'total').collectionAmount.forEach(item => {
collom[item.currencyId] = item.amount
})
console.log('collom',collom)
// if(recepted.length>collom.length){
......
......@@ -127,7 +127,13 @@
</template>
<script>
import { createCustomer, updateCustomer, deleteCustomer, getCustomer, exportCustomerExcel,getMyCustomerService } from "@/api/ecw/customer";
import {
createCustomer,
updateCustomer,
deleteCustomer,
getMyCustomerService,
mineExporteExcel
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload'
import customerFollowList from "@/components/CustomerFollowList";
......@@ -373,9 +379,9 @@ export default {
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出所有客户数据项?')).then(() => {
this.$modal.confirm(this.$t('是否确认导出我的客户数据项?')).then(() => {
this.exportLoading = true;
return exportCustomerExcel(params);
return mineExporteExcel(params);
}).then(response => {
this.$download.excel(response, `${this.$t('我的客户列表')}.xls`);
this.exportLoading = false;
......
......@@ -146,7 +146,15 @@
</template>
<script>
import { createCustomer, updateCustomer, deleteCustomer,handOverCustomer,getPublicList,exportCustomerExcel, setFishing } from "@/api/ecw/customer";
import {
createCustomer,
updateCustomer,
deleteCustomer,
handOverCustomer,
getPublicList,
setFishing,
publicExportExcel
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload'
import {listServiceUser} from "@/api/system/user";
......@@ -382,9 +390,9 @@ export default {
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出所有客户数据项?')).then(() => {
this.$modal.confirm(this.$t('是否确认导出公海池客户数据项?')).then(() => {
this.exportLoading = true;
return exportCustomerExcel(params);
return publicExportExcel(params);
}).then(response => {
this.$download.excel(response, `${this.$t('公海池客户')}.xls`);
this.exportLoading = false;
......
......@@ -101,7 +101,7 @@
</el-descriptions-item>
<el-descriptions-item :label="$t('集运仓库')">
{{order.isExternalWarehouse ? $t('外部仓') : $t('自有仓') }}
<template v-for="(item, index) in order.externalWarehouseDtoList" >
<template v-if="order.isExternalWarehouse" v-for="(item, index) in order.externalWarehouseDtoList" >
<div v-if="item.estLoadingTime || item.loadingAddress" :key="index">
{{$t('装柜时间')}}{{item.estLoadingTime}}
{{$t('装柜地址')}}{{item.loadingAddress}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment