Commit e6d719e0 authored by GuanHua's avatar GuanHua
parents 18ce0d24 e7262173
......@@ -13,9 +13,9 @@
"start": "yarn api && yarn scripts:build && umi dev",
"build": "yarn api && yarn scripts:build && yarn build:clean",
"build:yxc": "yarn api && yarn scripts:build-yxc && umi build",
"build:analyze": "NODE_OPTIONS=--max_old_space_size=4096 ANALYZE=1 umi build",
"build:analyze": "cross-env NODE_OPTIONS=--max_old_space_size=4096 ANALYZE=1 umi build",
"build:dev": "pm2 start scripts/devServer.js",
"build:clean": "NODE_OPTIONS=--max_old_space_size=4096 umi build",
"build:clean": "cross-env NODE_OPTIONS=--max_old_space_size=4096 umi build",
"build:scm": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com USE_ROUTE_CONFIG=false SOCKET_URL=ws://lingxi-scm.wg.shushangyun.com yarn build",
"build:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.0.10:8100 yarn build",
"postinstall": "umi generate tmp",
......
......@@ -178,17 +178,16 @@ const Analysis: React.FC<AnalysisProps> = ({
const { data, totalCount } = res.data;
resolve({
data: data.map(item => {
const product = isJSONStr(item.product) || {};
return {
id: item.id,
star: item.star,
comment: item.comment,
productName: product.productName || '',
price: product.price,
quantity: product.purchaseCount,
productName: item.product || '',
price: item.price,
quantity: item.purchaseCount,
created: item.createTime,
target: item.byMemberName,
orderId: product.orderId,
orderId: item.orderId,
};
}),
totalCount,
......@@ -211,17 +210,16 @@ const Analysis: React.FC<AnalysisProps> = ({
const { data, totalCount } = res.data;
resolve({
data: data.map(item => {
const product = isJSONStr(item.product) || {};
return {
id: item.id,
star: item.star,
comment: item.comment,
productName: product.productName || '',
price: product.price,
quantity: product.purchaseCount,
productName: item.product || '',
price: item.price,
quantity: item.purchaseCount,
created: item.dealTime as string,
target: item.memberName,
orderId: product.orderId,
orderId: item.orderId,
};
}),
totalCount,
......@@ -246,17 +244,16 @@ const Analysis: React.FC<AnalysisProps> = ({
const { data, totalCount } = res.data;
resolve({
data: data.map(item => {
const product = isJSONStr(item.product) || {};
return {
id: item.id,
star: item.star,
comment: item.comment,
productName: product.productName || '',
price: product.price,
quantity: product.purchaseCount,
productName: item.product || '',
price: item.price,
quantity: item.purchaseCount,
created: item.dealTime as string,
target: item.subMemberName,
orderId: product.orderId,
orderId: item.orderId,
};
}),
totalCount,
......
......@@ -142,7 +142,10 @@ const EvaluationList = props => {
</div>
<div className="goodInfo-right">
<div className="goodInfo-title">{item.good.productName}</div>
<div className="goodInfo-desc">X {item.good.purchaseCount || ''}</div>
<div className="goodInfo-desc">
X {item.good.purchaseCount || ''}
{item.good.unit || ''}
</div>
<div className="goodInfo-price">{`¥ ${item.good.price}`}</div>
</div>
</div>
......
......@@ -30,7 +30,7 @@ interface Unevaluated {
good: {
pic: string,
productName: string,
price: string,
price: number,
purchaseCount: string,
};
star: number;
......@@ -73,14 +73,14 @@ const ReceivedDetail: React.FC = () => {
}).then(res => {
if (res.code === 1000) {
const { product } = res.data;
const productObj = isJSONStr(product) || {};
setEvaluationInfo({
good: {
pic: productObj.pic,
productName: productObj.productName,
price: productObj.price,
purchaseCount: productObj.purchaseCount,
pic: res.data.productImgUrl,
productName: res.data.product,
price: res.data.price,
purchaseCount: res.data.purchaseCount,
unit: res.data.unit,
},
star: res.data.star,
comment: res.data.comment,
......@@ -170,9 +170,9 @@ const ReceivedDetail: React.FC = () => {
initialValues={{
comments: [evaluationInfo],
}}
editable={pageStatus === PageStatus.EDIT}
editable={false}
expressionScope={{
UploadTip: pageStatus === PageStatus.EDIT ? UploadTip : null,
UploadTip: null,
beforeUpload,
}}
onSubmit={handleSubmit}
......
......@@ -32,7 +32,7 @@ interface Unevaluated {
good: {
pic: string,
productName: string,
price: string,
price: number,
purchaseCount: string,
};
star: number;
......@@ -85,15 +85,14 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
id,
}).then(res => {
if (res.code === 1000) {
const { product } = res.data;
const productObj = isJSONStr(product) || {};
setEvaluationInfo({
good: {
pic: productObj.pic,
productName: productObj.productName,
price: productObj.price,
purchaseCount: productObj.purchaseCount,
pic: res.data.productImgUrl,
productName: res.data.product,
price: res.data.price,
purchaseCount: res.data.purchaseCount,
unit: res.data.unit,
},
star: res.data.star,
comment: res.data.comment,
......
......@@ -89,25 +89,25 @@ const EvaluateOrder: React.FC = () => {
// 被评价方是 销售会员(订单提供者数据)
return {
memberId: orderInfo.supplyMembersId,
roleId: orderInfo.supplyMembersRoleId,
memberName: orderInfo.supplyMembersName || '',
star,
comment,
product: JSON.stringify(good),
remark: orderInfo.orderNo,
product: good.productName,
productId: good.productId,
orderId: orderInfo.id,
productImgUrl: good.pic,
dealTime: orderInfo.createTime,
dealTime: orderInfo.createTime, // 交易时间取订单的时间
dealCount: good.purchaseCount,
unit: good.unit,
price: good.price,
totalPrice: orderInfo.sumPrice,
totalPrice: good.totalPrice,
pics: picture.map(item => item.status === 'done' && item.data.url).filter(Boolean),
};
});
PublicApi.postMemberCommentConsumerOrderTradeSubmit({
memberId: orderInfo.supplyMembersId,
roleId: orderInfo.supplyMembersRoleId,
orderId: orderInfo.id,
orderNo: orderInfo.orderNo,
commentSubmitDetailList: payload,
}).then(res => {
if (res.code === 1000) {
......
......@@ -18,18 +18,11 @@ export const normalizeUnevaluatedList = (arr: {[key: string]: any}[]) => {
good: {
pic: item.imgUrl || '',
productId: item.productId,
orderId: item.orderId,
productName: item.productName,
category: item.category,
brand: item.brand,
unit: item.unit,
price: item.price,
memberPrice: item.memberPrice,
purchaseCount: item.purchaseCount, // 采购数量
taxInclusive: item.taxInclusive,
money: item.money,
inventory: item.inventory,
productAttributeJson: item.productAttributeJson,
totalPrice: +(item.price * item.purchaseCount).toFixed(2),
},
star: 5, // 评分星星
comment: '', // 评价
......
......@@ -178,17 +178,16 @@ const Analysis: React.FC<AnalysisProps> = ({
const { data, totalCount } = res.data;
resolve({
data: data.map(item => {
const product = isJSONStr(item.product) || {};
return {
id: item.id,
star: item.star,
comment: item.comment,
productName: product.productName || '',
price: product.price,
quantity: product.purchaseCount,
productName: item.product || '',
price: item.price,
quantity: item.purchaseCount,
created: item.createTime,
target: item.byMemberName,
orderId: product.orderId,
orderId: item.orderId,
};
}),
totalCount,
......@@ -211,17 +210,16 @@ const Analysis: React.FC<AnalysisProps> = ({
const { data, totalCount } = res.data;
resolve({
data: data.map(item => {
const product = isJSONStr(item.product) || {};
return {
id: item.id,
star: item.star,
comment: item.comment,
productName: product.productName || '',
price: product.price,
quantity: product.purchaseCount,
productName: item.product || '',
price: item.price,
quantity: item.purchaseCount,
created: item.dealTime as string,
target: item.memberName,
orderId: product.orderId,
orderId: item.orderId,
};
}),
totalCount,
......@@ -246,17 +244,16 @@ const Analysis: React.FC<AnalysisProps> = ({
const { data, totalCount } = res.data;
resolve({
data: data.map(item => {
const product = isJSONStr(item.product) || {};
return {
id: item.id,
star: item.star,
comment: item.comment,
productName: product.productName || '',
price: product.price,
quantity: product.purchaseCount,
productName: item.product || '',
price: item.price,
quantity: item.purchaseCount,
created: item.dealTime as string,
target: item.subMemberName,
orderId: product.orderId,
orderId: item.orderId,
};
}),
totalCount,
......
......@@ -142,7 +142,10 @@ const EvaluationList = props => {
</div>
<div className="goodInfo-right">
<div className="goodInfo-title">{item.good.productName}</div>
<div className="goodInfo-desc">X {item.good.purchaseCount || ''}</div>
<div className="goodInfo-desc">
X {item.good.purchaseCount || ''}
{item.good.unit || ''}
</div>
<div className="goodInfo-price">{`¥ ${item.good.price}`}</div>
</div>
</div>
......
......@@ -30,7 +30,7 @@ interface Unevaluated {
good: {
pic: string,
productName: string,
price: string,
price: number,
purchaseCount: string,
};
star: number;
......@@ -77,10 +77,11 @@ const ReceivedDetail: React.FC = () => {
setEvaluationInfo({
good: {
pic: productObj.pic,
productName: productObj.productName,
price: productObj.price,
purchaseCount: productObj.purchaseCount,
pic: res.data.productImgUrl,
productName: res.data.product,
price: res.data.price,
purchaseCount: res.data.purchaseCount,
unit: res.data.unit,
},
star: res.data.star,
comment: res.data.comment,
......@@ -170,9 +171,9 @@ const ReceivedDetail: React.FC = () => {
initialValues={{
comments: [evaluationInfo],
}}
editable={pageStatus === PageStatus.EDIT}
editable={false}
expressionScope={{
UploadTip: pageStatus === PageStatus.EDIT ? UploadTip : null,
UploadTip: null,
beforeUpload,
}}
onSubmit={handleSubmit}
......
......@@ -31,7 +31,7 @@ interface Unevaluated {
good: {
pic: string,
productName: string,
price: string,
price: number,
purchaseCount: string,
};
star: number;
......@@ -84,15 +84,13 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
id,
}).then(res => {
if (res.code === 1000) {
const { product } = res.data;
const productObj = isJSONStr(product) || {};
setEvaluationInfo({
good: {
pic: productObj.pic,
productName: productObj.productName,
price: productObj.price,
purchaseCount: productObj.purchaseCount,
pic: res.data.productImgUrl,
productName: res.data.product,
price: res.data.price,
purchaseCount: res.data.purchaseCount,
unit: res.data.unit,
},
star: res.data.star,
comment: res.data.comment,
......
......@@ -89,25 +89,25 @@ const EvaluateOrder: React.FC = () => {
// 被评价方是 采购会员(订单创建者数据)
return {
memberId: orderInfo.createMemberId,
roleId: orderInfo.createRoleId,
memberName: orderInfo.createMemberName || '',
star,
comment,
product: JSON.stringify(good),
remark: orderInfo.orderNo,
product: good.productName,
productId: good.productId,
orderId: orderInfo.id,
productImgUrl: good.pic,
dealTime: orderInfo.createTime,
dealTime: orderInfo.createTime, // 交易时间取订单的时间
dealCount: good.purchaseCount,
unit: good.unit,
price: good.price,
totalPrice: orderInfo.sumPrice,
totalPrice: good.totalPrice,
pics: picture.map(item => item.status === 'done' && item.data.url).filter(Boolean),
};
});
PublicApi.postMemberCommentSupplyOrderTradeSubmit({
memberId: orderInfo.createMemberId,
roleId: orderInfo.createRoleId,
orderId: orderInfo.id,
orderNo: orderInfo.orderNo,
commentSubmitDetailList: payload,
}).then(res => {
if (res.code === 1000) {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-10-19 16:02:53
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-27 17:00:33
* @LastEditTime: 2020-12-04 10:13:24
* @Description:
*/
......@@ -18,18 +18,11 @@ export const normalizeUnevaluatedList = (arr: {[key: string]: any}[]) => {
good: {
pic: item.imgUrl || '',
productId: item.productId,
orderId: item.orderId,
productName: item.productName,
category: item.category,
brand: item.brand,
unit: item.unit,
price: item.price,
memberPrice: item.memberPrice,
purchaseCount: item.purchaseCount, // 采购数量
taxInclusive: item.taxInclusive,
money: item.money,
inventory: item.inventory,
productAttributeJson: item.productAttributeJson,
totalPrice: +(item.price * item.purchaseCount).toFixed(2),
},
star: 5, // 评分星星
comment: '', // 评价
......
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