Commit 4b401103 authored by chenjiuping's avatar chenjiuping

Merge branch 'dev' into bmp

parents 9bc42ce6 f66a0cba
......@@ -318,3 +318,12 @@ export function downloadLadingCopy(params) {
params,
});
}
// 更新异常订单状态
export function updateAbnormalOrder(data) {
return request({
url: "/shipment/box/updateAbnormalOrder",
method: "post",
data,
});
}
......@@ -259,3 +259,38 @@ 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,
})
}
// 获取客户审批详情
export function getApproval(id) {
return request({
url: '/ecw/customer-approval/get',
method: 'get',
params: {id}
})
}
\ No newline at end of file
// 导出客户 Excel
import request from '@/utils/request'
import query from "@/views/ecw/customer/query";
import * as url from "url";
export function exportCustomerExcel(query) {
return request({
url: '/ecw/indirect-customer/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 获得客户
export function getCustomer(id) {
return request({
url: '/ecw/indirect-customer/get?id=' + id,
method: 'get'
})
}
// 获得客户分页
export function getCustomerPage(query) {
return request({
url: '/ecw/indirect-customer/page',
method: 'get',
params: query
})
}
// 更新客户
export function updateCustomer(data) {
return request({
url: '/ecw/indirect-customer/update',
method: 'put',
data: data
})
}
// 根据客户ID获得联系人列表
export function getCustomerContactsListByCustomer(id) {
return request({
url: '/ecw/indirect-customer-contacts/list-by-customer/get?customerId=' + id,
method: 'get'
})
}
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', //产品备案属性
......@@ -202,7 +203,14 @@ export const DICT_TYPE = {
BOX_SEA_AIR: 'shipping_process_sea_air', // 海空联运流程流程
BOX_SHIPPING_BRAND_TYPE: 'shipping_brand_type', // 出货品牌类型
BOX_SHIPPING_NOTICE_TYPE: 'shipping_notice_type', // 出货通知类型
BOX_ORDER_SHIPMENT_STATE: 'order_shipment_state'
BOX_ORDER_SHIPMENT_STATE: 'order_shipment_state',
BOX_INSPECTION_TIME_CUSTOMS: 'inspection_time_customs', // 校验时间-报关
BOX_INSPECTION_TIME_SHIPPING: 'inspection_time_shipping', // 校验时间-起运
BOX_INSPECTION_TIME_ARRIVAL: 'inspection_time_arrival', // 校验时间-到港
BOX_SHIPPING_UPDATE_TYPE: "shipping_update_type",// 更新类型
BOX_CUSTOMS_ERROR_TYPE: "customs_error_type",// 报关异常状态
BOX_SHIPPING_ERROR_TYPE: "shipping_error_type",// 起运异常状态
BOX_ARRIVAL_ERROR_TYPE: "arrival_error_type",// 到港异常状态
}
/**
......
......@@ -331,6 +331,12 @@ export default {
id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath
},
// 客户延期
customer_delay:{
component: () => import('@/views/ecw/customer/components/Delay'),
id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath
},
}
console.log(this.processInstance.processDefinition.formCustomViewPath.trim())
return map[this.processInstance.processDefinition.formCustomViewPath.trim()]
......
......@@ -178,7 +178,7 @@
</el-table-column>
<el-table-column :label="$t('操作')" align="center" width="80">
<template slot-scope="scope">
<el-button type="text" @click="handleCommand(scope.row, 'sea')">{{$t('处理')}}</el-button>
<el-button type="text" @click="handleCommand(scope.row, 'handle')">{{$t('处理')}}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -372,7 +372,9 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm(this.$t('是否确认删除出货编号为 {no} 的数据项?', {no: row.selfNo}))
.confirm(
this.$t("是否确认删除出货编号为 {no} 的数据项?", { no: row.selfNo })
)
.then(function () {
return deletebox(row.id);
})
......@@ -432,11 +434,14 @@ export default {
case "editLadingBill":
const cabinetLabel = this.getCabinetName(row.cabinetId);
const title = this.$t('查看提单 {selfNo} 柜号:{cubNo} 柜型:{cabinetLabel}', {
selfNo: row.selfNo,
cubNo: row.cubNo,
cabinetLabel: cabinetLabel
})
const title = this.$t(
"查看提单 {selfNo} 柜号:{cubNo} 柜型:{cabinetLabel}",
{
selfNo: row.selfNo,
cubNo: row.cubNo,
cabinetLabel: cabinetLabel,
}
);
this.$set(this.dialogCfg, "title", title);
this.$set(this.dialogCfg, "fullscreen", true);
break;
......@@ -453,7 +458,7 @@ export default {
downloadFile(
command,
{ shipmentId: row.id },
this.$t('预装单')+`(${row.selfNo}).xlsx`,
this.$t("预装单") + `(${row.selfNo}).xlsx`,
"xlsx"
);
break;
......@@ -461,7 +466,7 @@ export default {
downloadFile(
command,
{ shipmentId: row.id },
this.$t('已装单') + `(${row.selfNo}).xlsx`,
this.$t("已装单") + `(${row.selfNo}).xlsx`,
"xlsx"
);
break;
......@@ -469,7 +474,7 @@ export default {
downloadFile(
command,
{ shipmentId: row.id },
this.$t('应收汇总表') + `(${row.selfNo}).xlsx`,
this.$t("应收汇总表") + `(${row.selfNo}).xlsx`,
"xlsx"
);
break;
......@@ -486,6 +491,16 @@ export default {
case "downloadLadingCopy":
downloadFileByUrl(command, { shipmentId: row.id });
break;
case "handle":
const { noticeType } = row;
if ([1, 2, 3, 4, 8].includes(noticeType)) {
this.$router.push("/boxSea/shippingSea/" + row.id);
}
if ([5, 6, 7].includes(noticeType)) {
this.$router.push("/boxSea/query/" + row.id);
}
this.closeDialog();
break;
}
if (["editLadingBill", "cost", "error"].includes(command)) {
......
......@@ -55,6 +55,10 @@
<p class="box-weight">
{{getSectionInfo}}
</p>
<div style="margin-left:30px;">
<el-button type="primary" size="small" @click="()=>updateStatus('selected')">{{$t('更新所选订单状态')}}</el-button>
<el-button type="primary" size="small" @click="()=>updateStatus('all')">{{$t('更新全部订单状态')}}</el-button>
</div>
<div class="document-status">
<p>{{$t('单证状态')}}</p>
<template v-for="(item, index) in getDocStatus(sectionObj.sectionOrderList)">
......@@ -62,7 +66,8 @@
</template>
</div>
</div>
<el-table :data="sectionObj.sectionOrderList" style="width: 100%" border>
<el-table :data="sectionObj.sectionOrderList" style="width: 100%" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" :selectable="selectable"></el-table-column>>
<el-table-column type="index" align="center" :label="$t('序号')" width="50" />
<el-table-column prop="orderNo" :label="$t('订单号')" align="center">
<template v-slot="scope">
......@@ -93,6 +98,11 @@
</template>
</el-table-column>
<el-table-column prop="customsFee" :label="$t('报关费用')" align="center"></el-table-column>
<el-table-column prop="" :label="$t('操作')" align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" :disabled="scope.row.abnormalDealStatus === 1" @click="()=>updateStatus('single', scope.row)">{{$t('更新状态')}}</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane :label="$t('状态')" name="status">
......@@ -137,7 +147,7 @@
<el-tab-pane :label="$t('异常')" name="error">
<el-table :data="errorList" style="width: 100%" border>
<el-table-column type="index" align="center" :label="$t('序号')" width="50" />
<el-table-column prop="opStep" :label="$t('操作步骤')" align="center">
<el-table-column prop="opStep" :label="$t('操作')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PROCESS" :value="scope.row.opStep" />
</template>
......@@ -147,8 +157,9 @@
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_TICKET_EXCEPTION" :value="scope.row.opStep" />
</template>
</el-table-column>
<el-table-column prop="abnDetail" :label="$t('异常详情')" align="center" width="800"></el-table-column>
<el-table-column prop="" :label="$t('异常时间')" align="center">
<el-table-column prop="abnDetail" :label="$t('异常描述')" align="center" width="700"></el-table-column>
<el-table-column prop="delayDays" :label="$t('异常延迟天数')" align="center"></el-table-column>
<el-table-column prop="" :label="$t('异常时间')" align="center" width="300">
<template slot-scope="scope">
<span v-if="scope.row.abnStartTime">{{formatDate(scope.row.abnStartTime)}} - </span>
<span v-if="scope.row.abnEndTime">{{formatDate(scope.row.abnEndTime)}}</span>
......@@ -180,7 +191,10 @@
<costForm v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :costDetail="costDetail" />
</template>
<template v-if="dialogConfig.type === 'error'">
<regError v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" />
<regError v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :allUsers="allUsers" />
</template>
<template v-if="dialogConfig.type === 'updateError'">
<updateError v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :errorInfo="errorInfo" />
</template>
</el-dialog>
</div>
......@@ -199,8 +213,6 @@ import { getChannelList } from "@/api/ecw/channel";
import { getCabinetPage } from "@/api/ecw/cabinet";
import { getWarehouseList } from "@/api/ecw/warehouse";
import {
getSeaStatus,
getStatusName,
getTotlContent,
formatDate,
serviceMsg,
......@@ -212,6 +224,8 @@ import { getSupplierPage } from "@/api/ecw/supplier";
import costForm from "./costForm.vue";
import regError from "./regError.vue";
import editForm from "./editForm.vue";
import updateError from "./updateError.vue";
import { listUser } from "@/api/system/user";
export default {
name: "boxDetail",
......@@ -222,6 +236,7 @@ export default {
costForm,
regError,
editForm,
updateError,
},
created() {
this.transportTypes = this.getDictDatas(
......@@ -229,6 +244,11 @@ export default {
).filter((item) => item.value == "1" || item.value == "2");
this.initData();
this.queryAllData();
// 用户
listUser({ pageNo: "1", pageSize: "10000" }).then((res) => {
const { data } = res;
this.allUsers = data.list ?? [];
});
},
data() {
return {
......@@ -242,6 +262,7 @@ export default {
warehouseList: [],
// 供应商
allSupplier: [],
allUsers: [],
// 部分list
sectionList: [],
// 单证数组
......@@ -276,18 +297,88 @@ export default {
{ title: this.$t("预装单"), serviceName: "downloadPreloadGoodsList" },
{ title: this.$t("已装单"), serviceName: "downloadLoadGoodsList" },
{ title: this.$t("应收汇总表"), serviceName: "downloadReceivableList" },
{ title: this.$t("提货单"), serviceName: "zipDownload", fileFormat: "zip" },
{
title: this.$t("提货单"),
serviceName: "zipDownload",
fileFormat: "zip",
},
{
title: "agent list",
serviceName: "downloadAgentListFiles",
type: "url",
},
{ title: "soncap", serviceName: "downloadSoncapFiles", type: "url" },
{ title: this.$t("提单Copy"), serviceName: "downloadLadingCopy", type: "url" },
{
title: this.$t("提单Copy"),
serviceName: "downloadLadingCopy",
type: "url",
},
],
// 选中行
selectedRows: [],
// 修改异常
errorInfo: {
orderList: [],
errorType: "",
operate: "",
},
};
},
methods: {
selectable(row, index) {
if (row.abnormalDealStatus === 1) return false;
return true;
},
/* 全选 */
handleSelectionChange(selected) {
this.selectedRows = selected;
},
/* 更新状态 */
updateStatus(type, row) {
let orders = [];
if (type === "selected") {
if (!this.selectedRows.length) {
this.$message.error("请选择需要更新的订单");
return;
}
orders = this.selectedRows;
} else if (type === "all") {
// 筛选未处理的订单
orders = this.sectionObj.sectionOrderList.filter(
(item) => item.abnormalDealStatus === 0
);
if (!orders.length) {
this.$message.error("没有订单需要更新");
return;
}
} else if (type === "single") {
orders = [row];
}
this.getErrorType();
this.$set(this.errorInfo, "orderList", orders);
this.$set(this.errorInfo, "operate", type);
// 判断异常类型
this.handleCommand("updateError");
},
getErrorType() {
for (const [key, value] of Object.entries(this.shipmentObj)) {
// 报关异常 customsInfo
if (key === "customsInfo" && value.hasAbnormal) {
this.$set(this.errorInfo, "errorType", "customs");
this.$set(this.dialogConfig, "title", this.$t("更新报关异常状态"));
}
// 起运异常 shippingInfo
if (key === "shippingInfo" && value.hasAbnormal) {
this.$set(this.errorInfo, "errorType", "shipping");
this.$set(this.dialogConfig, "title", this.$t("更新起运异常状态"));
}
// 到港异常 arrivalInfo
if (key === "arrivalInfo" && value.hasAbnormal) {
this.$set(this.errorInfo, "errorType", "arrival");
this.$set(this.dialogConfig, "title", this.$t("更新到港异常状态"));
}
}
},
// 初始化字典数据
initData() {
// 查询渠道
......@@ -316,7 +407,7 @@ export default {
this.sectionList = res.data.map((item, index) => {
return {
...item,
title: this.$t('第{index}部分', {index: index + 1}),
title: this.$t("第{index}部分", { index: index + 1 }),
};
});
});
......@@ -363,7 +454,7 @@ export default {
// 供应商
getSupplier(id) {
let arr = this.allSupplier.find((item) => item.id == id) ?? {};
return this.$l(arr, 'company');
return this.$l(arr, "company");
},
editCostClick(row) {
this.costDetail = row;
......@@ -401,15 +492,19 @@ export default {
this.$set(this.dialogConfig, "title", this.$t("费用登记"));
this.$set(this.dialogConfig, "type", "cost");
break;
case "error":
this.$set(this.dialogConfig, "visible", true);
this.$set(this.dialogConfig, "title", this.$t("异常登记"));
this.$set(this.dialogConfig, "type", "error");
break;
case "delete":
this.$modal
.confirm(
$t('是否确认删除出货编号为 {no} 的数据项?', {no: this.shipmentObj.selfNo})
this.$t("是否确认删除出货编号为 {no} 的数据项?", {
no: this.shipmentObj.selfNo,
})
)
.then(() => {
return deletebox(this.shipmentId);
......@@ -430,6 +525,11 @@ export default {
})
.catch(() => {});
break;
case "updateError":
this.$set(this.dialogConfig, "visible", true);
this.$set(this.dialogConfig, "type", "updateError");
break;
}
},
// 关闭弹框
......@@ -446,6 +546,9 @@ export default {
this.errorList = res.data;
});
}
if (type === "detail") {
this.getBoxGoodsDetail();
}
},
formatDate,
downloadDetailFile(row) {
......@@ -483,7 +586,7 @@ export default {
return (shippingChannelId) => {
for (const channelItem of this.channelList) {
if (channelItem.channelId == shippingChannelId) {
return this.$l(channelItem, 'name');
return this.$l(channelItem, "name");
}
}
};
......@@ -498,20 +601,14 @@ export default {
}
};
},
/* 状态 */
getBoxStatus() {
return (shippingVO) => {
return getStatusName(getSeaStatus(shippingVO));
};
},
/* 总计 */
getBoxSum() {
return (boxStatistics) => {
if (boxStatistics) {
return this.$t("{num}箱 {volum}m³", {
num: boxStatistics.num ?? 0,
volume: boxStatistics.weight ?? 0
})
volume: boxStatistics.weight ?? 0,
});
/* `${boxStatistics.num ?? 0} ${boxStatistics.volume ?? 0}m3 ${
boxStatistics.weight ?? 0
}kg`; */
......@@ -523,7 +620,7 @@ export default {
getCityName() {
return (id) => {
let arr = this.warehouseList.filter((item) => item.id == id);
return arr.length > 0 ? this.$l(arr[0], 'title') : this.$t("无");
return arr.length > 0 ? this.$l(arr[0], "title") : this.$t("无");
};
},
// 部分信息
......
......@@ -17,12 +17,17 @@
<el-form-item :label="$t('异常情况')">
<el-input v-model="errorObj.abnDetail" type="textarea" rows="2" :placeholder="$t('请输入异常情况')"></el-input>
</el-form-item>
<el-form-item :label="$t('异常时间')" prop="arrivalTime" class="two-element">
<el-form-item :label="$t('异常时间')" prop="arrivalTime" class="three-element">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="errorObj.abnStartTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="errorObj.abnEndTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<div class="delayTime">延迟时间:{{delayDay}}</div>
</el-form-item>
<el-form-item :label="$t('是否更新订单状态')">
<el-form-item :label="$t('通知人')">
<userSelect v-model="errorObj.notifyUsers" :placeholder="$t('请选择通知人')" :allUsers="this.$attrs.allUsers" multiple />
</el-form-item>
<!-- <el-form-item :label="$t('是否更新订单状态')">
<el-radio-group v-model="errorObj.orderStatus">
<el-radio v-for="item in status" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
......@@ -32,7 +37,7 @@
</el-form-item>
<el-form-item :label="$t('英文内容')">
<el-input v-model="errorObj.contentEn" type="textarea" rows="2" :placeholder="$t('请输入英文内容')"></el-input>
</el-form-item>
</el-form-item> -->
</el-form>
<el-row class="operate-button">
......@@ -45,12 +50,16 @@
<script>
import { abnormalCreate } from "@/api/ecw/boxSea";
import { serviceMsg } from "./shippingSea/utils";
import userSelect from "./shippingSea/nodePage/common/userSelect.vue";
import dayjs from "dayjs";
/**
* 异常登记
*/
export default {
name: "regError",
inheritAttrs: false,
components: { userSelect },
data() {
return {
// 异常对象
......@@ -66,23 +75,47 @@ export default {
label: this.$t(""),
},
],
flag: 'sea'
flag: "sea",
delayDay: 0,
};
},
created() {
const { currNode } = this.$attrs;
this.errorObj = { opStep: currNode?.dataKey ?? undefined };
if(this.$attrs.shipmentObj.bosType == 'seaAir'){
this.flag = 'seaAir';
if (this.$attrs.shipmentObj.bosType == "seaAir") {
this.flag = "seaAir";
}
},
watch: {
// 异常开始时间
"errorObj.abnStartTime"(val) {
this.compareDate(val, this.errorObj.abnEndTime);
},
// 异常结束时间
"errorObj.abnEndTime"(val) {
this.compareDate(this.errorObj.abnStartTime, val);
},
},
methods: {
// 时间比较
compareDate(abnStartTime, abnEndTime) {
this.delayDay = 0;
let date1 = null,
date2 = null;
if (abnStartTime) date1 = dayjs(abnStartTime);
if (abnEndTime) date2 = dayjs(abnEndTime);
if (date1 && date2) {
this.delayDay = date2.diff(date1, "day");
}
},
/** 提交 */
onSubmit() {
this.$refs["errorForm"].validate((valid) => {
if (valid) {
abnormalCreate({
...this.errorObj,
delayDays: this.delayDay,
notifyUsers: this.errorObj.notifyUsers?.join(",") ?? "",
shipmentId: this.$attrs.shipmentObj.id,
}).then((res) => {
serviceMsg(res, this).then(() => {
......@@ -108,18 +141,14 @@ export default {
.operate-button {
text-align: center;
}
.two-element-formItem {
display: flex;
> :last-child {
width: 100%;
margin-left: 10px;
}
}
.two-element {
.three-element {
.el-form-item__content {
display: flex;
> :last-child {
margin-left: 10px;
> .el-date-editor {
margin-right: 10px;
}
> .delayTime {
width: 300px;
}
}
}
......
......@@ -93,7 +93,6 @@
import { approvalDetail } from "@/api/ecw/box";
import {
getSeaStatus,
getStatusName,
getTotlContent,
} from "./shippingSea/utils";
import { getCabinetPage } from "@/api/ecw/cabinet";
......@@ -196,12 +195,6 @@ export default {
}
};
},
/* 货柜状态 */
getCabinetStatus() {
return (shippingVO) => {
return getStatusName(getSeaStatus(shippingVO));
};
},
/* 体积重量 */
getVolumeWeight() {
return (total) => {
......
......@@ -24,7 +24,7 @@
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('票异常')" :visible.sync="dialogVisible" width="700px" :modal-append-to-body=false append-to-body destroy-on-close>
<regError @closeDialog="dialogVisible = false" v-bind="$attrs" />
<regError @closeDialog="regCloseDialog" v-bind="$attrs" />
</el-dialog>
</div>
</template>
......@@ -50,12 +50,17 @@ export default {
arrivalObj: {},
// 校验
rules: {
apRealTime: [{ required: true, message: this.$t("必填"), trigger: "change" }],
apRealTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
},
// 弹窗配置
dialogVisible: false,
// 提示消息
showMsg: false,
inspectionTimeArrival: this.getDictDatas(
this.DICT_TYPE.BOX_INSPECTION_TIME_ARRIVAL
)[0].value,
};
},
created() {
......@@ -76,11 +81,19 @@ export default {
},
},
methods: {
regCloseDialog(type) {
this.dialogVisible = false;
if (type === "error") {
this.$emit("getBoxInfo");
}
},
// 获取预计到港时间
getExpectedTime() {
const { shippingInfo } = this.$attrs.shipmentObj;
if (shippingInfo) {
return dayjs(shippingInfo.dtEstArrivalTime).format("YYYY-MM-DD HH:mm:ss");
return dayjs(shippingInfo.dtEstArrivalTime).format(
"YYYY-MM-DD HH:mm:ss"
);
}
return null;
},
......@@ -93,7 +106,7 @@ export default {
if (apConfirmTime) date2 = dayjs(apConfirmTime);
if (date1 && date2) {
const days = date2.diff(date1, "day");
if (days > 5) {
if (days > this.inspectionTimeArrival) {
this.showMsg = true;
}
}
......
......@@ -35,6 +35,9 @@
<el-form-item :label="$t('截关时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cusDeclarationObj.dcCutOffTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('报关时间')" prop="dcDecTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="cusDeclarationObj.dcDecTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('状态')" prop="dcCustomsStatus">
<el-radio-group v-model="cusDeclarationObj.dcCustomsStatus" :disabled="inReview || isCheckDeal('status')">
<el-radio v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_DCCUSTOMS_STATUS)" :key="item.value" :label="item.value">{{item.label}}</el-radio>
......@@ -88,6 +91,7 @@
<el-button type="success" v-if="!inReview" @click="onSubmit(2)" :disabled="isCheckDeal('submit')">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button type="primary" @click="extraCost" v-show="cusDeclarationObj.dcCustomsStatus === '2' || cusDeclarationObj.dcCustomsStatus === '3'">{{$t('额外费用')}}</el-button>
<el-button type="primary" @click="exceptionReg" :disabled="!isShowError">{{$t('异常登记')}}</el-button>
</el-row>
<!-- 对话框 -->
......@@ -141,6 +145,11 @@
</el-row>
</el-row>
</el-dialog>
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('票异常')" :visible.sync="regDialogVisible" width="700px" :modal-append-to-body=false append-to-body destroy-on-close>
<regError @closeDialog="regCloseDialog" v-bind="$attrs" :shipmentObj="shipmentObj" />
</el-dialog>
</div>
</template>
......@@ -165,6 +174,8 @@ import {
} from "../utils";
import ImageUpload from "@/components/ImageUpload";
import Decimal from "decimal.js";
import regError from "../../regError";
import dayjs from "dayjs";
/**
* 报关
......@@ -172,7 +183,7 @@ import Decimal from "decimal.js";
export default {
name: "cusDeclaration",
inheritAttrs: false,
components: { supplierSelect, ImageUpload },
components: { supplierSelect, ImageUpload, regError },
props: {
shipmentObj: Object,
},
......@@ -194,6 +205,9 @@ export default {
dcCustomsStatus: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
dcDecTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
},
// 弹窗配置
dialogConfig: {
......@@ -208,6 +222,12 @@ export default {
costList: [],
// 是否审核中
inReview: false,
// 异常登记
regDialogVisible: false,
isShowError: false,
inspectionTimecustoms: this.getDictDatas(
this.DICT_TYPE.BOX_INSPECTION_TIME_CUSTOMS
)[0].value,
};
},
created() {
......@@ -228,15 +248,39 @@ export default {
"dcCutOffTime",
"dcCheckTime",
"dcPassTime",
"dcDecTime",
]);
oldData = formatNumberString(oldData, [
"dcCustomsType",
"dcCustomsStatus",
"dcCheckStatus",
]);
this.cusDeclarationObj = oldData;
},
methods: {
regCloseDialog(type) {
this.regDialogVisible = false;
if (type === "error") {
this.$emit("getBoxInfo");
}
},
// 时间比较
compareDate(dcDecTime, dcPassTime) {
this.isShowError = false;
let date1 = null,
date2 = null;
if (dcDecTime) date1 = dayjs(dcDecTime);
if (dcPassTime) date2 = dayjs(dcPassTime);
if (date1 && date2) {
const delayDay = date2.diff(date1, "day");
if (delayDay >= this.inspectionTimecustoms) this.isShowError = true;
}
},
// 异常登记
exceptionReg() {
this.regDialogVisible = true;
},
/* 跳转订单详情 */
jumpOrderDetail(row) {
this.$router.push({
......@@ -498,6 +542,7 @@ export default {
"cusDeclarationObj.dcCustomsStatus"(val) {
if (val !== "3") {
this.$set(this.cusDeclarationObj, "dcCheckStatus", "");
this.$set(this.cusDeclarationObj, "dcPassTime", "");
} else {
const { customsInfo = {} } = this.shipmentObj;
this.$set(
......@@ -520,6 +565,21 @@ export default {
}
},
},
// 报关时间
"cusDeclarationObj.dcDecTime"(val) {
this.compareDate(val, this.cusDeclarationObj.dcPassTime);
},
// 放行时间
"cusDeclarationObj.dcPassTime"(val) {
this.compareDate(this.cusDeclarationObj.dcDecTime, val);
},
// 查验状态
"cusDeclarationObj.dcCheckStatus"(val) {
const { customsInfo = {} } = this.shipmentObj;
if (val != customsInfo.dcCheckStatus) {
this.$set(this.cusDeclarationObj, "dcPassTime", "");
}
},
},
computed: {
/* 获取报关审核退场状态文字 */
......
......@@ -19,12 +19,12 @@
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button type="primary" @click="exceptionReg" :disabled="!showMsg">{{$t('异常登记')}}</el-button>
<el-button type="primary" @click="exceptionReg" :disabled="!isShowError">{{$t('异常登记')}}</el-button>
</el-row>
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('票异常')" :visible.sync="dialogVisible" width="700px" :modal-append-to-body=false append-to-body destroy-on-close>
<regError @closeDialog="dialogVisible = false" v-bind="$attrs" />
<regError @closeDialog="regCloseDialog" v-bind="$attrs" />
</el-dialog>
</div>
</template>
......@@ -56,6 +56,11 @@ export default {
dialogVisible: false,
// 提示消息
showMsg: false,
// 异常登记
isShowError: false,
inspectionTimeShipping: this.getDictDatas(
this.DICT_TYPE.BOX_INSPECTION_TIME_SHIPPING
)[0].value,
};
},
created() {
......@@ -69,9 +74,16 @@ export default {
// 实际开船时间
"departureObj.dtRealShipTime"(val) {
this.compareDate(val, this.getSailingTime());
this.compareDate1(val, this.getSailingTime());
},
},
methods: {
regCloseDialog(type) {
this.dialogVisible = false;
if (type === "error") {
this.$emit("getBoxInfo");
}
},
// 时间比较
compareDate(dtRealShipTime, sailTime) {
this.showMsg = false;
......@@ -83,6 +95,17 @@ export default {
this.showMsg = true;
}
},
compareDate1(dtRealShipTime, sailTime) {
this.isShowError = false;
let date1 = null,
date2 = null;
if (dtRealShipTime) date1 = dayjs(dtRealShipTime);
if (sailTime) date2 = dayjs(sailTime);
if (date1 && date2) {
const delayDay = date1.diff(date2, "day");
if (delayDay >= this.inspectionTimeShipping) this.isShowError = true;
}
},
// 异常登记
exceptionReg() {
this.dialogVisible = true;
......
......@@ -236,6 +236,10 @@ export default {
if (end.includes(val[keyName])) {
node.currStatus = "end";
// 判断是否存在异常未处理
if (val[voName].hasAbnormal) {
continue;
}
// 报关
if (type === "cusDeclaration") {
const { dcCustomsStatus, dcCheckStatus } = val;
......
......@@ -45,7 +45,7 @@ import { getDockPage } from "@/api/ecw/dock";
import { listUser } from "@/api/system/user";
// 这里引入的数据切换语言后要刷新才生效,优化办法是label同时配备labelEn字段,然后再页面上用$l函数调用
import { getSeaStatus, getStatusName, seaBaseData } from "./utils";
import { seaBaseData } from "./utils";
/**
* 海运操作主页面
*/
......@@ -115,12 +115,6 @@ export default {
});
},
},
watch: {
/* 监听发货对象 */
shipmentObj(val) {
// this.statusLabel = getStatusName(getSeaStatus(val));
},
},
};
</script>
......
......@@ -4,79 +4,6 @@ import FileSaver from "file-saver";
import Decimal from "decimal.js";
import i18n from "@/i18n";
/**
* 节点状态值
*
* @return {*}
*/
function getStatusName(statu) {
const statusName = new Map();
statusName.set(11, i18n.$t("未订舱"));
statusName.set(12, i18n.$t("已订舱"));
statusName.set(21, i18n.$t("未预装"));
statusName.set(22, i18n.$t("预装中"));
statusName.set(23, i18n.$t("预装审核中"));
statusName.set(24, i18n.$t("预装审核失败"));
statusName.set(25, i18n.$t("预装审核成功"));
statusName.set(2111, i18n.$t("未理货"));
statusName.set(2112, i18n.$t("已理货"));
statusName.set(31, i18n.$t("未派车"));
statusName.set(32, i18n.$t("已派车"));
statusName.set(41, i18n.$t("未装柜"));
statusName.set(42, i18n.$t("装柜中"));
statusName.set(43, i18n.$t("已装柜、待封柜"));
statusName.set(44, i18n.$t("封柜审核中"));
statusName.set(45, i18n.$t("封柜审核失败"));
statusName.set(46, i18n.$t("封柜审核成功"));
statusName.set(47, i18n.$t("已封柜,待出仓"));
statusName.set(51, i18n.$t("未报关"));
statusName.set(52, i18n.$t("报关中"));
statusName.set(53, i18n.$t("已报关"));
statusName.set(61, i18n.$t("未配船"));
statusName.set(62, i18n.$t("已配船"));
statusName.set(71, i18n.$t("未提单补料"));
statusName.set(72, i18n.$t("已提单补料"));
statusName.set(81, i18n.$t("未驳船"));
statusName.set(82, i18n.$t("已驳船"));
statusName.set(91, i18n.$t("未起运"));
statusName.set(92, i18n.$t("已起运"));
statusName.set(101, i18n.$t("未上传"));
statusName.set(102, i18n.$t("已上传"));
statusName.set(111, i18n.$t("未清关文件"));
statusName.set(112, i18n.$t("已清关文件"));
statusName.set(121, i18n.$t("未到港"));
statusName.set(122, i18n.$t("已到港"));
statusName.set(131, i18n.$t("未清关"));
statusName.set(132, i18n.$t("已清关"));
statusName.set(181, i18n.$t("未卸柜"));
statusName.set(182, i18n.$t("卸柜中"));
statusName.set(183, i18n.$t("卸柜审核中"));
statusName.set(184, i18n.$t("卸柜审核失败"));
statusName.set(185, i18n.$t("卸柜审核成功"));
statusName.set(186, i18n.$t("已卸柜"));
statusName.set(191, i18n.$t("未结算"));
statusName.set(192, i18n.$t("结算中"));
statusName.set(193, i18n.$t("已结算"));
return statusName.get(statu);
}
/**
* 海运流程
*
......@@ -1537,7 +1464,6 @@ function downloadFileByUrl(funName, params) {
}
export {
getStatusName,
getColmnMapping,
getSeaStatus,
seaBaseData,
......
......@@ -44,7 +44,7 @@ import { getSupplierPage } from "@/api/ecw/supplier";
import { getChannelList } from '@/api/ecw/channel';
import { getDockPage } from "@/api/ecw/dock";
import { listUser } from "@/api/system/user";
import { getSeaStatus, getStatusName, seaAirBaseData } from "../shippingSea/utils";
import { seaAirBaseData } from "../shippingSea/utils";
import {arrryToKeyedObjectBy} from '@/utils/index'
/**
......@@ -130,12 +130,6 @@ export default {
});
},
},
watch: {
/* 监听发货对象 */
shipmentObj(val) {
this.statusLabel = getStatusName(getSeaStatus(val));
},
},
};
</script>
......
<template>
<div class="shipping-update-error">
<!-- 更新报关异常状态 -->
<div class="message-title">{{headerTitle}}</div>
<el-form ref="updateErrorForm" :rules="rules" :model="updateObj" label-width="140px">
<el-form-item :label="$t('更新类型')" prop="type">
<el-radio-group v-model="updateObj.type">
<el-radio v-for="item in this.getDictDatas(this.DICT_TYPE.BOX_SHIPPING_UPDATE_TYPE)" :key="item.value" :label="item.value">{{$l(item, 'label')}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('更新订单状态')">
<el-radio-group v-model="updateObj.updateOrder">
<el-radio v-for="item in types" :key="item.value" :label="item.value">{{$l(item, 'label')}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="customize">
<el-input v-model="updateObj.customize" :placeholder="$t('请输入')" :disabled="!isEnter"></el-input>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button>
</el-row>
</div>
</template>
<script>
import { updateAbnormalOrder } from "@/api/ecw/box";
import { serviceMsg } from "./shippingSea/utils";
export default {
name: "updateError",
inheritAttrs: false,
components: {},
props: {
shipmentObj: Object,
errorInfo: Object,
},
data() {
return {
updateObj: {},
rules: {
type: [{ required: true, message: this.$t("必填"), trigger: "change" }],
},
types: [],
isEnter: false,
headerTitle: "",
};
},
methods: {
onSubmit() {
this.$refs["updateErrorForm"].validate((valid) => {
if (valid) {
let text = "";
// 自定义
if (this.updateObj.updateOrder === "0") {
text = this.updateObj.customize;
} else {
const dict = this.types.find(
(item) => item.value === this.updateObj.updateOrder
);
text = this.$l(dict, "label");
}
const { orderList } = this.errorInfo;
updateAbnormalOrder({
shipmentId: this.shipmentObj.id,
orderIdList: orderList.map((item) => item.orderId) ?? [],
type: this.updateObj.type,
text,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.$emit("closeDialog", "detail");
});
});
}
});
},
cancel() {
this.$emit("closeDialog");
},
},
watch: {
errorInfo: {
handler: function (val) {
const { errorType, orderList, operate } = val;
if (operate === "single") {
this.headerTitle = this.$t(
"确定给{selfNo}下的{orderNos}更新状态吗?",
{
selfNo: this.shipmentObj.selfNo,
orderNos: orderList.map((item) => item.orderNo).join(",") ?? "",
}
);
} else {
this.headerTitle = this.$t(
`确定给{selfNo}下的${
operate === "all" ? "所有订单" : "所选订单"
}更新状态吗?`,
{
selfNo: this.shipmentObj.selfNo,
}
);
}
switch (errorType) {
// 报关异常
case "customs":
this.types = this.getDictDatas(
this.DICT_TYPE.BOX_CUSTOMS_ERROR_TYPE
);
break;
case "shipping":
this.types = this.getDictDatas(
this.DICT_TYPE.BOX_SHIPPING_ERROR_TYPE
);
break;
case "arrival":
this.types = this.getDictDatas(
this.DICT_TYPE.BOX_ARRIVAL_ERROR_TYPE
);
break;
}
},
immediate: true,
},
"updateObj.updateOrder"(val) {
if (val === "0") {
this.isEnter = true;
this.rules.customize = [
{ required: true, message: this.$t("必填"), trigger: "change" },
];
} else {
this.isEnter = false;
this.rules.customize = [];
this.$refs["updateErrorForm"].clearValidate("customize");
}
},
},
};
</script>
<style lang="scss" scoped>
.shipping-update-error {
.message-title {
text-align: center;
font-size: 20px;
margin: 0 20px 10px;
}
}
</style>
<template>
<div>
<el-descriptions :column="4">
<el-descriptions-item label="客户编号">{{detail.customerId}}</el-descriptions-item>
<el-descriptions-item label="客户名称">{{detail.customerName}}</el-descriptions-item>
<el-descriptions-item label="跟进客服">{{detail.followUpSalesmanName}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{detail.createTime|parseTime}}</el-descriptions-item>
<el-descriptions-item label="申请凭证" :span="4">
<el-image v-for="(item, index) in pictures" :key="index" :src="item" style="width:100px; height:100px" :preview-src-list="pictures"></el-image>
</el-descriptions-item>
<el-descriptions-item label="申请原因" :span="4">{{detail.reason}}</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script>
import { getApproval } from '@/api/ecw/customer';
import {parseTime} from '@/utils/ruoyi'
export default {
filters: {parseTime},
props:{
id: [String, Number]
},
data(){
return {
info: null
}
},
computed:{
detail(){
if(!this.info) return null
return JSON.parse(this.info.details)
},
pictures(){
if(!this.detail) return []
return this.detail.voucher.split(',').filter(item => !!item)
}
},
created(){
getApproval(this.id).then(res => {
this.info = res.data
})
}
}
</script>
\ No newline at end of file
<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"
:picker-options="pickerOptions"
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()">{{$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:[],
pickerOptions: {
}
};
},
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)
}
}
that.pickerOptions = {
disabledDate: (time) => {
var date = new Date(that.handlerParams.orgEstimateEnterOpenSeaTime);
return (
time.getTime() < date.getTime()
);
},
}
})
},
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
// }
var params = Object.assign({},this.handlerParams)
var ccIds = Array.isArray(this.handlerParams.ccIds) ? this.handlerParams.ccIds.join(',') : this.handlerParams.ccIds
params.ccIds = ccIds
params.voucher = Array.isArray(this.handlerParams.voucher) ? this.handlerParams.voucher.join(',') : this.handlerParams.voucher
this.$set(this.handlerParams,'createTime',this.formatDate())
params.estimateEnterOpenSeaTime = this.getNowDate(this.handlerParams.estimateEnterOpenSeaTime)
creatDelayApproval(params).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>
......@@ -35,6 +35,11 @@
<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="transportType">
<dict-selector :type="DICT_TYPE.TRANSPORT_TYPE" form-type="checkbox" multiple v-model="form.transportType"></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('请输入常用提货网点')">
......@@ -661,7 +666,7 @@ export default {
return
}
const form = {...this.form, type: this.form.type?.join(','), taxRate: Number(this.form.taxRate)}
const form = {...this.form, type: this.form.type?.join(','), transportType: this.form.transportType?.join(','), taxRate: Number(this.form.taxRate)}
// 检查路线是否启用了但是没选择目的仓
let errors = 0
......
<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,
getCustomerList,
memberUserList,
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,getCustomerContactsListByCustomer,getCustomer,getCustomerPage,updateCustomer} from "@/api/ecw/indirectCustomer"
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" >
<template v-slot="scope">
<router-link :to="{path: '/customer/indirectInfo',query: {id: scope.row.id}}" class="link-type">
<span>{{ scope.row.name }}</span>
</router-link>
</template>
</el-table-column>
<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 {updateCustomer, getCustomer,
getCustomerPage, exportCustomerExcel } from "@/api/ecw/indirectCustomer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {listServiceUser} from "@/api/system/user";
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>
<template>
<div>
<el-row type="flex" style="margin-top: 15px;margin-bottom: 15px" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="16">
<div style="display: flex;justify-content: space-between;align-items: flex-end;">
<h2>{{$t('查看')}}</h2>
<div>
<el-button type="primary" size="small" @click="$router.push('/customer/edit/' + id)">{{$t('编辑')}}</el-button>
<!-- <el-button @click="$router.push('/offer/create')" type="primary" size="small">{{$t('报价')}}</el-button>
<el-button type="primary" size="small" @click="$refs['customerFollow'].customerFollow.dialogVisible = true">{{$t('跟进')}}</el-button>
<el-button type="primary" size="small" @click="$refs['customerComplaint'].handleAdd()">{{$t('客诉')}}</el-button> -->
<el-button type="danger" size="small">{{$t('删除')}}</el-button>
</div>
</div>
<el-card style="margin-top: 15px;">
<el-descriptions :column="4" border>
<el-descriptions-item :label="$t('客户编号')">{{ customer.number }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户名称')">{{ customer.name }}</el-descriptions-item>
<el-descriptions-item :label="$t('结算方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, '{y}-{m}-{d}') }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户等级')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_LEVEL, customer.level) }}</el-descriptions-item>
<el-descriptions-item :label="$t('国家')">{{ country }}</el-descriptions-item>
<!-- <el-descriptions-item :label="$t('业务员')">{{ customer }}</el-descriptions-item>-->
<el-descriptions-item :label="$t('客户来源')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户类别')">{{ getDictDatas2(DICT_TYPE.CUSTOMER_TYPE, (customer.type||'').split(',')).map(e => e.label).join(', ') }}</el-descriptions-item>
<!-- <el-descriptions-item :label="$t('联系方式')">{{ customer }}</el-descriptions-item>-->
<el-descriptions-item :label="$t('推介人')">{{ promoter }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户经理')">{{ customerService }}</el-descriptions-item>
<el-descriptions-item :label="$t('公司名称')">{{ customer.company }}</el-descriptions-item>
<el-descriptions-item :label="$t('联系地址')">{{ customer.address }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建时间')">{{ parseTime(customer.createTime) }}</el-descriptions-item>
<el-descriptions-item :label="$t('状态')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status) }}</el-descriptions-item>
<el-descriptions-item :label="$t('主营类别')">{{ productType }}</el-descriptions-item>
<el-descriptions-item :label="$t('常提货网点')">{{ pickupPoint }}</el-descriptions-item>
<el-descriptions-item :label="$t('图片')">
<el-image v-show="!!customer.picture" :src="customer.picture" style="width: 100px;height: 100px"></el-image>
</el-descriptions-item>
<el-descriptions-item :label="$t('备注')">{{ customer.remarks }}</el-descriptions-item>
<!-- <el-descriptions-item label="信用等级">{{ customer }}</el-descriptions-item>-->
</el-descriptions>
</el-card>
<el-card style="margin-top: 15px">
<h3>{{$t('联系人')}}</h3>
<el-table
:data="customerContacts"
style="width: 100%"
border
>
<el-table-column
prop="department"
:label="$t('部门')"
>
</el-table-column>
<el-table-column
prop="position"
:label="$t('职位')"
>
</el-table-column>
<el-table-column
prop="name"
:label="$t('联系人')"
>
</el-table-column>
<el-table-column
prop="phoneNew"
:label="$t('联系方式')"
>
<template v-slot="{row}">
{{ row.areaCode + row.phoneNew }}
</template>
</el-table-column>
<el-table-column
prop="userid"
:label="$t('关联账号')"
:formatter="userIdFormatter"
>
</el-table-column>
<el-table-column
prop="social"
:label="$t('社交软件')"
:formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.SOCIAL, cellValue)"
>
</el-table-column>
<el-table-column
prop="socialNumber"
:label="$t('社交软件号码')"
>
</el-table-column>
<el-table-column
prop="email"
:label="$t('邮箱')"
>
</el-table-column>
</el-table>
</el-card>
<!-- <el-tabs style="margin-top: 15px" type="border-card">
<el-tab-pane :label="$t('订单')">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-form :inline="true">
<el-form-item :label="$t('运输方式:')">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" />
</el-form-item>
<el-form-item :label="$t('订单状态:')">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"/>
</el-form-item>
<el-form-item :label="$t('报关方式:')">
<dict-selector
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
v-model="queryParams.customerType"
/>
</el-form-item>
<el-form-item :label="$t('控货')">
<dict-selector
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
v-model="queryParams.isCargoControl"
/>
</el-form-item>
<el-form-item :label="$t('入仓时间:')">
<el-date-picker v-model="rucangtime"
@change="changeDate"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
:start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getorderList">{{$t('搜索')}}</el-button>
<el-button type="primary" @click="()=>{
queryParams = { rows:10,page:1}; getorderList()
}">{{$t('重置')}}</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="orderList">
<el-table-column :label="$t('订单编号')" width="120px" align="center" prop="orderNo" >
<template slot-scope="scope">
<router-link :to="{path: '/order/detail',query: {orderId: scope.row.orderId}}" class="link-type">
<span>{{ scope.row.orderNo }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('总箱数/入仓箱数')" align="center" prop="sumNum">
<template slot-scope="{row}">
{{row.totalNum}}{{$t('')}}/{{row.sumNum}}{{$t('')}}
</template>
</el-table-column>
<el-table-column :label="$t('体积/重量')" align="center" prop="sumWeight">
<template slot-scope="{row}">
//入仓前是填单数据,入仓后是入仓数据
<template v-if="row.inWarehouseState <= 1">{{row.costVO.totalVolume}}m³ /{{row.costVO.totalWeight}}Kg</template>
<template v-else>{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</template>
</template>
</el-table-column>
<el-table-column :label="$t('始发仓')" align="center" prop="departureName" />
<el-table-column :label="$t('运输方式/目的地')" align="center" prop="transportId">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" /> / {{row.objectiveName}}
</template>
</el-table-column>
<el-table-column :label="$t('控货')" align="center" prop="transportId">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="row.isCargoControl" />
</template>
</el-table-column>
<el-table-column :label="$t('订单状态')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
</el-table>
<pagination @pagination="getorderList" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="orderTotal" ></pagination>
</el-card>
</el-tab-pane>
<el-tab-pane :label="$t('报价')">
<el-table
:data="infoListOfferList"
style="width: 100%"
>
<el-table-column
type="index"
:label="$t('序号')"
>
</el-table-column>
<el-table-column
prop="number"
:label="$t('报价单号')"
>
</el-table-column>
<el-table-column
prop="orderNo"
:label="$t('订单号')"
>
</el-table-column>
<el-table-column
prop="consignorName"
:label="$t('客户名称')"
>
</el-table-column>
<el-table-column
prop="objectiveName"
:label="$t('目的地')"
>
</el-table-column>
<el-table-column
:label="$t('销售阶段')"
>
<template v-slot="{row}">
{{STATUS[row.status]}}
</template>
</el-table-column>
<el-table-column
prop="stopTime"
:label="$t('预计结束时间')"
>
</el-table-column>
<el-table-column
prop="businessManagerName"
:label="$t('负责人')"
>
</el-table-column>
</el-table>
<pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal" ></pagination>
</el-tab-pane>
<el-tab-pane :label="$t('跟进')">
<customer-follow ref="customerFollow" :id="id" :customer-id="id"></customer-follow>
</el-tab-pane>
<el-tab-pane :label="$t('客户投诉')">
<customer-complaint ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
</el-tab-pane>
<el-tab-pane :label="$t('账单')">
<el-table style="width: 100%" :data="infoListReceiptList">
<el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column :label="$t('账单')" prop="receiptNo"></el-table-column>
<el-table-column :label="$t('订单号')" prop="orderNo"></el-table-column>
<el-table-column :label="$t('箱数')" prop="num"></el-table-column>
<el-table-column :label="$t('方数')" prop="volume" ></el-table-column>
<el-table-column :label="$t('重量')" prop="weight" ></el-table-column>
<el-table-column :label="$t('类型')">
<template v-slot="{row}">
<dict-tag :type="DICT_TYPE.PAYMENT_TYPE" :value="row.collectionType" />
</template>
</el-table-column>
<el-table-column :label="$t('费用类型')">
<template v-slot="{row}">
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" />
</template>
</el-table-column>
<el-table-column :label="$t('金额')" prop="totalAmount">
</el-table-column>
<el-table-column :label="$t('已核销比例')" prop="writeOffScale"></el-table-column>
<el-table-column :label="$t('实收日期')" prop="writeOffAt"></el-table-column>
<el-table-column :label="$t('业务员')" prop="salesmanName"></el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane :label="$t('数据')">
<el-descriptions :column="2">
<el-descriptions-item :label="$t('海空联运/海运拼柜/海运整柜/专线空运')">{{orderStatisticsObj.hklyTotal || 0}}/{{orderStatisticsObj.hypgTotal || 0 }}/{{orderStatisticsObj.hyzgTotal || 0}}/{{orderStatisticsObj.zxkyTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('最后交易日期')">{{orderStatisticsObj.lastBusinessDate}}</el-descriptions-item>
<el-descriptions-item :label="$t('全部订单/控货订单')">{{orderStatisticsObj.allOrderTotal || 0}}/{{orderStatisticsObj.controlOrderTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('最后交易单号')">{{orderStatisticsObj.lastBusinessOrderNo}}</el-descriptions-item>
<el-descriptions-item :label="$t('报价/下单/入仓')">{{orderStatisticsObj.offerOrderTotal || 0}}/{{orderStatisticsObj.pickOrderTotal || 0}}/{{orderStatisticsObj.wareHousingTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('储存量')">{{orderStatisticsObj.stock || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('已出货订单')">{{orderStatisticsObj.shipmentTotal || 0}}</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane :label="$t('品牌授权')">
<el-table border style="width:100%" :data="brandAuthorizationList">
<el-table-column type="index" :prop="$t('序号')"></el-table-column>
<el-table-column :label="$t('中文标题')" prop="titleZh" ></el-table-column>
<el-table-column prop="titleEn" :label="$t('英文标题')"></el-table-column>
<el-table-column :label="$t('有无备案')">
<template v-slot="{row}">
<dict-tag :type="DICT_TYPE.BRAND_REG_TYPE" :value="row.filing" />
</template>
</el-table-column>
<el-table-column :label="$t('授权开始')">
<template v-slot="{row}">
{{parseTime(row.startTime)}}
</template>
</el-table-column>
<el-table-column :label="$t('授权结束')">
<template v-slot="{row}">
{{parseTime(row.endTime)}}
</template>
</el-table-column>
<el-table-column :label="$t('授权证明')">
<template v-slot="{row}">
<div v-if="!!row.fileUrl && row.fileUrl.length > 0">
<span v-for="(item, index) in (row.fileUrl||'').split(',')">
<a :href="item" target="_blank">{{$t('附件')}}{{ index + 1 }}</a>,
</span>
</div>
</template>
</el-table-column>
<el-table-column
prop="feeScale"
:formatter="(row) => getDictDataLabel(DICT_TYPE.BRAND_CUSTOMER_CHARGING_MODEL, row.feeScale)"
:label="$t('收费标准')">
</el-table-column>
<el-table-column
prop="createUsername"
:label="$t('添加人')">
</el-table-column>
<el-table-column :label="$t('创建时间')">
<template v-slot="{row}">
{{parseTime(row.createTime)}}
</template>
</el-table-column>
</el-table>
<pagination v-show="brandAuthorizationTotal > 0" :total="brandAuthorizationTotal" :page.sync="brandAuthorizationFrom.pageNo" :limit.sync="brandAuthorizationFrom.pageSize"
@pagination="getBrankByCustomerList"/>
</el-tab-pane>
<el-tab-pane :label="$t('信用日志')">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-button style="float: right;" type="primary" @click="dialogVisible = true" >{{$t('添加信用日志')}}</el-button>
<el-descriptions :column="5" border>
<el-descriptions-item v-for="(item,index) in creditScoreStatisticObj" :key="index" :label="creditScoreCalculation(item.type)">{{item.score}}</el-descriptions-item>
</el-descriptions>
</div>
<el-table :data="customerCreditLogList">
<el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column prop="name" :label="$t('规则名称')"></el-table-column>
<el-table-column prop="type" :label="$t('规则分类')">
<template v-slot="{row}">
<dict-tag :type="DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE" :value="row.type" />
</template>
</el-table-column>
<el-table-column prop="score" :label="$t('规则得分')"></el-table-column>
<el-table-column prop="remark" :label="$t('备注')"></el-table-column>
<el-table-column :label="$t('添加人')" prop="createName"></el-table-column>
<el-table-column :label="$t('时间')">
<template v-slot="{row}">
{{parseTime(row.createTime)}}
</template>
</el-table-column>
</el-table>
<pagination @pagination="creditLogPage" :page.sync="customerCreditLogFrom.pageNo" :limit.sync="customerCreditLogFrom.pageSize" :total="customerCreditLogFrom.total" ></pagination>
</el-card>
</el-tab-pane>
<el-tab-pane :label="$t('等级日志')">
<el-table style="width: 100%" :data="getCustomerGradeList">
<el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column :label="$t('规则名称')" prop="name"></el-table-column>
<el-table-column :label="$t('规则分类')" prop="type">
<template v-slot="{row}">
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL_RULE_TYPE" :value="row.type" />
</template>
</el-table-column>
<el-table-column :label="$t('规则得分')" prop="score"></el-table-column>
<el-table-column :label="$t('备注')" prop="remark"></el-table-column>
<el-table-column :label="$t('时间')">
<template v-slot="{row}">
{{parseTime(row.createTime)}}
</template>
</el-table-column>
</el-table>
<pagination @pagination="getCustomerGrade" :page.sync="getCustomerGradeFrom.pageNo" :limit.sync="getCustomerGradeFrom.pageSize" :total="getCustomerGradeFrom.total" ></pagination>
</el-tab-pane>
</el-tabs>-->
</el-col>
</el-row>
<el-dialog
:visible.sync="dialogVisible"
width="30%"
>
<h1 slot="title">
{{$t('给客户')}}{{customer.name}}{{$t('添加信用日志')}}
</h1>
<el-form label-width="100">
<el-form-item :label="$t('客户编号:')">{{customer.number}}</el-form-item>
<el-form-item :label="$t('信用类别')">
<el-select v-model="creditFrom.ruleId">
<el-option v-for="(item,index) in creditTypeList" :key="index" :value="item.id" :label="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="creditTypeList.length > 0" :label="$t('信用分')">{{(creditTypeList.find(r=>creditFrom.ruleId === r.id) || {}).score }}{{$t('')}}</el-form-item>
<el-form-item :label="$t('备注')">
<el-input type="textarea" v-model="creditFrom.remark"> </el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="submit">{{$t('提交')}}</el-button>
<el-button @click="dialogVisible = false" >{{$t('取消')}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getCustomerSelect,
getBrankByCustomer,
levelLogPage,
customerCreditLogPage,
infoListOrderPage,
infoListOfferPage,
orderStatistics,
creditLogCreate,
creditScoreStatistic,
infoListReceiptPage, memberUserList
} from '@/api/ecw/customer'
import { DICT_TYPE, getDictDataLabel, getDictDatas2 } from '@/utils/dict'
import { getProductTypeList } from '@/api/ecw/productType'
import { getNodeList } from '@/api/ecw/node'
import CustomerFollow from "@/components/CustomerFollow"
import { parseTime } from '@/utils/ruoyi'
import CustomerComplaint from '@/views/ecw/customerComplaint'
import { listServiceUser } from '@/api/system/user'
import { getCustomerContactsListByCustomer,getCustomer } from '@/api/ecw/indirectCustomer'
import {getOrderPage} from "@/api/ecw/order";
import Template from "@/views/cms/template";
import {getCreditRulePage} from "@/api/customer/creditRule";
import {getCountry} from "@/api/ecw/country"
export default {
name: 'IndirectInfo',
components: {
Template,
CustomerFollow,
CustomerComplaint
},
created() {
//获取信用类型
if(this.$route.query.id){
this.id = this.$route.query.id
}
getCreditRulePage({page:1,rows:999,type:2}).then(r => {
this.creditTypeList = r.data.list
})
getNodeList().then(r => {
this.nodeList = r.data
})
getCustomer(this.id).then(response => {
this.customer = { ...this.customer, ...response.data }
getCustomerContactsListByCustomer({customerId: this.id}).then(r => {
this.customerContacts = r.data
let list = this.customerContacts.map(r => r.userid)
memberUserList({ids:list.join(',')}).then(r => {
this.memberList = r.data
})
})
getCountry(this.customer.country ? this.customer.country : 0 ).then(r => {
this.country = r.data.nameZh
})
})
getProductTypeList().then(r => {
this.productTypeList = r.data
})
getCustomerSelect().then(r => {
this.customerSelect = r.data.list
})
listServiceUser().then(r => {
this.serviceUserList = r.data
})
this.getBrankByCustomerList()
this.getCustomerGrade()
this.creditLogPage()
this.getorderList()
this.getInfoListOfferPage()
this.getOrderStatistics()
this.creditScoreStatisticFn()
this.infoListReceiptFn()
},
data() {
return {
STATUS:{
0:this.$t('取消报价'),
1:this.$t('特价审批中'),
2:this.$t('需求确认'),
3:this.$t('跟进中'),
4:this.$t('赢单'),
5:this.$t('输单'),
6:this.$t('报价完成')
},
dialogVisible:false,
DICT_TYPE,
getDictDataLabel,
getDictDatas2,
parseTime,
nodeList: [],
id:0,
productTypeList: [],
customerSelect: [],
serviceUserList: [],
customerContacts: [],
memberList: [],
customer: {
id: undefined,
number: undefined,
name: undefined,
level: undefined,
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,
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,
weightUnit: undefined,
createTime: undefined
},
brandAuthorizationFrom:{
pageNo:1,
pageSize:10,
},
brandAuthorizationList:[],
brandAuthorizationTotal:0,
getCustomerGradeFrom:{
pageNo:1,
pageSize:10,
total:0
},
getCustomerGradeList:[],
customerCreditLogFrom:{
pageNo:1,
pageSize:10,
total:0
},
customerCreditLogList:[],
rucangtime:[],
queryParams:{
pageSize:10,
pageNo:1
},
orderList:[],
orderTotal:0,
infoListOfferFrom:{
pageNo:1,
pageSize:10,
},
infoListOfferTotal:0,
infoListOfferList:[],
orderStatisticsObj:{},
creditTypeList:[],
creditFrom:{},//添加信用 日志
creditScoreStatisticObj:[],
infoListReceiptList:[],
infoListReceiptFrom:{
pageNo:1,
pageSize:10,
},
infoListReceiptTotal:0,
country: ''
}
},
computed: {
productType(){
const productType = this.productTypeList.find(p => p.id === parseInt(this.customer.productType))
return productType ? productType.titleZh : ''
},
pickupPoint(){
const pickupPoint = this.nodeList.find(p => p.id === parseInt(this.customer.pickupPoint))
return pickupPoint ? pickupPoint.titleZh : ''
},
promoter() {
console.log(this.customerSelect,'this.customerSelect.find');
return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
},
customerService() {
return this.serviceUserList.find(e => e.id === this.customer.customerService)?.nickname || ''
},
id() {
return this.customerId ? parseInt(this.customerId) : undefined
},
creditScoreCalculation(){
return (val)=>{
if(val === 'all'){
return this.$t('信用分')
}else{
return (this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE).find(i => i.value === val)||{}).label
}
}
}
},
methods:{
userIdFormatter(row, column, cellValue){
const member = this.memberList.find(e => e.id === cellValue)
if (member) {
return member.nickname + '(' + member.mobile + ')'
} else {
return ''
}
},
changeDate(val){
if(val){
this.queryParams.houseStartDate = val[0];
this.queryParams.houseEndDate = val[1];
}else {
this.queryParams.houseStartDate = undefined;
this.queryParams.houseEndDate = undefined;
}
},
//品牌授权
getBrankByCustomerList(){
getBrankByCustomer({...this.brandAuthorizationFrom,customerId:this.id}).then(r => {this.brandAuthorizationList = r.data.list; this.brandAuthorizationTotal = r.data.total})
},
getCustomerGrade(){
levelLogPage({...this.getCustomerGradeFrom,customerId:this.id,total:undefined}).then(r => {
console.log(r,'客户等级');
if(r.code === 0){
this.getCustomerGradeList = r.data.list;
this.getCustomerGradeFrom.total = r.data.total;
}
})
},
// 获取信用等级日志列表
creditLogPage(){
customerCreditLogPage({...this.customerCreditLogFrom,customerId:this.id}).then(r => {
if(r.code === 0){
console.log(r,'r');
this.customerCreditLogList = r.data.list;
this.customerCreditLogFrom.total = r.data.total;
}
})
},
//订单
getorderList(){
infoListOrderPage({customerId:this.id,...this.queryParams}).then(r => {
console.log(r)
if(r.code === 0){
this.orderList = r.data.list
this.orderTotal = r.data.total
}
})
},
// 客户报价
getInfoListOfferPage(){
infoListOfferPage({...this.infoListOfferFrom,customerId:this.id}).then(r => {
this.infoListOfferList = r.data.list;
this.infoListOfferTotal = r.data.total;
}).catch(r => {
})
},
// 数据
getOrderStatistics(){
orderStatistics({customerId:this.id}).then(r => {
console.log(r,'数据')
if(r.code === 0){
this.orderStatisticsObj = r.data
}
})
},
submit(){
creditLogCreate({customerId:this.id,...this.creditFrom}).then(r => {
if(r.code === 0){
this.creditLogPage();
this.creditFrom = {};
this.dialogVisible = false;
}
})
},
//获得信用客户统计
creditScoreStatisticFn(){
creditScoreStatistic({customerId:this.id}).then(r => {
console.log(r)
if(r.code === 0) this.creditScoreStatisticObj = r.data
})
},
// 获取账单数据
infoListReceiptFn(){
infoListReceiptPage({...this.infoListReceiptFrom,customerId:this.id}).then(r => {
console.log(r)
if(r.code === 0){
this.infoListReceiptList = r.data.list;
this.infoListReceiptTotal = r.data.total;
}
})
}
}
}
</script>
<style scoped>
</style>
......@@ -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,31 @@
}
})
},
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.totalData.companyWeight =this.myAchievementData.companyTotaWeight
this.totalData.companyVolume =this.myAchievementData.companyTotaVolume
this.totalData.companyNum =this.myAchievementData.companyTotaNum
this.totalData.developWeight =this.myAchievementData.devTotaWeight
this.totalData.developVolume =this.myAchievementData.devTotaVolume
this.totalData.developNum =this.myAchievementData.devTotalNum
this.loading = false;
});
},
......@@ -299,6 +381,46 @@
}).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.developVolume += item.completeVolume
data.developNum += 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
this.totalData.companyWeight =this.myAchievementData.companyTotaWeight
this.totalData.companyVolume =this.myAchievementData.companyTotaVolume
this.totalData.companyNum =this.myAchievementData.companyTotaNum
this.totalData.developWeight =this.myAchievementData.devTotaWeight
this.totalData.developVolume =this.myAchievementData.devTotaVolume
this.totalData.developNum =this.myAchievementData.devTotalNum
}
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
......@@ -313,7 +435,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 +444,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>
<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="标题中文" prop="titleZh">
<el-input v-model="queryParams.titleZh" placeholder="请输入标题中文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="标题英文" prop="titleEn">
<el-input v-model="queryParams.titleEn" placeholder="请输入标题英文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择" clearable size="small">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:internal-help-doc:create']">新增</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="['system:internal-help-doc:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="" align="center" prop="id" />
<el-table-column label="标题中文" align="center" prop="titleZh" />
<el-table-column label="标题英文" align="center" prop="titleEn" />
<el-table-column label="内容中文" align="center" prop="contentZh" />
<el-table-column label="内容英语" align="center" prop="contentEn" />
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:internal-help-doc:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:internal-help-doc:delete']">删除</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"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="标题中文" prop="titleZh">
<el-input v-model="form.titleZh" placeholder="请输入标题中文" />
</el-form-item>
<el-form-item label="标题英文" prop="titleEn">
<el-input v-model="form.titleEn" placeholder="请输入标题英文" />
</el-form-item>
<el-form-item label="内容中文" prop="contentZh">
<editor v-model="form.contentZh" placeholder="请输入内容中文" />
</el-form-item>
<el-form-item label="内容英语" prop="contentEn">
<editor v-model="form.contentEn" placeholder="请输入内容英语" />
</el-form-item>
<el-form-item label="0-启用,1-停用" prop="status">
<el-radio-group v-model="form.status">
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="parseInt(dict.value)">{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createInternalHelpDoc, updateInternalHelpDoc, deleteInternalHelpDoc, getInternalHelpDoc, getInternalHelpDocPage, exportInternalHelpDocExcel } from "@/api/system/internalHelpDoc";
import Editor from '@/components/Editor';
export default {
name: "InternalHelpDoc",
components: {
Editor
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 对内帮助文档列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
titleZh: null,
titleEn: null,
contentZh: null,
contentEn: null,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getInternalHelpDocPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
titleZh: undefined,
titleEn: undefined,
contentZh: undefined,
contentEn: undefined,
status: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加对内帮助文档";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getInternalHelpDoc(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改对内帮助文档";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
// 修改的提交
if (this.form.id != null) {
updateInternalHelpDoc(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createInternalHelpDoc(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除对内帮助文档编号为"' + id + '"的数据项?').then(function() {
return deleteInternalHelpDoc(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm('是否确认导出所有对内帮助文档数据项?').then(() => {
this.exportLoading = true;
return exportInternalHelpDocExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
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