Commit 5a6b5d96 authored by LeeJiancong's avatar LeeJiancong

'对接新增报价单大模块'

parent bf9e380b
......@@ -3,7 +3,7 @@
* @Date: 2020-07-31 19:56:22
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-11 10:17:58
* @LastEditTime: 2020-09-15 15:20:45
*/
const TranactionRoute = {
......@@ -79,26 +79,22 @@ const TranactionRoute = {
{
path:'/memberCenter/tranactionAbility/enquirySubmit/enquirySearch',
name:'enquirySearch',
key:'enquirySearch',
component: '@/pages/transaction/enquirySubmit/enquirySearch'
},
{
path:'/memberCenter/tranactionAbility/enquirySubmit/toAddSubmitList',
name:'toAddSubmitList',
key:'toAddSubmitList',
component: '@/pages/transaction/enquirySubmit/toAddSubmit'
},
{
path:'/memberCenter/tranactionAbility/enquirySubmit/addEnquiry',
name:'addEnquiry',
key:'addEnquiry',
component: '@/pages/transaction/enquirySubmit/toAddSubmit/detail',
hideInMenu: true,
},
{//需求单详情
path:'/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail',
name:'viewEnquiryDetail',
key:'viewEnquiryDetail',
component: '@/pages/transaction/enquirySubmit/components/detail',
hideInMenu: true,
},
......@@ -106,19 +102,16 @@ const TranactionRoute = {
{
path:'/memberCenter/tranactionAbility/enquirySubmit/enquiryOne',
name:'enquiryOne',
key:'enquiryOne',
component: '@/pages/transaction/enquirySubmit/enquiryOne'
},
{
path:'/memberCenter/tranactionAbility/enquirySubmit/enquiryTwo',
name:'enquiryTwo',
key:'enquiryTwo',
component: '@/pages/transaction/enquirySubmit/enquiryTwo'
},
{
path:'/memberCenter/tranactionAbility/enquirySubmit/toSubmit',
name:'toSubmit',
key:'toSubmit',
component: '@/pages/transaction/enquirySubmit/toSubmit'
},
......@@ -140,13 +133,11 @@ const TranactionRoute = {
{
path:'/memberCenter/tranactionAbility/enquiryOffer/enquirySearch',
name:'enquirySearch',
key:'enquirySearch',
component: '@/pages/transaction/enquiryOffer/enquirySearch'
},
{//需求单详情
path:'/memberCenter/tranactionAbility/enquiryOffer/viewEnquiryDetail',
name:'viewEnquiryDetail',
key:'viewEnquiryDetail',
component: '@/pages/transaction/enquiryOffer/components/detail',
hideInMenu: true,
},
......@@ -155,14 +146,12 @@ const TranactionRoute = {
{
path:'/memberCenter/tranactionAbility/enquiryOffer/toAddSubmitList',
name:'toAddSubmitList',
key:'toAddSubmitList',
component: '@/pages/transaction/enquiryOffer/toAddSubmit'
},
//新增
{
path:'/memberCenter/tranactionAbility/enquiryOffer/addEnquiry',
name:'addEnquiry',
key:'addEnquiry',
component: '@/pages/transaction/enquiryOffer/toAddSubmit/detail',
hideInMenu: true,
},
......
import React, { Component,ReactNode } from 'react';
import {Badge} from 'antd'
/****** *********************** 需求单 ************************** */
/**
* @description: 一级
* @description: 需求提交一级
* @param {type}
* @return {type}
*/
......@@ -17,7 +17,7 @@ export const interiorState = (text:any) => {
/**
* @description: 二级
* @description: 需求提交二级
* @param {type}
* @return {type}
*/
......@@ -62,4 +62,10 @@ export const enquirySearchexternalState = (text:any) => {
text === 6 ? component = <Badge status='error' text="审核不通过" />:
component = <Badge status="default" text="取消报价单" />
return component;
}
\ No newline at end of file
}
/****** *********************** 报价单 ************************** */
......@@ -3,9 +3,9 @@
* @Date: 2020-08-28 10:07:45
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-12 11:40:07
* @LastEditTime: 2020-09-15 14:32:41
*/
import React, { Component, useState, useEffect } from 'react';
import React, { Component, useState,useRef, useEffect,useImperativeHandle } from 'react';
import { Modal, Button,Space, Form, Radio, AutoComplete, Badge,Tabs, Input, Select, Checkbox } from 'antd'
import { PublicApi } from '@/services/api'
import ModalTable from '@/components/ModalTable'
......@@ -20,13 +20,17 @@ const { TextArea } = Input
export interface Params {
sourceData?: Array<any>[],
eqInfo: any,
id?: any,
mode?: number,
type?: number | string,
dialogVisible: boolean;
currentRef?: any;
onCancel: Function;
onRef?: any;
onOK?: Function;
initialValues?: any;
productAttributeJson: Function;//明细中的属性
dontReceive?: boolean; //默认展示
}
const layout = {
......@@ -44,10 +48,10 @@ const layout = {
* @param {type}
* @return {type}
*/
// const fetchData = async (params) => {
// const res = await PublicApi.getProductCommodityCommonGetCommodityDetailList({ ...params, environment: 1, shopType: 1 })
// return res.data
// }
const fetchData = async (params) => {
const res = await PublicApi.getProductCommodityCommonGetCommodityDetailList({ ...params, environment: 1, shopType: 1 })
return res.data
}
//数据是真实的 只是模拟
let data = [
......@@ -69,18 +73,18 @@ let data = [
unitName: "件"
}
]
const fetchData = params => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords);
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data,
});
}, 1000);
});
};
// const fetchData = params => {
// return new Promise((resolve, reject) => {
// const queryResult = data.find(v => v.key === params.keywords);
// setTimeout(() => {
// resolve({
// code: 200,
// message: '',
// data: queryResult ? [queryResult] : data,
// });
// }, 1000);
// });
// };
const columns: ColumnType<any>[] = [
{
......@@ -113,7 +117,9 @@ const columns: ColumnType<any>[] = [
* @param {type}
* @return {type}
*/
const comfirmDialog: React.FC<Params> = (props) => {
const comfirmDialog: React.FC<Params> = (props,{onRef}) => {
// const {onRef} = props
// const cRef = props.currentRef
// console.log('数据',props.sourceData)
const [visible, setsVisible] = useState(false) //state hook写法
const [Curform] = Form.useForm()
......@@ -128,6 +134,14 @@ const comfirmDialog: React.FC<Params> = (props) => {
const [placeOfOriginList, setplaceOfOriginList] = useState([])//产地
const handleCancel = () => {
}
const inRef = useRef<any>({})
useImperativeHandle(onRef,() => {
retSetForm: () => {
Curform.resetFields()
}
})
//选择商品
const handleLink = () => {
......@@ -137,16 +151,24 @@ const comfirmDialog: React.FC<Params> = (props) => {
const handleSelectOk = () => {
console.log('数据', productRowCtl);
const selectRow = productRowCtl.selectRow[0]
let { commodityId, id, goodsId, roleId, name, brandName } = selectRow
let { commodityId, id,customerCategoryName, goodsId, roleId, name, brandName } = selectRow
Curform.setFieldsValue({
name: name,//商品名称
brand: brandName
brand: brandName,
category: customerCategoryName
})
//查询属性
PublicApi.getProductCommodityGetCommodity({ id: commodityId }).then(res => {
//查询属性
// PublicApi.getProductCommodityGetCommodity({ id: commodityId }).then(res => {
// if (res.code === 1000) {
// let { data } = res || {}
// setcommodityAttributedataSource(data)
// }
// })
PublicApi.getProductCommodityGetCommodityAttributeByUnitPriceAndPicId({unitPriceAndPicId: id}).then(res => {
if (res.code === 1000) {
let { data } = res || {}
setcommodityAttributedataSource(data)
console.log('data',data)
}
})
setsVisible(false)
......@@ -155,22 +177,21 @@ const comfirmDialog: React.FC<Params> = (props) => {
setsVisible(false)
}
/**
* @description: 报价明细
* @param {type}
* @return {type}
*/
const handletOk = () => {
Curform.validateFields().then(v => {
console.log('表单', v)
// props.onOK(v)
props.onOK(v,commodityAttributedataSource)
props.productAttributeJson(commodityAttributedataSource)
Curform.resetFields()
})
// if(props.type){
// value.type = props.type
// }
// console.log('列表',value)
}
useEffect(() => {
// onRef(inRef)
return () => {
}
}, [])
......@@ -284,10 +305,10 @@ const comfirmDialog: React.FC<Params> = (props) => {
</>
)
}
const placeholderText = '请先选择对应需求单号'
return (
<>
<Modal
// title={props.mode === 0 ? '新增报价明细' : '查看报价明细'}
title={headerTitle}
width={800}
......@@ -302,10 +323,14 @@ const comfirmDialog: React.FC<Params> = (props) => {
<Form
{...layout}
colon={false}
ref={inRef}
labelAlign="left"
form={Curform}
autoComplete="off"
initialValues={{
purchaseQuantity: props.eqInfo.purchaseQuantity,
purchaseNuit: props.eqInfo.purchaseNuit
}}
>
<Tabs defaultActiveKey='tab1'
......@@ -317,12 +342,17 @@ const comfirmDialog: React.FC<Params> = (props) => {
name='model'
rules={[
{
required: true
}
]}
>
<Select>
<Option value="1">11</Option>
<Select placeholder="请先选择对应需求单号">
{
props.eqInfo.modelList.map((item,index) => {
return <Option key={index} value={item}>{item}</Option>
})
}
</Select>
</Form.Item>
<Form.Item
......@@ -350,6 +380,13 @@ const comfirmDialog: React.FC<Params> = (props) => {
>
<Input disabled placeholder='' />
</Form.Item>
<Form.Item
label='品类'
name='category'
hidden
>
<Input disabled placeholder='' />
</Form.Item>
</Tabs.TabPane>
{
......@@ -372,8 +409,8 @@ const comfirmDialog: React.FC<Params> = (props) => {
}
{
commodityAttributedataSource.commodityAttributeList.length > 0 && commodityAttributedataSource.commodityAttributeList.map((item: any) => <>
<TabPane tab={item.customerAttribute.name} key={item.customerAttribute.id}>
commodityAttributedataSource.length > 0 && commodityAttributedataSource.map((item: any) => <>
<TabPane tab={item.customerAttribute.name} key={item.customerAttribute.name}>
<Space key={item.customerAttribute.id} direction="vertical" size={16}>
{item.customerAttributeValueList.map((child,childIndex) => {
return <Badge text={child.value} key={childIndex} status="default"/>
......@@ -391,12 +428,11 @@ const comfirmDialog: React.FC<Params> = (props) => {
name='purchaseNuit'
rules={[
{
required: true,
message:"请先选择需求单"
required: true
}
]}
>
<Input placeholder='' />
<Input disabled placeholder={placeholderText} />
</Form.Item>
<Form.Item
......@@ -404,12 +440,11 @@ const comfirmDialog: React.FC<Params> = (props) => {
name='purchaseQuantity'
rules={[
{
required: true,
message:"请先选择需求单"
required: true
}
]}
>
<Input placeholder='' />
<Input disabled placeholder={placeholderText} />
</Form.Item>
<Form.Item
label='报价单价'
......@@ -453,6 +488,10 @@ const comfirmDialog: React.FC<Params> = (props) => {
)
}
comfirmDialog.defaultProps = {
eqInfo:{
// purchaseQuantity: '',//数量
// purchaseNuit:''//单位
},//规格列表
dontReceive: true,
type: 1 //1.支付宝 2.支付宝转账到银行卡参数配置 3.微信
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-11 16:59:50
* @LastEditTime: 2020-09-15 14:11:15
*/
import React, { ReactNode, useRef, useState,useEffect } from 'react';
import { history } from 'umi';
......@@ -158,7 +158,7 @@ const List:React.FC<{}> = () => {
},[])
const toEdit = (id:number | string) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/addEnquiry?id=${id}`)
history.push(`/memberCenter/tranactionAbility/enquiryOffer/addEnquiry?id=${id}`)
}
/**
* @description: 删除
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:29
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-11 11:43:16
* @LastEditTime: 2020-09-15 15:15:36
*/
import React, { Component, useState, useEffect } from 'react'
import ReactDOM from 'react-dom'
......@@ -912,7 +912,6 @@ const Detail: React.FC<{}> = () => {
if (id) {//修改
values['id'] = id
console.log('编辑',values)
return
PublicApi.postOrderRequisitionFormUpdate(values).then(res => {
if (res.code === 1000) {
setTimeout(() => {
......@@ -922,7 +921,6 @@ const Detail: React.FC<{}> = () => {
})
} else {
PublicApi.postOrderRequisitionFormAdd(values).then(res => {
if (res.code === 1000) {
setTimeout(() => {
......
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