Merge pull request '完成发货接口的开发' (#61) from Brunch_LPQ into main
commit
b3d05f8d65
@ -0,0 +1,9 @@
|
|||||||
|
package com.itmk.web.order.entity;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SendParm {
|
||||||
|
private Long orderId;
|
||||||
|
}
|
@ -1,6 +1,11 @@
|
|||||||
import http from "../../http";
|
import http from "../../http";
|
||||||
import type { OrderListParm } from "./OrderModel";
|
import type { OrderListParm } from "./OrderModel";
|
||||||
//列表
|
//列表
|
||||||
export const gePcOrdertListApi = (parm:OrderListParm)=>{
|
export const gePcOrdertListApi = (parm: OrderListParm) => {
|
||||||
return http.get("/wxapi/order/getPcOrderList",parm)
|
return http.get("/wxapi/order/getPcOrderList", parm)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发货
|
||||||
|
export const sendOrderApi = (orderId: string) => {
|
||||||
|
return http.put("/wxapi/order/sendOrder", { orderId: orderId })
|
||||||
}
|
}
|
@ -1,63 +1,77 @@
|
|||||||
import type { OrderListParm } from '../../api/order/OrderModel'
|
import type { OrderListParm } from '../../api/order/OrderModel'
|
||||||
import {nextTick, onMounted, reactive, ref} from 'vue'
|
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||||
import { gePcOrdertListApi } from '../../api/order'
|
import { gePcOrdertListApi, sendOrderApi } from '../../api/order'
|
||||||
export default function useOrderTable(){
|
import useInstance from '@/hooks/useInstance'
|
||||||
//表格高度
|
export default function useOrderTable() {
|
||||||
const tableHeight = ref(0)
|
const { global } = useInstance()
|
||||||
//表格数据
|
//表格高度
|
||||||
const tableList = ref([])
|
const tableHeight = ref(0)
|
||||||
//表格查询的参数
|
//表格数据
|
||||||
const listParm = reactive<OrderListParm>({
|
const tableList = ref([])
|
||||||
currentPage:1,
|
//表格查询的参数
|
||||||
pageSize:10,
|
const listParm = reactive<OrderListParm>({
|
||||||
type:'',
|
currentPage: 1,
|
||||||
userName:'',
|
pageSize: 10,
|
||||||
total:0
|
type: '',
|
||||||
})
|
userName: '',
|
||||||
//列表
|
total: 0
|
||||||
const getList = async()=>{
|
})
|
||||||
let res = await gePcOrdertListApi(listParm)
|
//列表
|
||||||
if(res && res.code == 200){
|
const getList = async () => {
|
||||||
//设置表格数据
|
let res = await gePcOrdertListApi(listParm)
|
||||||
tableList.value = res.data.records;
|
if (res && res.code == 200) {
|
||||||
//设置分页总条数
|
//设置表格数据
|
||||||
listParm.total = res.data.total;
|
tableList.value = res.data.records;
|
||||||
}
|
//设置分页总条数
|
||||||
}
|
listParm.total = res.data.total;
|
||||||
//搜索
|
|
||||||
const searchBtn = ()=>{
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
//重置
|
|
||||||
const resetBtn = ()=>{
|
|
||||||
listParm.currentPage = 1;
|
|
||||||
listParm.type = ''
|
|
||||||
getList()
|
|
||||||
}
|
}
|
||||||
//页容量改变触发
|
}
|
||||||
const sizeChange = (size:number)=>{
|
//搜索
|
||||||
listParm.pageSize = size;
|
const searchBtn = () => {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
//重置
|
||||||
|
const resetBtn = () => {
|
||||||
|
listParm.currentPage = 1;
|
||||||
|
listParm.type = ''
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
//页容量改变触发
|
||||||
|
const sizeChange = (size: number) => {
|
||||||
|
listParm.pageSize = size;
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
//页数改变触发
|
||||||
|
const currentChange = (page: number) => {
|
||||||
|
listParm.currentPage = page;
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
// 发货
|
||||||
|
const sendOrder = async (orderId: string) => {
|
||||||
|
let confirm = await global.$myconfirm('确定发货吗?')
|
||||||
|
if (confirm) {
|
||||||
|
let res = await sendOrderApi(orderId)
|
||||||
|
if (res && res.code == 200) {
|
||||||
getList()
|
getList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//页数改变触发
|
}
|
||||||
const currentChange = (page:number)=>{
|
|
||||||
listParm.currentPage = page;
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
}
|
nextTick(() => {
|
||||||
onMounted(()=>{
|
tableHeight.value = window.innerHeight - 220
|
||||||
getList()
|
|
||||||
nextTick(()=>{
|
|
||||||
tableHeight.value = window.innerHeight - 220
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
return{
|
})
|
||||||
tableList,
|
return {
|
||||||
listParm,
|
tableList,
|
||||||
getList,
|
sendOrder,
|
||||||
searchBtn,
|
listParm,
|
||||||
resetBtn,
|
getList,
|
||||||
sizeChange,
|
searchBtn,
|
||||||
currentChange,
|
resetBtn,
|
||||||
tableHeight
|
sizeChange,
|
||||||
}
|
currentChange,
|
||||||
|
tableHeight
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in new issue