Commit 48777062 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理销售订单区块字段显示异常、待确认订单添加合同签署供功能,处理新增采购订单数量大于最小起订数商品数据显示异常,处理商品提交审核后编辑时需要传入规格id、商品上架查询店铺时添加会员角色字段

parent f93466ce
......@@ -21,6 +21,7 @@ const DateRangePickerUnix = (props) => {
return (
<RangePicker
showTime={true}
style={{minWidth: 160}}
placeholder={placeholder}
onChange={handleChange}
......
......@@ -247,10 +247,12 @@ const AddProducts: React.FC<{}> = (props) => {
} else { // 编辑时没有点击商品图片(新增没有点击也就没有数据)
if(productInfoByEdit){
_params.unitPriceAndPicList = productInfoByEdit.unitPriceAndPicList
// 没有点击图片单单修改了商品价格 取原有的图片和新的价格合成
_params.isAllAttributePic = productInfoByEdit.isAllAttributePic
// 没有点击图片单单修改了商品价格 取原有的图片和新的价格合成(编辑属性组合变更,不点击图片,直接报存)
if (clickTabIndex.indexOf("4") !== -1) {
_params.unitPriceAndPicList = priceAttributeParams.map((item, index) => {
return {
id: item.id,
goods: { id: item.goodsId },
attributeAndValueList: item.attributeAndValueList,
unitPrice: item.unitPrice,
......@@ -281,6 +283,7 @@ const AddProducts: React.FC<{}> = (props) => {
_params.packing = productInfoByEdit.packing
_params.afterService = productInfoByEdit.afterService
}
_params.isUpdateAttribute = productInfoByEdit.isUpdateAttribute
}
// 校验属性单位重量是否提供发票
......
......@@ -94,7 +94,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
// }
// } , [combineAttributeArray.length]) // 监听属性组合是否有变动(由属性组合引发数据构建清空价格)
// // *bug* 不点击本页面之前就变更了价格属性 这里的属性组合监听就失效了
// // *todo* 不点击本页面之前就变更了价格属性 这里的属性组合监听就失效了
useEffect(() => {
let len = combineAttributeArray?.length
if(len){
......@@ -323,9 +323,11 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}) : _tempObj[_attributeNameArr[i]||_attributeNameArr[0]] = _rowArr // 当一项变动的时候 找_attributeNameArr可能会找不到 找不到的情况下置为索引0的那项
if(history.location.query?.id){
// 编辑的时候,先指定数据中的货品id,如果是重新组合的不存在id就使用选择的货品中的第一个,如果没有置为0;同理,不存在单价就置为{}
// _tempObj['对应货品'] = selectedGoods[i] && selectedGoods[i]?.id || selectedGoods[0]?.id || 0
_tempObj['对应货品'] = selectedGoods.length > 0 ? selectedGoods[0].id : 0
// 通过 isUpdateAttribute 判断是否需要携带unitPriceAndPicList的id字段
if(!productInfoByEdit.isUpdateAttribute){
_tempObj['规格ID'] = productInfoByEdit.unitPriceAndPicList[i]?.id
}
if(updateFlag.current){ // 初次渲染tab 再次进入tab采用缓存数据
_tempObj['单价'] = productInfoByEdit.unitPriceAndPicList[i]?.unitPrice || {}
}else{
......@@ -346,7 +348,10 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}else{ // length不存在,默认只有商品名称一行(无价格属性组合)只有一行的情况下单价可能有,可能阶梯价,也可能没有
let _tempObj: any = { 索引: 0 ,商品名称: productName }
_tempObj['对应货品'] = selectedGoods.length > 0 ? selectedGoods[0].id : 0 // 编辑情况下 对应货品id和单价 特殊处理
// 携带unitPriceAndPicList的id字段
if(!productInfoByEdit.isUpdateAttribute){
_tempObj['规格ID'] = productInfoByEdit.unitPriceAndPicList[0]?.id
}
if(updateFlag.current){
_tempObj['单价'] = productInfoByEdit?.unitPriceAndPicList[0]?.unitPrice || {}
}else{
......@@ -410,12 +415,14 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
_paramsArray.push({
goodsId: _tableDataSource[index] ? _tableDataSource[index]['对应货品'] : 0,
attributeAndValueList: _tempArr,
unitPrice: _tableDataSource[index]&&_tableDataSource[index]['单价']
unitPrice: _tableDataSource[index]&&_tableDataSource[index]['单价'],
id: _tableDataSource[index]&&_tableDataSource[index]['规格ID'],
}) /*带上货品id 带上单价*/
}) : _paramsArray.push({
goodsId: _tableDataSource[0] ? _tableDataSource[0]['对应货品'] : 0,
attributeAndValueList: [],
unitPrice: _tableDataSource[0]&&_tableDataSource[0]['单价']
unitPrice: _tableDataSource[0]&&_tableDataSource[0]['单价'],
id: _tableDataSource[0]&&_tableDataSource[0]['规格ID'],
}) /*带上货品id 带上单价*/ /* code1 end */
setPriceAttributeParams(_paramsArray)
......
......@@ -30,7 +30,14 @@ const ProductImageForm: React.FC<{}> = (props) => {
const editRowIndexRef = useRef<number>(0)
const { ProductStore } = store
const { priceAttributeParams, productInfoByEdit, setProductAttributeAndImageParams, setIsAllAttributePic, selectCategoryId, tabClickItem } = ProductStore
const {
priceAttributeParams,
productInfoByEdit,
setProductAttributeAndImageParams,
setIsAllAttributePic,
selectCategoryId,
tabClickItem
} = ProductStore
// 再次点击tab 选中置为0
useEffect(() => {
......@@ -104,7 +111,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
setIsAllAttributePic(setImageType)
_priceAttributeParams = priceAttributeParams.map((_item, _index) => {
let _obj = {..._item}
let _obj = {..._item, goodsId: _item.goods.id}
_obj.commodityPic = maintainImageData[_index] || []
return _obj
})
......
......@@ -451,7 +451,7 @@ const Products: React.FC<{}> = () => {
const onChangeUpShop = (values) => {
// 判断上架之前是否有店铺 有即可以上下架
if(judgeShopRef.current){
PublicApi.getTemplateShopFindShop().then(res => {
PublicApi.getTemplateShopFindShop({memberRoleId: JSON.parse(window.localStorage.getItem('auth')).memberRoleId}).then(res => {
if(res.data.id){
setShopId(res.data.id)
setCheckedValues(values)
......
import React, { useEffect } from 'react'
import React, { useContext, useEffect, useState } from 'react'
import ModalForm from '@/components/ModalForm'
import { createFormActions } from '@formily/antd'
import { createFormActions, registerVirtualBox } from '@formily/antd'
import { OrderDetailContext } from '../../_public/order/context'
import { Checkbox } from 'antd'
export interface ApprovedOrderModalProps {
currentRef: any,
onConfirm(),
loading?: boolean,
title?: string
title?: string,
isUseElectronicContract?: boolean,
}
// 虚线边框
registerVirtualBox("CustomDashLayout", ({ children, schema }) => {
return (
<>
<p style={{ fontSize: 12, color: '#c0c4cc' }}>注:勾选则表示同意签署电子合同,电子合同与纸质合同一样具备同等法律效力</p>
<div style={{ borderTop: "1px dashed #DFE1E6", marginTop: 24, height: 24 }}>
{children}
</div>
</>
);
});
// 采用电子合同字段的Schema
const ApproveSchemaUseContract = {
type: 'object',
properties: {
NO_SUBMIT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'top',
},
properties: {
// 合同相关
isElectronicContract: {
type: 'boolean',
"x-component": 'children',
"x-component-props": {
children: "",
},
title: '电子合同',
"x-rules": [
{
message: '请先生成电子合同',
required: true
}
],
},
electronicContractName: {
type: 'string',
display: false,
},
electronicContractUrl: {
type: 'string',
display: false,
},
signatureLogId: {
type: 'string',
display: false,
},
//--
NOFIELD: {
type: "object",
title: "",
"x-component": "CustomDashLayout",
"x-component-props": {},
},
state: {
type: 'radio',
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
],
default: 1,
"x-linkages": [
{
type: 'value:visible',
target: 'cause',
condition: "{{$value === 0}}"
},
{
type: 'value:visible',
target: 'isElectronicContract',
condition: "{{$value === 1}}"
},
{
type: 'value:visible',
target: 'NOFIELD',
condition: "{{$value === 1}}"
}
]
},
cause: {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多60个汉字'
},
title: '审核不通过原因',
"x-rules": [
{
required: true,
message: '请输入审核不通过原因'
},
{
limitByte: true,
maxByte: 30
}
]
}
}
}
}
}
// 不采用电子合同字段的Schema
const ApproveSchema = {
type: 'object',
properties: {
NO_SUBMIT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'top',
},
properties: {
state: {
type: 'radio',
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
],
default: 1,
"x-linkages": [
{
type: 'value:visible',
target: 'cause',
condition: "{{$value === 0}}"
},
{
type: 'value:visible',
target: 'isElectronicContract',
condition: "{{$value === 1}}"
},
{
type: 'value:visible',
target: 'NOFIELD',
condition: "{{$value === 1}}"
}
]
},
cause: {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多60个汉字'
},
title: '审核不通过原因',
"x-rules": [
{
required: true,
message: '请输入审核不通过原因'
},
{
limitByte: true,
maxByte: 30
}
]
}
}
}
}
}
const approvedActions = createFormActions()
// 需要弹窗确认的审核订单
const ApprovedOrderModal:React.FC<ApprovedOrderModalProps> = (props) => {
const { currentRef, onConfirm, title, children, loading } = props
const { currentRef, onConfirm, title, children, loading, isUseElectronicContract = false } = props
const { data } = useContext(OrderDetailContext)
const [checkedContract, setCheckedContract] = useState<boolean>(false)
useEffect(() => {
if (currentRef) {
currentRef.current = Object.assign({}, currentRef.current, {actions: approvedActions})
}
}, [currentRef])
const onChange = (e) => {
setCheckedContract(e.target.checked)
if(e.target.checked) {
approvedActions.setFieldValue("isElectronicContract", true)
} else {
approvedActions.setFieldValue("isElectronicContract", null)
}
}
return <ModalForm
modalTitle={title || '提示'}
currentRef={currentRef}
confirm={onConfirm}
actions={approvedActions}
schema={{
type: 'object',
properties: {
NO_SUBMIT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'top',
},
properties: {
state: {
type: 'radio',
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
],
default: 1,
"x-linkages": [
{
type: 'value:visible',
target: 'cause',
condition: "{{$value === 0}}"
}
]
},
cause: {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多60个汉字'
},
title: '审核不通过原因',
"x-rules": [
{
required: true,
message: '请输入审核不通过原因'
},
{
limitByte: true,
maxByte: 30
}
]
}
schema={isUseElectronicContract ? ApproveSchemaUseContract : ApproveSchema}
effects={($, ctx) => {
$('onFormInit').subscribe(() => {
ctx.setFieldState("isElectronicContract", innerState => {
innerState.props['x-component-props'] = {
children: <><Checkbox onChange={onChange} />&nbsp;&nbsp;<a href={data.electronicContractUrl} target="blank">{data.electronicContractName}</a></>
}
}
}
})
})
}}
modalProps={{confirmLoading: loading}}
/>
......
......@@ -76,11 +76,14 @@ const schema: ISchema = {
}
]
},
electronicContractUrl: {
type: 'string',
display: false,
},
signatureLogId: {
type: 'string',
display: false,
},
state: {
type: 'radio',
title: '是否审核通过',
......@@ -143,6 +146,7 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const { code, data: resData } = await run(params)
if (code === 1000) {
schemaActions.setFieldValue('electronicContractName', resData.contractName)
schemaActions.setFieldValue('signatureLogId', resData.signatureLogId) //** */
schemaActions.setFieldValue('electronicContractUrl', resData.contractUrl)
schemaActions.setFieldState('electronicContractName', state => {
state.props["x-component-props"].children = <a href={resData.contractUrl} download={resData.contractName} target='_blank'>{resData.contractName}</a>
......
import React, { useEffect, useState, useContext } from 'react'
import { Modal } from 'antd'
import { message, Modal } from 'antd'
import { OrderDetailContext } from '../../_public/order/context'
import { PublicApi } from '@/services/api'
import { history } from 'umi'
......@@ -7,13 +7,16 @@ import { useHttpRequest } from '@/hooks/useHttpRequest'
export interface OrderElectronModalProps {
currentRef: any,
type?: 'purchaseOrder' | 'saleOrder',
ctx?: any
}
//@todo 尚未完成
const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const { currentRef } = props
const { currentRef, type, ctx } = props
const { data } = useContext(OrderDetailContext)
const { run, loading } = useHttpRequest(PublicApi.postOrderElectronicContractsAffirm)
// @ts-ignore
const { run, loading } = useHttpRequest(type === 'saleOrder' ? PublicApi.postOrderSignaturePlatformSign : PublicApi.postOrderElectronicContractsAffirm)
const [visible, setVisible] = useState(false)
useEffect(() => {
currentRef.current = {
......@@ -21,17 +24,40 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
setVisible
}
}, [])
const handleSubmit = async () => {
console.log('签署')
const params = {
id: parseInt(data.id),
let params: any = {}
if(type === 'saleOrder') {
params.contractName = data.electronicContractName
params.contractUrl = data.electronicContractUrl
} else {
params.id = parseInt(data.signatureLogId)
}
const { code } = await run(params)
if (code === 1000) {
const res = await run(params)
if (res.code === 1000) {
setVisible(false)
if(type === 'saleOrder') {
handleConfirmOrder({
id: Number(data.id),
state: ctx.getFieldValue('state'),
signatureLogId: res.data.signatureLogId
})
} else {
history.goBack()
}
}
}
const handleConfirmOrder = async (params) => {
const res = await PublicApi.postOrderConfirmedOrder(params, { ctlType: 'none' })
if(res.code === 1000) {
history.goBack()
} else {
message.error(res.message)
}
}
return (
<Modal
width={1000}
......
import React, { useState, useEffect, useContext, useRef } from 'react'
import { Modal, Steps, Row, Col, Radio, message, Upload, Button, Input } from 'antd'
import { Modal, Steps, Row, Col, Spin, message, Upload, Button, Input } from 'antd'
import style from './index.less'
import { OrderDetailContext } from '../../_public/order/context'
import cx from 'classnames'
......@@ -9,6 +9,7 @@ import { usePageStatus } from '@/hooks/usePageStatus'
import { PublicApi } from '@/services/api'
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest'
import { encryptedByAES } from '@/utils/cryptoAes'
export interface OrderPayModalProps {
currentRef: any,
......@@ -76,12 +77,12 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const { run, loading } = useHttpRequest(PublicApi.postOrderPendingOrderPay)
const [visible, setVisible] = useState(false)
const [checked, setChecked] = useState<any>({})
const [current, setCurrent] = useState(0) // 0选择方式 1线下支付方式 2授信支付 3余额支付 4微信支付 1000清除
const [current, setCurrent] = useState(0) // 0选择方式 1线下支付方式 2授信支付 3余额支付 4微信支付 5货到付款 1000清除
const [payStep, setPayStep] = useState(0) // 支付模态框的步骤 0选方式 1下一步的具体操作 2输入支付密码
const [code, setCode] = useState('')
const [number, setNumber] = useState([0,1,2,3,4,5])
const { currentRef, confirm } = props
const [currentPayInfo, setCurrentPayInfo] = useState<any>()
const [isSpin, setIsSpin] = useState<boolean>(false)
const [creditInfo, setCreditInfo] = useState<any>()
const [balanceInfo, setBalanceInfo] = useState<any>()
......@@ -111,27 +112,42 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
setPayStep(1)
} else if (checked.id === 6) { // 授信额度支付
console.log('选择了授信支付')
PublicApi.getPayCreditGetCredit({parentMemberId: data.supplyMembersId, parentMemberRoleId: data.supplyMembersRoleId}).then(res => {
setIsSpin(true)
PublicApi.getPayCreditGetCredit({
parentMemberId: data.supplyMembersId,
parentMemberRoleId: data.supplyMembersRoleId
}).then(res => {
if(res.code === 1000) {
setCreditInfo(res.data)
} else {
message.error(res.message)
}
setIsSpin(false)
})
setCurrent(2)
setPayStep(1)
} else if (checked.id === 4) { // 余额支付
console.log('选择了余额支付')
PublicApi.getPayAssetAccountGetUserBalance({parentMemberId: data.supplyMembersId, parentMemberRoleId: data.supplyMembersRoleId, payType: data.ruleConfigurationId}).then(res => {
setIsSpin(true)
PublicApi.getPayAssetAccountGetUserBalance({
parentMemberId: data.supplyMembersId,
parentMemberRoleId: data.supplyMembersRoleId,
payType: data.ruleConfigurationId
}).then(res => {
if(res.code === 1000) {
setBalanceInfo(res.data)
} else {
message.error(res.message)
}
setIsSpin(false)
})
setCurrent(3)
setPayStep(1)
}
} else if(checked.id === 7) {
console.log('选择了货到付款')
setCurrent(5)
setPayStep(1)
}
// else if(checked.id === 2) {
// console.log('选择了微信支付')
// setCurrent(4)
......@@ -139,7 +155,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
// handleSubmitPay()
// }
else {
message.error('暂只支持线下支付、授信额度支付、余额支付方式')
message.error('暂只支持线下支付、授信额度支付、余额支付方式、货到付款')
}
} else {
message.error('请先选择支付方式')
......@@ -178,6 +194,10 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} else {
message.error('您的账户余额不足')
}
} else if(current === 5) {
// 开始提交货到付款数据
console.log('开始提交货到付款数据', payPrice)
handleSubmitPay()
}
confirm && confirm()
......@@ -207,7 +227,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
if(code.length != number.length){
return message.error('请输入支付密码')
}
params.payPassword = code
params.payPassword = encryptedByAES(code)
} else if(current === 1) {
params.payOrderUrls = payOrderUrls.join(',')
}
......@@ -327,7 +347,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
{/* 授信支付 */}
{
current === 2 &&
<div>
<Spin spinning={isSpin}>
<p>授信额度</p>
<p>
<span className={style.title}>
......@@ -361,12 +381,12 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
{data?.paymentInformationResponses?.filter(item => item.id === Number(currentPayInfoId))[0]?.payPrice?.toFixed(2)}
</span>
</p>
</div>
</Spin>
}
{/* 余额支付 */}
{
current === 3 &&
<div>
<Spin spinning={isSpin}>
<p>账户余额</p>
<p>
<span className={style.title}>
......@@ -384,6 +404,29 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
{data?.paymentInformationResponses?.filter(item => item.id === Number(currentPayInfoId))[0]?.payPrice?.toFixed(2)}
</span>
</p>
</Spin>
}
{/* 货到付款 */}
{
current === 5 &&
<div>
<p>货到付款支付确认</p>
<p>
<span className={style.title}>
支付方式:
</span>
<span className={style.amount}>
货到付款
</span>
</p>
<p>
<span className={style.title}>
支付金额(元):
</span>
<span className={cx(style.amount, style.amount2)}>
{data?.paymentInformationResponses?.filter(item => item.id === Number(currentPayInfoId))[0]?.payPrice?.toFixed(2)}
</span>
</p>
</div>
}
{/* 微信扫码支付 */}
......
......@@ -280,6 +280,7 @@ export const productInfoColumns: any[] = [
if(r?.commodityId) {
return <PriceComp priceSection={r.unitPrice}/>
} else {
console.log(r,'rr')
return r.price
}
}
......
......@@ -172,11 +172,12 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
switch (page_type) {
case '0': {
// 新增订单/编辑订单
let _orderProductRequests = JSON.parse(JSON.stringify(value.orderProductRequests))
const params = {
...value,
deliveryTime: moment(value.deliveryTime).valueOf(),
// 没用的字段
orderProductRequests: value.orderProductRequests.map(v => {
orderProductRequests: _orderProductRequests.map(v => {
v.price = 1
v.isMemberPrice = Number(v.isMemberPrice)
v.memberPrice = parseInt(v.memberPrice)
......
......@@ -44,7 +44,6 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id))
ctx.setFieldValue('orderProductRequests', newData)
}
const [productColumns, setProductColumns] = useState(() => {
if (pageStatus === PageStatus.ADD) {
productInfoColumns[productInfoColumns.length - 1].render = (text, record) => {
......
......@@ -52,8 +52,8 @@ export const useSelfTable = () => {
{
title: '采购会员',
align: 'left',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
dataIndex: 'memberName',
key: 'memberName',
},
{
title: '总金额/已支付(元)',
......
......@@ -34,7 +34,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
......@@ -34,7 +34,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
......@@ -42,8 +42,8 @@ export const useSelfTable = () => {
{
title: '采购会员',
align: 'left',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
dataIndex: 'memberName',
key: 'memberName',
},
{
title: '总金额',
......
......@@ -34,7 +34,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
......@@ -38,7 +38,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
......@@ -52,8 +52,8 @@ export const useSelfTable = () => {
{
title: '采购会员',
align: 'left',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
dataIndex: 'memberName',
key: 'memberName',
},
{
title: '总金额',
......
......@@ -34,7 +34,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
......@@ -10,6 +10,7 @@ import ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../../components/orderDetailSection';
import OrderElectronModal from '@/pages/transaction/components/orderElectronModal';
const ReadyConfirmOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
......@@ -17,22 +18,41 @@ const ReadyConfirmOrderDetail: React.FC = () => {
const approvedRef = useRef<any>({})
const handleClick = useCallback(() => {
approvedRef.current.setVisible(true)
PublicApi.getOrderSignatureAuthAuthState().then(res => {
if(res.code === 1000) {
approvedRef.current.setVisible(true)
}
})
}, [])
const electronRef = useRef<any>({})
// const handleClick = useCallback(() => {
// electronRef.current.setVisible(true)
// }, [])
// 提交表单
const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async () => {
approvedRef.current.actions.submit().then(async (v) => {
const params = {
id: Number(id),
state: 1
state: v.values.state,
cause: v.values.cause,
}
const result = await run(params)
if (result.code === 1000) {
if(v.values.state) { // 通过
approvedRef.current.setVisible(false)
history.goBack()
electronRef.current.setVisible(true)
} else { // 不通过
const result = await run(params)
if (result.code === 1000) {
approvedRef.current.setVisible(false)
history.goBack()
}
}
console.log(params, v, 'v', approvedRef.current, electronRef.current)
})
}, [])
......@@ -56,6 +76,13 @@ const ReadyConfirmOrderDetail: React.FC = () => {
currentRef={approvedRef}
onConfirm={handleSubmit}
loading={loading}
isUseElectronicContract={formContext.data?.usingElectronicContracts ? true : false}
/>
{/* 提交时触发的签合同弹窗集合 */}
<OrderElectronModal
currentRef={electronRef}
type='saleOrder'
ctx={approvedRef.current.actions}
/>
</OrderDetailContext.Provider>
</div>
......
......@@ -34,7 +34,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
......@@ -52,8 +52,8 @@ export const useSelfTable = () => {
{
title: '采购会员',
align: 'left',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
dataIndex: 'memberName',
key: 'memberName',
},
{
title: '总金额',
......
......@@ -34,7 +34,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
......@@ -82,8 +82,8 @@ export const useSelfTable = () => {
{
title: '采购会员',
align: 'left',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
dataIndex: 'memberName',
key: 'memberName',
},
{
title: '总金额/已支付(元)',
......
......@@ -34,7 +34,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
......@@ -34,7 +34,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
......@@ -34,7 +34,7 @@ export const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
......
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