Commit d102cf79 authored by dcy's avatar dcy

订单关联

parent ab027c2a
// export function
import request from '@/utils/request'
import {param} from "@/utils";
export function guanlianList(params){
return request({
......@@ -8,3 +9,44 @@ export function guanlianList(params){
data:params,
})
};
//未关联订单
export function getUnGuanlianOrderByOrderId(data){
return request({
url:'/order/guanlian/getUnGuanlianOrderByOrderId',
method:'post',
data:data,
})
}
//加入关联
export function guanlianCreate(data){
return request({
url:'order/guanlian/create',
method:'post',
data:data,
})
}
//批量加入关联
export function ordeRcreateBatch(data){
return request({
url:'order/guanlian/createBatch',
method:'post',
data:data,
})
}
//移出关联
export function deleteGuanlianOrderByOrderId(data){
return request({
url:'/order/guanlian/deleteGuanlianOrderByOrderId',
method:'delete',
data:data
})
}
// 批量移出关联
export function deleteBatchGuanlianOrderByOrderId(data){
return request({
url:'/order/guanlian/deleteBatchGuanlianOrderByOrderId',
method:'delete',
data:data,
})
}
......@@ -291,25 +291,26 @@ export const constantRoutes = [
children: [
{
path: 'associated-order/:orderId(\\d+)',
component: (resolve) => import('@/views/ecw/order/associatedOrder'),
component: (resolve) => require(['@/views/ecw/order/associatedOrder'],resolve),
props: true,
name: 'associatedOrder',
meta: {title: '关联订单', icon: '', activeMenu: '/order/associatedOrder'}
meta: {title: '关联订单', icon: '', activeMenu: '/order/associatedOrder',noCache:true,}
},
{
path: 'add-associated-order/:orderId',
component:()=>import('@/views/ecw/order/addAssociatedOrder'),
path: 'add-associated-order/:orderId(\\d+)',
component:(resolve)=>require(['@/views/ecw/order/addAssociatedOrder'], resolve),
props: true,
name:'addAssociatedOrder',
meta:{
title:'添加关联订单',
icon:'',
activeMenu:'/order/addAssociatedOrder'
activeMenu:'/order/addAssociatedOrder',
noCache:false,
}
},
{
path:'single-application/:orderId',
component:()=>import('@/views/ecw/order/singleApplication'),
component:(resolve)=>require(['@/views/ecw/order/singleApplication'],resolve),
props: true,
name: 'singleApplication',
meta: {
......@@ -320,7 +321,7 @@ export const constantRoutes = [
},
{
path: 'batch-single-application/:orderId',
component:()=> import('@/views/ecw/order/batchSingleApplication'),
component:(resolve)=> require(['@/views/ecw/order/batchSingleApplication'],resolve),
name: 'batchSingleApplication',
meta: {
title: '批量调仓申请',
......@@ -331,7 +332,7 @@ export const constantRoutes = [
},
{
path: 'fee-application/:orderId',
component:()=> import('@/views/ecw/order/feeApplication'),
component:(resolve)=> require(['@/views/ecw/order/feeApplication'],resolve),
name: 'feeApplication',
props: true,
meta: {
......
<template>
<div class="add-associated-order">
<h1 class="title">订单号:{{orderDetails.orderNo}} 选择订单</h1>
<el-divider></el-divider>
<el-form inline label-width="85px" label-position="left">
<el-form-item label="订单号">
<div class="content"></div>
</el-form-item>
<el-form-item label="唛头">
<div class="content"></div>
</el-form-item>
<el-form-item label="商品类型">
<div class="content"></div>
</el-form-item>
<el-form-item label="商品名称">
<div class="content"></div>
</el-form-item>
<el-form-item label="运输方式">
<div class="content"></div>
</el-form-item>
<el-form-item label="出货渠道">
<div class="content"></div>
</el-form-item>
<el-form-item label="客户名称">
<div class="content"></div>
</el-form-item>
<el-form-item label="客户手机号">
<div class="content"></div>
</el-form-item>
<el-form-item label="商品特性">
<div class="content"></div>
</el-form-item>
<el-form-item>
<el-button>查询</el-button>
<el-button>重置</el-button>
</el-form-item>
</el-form>
<h1 class="title">
未加入关联订单列表
</h1>
<el-divider></el-divider>
<el-table>
<el-table-column
type="selection"
width="55"
></el-table-column>
<el-table-column label="序号"></el-table-column>
<el-table-column label="订单号"></el-table-column>
<el-table-column label="唛头"></el-table-column>
<el-table-column label="商品名列表"></el-table-column>
<el-table-column label="货物特性"></el-table-column>
<el-table-column label="货物材质"></el-table-column>
<el-table-column label="货物数据"></el-table-column>
<el-table-column label="入仓时间"></el-table-column>
<el-table-column label="状态"></el-table-column>
<el-table-column label="操作人"></el-table-column>
<el-table-column label="操作时间"></el-table-column>
<el-table-column label="操作"></el-table-column>
</el-table>
<el-row style="margin-top: 40px">
<el-col>
<el-button type="primary">
批量加入关联
</el-button>
<el-button>
取消
</el-button>
</el-col>
</el-row>
</div>
<div class="add-associated-order">
<h1 class="title">订单号:{{ orderDetails.orderNo }} 选择订单</h1>
<el-divider></el-divider>
<el-form inline label-width="85px" label-position="left">
<el-form-item label="订单号">
<div class="content">
<el-input v-model="relateOrderId"></el-input>
</div>
</el-form-item>
<el-form-item>
<el-button @click="getUnassociatedOrder">查询</el-button>
</el-form-item>
</el-form>
<h1 class="title">
未加入关联订单列表
</h1>
<el-divider></el-divider>
<el-table :data="list" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
></el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="订单号" prop="orderNo"></el-table-column>
<el-table-column label="唛头" prop="marks"></el-table-column>
<el-table-column label="货物数据"></el-table-column>
<el-table-column label="入仓时间" prop="rucangtime"></el-table-column>
<el-table-column label="状态">
<template v-slot:default="scope">
<dict-tag :value="scope.row.status" :type="DICT_TYPE.ORDER_STATUS"></dict-tag>
</template>
</el-table-column>
<el-table-column label="操作人"></el-table-column>
<el-table-column label="操作时间"></el-table-column>
<el-table-column label="操作">
<template v-slot:default="scope">
<el-button type="text" size="mini" @click="joinAssociation(scope.row.orderId)">加入关联</el-button>
</template>
</el-table-column>
</el-table>
<el-row style="margin-top: 40px">
<el-col>
<el-button type="primary" @click="batchJoin(multipleSelection.map(e => e.orderId))"
:disabled="multipleSelection.length === 0">
批量加入关联
</el-button>
<el-button @click="$router.push('/order/associated-order/'+ orderId);">
取消
</el-button>
</el-col>
</el-row>
</div>
</template>
<script>
//添加关联订单
import {getOrder} from "@/api/ecw/order";
import Template from "@/views/cms/template";
import {getUnGuanlianOrderByOrderId, guanlianCreate, ordeRcreateBatch} from "@/api/ecw/associatedOrder";
export default {
name: "addAssociatedOrder",
data(){
components: {Template},
props: {
orderId: [String, Number]
},
data() {
return {
orderDetails:{}
orderDetails: {},
relateOrderId: '',
list: [],
multipleSelection: [],
}
},
created() {
getOrder(this.orderId).then( r =>{
if(r.code === 0){
getOrder(this.orderId).then(r => {
if (r.code === 0) {
this.orderDetails = r.data;
}
})
this.getUnassociatedOrder();
},
mounted() {
},
methods: {
getUnassociatedOrder() {
getUnGuanlianOrderByOrderId({
orderId: this.orderId,
relateOrderId: this.relateOrderId ? this.relateOrderId : 0
}).then(r => {
if (r.code === 0) {
this.list = r.data
}
})
},
joinAssociation(val) {
guanlianCreate({orderId: this.orderId, relateOrderId: val}).then(this.operation)
},
batchJoin(val) {
let p = val.map(e => ({orderId:this.orderId,relateOrderId:e}))
ordeRcreateBatch(p).then(this.operation)
},
operation(r) {
if (r.code === 0) {
this.$message.success('操作成功')
this.getUnassociatedOrder();
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
}
}
}
</script>
<style scoped lang="scss">
.add-associated-order{
.add-associated-order {
padding: 20px;
box-sizing: border-box;
.title{
font-size: 30px;
font-weight: 600;
text-align: left;
}
.el-form{
.content{
.title {
font-size: 30px;
font-weight: 600;
text-align: left;
}
.el-form {
.content {
width: 300px;
}
}
......
......@@ -8,10 +8,10 @@
<el-divider></el-divider>
<el-form inline label-width="100px">
<el-form-item label="订单号"><div class="content">
<el-input></el-input>
<el-input v-model="params.relateOrderId"></el-input>
</div></el-form-item>
<el-form-item><div class="content">
<el-button>查询</el-button>
<el-button @click="getList">查询</el-button>
</div></el-form-item>
</el-form>
<el-divider></el-divider>
......@@ -20,13 +20,13 @@
已加入关联订单列表
</h1>
<div style="flex: 1;margin-left: 20px;">
<el-button type="primary">批量移出</el-button>
<el-button :disabled="multipleSelection.length === 0" type="primary" @click="batchGuanlianOrderByOrderId(multipleSelection.map(e =>({orderId:orderId,relateOrderId:e.orderId})))" >批量移出</el-button>
</div>
<div>
<el-button type="primary" @click="$router.push(`/order/add-associated-order/${orderId}`)">添加关联订单</el-button>
</div>
</div>
<el-table :data="list">
<el-table :data="list" @selection-change="handleSelectionChange" >
<el-table-column
type="selection"
width="55">
......@@ -38,14 +38,14 @@
<el-table-column label="入仓时间" prop="remarks"></el-table-column>
<el-table-column label="状态" prop="status" >
<template v-slot:default="scope">
<!-- <dict-tag :value="scope.row.status" :type="DICT_TYPE.ORDER_STATUS" ></dict-tag>-->
<dict-tag :value="scope.row.status" :type="DICT_TYPE.ORDER_STATUS" ></dict-tag>
</template>
</el-table-column>
<el-table-column label="操作人"></el-table-column>
<el-table-column label="操作时间" prop="createTime"></el-table-column>
<el-table-column label="操作">
<template>
<el-button type="text">
<template v-slot:default='scope'>
<el-button type="text" @click ="guanlianOrderByOrderId(scope.row.orderId)">
移出
</el-button>
</template>
......@@ -58,7 +58,11 @@
//关联订单
import ordeDetailsForm from "@/views/ecw/order/components/ordeDetailsForm";
import {getOrder} from "@/api/ecw/order";
import {guanlianList,} from "@/api/ecw/associatedOrder";
import {
deleteBatchGuanlianOrderByOrderId,
deleteGuanlianOrderByOrderId,
guanlianList,
} from "@/api/ecw/associatedOrder";
import {getDictDatas,DICT_TYPE} from '@/utils/dict'
export default {
name: "associatedOrder",
......@@ -73,10 +77,12 @@ export default {
orderDetails:{},
params:{
orderId:undefined,
relateOrderId:undefined
},
list:[],
DICT_TYPE,
getDictDatas
getDictDatas,
multipleSelection:[]
}
},
created() {
......@@ -95,8 +101,27 @@ export default {
this.list = r.data
}
})
},
guanlianOrderByOrderId(id){
deleteGuanlianOrderByOrderId({orderId:this.orderId,relateOrderId:id}).then(r =>{
if(r.code === 0){
this.getList()
this.$message.success('操作成功');
}
})
},
batchGuanlianOrderByOrderId(val){
deleteBatchGuanlianOrderByOrderId(val).then(r => {
this.getList()
this.$message.success('操作成功');
this.multipleSelection = []
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
}
}
},
}
</script>
......
......@@ -36,6 +36,11 @@
<el-table-column label="公司名称" align="center" prop="enterpriseName" />
<el-table-column label="用户昵称" align="center" prop="nickname" />
<el-table-column label="真实姓名" align="center" prop="identityName" />
<el-table-column label="区号">
<template v-slot:default = 'scope'>
{{scope.row.areaCode ? `+${scope.row.areaCode}`:''}}
</template>
</el-table-column>
<el-table-column label="手机号" show-overflow-tooltip align="center" prop="mobile" >
</el-table-column>
<el-table-column label="成交" align="center" prop="" show-overflow-tooltip />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment