|
@@ -140,6 +140,71 @@ export default class CreateOrder extends Component {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * @desc 对选择的产品列表进行加工,以适应table的展示样式,并进行数量及价格调整
|
|
|
|
+ * @param {[json]} data
|
|
|
|
+ * @return {[json]}
|
|
|
|
+ */
|
|
|
|
+ tableDataConventer = (data) => {
|
|
|
|
+ const jokeData = [{
|
|
|
|
+ id: '1',
|
|
|
|
+ pid: '1',
|
|
|
|
+ name: '一花一世界',
|
|
|
|
+ code: '001',
|
|
|
|
+ type: 'COURSE',
|
|
|
|
+ status: 'NORMAL',
|
|
|
|
+ goods: [],
|
|
|
|
+ tags: [],
|
|
|
|
+ merchantId: '1234',
|
|
|
|
+ merchantName: '贝尔安亲',
|
|
|
|
+ },{
|
|
|
|
+ id: '2',
|
|
|
|
+ pid: '2',
|
|
|
|
+ name: '看图识物手册',
|
|
|
|
+ code: '001',
|
|
|
|
+ type: 'SUPPORT',
|
|
|
|
+ status: 'NORMAL',
|
|
|
|
+ goods: [],
|
|
|
|
+ tags: [],
|
|
|
|
+ merchantId: '1234',
|
|
|
|
+ merchantName: '贝尔安亲',
|
|
|
|
+ },{
|
|
|
|
+ id: '3',
|
|
|
|
+ pid: '3',
|
|
|
|
+ name: '急用先学',
|
|
|
|
+ code: '001',
|
|
|
|
+ type: 'PACKAGE',
|
|
|
|
+ status: 'NORMAL',
|
|
|
|
+ goods: [],
|
|
|
|
+ tags: [],
|
|
|
|
+ merchantId: '1234',
|
|
|
|
+ merchantName: '贝尔安亲',
|
|
|
|
+ subItemList: [{
|
|
|
|
+ id: '4',
|
|
|
|
+ pid: '4',
|
|
|
|
+ name: '急用先学汉字',
|
|
|
|
+ code: '002',
|
|
|
|
+ type: 'SUPPORT',
|
|
|
|
+ status: '',
|
|
|
|
+ goods: [],
|
|
|
|
+ tags: [],
|
|
|
|
+ merchantId: '',
|
|
|
|
+ merchantName: '',
|
|
|
|
+ },{
|
|
|
|
+ id: '5',
|
|
|
|
+ pid: '5',
|
|
|
|
+ name: '',
|
|
|
|
+ code: '002',
|
|
|
|
+ type: 'COURSE',
|
|
|
|
+ status: '',
|
|
|
|
+ goods: [],
|
|
|
|
+ tags: [],
|
|
|
|
+ merchantId: '',
|
|
|
|
+ merchantName: '',
|
|
|
|
+ }],
|
|
|
|
+ }];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* @desc 对返回的单个订单数据进行加工,方便在table中进行展示及编辑
|
|
* @desc 对返回的单个订单数据进行加工,方便在table中进行展示及编辑
|
|
* @param {Object}
|
|
* @param {Object}
|
|
* @return {Object}
|
|
* @return {Object}
|
|
@@ -175,6 +240,7 @@ export default class CreateOrder extends Component {
|
|
const { userInfo, products } = this.state;
|
|
const { userInfo, products } = this.state;
|
|
const { getFieldDecorator } = form;
|
|
const { getFieldDecorator } = form;
|
|
const { terminalModalShow, productModalShow } = orderDetail;
|
|
const { terminalModalShow, productModalShow } = orderDetail;
|
|
|
|
+ console.log(this.state)
|
|
const fmtProducts = this.formatTableDatas(products);
|
|
const fmtProducts = this.formatTableDatas(products);
|
|
|
|
|
|
const formItemLayout = {
|
|
const formItemLayout = {
|
|
@@ -189,6 +255,10 @@ export default class CreateOrder extends Component {
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const newColumns = [{
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+
|
|
const columns = [{
|
|
const columns = [{
|
|
title: '序号',
|
|
title: '序号',
|
|
dataIndex: 'sort',
|
|
dataIndex: 'sort',
|
|
@@ -270,11 +340,11 @@ export default class CreateOrder extends Component {
|
|
dataIndex: 'quantity',
|
|
dataIndex: 'quantity',
|
|
key: 8,
|
|
key: 8,
|
|
render: (text, record) => {
|
|
render: (text, record) => {
|
|
- if (!record.isChild || record.type == Codes.CODE_SUPPORT) {
|
|
|
|
|
|
+ if (!record.isChild) {
|
|
return (
|
|
return (
|
|
<InputNumber
|
|
<InputNumber
|
|
min={1}
|
|
min={1}
|
|
- value={text}
|
|
|
|
|
|
+ value={record.goods.filter(item => item.selected)[0].quantity}
|
|
formatter={value => `x ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
|
|
formatter={value => `x ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
|
|
parser={value => value.replace(/\x\s?|(,*)/g, '')}
|
|
parser={value => value.replace(/\x\s?|(,*)/g, '')}
|
|
/>
|
|
/>
|
|
@@ -288,6 +358,8 @@ export default class CreateOrder extends Component {
|
|
title: '小计',
|
|
title: '小计',
|
|
dataIndex: 'rowSum',
|
|
dataIndex: 'rowSum',
|
|
key: 9,
|
|
key: 9,
|
|
|
|
+ render: (text, record) => {
|
|
|
|
+ },
|
|
width: '10%',
|
|
width: '10%',
|
|
},{
|
|
},{
|
|
title: '操作',
|
|
title: '操作',
|