Commit 1d7200ad authored by 我在何方's avatar 我在何方

更新帮助客户延迟

parent 2910861d
......@@ -259,3 +259,29 @@ export function getCustomerLines(customerId){
})
}
// 获取客户延期调入公海池的审批详情
export function getDelayInfo(query) {
return request({
url: '/ecw/customer/delay/approval/info',
method: 'get',
params: query
})
}
//客户延期调入公海池的审批申请
export function creatDelayApproval(data){
return request({
url:'/ecw/customer/delay/approval',
method:'post',
data
})
}
// 取消客户延期调入公海池的审批申请
export function cancelDelayApproval(data) {
return request({
url: '/ecw/customer/cancel/delay/approval',
method: 'put',
data: data,
})
}
import request from '@/utils/request'
// 创建对内帮助文档
export function createInternalHelpDoc(data) {
return request({
url: '/system/internal-help-doc/create',
method: 'post',
data: data
})
}
// 更新对内帮助文档
export function updateInternalHelpDoc(data) {
return request({
url: '/system/internal-help-doc/update',
method: 'put',
data: data
})
}
// 删除对内帮助文档
export function deleteInternalHelpDoc(id) {
return request({
url: '/system/internal-help-doc/delete?id=' + id,
method: 'delete'
})
}
// 获得对内帮助文档
export function getInternalHelpDoc(id) {
return request({
url: '/system/internal-help-doc/get?id=' + id,
method: 'get'
})
}
// 获得对内帮助文档分页
export function getInternalHelpDocPage(query) {
return request({
url: '/system/internal-help-doc/page',
method: 'get',
params: query
})
}
// 导出对内帮助文档 Excel
export function exportInternalHelpDocExcel(query) {
return request({
url: '/system/internal-help-doc/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
......@@ -7,10 +7,14 @@
<div class="right-menu">
<template v-if="device!=='mobile'">
<div class="right-menu-item">
<el-image style="width: 22px;height: 22px;cursor: pointer;" :src="helpIcon" @click="tohelp"></el-image>
</div>
<el-badge :value="matterNum !== 0 ? matterNum : '' " class="right-menu-item badge">
<div @click="$router.push('/task/todo')" style="font-size: 28px; color: #cccccc;cursor: pointer;" class="el-icon-postcard"></div>
</el-badge>
<el-badge :value="notMessage !== 0 ? notMessage : '' " class="right-menu-item badge">
<el-image style="width: 22px;height: 20px;cursor: pointer;" :src="unreadMessage" @click="notRead"></el-image>
</el-badge>
......@@ -40,7 +44,7 @@
<dict-selector :type="DICT_TYPE.SYSTEM_LOCALE" v-model="lang" defaultable class="right-menu-item select-nav" />
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper flex-center">
{{$store.getters.name}}
<img :src="avatar" class="user-avatar ml-10">
......@@ -74,11 +78,13 @@ import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc'
import {getLocale, saveLocale} from "@/utils/db";
import unreadMessage from "@/assets/images/unread-message.png"
import helpIcon from "@/assets/images/help.png"
import i18n from '@/i18n'
export default {
data() {
return {
unreadMessage,
helpIcon,
// locale: getLocale(),
// 枚举
// langDatas: LangEnum.LANG,
......@@ -159,6 +165,9 @@ export default {
},
notRead(){
this.$router.push({path:'/system/internalMessage/my-internal-message',query:{status:'0'}});
},
tohelp(){
this.$router.push({path:'/operation_manage/info'});
}
}
}
......
......@@ -148,6 +148,7 @@ export const DICT_TYPE = {
//customer
CUSTOMER_CREDIT_RULE_TYPE: 'customer_credit_rule_type',
CUSTOMER_LEVEL_RULE_TYPE: 'customer_level_rule_type',
CUSTOMER_ESOURCE_TYPE:'customer_resource_type',//客户资源类型
// order
ORDER_TYPE: 'order_type', // 订单类型
PRODUCT_RECORD_ATTRIBUTE: 'product_record_attribute', //产品备案属性
......
<template>
<div class="app-container">
<el-card>
<el-form :model="handlerParams" ref="queryForms" size="small" :inline="true" label-width="180px" class="card">
<el-row>
<el-form-item :label="$t('客户名称')+':'">
<span style="margin-left: 8px;">{{handlerParams.customerName}}</span>
</el-form-item>
</el-row>
<el-row >
<el-form-item :label="$t('原时间掉入公海池时间')+':'">
<span style="margin-left: 8px;">{{handlerParams.orgEstimateEnterOpenSeaTime}}</span>
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('申请延期后掉入时间')+':'">
<el-date-picker
v-model="handlerParams.estimateEnterOpenSeaTime"
type="date"
value-format="timestamp"
:placeholder="$t('请输入申请延期后掉入时间')">
</el-date-picker>
</el-form-item>
</el-row>
<el-row :span="8">
<el-form-item :label="$t('凭证')+':'" size="medium" :require="true">
<upload v-model="handlerParams.voucher" :limit="1"></upload>
</el-form-item>
</el-row>
<el-row :span="8">
<el-form-item :label="$t('申请理由')+':'" size="medium">
<el-input style="width: 500px;" type="textarea" v-model="handlerParams.reason" />
</el-form-item>
</el-row>
</el-form>
</el-card>
<!-- 只有不需要预付才需要审核 -->
<template>
<div class="page-title">{{$t('审批流程')}}</div>
<work-flow xmlkey="quotation_customer_delay_public" v-model="handlerParams.ccIds" />
</template>
<div slot="footer" class="dialog-footer">
<!-- bpmStatus
异常流程状态,1处理中2通过3不通过4已取消
待审核可能没有bpmStatus字段
-->
<template v-if="handlerParams.status == 1">
<el-button type="primary" @click="$router.push(`/bpm/process-instance/detail?id=`+handlerParams.bpmId)">{{$t('审核中')}}</el-button>
<el-button plain type="primary" @click="cancelAudit">{{$t('取消审核')}}</el-button>
<el-button plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('返回')}}</el-button>
</template>
<template v-else>
<el-button type="primary" @click="submitForm">{{$t('提交')}}</el-button>
<el-button plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('取消')}}</el-button>
</template>
</div>
</div>
</template>
<script>
import upload from '@/components/ImageUpload'
import {getDictData, getDictDatas} from '@/utils/dict'
import {getCustomer,getDelayInfo,creatDelayApproval,cancelDelayApproval} from '@/api/ecw/customer'
import WorkFlow from '@/components/WorkFlow'
import {cancelProcessInstance} from '@/api/bpm/processInstance'
export default {
name: "Delay",
components: {
upload, WorkFlow
},
data() {
return {
// 遮罩层
loading: false,
handlerParams:{
},
customerData:{},
showWorkFlow: false, // 是否显示工作流
dateRangeCreateTime:[]
};
},
created() {
if(this.$route.query.id){
this.getData(this.$route.query.id)
}
},
methods: {
getData(id){
getCustomer(id).then(response => {
this.customerData = response.data
this.getDely(id)
});
},
getDely(id){
console.log(this.customerData)
let that = this
getDelayInfo({customerId:id}).then(res=>{
if(res.data){
that.handlerParams = res.data
if(!that.handlerParams.orgEstimateEnterOpenSeaTime){
that.handlerParams.orgEstimateEnterOpenSeaTime = that.getNowDate(that.customerData.enterOpenSeaTime)
}
console.log(that.handlerParams)
}else{
that.handlerParams = {
customerId:that.customerData.id,
customerName:that.customerData.name,
orgEstimateEnterOpenSeaTime: that.getNowDate(that.customerData.enterOpenSeaTime)
}
}
})
},
submitForm(){
// if(!this.handlerParams.orderExceptionHandlerResult){
// this.$modal.msgError(this.$t('请选择处理结果'));
// return
// }
// if(!this.handlerParams.fileList||this.handlerParams.fileList.length==0){
// this.$modal.msgError(this.$t('请上传报关资料'));
// return
// }
this.handlerParams.ccIds = Array.isArray(this.handlerParams.ccIds) ? this.handlerParams.ccIds.join(',') : this.handlerParams.ccIds
this.handlerParams.voucher = Array.isArray(this.handlerParams.voucher) ? this.handlerParams.voucher.join(',') : this.handlerParams.voucher
this.$set(this.handlerParams,'createTime',this.formatDate())
this.handlerParams.estimateEnterOpenSeaTime = this.getNowDate(this.handlerParams.estimateEnterOpenSeaTime)
creatDelayApproval(this.handlerParams).then(res=>{
this.$modal.msgSuccess(this.$t('提交成功'));
this.$store.dispatch('tagsView/delCurrentView')
})
},
getNowDate(time) {
if(time){
var date = new Date(time);
}else{
var date = new Date();
}
var year = date.getFullYear() // 年
var month = date.getMonth() + 1; // 月
var day = date.getDate(); // 日
// 给一位数的数据前面加 “0”
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (day >= 0 && day <= 9) {
day = "0" + day;
}
return year + "-" + month + "-" + day
},
formatDate() {
var date = new Date()
var year = date.getFullYear()
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
},
// 取消审核
cancelAudit(){
this.$prompt("请输入取消原因", {
inputPattern: /[\S]+/,
inputErrorMessage: '不能为空'
}).then(({value}) => {
return cancelDelayApproval(this.handlerParams.formId, value)
})
.then(res => {
this.getList()
})
}
}
};
</script>
<style scoped>
.card-title{
font-size: 18px;
font-weight: bold;
margin-top: 10px;
}
.header{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.card{
margin-top: 20px;
}
.dialog-footer{
padding: 40px;
width: 60%;
align-items: center;
display: flex;
/* justify-content: space-between; */
}
</style>
<template xmlns="">
<div>
<el-row type="flex" style="margin-top: 15px;margin-bottom: 15px" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="22" :xl="20">
<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">
<el-input v-model="form.name" :placeholder="$t('请输入客户名称')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('国家')" prop="country">
<el-select filterable clearable v-model="form.country" :placeholder="$t('请选择国家')">
<el-option v-for="dict in countryList"
:key="dict.id" :label="dict.nameZh" :value="parseInt(dict.id)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户等级')" prop="level">
<el-select v-model="form.level" :placeholder="$t('请选择客户等级')" disabled>
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('联系地址')" prop="address">
<el-input v-model="form.address" :placeholder="$t('请输入联系地址')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户类别')" prop="type">
<dict-selector :type="DICT_TYPE.CUSTOMER_TYPE" form-type="checkbox" multiple v-model="form.type"></dict-selector>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('常用提货网点')" prop="pickupPoint">
<el-select v-model="form.pickupPoint" :placeholder="$t('请输入常用提货网点')">
<el-option v-for="node in nodeList"
:key="node.id" :label="node.titleZh" :value="node.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="13" v-show="form.type && form.type.indexOf('2') !== -1">
<el-form-item :label="$t('所属代理')" prop="agentId">
<el-select filterable clearable v-model="form.agentId" :placeholder="$t('请选择所属代理')">
<el-option v-for="item in serviceUserList"
:key="item.id" :label="item.nickname" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('公司名称')" prop="company">
<el-input v-model="form.company" :placeholder="$t('请输入公司名称')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户生日')" prop="birthday">
<el-date-picker
v-model="form.birthday"
type="date"
value-format="timestamp"
:placeholder="$t('请输入客户生日')">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('主营类别')" prop="productType">
<el-row :gutter="10">
<el-col :span="11">
<el-select v-model="form.productType" :placeholder="$t('请选择产品类别')" @change="form.productId = ''">
<el-option :label="item.titleZh" :value="item.id" v-for="(item) in productTypeList" :key="item.id"/>
</el-select>
</el-col>
<el-col :span="11">
<el-select v-model="form.productId" :placeholder="$t('请选择')">
<el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="(item) in productListFilter" :key="item.id"/>
</el-select>
</el-col>
</el-row>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户来源')" prop="source">
<el-select v-model="form.source" :placeholder="$t('请选择客户来源')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('结算方式')" prop="balance">
<el-select v-model="form.balance" :placeholder="$t('请选择结算方式')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')" :disabled="(!!(customerId !== '0' && form.customerService) || isCustomerServiceConfirmed)">
<el-option v-for="item in serviceUserList"
:key="item.id" :label="item.nickname" :value="item.id" />
</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">
<el-select v-model="form.status" :placeholder="$t('请选择客户状态')" disabled>
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('推介人')" prop="promoter">
<el-select clearable remote :remote-method="remoteMethod" v-model="form.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-col>
<el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder">
<el-select v-model="form.founder" disabled>
<el-option
v-for="item in serviceUserList"
:key="item.id"
:label="item.nickname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建时间')" prop="createTime">
<el-date-picker
v-model="form.createTime"
type="datetime"
value-format="timestamp"
disabled
:placeholder="$t('选择创建时间')">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('备注')" prop="remarks">
<el-input v-model="form.remarks" :placeholder="$t('请输入备注')"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('是否显示提单价格')" prop="remarks">
<el-switch v-model="form.isShowTidanPrice"></el-switch>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
<el-switch v-model="form.arrivalConfirm" :active-value="1" :inactive-value="0" />
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item :label="$t('重货标准')" prop="weightUnit">
<el-switch v-model="showZhong"/>
<el-input v-model="form.weightUnit" :placeholder="$t('请输入重货标准')" v-show="showZhong">
<template slot="append">kg/cbm</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" v-show="showZhong">
<el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showZhong1"></el-switch>
<customer-line-table v-if="showZhong1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="zhongLines" :zhong-pao-type="1"></customer-line-table>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item :label="$t('泡货标准')" prop="weightUnit">
<el-switch v-model="showPao"/>
<el-input v-model="form.lightUnit" :placeholder="$t('请输入泡货标准')" v-show="showPao">
<template slot="append">kg/cbm</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" v-show="showPao">
<el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showPao1"></el-switch>
<customer-line-table v-if="showPao1" :warehouse-list="warehouseList" :import-city-list="importCityList" v-model="paoLines" :zhong-pao-type="2"></customer-line-table>
</el-form-item>
</el-col>
</el-row>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{$t('联系人')}}</span>
<el-button style="float: right;" size="small" type="primary" @click="handleAddContact">+</el-button>
</div>
<el-form ref="contactForm" :rules="contactRules" :model="form">
<el-table
:data="form.customerContacts"
style="width: 100%"
>
<el-table-column
prop="department"
:label="$t('部门')"
width=""
>
<template v-slot="{ row }">
<el-form-item label="">
<el-input v-model="row.department" :placeholder="$t('请输入部门')" size="mini"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="position"
:label="$t('职位')"
width=""
>
<template v-slot="{row}">
<el-form-item label="">
<el-input v-model="row.position" :placeholder="$t('请输入职位')" size="mini"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="name"
:label="$t('联系人')"
>
<template slot="header">
{{$t('联系人')}} <span style="color: #ff0000">*</span>
</template>
<template v-slot="{row, cellValue, $index}">
<el-form-item :rules="contactRules.name" :prop="'customerContacts.' + $index + '.name'" label="">
<el-input v-model="row.name" :placeholder="$t('请输入联系人')" size="mini"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="areaCode"
:label="$t('区号')"
>
<template slot="header">
{{$t('区号')}} <span style="color: #ff0000">*</span>
</template>
<template v-slot="{row, cellValue, $index}">
<el-form-item :rules="contactRules.areaCode" :prop="'customerContacts.' + $index + '.areaCode'" label="">
<el-select v-model="row.areaCode" :placeholder="$t('请选择区号')" filterable size="mini">
<el-option v-for="(item, index) in countryList"
:key="index" :label="item.nameShort + item.nameZh + '(' + item.tel + ')'" :value="item.tel" />
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="phoneNew"
:label="$t('联系方式')"
>
<template slot="header">
{{$t('联系方式')}} <span style="color: #ff0000">*</span>
</template>
<template v-slot="{row, cellValue, $index}">
<el-form-item :rules="contactRules.phoneNew" :prop="'customerContacts.' + $index + '.phoneNew'" label="">
<el-input v-model="row.phoneNew" :placeholder="$t('请输入联系方式')" size="mini"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop=""
:label="$t('关联账号')"
>
<template v-slot = "{row}">
<el-form-item label="">
<!-- <el-select v-model="row.userid" clearable remote :remote-method="getUserMemberUserFn" @change="selectBD" size="mini" filterable>
<el-option v-for="(item,index) in userMemberUser" :value="item.id" :key="index" :label="item.nickname + '(' + item.mobile + ')'" ></el-option>
</el-select> -->
<MemberSelector v-model="row.userid" size="mini" />
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="social"
:label="$t('社交软件')"
>
<template v-slot="{row}">
<el-form-item label="">
<el-select v-model="row.social" :placeholder="$t('请选择社交软件')" size="mini">
<el-option v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="socialNumber"
:label="$t('社交软件号码')"
>
<template v-slot="{row}">
<el-form-item label="">
<el-input v-model="row.socialNumber" :placeholder="$t('请输入社交软件号码')" size="mini"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="email"
:label="$t('邮箱')"
>
<template v-slot="{row}">
<el-form-item label="">
<el-input v-model="row.email" :placeholder="$t('请输入邮箱')" size="mini"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="isDefault"
:label="$t('设为默认')"
>
<template v-slot="{ row, column, $index }">
<el-form-item label="">
<el-select v-model="row.isDefault" :placeholder="$t('设为默认')" @change="handleDefaultChange($index)" size="mini">
<el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)"
:key="dict.value" :label="dict.label" :value="Number(dict.value)" />
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="name"
:label="$t('操作')"
>
<template v-slot="{ row, column, $index }">
<el-form-item label="">
<el-button type="danger" @click="handleDeleteContact($index)" size="mini">{{$t('删除')}}</el-button>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-card>
<el-row :gutter="10" style="margin-top: 15px">
<el-col :span="12">
<el-form-item label="发票抬头" prop="invoiceTitle">
<el-input v-model="form.invoiceTitle" :placeholder="$t('请输入发票抬头')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('纳税人识别号')" prop="licenseNumber">
<el-input v-model="form.licenseNumber" :placeholder="$t('请输入纳税人识别号')" />
</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">
<el-input v-model="form.bankNumber" :placeholder="$t('请输入账户')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('项目')" prop="project">
<el-input v-model="form.project" :placeholder="$t('请输入项目')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('开票地址')" prop="billingAddress">
<el-input v-model="form.billingAddress" :placeholder="$t('请输入开票地址')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('开票电话')" prop="billingTell">
<el-input v-model="form.billingTell" :placeholder="$t('请输入开票电话')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('税率')" prop="taxRate">
<el-input v-model="form.taxRate" :placeholder="$t('请输入税率')" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="text-align: center">
<el-button type="primary" @click="submitForm">{{$t('确 定')}}</el-button>
<el-button @click="cancel">{{$t('取 消')}}</el-button>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload'
import {
createCustomer,
getCustomer,
getCustomerList,
getCustomerPage, memberUserList,
updateCustomer,
userMemberUserList,
getCustomerLines, fillupCustomeInfo
} from '@/api/ecw/customer'
import {getNodeList} from "@/api/ecw/node"
import { getProductTypeList } from '@/api/ecw/productType'
import { getProductList } from '@/api/ecw/product'
import {getTradeCityList} from "@/api/ecw/region"
import {getWarehouseList} from "@/api/ecw/warehouse"
import CustomerLineTable from '@/components/CustomerLineTable'
import {getCustomerSelect} from "@/api/ecw/customer"
import {listServiceUser, listSimpleUsers} from "@/api/system/user"
import { getZhongPaoBest, getZhongPaoPage } from '@/api/ecw/zhongPao'
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import { getCountryListAll } from '@/api/ecw/country'
import Template from "@/views/cms/template";
import {validatorMobile} from "@/api/ecw/validate"
// import {customerDropDownList} from "@/api/ecw/customerCommissionInfo";
import MemberSelector from '@/components/MemberSelector'
export default {
name: "editIndirect",
props: {
customerId: String,
},
components: {
Template,
upload,
CustomerLineTable,
MemberSelector
},
created() {
this.isCustomerServiceConfirmed = this.$route.query.isCustomerServiceConfirmed ? true : false
this.getCustomerSelect()
this.reset()
// this.getUserMemberUserFn()
if(this.$route.query.id) {
// 编辑客户
this.customerId = this.$route.query.id
this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.form.customerContacts = r.data
let list = this.form.customerContacts.map(item => item.userid);
if(list.length >0){
memberUserList({ids:list.join(',')}).then(r=>{
this.selectMemberList = r.data
})
}
if(this.form.promoter){
getCustomerList({ids:this.form.promoter}).then(r => {
this.recommended = r.data;
})
}
})
// 打开重泡货开关
if(this.form.weightUnit){
this.showZhong = true
}
if(this.form.lightUnit){
this.showPao = true
}
// 获取重泡货路线
getCustomerLines(this.customerId).then(res => {
console.log({getCustomerLines: res})
this.zhongLines = res.data.filter(item => item.zhongPaoType == 1)
this.paoLines = res.data.filter(item => item.zhongPaoType == 2)
if(this.zhongLines.length)this.showZhong1 = true
if(this.paoLines.length) this.showPao1 = true
// /admin-api/customer-line/get-by-customer
// /admin-api/customer-line/get-by-customer?customerId=29564
})
})
} else {
// 新建客户
this.handleAddContact()
if(this.isCustomerServiceConfirmed){
console.log(this.userId);
this.form.customerService = this.userId
}
}
getNodeList().then(r => {
this.nodeList = r.data
})
getProductTypeList().then(r => {
this.productTypeList = r.data
})
getProductList().then(r => {
this.productList = r.data
})
getTradeCityList({type: 1}).then(r => {
this.importCityList = r.data.filter(item => item.type === '1')
})
getWarehouseList().then(r => {
this.warehouseList = r.data
})
listSimpleUsers().then(r => {
this.serviceUserList = r.data
})
getCountryListAll().then(r => {
this.countryList = r.data
})
this.getZhongPao()
},
data(){
return {
isCustomerServiceConfirmed:false,
getDictDatas,
DICT_TYPE,
// 表单参数
form: {},
// 表单校验
rules: {
name: [{ required: true, message: this.$t('客户名称不能为空'), trigger: "blur" }],
country: [{ required: true, message: this.$t('国家不能为空'), trigger: "blur" }],
level: [{ required: true, message: this.$t('客户等级不能为空'), trigger: "blur" }],
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" }],
status: [{ required: true, message: this.$t('客户状态不能为空'), trigger: "blur" }],
founder: [{ required: true, message: this.$t('创建人不能为空'), trigger: "blur" }],
},
contactRules: {
name: [{ required: true, message: this.$t('请输入联系人'), trigger: "blur" }],
areaCode: [{ required: true, message: this.$t('请选择区号'), trigger: "change" }],
phoneNew: [{
required: true,
trigger: "blur",
validator: this.phoneValidator
}],
},
// 网点
nodeList: [],
productTypeList: [],
productList: [],
showZhong: false,
showZhong1: false,
showPao: false,
showPao1: false,
warehouseList: [], // 仓库列表
importCityList: [], // 进口地址
customerSelect: [],
recommended:[],
serviceUserList: [],
countryList: [],
zhongLines: [], // 重货线路
paoLines: [], // 泡货线路
memberList:[],//会员列表
selectMemberList:[]//选中会员列表
}
},
methods: {
/* getUserMemberUserFn(val){
userMemberUserList({pageNo:1,pageSize:100,searchKey:val}).then(r => {
this.memberList = r.data.list
})
}, */
remoteMethod(val){
this.getCustomerSelect(val);
},
getCustomerSelect(val = ''){
getCustomerSelect({pageNo:1,pageSize:30,searchKey:val}).then(res => {
this.customerSelect = res.data.list
})
},
phoneValidator(rule, value, callback){
if (!value) {
return callback(new Error(this.$t('请输入联系方式')));
}
validatorMobile({
code: this.form.customerContacts.find(e => e.phoneNew === value).areaCode,
mobile: value
}).then(r => {
if (r.data){
callback()
} else {
callback(new Error(r.msg || this.$t('手机号验证失败')))
}
}).catch(e => {
console.error(e)
callback(new Error(this.$t('手机号验证失败')))
})
},
handleDefaultChange($index){
// 只有一个联系人,设置成非默认
if (this.form.customerContacts.length === 1 && this.form.customerContacts[0].isDefault === 0){
this.$modal.msgWarning(this.$t('至少拥有一个默认联系人'))
this.form.customerContacts[0].isDefault = 1
return
}
// 设置默认联系人
if (this.form.customerContacts[$index].isDefault === 1) {
// 其他的置否
let i = 0
this.form.customerContacts.forEach(e => {
if (i !== $index){
e.isDefault = 0
}
i++
})
} else {
// 第一个置是
this.form.customerContacts[0].isDefault = 1
}
},
/* selectBD(val){
if(!val){
return
}
let i = this.selectMemberList.find(item => item.id === val);
if(i === undefined){
this.selectMemberList.push(this.memberList.find(item => item.id === val))
}
// this.getUserMemberUserFn()
}, */
/** 取消按钮 */
cancel() {
this.$tab.closePage()
this.open = false;
this.reset();
},
/** 提交按钮 */
submitForm() {
if(this.form.customerContacts.length === 0){
this.$modal.alert(this.$t('至少添加一位联系人'))
return
}
this.$refs["contactForm"].validate((valid1,err1) => {
this.$refs["form"].validate((valid2,err2) => {
if (!valid1 || !valid2) {
this.$showFormValidateErrors({...err1,...err2})
return;
}
if (this.form.customerContacts.length === 0){
this.$modal.msgError(this.$t('至少填写一个联系人信息'));
return
}
const form = {...this.form, type: this.form.type?.join(','), taxRate: Number(this.form.taxRate)}
// 检查路线是否启用了但是没选择目的仓
let errors = 0
form.customerLines.forEach(line => {
if(!line.objectiveIds || line.objectiveIds == ''){
errors ++
}
})
if(errors){
return this.$message.error('有两条路线未选择目的地')
}
// 修改的提交
if (this.form.id != null) {
this.form.customerContacts.forEach(e => {
e.customerId = this.customerId
})
if(this.$route.name === 'perfect'){
fillupCustomeInfo(form).then(r => {
this.$modal.msgSuccess(this.$t('修改成功'));
this.open = false;
const obj = { path: "/customer/customer" };
this.$tab.closeOpenPage(obj);
})
}else {
updateCustomer(form).then(response => {
this.$modal.msgSuccess(this.$t('修改成功'));
this.open = false;
// this.getList();
const obj = { path: "/customer/customer" };
this.$tab.closeOpenPage(obj);
})
}
return;
}
// 添加的提交
//我的客户页面跳转直接
form.isCustomerServiceConfirmed = true;
createCustomer(form).then(response => {
this.$modal.msgSuccess(this.$t('新增成功'));
this.open = false;
// this.getList();
const obj = { path: "/customer/customer" };
this.$tab.closeOpenPage(obj);
})
});
})
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
number: undefined,
name: undefined,
level: 1,
country: undefined,
type: undefined,
agentId: undefined,
company: undefined,
address: undefined,
productType: undefined,
productId: undefined,
pickupPoint: undefined,
memberId: undefined,
birthday: undefined,
balance: undefined,
source: undefined,
picture: undefined,
customerService: undefined,
customerContacts: [],
customerLines: [],
lightUnit: undefined,
promoter: undefined,
status: 1,
founder: this.$store.getters.userId,
department: undefined,
invoiceTitle: undefined,
licenseNumber: undefined,
bank: undefined,
bankNumber: undefined,
project: undefined,
billingAddress: undefined,
billingTell: undefined,
taxRate: undefined,
remarks: undefined,
arrivalConfirm: undefined,
weightUnit: undefined,
createTime: undefined,
isShowTidanPrice:true,
};
this.form.createTime = (new Date()).getTime()
this.resetForm("form");
},
getCustomer(id) {
return getCustomer(id).then(response => {
this.form = { ...this.form, ...response.data, id: this.customerId };
this.open = true;
this.title = this.$t('修改客户');
});
},
updateCustomerLines() {
let zhongLines = [], paoLines = []
if (this.zhongLines.length > 0) {
zhongLines = this.zhongLines
}
if (this.paoLines.length > 0) {
paoLines = this.paoLines
}
this.form.customerLines = [...zhongLines, ...paoLines]
},
handleAddContact() {
this.form.customerContacts.push({
"areaCode": "",
// "customerId": 0,
"department": "",
"email": "",
"isDefault": this.form.customerContacts.length === 0 ? 1 : 0,
"name": "",
"phoneNew": "",
"position": "",
"social": undefined,
"socialNumber": "",
"userid": undefined,
// "username": ""
})
},
handleDeleteContact($index){
this.form.customerContacts.splice($index, 1)
if (this.form.customerContacts.length > 0) {
this.$refs['contactForm'].clearValidate()
if (!this.form.customerContacts.find(e => e.isDefault)){
this.form.customerContacts[0].isDefault = 1
}
}
},
getZhongPao(){
getZhongPaoBest({
customerId: this.customerId,
// departureId: this.departureId,
// objectiveId: this.objectiveId
}).then(r => {
this.form.weightUnit = r.data.zhongEdge
this.form.lightUnit = r.data.paoEdge
})
}
},
computed: {
userId(){
return this.$store.state.user.id
},
/* userMemberUser(){
let list = this.memberList.filter(item => {
return this.selectMemberList.findIndex(i => i.id === item.id) < 0
})
return [...this.selectMemberList,...list]
}, */
productListFilter(){
return this.productList.filter((p) => p.typeId === this.form.productType)
},
customerSelectFn(){
if(this.recommended.length > 0){
let i = this.customerSelect.find(item => item.id === this.recommended[0].id)
if(!i){
this.customerSelect.push(this.recommended[0])
}
return this.customerSelect
}else {
return this.customerSelect
}
}
},
watch: {
zhongLines() {
console.log('zhongLines', this.zhongLines)
this.updateCustomerLines()
},
paoLines() {
console.log('paoLines', this.paoLines)
this.updateCustomerLines()
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-table__cell {
padding-bottom: 0;
.cell {
.el-form-item {
margin-bottom: 9px;
}
.el-form-item__error {
z-index: 1;
padding-top: 0;
top: 32px;
}
}
}
</style>
......@@ -120,6 +120,7 @@
v-hasPermi="['ecw:customer:delete']">{{$t('删除')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-collection" @click="followUp(scope.row)">{{$t('跟进')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-user" @click="complaint(scope.row)">{{$t('客诉')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{$t('延期')}}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -753,6 +754,10 @@ export default {
this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
})
},
delay(row){
this.$router.push({path:'/customer/delay',query:{id:row.id}})
},
complaint(row){
this.customerId = row.id;
this.$nextTick(()=>{
......
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('客户名称')" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('联系方式')">
<el-input :placeholder="$t('请输入联系方式')" v-model="queryParams.defaultContactPhone"></el-input>
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" clearable size="small">
<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 clearable v-model="queryParams.source" :placeholder="$t('请选择客户来源')" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<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-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>
</el-form>
<!-- 列表 -->
<el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="name" />
<el-table-column :label="$t('联系方式')" prop="defaultContactPhone">
<template v-slot="{row}">
+{{row.defaultContactPhone}}
</template>
</el-table-column>
<el-table-column :label="$t('客户来源')" align="center" prop="sourse">
<template v-slot="{row}">
<dict-tag :value="row.resourceType" :type="DICT_TYPE.CUSTOMER_SOURCE" />
</template>
</el-table-column>
<el-table-column :label="$t('资源类型')" align="center" prop="resourceType">
<template v-slot="{row}">
<dict-tag :value="row.resourceType" :type="DICT_TYPE.CUSTOMER_ESOURCE_TYPE" />
</template>
</el-table-column>
<el-table-column :label="$t('客户类别')" align="center" prop="sourse">
<template v-slot="{row}">
<dict-tag :value="row.type" :type="DICT_TYPE.CUSTOMER_TYPE" />
</template>
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerService" :formatter="customerServiceFn">
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{$t('完善')}}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
</div>
</template>
<script>
import { createCustomer, updateCustomer, deleteCustomer, getCustomer,
getCustomerPage, exportCustomerExcel } from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants'
import {getNodeList} from "@/api/ecw/node"
import {listServiceUser} from "@/api/system/user";
import {getCreditPage} from "@/api/customer/credit";
export default {
name: "IndirectCustomer",
data() {
return {
getDictDatas,
DICT_TYPE,
// 遮罩层
loading: true,
// 导出遮罩层
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 客户列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
name: null,
source: null,
customerService: null,
},
// 网点
nodeList: [],
customerId:undefined,
customerServiceList:[],
};
},
created() {
this.getList();
listServiceUser().then(r=>{
this.customerServiceList = r.data;
})
},
methods: {
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.customerService);
return index !== -1 ? this.customerServiceList[index]?.nickname :''
}else {
return ''
}
},
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getCustomerPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.queryParams = {
pageNo: 1,
pageSize: 10,
name: null,
source: null,
customerService: null,
}
this.handleQuery();
},
delay(row){
this.$router.push({path:'/customer/editIndirect',query:{id:row.id}})
},
handleSelectionChange(val){
}
}
};
</script>
......@@ -3,15 +3,33 @@
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('关键字')" prop="transportType">
<el-input v-model="queryParams.key" :placeholder="$t('请输入关键字查找')" />
</el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportType">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number"/>
</el-form-item>
<el-form-item :label="$t('出货渠道')" prop="shippingChannel">
<el-select v-model="queryParams.shippingChannel" :placeholder="$t('请选择出货渠道')">
<el-option v-for="item in channelList" :label="item.nameZh" :value="item.channelId"
:key="item.channelId"></el-option>
</el-select>
<el-form-item :label="$t('唛头')" prop="transportType">
<el-input v-model="queryParams.marks" :placeholder="$t('请输入关键字查找')" />
</el-form-item>
<el-form-item :label="$t('资源类型')" prop="customerType">
<el-select clearable v-model="queryParams.customerType" :placeholder="$t('请选择资源类型')" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_ESOURCE_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<!-- <el-form-item :label="$t('客户经理')" prop="customerService">
<el-select clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" clearable size="small">
<el-option v-for="dict in customerServiceList"
:key="dict.id" :label="dict.nickname" :value="dict.id"/>
</el-select>
</el-form-item> -->
<!-- <el-form-item prop="customerService">
<el-select clearable v-model="queryParams.customerService" clearable size="small">
<el-option label="下单时间" value="createTime"/>
<el-option label="装柜时间" value="ldBoxTime"/>
</el-select>
</el-form-item> -->
<el-form-item>
<el-date-picker v-model="dateFilter" type="daterange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<!-- <el-date-picker v-model="queryParams.beginStartTime" :placeholder="$t('请选择开始时间')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>-->
......@@ -21,36 +39,65 @@
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
>{{$t('导出')}}</el-button>
</el-form-item>
</el-form>
<div class="total_num">
<span>开发客户:</span>
<span>总箱数 {{totalData.developNum}}</span>
<span>总方数 {{totalData.developNum}}</span>
<span>总重量 {{totalData.developNum}}KG </span>
<span>公司客户:</span>
<span>总箱数 {{totalData.companyNum}}</span>
<span>总方数 {{totalData.companyNum}}</span>
<span>总重量 {{totalData.companyNum}}KG </span>
<span>汇总:</span>
<span>总箱数 {{totalData.sumNum}}</span>
<span>总方数 {{totalData.sumNum}}</span>
<span>总重量 {{totalData.sumNum}}KG </span>
</div>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('序号')" align="center" type="index"></el-table-column>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<!-- <el-table-column :label="$t('序号')" align="center" type="index"></el-table-column> -->
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column :label="$t('资源类型')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_ESOURCE_TYPE" :value="scope.row.customerType"/>
</template>
</el-table-column>
<el-table-column :label="$t('报价单号')" align="center" width="180">
<template slot-scope="scope">
<span>{{scope.row.offerId}}</span>
<span>{{scope.row.number}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('报价结果')" align="center">
<!-- <el-table-column :label="$t('报价结果')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="scope.row.offerStatus"/>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column :label="$t('订单号')" align="center" prop="orderNo"/>
<el-table-column :label="$t('发货人')" align="center" prop="consignorName"/>
<el-table-column :label="$t('客户名称')" align="center" prop="name"/>
<el-table-column :label="$t('联系方式')" align="center" prop="phoneNew"/>
<el-table-column :label="$t('唛头')" align="center" prop="marks"/>
<el-table-column :label="$t('订单状态')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column :label="$t('是否控货')" align="center" prop="isCargoControl">
<template slot-scope="scope">
{{scope.row.isCargoControl?$t(''):$t('')}}
</template>
</el-table-column>
<el-table-column :label="$t('方数')" align="center" prop="sumVolume"/>
<el-table-column :label="$t('重量')" align="center" prop="completeWeight"/>
<el-table-column :label="$t('方数')" align="center" prop="completeVolume"/>
<el-table-column :label="$t('下单时间')" align="center" prop="createTime"/>
<el-table-column :label="$t('订单状态')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status"/>
</template>
<el-table-column :label="$t('装柜时间')" align="center" prop="ldBoxTime"/>
<el-table-column :label="$t('客户经理')" align="center" prop="userId" :formatter="customerServiceFn">
</el-table-column>
</el-table>
<!-- 分页组件 -->
......@@ -74,6 +121,7 @@
import {listSimpleDepts} from "@/api/system/dept";
import {getChannelList} from '@/api/ecw/channel';
import dayjs from "dayjs";
import {listServiceUser} from "@/api/system/user";
export default {
name: "DeptTarget",
......@@ -131,12 +179,25 @@
},
// 表单参数
form: {},
customerServiceList:[],
// 表单校验
rules: {
deptId: [{required: true, message: this.$t("部门ID不能为空"), trigger: "blur"}],
targetType: [{required: true, message: this.$t("目标类型不能为空"), trigger: "change"}],
cubeNum: [{required: true, message: this.$t("立方数不能为空"), trigger: "blur"}],
}
},
totalData:{
companyWeight:0,
companyVolume:0,
companyNum:0,
developWeight:0,
developVolume:0,
developNum:0,
sumWeight:0,
sumVolume:0,
sumNum:0,
},
myAchievementData:{}
};
},
computed: {
......@@ -155,6 +216,9 @@
created() {
this.getChannelList();
this.getList();
listServiceUser().then(r=>{
this.customerServiceList = r.data;
})
},
methods: {
getChannelList() {
......@@ -183,13 +247,25 @@
}
})
},
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.userId);
return index !== -1 ? this.customerServiceList[index]?.nickname :''
}else {
return ''
}
},
/** 查询列表 */
getList() {
this.loading = true;
// 执行查询
myAchievementByPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.list = response.data.myAchievementDtos.list;
this.total = response.data.myAchievementDtos.total;
this.myAchievementData = response.data
this.totalData.sumWeight =this.myAchievementData.totalWeight
this.totalData.sumVolume =this.myAchievementData.totalVolume
this.totalData.sumNum =this.myAchievementData.totalNum
this.loading = false;
});
},
......@@ -299,6 +375,40 @@
}).catch(() => {
});
},
handleSelectionChange(val){
if(val&&val.length>0){
var data={
companyWeight:0,
companyVolume:0,
companyNum:0,
developWeight:0,
developVolume:0,
developNum:0,
sumWeight:0,
sumVolume:0,
sumNum:0,
}
val.forEach(item=>{
if(item.customerType==1){
data.developWeight += item.completeWeight
data.companyVolume += item.completeVolume
data.companyNum += item.sumNum
}else{
data.companyWeight += item.completeWeight
data.companyVolume += item.completeVolume
data.companyNum += item.sumNum
}
data.sumWeight += item.completeWeight
data.sumVolume += item.completeVolume
data.sumNum += item.sumNum
})
this.$set(this,'totalData',data)
}else{
this.totalData.sumWeight =this.myAchievementData.totalWeight
this.totalData.sumVolume =this.myAchievementData.totalVolume
this.totalData.sumNum =this.myAchievementData.totalNum
}
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
......@@ -313,7 +423,8 @@
this.exportLoading = true;
return exportDeptTargetExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.$download.excel(response, `${this.$t('我的业绩')}.xls`);
this.exportLoading = false;
}).catch(() => {
});
......@@ -321,3 +432,17 @@
}
};
</script>
<style scoped >
.total_num{
display:flex;
align-items: center;
justify-content: center;
margin:20px 0;
font-size:15px;
}
.total_num span{
margin: 0 8px;
}
</style>
<template>
<div class="infoheader">
<el-collapse v-model="activeNames">
<div v-for="item in helpData" :key="item.id">
<el-collapse-item :title="item.titleZh" :name="item.id">
<span v-html="item.contentZh">{{ item.contentZh }}</span>
</el-collapse-item>
</div>
</el-collapse>
</div>
</template>
<script>
import { getInternalHelpDocPage} from "@/api/system/internalHelpDoc";
export default {
data() {
return {
activeNames: [],
helpData: []
}
},
created() {
getInternalHelpDocPage({ pageNo: 1, pageSize: 100 }).then((r) => {
this.helpData = r.data.list
this.activeNames = this.helpData.map(m => { return m.id })
})
}
}
</script>
<style scoped>
.infoheader{
padding:20px
}
</style>
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