Commit 88e7c9a3 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞 fix(商品询价、采购询价、需求采购计划): x修复bug

parent ea6636fb
......@@ -137,6 +137,7 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
{...otherProps}
>
<StandardTable
keepAlive={false}
columns={columns}
tableProps={{
...tableProps,
......
......@@ -33,6 +33,7 @@ const AddQuotes: React.FC<parmas> = (props) => {
PublicApi.getTransactionProductQuotationDetails({ id }).then(res => {
if (res.code === 1000) {
setEditData(res.data);
console.log(res.data, 123)
setInquiryLNo({
orderNo: res.data.inquiryListNo,
orderId: res.data.inquiryListId
......
......@@ -115,7 +115,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
details: editData.details
})
setinquiryNo({
orderId: editData.id,
orderId: editData.inquiryListId || editData.id ,
orderNo: editData.inquiryListNo
});
}
......
......@@ -256,6 +256,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
case 'audit':
return 'auditOpinion';
case 'planAudit':
case 'billBack':
return 'cause'
default:
return 'reason'
......
......@@ -62,7 +62,6 @@ const Material: React.FC<Materialprops> = (props: any) => {
<Form.Item
style={{ marginBottom: 0 }}
name={`needCount${index}`}
initialValue={text}
rules={[
{
required: true,
......@@ -102,7 +101,7 @@ const Material: React.FC<Materialprops> = (props: any) => {
<Form.Item
style={{ marginBottom: 0 }}
name={`arriveTime${index}`}
initialValue={text && moment(text)}
rules={[{ required: true, message: '请选择到货日期', }]}
>
<DatePicker
style={{ width: '100%' }}
......@@ -141,7 +140,12 @@ const Material: React.FC<Materialprops> = (props: any) => {
const handleArriveTime = (val, index) => {
const data = [...dataSource];
data[index].arriveTime = val.format('x');
if (val) {
console.log(val)
data[index].arriveTime = val.format('x');
} else {
data[index].arriveTime = undefined
}
setDataSource(data)
}
......@@ -157,8 +161,8 @@ const Material: React.FC<Materialprops> = (props: any) => {
number: item.code,
name: item.name,
model: item.type,
category: !isEmpty(item.customerCategory) && item.customerCategory.name,
brand: !isEmpty(item.brand) && item.brand.name,
category: !isEmpty(item.customerCategory) ? item.customerCategory.name : null,
brand: !isEmpty(item.brand) ? item.brand.name : null,
unit: item.unitName,
needCount: item.needCount ? item.needCount : null,
costPrice: item.costPrice,
......@@ -180,10 +184,12 @@ const Material: React.FC<Materialprops> = (props: any) => {
const data = [...dataSource];
data.splice(index, 1);
message.success('删除成功')
form.resetFields();
data.forEach((item, index) => {
console.log(moment(Number(item.arriveTime)))
form.setFieldsValue({
[`needCount${index}`]: item.needCount ? item.needCount : undefined,
[`arriveTime${index}`]: item.arriveTime ? moment(item.arriveTime) : undefined,
[`arriveTime${index}`]: item.arriveTime ? moment(Number(item.arriveTime)) : undefined,
})
})
setDataSource(data)
......@@ -197,6 +203,7 @@ const Material: React.FC<Materialprops> = (props: any) => {
state: true,
name: 'material',
data: {
addType: _res.addType,
details: dataSource,
},
})
......@@ -214,6 +221,13 @@ const Material: React.FC<Materialprops> = (props: any) => {
/**编辑回显数据 */
if (!isEmpty(fetchdata.details)) {
const data = [...fetchdata.details];
form.resetFields();
data.forEach((item, index) => {
form.setFieldsValue({
[`needCount${index}`]: item.needCount ? item.needCount : undefined,
[`arriveTime${index}`]: item.arriveTime ? moment(item.arriveTime) : undefined,
})
})
setDataSource([...data])
}
}, [fetchdata.details])
......@@ -222,12 +236,13 @@ const Material: React.FC<Materialprops> = (props: any) => {
<Form {...layout} form={form}>
<Form.Item
label='添加方式'
name='materielMode'
name='addType'
rules={[{ required: true, message: '请选择添加方式' }]}
initialValue={1}
>
<Radio.Group>
<Radio value={1}>选择货品生成</Radio>
<Radio value={2}>导入计划采购物料</Radio>
{/* <Radio value={2}>导入计划采购物料</Radio> */}
</Radio.Group>
</Form.Item>
<Button
......
......@@ -68,7 +68,7 @@ const DemandDetailed = () => {
const params = {
id,
}
await PublicApi.getPurchaseNeedPlanDetails({ ...params }).then(res => {
await PublicApi.getPurchaseNeedPlanDetails({ ...params }).then((res: any) => {
if (res.code !== 1000) {
history.goBack();
return;
......@@ -92,6 +92,7 @@ const DemandDetailed = () => {
createRoleId: item.needPlanId,
createTime: item.operateTime,
department: item.department,
stateName: item.status,
id: item.id,
memberId: null,
memberRoleId: null,
......
......@@ -181,6 +181,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
type: 2,
})
})
form.setFieldsValue({ "rowCol": data })
setRowCtl(data);
}
}
......@@ -239,6 +240,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
setValue(fetchdata.type);
fetchdata.shopIds && handleStoreIds(fetchdata.shopIds);
fetchdata.demandMembers && setRowCtl([...fetchdata.demandMembers]);
fetchdata.demandMembers && form.setFieldsValue({ "rowCol": fetchdata.demandMembers })
}
}, [fetchdata])
......@@ -295,7 +297,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
)}
{value === 3
&& (
<Form.Item noStyle>
<Form.Item wrapperCol={{ span: 24 }} name="rowCol" rules={[{ required: true, message: "请选择会员" }]}>
<Button
type='dashed'
block
......
......@@ -66,7 +66,7 @@ const DemandDetailed = () => {
const params = {
id,
}
await PublicApi.getPurchaseNeedPlanDetails({ ...params }).then(res => {
await PublicApi.getPurchaseNeedPlanDetails({ ...params }).then((res: any) => {
if (res.code !== 1000) {
history.goBack();
return;
......@@ -90,11 +90,12 @@ const DemandDetailed = () => {
createRoleId: item.needPlanId,
createTime: item.operateTime,
department: item.department,
stateName: item.status,
id: item.id,
memberId: null,
memberRoleId: null,
operation: item.operate,
position: '',
position: item.jobTitle,
purchaseInquiryId: null,
roleName: item.operator,
state: item.step + 1,
......
......@@ -136,14 +136,15 @@ const PurchasePlanDetailed = () => {
createRoleId: item.needPlanId,
createTime: item.operateTime,
department: item.department,
stateName: item.status,
id: item.id,
memberId: null,
memberRoleId: null,
operation: item.operate,
position: '',
position: item.jobTitle,
purchaseInquiryId: null,
roleName: item.operator,
state: item.status,
state: item.step + 1,
step: item.step,
})
})
......
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