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

Merge branch 'dev' into test

parents f0e03866 a63820dd
registry = "http://10.0.0.19:7001"
registry="http://10.0.0.19:4873"
# registry = "https://registry.npmjs.org/"
......@@ -978,6 +978,7 @@ export enum DeliverySideState {
// 订单外部显示文案
export const PurchaseOrderOutWorkStateTexts = {
"-1": "取消订单",
0: '订单完成',
1: '待提交订单',
2: '待确认订单',
3: '待确认电子合同',
......@@ -1051,6 +1052,7 @@ export const SaleOrderInsideWorkStateTexts = {
// 订单流转记录外部状态
export const OrderTransformOutWorkStateTexts = {
"-1": '取消订单',
0: '订单完成',
1: '待确认',
2: '待确认电子合同',
3: '待支付',
......@@ -1074,6 +1076,7 @@ export const OrderTransformOutWorkStateTexts = {
// 采购订单流转记录内部状态
export const PurchaseOrderTransformInsideWorkStateTexts = {
"-1": '取消订单',
0: '订单完成',
1: '待提交审核',
2: '提交审核通过',
3: '审核通过',
......
......@@ -33,7 +33,7 @@ const { Option } = Select
let _tableDataSource: any = []
const PriceAttributeForm: React.FC<Iprops> = (props) => {
const PriceAttributeForm: React.FC<Iprops> = (props) => {
const { onRef } = props
const priceFormRef = useRef()
const updateFlag = useRef(true) // 是否第一次构建
......@@ -58,15 +58,15 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
const [colums, setColumns] = useState<ColumnType<any>[]>()
const { ProductStore } = store
const {
productName,
selectedGoods,
productSelectAttribute,
setProductSelectAttribute,
tableDataSource,
setTableDataSource,
clearData,
setPriceAttributeParams,
const {
productName,
selectedGoods,
productSelectAttribute,
setProductSelectAttribute,
tableDataSource,
setTableDataSource,
clearData,
setPriceAttributeParams,
productInfoByEdit,
getPriceAttributeFormParamsByEdit,
selectCategoryId,
......@@ -136,7 +136,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
useEffect(() => {
// 品类 变动清空form和属性组合
if(history.location.query?.id && !flagRef.current) {
flagRef.current = true
flagRef.current = true
} else {
// setProductSelectAttribute([])
priceForm.resetFields()
......@@ -147,7 +147,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
/**
* 添加clearPrice.current依赖,处理在未渲染价格属性前已经变动了价格属性组合,此时需要清空价格数据
* bug: 在不改变那价格属性组合情况下修改价格可以保留,当属性组合变动之后,修改价格再做其他修改时会清空价格(原因:clearPrice.current始终为true)
* 添加 tabClickItem
* 添加 tabClickItem
* 价格属性变动引发的构建,清空价格(仅清空一次)之后置为false
*/
useEffect(()=>{
......@@ -170,7 +170,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if(hasAttribute.length){ // 提取价格属性 属性名数组 属性值SKU数组 /*编辑情况下直接进入此页面length为空 此时需获取调用接口返回的数据生成*/
hasAttribute.map(_item=>{
_attributeNameArr.push(_item.attributeName) // 用于列header
_temp_attributeObjArr.push({attributeName: _item.attributeName, customerAttributeId: _item.customerAttributeId})
_temp_attributeObjArr.push({attributeName: _item.attributeName, customerAttributeId: _item.customerAttributeId})
let _tempArr = []
let _tempObjArr = [] // 取id备用 //....若为日期属性,此处应获取日期段的每一天 进行特殊处理....//
// if(_item.isDate){
......@@ -273,14 +273,14 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if(_attributeNameArr?.length>0){
_attributeNameArr.map( _attr => {
_col.push({
title: _attr,
dataIndex: _attr,
title: _attr,
dataIndex: _attr,
key: _attr
})
})
}
_col.push({
title: planPrice===3?'所需积分':'单价(元)',
title: planPrice===3?'所需积分':'单价(元)',
dataIndex: '单价',
key: '单价',
width: 200,
......@@ -389,21 +389,21 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
let _tempArr: any = []
Array.isArray(item) ? item.map((_item, _index) => { /* code2 */
let _tempObject: any = {};
_tempObject.customerAttribute = {
id: attributeObjArr[_index].customerAttributeId,
id: attributeObjArr[_index].customerAttributeId,
name: attributeObjArr[_index].attributeName
}
_tempObject.customerAttributeValue = {
id: attributeValObjArr.map(__item => __item.find(_ => _.value===_item)).filter(__ => __)[0].id,
id: attributeValObjArr.map(__item => __item.find(_ => _.value===_item)).filter(__ => __)[0].id,
value: item[_index]
}
_tempArr.push(_tempObject)
}) : ( /* code3 */
// ** 可能是单一多选 attributeValObjArr可能为多个
_tempArr.push({
_tempArr.push({
customerAttribute: {
id: attributeObjArr[0].customerAttributeId,
id: attributeObjArr[0].customerAttributeId,
name: attributeObjArr[0].attributeName
},
customerAttributeValue: {
......@@ -414,7 +414,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
) /* code3 end */ /* code2 end */
_paramsArray.push({
goodsId: _tableDataSource[index] ? _tableDataSource[index]['对应货品'] : 0,
attributeAndValueList: _tempArr,
attributeAndValueList: _tempArr,
unitPrice: _tableDataSource[index]&&_tableDataSource[index]['单价'],
id: _tableDataSource[index]&&_tableDataSource[index]['规格ID'],
}) /*带上货品id 带上单价*/
......@@ -432,7 +432,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
/**
* @description table选择货品改变对应的data数据
* @param v modal数据对象
* @param record table行记录
* @param record table行记录
*/
const tableSelelctChange = (v: number, record: any) => {
let _row = { ...record, 对应货品: v }
......@@ -526,12 +526,12 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if(numberArray[0][0] === minOrder){
let tempArr = [];
numberArray.map((_item, _index) => {
tempArr.push({ numberPrice: priceArray[_index], numberRange: { numberMin: _item[0], numberMax: _item[1] } })
tempArr.push({ numberPrice: priceArray[_index], numberRange: { numberMin: _item[0], numberMax: _item[1] } })
})
setPriceForm.setFieldsValue({ladderPrice: true, ladderRange: tempArr})
}else{
let tempArr = [];
tempArr.push({ numberPrice: null, numberRange: { numberMin: minOrder, numberMax: null } })
tempArr.push({ numberPrice: null, numberRange: { numberMin: minOrder, numberMax: null } })
setPriceForm.setFieldsValue({ladderPrice: true, ladderRange: tempArr})
}
}
......@@ -558,6 +558,25 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
// 校验阶梯范围
const validatorNumberRange = (rule, value, callback) => {
let minOrder = Number(minOrderNumber)
let precision;
if(Number.isInteger(minOrder)) { // 整数取1
precision = 1
} else { // 小数取最小精度(最多三位)
switch(minOrderNumber.toString().split(".")[1].length) {
case 1:
precision = 0.1
break;
case 2:
precision = 0.01
break;
case 3:
precision = 0.001
break;
default:
precision = 1
}
}
try {
if(Array.isArray(value)){
let range = value.map(item => {
......@@ -565,6 +584,12 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
return Object.values(item.numberRange)
}).reduce(
function(a, b) {
// 判断首位数是否满足精度
if(a.length && b.length) {
if((Number(b[0])*1000 - Number(a[a.length-1])*1000)/1000 !== precision) {
throw new Error('请正确输入阶梯数量范围');
}
}
return a.concat(b);
},
[]
......@@ -589,8 +614,8 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
/**
* 按属性归类
* @param objectArray
* @param {string} property
* @param objectArray
* @param {string} property
*/
const groupBy = (objectArray, property) => {
......@@ -615,7 +640,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
// initialValues={productInfoByEdit?.id ? getPriceAttributeFormParamsByEdit : {isMemberPrice: false, priceType: planPrice}}
autoComplete="off"
>
<Form.Item
<Form.Item
name="unitId"
label={
<span>
......@@ -725,10 +750,10 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
{
planPrice != 2 && productName && <Button type="text" style={{float: 'right'}} onClick={clickBatchSetPrice}><SettingOutlined />{planPrice === 3 ? '批量设置积分' : '批量设置价格'}</Button>
}
<Table
rowKey="索引"
dataSource={tableDataSource}
columns={planPrice === 2 ? colums.slice(0, colums.length-2) : colums}
<Table
rowKey="索引"
dataSource={tableDataSource}
columns={planPrice === 2 ? colums.slice(0, colums.length-2) : colums}
pagination={false}
locale={{emptyText:<>暂无数据<br />请先完善商品基本信息项!</>}}
style={{clear: 'both'}}
......@@ -750,7 +775,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
initialValues={{ladderPrice: false}}
autoComplete="off"
>
{
{
planPrice!==3 &&
<Form.Item
label=""
......@@ -874,4 +899,4 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
</>)
}
export default observer(PriceAttributeForm)
\ No newline at end of file
export default observer(PriceAttributeForm)
......@@ -197,7 +197,7 @@ const FastModifyPrice: React.FC<{}> = () => {
let priceArray = Object.values(data)
let tempArr = [];
numberArray.map((_item, _index) => {
tempArr.push({ numberPrice: priceArray[_index], numberRange: { numberMin: _item[0], numberMax: _item[1] } })
tempArr.push({ numberPrice: priceArray[_index], numberRange: { numberMin: _item[0], numberMax: _item[1] } })
})
setForm.setFieldsValue({ladderPrice: true, ladderRange: tempArr})
}
......@@ -237,6 +237,25 @@ const FastModifyPrice: React.FC<{}> = () => {
// 校验阶梯范围
const validatorNumberRange = (rule, value, callback) => {
let minOrder = Number(currentRow.minOrder)
let precision;
if(Number.isInteger(minOrder)) { // 整数取1
precision = 1
} else { // 小数取最小精度(最多三位)
switch(minOrder.toString().split(".")[1].length) {
case 1:
precision = 0.1
break;
case 2:
precision = 0.01
break;
case 3:
precision = 0.001
break;
default:
precision = 1
}
}
try {
if(Array.isArray(value)){
let range = value.map(item => {
......@@ -244,6 +263,12 @@ const FastModifyPrice: React.FC<{}> = () => {
return Object.values(item.numberRange)
}).reduce(
function(a, b) {
// 判断首位数是否满足精度
if(a.length && b.length) {
if((Number(b[0])*1000 - Number(a[1])*1000)/1000 !== precision) {
throw new Error('请正确输入阶梯数量范围');
}
}
return a.concat(b);
},
[]
......@@ -283,7 +308,7 @@ const FastModifyPrice: React.FC<{}> = () => {
FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(state => {
searchCustomerCategoryOptionEffect(actions, 'customerCategoryId')
})
}}
}}
schema={fastSchema}
/>
}
......@@ -406,9 +431,9 @@ const FastModifyPrice: React.FC<{}> = () => {
label={priceType===3 ? "积分" : "单价"}
name="uniquePrice"
rules={[
{
{
required: true,
message: priceType===3 ? '请输入积分!' : '请输入单价!'
message: priceType===3 ? '请输入积分!' : '请输入单价!'
},
{
pattern: priceType!==3 ? /^\d+(\.\d{1,4})?$/ : /^[1-9]\d*$/,
......@@ -425,4 +450,4 @@ const FastModifyPrice: React.FC<{}> = () => {
)
}
export default FastModifyPrice
\ No newline at end of file
export default FastModifyPrice
......@@ -14,10 +14,10 @@ import cx from 'classnames'
import ReutrnEle from '@/components/ReturnEle'
import styles from "./index.less"
import { PublicApi } from '@/services/api'
import {
GetProductCommodityGetCommodityResponse,
GetProductCommodityGetCommodityCheckRecordResponse,
GetProductCommodityGetShopResponse
import {
GetProductCommodityGetCommodityResponse,
GetProductCommodityGetCommodityCheckRecordResponse,
GetProductCommodityGetShopResponse
} from '@/services/ProductApi'
import moment from 'moment'
import { isGetAccessor } from 'typescript'
......@@ -92,13 +92,13 @@ const viewProducts: React.FC<{}> = () => {
setLogisticResourceSendAddress(provinceName + cityName + districtName + address)
})
}, [productDetail])
const columns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'memberRoleId',
key: 'memberRoleId',
render: (t, c, i) => i + 1
render: (t, c, i) => i + 1
},
{
title: '角色',
......@@ -139,7 +139,7 @@ const viewProducts: React.FC<{}> = () => {
title: '操作时间',
dataIndex: 'createTime',
key: 'createTime',
render: (text: any) => moment(text).format("YYYY-MM-DD HH:mm:ss")
render: (text: any) => moment(text).format("YYYY-MM-DD HH:mm:ss")
},
{
title: '意见',
......@@ -190,7 +190,7 @@ const viewProducts: React.FC<{}> = () => {
component = null
}else
if (status === 5)
component = (<span style={{ color: '#00B37A', padding: '2px 5px', background: 'rgba(235,247,242,1)', borderRadius: '4px' }}>已上架</span>)
component = (<span style={{ color: '#00B37A', padding: '2px 5px', background: 'rgba(235,247,242,1)', borderRadius: '4px' }}>已上架</span>)
else if (status === 6)
component = (<span style={{ padding: '2px 5px', background: 'rgba(244,245,247,1)', borderRadius: '4px' }}>已下架</span>)
else
......@@ -212,7 +212,7 @@ const viewProducts: React.FC<{}> = () => {
<Descriptions.Item label="商品品牌">{productDetail?.brand?.name}</Descriptions.Item>
<Descriptions.Item label="商品品类">{productDetail?.customerCategory?.fullName}</Descriptions.Item>
{/* {
productDetail?.commodityShopList?.length>0 &&
productDetail?.commodityShopList?.length>0 &&
<Descriptions.Item label="上架商城">
{
productDetail.commodityShopList.map((item, index)=><span key={index}><img width="24" height="24" style={{borderRadius: '50%', marginRight: 4}} src={item.logoUrl} title={item.name} alt={item.name}/></span>)
......@@ -224,7 +224,7 @@ const viewProducts: React.FC<{}> = () => {
<Descriptions.Item label="商品类型"><span className="commonStatusValid"></span>{renderCustomerCategoryType(productDetail?.customerCategory?.type)}</Descriptions.Item>
</Descriptions>
</>
const renderPriceType = (type: number) => {
if(type === 1 ) return '现货价格'
if(type === 2 ) return '价格需要询价'
......@@ -262,22 +262,22 @@ const viewProducts: React.FC<{}> = () => {
})
attributeByValue.map(_ => {
_col.push({
title: _.name,
dataIndex: _.name,
title: _.name,
dataIndex: _.name,
key: '索引'
})
})
}
if(item.goods?.id){ // 存在货品
_col.push({
title: '对应货品',
dataIndex: '对应货品',
key: '索引',
title: '对应货品',
dataIndex: '对应货品',
key: '索引',
})
}
}
_col.push({
title: product?.priceType===3?'所需积分':'单价(元)',
title: product?.priceType===3?'所需积分':'单价(元)',
dataIndex: '单价',
key: '单价',
render: (text, record) => {
......@@ -344,8 +344,8 @@ const viewProducts: React.FC<{}> = () => {
return <>
<p>
{
str === 'area'
?
str === 'area'
?
showDataSource.map((_item, _i) => <p key={_i}>{_item.provinceName+'/'+(_item.cityName||'')}</p>)
:
showDataSource.map((_item, _i) => <p key={_i}>{_item.name}</p>)
......@@ -419,7 +419,7 @@ const viewProducts: React.FC<{}> = () => {
</Col>
</Row>
{
productDetail?.commodityShopList?.length>0 &&
productDetail?.commodityShopList?.length>0 &&
<Row>
<Col span={4}>
<p>上架商城:</p>
......@@ -438,7 +438,7 @@ const viewProducts: React.FC<{}> = () => {
<Col span={8}>
<Card headStyle={{borderBottom:'none'}} title="物流信息" style={{height:'100%'}}>
{
renderDeliveryType(productDetail?.logistics?.deliveryType) &&
renderDeliveryType(productDetail?.logistics?.deliveryType) &&
<Row>
<Col span={4}>
<p>配送方式:</p>
......@@ -460,7 +460,7 @@ const viewProducts: React.FC<{}> = () => {
</Row>
}
{
productDetail?.logistics?.weight &&
productDetail?.logistics?.weight &&
<Row>
<Col span={4}>
<p>重量:</p>
......@@ -471,7 +471,7 @@ const viewProducts: React.FC<{}> = () => {
</Row>
}
{
logisticTemplateName &&
logisticTemplateName &&
<Row>
<Col span={4}>
<p>运费模版:</p>
......@@ -482,7 +482,7 @@ const viewProducts: React.FC<{}> = () => {
</Row>
}
{
logisticResourceCompanyName &&
logisticResourceCompanyName &&
<Row>
<Col span={4}>
<p>物流公司:</p>
......@@ -493,7 +493,7 @@ const viewProducts: React.FC<{}> = () => {
</Row>
}
{
logisticResourceSendAddress &&
logisticResourceSendAddress &&
<Row>
<Col span={4}>
<p>发货地址:</p>
......@@ -613,7 +613,7 @@ const viewProducts: React.FC<{}> = () => {
<Col span={6}>
<p>
{
productDetail?.isMemberPrice && '允许使用会员折扣购买'
productDetail?.isMemberPrice ? '允许使用会员折扣购买' : '无'
}
</p>
</Col>
......@@ -637,7 +637,7 @@ const viewProducts: React.FC<{}> = () => {
{/* 没有价格属性默认一行直接显示图片 */}
<div className={styles.productImgBox}>
{
productDetail?.unitPriceAndPicList[0].commodityPic.length>0 && productDetail?.unitPriceAndPicList[0].commodityPic.map((_item, index) =>
productDetail?.unitPriceAndPicList[0].commodityPic.length>0 && productDetail?.unitPriceAndPicList[0].commodityPic.map((_item, index) =>
<div key={index} className={styles.imgItem}><img className={styles.pic} src={_item} alt=""/>
</div>)
}
......@@ -665,7 +665,7 @@ const viewProducts: React.FC<{}> = () => {
<Divider />
<div className={styles.productImgBox}>
{
imageArrByImageRender.length>0 && imageArrByImageRender[index].map((_item, _index) =>
imageArrByImageRender.length>0 && imageArrByImageRender[index].map((_item, _index) =>
<div key={_index} className={styles.imgItem}><img className={styles.pic} src={_item} alt=""/>
</div>)
}
......@@ -680,7 +680,7 @@ const viewProducts: React.FC<{}> = () => {
<Card headStyle={{borderBottom:'none'}} title="商品描述">
{/* 文字区块 */}
{
productDetail?.commodityRemark?.word?.length>0 &&
productDetail?.commodityRemark?.word?.length>0 &&
<div className={cx(styles.descriptionBox, styles.descriptionWordBox)}>
{
productDetail?.commodityRemark?.word.map((_item, _index) =>
......@@ -691,7 +691,7 @@ const viewProducts: React.FC<{}> = () => {
}
{/* 视频区块 */}
{
productDetail?.commodityRemark?.video?.length>0 &&
productDetail?.commodityRemark?.video?.length>0 &&
<div className={styles.descriptionBox}>
{
productDetail?.commodityRemark?.video.map((_item, _index)=> <div key={_index} className={styles.videoItem}>
......@@ -704,7 +704,7 @@ const viewProducts: React.FC<{}> = () => {
}
{/* 图片区块 */}
{
productDetail?.commodityRemark?.image?.length>0 &&
productDetail?.commodityRemark?.image?.length>0 &&
<div className={styles.descriptionBox}>
{
productDetail?.commodityRemark?.image.map((_item, _index)=> _item && <div key={_index} className={styles.imgItem}>
......
......@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'
import cx from 'classnames'
import { PublicApi } from '@/services/api'
import { GetPayCreditGetCreditResponse } from '@/services/PayApi'
import { message } from 'antd'
import { DownOutlined } from '@ant-design/icons'
import alipayIcon from '@/assets/imgs/alipay_icon.png'
import wechatIcon from '@/assets/imgs/wechat_icon.png'
......@@ -48,6 +49,7 @@ const PayWay: React.FC<PayWayProps> = (props) => {
}
PublicApi.getPayCreditGetCredit(param).then(res => {
message.destroy()
if(res.code === 1000) {
setCreditInfo(res.data)
}
......
......@@ -206,8 +206,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}).then(res => {
if(res.code === 1000) {
setBalanceInfo(res.data)
} else {
message.error(res.message)
}
setIsSpin(false)
})
......
......@@ -71,7 +71,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
orderProductList: logsiticsDataMaps.map(v => ({
templateId: v.logistics.templateId,
weight: v.logistics.weight,
count: v?.purchaseCount || null
count: v?.purchaseCount || 0
})),
receiverAddressId: typeof receiverAddressId === 'object' ? receiverAddressId.id : receiverAddressId
}, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => {
......
......@@ -9,7 +9,7 @@ import { message } from 'antd'
export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, memberId: any, memberRoleId: any, orderProducts: any): any => {
const paywayData = useRef<any>({})
const [columns, setColumns] = useState<any[]>(paymentInformationColumns)
const { productSumPrice } = useContext(ReadyAddOrderDetailContext)
// const { schemaActions, detailData } = useContext(ReadyAddOrderDetailContext)
const components = {
body: {
row: EditableRow,
......@@ -68,6 +68,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
// })
// }, [])
useEffect(() => {
// 当选择报价单/会员/商品时有memberId传入时 调用支付方式api
if(memberId) {
......@@ -75,28 +76,36 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
}
}, [memberId])
// useEffect(() => {
// // 当有商品数据传入的时 判断商品只有是物流的才能使用到付
// if(orderProducts?.length) {
// const newColumns = [...columns]
// let options = newColumns[5].formItemProps.options
// if(orderProducts.filter(item => item.deliveryType === 1).length !== orderProducts.length) {
// if(options.filter(_item => _item.payType === 4).length) {
// options.filter(_item => _item.payType === 4)[0].disabled = true
// }
// } else {
// if(options.filter(_item => _item.payType === 4).length) {
// options.filter(_item => _item.payType === 4)[0].disabled = false
// }
// }
// // 多次支付也要禁用到付
// if(ctx.getFieldValue('paymentInformationResponses').length > 1) {
// if(options.filter(_item => _item.payType === 4).length)
// options.filter(_item => _item.payType === 4)[0].disabled = true
// } else {
// if(options.filter(_item => _item.payType === 4).length)
// options.filter(_item => _item.payType === 4)[0].disabled = false
// }
// }
// }, [orderProducts, columns])
useEffect(() => {
// 当有商品数据传入的时 判断商品只有是物流的才能使用到付
if(orderProducts?.length) {
const newColumns = [...columns]
let options = newColumns[5].formItemProps.options
if(orderProducts.filter(item => item.deliveryType === 1).length !== orderProducts.length) {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = true
} else {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false
}
// 多次支付也要禁用到付
if(ctx.getFieldValue('paymentInformationResponses').length > 1) {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = true
} else {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false
}
restrictArrivalPay(columns, orderProducts)
}
}, [orderProducts, columns])
}, [orderProducts])
const getPayLists = (memberId, memberRoleId) => {
PublicApi.getPayPayWayList({memberId, memberRoleId}).then(res => {
......@@ -105,7 +114,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
const newColumns = [...columns]
newColumns[5].formItemProps.options = initPayWayList(data)
paywayData.current = data
restrictArrivalPay(newColumns, orderProducts)
setColumns(newColumns)
} else {
message.error(res.message)
......@@ -113,6 +122,39 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
})
}
// 限制使用到付(多次支付和商品仅有物流)
const restrictArrivalPay = (cols, pros) => {
if(pros?.length) {
// const newColumns = [...columns]
const newColumns = [...cols]
let options = newColumns[5].formItemProps.options
if(pros.filter(item => item.deliveryType === 1).length !== pros.length) {
if(options.filter(_item => _item.payType === 4).length) {
options.filter(_item => _item.payType === 4)[0].disabled = true
}
} else {
if(options.filter(_item => _item.payType === 4).length) {
options.filter(_item => _item.payType === 4)[0].disabled = false
}
}
setTimeout(() => {
let payment = ctx.getFieldValue('paymentInformationResponses')
// 多次支付也要禁用到付
if(payment?.length > 1) {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = true
}
else {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false
}
} , 1000)
setColumns(newColumns)
}
}
const handleSave = row => {
return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('paymentInformationResponses')];
......
......@@ -95,6 +95,9 @@ export const useSelfTable = () => {
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.DELIVERY_APPROVED_SUCCESS &&
<Button type='link' onClick={() => handlePreview(record)}>查看物流单</Button>
}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.NOT_ACCEPTED_DELIVERY &&
<Button type='link' onClick={() => handleModify(record)}>修改物流单</Button>
}
</>
}
]
......@@ -115,6 +118,11 @@ export const useSelfTable = () => {
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?id=${logisticsId}&invoicesTypeId=2`)
}
const handleModify = async (record) => {
const logisticsId = record.logisticsId
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/edit?id=${logisticsId}`)
}
return {
columns: customOrderColumns
}
......
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