|
@@ -1,6 +1,6 @@
|
|
import React, { PureComponent } from "react";
|
|
import React, { PureComponent } from "react";
|
|
import { connect } from "dva";
|
|
import { connect } from "dva";
|
|
-import { Icon, Checkbox, Select, Input, Button, message, Breadcrumb } from "antd";
|
|
|
|
|
|
+import { Icon, Checkbox, Select, Input, Button, message, Breadcrumb, Tag, Modal } from "antd";
|
|
import styles from "./index.less";
|
|
import styles from "./index.less";
|
|
import AmountFun from "@/components/AmountFun/index.js";
|
|
import AmountFun from "@/components/AmountFun/index.js";
|
|
import { SpecificationMethod, _isContained, _isArrEqual, amountPrecision } from '@/utils/utils';
|
|
import { SpecificationMethod, _isContained, _isArrEqual, amountPrecision } from '@/utils/utils';
|
|
@@ -36,7 +36,17 @@ class GoodsDetails extends PureComponent {
|
|
SpecificationFlag: 0,
|
|
SpecificationFlag: 0,
|
|
mockdata: [],
|
|
mockdata: [],
|
|
isCheckVal: [],
|
|
isCheckVal: [],
|
|
- isCheckName: []
|
|
|
|
|
|
+ isCheckName: [],
|
|
|
|
+ optValShow: false,
|
|
|
|
+ optSearchVal: "",
|
|
|
|
+ optValSelectId: "",
|
|
|
|
+ optVal: {
|
|
|
|
+ baseGoodsOptValue: "",
|
|
|
|
+ baseGoodsOptId: "",
|
|
|
|
+ ext05: "",
|
|
|
|
+ ext04: "",
|
|
|
|
+ price: ""
|
|
|
|
+ }
|
|
};
|
|
};
|
|
}
|
|
}
|
|
componentWillMount() {
|
|
componentWillMount() {
|
|
@@ -160,6 +170,33 @@ class GoodsDetails extends PureComponent {
|
|
isHover: index
|
|
isHover: index
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ // 清空颜色
|
|
|
|
+ clearColor() {
|
|
|
|
+ this.setState({
|
|
|
|
+ optVal: {}
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 显示颜色选择窗口
|
|
|
|
+ openColorDlg() {
|
|
|
|
+ this.setState({
|
|
|
|
+ optValShow: true
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // selectColor(optValSelectId) {
|
|
|
|
+ // console.log(optValSelectId.target.textContent)
|
|
|
|
+ // this.setState({
|
|
|
|
+ // optValSelectId: optValSelectId.target.textContent
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ selectColor(optValSelectId) {
|
|
|
|
+ this.setState({
|
|
|
|
+ optValSelectId
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
// 获取购买数量
|
|
// 获取购买数量
|
|
buyNumChange(num) {
|
|
buyNumChange(num) {
|
|
this.setState({
|
|
this.setState({
|
|
@@ -401,6 +438,7 @@ class GoodsDetails extends PureComponent {
|
|
));
|
|
));
|
|
return temp;
|
|
return temp;
|
|
};
|
|
};
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<div className={styles.commodityDetailsPage}>
|
|
<div className={styles.commodityDetailsPage}>
|
|
{/* {this.BreadcrumbItem()} */}
|
|
{/* {this.BreadcrumbItem()} */}
|
|
@@ -440,7 +478,7 @@ class GoodsDetails extends PureComponent {
|
|
<span>{goodsDetail ? goodsDetail.promQueryResultList : ''}</span>
|
|
<span>{goodsDetail ? goodsDetail.promQueryResultList : ''}</span>
|
|
</p>
|
|
</p>
|
|
</li>
|
|
</li>
|
|
- { specsHtml() }
|
|
|
|
|
|
+ {/* { specsHtml() } */}
|
|
<li className={styles.titleTextList} >
|
|
<li className={styles.titleTextList} >
|
|
<span className={styles.title} >重量</span>
|
|
<span className={styles.title} >重量</span>
|
|
<em className={styles.symbolEm} >:</em>
|
|
<em className={styles.symbolEm} >:</em>
|
|
@@ -459,6 +497,21 @@ class GoodsDetails extends PureComponent {
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
|
|
+ <li className={styles.titleTextList} >
|
|
|
|
+ <span className={styles.title} >系列</span>
|
|
|
|
+ <em className={styles.symbolEm} >:</em>
|
|
|
|
+ <div className={styles.amountBox} >
|
|
|
|
+ <Tag onClick={this.clearColor.bind(this)} color={this.state.optVal.baseGoodsOptId ? "" : "red"}>无</Tag>
|
|
|
|
+ <Tag onClick={this.openColorDlg.bind(this)}>选颜色</Tag>
|
|
|
|
+ </div>
|
|
|
|
+ </li>
|
|
|
|
+ <li className={styles.titleTextList} >
|
|
|
|
+ <span className={styles.title} >颜色</span>
|
|
|
|
+ <em className={styles.symbolEm} >:</em>
|
|
|
|
+ <div className={styles.amountBox} >
|
|
|
|
+ {this.state.optVal.baseGoodsOptValue}
|
|
|
|
+ </div>
|
|
|
|
+ </li>
|
|
<li className={styles.titleTextList} >
|
|
<li className={styles.titleTextList} >
|
|
<span className={styles.title} >数量</span>
|
|
<span className={styles.title} >数量</span>
|
|
<em className={styles.symbolEm} >:</em>
|
|
<em className={styles.symbolEm} >:</em>
|
|
@@ -471,7 +524,8 @@ class GoodsDetails extends PureComponent {
|
|
<em className={styles.symbolEm} >:</em>
|
|
<em className={styles.symbolEm} >:</em>
|
|
<div className={styles.textBox} >
|
|
<div className={styles.textBox} >
|
|
<span className={styles.contBs} >
|
|
<span className={styles.contBs} >
|
|
- {(goodsDetail.specification)}/{goodsDetail.basicUnitName}
|
|
|
|
|
|
+ {/* {(goodsDetail.specification)}/{goodsDetail.basicUnitName} */}
|
|
|
|
+ {goodsDetail ? (goodsDetail.specification) +"/"+(goodsDetail.basicUnitName) : ""}
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
@@ -510,6 +564,48 @@ class GoodsDetails extends PureComponent {
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <Modal title="颜色选择" visible={this.state.optValShow}
|
|
|
|
+ onCancel={() => {
|
|
|
|
+ this.setState({optValShow: false})
|
|
|
|
+ }}
|
|
|
|
+ onOk={() => {
|
|
|
|
+ if (this.state.optValSelectId) {
|
|
|
|
+ const colorSelc = goodsDetail ? goodsDetail.goodsAttrVals.find(item => item.attrValId == this.state.optValSelectId) : null
|
|
|
|
+ this.setState({
|
|
|
|
+ optVal: Object.assign({},this.state.optVal,{baseGoodsOptValue: `${colorSelc.custDocGroupName}->${colorSelc.attrValName}`}),
|
|
|
|
+ optValShow: false
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ message.warning("请选择颜色")
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ width="1000px" maskClosable={false}
|
|
|
|
+ >
|
|
|
|
+ <div>
|
|
|
|
+ <Input.Search placeholder="请输入颜色编码"
|
|
|
|
+ // defaultValue={this.state.optSearchVal}
|
|
|
|
+ onBlur={(e) => {
|
|
|
|
+ this.setState({optSearchVal: e.target.value})
|
|
|
|
+ }}
|
|
|
|
+ onSearch={(e) => {
|
|
|
|
+ this.setState({optSearchVal: e})
|
|
|
|
+ }}
|
|
|
|
+ onPressEnter={(e) => {
|
|
|
|
+ this.setState({optSearchVal: e.target.value})
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div style={{height: "500px",width: "950px",overflow: "auto", marginTop: "10px"}}>
|
|
|
|
+ {
|
|
|
|
+ goodsDetail ? goodsDetail.goodsAttrVals.filter(item => !this.state.optSearchVal || item.attrValName.indexOf(this.state.optSearchVal) >= 0).map((item,index) => {
|
|
|
|
+ // return <Tag color={this.state.optValSelectId == item.attrValName ? "red" : ""} className={styles.colorItem} onClick={this.selectColor.bind(this)}>{item.attrValName}</Tag>
|
|
|
|
+ return <Tag color={this.state.optValSelectId == item.attrValId ? "red" : ""} className={styles.colorItem} onClick={() => {this.selectColor(item.attrValId)}}>{item.attrValName}</Tag>
|
|
|
|
+ }) : ""
|
|
|
|
+ }
|
|
|
|
+ </div>
|
|
|
|
+ </Modal>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
}
|
|
}
|