Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
488c589e
Commit
488c589e
authored
Oct 27, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: merge、交易规则路由调整
parent
821fb4a3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
407 additions
and
0 deletions
+407
-0
index.ts
.../purchaserEvaluation/unevaluated/evaluate/schema/index.ts
+100
-0
index.tsx
...saction/supplierEvaluation/unevaluated/evaluate/index.tsx
+207
-0
index.ts
...n/supplierEvaluation/unevaluated/evaluate/schema/index.ts
+100
-0
No files found.
src/pages/transaction/purchaserEvaluation/unevaluated/evaluate/schema/index.ts
0 → 100644
View file @
488c589e
/*
* @Author: XieZhiXiong
* @Date: 2020-09-23 17:00:24
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-20 17:58:51
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
UPLOAD_TYPE
}
from
'@/constants'
;
export
const
evaluateSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
comments
:
{
type
:
'array'
,
'x-component'
:
'EvaluationList'
,
default
:
[],
items
:
{
type
:
'object'
,
properties
:
{
LEFT_RIGHT
:
{
type
:
'object'
,
'x-component'
:
'LeftRightLayout'
,
'x-component-props'
:
{
rightProps
:
{
span
:
2
,
offset
:
4
,
},
},
properties
:
{
MEGA_LADYOUT
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
labelCol
:
6
,
labelAlign
:
'left'
,
position
:
'left'
,
},
properties
:
{
star
:
{
title
:
'满意程度'
,
required
:
true
,
'x-component'
:
'Rating'
,
'x-component-props'
:
{
allowHalf
:
false
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择满意程度'
,
},
],
},
comment
:
{
type
:
'string'
,
title
:
'评价'
,
'x-component'
:
'TextArea'
,
'x-component-props'
:
{
rows
:
4
,
},
'x-rules'
:
{
max
:
200
,
},
},
picture
:
{
type
:
'string'
,
title
:
'图片'
,
'x-component'
:
'Upload'
,
'x-component-props'
:
{
listType
:
'card'
,
action
:
'/api/file/file/upload/prefix'
,
data
:
{
fileType
:
UPLOAD_TYPE
,
prefix
:
'/purchaserEvaluation/'
,
},
beforeUpload
:
'{{beforeUpload}}'
,
accept
:
'.png, .jpg, .jpeg'
,
},
'x-mega-props'
:
{
addonAfter
:
'{{UploadTip}}'
,
},
},
},
},
smile
:
{
type
:
'object'
,
default
:
1
,
'x-component'
:
'SmilingFace'
,
'x-component-props'
:
{
position
:
'right'
,
},
},
},
},
},
},
},
},
};
\ No newline at end of file
src/pages/transaction/supplierEvaluation/unevaluated/evaluate/index.tsx
0 → 100644
View file @
488c589e
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
PageHeader
,
Descriptions
,
Card
,
Spin
,
Button
,
message
,
}
from
'antd'
;
import
{
FormOutlined
}
from
'@ant-design/icons'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
history
}
from
'umi'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetOrderPurchaseOrderDetailsResponse
}
from
'@/services/OrderApi'
;
import
{
normalizeFiledata
}
from
'@/utils'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
normalizeUnevaluatedList
}
from
'../../utils'
;
import
{
evaluateSchema
}
from
'./schema'
;
import
{
createEffects
}
from
'./effects'
;
import
EvaluationList
from
'../../components/EvaluationList'
;
import
styles
from
'./index.less'
;
const
formActions
=
createFormActions
();
interface
Unevaluated
{
good
:
{
pic
:
string
,
name
:
string
,
price
:
string
,
desc
:
string
,
};
star
:
number
;
comment
:
string
;
picture
:
string
[];
smile
:
number
;
};
interface
OrderInfo
extends
GetOrderPurchaseOrderDetailsResponse
{
unevaluatedList
:
Unevaluated
[];
};
const
EvaluateOrder
:
React
.
FC
=
()
=>
{
const
{
id
}
=
usePageStatus
();
const
[
orderInfo
,
setOrderInfo
]
=
useState
<
OrderInfo
>
(
null
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
getOrderInfo
=
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoLoading
(
true
);
PublicApi
.
getOrderProcurementOrderDetails
({
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
orderProductRequests
}
=
res
.
data
;
setOrderInfo
({
...
res
.
data
,
unevaluatedList
:
normalizeUnevaluatedList
(
orderProductRequests
),
});
}
}).
finally
(()
=>
{
setInfoLoading
(
false
);
});
};
useEffect
(()
=>
{
getOrderInfo
();
},
[]);
const
handleSubmit
=
values
=>
{
setSubmitLoading
(
true
);
const
payload
=
values
.
comments
.
map
(
item
=>
{
const
{
comment
,
good
,
picture
,
star
,
}
=
item
;
return
{
memberId
:
orderInfo
.
supplyMembersId
,
roleId
:
orderInfo
.
supplyMembersRoleId
,
memberName
:
orderInfo
.
supplyMembersName
||
''
,
star
,
comment
,
product
:
JSON
.
stringify
(
good
),
remark
:
orderInfo
.
orderNo
,
productId
:
good
.
productId
,
orderId
:
orderInfo
.
id
,
productImgUrl
:
good
.
pic
,
dealTime
:
orderInfo
.
createTime
,
dealCount
:
good
.
purchaseCount
,
price
:
good
.
price
,
totalPrice
:
orderInfo
.
sumPrice
,
pics
:
picture
.
map
(
item
=>
item
.
status
===
'done'
&&
item
.
data
).
filter
(
Boolean
),
};
});
PublicApi
.
postMemberCommentConsumerOrderTradeSubmit
({
commentSubmitDetailList
:
payload
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
};
const
beforeUpload
=
file
=>
{
if
(
file
.
size
/
1024
<
10
)
{
message
.
warning
(
'图片大小超过10M'
);
return
Promise
.
reject
();
}
};
const
UploadTip
=
(
<
span
style=
{
{
lineHeight
:
'24px'
,
color
:
'#909399'
,
fontWeight
:
400
,
wordBreak
:
'break-all'
,
position
:
'relative'
,
top
:
'34px'
,
}
}
>
支持JPG/PNG/JPEG
<
br
/>
每张最大不超过 10M,尺寸不限
<
br
/>
最大数量限制 4张
</
span
>
);
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
PageHeaderWrapper
title=
{
<>
<
PageHeader
style=
{
{
padding
:
'0'
}
}
onBack=
{
()
=>
history
.
goBack
()
}
title=
{
<
AvatarWrap
info=
{
{
aloneTxt
:
'单'
,
name
:
orderInfo
?.
orderNo
,
}
}
/>
}
extra=
{
(
<>
<
Button
type=
"primary"
icon=
{
<
FormOutlined
/>
}
disabled=
{
!
orderInfo
||
!
orderInfo
.
id
}
loading=
{
submitLoading
}
onClick=
{
()
=>
formActions
.
submit
()
}
>
发布
</
Button
>
</>
)
}
>
<
Descriptions
size=
"small"
column=
{
3
}
style=
{
{
padding
:
'0 32px'
,
}
}
>
<
Descriptions
.
Item
label=
"供应会员"
>
{
orderInfo
?.
supplyMembersName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"下单时间"
span=
{
2
}
>
{
orderInfo
?.
createTime
}
</
Descriptions
.
Item
>
</
Descriptions
>
</
PageHeader
>
</>
}
>
<
NiceForm
actions=
{
formActions
}
initialValues=
{
{
comments
:
orderInfo
?
orderInfo
.
unevaluatedList
:
[],
}
}
expressionScope=
{
{
UploadTip
,
beforeUpload
,
}
}
onSubmit=
{
handleSubmit
}
components=
{
{
EvaluationList
,
}
}
effects=
{
(
$
,
actions
)
=>
{
createEffects
(
$
,
actions
);
}
}
schema=
{
evaluateSchema
}
/>
</
PageHeaderWrapper
>
</
Spin
>
);
};
export
default
EvaluateOrder
;
\ No newline at end of file
src/pages/transaction/supplierEvaluation/unevaluated/evaluate/schema/index.ts
0 → 100644
View file @
488c589e
/*
* @Author: XieZhiXiong
* @Date: 2020-09-23 17:00:24
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-20 17:58:51
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
UPLOAD_TYPE
}
from
'@/constants'
;
export
const
evaluateSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
comments
:
{
type
:
'array'
,
'x-component'
:
'EvaluationList'
,
default
:
[],
items
:
{
type
:
'object'
,
properties
:
{
LEFT_RIGHT
:
{
type
:
'object'
,
'x-component'
:
'LeftRightLayout'
,
'x-component-props'
:
{
rightProps
:
{
span
:
2
,
offset
:
4
,
},
},
properties
:
{
MEGA_LADYOUT
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
labelCol
:
6
,
labelAlign
:
'left'
,
position
:
'left'
,
},
properties
:
{
star
:
{
title
:
'满意程度'
,
required
:
true
,
'x-component'
:
'Rating'
,
'x-component-props'
:
{
allowHalf
:
false
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择满意程度'
,
},
],
},
comment
:
{
type
:
'string'
,
title
:
'评价'
,
'x-component'
:
'TextArea'
,
'x-component-props'
:
{
rows
:
4
,
},
'x-rules'
:
{
max
:
200
,
},
},
picture
:
{
type
:
'string'
,
title
:
'图片'
,
'x-component'
:
'Upload'
,
'x-component-props'
:
{
listType
:
'card'
,
action
:
'/api/file/file/upload/prefix'
,
data
:
{
fileType
:
UPLOAD_TYPE
,
prefix
:
'/purchaserEvaluation/'
,
},
beforeUpload
:
'{{beforeUpload}}'
,
accept
:
'.png, .jpg, .jpeg'
,
},
'x-mega-props'
:
{
addonAfter
:
'{{UploadTip}}'
,
},
},
},
},
smile
:
{
type
:
'object'
,
default
:
1
,
'x-component'
:
'SmilingFace'
,
'x-component-props'
:
{
position
:
'right'
,
},
},
},
},
},
},
},
},
};
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment