|
|
@ -0,0 +1,671 @@ |
|
|
|
<template> |
|
|
|
<a-card :bordered="false"> |
|
|
|
<!-- 查询区域 --> |
|
|
|
<div class="table-page-search-wrapper"> |
|
|
|
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
|
|
|
<a-row :gutter="24"> |
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
<a-form-item label="订单状态"> |
|
|
|
<j-dict-select-tag placeholder="请选择订单状态" v-model="queryParam.state" dictCode="order_type"/> |
|
|
|
</a-form-item> |
|
|
|
</a-col> |
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
<a-form-item label="流程状态"> |
|
|
|
<j-dict-select-tag placeholder="请选择流程状态" v-model="queryParam.status" dictCode="order_state"/> |
|
|
|
</a-form-item> |
|
|
|
</a-col> |
|
|
|
<template v-if="toggleSearchStatus"> |
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
<a-form-item label="下单用户"> |
|
|
|
<j-search-select-tag placeholder="请选择下单用户" v-model="queryParam.userId" dict="han_hai_member,nick_name,id"/> |
|
|
|
</a-form-item> |
|
|
|
</a-col> |
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
<a-form-item label="联系电话"> |
|
|
|
<a-input placeholder="请输入联系电话" v-model="queryParam.phone"></a-input> |
|
|
|
</a-form-item> |
|
|
|
</a-col> |
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
<a-form-item label="物流编码"> |
|
|
|
<a-input placeholder="请输入物流编码" v-model="queryParam.wliuNo"></a-input> |
|
|
|
</a-form-item> |
|
|
|
</a-col> |
|
|
|
</template> |
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
|
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
|
|
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
|
|
|
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
|
|
|
<a @click="handleToggleSearch" style="margin-left: 8px"> |
|
|
|
{{ toggleSearchStatus ? '收起' : '展开' }} |
|
|
|
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
|
|
|
</a> |
|
|
|
</span> |
|
|
|
</a-col> |
|
|
|
</a-row> |
|
|
|
</a-form> |
|
|
|
</div> |
|
|
|
<!-- 查询区域-END --> |
|
|
|
|
|
|
|
<!-- 操作按钮区域 --> |
|
|
|
<!-- <div class="table-operator">--> |
|
|
|
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> |
|
|
|
<!-- <a-button type="primary" icon="download" @click="handleExportXls('订单信息表')">导出</a-button>--> |
|
|
|
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> |
|
|
|
<!-- <a-button type="primary" icon="import">导入</a-button>--> |
|
|
|
<!-- </a-upload>--> |
|
|
|
<!-- <!– 高级查询区域 –>--> |
|
|
|
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
|
|
|
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> |
|
|
|
<!-- <a-menu slot="overlay">--> |
|
|
|
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> |
|
|
|
<!-- </a-menu>--> |
|
|
|
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> |
|
|
|
<!-- </a-dropdown>--> |
|
|
|
<!-- </div>--> |
|
|
|
|
|
|
|
<!-- table区域-begin --> |
|
|
|
<div> |
|
|
|
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
|
|
|
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
|
|
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a-table |
|
|
|
ref="table" |
|
|
|
size="middle" |
|
|
|
rowKey="id" |
|
|
|
class="j-table-force-nowrap" |
|
|
|
:scroll="{x:true}" |
|
|
|
:columns="columns" |
|
|
|
:dataSource="dataSource" |
|
|
|
:pagination="ipagination" |
|
|
|
:loading="loading" |
|
|
|
:expandedRowKeys="expandedRowKeys" |
|
|
|
@change="handleTableChange" |
|
|
|
@expand="handleExpand" |
|
|
|
v-bind="tableProps"> |
|
|
|
|
|
|
|
<template slot="imgSlot" slot-scope="text,record"> |
|
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
|
|
|
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
|
|
|
</template> |
|
|
|
<template slot="fileSlot" slot-scope="text"> |
|
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
|
|
|
<a-button |
|
|
|
v-else |
|
|
|
:ghost="true" |
|
|
|
type="primary" |
|
|
|
icon="download" |
|
|
|
size="small" |
|
|
|
@click="downloadFile(text)"> |
|
|
|
下载 |
|
|
|
</a-button> |
|
|
|
</template> |
|
|
|
|
|
|
|
<span slot="action" slot-scope="text, record"> |
|
|
|
<a @click="handleEdit(record)">编辑</a> |
|
|
|
<a-divider type="vertical" /> |
|
|
|
|
|
|
|
<a @click="handleRefund(record)" |
|
|
|
v-if="record.state == 2 && record.status == 3 && isWithin48Hours(record.testingTime)">退货退款</a> |
|
|
|
|
|
|
|
<a-divider type="vertical" /> |
|
|
|
<a-dropdown> |
|
|
|
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
|
|
|
<a-menu slot="overlay"> |
|
|
|
<!-- <a-menu-item>--> |
|
|
|
<!-- <a @click="handleAddChild(record)">添加下级</a>--> |
|
|
|
<!-- </a-menu-item>--> |
|
|
|
<a-menu-item> |
|
|
|
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft"> |
|
|
|
<a>删除</a> |
|
|
|
</a-popconfirm> |
|
|
|
</a-menu-item> |
|
|
|
</a-menu> |
|
|
|
</a-dropdown> |
|
|
|
</span> |
|
|
|
|
|
|
|
</a-table> |
|
|
|
</div> |
|
|
|
|
|
|
|
<commonOrder-modal ref="modalForm" @ok="modalFormOk"></commonOrder-modal> |
|
|
|
</a-card> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
import { getAction, deleteAction, postAction } from '@/api/manage' |
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
|
|
|
import CommonOrderModal from './modules/CommonOrderModal' |
|
|
|
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
|
|
|
import { filterObj } from '@/utils/util'; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "CommonOrderList", |
|
|
|
mixins:[JeecgListMixin], |
|
|
|
components: { |
|
|
|
CommonOrderModal |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
description: '订单信息表管理页面', |
|
|
|
// 表头 |
|
|
|
columns: [ |
|
|
|
{ |
|
|
|
title:'创建日期', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'createTime' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'订单编号', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'ordeNo' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'订单状态', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'state_dictText' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'流程状态', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'status_dictText' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'下单用户', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'userId_dictText' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'订单图片', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'image', |
|
|
|
scopedSlots: {customRender: 'imgSlot'} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'订单标题', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'title' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'客户姓名', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'name' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'联系电话', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'phone' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'订单价格', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'price' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'取件地址', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'address' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'取件地址明细', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'addressDetail' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'直推佣金', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'oneMoney' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'间推佣金', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'twoMoney' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'上门时间', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'goTime' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'物流公司', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'wliu' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'单价', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'onePrice' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'单位', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'unit' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'数量', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'num' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'简介', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'details' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'最近回收', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'izShow', |
|
|
|
customRender: (text) => (!text ? "" : (text == "Y" ? "是" : "否")) |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'物流编码', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'wliuNo' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'商品标识', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'shopId' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'地址标识', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'addressId' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'检测状态', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'testingStatus_dictText' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'检测说明', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'testingInstructions' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'检测时间', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'testingTime' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'检测报告', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'testingImages', |
|
|
|
scopedSlots: {customRender: 'imgSlot'} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'是否包邮', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'isBy', |
|
|
|
customRender: (text) => (!text ? "" : (text == "Y" ? "是" : "否")) |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'质检员', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'isUserId_dictText' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'品牌', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'pinId' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'合格数量', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'qualifiedNum' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'不合格数量', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'noQualifiedNum' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'不可回收数量', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'unrecyclable' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'分类', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'shopClass' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'预估价格', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'estimatedPrice' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title:'快递员电话', |
|
|
|
align:"left", |
|
|
|
dataIndex: 'deliveryPhone' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '操作', |
|
|
|
dataIndex: 'action', |
|
|
|
align:"center", |
|
|
|
fixed:"right", |
|
|
|
width:147, |
|
|
|
scopedSlots: { customRender: 'action' }, |
|
|
|
} |
|
|
|
], |
|
|
|
url: { |
|
|
|
list: "/commonOrder/commonOrder/rootList", |
|
|
|
childList: "/commonOrder/commonOrder/childList", |
|
|
|
getChildListBatch: "/commonOrder/commonOrder/getChildListBatch", |
|
|
|
delete: "/commonOrder/commonOrder/delete", |
|
|
|
deleteBatch: "/commonOrder/commonOrder/deleteBatch", |
|
|
|
exportXlsUrl: "/commonOrder/commonOrder/exportXls", |
|
|
|
importExcelUrl: "commonOrder/commonOrder/importExcel", |
|
|
|
}, |
|
|
|
expandedRowKeys:[], |
|
|
|
hasChildrenField:"hasChild", |
|
|
|
pidField:"pid", |
|
|
|
dictOptions: {}, |
|
|
|
loadParent: false, |
|
|
|
superFieldList:[], |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getSuperFieldList(); |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
importExcelUrl(){ |
|
|
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
|
|
|
}, |
|
|
|
tableProps() { |
|
|
|
let _this = this |
|
|
|
return { |
|
|
|
// 列表项是否可选择 |
|
|
|
rowSelection: { |
|
|
|
selectedRowKeys: _this.selectedRowKeys, |
|
|
|
onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
loadData(arg){ |
|
|
|
if(arg==1){ |
|
|
|
this.ipagination.current=1 |
|
|
|
} |
|
|
|
this.loading = true |
|
|
|
let params = this.getQueryParams() |
|
|
|
// params.hasQuery = 'true' |
|
|
|
getAction(this.url.list,params).then(res=>{ |
|
|
|
if(res.success){ |
|
|
|
let result = res.result |
|
|
|
if(Number(result.total)>0){ |
|
|
|
this.ipagination.total = Number(result.total) |
|
|
|
this.dataSource = this.getDataByResult(res.result.records) |
|
|
|
return this.loadDataByExpandedRows(this.dataSource) |
|
|
|
}else{ |
|
|
|
this.ipagination.total=0 |
|
|
|
this.dataSource=[] |
|
|
|
} |
|
|
|
}else{ |
|
|
|
this.$message.warning(res.message) |
|
|
|
} |
|
|
|
}).finally(()=>{ |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 根据已展开的行查询数据(用于保存后刷新时异步加载子级的数据) |
|
|
|
loadDataByExpandedRows(dataList) { |
|
|
|
if (this.expandedRowKeys.length > 0) { |
|
|
|
return getAction(this.url.getChildListBatch,{ parentIds: this.expandedRowKeys.join(',') }).then(res=>{ |
|
|
|
if (res.success && res.result.records.length>0) { |
|
|
|
//已展开的数据批量子节点 |
|
|
|
let records = res.result.records |
|
|
|
const listMap = new Map(); |
|
|
|
for (let item of records) { |
|
|
|
let pid = item[this.pidField]; |
|
|
|
if (this.expandedRowKeys.join(',').includes(pid)) { |
|
|
|
let mapList = listMap.get(pid); |
|
|
|
if (mapList == null) { |
|
|
|
mapList = []; |
|
|
|
} |
|
|
|
mapList.push(item); |
|
|
|
listMap.set(pid, mapList); |
|
|
|
} |
|
|
|
} |
|
|
|
let childrenMap = listMap; |
|
|
|
let fn = (list) => { |
|
|
|
if(list) { |
|
|
|
list.forEach(data => { |
|
|
|
if (this.expandedRowKeys.includes(data.id)) { |
|
|
|
data.children = this.getDataByResult(childrenMap.get(data.id)) |
|
|
|
fn(data.children) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
fn(dataList) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
return Promise.resolve() |
|
|
|
} |
|
|
|
}, |
|
|
|
getQueryParams(arg) { |
|
|
|
//获取查询条件 |
|
|
|
let sqp = {} |
|
|
|
let param = {} |
|
|
|
if(this.superQueryParams){ |
|
|
|
sqp['superQueryParams']=encodeURI(this.superQueryParams) |
|
|
|
sqp['superQueryMatchType'] = this.superQueryMatchType |
|
|
|
} |
|
|
|
if(arg){ |
|
|
|
param = Object.assign(sqp, this.isorter ,this.filters); |
|
|
|
}else{ |
|
|
|
param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters); |
|
|
|
} |
|
|
|
if(JSON.stringify(this.queryParam) === "{}" || arg){ |
|
|
|
param.hasQuery = 'false' |
|
|
|
}else{ |
|
|
|
param.hasQuery = 'true' |
|
|
|
} |
|
|
|
param.field = this.getQueryField(); |
|
|
|
param.pageNo = this.ipagination.current; |
|
|
|
param.pageSize = this.ipagination.pageSize; |
|
|
|
return filterObj(param); |
|
|
|
}, |
|
|
|
searchReset() { |
|
|
|
//重置 |
|
|
|
this.expandedRowKeys = [] |
|
|
|
this.queryParam = {} |
|
|
|
this.loadData(1); |
|
|
|
}, |
|
|
|
getDataByResult(result){ |
|
|
|
if(result){ |
|
|
|
return result.map(item=>{ |
|
|
|
//判断是否标记了带有子节点 |
|
|
|
if(item[this.hasChildrenField]=='1'){ |
|
|
|
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true } |
|
|
|
item.children = [loadChild] |
|
|
|
} |
|
|
|
return item |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleExpand(expanded, record){ |
|
|
|
// 判断是否是展开状态 |
|
|
|
if (expanded) { |
|
|
|
this.expandedRowKeys.push(record.id) |
|
|
|
if (record.children.length>0 && record.children[0].isLoading === true) { |
|
|
|
let params = this.getQueryParams(1);//查询条件 |
|
|
|
params[this.pidField] = record.id |
|
|
|
params.hasQuery = 'false' |
|
|
|
params.superQueryParams="" |
|
|
|
getAction(this.url.childList,params).then((res)=>{ |
|
|
|
if(res.success){ |
|
|
|
if(res.result.records){ |
|
|
|
record.children = this.getDataByResult(res.result.records) |
|
|
|
this.dataSource = [...this.dataSource] |
|
|
|
}else{ |
|
|
|
record.children='' |
|
|
|
record.hasChildrenField='0' |
|
|
|
} |
|
|
|
}else{ |
|
|
|
this.$message.warning(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
let keyIndex = this.expandedRowKeys.indexOf(record.id) |
|
|
|
if(keyIndex>=0){ |
|
|
|
this.expandedRowKeys.splice(keyIndex, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
handleAddChild(record){ |
|
|
|
this.loadParent = true |
|
|
|
let obj = {} |
|
|
|
obj[this.pidField] = record['id'] |
|
|
|
this.$refs.modalForm.add(obj); |
|
|
|
}, |
|
|
|
handleDeleteNode(id) { |
|
|
|
if(!this.url.delete){ |
|
|
|
this.$message.error("请设置url.delete属性!") |
|
|
|
return |
|
|
|
} |
|
|
|
var that = this; |
|
|
|
deleteAction(that.url.delete, {id: id}).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
that.loadData(1) |
|
|
|
} else { |
|
|
|
that.$message.warning(res.message); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
batchDel(){ |
|
|
|
if(this.selectedRowKeys.length<=0){ |
|
|
|
this.$message.warning('请选择一条记录!'); |
|
|
|
return false; |
|
|
|
}else{ |
|
|
|
let ids = ""; |
|
|
|
let that = this; |
|
|
|
that.selectedRowKeys.forEach(function(val) { |
|
|
|
ids+=val+","; |
|
|
|
}); |
|
|
|
that.$confirm({ |
|
|
|
title:"确认删除", |
|
|
|
content:"是否删除选中数据?", |
|
|
|
onOk: function(){ |
|
|
|
that.handleDeleteNode(ids) |
|
|
|
that.onClearSelected(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 检查时间是否在48小时内 |
|
|
|
isWithin48Hours(testingTime) { |
|
|
|
if (!testingTime) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
const testingDate = new Date(testingTime); |
|
|
|
const currentDate = new Date(); |
|
|
|
const timeDiff = currentDate.getTime() - testingDate.getTime(); |
|
|
|
const hoursDiff = timeDiff / (1000 * 60 * 60); |
|
|
|
|
|
|
|
return hoursDiff <= 48; |
|
|
|
}, |
|
|
|
// 处理退货退款 |
|
|
|
handleRefund(record) { |
|
|
|
if (!this.isWithin48Hours(record.testingTime)) { |
|
|
|
this.$message.warning('检测时间已超过48小时,无法进行退货退款操作'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm({ |
|
|
|
title: '确认退货退款', |
|
|
|
content: `确定要对订单 ${record.ordeNo} 进行退货退款操作吗?`, |
|
|
|
onOk: () => { |
|
|
|
this.processRefund(record); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 执行退货退款操作 |
|
|
|
processRefund(record) { |
|
|
|
// 这里可以调用后端API进行退货退款操作 |
|
|
|
// 示例:调用退货退款接口 |
|
|
|
const params = { |
|
|
|
id: record.id, |
|
|
|
}; |
|
|
|
|
|
|
|
// 假设有一个退货退款的API接口 |
|
|
|
getAction('/commonOrder/commonOrder/refund', params).then(res => { |
|
|
|
if (res.success) { |
|
|
|
console.log(res.result); |
|
|
|
if (res.result && res.result.money < 0) { |
|
|
|
this.$confirm({ |
|
|
|
title: '余额不足提醒', |
|
|
|
content: '退货退款完成,请注意:该用户余额不足退款,已成负数,请及时通知用户', |
|
|
|
okText: '确定', |
|
|
|
type: 'warning' |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
this.$message.success('退货退款成功'); |
|
|
|
} |
|
|
|
|
|
|
|
this.loadData(1); // 刷新列表 |
|
|
|
} else { |
|
|
|
this.$message.error(res.message || '退货退款申请失败'); |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
this.$message.error('操作失败,请稍后重试'); |
|
|
|
}); |
|
|
|
|
|
|
|
// 临时提示,实际使用时需要替换为真实的API调用 |
|
|
|
// this.$message.success('退货退款申请已提交(示例)'); |
|
|
|
// console.log('退货退款参数:', params); |
|
|
|
}, |
|
|
|
getSuperFieldList(){ |
|
|
|
let fieldList=[]; |
|
|
|
fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) |
|
|
|
fieldList.push({type:'string',value:'ordeNo',text:'订单编号',dictCode:''}) |
|
|
|
fieldList.push({type:'int',value:'state',text:'订单状态',dictCode:'order_type'}) |
|
|
|
fieldList.push({type:'int',value:'status',text:'流程状态',dictCode:'order_state'}) |
|
|
|
fieldList.push({type:'sel_search',value:'userId',text:'下单用户',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'}) |
|
|
|
fieldList.push({type:'Text',value:'image',text:'订单图片',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'title',text:'订单标题',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'name',text:'客户姓名',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'phone',text:'联系电话',dictCode:''}) |
|
|
|
fieldList.push({type:'BigDecimal',value:'price',text:'订单价格',dictCode:''}) |
|
|
|
fieldList.push({type:'Text',value:'address',text:'取件地址',dictCode:''}) |
|
|
|
fieldList.push({type:'Text',value:'addressDetail',text:'取件地址明细',dictCode:''}) |
|
|
|
fieldList.push({type:'BigDecimal',value:'oneMoney',text:'直推佣金',dictCode:''}) |
|
|
|
fieldList.push({type:'BigDecimal',value:'twoMoney',text:'间推佣金',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'pid',text:'父级节点',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'goTime',text:'上门时间',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'wliu',text:'物流公司',dictCode:''}) |
|
|
|
fieldList.push({type:'BigDecimal',value:'onePrice',text:'单价',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'unit',text:'单位',dictCode:''}) |
|
|
|
fieldList.push({type:'int',value:'num',text:'数量',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'details',text:'简介',dictCode:''}) |
|
|
|
fieldList.push({type:'switch',value:'izShow',text:'最近回收'}) |
|
|
|
fieldList.push({type:'string',value:'wliuNo',text:'物流编码',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'shopId',text:'商品标识',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'addressId',text:'地址标识',dictCode:''}) |
|
|
|
fieldList.push({type:'int',value:'testingStatus',text:'检测状态',dictCode:'test_status'}) |
|
|
|
fieldList.push({type:'string',value:'testingInstructions',text:'检测说明',dictCode:''}) |
|
|
|
fieldList.push({type:'datetime',value:'testingTime',text:'检测时间'}) |
|
|
|
fieldList.push({type:'Text',value:'testingImages',text:'检测报告',dictCode:''}) |
|
|
|
fieldList.push({type:'switch',value:'isBy',text:'是否包邮'}) |
|
|
|
fieldList.push({type:'sel_search',value:'isUserId',text:'质检员',dictTable:"han_hai_member", dictText:'name', dictCode:'id'}) |
|
|
|
fieldList.push({type:'string',value:'pinId',text:'品牌',dictCode:''}) |
|
|
|
fieldList.push({type:'int',value:'qualifiedNum',text:'合格数量',dictCode:''}) |
|
|
|
fieldList.push({type:'int',value:'noQualifiedNum',text:'不合格数量',dictCode:''}) |
|
|
|
fieldList.push({type:'int',value:'unrecyclable',text:'不可回收数量',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'shopClass',text:'分类',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'estimatedPrice',text:'预估价格',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'deliveryPhone',text:'快递员电话',dictCode:''}) |
|
|
|
this.superFieldList = fieldList |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
@import '~@assets/less/common.less'; |
|
|
|
</style> |