feat: 新增,编辑和复制

This commit is contained in:
zhangds 2024-05-10 18:06:46 +08:00
parent cac2c318a5
commit e0def52bf3
2 changed files with 11 additions and 7 deletions

View File

@ -952,12 +952,14 @@ export default class addKnockGold extends Component {
) : null} ) : null}
{/* 批量需改主体 */} {/* 批量需改主体 */}
<VoucherBatch {this.state.subjectList.length > 0 && (
ref="voucherBatchRef" <VoucherBatch
channel={this.state.model.channel} ref="voucherBatchRef"
subjectList={this.state.subjectList} channel={this.state.model.channel}
voucherBatchData={this.props.data?.voucher_batch} subjectList={this.state.subjectList}
></VoucherBatch> voucherBatchData={this.props.data?.voucher_batch}
/>
)}
<FormItem labelname="批次商品名称" prop="batch_goods_name" id="batch_goods_name"> <FormItem labelname="批次商品名称" prop="batch_goods_name" id="batch_goods_name">
<Ipt <Ipt

View File

@ -1,7 +1,6 @@
import { Grid, Input, Select, Button, Notify } from "zent" import { Grid, Input, Select, Button, Notify } from "zent"
import { useCallback, useState, useMemo, forwardRef, useImperativeHandle, useEffect } from "react" import { useCallback, useState, useMemo, forwardRef, useImperativeHandle, useEffect } from "react"
import { useUpdateEffect } from "ahooks" import { useUpdateEffect } from "ahooks"
import { isPosIntNumber } from "@/tools/validate"
const VoucherBatch = forwardRef((props, ref) => { const VoucherBatch = forwardRef((props, ref) => {
const { channel, voucherBatchData, subjectList } = props const { channel, voucherBatchData, subjectList } = props
@ -29,7 +28,10 @@ const VoucherBatch = forwardRef((props, ref) => {
) )
const [datasets, setDatasets] = useState(() => { const [datasets, setDatasets] = useState(() => {
console.log("voucherBatchData =>", voucherBatchData)
console.log("subjectList =>", subjectList)
if (voucherBatchData) { if (voucherBatchData) {
debugger
let new_data = voucherBatchData.map((item) => { let new_data = voucherBatchData.map((item) => {
let provider_el = subjectList.find((row) => row.key === item.provider) let provider_el = subjectList.find((row) => row.key === item.provider)
return { return {