线下出货模块处理

This commit is contained in:
JasonChen
2023-08-04 15:53:16 +08:00
parent 2cad342c01
commit 58d8b32131
4 changed files with 158 additions and 240 deletions

View File

@@ -6,49 +6,40 @@
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="8" :sm="24">
<a-form-item label="订单号码">
<a-input v-model="queryParam.item_id" placeholder="订单号" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="手机号码">
<a-input v-model="queryParam.order_no" placeholder="购买人手机号" />
<a-input v-model="queryParam.mobile" placeholder="购买人手机号" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="真实姓名">
<a-input v-model="queryParam.item_id" placeholder="购买人真实姓名" />
<a-input v-model="queryParam.name" placeholder="购买人真实姓名" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="发货数量" has-feedback>
<a-input v-model="queryParam.order_no" placeholder="发货数量" />
<a-form-item label="详细地址">
<a-input v-model="queryParam.address" placeholder="购买人收货地址" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="快递类型" has-feedback>
<a-select v-model="queryParam.business_type_id" @change="onBusinessChange" placeholder="快递类型">
<a-select-option v-for="item in businessArray" :key="item.id" :value="item.id">{{ item.title }}</a-select-option>
<!-- <a-col :md="8" :sm="24">
<a-form-item label="发货方式" has-feedback>
<a-select v-model="queryParam.channel" placeholder="发货方式">
<a-select-option v-for="item in channels" :key="item.value" :value="item.value">{{ item.text }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="快递单号">
<a-input v-model="queryParam.item_id" placeholder="快递单号" />
<a-form-item label="快递类型" has-feedback>
<a-select v-model="queryParam.express" placeholder="快递类型">
<a-select-option v-for="(item, key, index) in expresses" :key="index" :value="key">{{ item }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-col> -->
<a-col :md="8" :sm="24">
<a-button type="primary" @click="search"><a-icon type="search" />搜索</a-button>
<a-button class="ml8" t ype="primary" @click="onAddRole"><a-icon type="plus" />新增线下出货</a-button>
<a-button class="ml8" t ype="primary" @click="CreateOffline"><a-icon type="plus" />新增线下出货</a-button>
<a-button class="ml8" @click="resetSearch"><a-icon type="undo" />重置</a-button>
<a-button
v-if="exports_can"
class="ml8"
type="dashed"
shape="round"
icon="download"
@click="exports"/>
</a-col>
</a-row>
</a-form>
@@ -61,22 +52,23 @@
ref="table"
:columns="columns"
:data="loadData"
:rowKey="(row) => row.order_item_id"
:rowKey="(row) => row.offline_id"
showPagination="auto"
bordered
size="default"
:scroll="{ x: 1200, y: 1000 }">
<!-- 申请用户 实习顾问 法务老师 -->
<div slot="user" slot-scope="text, record" style="color: #1890ff">
<div>{{ record.user }}</div>
>
<div slot="name" slot-scope="text, record">
<div>{{ record.name }} {{ record.mobile?'('+record.mobile+')':'--' }}</div>
<div>{{ record.address || '--' }}</div>
</div>
<!-- 创建时间 -->
<span slot="created_at" slot-scope="text, record">{{ record.created_at }}</span>
<!-- 操作 -->
<div slot="actions" slot-scope="text, record">
<a class="ant-dropdown-link" @click="onInfo(record)">查看详情</a>
<!-- <a-divider type="vertical" /> -->
<!-- <a class="ant-dropdown-link" @click="onEdit(record)">发货</a> -->
<div slot="number" slot-scope="text, record">
{{ record.number }}
</div>
<div slot="channel" slot-scope="text, record">
{{ record.channel == 'express' ?'快递':'自提' }}
</div>
<div slot="express" slot-scope="text, record">
{{ record.express.name || '-' }} <div>{{ record.express.express_no || '-' }}</div>
</div>
</s-table>
</a-card>
@@ -86,62 +78,53 @@
<script>
import { STable, UserInfo } from '@/components'
import DeriveButton from '@/components/OrderDetailInfo/DeriveButton'
import { institutionsExports } from '@/api/storage'
import moment from 'moment'
import Info from '@/views/home/components/Info'
import {
init,
canExport
} from '@/api/organization'
import { getMiddlesExperience } from '@/api/stock'
import storage from 'store'
import EditSend from './widgets/EditSend.vue'
import StockInfo from './widgets/StockInfo.vue'
import { getMiddlesStockOffline, getMiddlesStockOfflineInit } from '@/api/stock'
import AddOffline from './widgets/AddOffline.vue'
// 列表规格
const columns = [
{
title: '订单号',
dataIndex: 'user22',
align: 'center'
},
{
title: '收货人',
dataIndex: 'created_at',
align: 'center'
title: 'ID',
dataIndex: 'offline_id',
align: 'center',
width: 100
},
{
title: '发货数量',
dataIndex: 'created_at1',
align: 'center'
},
{
title: '订单信息',
children: [
{
title: '状态',
dataIndex: 'name',
key: 'name',
align: 'center'
},
{
title: '金额',
dataIndex: 'name1',
key: 'name1',
align: 'center'
}
],
width: 300,
align: 'center'
},
{
title: '操作',
scopedSlots: { customRender: 'actions' },
scopedSlots: { customRender: 'number' },
align: 'center',
width: 160,
fixed: 'right'
width: 120
},
{
title: '发货方式',
scopedSlots: { customRender: 'channel' },
align: 'center',
width: 120
},
{
title: '收货人',
scopedSlots: { customRender: 'name' },
align: 'center'
},
{
title: '快递信息',
scopedSlots: { customRender: 'express' },
align: 'center'
},
{
title: '创建时间',
dataIndex: 'created_at',
align: 'center'
}
// {
// title: '操作',
// scopedSlots: { customRender: 'actions' },
// align: 'center',
// width: 160,
// fixed: 'right'
// }
]
export default {
@@ -157,24 +140,20 @@ export default {
exports_can: false,
columns,
searchType: false, // 展示全部的搜索
businessArray: [], // 业务类型
statusArray: [], // 机构列表
expresses: [], // 快递列表
channels: [], // 返货方式
queryParam: {
order_no: '', // 订单编号
institution: '', // 机构名称
item_id: '', // 机构编号
nickname: '', // 下单人
business_type_id: '', // 业务类型
status: '', // 机构状态
paid_at: undefined, // 下单时间
audit_at: undefined, // 执行时间
settle_at: undefined // 结案时间
name: undefined,
mobile: undefined,
channel: undefined,
address: undefined,
express: undefined
},
listCount: 0,
loadData: (parameter) => {
const requestParameters = Object.assign({}, parameter, this.queryParam)
return getMiddlesExperience(requestParameters)
return getMiddlesStockOffline(requestParameters)
}
}
},
@@ -200,36 +179,11 @@ export default {
moment,
// 获取检索的基本样式
init () {
init().then(res => {
this.statusArray = res.status // 机构状态
this.businessArray = res.type // 业务类型
// this.canExports()
getMiddlesStockOfflineInit().then(res => {
this.channels = res.channel
this.expresses = res.expresses
})
},
// 更改创建时间
onCreateChange (dates, dateStrings) {
this.queryParam.paid_at = dateStrings
},
// 更改执行时间
onCarryChange (dates, dateStrings) {
this.queryParam.audit_at = dateStrings
},
// 更改结案时间
onSettleChange (dates, dateStrings) {
this.queryParam.settle_at = dateStrings
},
// 处理状态
onDisposeChange (e) {
this.queryParam.dispose = e
},
// 业务类型
onBusinessChange (e) {
this.queryParam.business_type_id = e
},
// 机构状态
onOrganizationChange (e) {
this.queryParam.status = e
},
// 搜索列表
search () {
this.$refs.table.refresh(true) // 重置接口且刷先到第一页
@@ -237,45 +191,16 @@ export default {
// 重置搜索列表
resetSearch () {
this.queryParam = {
order_no: '', // 订单编号
institution: '', // 机构名称
item_id: '', // 机构编号
nickname: '', // 下单人
business_type_id: '', // 业务类型
status: '', // 机构状态
paid_at: undefined, // 下单时间
audit_at: undefined, // 执行时间
settle_at: undefined// 结案时间
name: undefined,
mobile: undefined,
channel: undefined,
address: undefined,
express: undefined
}
this.$refs.table.refresh(true) // 重置接口且刷先到第一页
},
// 机构是否能导出
canExports () {
canExport(storage.get('userid')).then(res => {
this.exports_can = res.exports
})
},
// 导出列表
exports () {
const params = this.queryParam
params.audit_at = this.queryParam.audit_at || ''
params.paid_at = this.queryParam.paid_at || ''
params.settle_at = this.queryParam.settle_at || ''
if (this.listCount > 0) {
let downUrl = institutionsExports() + '?user_id=' + storage.get('userid')
for (const key in params) {
downUrl = downUrl + '&' + key + '=' + params[key]
}
window.open(downUrl)
} else {
this.$notification.error({
message: '温馨提醒',
description: '数据为空不能下载!'
})
}
},
// 新增用户
onAddRole () {
// 创建线下出货
CreateOffline () {
const success = {
title: '新增线下出货',
width: 600,
@@ -284,55 +209,15 @@ export default {
okText: '确认新增',
cancelText: '取消'
}
const offline = {
channels: this.channels,
expresses: this.expresses
}
console.log(offline)
this.$dialog(
AddOffline,
{
on: {
ok: () => {
this.$refs.table.loadData()
}
}
},
success
)
},
// 查看详情
onInfo (item) {
const success = {
title: '立即发货',
width: 1000,
maskClosable: true,
closable: true,
footer: '',
cancelText: '取消'
}
this.$dialog(
StockInfo,
{
item,
on: {
ok: () => {
this.$refs.table.loadData()
}
}
},
success
)
},
// 发货
onEdit (item) {
const success = {
title: '立即发货',
width: 600,
maskClosable: true,
closable: true,
okText: '确认发货',
cancelText: '取消'
}
this.$dialog(
EditSend,
{
item,
offline,
on: {
ok: () => {
this.$refs.table.loadData()