@ -9,7 +9,7 @@ import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
import ajax from '@/services'
import ajax from '@/services'
import { useSessionStorageState } from "ahooks"
import { useSessionStorageState } from "ahooks"
import { useNavigate , useLocation } from "react-router-dom"
import { useNavigate , useLocation } from "react-router-dom"
const { RangePicker } = DatePicker ;
function StaggeredOrder ( props ) {
function StaggeredOrder ( props ) {
/ / c o n s t c o n f i g D a t a = p r o p s . s y s C o n f i g [ " l i b - d e p l o y " ] | | { } ;
/ / c o n s t c o n f i g D a t a = p r o p s . s y s C o n f i g [ " l i b - d e p l o y " ] | | { } ;
const [ ajaxLoading , setAjaxLoading ] = useState ( false )
const [ ajaxLoading , setAjaxLoading ] = useState ( false )
@ -39,7 +39,6 @@ function StaggeredOrder(props) {
const [ editVisible , setEditVisible ] = useState ( false )
const [ editVisible , setEditVisible ] = useState ( false )
const [ getSelectStatus , setGetSelectStatus ] = useState ( true )
const [ getSelectStatus , setGetSelectStatus ] = useState ( true )
const [ addVisible , setAddVisible ] = useState ( false )
const [ addVisible , setAddVisible ] = useState ( false )
const [ getCanCaDer , setGetCanCaDer ] = useState ( [ ] ) / / 区 域
/ / 停 车 场 名 称
/ / 停 车 场 名 称
@ -59,11 +58,11 @@ function StaggeredOrder(props) {
setFormData ( { ... formData , method : v } )
setFormData ( { ... formData , method : v } )
}
}
/ / 订 购 时 间
/ / 订 购 时 间
const onChangeTime = ( value , dateString ) => {
setFormData ( {
const onChangeTime = ( value , dateString ) => {
setFormData ( {
... formData ,
... formData ,
start_time : dateString [ 0 ] ,
start_time : dateString [ 0 ] ,
end_time : dateString [ 1 ]
end_time : dateString [ 1 ]
} )
} )
}
}
/ / 商 户 名 称
/ / 商 户 名 称
@ -71,23 +70,13 @@ function StaggeredOrder(props) {
setFormData ( { ... formData , serial_number : value . target . value } )
setFormData ( { ... formData , serial_number : value . target . value } )
}
}
/ / 导 出
const exportData = ( ) => {
let data = {
... formData
}
ajax . getExportOrder ( data ) . then ( res => {
window . open ( res . data . url )
} )
}
const getCascaderList = ( ) => {
/ / 导 出
const exportData = ( ) => {
let data = {
let data = {
type : 3
... formData
}
}
ajax . cascaderList ( data ) . then ( res => {
if ( res . status === 20000 ) {
setGetCanCaDer ( res . data )
}
ajax . getExportOrder ( data ) . then ( res => {
window . open ( res . data . url )
} )
} )
}
}
/ / 列 表
/ / 列 表
@ -105,43 +94,49 @@ function StaggeredOrder(props) {
const deployListColumns = [
const deployListColumns = [
{
{
title : '序号' ,
title : '序号' ,
dataIndex : 'id' ,
key : 'id' ,
render : ( _ , record , index ) => {
return index + 1
}
} ,
} ,
{
{
title : '物品编号 ' ,
dataIndex : 'cod e' ,
key : 'cod e' ,
title : '停车场名称 ' ,
dataIndex : 'road_nam e' ,
key : 'road_nam e' ,
} ,
} ,
{
{
title : '物品名称 ' ,
dataIndex : 'goods_nam e' ,
key : 'goods_nam e' ,
title : '车牌号 ' ,
dataIndex : 'plat e' ,
key : 'plat e' ,
} ,
} ,
{
{
title : '物品类型 ' ,
dataIndex : 'brand_nam e' ,
key : 'brand_nam e' ,
title : '手机号 ' ,
dataIndex : 'phon e' ,
key : 'phon e' ,
} ,
} ,
{
{
title : '物品型号 ' ,
dataIndex : 'model_name ' ,
key : 'model_name ' ,
title : '订单金额 ' ,
dataIndex : 'order_amount ' ,
key : 'order_amount ' ,
} ,
} ,
{
{
title : '状态 ' ,
dataIndex : 'goods_status ' ,
key : 'goods_status ' ,
title : '支付方式 ' ,
dataIndex : 'method ' ,
key : 'method ' ,
} ,
} ,
{
{
title : '领用人 ' ,
dataIndex : 'use_name ' ,
key : 'use_name ' ,
title : '渠道流水号 ' ,
dataIndex : 'serial_number ' ,
key : 'serial_number ' ,
} ,
} ,
{
{
title : '商户名称' ,
dataIndex : 'shop_name' ,
key : 'shop_name' ,
title : '同步MS状态' ,
dataIndex : 'status' ,
key : 'status' ,
} ,
{
title : '订购时间' ,
dataIndex : 'order_time' ,
key : 'order_time' ,
} ,
} ,
{
{
title : '操作' ,
title : '操作' ,
@ -150,13 +145,12 @@ function StaggeredOrder(props) {
< Popover content = {
< Popover content = {
< div className = "operateBtn" >
< div className = "operateBtn" >
< div onClick = { ( ) => { CheckBtn ( record ) } } > 查看 < / div >
< div onClick = { ( ) => { CheckBtn ( record ) } } > 查看 < / div >
< div onClick = { ( ) => { translateBtn ( record ) } } > 编辑 < / div >
< / div > } >
< / div > } >
< button className = "scheduleBtn colorBtn" > 操作 < / button >
< button className = "scheduleBtn colorBtn" > 操作 < / button >
< / Popover >
< / Popover >
< / >
< / >
} ,
} ,
} , ]
} ]
/ / 查 看 弹 窗
/ / 查 看 弹 窗
const [ getRecordData , setGetRecordData ] = useState ( [ ] )
const [ getRecordData , setGetRecordData ] = useState ( [ ] )
const CheckBtn = ( record ) => {
const CheckBtn = ( record ) => {
@ -186,20 +180,6 @@ function StaggeredOrder(props) {
uid : ''
uid : ''
} )
} )
const [ getId , setGetId ] = useState ( { } )
const [ getId , setGetId ] = useState ( { } )
const translateBtn = ( record ) => {
setGetId ( record )
setEditVisible ( true )
setGetEditData ( Object . assign ( { } , getEditData , {
region_id : record . region_id ,
operatorid : record . operatorid ,
code : record . code ,
name : record . goods_name ,
brand_id : record . brand_id ,
model_id : record . model_id ,
status : record . status ,
uid : record . use_name ,
} ) )
}
const editModal = ( ) => {
const editModal = ( ) => {
setEditVisible ( false )
setEditVisible ( false )
}
}
@ -215,70 +195,12 @@ function StaggeredOrder(props) {
return result ;
return result ;
}
}
const handleDeColumns = [
const handleDeColumns = [
{
title : '序号' ,
render : ( _ , record , index ) => {
return index + 1
}
} ,
{
title : '停车场名称' ,
dataIndex : 'shop_name' ,
key : 'shop_name' ,
} ,
{
title : '车牌号' ,
dataIndex : 'code' ,
key : 'code' ,
} ,
{
title : '手机号' ,
dataIndex : 'goods_name' ,
key : 'goods_name' ,
} ,
{
title : '订单金额' ,
dataIndex : 'brand_name' ,
key : 'brand_name' ,
} ,
{
title : '支付方式' ,
dataIndex : 'model_name' ,
key : 'model_name' ,
} ,
{
title : '渠道流水号' ,
dataIndex : 'goods_status' ,
key : 'goods_status' ,
} ,
{
title : '同步MS状态' ,
dataIndex : 'use_name' ,
key : 'use_name' ,
} ,
{
title : '订购时间' ,
dataIndex : 'use_name' ,
key : 'use_name' ,
} ,
{
title : '操作' ,
render : ( text , record ) => {
return < >
< Popover content = {
< div className = "operateBtn" >
< div onClick = { ( ) => { CheckBtn ( record ) } } > 查看 < / div >
< / div > } >
< button className = "scheduleBtn colorBtn" > 操作 < / button >
< / Popover >
< / >
} ,
}
]
]
/ / 获 取 列 表 数 据
/ / 获 取 列 表 数 据
const getData = ( data = formData ) => {
const getData = ( data = formData ) => {
setAjaxLoading ( true )
setAjaxLoading ( true )
ajax . assets List( data ) . then ( res => {
ajax . getOrderList ( data ) . then ( res => {
setAjaxLoading ( false )
setAjaxLoading ( false )
if ( res . status === 20000 ) {
if ( res . status === 20000 ) {
let resDataArr = res . data . list . map ( ( item ) => {
let resDataArr = res . data . list . map ( ( item ) => {
@ -288,7 +210,7 @@ function StaggeredOrder(props) {
setResultData ( {
setResultData ( {
... resultData ,
... resultData ,
data : resDataArr ,
data : resDataArr ,
total_records : res . data . total_records
total_records : res . data . total
} )
} )
} else {
} else {
setResultData ( {
setResultData ( {
@ -322,33 +244,6 @@ function StaggeredOrder(props) {
const getSearchData = ( data = formData ) => {
const getSearchData = ( data = formData ) => {
getData ( data )
getData ( data )
}
}
const [ getOperationName , setGetOperationName ] = useState ( [ ] )
const operatorid = ( ) => {
ajax . assetsType ( ) . then ( res => {
setGetOperationName ( res . data )
} )
}
const [ getMerchantDataName , setGetMerchantDataName ] = useState ( [ ] )
const merchantDataName = ( ) => {
ajax . getOperator ( ) . then ( res => {
setGetMerchantDataName ( res . data )
} )
}
const [ getAssetsModel , setGetAssetsModel ] = useState ( [ ] )
const assetsModelName = ( ) => {
let data = {
brand_id : getBrandId
}
ajax . assetsModel ( data ) . then ( res => {
setGetAssetsModel ( res . data )
} )
}
const [ getRecipient , setGetRecipient ] = useState ( [ ] )
const recipientName = ( ) => {
ajax . recipient ( ) . then ( res => {
setGetRecipient ( res . data )
} )
}
/ / 添 加
/ / 添 加
const addData = ( ) => {
const addData = ( ) => {
setAddVisible ( true )
setAddVisible ( true )
@ -372,10 +267,6 @@ function StaggeredOrder(props) {
Object . assign ( { } , checkData , { region_id : newValue } )
Object . assign ( { } , checkData , { region_id : newValue } )
) ;
) ;
} ;
} ;
/ / 商 户 名 称
const handleAddDeployType = ( value ) => {
setCheckData ( { ... checkData , operatorid : value } )
}
/ / 物 品 编 号
/ / 物 品 编 号
const handleAddLoginName = ( v ) => {
const handleAddLoginName = ( v ) => {
setCheckData ( { ... checkData , code : v . target . value } )
setCheckData ( { ... checkData , code : v . target . value } )
@ -384,15 +275,6 @@ function StaggeredOrder(props) {
const handleAddAssetsName = ( v ) => {
const handleAddAssetsName = ( v ) => {
setCheckData ( { ... checkData , name : v . target . value } )
setCheckData ( { ... checkData , name : v . target . value } )
}
}
/ / 物 品 类 型
const handleAddOperator = ( v ) => {
setGetBrandId ( v )
setCheckData ( { ... checkData , brand_id : v } )
}
/ / 物 品 型 号
const handleAddJobStatus = ( value ) => {
setCheckData ( { ... checkData , model_id : value } )
}
/ / 状 态
/ / 状 态
const handleAddStatus = ( v ) => {
const handleAddStatus = ( v ) => {
setCheckData ( { ... checkData , status : v } )
setCheckData ( { ... checkData , status : v } )
@ -403,10 +285,6 @@ function StaggeredOrder(props) {
setGetSelectStatus ( true )
setGetSelectStatus ( true )
}
}
}
}
/ / 领 用 人
const handleAddRecipient = ( v ) => {
setCheckData ( { ... checkData , uid : v } )
}
const placeSaveBtn = ( ) => {
const placeSaveBtn = ( ) => {
let data = {
let data = {
... checkData ,
... checkData ,
@ -463,9 +341,6 @@ function StaggeredOrder(props) {
setAddVisible ( false )
setAddVisible ( false )
setEditVisible ( false )
setEditVisible ( false )
}
}
useEffect ( ( ) => {
assetsModelName ( )
} , [ getBrandId ] )
const [ sessionTabList , setSessionTabList ] = useSessionStorageState ( 'StaggeredOrder' , {
const [ sessionTabList , setSessionTabList ] = useSessionStorageState ( 'StaggeredOrder' , {
value : {
value : {
}
}
@ -490,17 +365,17 @@ function StaggeredOrder(props) {
... formData
... formData
} )
} )
} , [ formData ] )
} , [ formData ] )
/ / u s e E f f e c t ( ( ) = > {
/ / r e t u r n ( ) = > {
/ / s e s s i o n S t o r a g e . r e m o v e I t e m ( ' S t a g g e r e d O r d e r ' )
/ / }
/ / } , [ ] )
const [ getMerchantDataName , setGetMerchantDataName ] = useState ( [ ] )
const merchantDataName = ( ) => {
ajax . getPayData ( ) . then ( res => {
if ( res . status === 20000 ) {
setGetMerchantDataName ( res )
}
} )
}
useEffect ( ( ) => {
useEffect ( ( ) => {
getData ( )
getData ( )
operatorid ( )
merchantDataName ( )
merchantDataName ( )
recipientName ( )
getCascaderList ( )
} , [ ] )
} , [ ] )
return < >
return < >
< div className = "paid-StaggeredOrder" >
< div className = "paid-StaggeredOrder" >
@ -511,7 +386,7 @@ function StaggeredOrder(props) {
< Input
< Input
placeholder = "请输入停车场名称"
placeholder = "请输入停车场名称"
value = { formData . road }
value = { formData . road }
style = { { width : 220 } }
style = { { width : 255 } }
onChange = { handlePartName }
onChange = { handlePartName }
/ >
/ >
< / div >
< / div >
@ -520,7 +395,7 @@ function StaggeredOrder(props) {
< Input
< Input
placeholder = "请输入手机号"
placeholder = "请输入手机号"
value = { formData . phone }
value = { formData . phone }
style = { { width : 220 } }
style = { { width : 255 , marginLeft : 28 } }
onChange = { handlePhone }
onChange = { handlePhone }
/ >
/ >
< / div >
< / div >
@ -529,14 +404,14 @@ function StaggeredOrder(props) {
< Input
< Input
placeholder = "请输入车牌号"
placeholder = "请输入车牌号"
value = { formData . plate }
value = { formData . plate }
style = { { width : 220 } }
style = { { width : 255 , marginLeft : 28 } }
onChange = { handlePlate }
onChange = { handlePlate }
/ >
/ >
< / div >
< / div >
< div className = "yisa-search" >
< div className = "yisa-search" >
< label > 支付方式 < / label >
< label > 支付方式 < / label >
< Select
< Select
style = { { width : 220 } }
style = { { width : 255 , marginLeft : 14 } }
value = { formData . method }
value = { formData . method }
options = { getMerchantDataName }
options = { getMerchantDataName }
onChange = { handleMethod }
onChange = { handleMethod }
@ -545,6 +420,7 @@ function StaggeredOrder(props) {
< div className = "yisa-search" >
< div className = "yisa-search" >
< label > 订购时间 < / label >
< label > 订购时间 < / label >
< RangePicker
< RangePicker
style = { { width : 255 , marginLeft : 14 } }
showTime = { {
showTime = { {
format : 'HH:mm:ss' ,
format : 'HH:mm:ss' ,
} }
} }
@ -557,7 +433,7 @@ function StaggeredOrder(props) {
< Input
< Input
placeholder = "请输入"
placeholder = "请输入"
value = { formData . serial_number }
value = { formData . serial_number }
style = { { width : 220 } }
style = { { width : 255 } }
onChange = { handleSerial }
onChange = { handleSerial }
/ >
/ >
< / div >
< / div >
@ -633,28 +509,6 @@ function StaggeredOrder(props) {
>
>
< div className = "add" >
< div className = "add" >
< div className = "yisa-search" >
< div className = "yisa-search" >
< label > 区域 < / label >
< Cascader options = { getCanCaDer }
onChange = { onChange }
changeOnSelect
style = { { width : 180 , marginLeft : 47 } }
fieldNames = { {
label : 'name' ,
value : 'id' ,
children : 'children'
} }
/ >
< / div >
< div className = "yisa-search" >
< label > 商户名称 < / label >
< Select
style = { { width : 180 , marginLeft : 20 } }
value = { checkData . operatorid }
options = { getMerchantDataName }
onChange = { handleAddDeployType }
/ >
< / div >
< div className = "yisa-search" >
< label > 物品编号 < / label >
< label > 物品编号 < / label >
< Input
< Input
placeholder = "请输入"
placeholder = "请输入"
@ -673,25 +527,6 @@ function StaggeredOrder(props) {
/ >
/ >
< / div >
< / div >
< div className = "yisa-search" >
< div className = "yisa-search" >
< label > 物品类型 < / label >
< Select
value = { checkData . brand_id }
style = { { width : 180 , marginLeft : 20 } }
options = { getOperationName }
onChange = { handleAddOperator }
/ >
< / div >
< div className = "yisa-search" >
< label > 物品型号 < / label >
< Select
placeholder = "请选择"
value = { checkData . model_id }
style = { { width : 180 , marginLeft : 20 } }
options = { getAssetsModel }
onChange = { handleAddJobStatus }
/ >
< / div >
< div className = "yisa-search" >
< label > 状态 < / label >
< label > 状态 < / label >
< Select
< Select
style = { { width : 180 , marginLeft : 47 } }
style = { { width : 180 , marginLeft : 47 } }
@ -710,17 +545,6 @@ function StaggeredOrder(props) {
] }
] }
/ >
/ >
< / div >
< / div >
< div className = "yisa-search" >
< label > 领用人 < / label >
< Select
style = { { width : 180 , marginLeft : 33 } }
placeholder = "请选择"
disabled = { getSelectStatus }
value = { checkData . uid }
options = { getRecipient }
onChange = { handleAddRecipient }
/ >
< / div >
< div className = "submitBtn" >
< div className = "submitBtn" >
< button type = "primary" className = "submit colorBtn" onClick = { ( ) => { placeSaveBtn ( ) } } >
< button type = "primary" className = "submit colorBtn" onClick = { ( ) => { placeSaveBtn ( ) } } >
提交
提交
@ -739,37 +563,6 @@ function StaggeredOrder(props) {
>
>
< div className = "add" >
< div className = "add" >
< div className = "yisa-search" >
< div className = "yisa-search" >
< label > 区域 < / label >
< Cascader options = { getCanCaDer }
changeOnSelect
style = { { width : 180 , marginLeft : 47 } }
value = { getEditData . region_id }
fieldNames = { {
label : 'name' ,
value : 'id' ,
children : 'children'
} }
onChange = { ( newValue ) => {
setGetEditData (
Object . assign ( { } , getEditData , { region_id : newValue } )
) ;
} }
/ >
< / div >
< div className = "yisa-search" >
< label > 商户名称 < / label >
< Select
style = { { width : 180 , marginLeft : 20 } }
value = { getEditData . operatorid }
options = { getMerchantDataName }
onChange = { ( value ) => {
setGetEditData (
Object . assign ( { } , getEditData , { operatorid : value } )
) ;
} }
/ >
< / div >
< div className = "yisa-search" >
< label > 物品编号 < / label >
< label > 物品编号 < / label >
< Input
< Input
placeholder = "请输入"
placeholder = "请输入"
@ -796,33 +589,6 @@ function StaggeredOrder(props) {
/ >
/ >
< / div >
< / div >
< div className = "yisa-search" >
< div className = "yisa-search" >
< label > 物品类型 < / label >
< Select
value = { getEditData . brand_id }
style = { { width : 180 , marginLeft : 20 } }
options = { getOperationName }
onChange = { ( v ) => {
setGetEditData (
Object . assign ( { } , getEditData , { brand_id : v } )
) ;
} }
/ >
< / div >
< div className = "yisa-search" >
< label > 物品型号 < / label >
< Select
placeholder = "请选择"
value = { getEditData . model_id }
style = { { width : 180 , marginLeft : 20 } }
options = { getAssetsModel }
onChange = { ( value ) => {
setGetEditData (
Object . assign ( { } , getEditData , { model_id : value } )
) ;
} }
/ >
< / div >
< div className = "yisa-search" >
< label > 状态 < / label >
< label > 状态 < / label >
< Select
< Select
style = { { width : 180 , marginLeft : 47 } }
style = { { width : 180 , marginLeft : 47 } }
@ -845,21 +611,6 @@ function StaggeredOrder(props) {
] }
] }
/ >
/ >
< / div >
< / div >
< div className = "yisa-search" >
< label > 领用人 < / label >
< Select
style = { { width : 180 , marginLeft : 33 } }
placeholder = "请选择"
disabled = { getSelectStatus }
value = { getEditData . uid }
options = { getRecipient }
onChange = { ( v ) => {
setGetEditData (
Object . assign ( { } , getEditData , { uid : v } )
) ;
} }
/ >
< / div >
< div className = "submitBtn" >
< div className = "submitBtn" >
< button type = "primary" className = "submit colorBtn" onClick = { ( ) => { editBtn ( ) } } >
< button type = "primary" className = "submit colorBtn" onClick = { ( ) => { editBtn ( ) } } >
提交
提交