Commit 81d43e9a authored by Bill's avatar Bill

Merge branch 'v2' of 10.0.0.22:lingxi/lingxi-business-paltform into v2

parents da42e8e3 ed1d6f40
......@@ -77,6 +77,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
product,
attribute
})
setAttribute([])
setProduct({})
}
return (
......@@ -178,7 +179,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
</div>
<div className={style.row}>
<span className={style.label}>规格型号:</span>
<span className={style.col}>{record.associatedType}</span>
<span className={style.col}>{record.type}</span>
</div>
</div>
</div>
......
......@@ -88,35 +88,66 @@ const FormList = (props: any) => {
default:
break;
}
// const fnsasdf = (sourceType: string, newObj: any, callBackArr: Array) => {
// const key = callBackArr[sourceType]
// if (sourceType == '2') {
// return newObj.inviteTenderMateriel[key]
// }
// return newObj[key]
// }
console.log(parmas, 'parmas', Row)
/* 过滤字段 */
const _filter = (sourceType: string, newObj: any, callBackArr: Array) => {
const key = callBackArr[sourceType]
console.log(sourceType, newObj, key)
if (!key) {
return '';
}
let callBlackString = '';
if (sourceType == '2') {
return newObj.inviteTenderMateriel[key]
}
callBlackString = newObj[key]
if (callBlackString == null) {
return '';
}
return callBlackString;
}
/* 处理数组 */
const _filterArr = (sourceType: string, newObj: any, callBackArr: Array) => {
let callBlackString = _filter(sourceType, newObj, callBackArr);
console.log(callBlackString, 'callBlackString')
if (Object.getPrototypeOf(callBlackString) === Array.prototype) {
callBlackString = callBlackString[0]
}
return callBlackString
}
/* 处理布尔值 */
const _filterFalg = (sourceType: string, newObj: any, callBackArr: Array) => {
let callBlackString = _filter(sourceType, newObj, callBackArr);
if (sourceType !== '1') {
callBlackString = callBlackString ? '1' : '0';
}
return callBlackString
}
fn(parmas).then(res => {
if (res.code === 1000) {
let data = res.data.data.map((item, index) => {
return {
// fnsasdf(sourceType,item,['number','code','number'])
code: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : item.number, // 物料编号
name: sourceType == '1' ? item.name : sourceType == '2' ? item.inviteTenderMateriel.name : item.name, // 物料名称
type: sourceType == '1' ? item.model : sourceType == '2' ? item.inviteTenderMateriel.type : item.model, // 物料规格
code: _filter(sourceType, item, ['', 'number', 'code', 'number']),// 物料编号
name: _filter(sourceType, item, ['', 'name', 'name', 'name']),//物料名称
type: _filter(sourceType, item, ['', 'model', 'type', 'model']),//物料规格
customerCategory: { // 品类
name: sourceType == '1' ? item.category : sourceType == '2' ? item.inviteTenderMateriel.brandName : '',
category: item.category ? item.category : '',
id: sourceType == '1' ? item.goodsId : sourceType == '2' ? item.inviteTenderMateriel.categoryId[0] : item.ids[0],
name: _filter(sourceType, item, ['', 'category', 'brandName', '']),
category: _filter(sourceType, item, ['', 'category', '', '']),
id: _filterArr(sourceType, item, ['', 'goodsId', 'categoryId', 'ids']),
},
brand: { name: sourceType == '1' ? item.brand : sourceType == '2' ? item.inviteTenderMateriel.categoryName : item.brand }, // 品牌
unitName: sourceType == '1' ? item.unit : sourceType == '2' ? item.inviteTenderMateriel.unitName : item.unitPrice, //单位
purchaseCount: sourceType == '1' ? item.purchaseCount : sourceType == '2' ? item.inviteTenderMateriel.count : item.purchaseCount, // 数量
isHasTax: sourceType == '1' ? item.isTax : sourceType == '2' ? item.isTax ? 1 : 0 : item.isTax ? 1 : 0, // 是否函税
taxRate: sourceType == '1' ? item.taxProbability : sourceType == '2' ? item.taxRate : item.taxRate, //税率
price: sourceType == '1' ? item.taxUnitPrice : item.price, // 单价
brand: {
name: _filter(sourceType, item, ['', 'brand', 'categoryName', 'brand'])
}, // 品牌
unitName: _filter(sourceType, item, ['', 'unit', 'unitName', 'unitPrice']), //单位
purchaseCount: _filter(sourceType, item, ['', 'purchaseCount', 'count', 'purchaseCount']),// 数量
isHasTax: _filterFalg(sourceType, item, ['', 'isTax', 'isTax', 'isTax']),// 数量是否函税
taxRate: _filter(sourceType, item, ['', 'taxProbability', 'taxRate', 'taxRate']), //税率
price: _filter(sourceType, item, ['', 'taxUnitPrice', 'price', 'price']), //单价
bidCount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 : item.purchaseCount,
bidAmount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 * item.price : item.price,
associatedType: _filter(sourceType, item, ['', 'productBrand', '', '']),
associatedBrand: _filter(sourceType, item, ['', 'productAttributeJson', '', '']),
associatedDataId: sourceType == '1' ? item.productId : sourceType == '2' ? item.commodityId : '', // 关联商品id
associatedMaterielNo: sourceType == '1' ? item.number : sourceType == '2' ? item.commodityAttribute : '', // 关联物料编号
associatedMaterielName: sourceType == '1' ? item.productName : sourceType == '2' ? item.commodityName : '', // 关联商品名称
......@@ -124,7 +155,7 @@ const FormList = (props: any) => {
rowId: index,
}
})
console.log(data, 'data')
setData(data)
}
})
......
......@@ -191,7 +191,6 @@ const FormList = (props: any) => {
break;
case 'payNum':
item[idx].payNum = e;
break;
case 'expectPayTime':
item[idx].expectPayTime = moment(e).format('YYYY-MM-DD HH:mm:ss');
......
......@@ -27,7 +27,7 @@
.flex {
display: flex;
align-items: center;
justify-content: center;
justify-content: end;
}
.flex span {
background: #e4e6eb;
......@@ -68,7 +68,8 @@
.select .setBox {
width: 100px;
display: flex;
align-items: flex-end;
justify-content: end;
align-items: center;
position: absolute;
top: 1px;
right: 78px;
......
......@@ -31,7 +31,7 @@
.flex {
display: flex;
align-items: center;
justify-content: center;
justify-content: end;
span {
background: #e4e6eb;
padding: 7px 12px;
......@@ -78,7 +78,9 @@
.setBox{
width: 100px;
display: flex;
align-items: flex-end;
justify-content: end;
// align-items: flex-end;
align-items: center;
position: absolute;
top: 1px;
right: 78px;
......
......@@ -122,7 +122,7 @@ const Examine = () => {
render: (text, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => history.push(`/memberCenter/contract/manage/examine/details?contractId=${record.id}&type=ManageSubmitExamine`)}>提交审核</span>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => history.push(`/memberCenter/contract/manage/examine/details?contractId=${record.id}&type=ManageSubmitExamine`)}>审核</span>
</div>
)
}
......
......@@ -120,7 +120,7 @@ const Secondaryexamine = () => {
render: (text, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => history.push(`/memberCenter/contract/manage/secondaryexamine/details?contractId=${record.id}&type=PageToBeExamineStepTwo`)}>提交审核</span>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => history.push(`/memberCenter/contract/manage/secondaryexamine/details?contractId=${record.id}&type=PageToBeExamineStepTwo`)}>审核</span>
</div>
)
}
......
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