index.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. import React, { Component } from 'react';
  2. import { connect } from 'dva';
  3. import { routerRedux } from 'dva/router';
  4. import queryString from 'query-string';
  5. import {
  6. Tooltip,
  7. Modal,
  8. Card,
  9. List,
  10. Form,
  11. Table,
  12. Button,
  13. Radio,
  14. Input,
  15. InputNumber,
  16. Select,
  17. } from 'antd';
  18. import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
  19. import FooterToolbar from '../../../components/FooterToolbar';
  20. import TerminalSelectModal from './terminal';
  21. import MerchantProductSelectModal from './product';
  22. import { productType, pageSize, Codes } from '../../../utils/config';
  23. import styles from './index.less';
  24. @Form.create()
  25. @connect(state => ({
  26. terminal: state.terminal,
  27. orderDetail: state.orderDetail,
  28. mproduct: state.mproduct,
  29. }))
  30. export default class CreateOrder extends Component {
  31. state = {
  32. userInfo: {}, // 记录终端用户信息
  33. products: [], // 记录选择的产品
  34. tableDatas: [], // 记录选择的商品
  35. isFromCart: false, // 记录商品从哪里选择的<购物车?产品库>
  36. };
  37. // 终端选择弹框,显示 -> 加载数据
  38. handleTerminalSelectBtnClick = () => {
  39. this.props.dispatch({ type: 'orderDetail/showTerminalModal' });
  40. this.props.dispatch({
  41. type: 'terminal/query',
  42. payload: {
  43. pageNo: 1,
  44. pageSize,
  45. },
  46. });
  47. }
  48. // 选择终端
  49. handleTerminalModalOk = (record) => {
  50. this.setState({
  51. userInfo: {
  52. uid: record.id,
  53. userCode: record.code,
  54. userName: record.name,
  55. campusName: record.campusName,
  56. merchantName: record.merchantName,
  57. merchantId: record.merchantId,
  58. contactName: record.contactName,
  59. mobile: record.mobile,
  60. address: record.address,
  61. },
  62. });
  63. this.props.dispatch({ type: 'orderDetail/hideTerminalModal' });
  64. }
  65. handleTerminalModalCancel = () => {
  66. this.props.dispatch({ type: 'orderDetail/hideTerminalModal' });
  67. }
  68. handleTerminalModalSearch = (data) => {
  69. const newData = { ...data };
  70. if (newData.keyword) {
  71. newData[newData.field] = newData.keyword;
  72. }
  73. delete newData.field;
  74. delete newData.keyword;
  75. this.props.dispatch({
  76. type: 'terminal/query',
  77. payload: { ...newData, pageNo: 1, pageSize },
  78. });
  79. }
  80. handleTerminalModalTableChange = (pagination, filterArgs, filters) => {
  81. const newFilters = { ...filters };
  82. if (newFilters.keyword) {
  83. newFilters[newFilters.field] = newFilters.keyword;
  84. }
  85. delete newFilters.field;
  86. delete newFilters.keyword;
  87. const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');
  88. const tableFilters = Object.keys(filterArgs).reduce((obj, key) => {
  89. const newObj = { ...obj };
  90. newObj[key] = getValue(filterArgs[key]);
  91. return newObj;
  92. }, {});
  93. const data = { ...newFilters, ...tableFilters, pageNo: pagination.current, pageSize: pagination.pageSize };
  94. Object.keys(data).map(key => (data[key] ? null : delete data[key]));
  95. this.props.dispatch({ type: 'terminal/query', payload: data });
  96. }
  97. // 产品选择弹框
  98. handleProductSelectBtnClick = (isFromCart) => {
  99. const { userInfo } = this.state;
  100. const { merchantId, uid } = userInfo;
  101. this.setState({ isFromCart });
  102. this.props.dispatch({ type: 'orderDetail/showProductModal' });
  103. if (isFromCart) {
  104. this.props.dispatch({
  105. type: 'mproduct/queryBuyMsg',
  106. payload: {
  107. pageSize,
  108. userId: uid,
  109. pageNo: 1,
  110. }
  111. });
  112. } else {
  113. this.props.dispatch({
  114. type: 'mproduct/query',
  115. payload: {
  116. pageNo: 1,
  117. pageSize,
  118. merchantId,
  119. },
  120. });
  121. }
  122. }
  123. handleProductModalSearch = (data) => {
  124. const { userInfo, isFromCart } = this.state;
  125. const { merchantId, id } = userInfo;
  126. const newData = { ...data };
  127. if (newData.keyword) {
  128. newData[newData.field] = newData.keyword;
  129. }
  130. delete newData.field;
  131. delete newData.keyword;
  132. if (isFromCart) {
  133. console.log('购物车内商品暂不支持查找...');
  134. } else {
  135. this.props.dispatch({
  136. type: 'mproduct/query',
  137. payload: { ...newData, merchantId, pageNo: 1, pageSize },
  138. });
  139. }
  140. }
  141. handleProductModalTableChange = (pagination, filterArgs, filters) => {
  142. const { userInfo, isFromCart } = this.state;
  143. const { merchantId } = userInfo;
  144. const newFilters = { ...filters };
  145. if (isFromCart) {return;}
  146. if (newFilters.keyword) {
  147. newFilters[newFilters.field] = newFilters.keyword;
  148. }
  149. delete newFilters.field;
  150. delete newFilters.keyword;
  151. const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');
  152. const tableFilters = Object.keys(filterArgs).reduce((obj, key) => {
  153. const newObj = { ...obj };
  154. newObj[key] = getValue(filterArgs[key]);
  155. return newObj;
  156. }, {});
  157. const data = { ...newFilters, ...tableFilters, pageNo: pagination.current, pageSize: pagination.pageSize, merchantId };
  158. Object.keys(data).map(key => (data[key] ? null : delete data[key]));
  159. this.props.dispatch({ type: 'mporduct/query', payload: data });
  160. }
  161. // 选择产品
  162. handleProductModalOk = (data) => {
  163. const formatedData = this.tableDataConventer(data);
  164. this.setState({
  165. products: data || [],
  166. tableDatas: formatedData,
  167. });
  168. this.props.dispatch({ type: 'orderDetail/hideProductModal' });
  169. }
  170. handleProductModalCancel = () => {
  171. this.props.dispatch({ type: 'orderDetail/hideProductModal' });
  172. }
  173. // 对待选的产品进行过滤,如果没有goods则不可选
  174. productListFilter = (list) => {
  175. const newList = [...list];
  176. newList.map(item =>
  177. ((!item.goods || item.goods.length == 0) ? item.selectable = true : item.selectable = false));
  178. return newList;
  179. }
  180. handleListItemDel = (record) => {
  181. const { products, tableDatas } = this.state;
  182. Modal.confirm({
  183. title: '确定从清单中删除此商品?',
  184. cancelText: '取消',
  185. okText: '确认',
  186. onOk: () => {
  187. const newProducts = products.filter(item => item.id !== record.key);
  188. const newTableDatas = tableDatas.filter(item => item.key.indexOf(record.key) == -1);
  189. this.setState({
  190. products: newProducts,
  191. tableDatas: newTableDatas,
  192. });
  193. },
  194. });
  195. }
  196. PKGPriceCalculator = (item, tableDatas) => {
  197. // 根据key找到该课程包内的所有配套
  198. const parentId = item.key;
  199. const subSupports = tableDatas.filter(row =>
  200. row.key.indexOf(`${parentId}[sub]`) !== -1 && row.type == Codes.CODE_SUPPORT
  201. );
  202. // 计算该课程包的价格
  203. let sumSupportsPrice = 0;
  204. subSupports.map((one) => {
  205. sumSupportsPrice += one.price2 * one.quantity;
  206. });
  207. item.rowSum = item.quantity * item.price2 + sumSupportsPrice;
  208. }
  209. handleInputNumberChange = (record, value) => {
  210. const { tableDatas } = this.state;
  211. const newTableDatas = [...tableDatas];
  212. newTableDatas.map((item) => {
  213. if (item.key == record.key) {
  214. item.quantity = value;
  215. if (record.type == Codes.CODE_PACKAGE) {
  216. this.PKGPriceCalculator(item, newTableDatas);
  217. } else if (record.type == Codes.CODE_SUPPORT && item.parent) {
  218. const parentId = item.key.split('[sub]')[0];
  219. newTableDatas.map(item => (item.key == parentId ? this.PKGPriceCalculator(item, newTableDatas) : null));
  220. } else {
  221. item.rowSum = item.quantity * item.price2;
  222. }
  223. }
  224. });
  225. this.setState({ tableDatas: newTableDatas });
  226. }
  227. handleSelectChange = (record, value) => {
  228. const { tableDatas } = this.state;
  229. const newTableDatas = [...tableDatas];
  230. newTableDatas.map((item) => {
  231. if (item.key === record.key) {
  232. const match = item.options.filter(one => one.goodsId === value)[0];
  233. item.price1 = match.price1;
  234. item.price2 = match.price2;
  235. item.price3 = match.price3;
  236. item.chargeUnit = match.chargeUnit;
  237. item.goodsId = value;
  238. if (record.type === Codes.CODE_PACKAGE) {
  239. this.PKGPriceCalculator(item, newTableDatas);
  240. } else if (record.type === Codes.CODE_SUPPORT && item.parent) {
  241. const parentId = item.key.split('[sub]')[0];
  242. newTableDatas.map(item => (item.key === parentId ? this.PKGPriceCalculator(item, newTableDatas) : null));
  243. } else {
  244. item.rowSum = item.quantity * item.price2;
  245. }
  246. }
  247. });
  248. this.setState({ tableDatas: newTableDatas });
  249. }
  250. handlePageCancel = () => {
  251. const { orderDetail, dispatch } = this.props;
  252. const { filters } = orderDetail;
  253. dispatch(routerRedux.push({
  254. pathname: '/trade/order',
  255. search: queryString.stringify(filters),
  256. }));
  257. }
  258. handlePageSubmit = () => {
  259. const { form, dispatch, orderDetail } = this.props;
  260. const { userInfo, tableDatas, isFromCart } = this.state;
  261. const { getFieldsValue, validateFields } = form;
  262. const { filters } = orderDetail;
  263. const { uid } = userInfo;
  264. validateFields((errors) => {
  265. if (errors) return;
  266. const postData = getFieldsValue();
  267. const detailList = [];
  268. tableDatas.map((item) => {
  269. const { goodsId, quantity } = item;
  270. if (!item.parent || item.type === Codes.CODE_SUPPORT) {
  271. detailList.push({ goodsId, quantity });
  272. }
  273. });
  274. postData.uid = uid;
  275. postData.goods = detailList;
  276. postData.adjustPrice = 0;
  277. postData.orderStatus = Codes.CODE_UNPAID;
  278. postData.isFromCart = isFromCart;
  279. dispatch({
  280. type: 'orderDetail/create',
  281. payload: postData,
  282. callback: () => {
  283. dispatch(routerRedux.push({
  284. pathname: '/trade/order',
  285. search: queryString.stringify(filters),
  286. }));
  287. },
  288. });
  289. });
  290. }
  291. /**
  292. * @desc 对选择的产品列表进行加工,以适应table的展示样式,并进行数量及价格调整
  293. * @param {[json]} data
  294. * @return {[json]}
  295. */
  296. tableDataConventer = (data) => {
  297. let rowSort = 1;
  298. const formatedData = [];
  299. const rowDataMaker = (item) => {
  300. let first = item.goods[0]; //默认选中第一个
  301. if (item.goods.filter(a => a.isInCart)[0]) {
  302. first = item.goods.filter(a => a.isInCart)[0];
  303. }
  304. return {
  305. name: item.name,
  306. code: item.code,
  307. type: item.type,
  308. goodsId: first.id,
  309. price1: first.cpPrice,
  310. price2: first.merchantPrice,
  311. price3: first.terminalPrice,
  312. rowSum: first.merchantPrice,
  313. chargeUnit: first.chargeUnit,
  314. isFromCart: this.state.isFromCart,
  315. };
  316. };
  317. data.map((item) => {
  318. if (!item.goods || item.goods.length == 0) return;
  319. if (item.type === Codes.CODE_COURSE) {
  320. const newObj = rowDataMaker(item);
  321. newObj.sumRows = 1;
  322. newObj.quantity = 1;
  323. newObj.key = item.id; // table row, type course, key is id
  324. newObj.options = item.goods.map(
  325. one => ({
  326. goodsId: one.id,
  327. price1: one.cpPrice,
  328. price2: one.merchantPrice,
  329. price3: one.terminalPrice,
  330. chargeUnit: one.chargeUnit,
  331. })
  332. );
  333. newObj.rowSort = rowSort;
  334. rowSort += 1;
  335. formatedData.push(newObj);
  336. } else if (item.type === Codes.CODE_SUPPORT) {
  337. const newObj = rowDataMaker(item);
  338. newObj.sumRows = 1;
  339. newObj.quantity = 1;
  340. newObj.key = item.id; // table row, type support, key is id
  341. newObj.rowSort = rowSort;
  342. rowSort += 1;
  343. formatedData.push(newObj);
  344. } else if (item.type === Codes.CODE_PACKAGE) {
  345. const { products, specials } = item;
  346. // 产品包为一行
  347. const newObj = rowDataMaker(item);
  348. newObj.sumRows = products ? products.length + 1 : 1;
  349. newObj.quantity = 1;
  350. newObj.key = item.id; // table row, type package, key is id
  351. newObj.options = item.goods.map(
  352. one => ({
  353. goodsId: one.id,
  354. price1: one.cpPrice,
  355. price2: one.merchantPrice,
  356. price3: one.terminalPrice,
  357. chargeUnit: one.chargeUnit,
  358. })
  359. );
  360. newObj.rowSort = rowSort;
  361. rowSort += 1;
  362. formatedData.push(newObj);
  363. // 产品包中products每一项为一行
  364. products.map((subItem) => {
  365. const matchGoods = specials.filter(specialsItem => specialsItem.pid == subItem.pid)[0];
  366. const newObj = {};
  367. newObj.sumRows = 0;
  368. newObj.name = subItem.name;
  369. newObj.code = subItem.code;
  370. newObj.type = subItem.type;
  371. newObj.key = `${item.id}[sub]${subItem.id}`; // table row, type package subPro, key is pkgId[sub]pid
  372. // 产品包中的配套 - 显示价格及支持数量调整
  373. if (subItem.type == Codes.CODE_SUPPORT) {
  374. newObj.parent = true;
  375. newObj.goodsId = matchGoods.id;
  376. newObj.chargeUnit = '件';
  377. newObj.price1 = matchGoods.cpPrice;
  378. newObj.price2 = matchGoods.merchantPrice;
  379. newObj.price3 = '-';
  380. newObj.quantity = 0;
  381. // 产品包中的课程 - 不显示价格并且不支持数量调整
  382. } else if (subItem.type === Codes.CODE_COURSE) {
  383. newObj.parent = true;
  384. newObj.chargeUnit = '-';
  385. newObj.price1 = '-';
  386. newObj.price2 = '-';
  387. newObj.price3 = '-';
  388. newObj.quantity = '-';
  389. }
  390. formatedData.push(newObj);
  391. });
  392. }
  393. });
  394. return formatedData;
  395. }
  396. render() {
  397. const { orderDetail, terminal, mproduct, form } = this.props;
  398. const { userInfo, products, tableDatas } = this.state;
  399. const { getFieldDecorator } = form;
  400. const { terminalModalShow, productModalShow } = orderDetail;
  401. const listData = tableDatas;
  402. const productList = this.productListFilter(mproduct.list);
  403. const formItemLayout = {
  404. labelCol: {
  405. xs: { span: 24 },
  406. sm: { span: 2 },
  407. },
  408. wrapperCol: {
  409. xs: { span: 24 },
  410. sm: { span: 12 },
  411. md: { span: 22 },
  412. },
  413. };
  414. const columns = [{
  415. title: '序号',
  416. dataIndex: 'rowSort',
  417. width: '6%',
  418. key: 0,
  419. render: (text, row) => ({ children: text, props: { rowSpan: row.sumRows } }),
  420. }, {
  421. title: '编号',
  422. dataIndex: 'code',
  423. key: 1,
  424. width: '10%',
  425. }, {
  426. title: '名称',
  427. dataIndex: 'name',
  428. key: 2,
  429. width: '10%',
  430. }, {
  431. title: '类型',
  432. dataIndex: 'type',
  433. key: 3,
  434. render: text => productType[text],
  435. width: '10%',
  436. }, {
  437. title: '价格类型',
  438. dataIndex: 'goods',
  439. key: 4,
  440. render: (text, row) => {
  441. // 既不是单独课程也不是课程包里的配套
  442. if (!row.options && row.type !== Codes.CODE_SUPPORT) {
  443. return '-';
  444. // 单独的课程
  445. } else if (row.options) {
  446. return (
  447. <Select style={{ width: '100%' }} value={row.goodsId} onChange={value => this.handleSelectChange(row, value)}>
  448. {row.options.map(item => <Select.Option key={item.goodsId} value={item.goodsId}>{`¥${item.price2} / ${item.chargeUnit}`}</Select.Option>)}
  449. </Select>
  450. );
  451. // 课程包里的配套(显示价格和数量)
  452. } else if (!row.options && row.type === Codes.CODE_SUPPORT) {
  453. return `¥${row.price1} / ${row.chargeUnit}`;
  454. }
  455. },
  456. width: '13%',
  457. }, {
  458. title: '供应商售价(¥)',
  459. dataIndex: 'price1',
  460. key: 5,
  461. width: '10%',
  462. }, {
  463. title: '领教售价(¥)',
  464. dataIndex: 'price2',
  465. key: 6,
  466. width: '10%',
  467. }, {
  468. title: '渠道售价(¥)',
  469. dataIndex: 'price3',
  470. key: 7,
  471. width: '10%',
  472. }, {
  473. title: '数量',
  474. dataIndex: 'quantity',
  475. key: 8,
  476. render: (text, row) => {
  477. // 课程
  478. if (row.type === Codes.CODE_COURSE && !row.parent) {
  479. return (
  480. <InputNumber
  481. value={text}
  482. onChange={value => this.handleInputNumberChange(row, value)}
  483. min={1}
  484. placeholder="请填写"
  485. />
  486. );
  487. // 配套
  488. } else if (row.type === Codes.CODE_SUPPORT && !row.parent) {
  489. return (
  490. <InputNumber
  491. value={text}
  492. onChange={value => this.handleInputNumberChange(row, value)}
  493. min={1}
  494. placeholder="请填写"
  495. />
  496. );
  497. // 课程包
  498. } else if (row.type === Codes.CODE_PACKAGE) {
  499. return (
  500. <InputNumber
  501. value={text}
  502. onChange={value => this.handleInputNumberChange(row, value)}
  503. min={1}
  504. placeholder="请填写"
  505. />
  506. );
  507. // 课程包内的配套
  508. } else if (row.type === Codes.CODE_SUPPORT && row.parent) {
  509. return (
  510. <InputNumber
  511. value={text}
  512. onChange={value => this.handleInputNumberChange(row, value)}
  513. min={0}
  514. placeholder="请填写"
  515. />
  516. );
  517. } else {
  518. return text;
  519. }
  520. },
  521. width: '6%',
  522. }, {
  523. title: '小计(¥)',
  524. dataIndex: 'rowSum',
  525. key: 9,
  526. render: (text, row) => ({ children: text, props: { rowSpan: row.sumRows } }),
  527. width: '8%',
  528. }, {
  529. title: '操作',
  530. dataIndex: 'operation',
  531. key: 10,
  532. render: (text, row) => ({ children: <a onClick={() => this.handleListItemDel(row)}>删除</a>, props: { rowSpan: row.sumRows } }),
  533. width: '7%',
  534. }];
  535. let total = 0;
  536. listData.map(item => (item.rowSum ? total += item.rowSum : null));
  537. return (
  538. <PageHeaderLayout>
  539. <Card>
  540. <Form>
  541. <Form.Item label="选择终端" {...formItemLayout}>
  542. <Button onClick={this.handleTerminalSelectBtnClick} type="primary" size="small" icon="plus-circle-o">选择</Button>
  543. {
  544. userInfo.userCode ?
  545. (
  546. <List
  547. size="small"
  548. bordered
  549. style={{ width: '50%' }}
  550. dataSource={[
  551. `终端编号: ${userInfo.userCode}`,
  552. `终端名称: ${userInfo.userName}`,
  553. `所属校区: ${userInfo.campusName}`,
  554. `所属渠道: ${userInfo.merchantName}`,
  555. ]}
  556. renderItem={item => <List.Item>{item}</List.Item>}
  557. />
  558. ) : null
  559. }
  560. </Form.Item>
  561. <Form.Item label="收货人" {...formItemLayout}>
  562. {getFieldDecorator('name', {
  563. rules: [{ required: true, type: 'string', message: '请填写收货人!' }],
  564. initialValue: userInfo.contactName,
  565. })(
  566. <Input style={{ width: '50%' }} placeholder="请填写或使用默认" />
  567. )}
  568. </Form.Item>
  569. <Form.Item label="联系电话" {...formItemLayout}>
  570. {getFieldDecorator('mobile', {
  571. rules: [{ required: true, type: 'string', message: '请填写联系电话!' }],
  572. initialValue: userInfo.mobile,
  573. })(
  574. <Input style={{ width: '50%' }} placeholder="请填写或使用默认" />
  575. )}
  576. </Form.Item>
  577. <Form.Item label="收货地址" {...formItemLayout}>
  578. {getFieldDecorator('address', {
  579. rules: [{ required: true, type: 'string', message: '请填写收货地址!' }],
  580. initialValue: userInfo.address,
  581. })(
  582. <Input.TextArea style={{ width: '50%' }} placeholder="请填写或使用默认" />
  583. )}
  584. </Form.Item>
  585. <Form.Item label="添加备注" {...formItemLayout}>
  586. {getFieldDecorator('note', {
  587. initialValue: userInfo.note,
  588. })(
  589. <Input.TextArea style={{ width: '50%' }} placeholder="请输入(选填)" />
  590. )}
  591. </Form.Item>
  592. {userInfo.merchantId &&
  593. <Form.Item label="添加商品" {...formItemLayout}>
  594. <Button.Group size="small">
  595. <Button
  596. type={this.state.isFromCart ? 'default' : 'primary'}
  597. onClick={() => this.handleProductSelectBtnClick(false)}
  598. >
  599. 产品库
  600. </Button>
  601. <Button
  602. type={this.state.isFromCart? 'primary' : 'default'}
  603. onClick={() => this.handleProductSelectBtnClick(true)}
  604. >
  605. 购物车
  606. </Button>
  607. </Button.Group>
  608. <Table
  609. bordered
  610. scroll={{ x: 1250 }}
  611. pagination={false}
  612. columns={columns}
  613. dataSource={listData}
  614. footer={() => <strong>{`价格总计: ${total}元`}</strong>}
  615. />
  616. </Form.Item>
  617. }
  618. </Form>
  619. {/* 终端选择弹框 */}
  620. <TerminalSelectModal
  621. rowKeyName="id"
  622. modalVisible={terminalModalShow}
  623. width={660}
  624. onOk={this.handleTerminalModalOk}
  625. onCancel={this.handleTerminalModalCancel}
  626. onSearch={this.handleTerminalModalSearch}
  627. fsTableDataSource={terminal.list || []}
  628. fsTableLoading={terminal.listLoading}
  629. fsTablePagination={terminal.pagination}
  630. fsTableOnChange={this.handleTerminalModalTableChange}
  631. />
  632. {/* 渠道产品选择弹框 */}
  633. <MerchantProductSelectModal
  634. rowKeyName="id"
  635. modalVisible={productModalShow}
  636. selTableData={products}
  637. width={660}
  638. fsTableDataSource={productList}
  639. fsTableLoading={mproduct.listLoading}
  640. fsTablePagination={mproduct.pagination}
  641. onOk={this.handleProductModalOk}
  642. onCancel={this.handleProductModalCancel}
  643. onSearch={this.handleProductModalSearch}
  644. fsTableOnChange={this.handleProductModalTableChange}
  645. />
  646. </Card>
  647. <FooterToolbar>
  648. <Button onClick={this.handlePageCancel}>取消</Button>
  649. <Button onClick={this.handlePageSubmit} type="primary">提交</Button>
  650. </FooterToolbar>
  651. </PageHeaderLayout>
  652. );
  653. }
  654. }