Commit c0ba8930 authored by LeeJiancong's avatar LeeJiancong

'详情明细'

parent b8ee832c
......@@ -176,7 +176,10 @@
color : #6B778C;
padding-right: 20px;
&:nth-of-type(n + 4) {
// &:nth-of-type(n + 4) {
// margin: 0;
// }
&:nth-of-type(3n+1) {
margin: 0;
}
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:32:05
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-17 15:49:30
* @LastEditTime: 2020-09-18 11:17:34
*/
import React, { Component, useEffect, useState, ReactNode, useRef } from 'react';
import { Row, Col, Modal, Table, Tooltip, Input, Select,Switch, Button, Popconfirm, Card, Tag, Badge, Steps, Tabs, } from 'antd'
......@@ -23,7 +23,8 @@ import style from './index.less'
import {interiorState,interiorStateTwo,enquirySearchInteriorState,
enquirySearchexternalState} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
import PlatType from '../../components/platType'
import RroductModal from '../components/productModal'
const { Step } = Steps
const { TabPane } = Tabs
const data = [
......@@ -60,6 +61,17 @@ const detailInfo: React.FC<{}> = () => {
const [platType, setplatType] = useState(1) //需求对接类型
const [otherList, setotherList] = useState([])//动态tab循环
const [productSource, setproductSource] = useState([])//商品列表 新增
const [RroductinitialValues, setRroductinitialValues] = useState({})
const [requisitionFormId, setrequisitionFormId] = useState(null)//对应需求单号
const [tabData, settabData] = useState<any>({})
const [dialogVisible, setdialogVisible] = useState(false)
const proRef = useRef<any>({})
const [mode, setmode] = useState(0)
const [eqInfo, seteqInfo] = useState({
purchaseNuit:'',
purchaseQuantity:null,
modelList:[]
})//报价明细里的规格列表
let [dataInfo, setdataInfo] = useState<any>({
status: '',
externalState: 0,
......@@ -245,22 +257,35 @@ const detailInfo: React.FC<{}> = () => {
const equiryColumns: ColumnType<any>[] = [
{
title: '报价商品名称',
dataIndex: 'productName',
key: 'productName',
align: 'left',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
setRroductinitialValues(records)
setdialogVisible(true)
setmode(2)
}}>{text}</EyePreview>
},
{
title: '品类',
dataIndex: 'category',
key: 'category',
align: 'left'
},
{
title: '商品规格型号',
dataIndex: 'model',
key: 'model',
align: 'left',
render: (text: any, records: any) => <EyePreview type="button" handleClick={() => {
handleOpenModal(records.id)
}}>{text}</EyePreview>
align: 'left'
},
{
title: '品牌',
dataIndex: 'brand',
key: 'brand',
align: 'center'
},
...otherList,
// ...otherList,//不展示
{
title: '单位',
dataIndex: 'purchaseNuit',
......@@ -272,6 +297,21 @@ const detailInfo: React.FC<{}> = () => {
dataIndex: 'purchaseQuantity',
key: 'purchaseQuantity',
align: 'center'
},
{
title: '报价单价',
dataIndex: 'price',
key: 'price',
align: 'center',
render:(text,record) => <>{text}</>
},
{
title: '金额',
dataIndex: 'totalPrice',
key: 'totalPrice',
align: 'center',
render:(text,record) => <>{(record.purchaseQuantity &&record.price) ?
record.purchaseQuantity * record.price : ''}</>
}
]
......@@ -290,6 +330,7 @@ const detailInfo: React.FC<{}> = () => {
// }
// }
setdataInfo(data)
getOrderProductAll(data.requisitionFormId)
// interiorStateList = [...data.interiorRequisitionFormStateResponses]
......@@ -313,43 +354,51 @@ const detailInfo: React.FC<{}> = () => {
})
//商品列表
PublicApi.getOrderRequisitionFormProductAll({ id: id }).then(res => {
if (res.code === 1000) {
let { data } = res
//商品
let source = []
let otherColumnkey = []//动态列的展示
data.forEach((v)=> {
let obj:any = {}
obj.model = v.model
obj.id = v.id
obj.brand = v.brand
obj.purchaseNuit = v.purchaseNuit
obj.purchaseQuantity = v.purchaseQuantity
if(v.productAttributeJson){
JSON.parse(v.productAttributeJson).forEach(child => {
Object.keys(child).forEach(key => {
//获取列头
otherColumnkey.push({
title: key,
dataIndex: key,
key: key,
align:'center'
})
// console.log('key',key,child,child[key])
obj[key] = child[key]
})
});
}
source.push(obj)
})
setotherList([...otherColumnkey])//生成列
setproductSource([...source])
PublicApi.getOrderQuotationParticulars({ id: id }).then(res => {
if(res.code === 1000){
let {data} = res.data
setproductSource([...data])
}
})
// //商品列表
// PublicApi.getOrderRequisitionFormProductAll({ id: id }).then(res => {
// if (res.code === 1000) {
// let { data } = res
// //商品
// let source = []
// let otherColumnkey = []//动态列的展示
// data.forEach((v)=> {
// let obj:any = {}
// obj.model = v.model
// obj.id = v.id
// obj.brand = v.brand
// obj.purchaseNuit = v.purchaseNuit
// obj.purchaseQuantity = v.purchaseQuantity
// if(v.productAttributeJson){
// JSON.parse(v.productAttributeJson).forEach(child => {
// Object.keys(child).forEach(key => {
// //获取列头
// otherColumnkey.push({
// title: key,
// dataIndex: key,
// key: key,
// align:'center'
// })
// // console.log('key',key,child,child[key])
// obj[key] = child[key]
// })
// });
// }
// source.push(obj)
// })
// setotherList([...otherColumnkey])//生成列
// setproductSource([...source])
// }
// })
}
......@@ -445,6 +494,31 @@ const detailInfo: React.FC<{}> = () => {
}
}
/**
* @description: 查询 商品规格 赋值单位和数量
* @param {type}
* @return {type}
*/
const getOrderProductAll = (id) => {
setrequisitionFormId(id)//需求id
PublicApi.getOrderRequisitionFormProductAll({id:id}).then(res => {
if(res.code === 1000){
let {data} = res || {}
let {purchaseNuit,purchaseQuantity} = data[0]
let list = data.map(v => v.model)
setRroductinitialValues({
...RroductinitialValues,
purchaseNuit: purchaseNuit,
purchaseQuantity: purchaseQuantity
})
seteqInfo({...eqInfo,modelList: list
})
}
})
}
return (
<PageHeaderWrapper
onBack={() => window.history.back()}
......@@ -676,6 +750,17 @@ const detailInfo: React.FC<{}> = () => {
onCancel={() => setvisible(false)}
onOK={ handleModalOK}
/>
<RroductModal
dialogVisible={dialogVisible}
eqInfo={eqInfo}//需求单相关
onRef={proRef}
// onRef={(refs) => setSetForm(refs)}
mode={mode}
initialValues={RroductinitialValues}
onCancel={() => setdialogVisible(false)}
>
</RroductModal>
</PageHeaderWrapper>
)
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-28 10:07:45
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-16 16:46:52
* @LastEditTime: 2020-09-18 11:18:40
*/
import React, { Component, useState,useRef, useEffect,useImperativeHandle } from 'react';
import { Modal, Button,Space, Form, Radio, AutoComplete, Badge,Tabs, Input, Select, Checkbox } from 'antd'
......@@ -20,17 +20,17 @@ const { TextArea } = Input
export interface Params {
sourceData?: Array<any>[],
eqInfo: any,
eqInfo: any,//重置需求单号列表
id?: any,
mode?: number,
mode?: number,// 0 新增 1编辑 2 查看
type?: number | string,
dialogVisible: boolean;
currentRef?: any;
onCancel: Function;
onRef?: any;
onOK?: Function;
initialValues?: any;
productAttributeJson: Function;//明细中的属性
initialValues?: any;//初始化
productAttributeJson?: Function;//明细中的属性
dontReceive?: boolean; //默认展示
}
const layout = {
......
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