You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

5084 lines
165 KiB

<template>
<div class="content_max" v-loading="pageLoad">
<!-- 菜单 -->
<el-tabs type="border-card" v-model="tabValue" @tab-change="tabChenge" class="el_tabs">
<div></div>
<template v-for="item in TabList">
<el-tab-pane v-if="item.state" :name="item.name" :label="item.label" :key="item.name">
</el-tab-pane>
</template>
<div class="content_right">
<basic-container>
<div class="avue-crud">
<!-- 搜索模块 -->
<el-row v-if="search">
<!-- 查询模块 -->
<el-form :inline="true" :model="topFrom" class="el-fr-d">
<div class="el_tims_box">
<div class="topText">
<el-form-item label="工单号" class="el-times">
<el-input
type="text"
v-model="query.workOrderNumber"
placeholder="请输入工单号"
/>
</el-form-item>
<el-form-item label="订单自编号" class="el-times">
<el-input
style="width: 500px"
type="textarea"
:rows="1"
v-model="query.orderCode"
placeholder="请输入订单自编号"
/>
</el-form-item>
</div>
<!-- <div class="el_times">
<el-form-item label="上报日期" class="el-times">
<el-date-picker
v-model="value1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:size="size"
/>
</el-form-item>
<el-form-item label="处理时间" class="el-times">
<el-date-picker
v-model="value1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:size="size"
/>
</el-form-item>
<el-form-item label="送货时间" class="el-times">
<el-date-picker
v-model="value1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:size="size"
/>
</el-form-item>
<el-form-item label="运损发现" class="el-times">
<el-date-picker
v-model="value1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:size="size"
/>
</el-form-item
</div> >-->
</div>
<!-- 查询按钮 -->
<el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"
>搜 索</el-button
>
<el-button icon="el-icon-delete" @click="searchReset()">清 空</el-button>
</el-form-item>
</el-form>
</el-row>
<!-- 控件模块 -->
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button v-if="ButtonPermissions.add" type="primary" @click="AddInfo">
<el-icon><Plus /></el-icon>新 增</el-button
>
<el-button
v-if="ButtonPermissions.export_Report"
type="primary"
@click="exportReport"
>
<el-icon><Download /></el-icon>EXCEL导出</el-button
>
<el-button
v-if="ButtonPermissions.Timed_outexport"
type="primary"
@click="TimedoutExport"
>
<el-icon><Download /></el-icon>超时导出</el-button
>
<el-button
v-if="ButtonPermissions.defaultassignments"
type="primary"
@click="defaultAssignments"
>
<el-icon><Pointer /></el-icon>默认指派</el-button
>
<!-- <el-button type="primary" @click="BatchDelete">
<el-icon><Delete /></el-icon>批量删除</el-button
> -->
<el-button
v-if="ButtonPermissions.batchReject"
type="primary"
@click="BatchReturn"
>批量打回</el-button
>
<!-- 仓库客服批量确定 -->
<el-button
v-if="ButtonPermissions.Batchdetermination"
type="primary"
@click="ResultConfirmation"
>批量确定</el-button
>
<!-- 总部客服批量确定 待审核-->
<el-button
v-if="ButtonPermissions.ManagerConfirmed"
type="primary"
@click="DetermineStorage"
>批量审核</el-button
>
<el-button type="primary" v-if="ButtonPermissions.assignment" @click="assign"
>工单指派</el-button
>
<el-button
v-if="ButtonPermissions.applyArbitration"
type="primary"
@click="arbitrate"
>客服介入</el-button
>
<el-button
type="primary"
v-if="ButtonPermissions.DingTalkNumber"
@click="DingTalk"
>钉钉号填写</el-button
>
<el-button
v-if="ButtonPermissions.batchFinish"
type="primary"
@click="Batchcompletion"
>批量完结</el-button
>
<!-- 完结确定结束完结按钮 -->
<el-button
type="primary"
v-if="ButtonPermissions.ArbitrationDetermination"
@click="AllEndArbitration"
>批量完结完成</el-button
>
<!-- <el-button
ButtonPermissions.batchFinish
type="primary"
@click="Batchdeletionappeals"
>批量删除</el-button
> -->
<!-- <el-button v-if="ButtonPermissions.appeal" type="primary" @click="appealAll"
>批量申诉</el-button
> -->
<!-- 财务入账 -->
<el-button
type="primary"
v-if="ButtonPermissions.Financial_accounting"
@click="Financialfillingbtn"
>财务入账</el-button
>
<!-- v-if="details.query.workOrderStatus == 30" -->
<!-- <el-button type="primary" @click="ProcessingParty"> 处理方信息</el-button> -->
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChangeS" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="Search" @click="searchHide" circle></el-button>
</div>
</div>
</el-row>
<!-- 申诉列表展示 -->
<el-tabs
type="border-card"
v-if="TabPermissions == 6"
@tab-change="AppealTab"
v-model="arbitrationTemp"
>
<el-tab-pane :name="0" label="完结"></el-tab-pane>
<el-tab-pane :name="1" label="申诉列表"></el-tab-pane>
</el-tabs>
<!-- 首页表格 -->
<el-row>
<!-- 列表模块 -->
<tablecmt
class="tableNode"
:columnList="publicColumnList"
:tableData="data"
:loading="loadingObj.list"
:checkselect="selectList"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
:isShowRefresh="false"
:tableRowClassName="
(row, index) => {
if (row.departStatus != null && row.departStatus) return 'Abnormal';
else return '';
}
"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '异常工单号'">
<el-text class="el_textBtn" @click="InformationViewing(slotProps.scope)">
{{
slotProps.scope.column.label === '异常工单号'
? slotProps.scope.row.workOrderNumber
: ''
}}
</el-text>
</template>
<template v-if="slotProps.scope.column.label === '操作'">
<div class="ElBtnClass">
<div>
<!-- <el-button @click="addingRecord(slotProps.scope)">新增记录</el-button> -->
<el-button @click="view(slotProps.scope)">查看</el-button>
<!-- v-if="
(!AppealStatusT && TabPermissions != '8') || (AppealStatusT && UserPermissions !== '仓库客服' && slotProps.scope.row.typesOf != '2')
" -->
<!-- 处理结果确定和处理完毕 -->
<!-- 总部客服确定 -->
<!-- <el-button
v-if="TabPermissions == '2' && UserPermissions == '总部客服经理'"
@click="ResultConfirmation(slotProps.scope)"
>确定</el-button
> -->
<!-- 仓库客服确定 -->
<el-button
v-if="
(TabPermissions == '2' || TabPermissions == '1') &&
slotProps.scope.row.workOrderStatus == '21' &&
(UserPermissions == '仓库客服' || UserPermissions == '总部客服经理')
"
@click="ResultConfirmation(slotProps.scope)"
>结果确定</el-button
>
<!-- 完结确定结束完结按钮 -->
<el-button
v-if="TabPermissions == '5' && UserPermissions != '仓库客服'"
@click="EndArbitration(slotProps.scope)"
>确定</el-button
>
<!-- 仓库客服的缺确定
<el-button
v-if="
TabPermissions == '1' && slotProps.scope.row.workOrderStatus != '30'
"
@click="DetermineStorage(slotProps.scope)"
>确定</el-button
> -->
<el-button
v-if="
TabPermissions == '6' &&
!AppealStatusT &&
UserPermissions == '仓库客服' &&
slotProps.scope.row.workOrderStatus == '80' &&
slotProps.scope.row.canRepresentations
"
@click="appeal(slotProps.scope, false)"
>申诉</el-button
>
<el-button
v-if="
AppealStatusT &&
slotProps.scope.row.typesOf == '0' &&
UserPermissions == '仓库客服'
"
@click="appeal(slotProps.scope, 'edit')"
>编辑</el-button
>
<!-- 处理结果编辑 -->
<el-button
v-if="TabPermissions == '4' && UserPermissions == '仓库客服'"
@click="Resultediting(slotProps.scope)"
>编辑</el-button
>
<!-- 处理完毕 处理结果编辑 -->
<el-button
v-if="
TabPermissions == '2' &&
UserPermissions == '仓库客服' &&
slotProps.scope.row.workOrderStatus == '21'
"
@click="ProcessedResultediting(slotProps.scope)"
>编辑</el-button
>
<!-- 完结信息编辑 -->
<!-- <el-button
v-if="
TabPermissions == '6' &&
UserPermissions != '仓库客服' &&
slotProps.scope.row.typesOfName == '待处理'
"
@click="CompletedEditing(slotProps.scope)"
>编辑</el-button
> -->
<!-- 理赔金额确定 -->
<!-- <el-button
v-if="TabPermissions == '4' && UserPermissions == '仓库客服'"
@click="DetermineClaims(slotProps.scope)"
>确定理赔金额</el-button
> -->
<el-button
v-if="AppealStatusT && slotProps.scope.row.typesOf == '3'"
@click="Deleteappeal(slotProps.scope, 'Delete')"
>删除</el-button
>
<el-button
v-if="TabPermissions == '8'"
@click="MessageReply(slotProps.scope, 'Delete')"
>回复</el-button
>
<el-button
v-if="
AppealStatusT &&
slotProps.scope.row.typesOf == '0' &&
UserPermissions == '仓库客服'
"
@click="CancelappealFn(slotProps.scope, 'edit')"
>取消申诉</el-button
>
<!-- AppealStatusT申诉列表状态 -->
<!-- <el-button v-if="AppealStatusT" @click="Appealeditor">编辑</el-button> -->
<!-- <el-button @click="ViewEvent(slotProps.scope)">编辑</el-button> -->
<!-- <el-button @click="reply(slotProps.scope)">回复</el-button> -->
<!-- <el-button @click="ViewDelete(slotProps.scope)">删除</el-button> -->
<!-- <el-button @click="CompletionButton(slotProps.scope)">完结</el-button> -->
<!-- <el-button v-if="ClaimStatus" @click="appeal(slotProps.scope)"
>申诉</el-button
> -->
<el-button
v-if="TabPermissions == '7' && UserPermissions != '仓库客服'"
@click="BtnModifyAmount(slotProps.scope)"
>修改金额</el-button
>
</div>
</div>
</template>
</template>
</tablecmt>
</el-row>
<!-- 分页模块 -->
<el-row class="el-fy">
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div>勾选数量:{{ details.selectionList.length }}</div>
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="page.pageSizesList"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</el-row>
</div>
<!-- 新增弹窗 -->
<!-- 完结弹窗 -->
<!-- 批量打回弹窗 -->
<el-dialog v-model="dialogReturn" title="批量打回" width="40%" draggable class="plAllret">
<el-form
v-loading="repulse"
element-loading-text="正在打回中..."
label-position="top"
label-width="100px"
:model="BatchFrom"
>
<el-form-item label="打回原因">
<el-input v-model="BatchFrom.txt" type="textarea" :rows="4" />
</el-form-item>
<el-form-item label="流转营业部">
<el-select
v-model="BatchFrom.businessDepartment"
multiple
filterable
default-first-option
:reserve-keyword="false"
placeholder="请选择活动区域"
>
<el-option
v-for="item in warehouseData"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogReturn = false">取消</el-button>
<el-button type="primary" @click="ConfirmReturn" :disabled="repulse">
确定
</el-button>
</span>
</template>
</el-dialog>
<!-- 工单指派弹窗 -->
<el-dialog v-model="dialogassign" title="工单指派" width="40%" draggable class="plAllret">
<el-form
v-loading="AssignLoad"
element-loading-text="正在打回中..."
label-position="top"
label-width="100px"
:model="assignFrom"
>
<el-form-item label="客服列表">
<el-select
v-model="assignFrom.businessDepartment"
filterable
default-first-option
:reserve-keyword="false"
placeholder="请选择指派客服"
>
<el-option
v-for="item in customerService"
:key="item.value"
:label="item.realName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogassign = false">取消</el-button>
<el-button type="primary" @click="Assignbutton" :disabled="AssignLoad">
确定
</el-button>
</span>
</template>
</el-dialog>
<!-- 客服介入原因 -->
<el-dialog v-model="dialogCustomer" title="客服介入" width="30%" draggable>
<el-form
:model="CustomerServiceForm"
v-loading="loadingCustomer"
element-loading-text="正在处理中..."
>
<el-form-item label="介入原因">
<el-input
v-model="CustomerServiceForm.reasonRemarks"
type="textarea"
placeholder="请输入介入原因"
/>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogCustomer = false">取消</el-button>
<el-button
type="primary"
@click="CustomerServiceintervention"
:disabled="loadingCustomer"
>
提交
</el-button>
</span>
</template>
</el-dialog>
<!-- 批量完结弹窗 -->
<el-dialog
v-model="dialogBatchcompletion"
title="批量完结"
width="60%"
:style="{ height: BatchcompletionHeight + 'px', overflowY: 'scroll' }"
class="el_Batchcompletion"
>
<div v-loading="PLloading" element-loading-text="正在批量处理中...">
<div class="Improveinformation">
<el-tabs type="border-card" class="demo-tabs">
<el-tab-pane>
<template #label>
<span class="custom-tabs-label">
<el-icon><calendar /></el-icon>
<span>完结信息</span>
</span>
</template>
<div class="el-ckbtn">
<el-button type="primary" @click="AddCompensation">添加赔款方</el-button>
<el-button type="primary" @click="AddPayee">添加受款方</el-button>
</div>
<div
class="payanindemnity"
v-for="(item, index) in CompensationParty"
:key="index"
>
<span class="title" :style="{ color: item.state != 0 ? '#000' : '#F56C6C' }"
>{{ item.state == 0 ? '赔款方' : '受款方' }}{{ item.cld }}</span
>
<!-- <div class="sk_input">
<el-input
v-model="item.name"
:placeholder="item.state == 0 ? '请填写赔款方' : '请填写受款方'"
/>
</div> -->
<div class="sk_input">
<el-select v-model="item.warehouseId" filterable placeholder="请选择仓库">
<el-option
v-for="item in warehouseData"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
<div class="sk_input">
<span>原因</span>
<el-input v-model="item.reason" placeholder="请填写原因" />
</div>
<div class="sk_input">
<span>金额</span>
<el-input
@input="amountMoney"
:min="0"
v-model="item.num"
placeholder="金额"
/>
</div>
<div class="sk_input" v-if="item.state == 0">
<span>责任人</span>
<el-input
v-model="item.personResponsibleName"
placeholder="请填写责任人"
clearable
:rows="2"
/>
</div>
<div class="sk_input" v-if="item.state == 1"></div>
<el-button type="danger" round @click="payremove(item.state, index)"
>移除</el-button
>
</div>
<div class="paySum">
<div class="sum">
<span>
<el-icon><Coin /></el-icon>赔款金额总和:<b>{{
TotalamountCompensation
}}</b></span
>
<span>
<el-icon><Coin /></el-icon>收款金额总和:<b>{{
TotalamountReceived
}}</b></span
>
</div>
<div></div>
</div>
</el-tab-pane>
</el-tabs>
</div>
<!-- 完结原因 -->
<div class="arbitrate">
<el-tabs type="border-card" class="demo-tabs">
<el-tab-pane>
<template #label>
<span class="custom-tabs-label">
<el-icon><calendar /></el-icon>
<span>完结原因</span>
</span>
</template>
<el-input
v-model="Reasonarbitration"
type="textarea"
:autosize="{ minRows: 5, maxRows: 4 }"
placeholder="请输入完结原因"
/>
</el-tab-pane>
</el-tabs>
<div class="el_btn">
<el-button type="primary" @click="CompletedSubmission">确认提交</el-button>
</div>
</div>
</div>
</el-dialog>
<!-- 申诉弹窗 -->
<el-dialog
v-model="dialogappeal"
:title="AppealeditorState ? '工单申述编辑' : '工单申诉'"
width="40%"
>
<div class="el_appeal" v-loading="loadingappeal" element-loading-text="Loading...">
<el-form-item label="选择实际责任方">
<el-select
v-model="Appealselection"
clearable
filterable
multiple
placeholder="请选择实际责任方"
>
<el-option
v-for="item in warehouseData"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="申诉原因">
<el-input
v-model="Reasonforappeal"
:rows="4"
type="textarea"
placeholder="请输入申诉原因"
/>
</el-form-item>
<el-form-item label="`照片">
<el-upload
v-model:file-list="AppealAttachment"
list-type="picture-card"
:on-preview="AppealAttachmentpictureList"
:on-remove="AppealAttachmentImgListRemove"
:action="doubledCount"
:on-success="AppealAttachmentImgSuccess"
:before-upload="beforeAvatarUpload"
:headers="headers"
multiple
drag
>
<el-icon><Plus /></el-icon>
</el-upload>
</el-form-item>
<span class="el_sdialog-footer">
<el-button @click="dialogappeal = false">取消</el-button>
<el-button type="primary" @click="Appealbutton"> 确定 </el-button>
</span>
</div>
</el-dialog>
<el-dialog
v-model="dialogModifyAmount"
:title="fromamount.title + '超时金额修改'"
width="30%"
>
<el-form label-position="left" label-width="70px" :model="fromamount">
<div class="el_amount">
<el-form-item label="原金额">
<el-input v-model="fromamount.ytimeout" disabled />
</el-form-item>
<el-form-item label="修改金额">
<el-input v-model="fromamount.Amount" placeholder="请输入要修改的金额" />
</el-form-item>
</div>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogModifyAmount = false">取消</el-button>
<el-button type="primary" @click="ModifyAmountFn">确定修改</el-button>
</span>
</template>
</el-dialog>
<!-- 钉钉号填写 -->
<el-dialog v-model="dialogDingTalk" title="钉钉号填写" width="30%">
<div class="el_DingTalk">
<el-form :model="DingTalkfilling" label-width="120px">
<el-form-item label="钉钉流程号">
<el-input v-model="DingTalkfilling.processNumber" placeholder="请填写钉钉号" />
</el-form-item>
<el-form-item label="审核人">
<el-input v-model="DingTalkfilling.reviewedBy" placeholder="请填写审核人" />
</el-form-item>
<el-form-item label="审核时间">
<el-date-picker
v-model="DingTalkfilling.auditTime"
type="datetime"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择审核时间"
/>
</el-form-item>
<!-- <el-form-item label="财务入账时间">
<el-date-picker
v-model="DingTalkfilling.entryTime"
type="datetime"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择时间"
/>
</el-form-item> -->
</el-form>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogDingTalk = false">取消</el-button>
<el-button type="primary" @click="DingTalkSubmit"> 确认 </el-button>
</span>
</template>
</el-dialog>
<!-- 总部客服经理权限 -->
<el-dialog
v-model="CustomerServicea"
title="客服默认指派"
width="50%"
class="el_Customer"
>
<div>
<el-button type="primary" @click="CreateAdditions">新增创建</el-button>
<el-tabs type="border-card" @tab-click="AssignSwitch">
<el-tab-pane name="0" label="总部指派"></el-tab-pane>
<el-tab-pane name="1" label="商场指派"></el-tab-pane>
</el-tabs>
<el-row v-if="AssignmentType == '1'">
<!-- 列表模块 -->
<tablecmt
:columnList="CustomerColumnList"
:tableData="CustomerData"
:loading="CustomerLoad"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
:isShowRefresh="false"
:tableRowClassName="
(row, index) => {
if (row.conditions != null && row.conditions == '1') return 'Abnormal';
else return '';
}
"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<div class="ElBtnClass">
<el-button @click="Unbindassignment(slotProps.scope)">解绑</el-button>
<el-button
v-if="slotProps.scope.row.conditions != '1'"
@click="setAsdefault(slotProps.scope)"
>设为默认</el-button
>
</div>
</template>
</template>
</tablecmt>
</el-row>
<el-row v-else>
<!-- 列表模块 -->
<tablecmt
:columnList="MallassignmentColumnList"
:tableData="CustomerData"
:loading="CustomerLoad"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
:isShowRefresh="false"
:tableRowClassName="
(row, index) => {
if (row.conditions != null && row.conditions == '1') return 'Abnormal';
else return '';
}
"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<div class="ElBtnClass">
<el-button @click="Unbindassignment(slotProps.scope)">解绑</el-button>
<el-button
v-if="slotProps.scope.row.conditions != '1'"
@click="setAsdefault(slotProps.scope)"
>设为默认</el-button
>
</div>
</template>
</template>
</tablecmt>
</el-row>
<!-- 分页模块 -->
<el-row class="el_FyCustomer">
<div></div>
<el-pagination
align="right"
background
@size-change="assignsizeChange"
@current-change="assigncurrentChange"
:current-page="assigncurrentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="assignpageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="CustomerTotal"
>
</el-pagination>
</el-row>
</div>
<div>
<!-- <el-form-item label="仓库选择">
<el-select
v-model="BatchFrom.businessDepartment"
multiple
filterable
default-first-option
:reserve-keyword="false"
placeholder="请选择仓库"
>
<el-option
v-for="item in warehouseData"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> -->
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="CustomerServicea = false">关闭</el-button>
<!-- <el-button type="primary" @click="dialogVisible = false">
确定
</el-button> -->
</span>
</template>
</el-dialog>
<el-dialog v-model="Createassignment" title="创建指派" width="50%" class="el_Customer">
<div
class="el_Createbinding"
v-loading="CreateassignmentLoading"
element-loading-text="正在处理中..."
>
<el-form-item :label="AssignmentType == '1' ? '仓库选择' : '商场选择'">
<el-select
style="width: 240px"
v-if="AssignmentType == '1'"
v-model="BatchFrom.AssignWarehouse"
filterable
default-first-option
:reserve-keyword="false"
:placeholder="'请选择仓库'"
@change="scChange"
>
<el-option
v-for="item in warehouseData"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
/>
</el-select>
<el-select
style="width: 240px"
v-else
v-model="BatchFrom.AssignWarehouse"
filterable
default-first-option
:reserve-keyword="false"
:placeholder="'请选择商场'"
@change="scChange"
>
<el-option
v-for="item in Malldropdown"
:key="item.value"
:label="item.tripartiteMall"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="客服选择" class="el_Customer">
<el-select
v-model="AssignCustomerlist"
multiple
filterable
default-first-option
:reserve-keyword="false"
placeholder="请选择客服"
collapse-tags
:max-collapse-tags="2"
>
<el-option
v-for="item in AssignCustomerservice"
:key="item.value"
:label="item.realName"
:value="item.id"
:disabled="item.disabled"
/>
</el-select>
</el-form-item>
</div>
<div class="el_bqList">
<tablecmt
:columnList="customerserviceColumnList"
:tableData="customerData"
:loading="CustomerLoad"
:isShowRefresh="false"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
</tablecmt>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="Createassignment = false">取消</el-button>
<el-button
type="primary"
:disabled="CreateassignmentLoading"
@click="AssignSubmission"
>
提交
</el-button>
</span>
</template>
</el-dialog>
<!-- 财务入账弹窗 -->
<el-dialog v-model="dialogFinancialaccounting" title="财务入账" width="30%">
<div
class="el_DingTalk"
v-loading="loadingFinancial"
element-loading-text="正在处理中..."
>
<el-form :model="FinancialFrom" label-width="120px">
<el-form-item label="操作人">
<el-input v-model="FinancialFrom.operator" placeholder="请填写操作人" />
</el-form-item>
<el-form-item label="财务入账时间">
<el-date-picker
v-model="FinancialFrom.entryTime"
type="datetime"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择财务入账时间"
/>
</el-form-item>
</el-form>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogFinancialaccounting = false">取消</el-button>
<el-button type="primary" @click="Financialfilling" :disabled="loadingFinancial">
确认
</el-button>
</span>
</template>
</el-dialog>
</basic-container>
</div>
</el-tabs>
</div>
<!-- 列表配置显示 -->
<edittablehead
@closce="showdrawer"
:drawerShow="drawerShow"
:columnList="details.columnList"
v-model="details.columnList"
></edittablehead>
</template>
<script setup>
import { ElMessage } from 'element-plus';
import { ElMessageBox } from 'element-plus';
import { Plus } from '@element-plus/icons-vue';
import { useStore } from 'vuex';
import { exportBlob } from '@/api/common';
import {
$_getList,
$_submit,
$_getDetail,
$_remove,
$_getProcessor,
$_AddReply,
$_getExchangeList,
$_getInfo,
$_batchReturn,
$_assignCustomerService,
$_getCustomerServicePersonnel,
$_arbitrate,
$_addCompletionEnd,
$_appealSubmit,
$_listSettlement,
$_listAppeal,
$_listOwn,
$_moneyUpdate,
$_updateWorkList,
$_updateManagerConfirmed,
$_updateWorkOrderStatus,
$_AppealDetails,
$_Cancelappeal,
$_getDetails,
$_settlementUpdate,
$_updateArbitrateStatu,
$_exportAftersalesWorkOrder,
$_aftersalesCustomerMall,
$_aftersalesCustomerMallremove,
$_aftersalesCustomerMallsave,
$_aftersalesCustomerMallsetDefault,
$_updateFinanceTime,
$_basicdataTripartiteMall,
$_aftersalesCustomerMallgetByClientId,
$_exportaftersalesOvertimeFine,
} from '@/api/aftersales/aftersalesWorkOrder';
import { getToken } from '@/utils/auth';
import NProgress from 'nprogress';
import { getDictionaryBiz } from '@/api/system/dict'; //字典
import functions from '@/utils/functions.js';
import { getDetailWarehouse, getDeptWarehouse } from '@/api/basicdata/basicdataWarehouse'; //处理方
import {
ref,
reactive,
toRefs,
computed,
onMounted,
nextTick,
watch,
getCurrentInstance,
onActivated,
} from 'vue';
import {
columnList,
recordList,
Claimsfield,
AppealList,
timeoutList,
CustomerColumnList,
MallassignmentColumnList,
customerserviceColumnList,
} from '@/option/aftersales/vueTvemp.js';
import { processRowProperty, isNumber, computeNumber, setNodeHeight } from '@/utils/util';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { useRouter } from 'vue-router';
import { downloadXls, deepClone } from '@/utils/util';
import dayjs from 'dayjs';
const $router = useRouter();
const $useStore = useStore();
const $route = useRoute();
/** vuex */
const customerData = ref([]); //查询已绑定的客服
const pageLoad = ref(false);
console.log($useStore, '$useStore');
const accessControl = $useStore.getters.permission;
console.log(accessControl, '权限按钮');
const loadingFinancial = ref(false);
const assigncurrentPage = ref(1); //商场当前多少
const assignpageSize = ref(30);
const Malldropdown = ref([]); //商场选择
const scChange = val => {
CreateassignmentLoading.value = true; //开启加载
$_aftersalesCustomerMallgetByClientId({ clientId: val }).then(res => {
customerData.value = res.data.data;
AssignCustomerservice.value.forEach(itemA => {
let exists = customerData.value.some(itemB => itemB.customerServiceId == itemA.id);
itemA.disabled = exists ? true : false;
});
CreateassignmentLoading.value = false; //开启加载
console.log(AssignCustomerservice.value, '处理好的数据');
});
};
// workAdd;//新增
// batch_return;//批量打回
// assign;//工单指派
// apply_arbitration;//申请完结
// batch_completion;//批量完结
// representations;//申诉
// reply;//回复
// processing_completed;//处理完结
// work_order_completion;//完结
// repulse;//打回
// arbitration_completed;//完结完结
// information_editing;//信息编辑
console.log(accessControl.workAdd, '新增按钮权限');
// const PermissionButton = computed(() => {
// return {
// workAdd: accessControl.workAdd, //新增
// batch_return: accessControl.batch_return, //批量打回
// assign: accessControl.assign, //工单指派
// apply_arbitration: accessControl.apply_arbitration, //申请完结
// batch_completion: accessControl.batch_completion, //批量完结
// representations: accessControl.representations, //申诉
// reply: accessControl.reply, //回复
// processing_completed: accessControl.processing_completed, //处理完结
// work_order_completion: accessControl.work_order_completion, //完结
// repulse: accessControl.repulse, //打回
// arbitration_completed: accessControl.arbitration_completed, //完结完结
// information_editing: accessControl.information_editing, //信息编辑
// };
// });
const PermissionButton = computed(() => {
return {
workAdd: accessControl.workAdd, //新增
batch_return: accessControl.batch_return, //批量打回
assign: accessControl.assign, //工单指派
apply_arbitration: accessControl.apply_arbitration, //申请完结
batch_completion: accessControl.batch_completion, //批量完结
representations: accessControl.representations, //申诉
reply: accessControl.reply, //回复
processing_completed: accessControl.processing_completed, //处理完结
work_order_completion: accessControl.work_order_completion, //完结
repulse: accessControl.repulse, //打回
arbitration_completed: accessControl.arbitration_completed, //完结完结
information_editing: accessControl.information_editing, //信息编辑
};
});
const CustomerServicea = ref(false); //客服指派弹窗
const dialogFinancialaccounting = ref(false); //财务入账
const dialogCustomer = ref(false); //客服介入弹窗
const CustomerServiceForm = ref({}); //客服介入表单
const DingTalkfilling = ref({}); //钉钉号表单
const dialogDingTalk = ref(false); //钉钉号弹窗
const tabValue = ref(0); //侧边栏激活状态
const publicColumnList = ref([]); //公共列表参数
const scrollContainer = ref(null); //客服实例
const workOrderStatus = ref(null); //侧边栏参数
const BatchFrom = ref({}); //批量打回
const AssignCustomerlist = ref([]); //指派选择人员列表
const selectList = ref([]); //表格勾选选中
const CustomerLoad = ref(false); //客服指派查询弹窗加载
const FinancialFrom = ref({}); //财务入账填写
const currentPage = ref(1); // 默认页码
const TransportlossList = ref([
//运损发现节点
]);
const pageSize = ref(30); // 默认每一页几条
const AppealAttachment = ref([]); //申诉附件
const total = ref(0); //页码总页数
const KFinput = ref(''); //客服发送消息
const Appealselection = ref([]); //申诉选择的责任人
const CustomerTotal = ref(0); //总页码客服指派
const KFfeel = ref(''); //文件附件地址
const pageList = ref([5, 10, 50, 100, 200]); // 选择每页显示多少条
const background = ref(true); // 是否开启背景颜色
const disabled = ref(false); // 是否禁止使用页码功能
const fromamount = ref({}); //修改金额表单
const TimeoutStatus = ref(false); //超时列表状态
const loading = ref(false); //首页表格加载效果
const Createassignment = ref(false); //创建指派
const CreateassignmentLoading = ref(false); //客服指派加载效果
const dialogReturn = ref(false); //批量打回弹窗状态
const dialogappeal = ref(false); //申诉弹窗状态
const Indexdialog = ref(false); //新增弹窗
const Reasonforappeal = ref(''); //申诉原因
const Indexform = ref({}); //首页新增表单
const dialogcustomerService = ref(false); //客服信息
const IndexException = ref([]); //异常类型下拉选择
const DiscoveringNodes = ref([]); //发现节点下拉选择
const warehouseData = ref([]); //处理方
const customerService = ref([]);
const IndexForm = ref(null); //首页表实例
const FromDisabled = ref(false); //详情禁止输入框
const loadingappeal = ref(false); //工单申诉状态
const SelectType = ref(null); //类型
const ListRow = ref(); //当前行数据
const appealList = ref(); //申诉选择的参数
const appealData = ref(); //申诉单条数据
const StateType = ref(true); //类型
const dialogassign = ref(false); //工单指派
const AssignLoad = ref(false); //工单指派加载
const assignFrom = ref({}); //工单指派表单
const dialogImageUrl = ref('');
const dialogVisible = ref(false);
const groundlineType = ref(null); //干线状态
const groundlineSet = ref(true); //干线条件都满足
const enddialog = ref(false); //完结弹窗
const endFrom = ref({}); //完结弹窗表单
const screenHeight = ref(0); // 屏幕高度
const eightyPercentHeight = ref(0); // 80% 高度
const list = ref([]);
const options = ref([]);
const arbitrationTemp = ref(0); //完结当点击的那个菜单
const CustomerData = ref([]); //客服指派表格查询
const repulse = ref(false);
const dialogBatchcompletion = ref(false); //批量完结弹窗
const PLloading = ref(false);
const Mydata = ref(null); //仓库关键信息
const ProcessingList = ref([]); //赔付方式列表
const AssignCustomerservice = ref([]); //工单指派客服列表
const iconState = ref(false); //消息状态
const ProcessingPartyState = ref(false); //处理方数据(为真才显示)
const currentUser = ref(null); //存放当前的对话框必要Id
const ArbitrationStatus = ref(null); //申请完结状态
const TotalamountCompensation = ref(0); //赔款金额合计
const TotalamountReceived = ref(0); //收款金额合计
const Reasonarbitration = ref(null); //完结原因
const BatchcompletionHeight = ref(0); //批量完结弹窗
const userInfo = ref(); //当前登录人信息
const ClaimStatus = ref(false); //理赔状态
const AppealStatus = ref(false); //申诉列表状态
const dialogModifyAmount = ref(false); //超时金额修改弹出状态
const UserPermissions = ref('仓库客服'); //客服权限
const TabPermissions = ref(0); //菜单权限
const AssignmentType = ref('1'); //指派切换类型
const AppealeditorState = ref(false); //申诉是否为编辑状态(默认否)
const AppealStatusT = ref(false); //是否为申诉列表
const loadingCustomer = ref(false); //客服介入弹窗加载
const TabList = ref([
{ name: 0, label: '全部', state: true, request: true, DataList: [], total: 0,currentPage: 1,pageSize: 50,},
{ name: 8, label: '待回复', state: false, request: true, DataList: [], total: 0,currentPage: 1,pageSize: 50, },
{ name: 3, label: '待处理(新建)', state: true, request: true, DataList: [], total: 0,currentPage: 1,pageSize: 50, },
{ name: 1, label: '处理中', state: true, request: true, DataList: [], total: 0,currentPage: 1,pageSize: 50, },
{ name: 4, label: '理赔金额未出', state: true, request: true, DataList: [], total: 0,currentPage: 1,pageSize: 50, },
{ name: 2, label: '处理完毕', state: true, request: true, DataList: [], total: 0,currentPage: 1,pageSize: 50, },
{ name: 5, label: '客服介入', state: true, request: true, DataList: [], total: 0 ,currentPage: 1,pageSize: 50,},
{ name: 9, label: '待审核', state: true, request: true, DataList: [], total: 0,currentPage: 1,pageSize: 50, },
{ name: 6, label: '完结', state: true, request: true, DataList: [], total: 0 ,currentPage: 1,pageSize: 50,},
{ name: 7, label: '超时未处理', state: true, request: true, DataList: [], total: 0,currentPage: 1,pageSize: 50, },
]); //标签栏
const DeliveryDriver = ref([]);
const CompensationParty = ref([
{ name: '', state: 0, num: null, reason: '', cld: 1, warehouseId: '', personResponsibleName: '' }, //赔款方
{ name: '', state: 1, num: null, reason: '', cld: 1, warehouseId: '', personResponsibleName: '' }, //受款方
]); //收/赔
const details = reactive({
/** 是否开启搜索 */
search: false,
/** 表格搜索条件 */
query: {
workOrderStatus: UserPermissions.value == '仓库客服' ? '1000' : '',
},
/** 时间快捷选择设置 */
shortcuts: [
{
text: '最近一周',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
},
},
{
text: '最近一个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
},
},
{
text: '最近三个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
},
},
],
/** 列表 */
columnList: deepClone(columnList),
/** 列表数据 */
data: [],
// 处理记录
recordList: deepClone(recordList),
// 处理记录数据
recorddata: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
packageListLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
currentPage: 1,
pageSize: 50,
total: 0,
},
/** 弹出层显示 */
popUpShow: {
/** 包件明细 */
packageOrderListlVisited: false,
/** 二维码 */
QRCodeVisible: false,
/** 修改客户信息 */
editClientInfoVisible: false,
},
/** 列表Dom节点 */
listNode: '',
form: {},
/** 全屏 */
fullscreenObj: {
/** 包明细 */
packageOrderListlVisited: false,
},
});
const {
search,
query,
shortcuts,
data,
loadingObj,
selectionList,
drawerShow,
page,
trickleLoadingPage,
zeroAdditionalRecordingInfo,
popUpShow,
recorddata,
} = toRefs(details);
// let tab = [
// { label: '全部', value: 0 },
// { label: '处理中', value: 1 },
// { label: '待处理完毕', value: 2 },
// { label: '待处理', value: 3 },
// { label: '理赔金额未出', value: 4 },
// { label: '完结', value: 5 },
// { label: '完结', value: 6 },
// { label: '超时未处理', value: 7 },
// ];
// // 按钮配置
// // 1.新增 2.批量打回 3.工单指派 4.申请完结 5.批量完结 6.申诉
// // 角色配置
// // 1.仓库客服
// // 2.职能客服
// // 3.客服经理
// // 在value == 0状态下的权限配置
// 1.新增 只能仓库客服查看
// 2.批量打回 只能职能客服查看
// 3.工单指派 只能客服经理查看
// 4.申请完结 只能仓库客服查看
// 5.批量完结 只能职能客服查看
// 6.申诉 隐藏
// // 在value==1状态下的权限配置
// 1.新增 隐藏
// 2.批量打回 只能仓库客服查看
// 3.工单指派 隐藏
// 4.申请完结 只能仓库客服查看
// 5.批量完结 只能职能客服和客服经理查看
// 6.申诉 隐藏
// // 在value==2状态下的权限配置
// 隐藏所有按钮
// // 在value==3状态下的权限配置
// 1.新增 隐藏
// 2.批量打回 只能仓库客服查看
// 3.工单指派 只能客服经理查看
// 4.申请完结 隐藏
// 5.批量完结 隐藏
// 6.申诉 隐藏
// // 在value==4状态下的权限配置
// 1.新增 隐藏
// 2.批量打回 隐藏
// 3.工单指派 隐藏
// 4.申请完结 隐藏
// 5.批量完结 隐藏
// 6.申诉 仓库客服查看
// // 在value==5状态下的权限配置
// 1.新增 隐藏
// 2.批量打回 隐藏
// 3.工单指派 隐藏
// 4.申请完结 隐藏
// 5.批量完结 隐藏
// 6.申诉 隐藏
// // 在value==6状态下的权限配置
// 1.新增 隐藏
// 2.批量打回 隐藏
// 3.工单指派 隐藏
// 4.申请完结 隐藏
// 5.批量完结 隐藏
// 6.申诉 隐藏
// // 在value== 7 状态下的权限配置
// 1.新增 隐藏
// 2.批量打回 隐藏
// 3.工单指派 隐藏
// 4. 申请完结 隐藏
// 5.批量完结 隐藏
// 6.申诉 隐藏
// 角色通过 UserPermissions 变量控制
// 菜单通过 TabPermissions变量 来控制
// 例如:
// const UserPermissions = ref('仓库客服'); //客服权限
// const TabPermissions = ref(0); //菜单权限
// 按钮权限
const ButtonPermissions = computed(() => {
// 根据 TabPermissions 的状态,决定每个按钮的显示隐藏逻辑
switch (TabPermissions.value) {
case 0: //全部
return {
// add: true, //新增按钮
// batchReject: true, //批量打回
// assignment: true, //工单指派
// applyArbitration:true, //客服介入
// DingTalkNumber:true,//钉钉号填写
// batchFinish:true, //批量完结
// appeal: true, //申诉
add: true, //新增按钮
batchReject: false, //批量打回
assignment: false, //工单指派
applyArbitration: false, //客服介入
DingTalkNumber: false, //钉钉号填写
batchFinish: false, //批量完结
appeal: false, //申诉
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: UserPermissions.value != '仓库客服', //默认指派
export_Report: true, //导出报表
Timed_outexport: false, //超时导出
};
case 1: //处理中
return {
add: false, //新增按钮
batchReject: false, //批量打回
assignment: UserPermissions.value != '仓库客服', //工单指派
applyArbitration: UserPermissions.value == '仓库客服', //客服介入
DingTalkNumber: false, //钉钉号填写
batchFinish: false, //批量完结
Batchdetermination: UserPermissions.value != '仓库客服', //批量确定
appeal: false, //申诉
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: false, //默认指派
export_Report: true, //导出报表
Timed_outexport: false, //超时导出
};
case 2: //处理完毕
return {
add: false, //新增按钮
batchReject: UserPermissions.value == '总部客服', //批量打回
assignment: true, //工单指派
applyArbitration: false, //客服介入
DingTalkNumber: false, //钉钉号填
batchFinish: false, //批量完结
appeal: UserPermissions.value == '仓库客服' && AppealStatusT.value, //申诉
Batchdetermination: UserPermissions.value == '仓库客服', //批量确定
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: false, //默认指派
export_Report: true, //导出报表
Timed_outexport: false, //超时导出
};
case 3: //待处理
return {
add: false, //新增按钮
batchReject: false, //批量打回
assignment: true, //工单指派
applyArbitration: false, //客服介入
batchFinish: false, //批量完结
appeal: false, //申诉
Batchdetermination: false, //批量确定
DingTalkNumber: false, //钉钉号填写
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: false, //默认指派
export_Report: true, //导出报表
Timed_outexport: false, //超时导出
};
case 4: //理赔金额未出
return {
add: false, //新增按钮
batchReject: false, //批量打回
assignment: false, //工单指派
applyArbitration: false, //客服介入
batchFinish: false, //批量完结
appeal: false, //申诉
DingTalkNumber: false, //钉钉号填写
Batchdetermination: false, //批量确定
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: false, //默认指派
export_Report: true, //导出报表
Timed_outexport: false, //超时导出
};
case 5: //客服介入
return {
add: false, //新增按钮
batchReject: false, //批量打回
assignment: false, //工单指派
applyArbitration: false, //客服介入
batchFinish: false, //批量完结
appeal: false, //申诉
DingTalkNumber: false, //钉钉号填写
Batchdetermination: false, //批量确定
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: UserPermissions.value != '仓库客服', //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: false, //默认指派
export_Report: true, //导出报表
Timed_outexport: false, //超时导出
};
case 6: //完结
return {
add: false, //新增按钮
batchReject: false, //批量打回
assignment: false, //工单指派
applyArbitration: false, //客服介入
batchFinish: false, //批量完结
DingTalkNumber: UserPermissions.value == '总部客服经理' && !AppealStatusT.value, //钉钉号填写, //钉钉号填写
appeal: UserPermissions.value == '仓库客服', //申诉
Batchdetermination: false, //批量确定
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: UserPermissions.value != '仓库客服' && !AppealStatusT.value, //财务入账
defaultassignments: false, //默认指派
export_Report: true, //导出报表
Timed_outexport: false, //超时导出
};
case 7: //超时未处理
return {
add: false, //新增按钮
batchReject: false, //批量打回
assignment: false, //工单指派
applyArbitration: false, //客服介入
batchFinish: false, //批量完结
appeal: false, //申诉
Batchdetermination: false, //批量确定
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: false, //默认指派
export_Report: false, //导出报表
Timed_outexport: true, //超时导出
};
case 8: //待回复
return {
add: false, //新增按钮
batchReject: false, //批量打回
assignment: false, //工单指派
applyArbitration: true, //客服介入
batchFinish: false, //批量完结
appeal: false, //申诉
Batchdetermination: false, //批量确定
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: false, //默认指派
export_Report: false, //导出报表
Timed_outexport: false, //超时导出
};
case 9: //待审核
return {
add: false, //新增按钮
batchReject: false, //批量打回
assignment: false, //工单指派
applyArbitration: false, //客服介入
batchFinish: UserPermissions.value != '仓库客服', //批量完结
appeal: false, //申诉
Batchdetermination: false, //批量确定
ManagerConfirmed: UserPermissions.value == '总部客服经理', //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: false, //默认指派
export_Report: true, //导出报表
Timed_outexport: false, //超时导出
};
// 其他任何情况下的默认情况
default:
return {
add: false,
batchReject: false,
assignment: false,
applyArbitration: false,
batchFinish: false,
appeal: false,
Batchdetermination: false, //批量确定
ManagerConfirmed: false, //处理完毕下面的客服经理批量确定
ArbitrationDetermination: false, //批量完结确定
Financial_accounting: false, //财务入账
defaultassignments: false, //默认指派
export_Report: false, //导出报表
Timed_outexport: false, //超时导出
};
}
});
const ProcessingResults = [
{
value: '0',
label: '维修',
},
{
value: '1',
label: '补漆',
},
{
value: '2',
label: '下补单',
},
{
value: '3',
label: '赔付运费',
},
{
value: '4',
label: '用库存',
},
{
value: '5',
label: '赔商家',
},
{
value: '6',
label: '赔客户',
},
];
const fileList = ref([]);
const TransportLossNode = ref([
{ label: '在库操作环节', value: 1 },
{ label: '干线卸车环节', value: 2 },
{ label: '入库环节', value: 3 },
{ label: '配送环节', value: 4 },
{ label: '中转卸车环节', value: 5 },
{ label: '安装环节', value: 6 },
]);
const Statusprocessing = val => {
val.forEach(item => {
// 对为null的数据进行处理
// for (const property in item) {
// if (item[property] == null) {
// item[property] = '/';
// }
// }
// 对状态进行处理
if (item.workOrderType == 1) {
item.workOrderTypeNameS = columnList[2].checkarr[0].label; //货损
} else if (item.workOrderType == 2) {
item.workOrderTypeNameS = columnList[2].checkarr[1].label; //少货
} else if (item.workOrderType == 3) {
item.workOrderTypeNameS = columnList[2].checkarr[2].label; //窜货
} else if (item.workOrderType == 4) {
item.workOrderTypeNameS = columnList[2].checkarr[3].label; //加急
} else if (item.workOrderType == 5) {
item.workOrderTypeNameS = columnList[2].checkarr[4].label; //其他
}
// 提货环节下拉赋值
if (item.discoveryNode == 1) {
item.discoveryNodeNameS = columnList[3].checkarr[0].label; //提货环节
} else if (item.discoveryNode == 2) {
item.discoveryNodeNameS = columnList[3].checkarr[1].label; //发货环节
} else if (item.discoveryNode == 3) {
item.discoveryNodeNameS = columnList[3].checkarr[2].label; //干线卸车环节
} else if (item.discoveryNode == 4) {
item.discoveryNodeNameS = columnList[3].checkarr[3].label; //库内作业环节
} else if (item.discoveryNode == 5) {
item.discoveryNodeNameS = columnList[3].checkarr[4].label; //配送装车环节
} else if (item.discoveryNode == 6) {
item.discoveryNodeNameS = columnList[3].checkarr[5].label; //其他
} else if (item.discoveryNode == 7) {
item.discoveryNodeNameS = columnList[3].checkarr[6].label; //配送签收环节
} else if (item.discoveryNode == 8) {
item.discoveryNodeNameS = columnList[3].checkarr[7].label; //安装环节
}
if (item.workOrderStatus == 10) {
item.workOrderStatusNameS = columnList[10].checkarr[0].label; //待处理
} else if (item.workOrderStatus == 20) {
item.workOrderStatusNameS = columnList[10].checkarr[1].label; //处理中
} else if (item.workOrderStatus == 30) {
item.workOrderStatusNameS = columnList[10].checkarr[2].label; //已处理
} else if (item.workOrderStatus == 40) {
item.workOrderStatusNameS = columnList[10].checkarr[4].label; //待审核
} else if (item.workOrderStatus == 50) {
item.workOrderStatusNameS = columnList[10].checkarr[5].label; //已审核
} else if (item.workOrderStatus == 60) {
item.workOrderStatusNameS = columnList[10].checkarr[3].label; //超时未处理
} else if (item.workOrderStatus == 70) {
item.workOrderStatusNameS = columnList[10].checkarr[6].label; //仲裁中
} else if (item.workOrderStatus == 80) {
item.workOrderStatusNameS = columnList[10].checkarr[7].label; //完结
} else if (item.workOrderStatus == 90) {
item.workOrderStatusNameS = columnList[10].checkarr[8].label; //理赔金未出
} else if (item.workOrderStatus == 21) {
item.workOrderStatusNameS = columnList[10].checkarr[9].label; //处理结果已提交
} else if (item.workOrderStatus == 100) {
item.workOrderStatusNameS = columnList[10].checkarr[10].label; //处理结果已提交
} else if (item.workOrderStatus == 110) {
item.workOrderStatusNameS = columnList[10].checkarr[11].label; //处理结果已提交
}
// } else if (item.workOrderStatus == 100) {
// item.workOrderStatusNameS = columnList[10].checkarr[10].label; //申诉中
// } else if (item.workOrderStatus == 110) {
// item.workOrderStatusNameS = columnList[10].checkarr[11].label; //已结束
// }
});
};
// 页面初始化数据
const IndexTable = (val, Refresh) => {
console.log(page.value,'page.value');
console.log('初始化接口');
console.log(
!TabList.value.find(res => res.name == TabPermissions.value).request,
Refresh,
'页面初始化Refresh'
);
let State = TabList.value.find(res => res.name == TabPermissions.value).request;
if (!State && !Refresh) {
details.data = TabList.value.find(res => res.name == TabPermissions.value).DataList;
page.value.total = TabList.value.find(res => res.name == TabPermissions.value).total;
return;
}
ClaimStatus.value = false;
AppealStatus.value = false; //关闭申诉状态
TimeoutStatus.value = false; //关闭超时
// ProcessingPartyState.value = false; //关闭处理方
details.loadingObj.list = true; //开启动画加载
pageLoad.value = true;
columnList[2].checkarr = []; //重置下拉搜索框
columnList[3].checkarr = [];
columnList[10].checkarr = [];
updateDictionary(columnList[2].checkarr, 'pc_work_order'); //异常类型
updateDictionary(columnList[3].checkarr, 'pc_discovery_node'); //发现环节
updateDictionary(columnList[10].checkarr, 'work_order_status'); //工单状态
getDictionaryBiz('after_sales_visits').then(res => {
console.log(res, '角色字典');
// 获取用户角色信息,并拆分为数组
const roleNames = JSON.parse(localStorage.getItem('TWMS-userInfo')).content.role_name.split(
','
);
// 根据角色名称查找匹配项目
const matchingItem = res.data.data.find(item => roleNames.includes(item.dictValue));
console.log(matchingItem, 'matchingItem');
if (matchingItem) {
UserPermissions.value = matchingItem.dictValue;
if (UserPermissions.value == '仓库客服') {
TabList.value.find(res => res.name == '8').state = true;
} else {
TabList.value.find(res => res.name == '8').state = false;
}
if (UserPermissions.value == '总部客服经理') {
TabList.value.find(res => res.name == '9').state = true;
} else {
TabList.value.find(res => res.name == '9').state = false;
}
}else{
TabList.value.find(res => res.name == '9').state = false;
}
console.log(UserPermissions.value, '当前角色权限');
let data = {
...val, //接收搜索参数值
current: page.value.currentPage, //页码
size: page.value.pageSize, //条数
};
if (TabPermissions.value == 0) {
if (UserPermissions.value != '仓库客服') {
data.workOrderStatus = null;
details.query.workOrderStatus = null;
} else {
data.workOrderStatus = '1000';
details.query.workOrderStatus = '1000';
}
}
console.log(data, '处理的参数');
$_getList(data).then(res => {
Tableheaderswitching(columnList);
console.log(res, '初始化返回值');
details.loadingObj.list = false; //关闭动画加载
pageLoad.value = false;
if (res.data.data) {
console.log(res.data.data, '初始化返回值===>');
// page.value.total = res.data.data.total; //总页数
if (res.data.data.records.length) {
Statusprocessing(res.data.data.records);
console.log(res.data.data.records, 'res.data.data.records有值');
TabList.value.find(res => res.name == TabPermissions.value).DataList =
res.data.data.records;
TabList.value.find(res => res.name == TabPermissions.value).total = res.data.data.total;
TabList.value.find(res => res.name == TabPermissions.value).currentPage = res.data.data.current;
TabList.value.find(res => res.name == TabPermissions.value).request = false;
console.log(TabList.value, '当前存储的值');
details.data = TabList.value.find(res => res.name == TabPermissions.value).DataList;
page.value.total = TabList.value.find(res => res.name == TabPermissions.value).total;
console.log(TabList.value, 'TabList.value===>');
} else {
TabList.value.find(res => res.name == TabPermissions.value).DataList = [];
TabList.value.find(res => res.name == TabPermissions.value).total = res.data.data.total;
TabList.value.find(res => res.name == TabPermissions.value).currentPage = res.data.data.current;
TabList.value.find(res => res.name == TabPermissions.value).request = true;
// details.data = res.data.data.records;
details.data = res.data.data.records;
}
}
loading.value = false; //关闭加载效果
});
});
};
// 表格切换
const Tableheaderswitching = val => {
publicColumnList.value = val; //默认加载表格
details.columnList = val; //列表配置项
};
const state = ref(0);
// 页面初始化
const OnLoad = () => {
// state.value = localStorage.getItem('state');
// console.log(state.value,'当前页面状态');
// if(state.value==1){
// return
// }
// state.value=1
// localStorage.setItem('state', state.value);
// 表格切换
userInfo.value = JSON.parse(localStorage.getItem('TWMS-userInfo')); //获取本地登录人参数
if (localStorage.getItem('my_data')) {
Mydata.value = JSON.parse(localStorage.getItem('my_data')); //获取本地仓库信息
currentUser.value = Mydata.value.id;
console.log(TabList.value, 'TabList');
}
// 在组件挂载后获取屏幕高度
screenHeight.value = window.innerHeight;
// 计算80%的高度
eightyPercentHeight.value = screenHeight.value * 0.8;
BatchcompletionHeight.value = screenHeight.value * 0.6;
loading.value = true; //开启加载效果
let data = {};
data.current = page.value.currentPage; //页码
data.size = page.value.pageSize; //条数
console.log(data, '要提交的数据');
updateDictionary(columnList[2].checkarr, 'pc_work_order'); //异常类型
updateDictionary(columnList[3].checkarr, 'pc_discovery_node'); //发现环节
IndexTable(details.query);
getDeptWarehouse({}).then(res => {
res.data.data.forEach(item => {
warehouseData.value.push({
value: item.id,
label: item.name,
});
});
});
};
OnLoad();
// 页面筛选监听路由地址变化
watch(
() => $route.path,
(newPath, oldPath) => {
if ($useStore.state.isRefresh.refreshObj.aftersalesWorkOrder) {
TabPermissions.value = $useStore.state.Customer.Customerobj;
console.log(TabPermissions.value, '当前TabPermissions.value');
console.log(tabValue.value, '当前 tabValue.value');
tabValue.value = $useStore.state.Customer.Customerobj; //菜单编号
if ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9].includes(TabPermissions.value)) {
//0.全部菜单
//4. 理赔金未出
tabChenge(TabPermissions.value, null, true);
$useStore.commit('Customer_Menu', 0); //设置回初始值
}
// 重新请求数据
$useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: false });
}
}
);
// onActivated(() => {
// console.log('进入缓存');
// if ($useStore.state.isRefresh.refreshObj.aftersalesWorkOrder) {
// // 重新请求数据
// OnLoad();
// $useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: false });
// }
// });
// 字典公共函数
function updateDictionary(targetArray, dictionaryType) {
getDictionaryBiz(dictionaryType).then(res => {
console.log(res, '字典');
res.data.data.forEach(item => {
targetArray.push({
value: item.dictKey,
label: item.dictValue,
});
});
});
}
// 字典请求函数
const AddInfo = () => {
$router.push('/aftersales/aftersalesWorkOrderAdd');
};
// 上传图片规则
const beforeAvatarUpload = async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
// 首页新增表单确定
const ConfirmForm = () => {
console.log(warehouseData.value, '准备好的数据');
console.log(Indexform.value.duty, '要筛选的数据');
let filteredB = warehouseData.value.filter(item => Indexform.value.duty.includes(item.id));
console.log(filteredB);
// 匹配司机名字
Indexform.value.deliveryDriver = DeliveryDriver.value.find(
item => item.value == Indexform.value.deliveryDriver
).label;
console.log(Indexform.value.deliveryDriver); // 输出李华
FromDisabled.value = false; //启用输入框
let processorEntityList = [];
//处理方
Indexform.value.processor.forEach(item => {
let found = warehouseData.value.find(element => element.value == item.toString());
processorEntityList.push({
businessName: found ? found.label : '',
businessId: item,
conditions: 1,
typesOf: 2,
});
});
//责任方
Indexform.value.duty.forEach(item => {
let found = warehouseData.value.find(element => element.value == item.toString());
processorEntityList.push({
businessName: found ? found.label : '',
businessId: item,
conditions: 1,
typesOf: 1,
});
});
// processorEntityList.push(ResponsibleParty);
console.log(processorEntityList, 'processorEntityList');
let DataSubmit = { ...Indexform.value }; //定义初始化
DataSubmit.processorEntityList = processorEntityList;
delete DataSubmit.duty, //移除多余字段
delete DataSubmit.processor; //移除多余字段
console.log(DataSubmit, '处理好的表单信息');
console.log(warehouseData.value, 'warehouseData.value');
Indexdialog.value = false; //关闭表单弹窗
$_submit(DataSubmit).then(res => {
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
Indexform.value = {}; //重置表单
IndexTable(details.query);
}
});
};
// 顶部搜索
const searchHide = () => {
console.log(details);
details.search = !details.search;
const _node = document.querySelectorAll('.tableNode');
setNodeHeight(_node, '', true);
};
// 异常工单号点击查看
const InformationViewing = val => {
console.log(val, '当前行数据');
const workOrderInfoPath = '/aftersales/aftersalesWorkOrderInfo';
const queryParams = {
id: val.row.workOrderId,
name: `${val.row.workOrderNumber}-信息查看`,
warehouseId: val.row.warehouseId,
workOrderNumber: val.row.workOrderNumber,
businessId: val.row.businessId,
RouteIndexs: TabPermissions.value,
workOrderStatus: val.row.workOrderStatus,
};
if (AppealStatusT.value) {
Object.assign(queryParams, {
appealID: val.row.id,
name: `${val.row.workOrderNumber}-申诉信息查看`,
typesOf: val.row.typesOf,
ProcessType: TabPermissions.value == 2 ? '2' : TabPermissions.value == 3 ? '1' : '',
Routstate: 'appeal',
});
$router.push({ path: workOrderInfoPath, query: queryParams });
console.log('申诉跳转');
return;
}
if (TabPermissions.value === 4) {
Resultediting(val);
console.log('菜单4跳转');
return;
}
if (TabPermissions.value === 7) {
$router.push({ path: workOrderInfoPath, query: queryParams });
console.log('菜单7跳转');
return;
}
console.log('默认跳转');
$router.push({ path: workOrderInfoPath, query: { ...queryParams, id: val.row.id } });
};
// // 异常工单号点击查看
// const InformationViewing = val => {
// console.log(val, '当前行数据');
// // 表示当前在申诉列表
// if (AppealStatusT.value) {
// $router.push({
// // AppealStatusT为真表示是申诉列表
// path: '/aftersales/aftersalesWorkOrderInfo',
// query: {
// id: val.row.workOrderId,
// appealID: val.row.id, //只有申诉才需要的参数
// name: val.row.workOrderNumber + '-申诉信息查看',
// typesOf: val.row.typesOf, //申诉列表状态0:待处理,1:成立,2:不成立
// warehouseId: val.row.warehouseId,
// workOrderNumber: val.row.workOrderNumber, //添加异常记录包条码
// businessId: val.row.businessId,
// ProcessType: TabPermissions.value == 2 ? '2' : TabPermissions.value == 3 ? '1' : '', //类型 1 待处理 2 已处理
// RouteIndexs: TabPermissions.value, //当前记录参数
// Routstate: 'appeal', //申诉列表
// workOrderStatus: val.row.workOrderStatus, //工单状态
// },
// });
// return;
// }
// // 理赔金额未出
// if (TabPermissions.value == 4) {
// //调用编辑理赔金额方法
// Resultediting(val);
// return
// }
// if (TabPermissions.value == 7) {
// console.log('当前在超时未处理未出');
// $router.push({
// path: '/aftersales/aftersalesWorkOrderInfo',
// query: {
// id: val.row.workOrderId,
// appealID: val.row.id, //只有才需要的参数
// name: val.row.workOrderNumber + '-信息查看',
// warehouseId: val.row.warehouseId,
// workOrderNumber: val.row.workOrderNumber, //添加异常记录包条码
// businessId: val.row.businessId,
// RouteIndexs: TabPermissions.value, //当前记录参数
// workOrderStatus: val.row.workOrderStatus, //订单状态
// },
// });
// return;
// }
// $router.push({
// path: '/aftersales/aftersalesWorkOrderInfo',
// query: {
// id: val.row.id,
// name: val.row.workOrderNumber + '-信息查看',
// warehouseId: val.row.warehouseId,
// workOrderNumber: val.row.workOrderNumber, //添加异常记录包条码
// businessId: val.row.businessId,
// RouteIndexs: TabPermissions.value, //当前记录参数
// workOrderStatus: val.row.workOrderStatus, //工单状态
// },
// });
// };
// 首页查看详情按钮
const view = val => {
console.log(val.row, '查看');
const workOrderInfoPath = '/aftersales/aftersalesWorkOrderInfo';
const baseQueryParams = {
id: val.row.workOrderId,
name: `${val.row.workOrderNumber}-信息查看`,
warehouseId: val.row.warehouseId,
workOrderNumber: val.row.workOrderNumber,
businessId: val.row.businessId,
RouteIndexs: TabPermissions.value,
workOrderStatus: val.row.workOrderStatus,
};
if (AppealStatusT.value) {
console.log('当前是申诉');
const appealQueryParams = {
...baseQueryParams,
typesOf: val.row.typesOf,
appealID: val.row.id,
name: `${val.row.workOrderNumber}-申诉信息查看`,
Routstate: 'appeal',
};
$router.push({ path: workOrderInfoPath, query: appealQueryParams });
return;
}
if (TabPermissions.value === 4) {
Resultediting(val);
console.log('菜单4跳转');
return;
}
// if (TabPermissions.value === 4) {
// console.log('当前菜单4');
// const claimQueryParams = {
// ...baseQueryParams,
// appealID: val.row.id,
// id: val.row.lawoId, //理赔金未出需要的ID
// ProcessType: TabPermissions.value == 2 ? '2' : TabPermissions.value == 3 ? '1' : '',
// Routstate: '',
// AppealReview: val.row.typesOf ? (val.row.typesOf === '0' ? 'true' : 'false') : 'true',
// };
// $router.push({ path: workOrderInfoPath, query: claimQueryParams });
// return;
// }
if (TabPermissions.value === 7) {
console.log('当前在超时未处理未出');
const timeoutQueryParams = { ...baseQueryParams, appealID: val.row.id };
$router.push({ path: workOrderInfoPath, query: timeoutQueryParams });
return;
}
console.log(AppealStatusT.value, 'AppealStatusT.value');
const defaultQueryParams = {
...baseQueryParams,
id: AppealStatusT.value ? val.row.workOrderId : val.row.id,
appealID: val.row.id,
ProcessType: TabPermissions.value == 2 ? '2' : TabPermissions.value == 3 ? '1' : '',
Routstate: '',
AppealReview: val.row.typesOf ? (val.row.typesOf === '0' ? 'true' : 'false') : 'true',
};
console.log('默认跳转');
$router.push({ path: workOrderInfoPath, query: defaultQueryParams });
};
// const view = val => {
// console.log(val.row, '申诉查看');
// if (AppealStatusT.value) {
// console.log('当前是申诉');
// // 表示当前在申诉列表
// $router.push({
// // AppealStatusT为真表示是申诉列表
// path: '/aftersales/aftersalesWorkOrderInfo',
// query: {
// id: val.row.workOrderId,
// typesOf: val.row.typesOf, //申诉列表状态0:待处理,1:成立,2:不成立
// appealID: val.row.id, //只有申诉才需要的参数
// name: val.row.workOrderNumber + '-信息查看',
// warehouseId: val.row.warehouseId,
// workOrderNumber: val.row.workOrderNumber, //添加异常记录包条码
// businessId: val.row.businessId,
// RouteIndexs: TabPermissions.value, //当前菜单
// Routstate: 'appeal', //申诉列表
// workOrderStatus: val.row.workOrderStatus, //当前工单状态
// },
// });
// return
// }
// // 理赔查看
// if (TabPermissions.value == 4) {
// $router.push({
// // AppealStatusT为真表示是申诉列表
// path: '/aftersales/aftersalesWorkOrderInfo',
// query: {
// id: val.row.lawoId,
// appealID: val.row.id, //只有申诉才需要的参数
// name: val.row.workOrderNumber + '-信息查看',
// warehouseId: val.row.warehouseId,
// workOrderNumber: val.row.workOrderNumber, //添加异常记录包条码
// businessId: val.row.businessId,
// ProcessType: TabPermissions.value == 2 ? '2' : TabPermissions.value == 3 ? '1' : '', //类型 1 待处理 2 已处理
// RouteIndexs: TabPermissions.value, //当前记录参数
// Routstate: '', //申诉列表
// AppealReview: val.row.typesOf ? (val.row.typesOf == '0' ? 'true' : 'false') : 'true', //当前只能查看申诉详情信息
// workOrderStatus: val.row.workOrderStatus, //订单状态
// },
// });
// return;
// }
// if (TabPermissions.value == 7) {
// console.log('当前在超时未处理未出');
// $router.push({
// path: '/aftersales/aftersalesWorkOrderInfo',
// query: {
// id: val.row.workOrderId,
// appealID: val.row.id, //只有才需要的参数
// name: val.row.workOrderNumber + '-信息查看',
// warehouseId: val.row.warehouseId,
// workOrderNumber: val.row.workOrderNumber, //添加异常记录包条码
// businessId: val.row.businessId,
// RouteIndexs: TabPermissions.value, //当前记录参数
// workOrderStatus: val.row.workOrderStatus, //订单状态
// },
// });
// return;
// }
// console.log(AppealStatusT.value,'AppealStatusT.value');
// $router.push({
// // AppealStatusT为真表示是申诉列表
// path: '/aftersales/aftersalesWorkOrderInfo',
// query: {
// id: AppealStatusT.value ? val.row.workOrderId : val.row.id,
// appealID: val.row.id, //只有申诉才需要的参数
// name: val.row.workOrderNumber + '-信息查看',
// warehouseId: val.row.warehouseId,
// workOrderNumber: val.row.workOrderNumber, //添加异常记录包条码
// businessId: val.row.businessId,
// ProcessType: TabPermissions.value == 2 ? '2' : TabPermissions.value == 3 ? '1' : '', //类型 1 待处理 2 已处理
// RouteIndexs: TabPermissions.value, //当前记录参数
// Routstate: '', //申诉列表
// AppealReview: val.row.typesOf ? (val.row.typesOf == '0' ? 'true' : 'false') : 'true', //当前只能查看申诉详情信息
// workOrderStatus: val.row.workOrderStatus, //订单状态
// },
// });
// };
// 申诉列表编辑
const Appealeditor = val => {
// 编辑信息
$router.push({
path: '/aftersales/aftersalesWorkOrdermodify',
query: {
id: val.row.id,
name: val.row.workOrderNumber + '-申诉编辑',
businessId: $route.query.businessId,
warehouseId: val.row.warehouseId,
workOrderNumber: val.row.workOrderNumber,
RouterState: 'Kfend',
Appealeditor: 'appeal', //申诉编辑
},
});
};
// 首页删除
const ViewDelete = val => {
ElMessageBox.confirm(`是否删除该条数据?`)
.then(() => {
$_remove({
ids: val.row.id,
}).then(res => {
console.log(res, '删除成功后的返回值');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
OnLoad(); //添加成功初始化程序
}
});
})
.catch(() => {
// catch error
});
};
// 首页批量删除
const BatchDelete = () => {
console.log(details.selectionList, '选中的参数');
let ids = [];
details.selectionList.forEach(item => {
ids.push(item.id);
});
ids = ids.join(',');
ElMessageBox.confirm(`是否批量删除选中数据?`)
.then(() => {
$_remove({
ids,
}).then(res => {
console.log(res, '删除成功后的返回值');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
OnLoad(); //添加成功初始化程序
}
});
})
.catch(() => {
// catch error
});
};
// 完结按钮
const CompletionButton = val => {
$router.push({
path: '/aftersales/aftersalesWorkOrderend',
query: {
id: val.row.id,
name: val.row.id + '-完结填写',
RouterState: 'end',
},
});
};
// 新增记录
const addingRecord = val => {
console.log(val);
$router.push({
path: '/aftersales/aftersalesWorkOrderend',
query: {
id: val.row.id,
name: val.row.workOrderNumber + '-添加异常记录',
RouterState: 'record',
businessId: val.row.businessId,
},
});
};
// 点击了申诉附件图片
const AppealAttachmentpictureList = val => {
console.log(val, '点击申诉附件图片');
};
// 申诉附件移除
const AppealAttachmentImgListRemove = val => {
console.log(val, '申诉附件移除');
};
// 申诉附件图片上传成功回调
const AppealAttachmentImgSuccess = val => {
console.log(val, '申诉图片上传成功');
};
// 取消申诉
const CancelappealFn = val => {
ElMessageBox.confirm('是否取消申诉?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
let data = {
id: val.row.id, //取消申诉ID
typesOf: '3', //申诉状态
workOrderId: val.row.workOrderId, //异常工单ID
};
$_Cancelappeal(data).then(res => {
console.log(res, '取消申诉返回值');
if (res.data.code == 200) {
appealFn(details.query);
ElMessage({
message: '取消申诉成功',
type: 'success',
});
}
});
})
.catch(() => {});
};
// 工单申诉按钮
const appeal = (val, state) => {
console.log(state, 'state');
AppealAttachment.value = []; //清空图片
Appealselection.value = []; //清空责任人
Reasonforappeal.value = ''; //清空申诉内容
console.log(state);
console.log(val, '申诉当前点击的按钮');
if (state == 'edit') {
// 当前是编辑申诉
details.selectionList.push(val.row);
AppealeditorState.value = true; //开启申诉编辑状态
if (val.row) {
selectList.value.push(val.row);
}
let data = {
id: val.row.id,
};
$_AppealDetails(data).then(res => {
console.log(res, '申诉编辑回显');
Reasonforappeal.value = res.data.data.reason; //申诉原因
setTimeout(() => {
console.log(res.data.data.peopleEntityList.map(item => item.actualPersonId));
console.log(warehouseData.value, '仓库数据');
if (res.data.data.peopleEntityList) {
Appealselection.value = res.data.data.peopleEntityList.map(item => item.actualPersonId);
}
if (res.data.data.imagePath) {
AppealAttachment.value.push({
url: res.data.data.imagePath,
});
}
dialogappeal.value = true; //展开申诉编辑
}, 0);
});
return;
}
if (!state) {
console.log('当前是申诉');
// 单条申诉
AppealeditorState.value = false; //开启申诉编辑状态
if (val.row) {
details.selectionList.push(val.row);
}
dialogappeal.value = true; //展开申诉弹窗
}
};
// 批量申诉
const appealAll = () => {
// 批量申诉
console.log(details.selectionList, 'details.selectionList');
if (!details.selectionList.length) {
ElMessage({
message: '请选择要申诉的数据',
type: 'warning',
});
return;
}
if (details.selectionList.length > 1) {
ElMessage({
message: '只能单条申诉',
type: 'warning',
});
return;
}
dialogappeal.value = true; //展开申诉弹窗
};
// 确定理赔金额
const DetermineClaims = val => {
ElMessageBox.confirm('是否确认理赔金额?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
console.log(val.row);
let data = {
id: val.row.lawoId,
workOrderStatus: 30,
};
details.loadingObj.list = true; //开启动画加载
pageLoad.value = true;
console.log(data, '处理好的值');
$_settlementUpdate(data)
.then(res => {
console.log(res);
if (res.data.code == 200) {
tabChenge(TabPermissions.value, {}, true);
}
})
.catch(res => {
details.loadingObj.list = false; //关闭动画加载
}).finally(()=>{
pageLoad.value = false;
});
})
.catch(() => {});
};
// 理赔金额未出编辑操作
const Resultediting = val => {
console.log(val.row, '参数');
// return
console.log(val.row, '理赔金额未出');
$router.push({
path: '/aftersales/aftersalesWorkOrderend',
query: {
id: val.row.lawoId,
subId: val.row.laprId,
name: val.row.workOrderNumber + '-处理结果编辑',
businessId: val.row.businessId,
warehouseId: val.row.warehouseId,
workOrderNumber: val.row.workOrderNumber,
workOrderStatus: val.row.workOrderStatus, //订单状态
RouteIndexs: TabPermissions.value, //当前记录参数
},
});
};
const ProcessedResultediting = val => {
console.log(val, '参数');
// return
$router.push({
path: '/aftersales/aftersalesWorkOrdermodify',
query: {
id: val.row.id,
subId: val.row.id,
name: val.row.workOrderNumber + '-处理结果编辑',
businessId: val.row.businessId,
warehouseId: val.row.warehouseId,
workOrderNumber: val.row.workOrderNumber,
RouterState: 'Kfend',
Processingresults: true, //处理结果编辑
Resultediting: true, //编辑理赔金额
workOrderStatus: val.row.workOrderStatus, //订单状态
RouteIndexs: TabPermissions.value, //当前记录参数
},
});
};
// 回复按钮
const MessageReply = val => {
$router.push({
path: '/aftersales/aftersalesWorkOrderend',
query: {
id: val.row.id,
name: val.row.workOrderNumber + '-消息回复',
businessId: val.row.businessId,
RouterState: 'determine',
workOrderStatus: val.row.workOrderStatus, //订单状态
RouteIndexs: TabPermissions.value, //当前记录参数
},
});
};
// 完结菜单的编辑
const CompletedEditing = val => {
console.log(val);
$router.push({
path: '/aftersales/aftersalesWorkOrdermodify',
query: {
id: val.row.workOrderId,
name: val.row.workOrderNumber + '-完结编辑',
businessId: val.row.businessId,
warehouseId: val.row.warehouseId,
workOrderNumber: val.row.workOrderNumber,
RouterState: 'Kfend',
CompletedEditing: 'true', //完结信息编辑
Appealeditor: 'appeal', //只是编辑完结
Processed: 'true',
index: '1',
},
});
};
// 工单申诉确认按钮
const Appealbutton = state => {
ElMessageBox.confirm('是否确认发起工单申诉?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
if (UserPermissions.value == '仓库客服') {
if (AppealAttachment.value.length > 1) {
ElMessage({
message: '只能上传一张图片',
type: 'warning',
});
return;
}
// appealData.value单条申诉点击变量暂未启用
console.log(details.selectionList, '当前申诉的东西');
loadingappeal.value = true; //开启加载效果
console.log(Appealselection.value, '当前选择的责任人');
console.log(warehouseData.value, '要循环处理的参数');
let data = {
peopleEntityList: [], //参数一
imagePath: '', //申诉图片附件
workOrderId: selectList.value[0], //工单ID
};
if (AppealeditorState.value) {
data.workOrderId = details.selectionList[0].workOrderId;
} else {
data.workOrderId = details.selectionList[0].id;
}
data.reason = Reasonforappeal.value;
data.appealPeopleName = warehouseData.value
.filter(item => Appealselection.value.includes(item.value))
.map(item => item.label)
.join(','); //实际责任人名称
//如果为编辑状态追加ID字段
console.log(AppealeditorState.value, '申诉状态');
if (AppealeditorState.value) {
data.id = details.selectionList[0].id;
}
console.log(details.selectionList, '准备处理的数据');
//处理数据
Appealselection.value.forEach(item => {
console.log(item, '循环的值');
data['peopleEntityList'].push({
workOrderId: details.selectionList[0].id, //异常工单ID
reason: Reasonforappeal.value, //申诉理由
claimant: userInfo.value.content.user_name, //申诉人
actualPersonId: warehouseData.value.find(res => res.value == item).value, //实际责任人ID
actualPersonName: warehouseData.value.find(res => res.value == item).label, //实际责任人名称
});
});
if (AppealAttachment.value.length) {
console.log(AppealAttachment.value, '图片');
if (AppealAttachment.value[0].response) {
data.imagePath = AppealAttachment.value[0].response.data.link; //申诉图片
} else {
data.imagePath = AppealAttachment.value[0].url; //申诉图片
}
}
console.log(data, '处理好的值');
$_appealSubmit(data)
.then(res => {
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
DataRendering(TabPermissions.value, details.query, true);
}
})
.finally(res => {
dialogappeal.value = false; //关闭申诉弹窗
loadingappeal.value = false; //关闭加载效果
console.log(res, '功返回值');
ProcessingPartyState.value = false; //关闭处理方
ArbitrationStatus.value = false; //不可以申请完结
AppealeditorState.value = false; //关闭编辑状态
appealData.value = {}; //清空当前行申诉数据
if (AppealStatusT.value) {
Tableheaderswitching(AppealList); //切换表头
appealFn(); // 获取申诉列表
} else {
data.workOrderStatus = 80;
details.query.workOrderStatus = 80;
tabValue.value = 6;
IndexTable({ workOrderStatus: 80 });
}
ElMessage({
message: res.data.msg,
type: 'success',
});
});
}
})
.catch(() => {});
};
/** 表格表头输入框搜索 */
const inputsc = async (index, row) => {
TabList.value.find(res => res.name == TabPermissions.value).request = true;
console.log('调用了表格输入参数');
processRowProperty(index, row, details);
details.query[row.prop] = index;
// tabChenge( TabPermissions.value,details.query)
await DataRendering(TabPermissions.value, details.query, true);
TabList.value.find(res => res.name == TabPermissions.value).request = false;
return;
// =======
// if (TimeoutStatus.value) {
// // 超时列表
// TimeoutHandling(details.query);
// return;
// }
// if (AppealStatus.value) {
// // 申诉列表
// appealFn(details.query);
// return;
// }
// if (ClaimStatus.value) {
// // 这是理赔搜索
// settlementclaim(details.query);
// return;
// }
// if (!ProcessingPartyState.value) {
// IndexTable(details.query); //首页初始化信息
// console.log('首页');
// } else {
// ProcessingPartyFun(details.query); //处理方信息
// console.log('处理方');
// }
};
// 网页顶部搜索按钮
const searchChange = () => {
DataRendering(TabPermissions.value, details.query, true);
return;
};
const emptyvalues = data => {
details.columnList.forEach(item => {
item.values = '';
});
};
// 清空头部搜索条件
const empty = () => {
// 清空搜索参数
for (let key in details.query) {
if (key !== 'workOrderStatus') {
delete details.query[key];
}
}
// let dataList = [columnList, recordList, Claimsfield, AppealList, timeoutList];
details.columnList.forEach(item => {
item.values = '';
});
};
const searchChangeS = () => {
console.log(details.columnList);
details.search = false; //关闭搜索
// tabValue.value = 0;
// IndexTable(); //首页初始化信息
tabChenge(TabPermissions.value, {}, true);
};
// 顶部搜索工单号事件
const WorkorderChange = val => {
console.log(val);
};
// 网页顶部清空按钮
const searchReset = () => {
details.query = {};
IndexTable(details.query, true);
details.search = false; //关闭搜索
};
/** 表格表头时间选择 */
const timesc = async (index, row) => {
TabList.value.find(res => res.name == TabPermissions.value).request = true;
processRowProperty(index, row, details);
details.query[row.prop] = index;
await DataRendering(TabPermissions.value, details.query, true);
TabList.value.find(res => res.name == TabPermissions.value).request = false;
return;
};
/** 表格表头输入框搜索 */
const btnsc = val => {
TabList.value.find(res => res.name == TabPermissions.value).request = true;
console.log(val);
};
/** 表格表头下拉框选择 */
const selectsc = async (index, row) => {
TabList.value.find(res => res.name == TabPermissions.value).request = true;
console.log(row, '下拉参数');
processRowProperty(index, row, details);
details.query[row.prop] = index;
await DataRendering(TabPermissions.value, details.query, true);
TabList.value.find(res => res.name == TabPermissions.value).request = false;
return;
};
// 反字典公共请求
const Antidictionary = (val, data) => {
getDictionaryBiz(val).then(res => {
res.data.data.forEach(item => {
data.checkarr.push({
value: item.dictValue,
label: item.dictValue,
});
});
});
};
/** 表格表头复选框选择 */
const selectionChange = list => {
// TabList.value.find(res=>res.name == TabPermissions.value).request=true
console.log(list, '当前选择的数据');
details.selectionList = list;
};
/** 页码改变执行的回调 */
const currentChange = async val => {
// let _row= TabList.value.find(res=>res.name==val)
// page.value.pageSize= _row.pageSize
// page.value.currentPage= _row.currentPage
TabList.value.find(res => res.name == TabPermissions.value).request = true;
let _row= TabList.value.find(res=>res.name==TabPermissions.value)
_row.currentPage = val
page.value.currentPage = val;
await DataRendering(TabPermissions.value, details.query, true);
TabList.value.find(res => res.name == TabPermissions.value).request = false;
return;
};
// 每页多少条
const sizeChange = async val => {
TabList.value.find(res => res.name == TabPermissions.value).request = true;
page.value.pageSize = val;
await DataRendering(TabPermissions.value, details.query, true);
TabList.value.find(res => res.name == TabPermissions.value).request = false;
return;
};
const changeProcessingResults = val => {
// 首先删除取消的项目
ProcessingList.value = ProcessingList.value.filter(item => val.includes(item.state - 1));
// 然后添加或保持新的项目
val.forEach(num => {
let newItem = { input: '', min: 0, max: 1000, state: num + 1 };
// 根据num为newItem的name字段赋值
switch (num) {
case '0':
newItem.name = '维修';
break;
case '1':
newItem.name = '补漆';
break;
case '2':
newItem.name = '下补单';
break;
case '3':
newItem.name = '赔付运费';
break;
case '4':
newItem.name = '用库存';
break;
case '5':
newItem.name = '赔商家';
break;
case '6':
newItem.name = '赔客户';
break;
default:
console.log('未知的编号:', num);
return; // 如果不是我们想处理的num,跳过之后的逻辑
}
// 如果列表中不存在则加入新项目
if (!ProcessingList.value.some(item => item.state === newItem.state)) {
ProcessingList.value.push(newItem);
console.log(`添加:${newItem.name}`);
}
});
};
// 查询理赔数据
const settlementclaim = (val, Refresh) => {
console.log(
!TabList.value.find(res => res.name == TabPermissions.value).request,
Refresh,
'Refresh'
);
if (!TabList.value.find(res => res.name == TabPermissions.value).request && !Refresh) {
details.data = TabList.value.find(res => res.name == TabPermissions.value).DataList;
page.value.total = TabList.value.find(res => res.name == TabPermissions.value).total;
return;
}
details.loadingObj.list = true; //开启动画加载
pageLoad.value = true;
console.log(Claimsfield, '理赔数据');
ClaimStatus.value = true; //开启理赔查询状态
AppealStatus.value = false; //关闭申诉状态
TimeoutStatus.value = false; //关闭 超时状态
details.columnList = Claimsfield;
Claimsfield[3].checkarr = []; //营业部
Claimsfield[7].checkarr = []; //异常类型名称
Claimsfield[9].checkarr = []; //发现环节
getDeptWarehouse({}).then(res => {
res.data.data.forEach(item => {
Claimsfield[3].checkarr.push({
value: item.name,
label: item.name,
});
});
});
getDictionaryBiz('pc_work_order').then(res => {
res.data.data.forEach(item => {
Claimsfield[7].checkarr.push({
value: item.dictValue,
label: item.dictValue,
});
});
});
getDictionaryBiz('pc_discovery_node').then(res => {
res.data.data.forEach(item => {
Claimsfield[9].checkarr.push({
value: item.dictValue,
label: item.dictValue,
});
});
});
// details.columnList warehouseData.value
console.log(details, 'details');
let data = {
current: details.page.currentPage,
size: details.page.pageSize,
...val,
};
console.log(data, '要传递的参数');
$_listSettlement(data)
.then(res => {
details.loadingObj.list = false; //关闭动画加载
pageLoad.value = false;
console.log(res, '查询理赔数据');
if (res.data.data) {
if (res.data.data.records.length) {
// details.data = res.data.data.records; //数据
TabList.value.find(res => res.name == TabPermissions.value).DataList =
res.data.data.records;
TabList.value.find(res => res.name == TabPermissions.value).total = res.data.data.total;
TabList.value.find(res => res.name == TabPermissions.value).request = false;
details.data = TabList.value.find(res => res.name == TabPermissions.value).DataList;
page.value.total = TabList.value.find(res => res.name == TabPermissions.value).total;
} else {
TabList.value.find(res => res.name == TabPermissions.value).DataList = [];
TabList.value.find(res => res.name == TabPermissions.value).total = 0;
TabList.value.find(res => res.name == TabPermissions.value).request = true;
details.data = res.data.data.records;
}
}
})
.catch(res => {
details.loadingObj.list = false; //关闭动画加载
pageLoad.value = false;
});
};
// 获取申诉列表
const appealFn = val => {
details.loadingObj.list = true; //开启动画加载
pageLoad.value = true;
AppealStatus.value = true; //开启申诉列表状态
TimeoutStatus.value = false; //关闭 超时状态
ClaimStatus.value = false; //关闭理赔查询状态
AppealList[5].checkarr = []; //异常类型名称
AppealList[6].checkarr = []; //发现环节
AppealList[7].checkarr = []; //发现环节
updateDictionary(AppealList[5].checkarr, 'pc_work_order'); //异常类型
updateDictionary(AppealList[6].checkarr, 'pc_discovery_node'); //发现环节
updateDictionary(AppealList[7].checkarr, 'work_order_status'); //发现环节
console.log('当前是申诉列表');
let data = {
current: details.page.currentPage,
size: details.page.pageSize,
identifying: UserPermissions.value != '仓库客服' ? '2' : '1',
...val,
};
$_listAppeal(data)
.then(res => {
details.loadingObj.list = false; //开启动画加载
pageLoad.value = false;
console.log(res, '申诉列表返回值');
if (res.data.data.records.length) {
// details.data = res.data.data.records;
TabList.value.find(res => res.name == TabPermissions.value).DataList =
res.data.data.records;
TabList.value.find(res => res.name == TabPermissions.value).total = res.data.data.total;
TabList.value.find(res => res.name == TabPermissions.value).request = false;
details.data = TabList.value.find(res => res.name == TabPermissions.value).DataList;
page.value.total = TabList.value.find(res => res.name == TabPermissions.value).total;
} else {
TabList.value.find(res => res.name == TabPermissions.value).DataList = [];
TabList.value.find(res => res.name == TabPermissions.value).total = 0;
TabList.value.find(res => res.name == TabPermissions.value).request = true;
details.data = res.data.data.records;
}
})
.catch(res => {
details.loadingObj.list = false; //关闭动画加载
pageLoad.value = false;
});
};
// 申诉列表
const AppealTab = async val => {
console.log(val, '完结当前列表');
arbitrationTemp.value = val;
if (val == 0) {
arbitrationTemp.value = 0;
AppealStatusT.value = false; //申诉列表关闭
console.log('处理完毕');
ProcessingPartyState.value = false; //关闭处理方
details.query.workOrderStatus = 80;
ArbitrationStatus.value = false; //不可以申请完结
// empty(); //清空搜索数据
let data = {
...details.query,
};
IndexTable(data, true);
Tableheaderswitching(columnList); //切换表头
} else {
arbitrationTemp.value = 1;
AppealListFn(); //申诉列表函数
}
AppealAttachment.value = []; //清空图片
Appealselection.value = ''; //清空责任人
Reasonforappeal.value = ''; //清空申诉内容
};
// 申诉列表公共函数
function AppealListFn(val) {
AppealStatusT.value = true; //申诉列表开启
console.log(AppealStatusT.value, 'AppealStatusT.value');
data.workOrderStatus = '';
console.log(data.workOrderStatus, '当前搜索状态');
Tableheaderswitching(AppealList); //切换表头
// AppealList.forEach(item => {
// //清空搜索记录
// item.values = '';
// });
appealFn(val); // 获取申诉列表
}
// 超时金额修改
const BtnModifyAmount = val => {
console.log(val, '超时金额修改');
dialogModifyAmount.value = true; //开启超时金额弹窗修改
fromamount.value.title = val.row.workOrderNumber; //工单号
fromamount.value.ytimeout = val.row.money; //原本金额
fromamount.value.id = val.row.id; //id
};
// 修改金额确定
const ModifyAmountFn = () => {
let data = {
id: fromamount.value.id,
money: fromamount.value.Amount,
};
console.log(data, '准备提交的金额参数');
$_moneyUpdate(data)
.then(res => {
TimeoutHandling();
console.log(res, '修改成功返回值');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
}
dialogModifyAmount.value = false; //关闭超时金额弹窗修改
})
.catch(res => {
dialogModifyAmount.value = false; //关闭超时金额弹窗修改
});
};
function getWinHight() {
var windowHight = 0;
if (document.body.clientHeight && document.documentElement.clientHeight) {
windowHight =
document.body.clientHeight < document.documentElement.clientHeight
? document.body.clientHeight
: document.documentElement.clientHeight;
}
return document.documentElement.clientHeight;
}
// const height = val => {
// console.log('执行了计算高度');
// var bodyContent = document.querySelectorAll('.maboxhi');
// const _height = getWinHight();
// // 设置列表的高度
// bodyContent.forEach(val => {
// val.style.height = _height - val.getBoundingClientRect().top - val + 'px';
// });
// };
// 查询超时记录
const TimeoutHandling = (val, Refresh) => {
console.log(
!TabList.value.find(res => res.name == TabPermissions.value).request,
Refresh,
'Refresh'
);
if (!TabList.value.find(res => res.name == TabPermissions.value).request && !Refresh) {
details.data = TabList.value.find(res => res.name == TabPermissions.value).DataList;
page.value.total = TabList.value.find(res => res.name == TabPermissions.value).total;
return;
}
timeoutList[3].checkarr = []; //异常类型名称
timeoutList[4].checkarr = []; //发现环节
ClaimStatus.value = false; //关闭理赔查询状态
AppealStatus.value = false; //关闭申诉状态
TimeoutStatus.value = true; //开启超时记录查询
details.loadingObj.list = true; //开启动画加载
pageLoad.value = true;
updateDictionary(timeoutList[3].checkarr, 'pc_work_order'); //异常类型
updateDictionary(timeoutList[4].checkarr, 'pc_discovery_node'); //发现环节
let data = {
current: details.page.currentPage,
size: details.page.pageSize,
...val,
};
$_listOwn(data)
.then(res => {
details.loadingObj.list = false; //关闭动画加载
pageLoad.value = false;
console.log(res, '超时记录');
if (res.data.data.records.length) {
Statusprocessing(res.data.data.records);
// details.data = res.data.data.records;
TabList.value.find(res => res.name == TabPermissions.value).DataList =
res.data.data.records;
TabList.value.find(res => res.name == TabPermissions.value).total = res.data.data.total;
TabList.value.find(res => res.name == TabPermissions.value).request = false;
page.value.total = TabList.value.find(res => res.name == TabPermissions.value).total;
details.data = TabList.value.find(res => res.name == TabPermissions.value).DataList;
} else {
TabList.value.find(res => res.name == TabPermissions.value).DataList = [];
TabList.value.find(res => res.name == TabPermissions.value).total = 0;
TabList.value.find(res => res.name == TabPermissions.value).request = true;
details.data = res.data.data.records;
}
})
.catch(res => {
details.loadingObj.list = false; //关闭动画加载
pageLoad.value = false;
});
};
// 数据渲染公共函数
const DataRendering = (val, input, Refresh) => {
// val:当前是在哪一个菜单下面
//input:当前传入的搜索参数
console.log(input, '接搜的搜索参数');
console.log('执行了公共函数');
if (val != 6) {
AppealStatusT.value = false; //申诉列表关闭
}
console.log(val, '触发了标签栏');
let data = {
...input, //搜索输入框
};
if (val == 0) {
ProcessingPartyState.value = false; //关闭处理方
ArbitrationStatus.value = true; //可以以申请完结
if (UserPermissions.value == '仓库客服') {
//全部
data.workOrderStatus = 1000;
details.query.workOrderStatus = 1000;
Tableheaderswitching(columnList);
IndexTable(data, Refresh);
} else {
data.workOrderStatus = null;
details.query.workOrderStatus = null;
Tableheaderswitching(columnList);
IndexTable(data, Refresh);
}
} else if (val == 1) {
// 处理中
if (UserPermissions.value == '仓库客服') {
data.workOrderStatus = 20;
details.query.workOrderStatus = 20;
} else {
data.workOrderStatus = 40;
details.query.workOrderStatus = 40;
}
ProcessingPartyState.value = false; //关闭处理方
ArbitrationStatus.value = true; //可以申请完结
Tableheaderswitching(columnList);
IndexTable(data, Refresh);
} else if (val == 2) {
//处理完毕
data.workOrderStatus = 30;
details.query.workOrderStatus = 30;
ProcessingPartyState.value = false; //关闭处理方
ArbitrationStatus.value = false; //不可以申请完结
Tableheaderswitching(columnList);
IndexTable(data, Refresh);
} else if (val == 3) {
// 待处理
ProcessingPartyState.value = true; //开启处理方
// if (UserPermissions.value == '总部客服') {
// data.workOrderStatus = 500;
// details.query.workOrderStatus = 500;
// } else {
// data.workOrderStatus = 10;
// details.query.workOrderStatus = 10;
// }
data.workOrderStatus = 10;
details.query.workOrderStatus = 10;
ArbitrationStatus.value = true; //可以申请完结
Tableheaderswitching(columnList);
IndexTable(data, Refresh);
} else if (val == 4) {
// 理赔金额未出
ProcessingPartyState.value = false; //关闭处理方
details.query.workOrderStatus = null;
ArbitrationStatus.value = false; //不可以申请完结
Tableheaderswitching(Claimsfield); //切换表格
settlementclaim(data, Refresh);
} else if (val == 5) {
// 客服介入
ProcessingPartyState.value = false; //关闭处理方
data.workOrderStatus = 70;
details.query.workOrderStatus = 70;
ArbitrationStatus.value = false; //不可以申请完结
IndexTable(data, Refresh);
} else if (val == 6 && arbitrationTemp.value == 1) {
// 申诉列表
console.log('申诉列表');
data.workOrderStatus = null;
details.query.workOrderStatus = null;
AppealListFn(data, Refresh); //申诉列表函数
Tableheaderswitching(AppealList); //切换表头
} else if (val == 6) {
console.log(arbitrationTemp.value, 'arbitrationTemp.value');
console.log(AppealStatusT.value, 'AppealStatusT.value');
// 完结
ProcessingPartyState.value = false; //关闭处理方
data.workOrderStatus = 80;
details.query.workOrderStatus = 80;
ArbitrationStatus.value = false; //不可以申请完结
// arbitrationTemp.value = 1;
IndexTable(data, Refresh);
Tableheaderswitching(columnList); //表头切换
var bodyContent = document.querySelectorAll('.maboxhi');
const _height = getWinHight();
// 设置列表的高度
bodyContent.forEach(val => {
val.style.height = _height - val.getBoundingClientRect().top - (65 + 20) + 'px';
});
} else if (val == 7) {
// 超时未处理
ProcessingPartyState.value = false; //关闭处理方
data.workOrderStatus = null;
details.query.workOrderStatus = null;
ArbitrationStatus.value = false; //不可以申请完结
Tableheaderswitching(timeoutList); //表头切换
TimeoutHandling(data, Refresh); //调用超时未出理
} else if (val == 8) {
// 待回复按钮
if (UserPermissions.value == '仓库客服') {
// 不是仓库客服看不见待回复按钮
data.workOrderStatus = null;
details.query.workOrderStatus = null;
Tableheaderswitching(columnList);
ProcessingPartyFun(data, Refresh);
}
} else if (val == 9) {
// 待审核
ProcessingPartyState.value = true; //开启处理方
if (UserPermissions.value == '总部客服经理') {
data.workOrderStatus = 500;
details.query.workOrderStatus = 500;
}
ArbitrationStatus.value = true; //可以申请完结
Tableheaderswitching(columnList);
IndexTable(data, Refresh);
}
console.log('执行完毕');
};
// 标签栏触发
const tabChenge = async (val, input, Refresh = false) => {
console.log(TabList.value, 'TabList.value');
console.log(val, 'val');
let _row= TabList.value.find(res=>res.name==val)
page.value.pageSize= _row.pageSize
page.value.currentPage= _row.currentPage
page.value.total= _row.total
console.log(_row,'当前点击的菜单');
TabPermissions.value = val; //记录当前点击的菜单
if (val != 6) {
// AppealStatusT.value = false; //申诉列表关闭
}
console.log(val, '触发了标签栏');
let data = {
...input, //搜索输入框
};
await empty();
DataRendering(TabPermissions.value, input, Refresh);
return;
};
/** 展开列表控件 */
const showdrawer = _flag => {
details.drawerShow = _flag;
};
// 待回复处理方数据公共函数
const ProcessingPartyFun = (val, Refresh) => {
console.log(
TabList.value.find(res => res.name == TabPermissions.value).request,
Refresh,
'待回复'
);
if (!TabList.value.find(res => res.name == TabPermissions.value).request && !Refresh) {
details.data = TabList.value.find(res => res.name == TabPermissions.value).DataList;
page.value.total = TabList.value.find(res => res.name == TabPermissions.value).total;
return;
}
console.log('触发了待回复');
ClaimStatus.value = false; //关闭理赔状态
TimeoutStatus.value = false; //关闭超时
AppealStatus.value = false; //关闭申诉状态
// details.query.workOrderStatus = null;
details.loadingObj.list = true; //开启动画加载
pageLoad.value = true;
let data = {
...val,
};
console.log(val, 'val接收的参数');
columnList[2].checkarr = []; //重置下拉搜索框
columnList[3].checkarr = [];
data.current = page.value.currentPage; //页码
data.size = page.value.pageSize; //条数
updateDictionary(columnList[2].checkarr, 'pc_work_order'); //异常类型
updateDictionary(columnList[3].checkarr, 'pc_discovery_node'); //发现环节
$_getProcessor(data)
.then(res => {
details.loadingObj.list = false; //关闭动画加载
pageLoad.value = false;
// page.value.total = res.data.data.total; //总页数
if (res.data.data.records.length) {
Statusprocessing(res.data.data.records);
TabList.value.find(res => res.name == TabPermissions.value).DataList =
res.data.data.records;
TabList.value.find(res => res.name == TabPermissions.value).total = res.data.data.total;
TabList.value.find(res => res.name == TabPermissions.value).request = false;
console.log(
TabList.value.find(res => res.name == TabPermissions.value).request,
'待回复当前状态'
);
page.value.total = TabList.value.find(res => res.name == TabPermissions.value).total;
// details.data = res.data.data.records;
details.data = TabList.value.find(res => res.name == TabPermissions.value).DataList;
console.log(details.data, '存储的数据');
} else {
TabList.value.find(res => res.name == TabPermissions.value).DataList = [];
TabList.value.find(res => res.name == TabPermissions.value).total = 0;
TabList.value.find(res => res.name == TabPermissions.value).request = true;
details.data = res.data.data.record;
}
loading.value = false; //关闭加载效果
})
.catch(res => {
loading.value = false; //关闭加载效果
});
};
// 获取聊天记录
const FKList = () => {
iconState.value = true;
let data = { workOrderId: ListRow.value.id };
$_getExchangeList(data).then(res => {
iconState.value = false;
console.log(res, '查询的值');
ChatHistory.value = res.data.data;
setTimeout(() => {
const container = scrollContainer.value;
if (container) {
container.scrollTop = container.scrollHeight;
}
}, 0);
});
};
// 点击回复按钮
const reply = val => {
$router.push({
path: '/aftersales/customerService',
query: {
row: JSON.stringify(val.row),
},
});
return;
};
// 处理方数据
const ProcessingParty = () => {
ProcessingPartyState.value = true; //开启处理方
ProcessingPartyFun({}, true);
};
// 消息发送函数
const messagesendFn = () => {
iconState.value = true;
let data = {
workOrderId: ListRow.value.id,
businessName: Mydata.value.departmentName,
businessId: Mydata.value.id,
content: KFinput.value,
warehouseId: ListRow.value.warehouseId,
annex: KFfeel.value,
};
console.log(data, '处理好的数据');
$_AddReply(data).then(res => {
// 获取当前时间
const currentTime = new Date();
// 获取年、月、日、小时、分钟、秒
const year = String(currentTime.getFullYear());
const month = String(currentTime.getMonth() + 1).padStart(2, '0');
const day = String(currentTime.getDate()).padStart(2, '0');
const hours = String(currentTime.getHours()).padStart(2, '0');
const minutes = String(currentTime.getMinutes()).padStart(2, '0');
const seconds = String(currentTime.getSeconds()).padStart(2, '0');
// 拼接时间字符串
const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
console.log(res, '添加成功');
if (res.data.code == 200) {
// 添加成功
iconState.value = false;
ChatHistory.value.push({
businessId: Mydata.value.id,
businessName: Mydata.value.departmentName,
content: KFinput.value,
createTime: formattedTime,
});
// 滚动到最后
setTimeout(() => {
const container = scrollContainer.value;
if (container) {
container.scrollTop = container.scrollHeight;
}
}, 0);
KFinput.value = ''; //清空内容
KFfeel.value = null; //清空文件
}
});
console.log(Mydata.value, '参数');
};
// 发送按钮
const messagesend = () => {
messagesendFn();
};
// 客服刷新按钮
const KFRefresh = () => {
FKList();
};
// 输入框回车
const inputEnter = () => {
messagesendFn();
};
// 图片上传必须携带TOKEN
const headers = computed(() => {
return { 'Blade-Auth': 'Bearer ' + getToken() };
});
// 图片上传接口
const doubledCount = computed(() => {
return '/api/blade-resource/oss/endpoint/put-file';
});
// 附件上传成功
const fellSuccess = (response, uploadFile) => {
console.log('上船成功');
console.log(response, uploadFile);
if (response.data.link) {
KFfeel.value = response.data.link;
}
};
//批量审核(由客服经理批量审核确定)
const DetermineStorage = val => {
if (!details.selectionList.length) {
ElMessage({
message: '请勾选数据',
type: 'warning',
});
return;
}
ElMessageBox.confirm('是否确定确定批量审核?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
let data = {
assignList: [],
};
data['assignList'] = details.selectionList.map(item => item.id);
details.loadingObj.list = true; //开启加载效果
pageLoad.value = true;
// 完结结果确定
console.log(data, '处理好的值');
$_updateManagerConfirmed(data)
.then(res => {
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
}
console.log(res, '处理完毕确定');
tabChenge(TabPermissions.value, {}, true);
})
.catch(res => {
console.log(res, '错误信息');
})
.finally(res => {
details.loadingObj.list = false; //关闭加载效果
pageLoad.value = false;
});
})
.catch(() => {});
};
// 完结里面确定按钮
const EndArbitration = val => {
console.log(val, '当前参数');
let data = {
assignList: [val.row.id],
};
details.loadingObj.list = true; //开启加载效果
pageLoad.value = true;
$_updateArbitrateStatu(data)
.then(res => {
console.log(res, '处理成功');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
DataRendering(TabPermissions.value, details.query, true);
}
})
.catch(res => {
console.log(res, '报错原因');
})
.finally(() => {
details.loadingObj.list = false; //开启加载效果
pageLoad.value = false;
});
};
// 批量完结确定
const AllEndArbitration = () => {
// 校验是否勾选了数据
if (!details.selectionList.length) {
ElMessage({
message: '请勾选要处理的数据数据',
type: 'warning',
});
return;
}
let data = {
assignList: [],
};
data['assignList'] = details.selectionList.map(res => res.id); //获取批量完结的ID
console.log('批量完结确定处理好的值');
$_updateArbitrateStatu(data)
.then(res => {
console.log(res, '处理成功');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
DataRendering(TabPermissions.value, details.query, true);
}
})
.catch(res => {
console.log(res, '报错原因');
})
.finally(() => {
details.selectionList = []; //清空勾选数据
details.loadingObj.list = false; //开启加载效果
pageLoad.value = false;
});
};
// 处理完毕里面确定(仓库客服用的)
const ResultConfirmation = val => {
if (UserPermissions.value == '仓库客服') {
console.log('仓库客服');
//处理完毕菜单下面确定按钮用于确定处理结果(仓库客服用的)
let data = {
assignList: [],
};
let ConfirmStatus = false; //批量确认状态
if (!val.row) {
// 说明点击的批量确定
console.log('当前点击的批量确定');
if (!details.selectionList.length) {
ElMessage({
message: '请勾选要处理的数据数据',
type: 'warning',
});
return;
} else {
ConfirmStatus = true; //说明走的是批量
data['assignList'] = details.selectionList.map(item => item.id);
console.log(data['assignList'], '批量确定处理好的参数');
}
} else {
let ID = {};
ID = val.row.id;
data['assignList'].push(ID);
}
// 仓库客服
if (ConfirmStatus) {
// 走的批量确认
let state = details.selectionList.every(item => item.workOrderStatus == '21');
console.log(state, 'state');
if (!state) {
ElMessage({
message: '勾选单子中有已经确认的请取消勾选!',
type: 'warning',
});
return;
}
} else {
if (val.workOrderStatus == '30') {
ElMessage({
message: '状态错误,已经确认过',
type: 'warning',
});
return;
}
}
ElMessageBox.confirm('是否确定当前处理结果?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
details.loadingObj.list = true; //开启加载效果
pageLoad.value = true;
console.log(data, '处理好的数据');
$_updateWorkOrderStatus(data)
.then(res => {
console.log(res, '确定提交存储');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
}
tabChenge(TabPermissions.value, {}, true);
})
.catch(res => {
console.log(res, '错误信息');
})
.finally(() => {
details.loadingObj.list = false; //关闭加载效果
pageLoad.value = false;
});
})
.catch(() => {
ElMessage({
type: 'info',
message: '取消确定',
});
});
} else {
let data = {
assignList: [],
};
let ConfirmStatus = false; //批量确认状态
if (!val.row) {
// 说明点击的批量确定
console.log('当前点击的批量确定');
if (!details.selectionList.length) {
ElMessage({
message: '请勾选要处理的数据数据',
type: 'warning',
});
return;
} else {
ConfirmStatus = true; //说明走的是批量
data['assignList'] = details.selectionList.map(item => item.id);
console.log(data['assignList'], '批量确定处理好的参数');
}
} else {
let ID = {};
ID = val.row.id;
data['assignList'].push(ID);
}
if (ConfirmStatus) {
// 走的批量确认
let state = details.selectionList.every(item => item.workOrderStatus == '40');
if (!state) {
ElMessage({
message: '批量确认中状态只能为待审核',
type: 'warning',
});
return;
}
} else {
if (val.workOrderStatus != '40') {
ElMessage({
message: '状态错误,已经确认过',
type: 'warning',
});
return;
}
}
ElMessageBox.confirm('是否确定当前处理信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
details.loadingObj.list = true; //开启加载效果
pageLoad.value = true;
// 完结结果确定
$_updateManagerConfirmed(data)
.then(res => {
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
}
console.log(res, '处理完毕确定');
tabChenge(TabPermissions.value, {}, true);
})
.catch(res => {
console.log(res, '错误信息');
})
.finally(res => {
details.loadingObj.list = false; //关闭加载效果
pageLoad.value = false;
});
// 赔款方
console.log(data, '处理好的值');
})
.catch(() => {
ElMessage({
type: 'info',
message: '已取消',
});
});
}
};
// 审核确定
const findingAudit = () => {};
// 批量打回
const BatchReturn = () => {
BatchFrom.value.businessDepartment = [];
BatchFrom.value.txt = null;
if (!details.selectionList.length) {
ElMessage({
message: '请勾选要打回的数据',
type: 'warning',
});
return;
}
dialogReturn.value = true;
console.log(details.selectionList, '选中的参数');
};
// 批量打回确定按钮
const ConfirmReturn = () => {
repulse.value = true; //开启加载并关闭按钮
let data = {
processorList: [],
};
// 过滤满足条件的对象
if (BatchFrom.value.businessDepartment.length) {
let foundObjs = warehouseData.value.filter(obj =>
BatchFrom.value.businessDepartment.includes(obj.value)
);
data['businessId'] = foundObjs.map(item => item.value).join(',');
data['businessName'] = foundObjs.map(item => item.label).join(',');
// 营业部处理
foundObjs.forEach(item => {
data['processorList'].push({ id: item.value, name: item.label });
});
}
data.reasonReturn = BatchFrom.value.txt; //打回原因
// data.warehouseId = details.selectionList.map(item=>item.warehouseId); //仓库ID
data.workOrderIds = details.selectionList.map(item => item.id); //异常工单ID
console.log(data, '处理好的值');
data.typesOf = '1'; //普通打回
$_batchReturn(data)
.then(res => {
repulse.value = false; //关闭加载并关闭按钮
dialogReturn.value = false; //关闭打回弹窗
IndexTable(); //首页初始化信息
console.log(res, '批量打回返回值');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
DataRendering(TabPermissions.value, details.query, true);
}
})
.catch(error => {
repulse.value = false; //关闭加载并关闭按钮
dialogReturn.value = false; //关闭打回弹窗
});
};
// 工单指派
const assign = () => {
if (!details.selectionList.length) {
ElMessage({
message: '请勾选工单数据',
type: 'warning',
});
return;
}
$_getCustomerServicePersonnel({})
.then(res => {
console.log(res, '客服列表');
customerService.value = res.data.data;
})
.catch(error => {
console.log(error, '客服列表错误');
});
assignFrom.value = {}; //清空内容
dialogassign.value = true; //开启指派工单弹窗
};
// 工单指派确定按钮
const Assignbutton = () => {
AssignLoad.value = true; //开启加载和按钮禁止重复点击
let foundObjs = customerService.value.find(obj => obj.id == assignFrom.value.businessDepartment); //筛选选择的工单
let data = {
assignList: [],
};
data.customerServiceId = foundObjs.id; //归属客服ID
data.customerServiceName = foundObjs.realName; //归属客服名称
data['assignList'] = details.selectionList.map(item => item.id); //异常工单ID//工单ID
console.log(data, '处理好的值');
$_assignCustomerService(data)
.then(res => {
AssignLoad.value = false; //关闭加载和按钮禁止重复点击
dialogassign.value = false; //关闭指派工单弹窗
console.log(res, '工单指派返回');
tabChenge(TabPermissions.value);
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
}
})
.catch(error => {
AssignLoad.value = false; //关闭加载和按钮禁止重复点击
dialogassign.value = false; //关闭指派工单弹窗
});
};
// 客服介入(申请完结)
const arbitrate = () => {
if (!details.selectionList.length) {
console.log('当前没有数据');
ElMessage({
message: '请勾要完结的数据',
type: 'warning',
});
return;
}
let resultState = details.selectionList.every(
item => item.workOrderStatus == '10' || item.workOrderStatus == '20'
); //判断勾选中的数据是否存在不符合条件的
if (!resultState) {
ElMessage({
message: '勾选数据不符合(待处理或处理中才可以申请完结)',
type: 'warning',
});
return;
}
dialogCustomer.value = true; //开启客服介入弹窗
};
const CustomerServiceintervention = () => {
// 处理中,待处理可申请
let data = {
assignList: [],
reasonRemarks: CustomerServiceForm.value.reasonRemarks, //客服介入原因
};
details.selectionList.forEach(item => {
data['assignList'].push(item.id);
});
console.log(data, '完结处理好的参数');
loadingCustomer.value = true; //开启加载
// 发送请求
$_arbitrate(data)
.then(res => {
console.log(res, '完结成功返回值');
// PagerefreshPublic();
DataRendering(TabPermissions.value, details.query, true);
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
}
})
.finally(() => {
dialogCustomer.value = false; //关闭弹窗
loadingCustomer.value = false; //关闭加载
});
};
// 钉钉号填写
const DingTalk = () => {
if (!details.selectionList.length) {
ElMessage({
message: '请勾选数据',
type: 'warning',
});
return;
}
dialogDingTalk.value = true; //开启钉钉号填写弹窗
};
// 钉钉号确认提交
const DingTalkSubmit = () => {
let data = {
assignList: [],
};
data.processNumber = DingTalkfilling.value.processNumber; //钉钉号
data.reviewedBy = DingTalkfilling.value.reviewedBy; //审核人
data.auditTime = DingTalkfilling.value.auditTime; //审核时间
// data.entryTime = DingTalkfilling.value.entryTime; //财务入账时间
data['assignList'] = details.selectionList.map(res => res.id); //ID
console.log(data, '处理好的值');
$_updateWorkList(data).then(res => {
console.log(res, '钉钉流程号填写');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
dialogDingTalk.value = false; //关闭钉钉号填写弹窗
DataRendering(TabPermissions.value, details.query, true);
}
});
};
// 页面刷新公共函数
const PagerefreshPublic = () => {
console.log('执行了页面刷新公共函数');
if (ProcessingPartyState.value && ArbitrationStatus.value) {
ProcessingPartyFun({}, true);
} else {
IndexTable(); //刷新页面
}
};
// 添加赔款方
const AddCompensation = () => {
console.log('添加赔款方');
let som = 1;
CompensationParty.value.forEach(item => {
if (item.state == 0) {
som++;
}
});
CompensationParty.value.push({
name: '',
state: 0,
num: 0,
reason: '',
cld: som,
warehouseId: '',
personResponsibleName: '',
});
};
// 添加受款方
const AddPayee = () => {
let som = 1;
CompensationParty.value.forEach(item => {
if (item.state == 1) {
som++;
}
});
CompensationParty.value.push({ name: '', state: 1, num: 0, reason: '', cld: som });
};
// 移除按钮
const payremove = (state, val) => {
// 判断赔付方,至少保留一条数据
let som = 0;
if (state == 0) {
CompensationParty.value.forEach(item => {
if (item.state == 0) {
som++;
}
});
if (som == 1) {
ElMessage({
message: '赔款必填最少一条',
type: 'warning',
});
return;
}
}
CompensationParty.value.splice(val, 1);
console.log('CompensationParty :>> ', CompensationParty);
amountMoney();
};
// 金额输入汇总
const amountMoney = () => {
// 计算赔款金额总数
TotalamountCompensation.value = 0;
TotalamountReceived.value = 0;
CompensationParty.value.forEach(item => {
const _num = isNumber(item.num) ? item.num : 0;
// 统计赔款方【0】
if (item.state == 0) {
TotalamountCompensation.value = computeNumber(
TotalamountCompensation.value,
'+',
_num
).result;
}
// 统计受款方金额【1】
if (item.state == 1) {
TotalamountReceived.value = computeNumber(TotalamountReceived.value, '+', _num).result;
}
});
console.log('赔款总计金额', TotalamountCompensation.value);
console.log('收款总计金额', TotalamountReceived.value);
};
// 财务入账按钮
const Financialfillingbtn = () => {
if (!details.selectionList.length) {
ElMessage({
message: '请勾选数据',
type: 'warning',
});
return;
}
FinancialFrom.value = {};
dialogFinancialaccounting.value = true; //开启财务入账弹窗
};
// 财务入账确定按钮
const Financialfilling = () => {
let data = {
ids: '',
...FinancialFrom.value,
};
if (details.selectionList.length) {
data.ids = details.selectionList.map(item => item.id).join(',');
loadingFinancial.value = true; //开启加载
$_updateFinanceTime(data)
.then(res => {
console.log(res, '财务入账填写成功');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
dialogFinancialaccounting.value = false; //关闭财务入账弹窗
DataRendering(TabPermissions.value, details.query, true);
}
// AppealListFn();
})
.catch(res => {
console.log(res, '财务入账成功返回值');
})
.finally(() => {
loadingFinancial.value = false; //关闭加载
});
}
};
// 批量完结
const Batchcompletion = () => {
console.log(details.selectionList);
// 完结的逻辑
if (!details.selectionList.length) {
ElMessage({
message: '请先勾选要处理的数据',
type: 'warning',
});
return;
}
dialogBatchcompletion.value = true; //开启批量完结弹窗
};
// 批量提交
const CompletedSubmission = () => {
PLloading.value = true; //开启处理加载效果
console.log(CompensationParty.value);
let pay = CompensationParty.value.find(item => item.cld == 1);
console.log(pay);
// if (!pay.name || pay.num == null || !pay.reason) {
// ElMessage({
// message: '请填写赔款方完整信息',
// type: 'warning',
// });
// return;
// }
if (!Reasonarbitration.value) {
ElMessage({
message: '请填写完结原因',
type: 'warning',
});
return;
}
console.log(CompensationParty.value, 'CompensationParty赔款列表');
console.log(details.selectionList, '选中的参数');
// 初始化data数组,其结构对应于details.selectionList的长度
let data = details.selectionList.map(() => ({
id: details.selectionList[0].id,
reasonArbitration: Reasonarbitration.value,
completionRecipientEntities: [],
completionRecordEntities: [],
}));
console.log(data, '初始值');
// 填充data数组
details.selectionList.forEach((selection, index) => {
CompensationParty.value.forEach(party => {
// 根据state值创建不同类型的对象填充到相应的数组中
if (party.state === 0) {
// 赔款方信息对象
const record = {
indemnitor: party.name,
reason: party.reason,
money: Number(party.num),
reasonArbitration: Reasonarbitration.value,
warehouseId: party.warehouseId, //仓库
compensationPersonnel: party.personResponsibleName, //责任人
workOrderId: selection.id, //工单id
};
// 将赔款方信息添加到对应的completionRecordEntities数组中
data[index].completionRecordEntities.push(record);
} else {
// 受款方信息对象
const recipient = {
recipient: party.name,
reasonReceivingPayment: party.reason,
money: Number(party.num),
responsibleParty: '', //
workOrderNumber: selection.workOrderNumber,
workOrderId: selection.id, //工单id
// warehouseId: selection.warehouseId,(修改过)
warehouseId: party.warehouseId, //仓库
};
// 将受款方信息添加到对应的completionRecipientEntities数组中
data[index].completionRecipientEntities.push(recipient);
}
});
});
// 赔款方
console.log(data, '处理好的值');
$_addCompletionEnd(data).then(res => {
DataRendering(TabPermissions.value, details.query, true);
PLloading.value = false; //关闭处理加载效果
dialogBatchcompletion.value = false; //关闭弹窗
console.log(res, '完结成功返回值');
if (res.data.code) {
ElMessage({
message: res.data.msg,
type: 'success',
});
}
});
};
// 批量删除申诉
const Batchdeletionappeals = () => {
if (!details.selectionList.length) {
ElMessage({
message: '请勾选选择要删除的数据',
type: 'warning',
});
return;
}
let ids = '';
if (details.selectionList.length) {
ids = details.selectionList.map(item => item.id).join(',');
$_getDetails({
ids: ids,
})
.then(res => {
console.log(res, '删除成功返回值');
if (res.data.code == 200) {
ElMessage({
message: '删除成功',
type: 'success',
});
}
AppealListFn();
})
.catch(res => {
console.log(res, '删除失败返回值');
});
}
};
// 删除申诉
const Deleteappeal = val => {
let id = val.row.id;
$_getDetails({ ids: id })
.then(res => {
if (res.data.code == 200) {
ElMessage({
message: '删除成功',
type: 'success',
});
}
AppealListFn();
})
.catch(res => {
console.log(res, '删除失败返回值');
});
};
// 导出报表
const exportReport = () => {
ElMessageBox.confirm('是否导出报表?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
let dataID = {
workOrderStatus: details.query.workOrderStatus,
};
if (details.selectionList.length) {
dataID.ids = details.selectionList.map(item => item.id).join(',');
}
pageLoad.value = true;
$_exportAftersalesWorkOrder(dataID)
.then(res => {
const currentDate = new Date();
const formattedDate = `${currentDate.getFullYear()}${(currentDate.getMonth() + 1)
.toString()
.padStart(2, '0')}${currentDate.getDate().toString().padStart(2, '0')}${currentDate
.getHours()
.toString()
.padStart(2, '0')}${currentDate.getMinutes().toString().padStart(2, '0')}${currentDate
.getSeconds()
.toString()
.padStart(2, '0')}`;
console.log(res, '导出');
downloadXls(res.data, `导出工单数据${formattedDate}.xlsx`);
})
.catch(e => {
console.log(e, 'error');
})
.finally(() => {
pageLoad.value = false;
});
})
.catch(() => {});
};
// 超时导出
const TimedoutExport = () => {
ElMessageBox.confirm('是否导出超时报表?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
let data = {};
if (details.selectionList.length) {
data.ids = details.selectionList.map(item => item.id).join(',');
}
$_exportaftersalesOvertimeFine(data).then(res => {
downloadXls(res.data, `超时导出数据.xlsx`);
});
})
.catch(() => {});
};
// 默认指派
const defaultAssignments = () => {
CustomerServicea.value = true; //开启弹窗
let data = {
current: assigncurrentPage.value,
size: assignpageSize.value,
typesOf: AssignmentType.value,
};
CustomerLoad.value = true; //开启加载
$_aftersalesCustomerMall(data)
.then(res => {
console.log(res, '获取成功值');
CustomerData.value = res.data.data.records;
CustomerTotal.value = res.data.data.total;
})
.catch(res => {})
.finally(res => {
CustomerLoad.value = false; //关闭加载
});
};
// 商场指派每一页多少个条
const assignsizeChange = val => {
console.log('123');
(assignpageSize.value = val), defaultAssignments();
};
// 点击多少页
const assigncurrentChange = val => {
assigncurrentPage.value = val;
defaultAssignments();
};
// 解绑客服默认指派
const Unbindassignment = val => {
// let data=
ElMessageBox.confirm('是否确定解绑?', 'Warning', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
console.log(val, '解绑指派');
let data = {
ids: val.row.id,
};
CustomerLoad.value = true; //开启加载
$_aftersalesCustomerMallremove(data).then(res => {
console.log(res, '解绑成功');
if (res.data.code == 200) {
ElMessage({
type: 'success',
message: '解绑成功',
});
defaultAssignments();
}
});
})
.catch(() => {})
.finally(res => {
CustomerLoad.value = false; //开启加载
});
};
// 设为默认
const setAsdefault = val => {
let data = {};
data = val.row;
CreateassignmentLoading.value = true; //开启加载
$_aftersalesCustomerMallsetDefault(data)
.then(res => {
console.log(res, '设为默认');
if (res.data.code == 200) {
defaultAssignments();
}
})
.catch(res => {})
.finally(() => {
CreateassignmentLoading.value = false; //关闭加载
});
};
// 指派新增
const CreateAdditions = () => {
if (AssignmentType.value == '2') {
$_basicdataTripartiteMall({}).then(res => {
console.log(res, '商场指派列表');
if (res.data.data) {
Malldropdown.value = res.data.data;
}
});
}
Createassignment.value = true; //开启弹窗
$_getCustomerServicePersonnel({})
.then(res => {
console.log(res, '客服列表');
AssignCustomerservice.value = res.data.data;
})
.catch(error => {
console.log(error, '客服列表错误');
});
};
// 指派切换
const AssignSwitch = val => {
console.log(val);
if (val.props.name == '0') {
// 总部指派
AssignmentType.value = '1';
} else if (val.props.name == '1') {
// 商场指派
AssignmentType.value = '2';
}
defaultAssignments();
};
// 指派提交
const AssignSubmission = () => {
let data = {
aftersalesCustomerMallEntities: [],
};
AssignCustomerlist.value.forEach(res => {
data['aftersalesCustomerMallEntities'].push({
customerServiceId: AssignCustomerservice.value.find(data => data.id == res).id, //仓库客服名称ID
customerServiceName: AssignCustomerservice.value.find(data => data.id == res).realName, //客服名称
clientId: BatchFrom.value.AssignWarehouse, //客服仓库ID
clientName:
AssignmentType.value == '1'
? warehouseData.value.find(res => res.value == BatchFrom.value.AssignWarehouse).label
: Malldropdown.value.find(res => res.id == BatchFrom.value.AssignWarehouse)
.tripartiteMall, //客服绑定仓库
typesOf: AssignmentType.value,
conditions: '2',
});
});
CreateassignmentLoading.value = true; //开启加载
$_aftersalesCustomerMallsave(data)
.then(res => {
console.log(res, '指派成功');
if (res.data.code == 200) {
ElMessageBox.confirm('提交成功是否关闭?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
Createassignment.value = false; //关闭页面
AssignCustomerlist.value = []; //清空选中列表
BatchFrom.value.AssignWarehouse = ''; //清空选择
defaultAssignments();
})
.catch(() => {});
}
})
.catch(res => {})
.finally(() => {
CreateassignmentLoading.value = false; //关闭加载
});
console.log(data, '处理好的值');
};
</script>
<style scoped lang="scss">
.el-card {
height: 100%;
:deep(.el-card__body) {
height: 100%;
display: flex;
flex-direction: column;
}
}
.page {
height: 30px;
flex: 1;
display: flex;
align-items: flex-end;
padding-bottom: 14px;
justify-content: flex-end;
}
:deep(.el-Cart-button) {
margin-bottom: 8px;
display: flex;
justify-content: space-between;
}
.el-Cart-button-right {
display: flex;
margin: 0 0px;
justify-content: space-between;
}
.el-Cart-button-right {
display: flex;
margin: 0 0px;
justify-content: space-between;
align-items: center;
button {
background-color: transparent;
border-radius: 50%;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #ccc;
margin-right: 8px;
&:hover {
background-color: #172e601f;
i {
color: #0e2549;
}
}
// 去掉最后一个按钮右侧边距
&:last-child {
margin-right: 0;
}
}
}
.IndexFrom {
display: flex;
flex-wrap: wrap;
.el-form-item {
margin: 10px;
width: 31%;
height: 46px;
display: flex;
align-items: center;
}
.el-form-item__content {
.el-input {
height: 36px;
width: 206px;
}
}
.el-input__wrapper {
height: 32px !important;
}
:deep(.el-input) {
width: 100% !important;
}
:deep(.el-input__wrapper) {
height: 30px !important;
}
:deep(.el-select) {
width: 100%;
}
}
.Transport_damage_photos {
padding: 6px;
.title {
font-size: 14px;
margin-bottom: 9px;
display: block;
}
}
.endClass {
display: flex;
flex-wrap: wrap;
align-items: center;
.el-form-item {
margin: 6px;
width: 32%;
}
.el-select {
width: 100%;
}
:deep(.el-input) {
width: 100%;
}
:deep(.el-input__wrapper) {
height: 26px;
}
.Transport_damage_photos {
.title {
font-size: 14px;
}
}
}
.ProcessingResults {
width: 100%;
height: 260px;
border: 1px solid #ccc;
position: relative;
padding: 26px;
box-sizing: border-box;
margin-top: 20px;
.title {
position: absolute;
top: -20px;
left: 20px;
font-size: 26px;
background-color: #fff;
}
}
.selector {
display: flex;
width: 100%;
padding: 16px;
padding-left: 6px;
.title {
width: 108px;
}
}
.Listadmiration {
display: flex;
flex-wrap: wrap;
.name {
display: flex;
margin: 10px 5%;
span {
display: block;
width: 90px;
}
}
}
.ElBtnClass {
button {
border: none;
padding: 0;
background-color: transparent;
}
button:hover {
background-color: transparent;
}
}
:deep(.el-card) {
height: 100%;
}
.avue-crud {
height: 100%;
display: flex;
flex-direction: column;
}
:deep(.el-card__body) {
height: 100%;
}
.lptime {
margin-top: 30px;
padding-left: 60px;
display: flex;
flex-direction: column;
font-size: 14px;
:deep(.el-input__wrapper) {
height: 30px;
}
.name {
margin-bottom: 10px;
}
}
.recordCl {
height: 200px;
overflow-y: scroll;
}
.el_Completion {
padding: 10px 0;
.title {
font-size: 14px;
}
}
.el-ckbtn {
margin-top: 10px;
}
.payanindemnity {
display: flex;
align-items: center;
margin-top: 20px;
.title {
width: 120px;
height: 100%;
display: flex;
display: block;
align-items: center;
}
.sk_input {
margin: 0 5px;
margin-left: 20px;
width: 20%;
display: flex;
span {
width: 70px;
font-size: 16px;
font-weight: 300;
display: flex;
align-items: center;
justify-content: flex-start;
}
}
.el-button {
background-color: #ff0000;
border: none;
}
}
.el_clzr {
padding: 0 18px;
padding-left: 8px;
:deep(.el-select) {
width: 100%;
}
:deep(.el-input) {
height: 38px;
}
}
.el-fy {
flex: 1;
display: flex;
align-items: flex-end;
margin-bottom: 10px;
}
.el-times {
:deep(.el-input__wrapper) {
height: 30px !important;
}
}
:deep(.el_tims_box) {
width: 100%;
display: flex;
.topText {
display: flex;
align-items: flex-start;
}
.el-form-item {
margin: 6px 0;
}
}
.el-fr-d {
margin: 6px 0px;
width: 100%;
display: flex;
justify-content: space-between;
}
.el-btn {
flex-direction: row;
margin-right: 0;
margin-bottom: 0;
:deep(.el-form-item__content) {
flex-direction: row;
flex-wrap: nowrap;
}
}
:deep(.el-card) {
box-shadow: none;
}
.content_max {
display: flex;
height: 100%;
}
.content_right {
flex: 1;
height: 100%;
width: 100%;
}
.el_times {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;
:deep(.el-form-item) {
margin: 0;
align-items: center;
.el-form-item__label {
margin-left: 20px;
}
}
}
.topText {
width: 100%;
:deep(.el-form-item) {
margin-right: 4px;
}
}
.content {
width: 100%;
height: 300px;
overflow-y: scroll;
scroll-behavior: smooth;
/* 添加平滑滚动效果 */
border-radius: 5px;
.YH {
width: 100%;
min-height: 50px;
margin: 4px 0;
display: flex;
flex-direction: row;
.box {
width: 386px;
height: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
.name {
display: flex;
flex-direction: column;
span {
display: flex;
justify-content: flex-start;
padding-left: 10px;
margin-bottom: 10px;
}
.time {
display: flex;
justify-content: flex-end;
padding: 0 10px;
margin-top: 4px;
}
}
}
.input {
border: 1px solid;
width: 300px;
min-height: 30px;
box-sizing: border-box;
border-radius: 8px;
padding: 8px;
margin: 0 6px;
text-indent: 2em;
position: relative;
.ico {
position: absolute;
right: -6%;
bottom: 0;
}
}
}
.KF {
width: 100%;
min-height: 50px;
margin: 4px 0;
display: flex;
justify-content: flex-end;
.box {
width: 386px;
height: 100%;
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
.name {
display: flex;
flex-direction: column;
span {
display: flex;
justify-content: flex-end;
padding-right: 10px;
margin-bottom: 10px;
}
.time {
display: flex;
justify-content: flex-start;
padding: 0 10px;
margin-top: 4px;
}
}
}
.input {
border: 1px solid;
width: 300px;
min-height: 30px;
box-sizing: border-box;
border-radius: 8px;
padding: 8px;
margin: 0 6px;
text-indent: 2em;
position: relative;
.ico {
position: absolute;
left: -16%;
bottom: 0;
}
}
}
.TX {
height: 50px;
width: 50px;
border-radius: 50%;
border: 1px solid #ccc;
background: url('../../../public/img/tx.png') no-repeat;
background-size: cover;
}
}
.inputTextarea {
margin-top: 50px;
display: flex;
align-items: flex-end;
.fell {
width: 100%;
.el-upload-list {
display: none;
}
}
}
.btn_fs {
margin-left: 50px;
}
.felltis {
height: 28px;
display: flex;
align-items: center;
justify-content: center;
margin-left: 4px;
border: 1px dashed;
padding: 0 4px;
border-radius: 3px;
}
.el_fk {
.my-header {
display: flex;
justify-content: space-between;
margin-right: 25px;
}
.el-dialog__title {
margin: 0;
}
}
.plAllret {
:deep(.el-select) {
width: 100%;
}
.el-select {
width: 100%;
}
}
:deep(.is-active) {
font-weight: bold !important;
}
.Improveinformation {
width: 100%;
:deep(.custom-tabs-label) {
display: flex;
align-items: center;
}
:deep(.el-tab-pane) {
padding: 10px;
}
}
.paySum {
margin-top: 36px;
font-size: 14px;
display: flex;
justify-content: space-between;
.sum {
display: flex;
}
span {
margin-right: 30px;
display: flex;
align-items: center;
}
}
:deep(.el_Batchcompletion) {
height: 745.6px;
overflow-y: scroll;
margin: 0;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.el_btn {
display: flex;
justify-content: flex-end;
}
:deep(.el_tabs) {
width: 100%;
display: flex;
flex-direction: column-reverse;
justify-content: space-between;
.el-tabs__content {
padding: 0;
flex: 1;
}
.el-tabs__header {
height: 37px;
width: 100%;
}
}
:deep(.avue-crud__pagination) {
padding-top: 2px !important;
}
.arbitrate {
margin-top: 36px;
.el_btn {
margin-top: 10px;
}
:deep(.el-tabs__content) {
padding: 0 !important;
flex: 1;
}
}
.el_appeal {
:deep(.el-select) {
width: 100% !important;
margin-bottom: 10px;
}
:deep(.el-form-item) {
flex-direction: column;
align-items: flex-start;
.el-form-item__content {
width: 100% !important;
}
}
}
.el_sdialog-footer {
display: flex;
justify-content: flex-end;
margin-top: 10px;
}
:deep(.avue-crud__header) {
align-items: center;
}
.el_amount {
display: flex;
justify-content: space-between;
}
.el_textBtn {
color: #9bb40d;
}
:deep(.el-upload-dragger) {
display: flex;
align-items: center;
justify-content: center;
}
.el_DingTalk {
:deep(.el-input--prefix) {
height: 32px !important;
width: 100%;
}
}
:deep(.el-table tr) {
&.Abnormal {
background: #b7bece;
.tabculconte,
.el-tooltip,
.el-button--text {
color: #000000 !important;
}
// td{
// border-top: 1px solid #1f7fed;
// border-bottom: 1px solid #1f7fed;
// }
// td:first-of-type {
// border-left: 3px solid #dc2e2e;
// }
// td:last-of-type {
// border-right: 3px solid #dc2e2e;
// }
}
&.hover-row {
.tabculconte,
.el-tooltip,
.el-button--text {
color: var(--el-color-primary) !important;
}
}
}
.el_Customer {
width: 440px;
#bodys {
height: 300px !important;
}
}
.el_FyCustomer {
margin-top: 3px;
justify-content: space-between;
}
.el_Createbinding {
height: 110px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
.el_Customer {
margin-left: 10px;
}
}
</style>