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

fix:交易规则中查询已设置交易规则的列表接口添加type字段,处理新增交易规则时选中非交易类型规则和电子合同项联动问题,修复采购订单列表售后功能

parent 6434f070
......@@ -101,7 +101,7 @@ const AddUser: React.FC<{}> = () => {
// 模拟请求
const fetchUserList = async (params: any) => {
const data = await PublicApi.getMemberRolePage(params)
const data = await PublicApi.getMemberRolePageByname(params)
return data.data
}
......
import React, { useState, useRef } from 'react'
import { Card, Button, Modal, Row, Col } from 'antd'
import { Card, Button, Modal, Row, Col, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
......@@ -69,15 +69,31 @@ const showDataSource = [
const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const [saleVisible, setSaleVisible] = useState<any>(false)
const [checkedId, setCheckedId] = useState<any>()
const [recordId, setRecordId] = useState<any>()
const ref = useRef<any>({})
// 售后唤起弹窗 @todo
const handleSaleAfter = (id) => {
setSaleVisible(true)
setRecordId(id)
}
const handleOk = () => {
if(checkedId) {
switch(checkedId) {
case 1:
history.push(`/memberCenter/afterService/exchangeApplication/exchangePrSubmit/add?orderId=${recordId}`)
break;
case 2:
history.push(`/memberCenter/afterService/returnApplication/returnPrSubmit/add?orderId=${recordId}`)
break;
case 3:
history.push(`/memberCenter/afterService/repairApplication/repairPrSubmit/add?orderId=${recordId}`)
break;
}
} else {
message.error("请选择售后类型")
}
}
const handleEvaluate = (id) => {
......@@ -92,8 +108,9 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
key: 'ctl',
render: (text, record) => <>
{ record.externalState === PurchaseOrderOutWorkState.FINISH_ORDER && <Button type='link' onClick={() => handleEvaluate(record.id)}>评价</Button> }
{/* todo */}
{/* <Button type='link' onClick={() => handleSaleAfter(record.id)}>售后</Button> */}
{
record.receivingTimes >= 1 && <Button type='link' onClick={() => handleSaleAfter(record.id)}>售后</Button>
}
</>
}
])
......
......@@ -278,9 +278,13 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
// // 查询已设置交易规则的列表
const fatchSetedProducts = (id) => {
PublicApi.getOrderTradingRulesProductIdList({shopId: id}).then(res => {
const { data, code } = res
setIdNotInList(() => data?.productIds || [])
let transactionProcesssId = addSchemaAction.getFieldValue("transactionProcesssId")
addSchemaAction.getFieldState("transactionProcesssId", state => {
let type = state.dataSource.filter(item => item.id === transactionProcesssId)[0]["type"]
PublicApi.getOrderTradingRulesProductIdList({shopId: id, type}).then(res => {
const { data, code } = res
setIdNotInList(() => data?.productIds || [])
})
})
}
......@@ -315,6 +319,18 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
})
fatchSetedProducts(parentState.value[0])
})
$('onFieldInputChange', 'transactionProcesssId').subscribe(parentState => {
// 不是下单交易类型 隐藏电子合同
if(parentState.dataSource.filter(item => item.id === parentState.value)[0]["type"] !== 1) {
setFieldState("MEGA_LAYOUT1_1", state => {
state.visible = false
})
} else {
setFieldState("MEGA_LAYOUT1_1", state => {
state.visible = true
})
}
})
}}
onSubmit={handleSubmit}
actions={addSchemaAction}
......
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