@fle-ui/plus-choose-goods 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -0
- package/README.md +17 -0
- package/es/components/icon/index.d.ts +3 -0
- package/es/components/icon/index.js +7 -0
- package/es/index.d.ts +27 -0
- package/es/index.js +532 -0
- package/es/index.less +76 -0
- package/es/utils/api.d.ts +6 -0
- package/es/utils/api.js +5 -0
- package/es/utils/common.d.ts +11 -0
- package/es/utils/common.js +9 -0
- package/es/utils/options.d.ts +25 -0
- package/es/utils/options.js +92 -0
- package/es/utils/request.d.ts +19 -0
- package/es/utils/request.js +106 -0
- package/es/utils/serviceEnv.d.ts +6 -0
- package/es/utils/serviceEnv.js +12 -0
- package/lib/components/icon/index.d.ts +3 -0
- package/lib/components/icon/index.js +13 -0
- package/lib/index.d.ts +27 -0
- package/lib/index.js +526 -0
- package/lib/index.less +76 -0
- package/lib/utils/api.d.ts +6 -0
- package/lib/utils/api.js +11 -0
- package/lib/utils/common.d.ts +11 -0
- package/lib/utils/common.js +15 -0
- package/lib/utils/options.d.ts +25 -0
- package/lib/utils/options.js +98 -0
- package/lib/utils/request.d.ts +19 -0
- package/lib/utils/request.js +112 -0
- package/lib/utils/serviceEnv.d.ts +6 -0
- package/lib/utils/serviceEnv.js +18 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MIT
|
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createFromIconfontCN } from '@ant-design/icons';
|
|
2
|
+
/* 采用iconfont Symbol模式
|
|
3
|
+
每次更新icon后,记得复制最新的地址哦~ */
|
|
4
|
+
var Icon = createFromIconfontCN({
|
|
5
|
+
scriptUrl: ['//at.alicdn.com/t/c/font_3161758_5bzjjx85uxv.js', '//at.alicdn.com/t/font_2562875_b3aduyabrj.js']
|
|
6
|
+
});
|
|
7
|
+
export default Icon;
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import type { ProColumns } from '@ant-design/pro-table';
|
|
3
|
+
import { EnvType } from './utils/serviceEnv';
|
|
4
|
+
import './index.less';
|
|
5
|
+
export interface ChooseGoodsProps {
|
|
6
|
+
open: boolean;
|
|
7
|
+
env?: EnvType;
|
|
8
|
+
token?: string;
|
|
9
|
+
loginErrFn?: any;
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
defaultSelectedGoodsIds?: React.Key[];
|
|
12
|
+
request?: Array<string>;
|
|
13
|
+
columns?: ProColumns[];
|
|
14
|
+
rowKey?: string;
|
|
15
|
+
customParams?: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
serviceUrl?: string;
|
|
19
|
+
scroll?: {
|
|
20
|
+
x?: number;
|
|
21
|
+
y?: number;
|
|
22
|
+
};
|
|
23
|
+
onOk?: (selectedGoodsId: React.Key[], selectedGoods: any[]) => void;
|
|
24
|
+
onCancel?: () => void;
|
|
25
|
+
}
|
|
26
|
+
declare const ChooseSiteGoods: FC<ChooseGoodsProps>;
|
|
27
|
+
export default ChooseSiteGoods;
|
package/es/index.js
ADDED
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import "antd/es/modal/style";
|
|
3
|
+
import _Modal from "antd/es/modal";
|
|
4
|
+
import "antd/es/radio/style";
|
|
5
|
+
import _Radio from "antd/es/radio";
|
|
6
|
+
import "antd/es/select/style";
|
|
7
|
+
import _Select from "antd/es/select";
|
|
8
|
+
import "antd/es/cascader/style";
|
|
9
|
+
import _Cascader from "antd/es/cascader";
|
|
10
|
+
import "antd/es/form/style";
|
|
11
|
+
import _Form from "antd/es/form";
|
|
12
|
+
import "antd/es/input/style";
|
|
13
|
+
import _Input from "antd/es/input";
|
|
14
|
+
import "antd/es/button/style";
|
|
15
|
+
import _Button from "antd/es/button";
|
|
16
|
+
import "antd/es/typography/style";
|
|
17
|
+
import _Typography from "antd/es/typography";
|
|
18
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
19
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
21
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
22
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
23
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
24
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
25
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
29
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
33
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
34
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
35
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
36
|
+
import React, { useEffect, useState, useRef, useMemo } from 'react';
|
|
37
|
+
import { ProTable, QueryFilter } from '@ant-design/pro-components';
|
|
38
|
+
import PlusConfigProvider from '@fle-ui/plus-config-provider';
|
|
39
|
+
import ProImage from '@fle-ui/plus-image';
|
|
40
|
+
import lodash from 'lodash';
|
|
41
|
+
import Icon from './components/icon';
|
|
42
|
+
import { priceRangeForPurchase, sortOptions } from './utils/options';
|
|
43
|
+
import httpClient from './utils/request';
|
|
44
|
+
import { getApiHost } from './utils/serviceEnv';
|
|
45
|
+
import api from './utils/api';
|
|
46
|
+
import { showMoney, formartNum } from './utils/common';
|
|
47
|
+
import { useRequest } from 'ahooks';
|
|
48
|
+
import PlusRangeInput from '@fle-ui/plus-range-input';
|
|
49
|
+
import './index.less';
|
|
50
|
+
var ChooseSiteGoods = function ChooseSiteGoods(props) {
|
|
51
|
+
var open = props.open,
|
|
52
|
+
env = props.env,
|
|
53
|
+
token = props.token,
|
|
54
|
+
serviceUrl = props.serviceUrl,
|
|
55
|
+
_props$columns = props.columns,
|
|
56
|
+
columns = _props$columns === void 0 ? [] : _props$columns,
|
|
57
|
+
_props$loginErrFn = props.loginErrFn,
|
|
58
|
+
loginErrFn = _props$loginErrFn === void 0 ? function () {} : _props$loginErrFn,
|
|
59
|
+
_props$multiple = props.multiple,
|
|
60
|
+
multiple = _props$multiple === void 0 ? true : _props$multiple,
|
|
61
|
+
_props$defaultSelecte = props.defaultSelectedGoodsIds,
|
|
62
|
+
defaultSelectedGoodsIds = _props$defaultSelecte === void 0 ? [] : _props$defaultSelecte,
|
|
63
|
+
_props$customParams = props.customParams,
|
|
64
|
+
customParams = _props$customParams === void 0 ? {} : _props$customParams,
|
|
65
|
+
_props$rowKey = props.rowKey,
|
|
66
|
+
rowKey = _props$rowKey === void 0 ? 'goodsId' : _props$rowKey,
|
|
67
|
+
_props$onOk = props.onOk,
|
|
68
|
+
onOk = _props$onOk === void 0 ? function () {} : _props$onOk,
|
|
69
|
+
_props$onCancel = props.onCancel,
|
|
70
|
+
onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
|
|
71
|
+
_props$scroll = props.scroll,
|
|
72
|
+
scroll = _props$scroll === void 0 ? {
|
|
73
|
+
x: 1500,
|
|
74
|
+
y: 400
|
|
75
|
+
} : _props$scroll;
|
|
76
|
+
var formRef = useRef();
|
|
77
|
+
var $http = httpClient({
|
|
78
|
+
baseURL: getApiHost(env),
|
|
79
|
+
token: token,
|
|
80
|
+
loginErrFn: loginErrFn
|
|
81
|
+
});
|
|
82
|
+
var _useState = useState(10),
|
|
83
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
84
|
+
pageSize = _useState2[0],
|
|
85
|
+
setPageSize = _useState2[1];
|
|
86
|
+
var DefaultParams = useMemo(function () {
|
|
87
|
+
return _objectSpread(_objectSpread({}, customParams), {}, {
|
|
88
|
+
pageSize: pageSize,
|
|
89
|
+
pageNo: 1,
|
|
90
|
+
isGetSubSupplierName: 1
|
|
91
|
+
});
|
|
92
|
+
}, [customParams, pageSize]);
|
|
93
|
+
var _useState3 = useState(DefaultParams),
|
|
94
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
95
|
+
searchParams = _useState4[0],
|
|
96
|
+
setSearchParams = _useState4[1];
|
|
97
|
+
var _useRequest = useRequest( /*#__PURE__*/function () {
|
|
98
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
|
|
99
|
+
var _val$flagCategory, _res$data, _res$data2;
|
|
100
|
+
var params, _val$rangePrice, _val$rangePrice2, res;
|
|
101
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
102
|
+
while (1) switch (_context.prev = _context.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
params = _objectSpread(_objectSpread({}, val), {}, {
|
|
105
|
+
flagCategory: ((_val$flagCategory = val.flagCategory) === null || _val$flagCategory === void 0 ? void 0 : _val$flagCategory.length) ? val.flagCategory[val.flagCategory.length - 1] : undefined
|
|
106
|
+
}); // 价格区间
|
|
107
|
+
if (val.priceType && val.rangePrice) {
|
|
108
|
+
params["".concat(val.priceType, "Min")] = formartNum((_val$rangePrice = val.rangePrice) === null || _val$rangePrice === void 0 ? void 0 : _val$rangePrice[0]);
|
|
109
|
+
params["".concat(val.priceType, "Max")] = formartNum((_val$rangePrice2 = val.rangePrice) === null || _val$rangePrice2 === void 0 ? void 0 : _val$rangePrice2[1]);
|
|
110
|
+
if (val.priceType.includes('once')) {
|
|
111
|
+
params['isOnce'] = 1;
|
|
112
|
+
}
|
|
113
|
+
if (val.priceType.includes('purchase')) {
|
|
114
|
+
params['isPurchase'] = 1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
_context.next = 4;
|
|
118
|
+
return $http.post(serviceUrl || api['getGoodsList'], params);
|
|
119
|
+
case 4:
|
|
120
|
+
res = _context.sent;
|
|
121
|
+
return _context.abrupt("return", {
|
|
122
|
+
list: (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list) || [],
|
|
123
|
+
total: (res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.total) || 0
|
|
124
|
+
});
|
|
125
|
+
case 6:
|
|
126
|
+
case "end":
|
|
127
|
+
return _context.stop();
|
|
128
|
+
}
|
|
129
|
+
}, _callee);
|
|
130
|
+
}));
|
|
131
|
+
return function (_x) {
|
|
132
|
+
return _ref.apply(this, arguments);
|
|
133
|
+
};
|
|
134
|
+
}(), {
|
|
135
|
+
manual: true,
|
|
136
|
+
loadingDelay: 300
|
|
137
|
+
}),
|
|
138
|
+
goodsData = _useRequest.data,
|
|
139
|
+
getGoodsListLoading = _useRequest.loading,
|
|
140
|
+
getGoodsList = _useRequest.run;
|
|
141
|
+
// 自有商品 标签 begin
|
|
142
|
+
var _useState5 = useState([]),
|
|
143
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
144
|
+
flagSceneOptions = _useState6[0],
|
|
145
|
+
setFlagSceneOptions = _useState6[1]; // 场景标签
|
|
146
|
+
var _useState7 = useState([]),
|
|
147
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
148
|
+
flagTagsOptions = _useState8[0],
|
|
149
|
+
setFlagTagsOptions = _useState8[1]; // 商品标签
|
|
150
|
+
var _useState9 = useState([]),
|
|
151
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
152
|
+
flagIndustryOptions = _useState10[0],
|
|
153
|
+
setFlagIndustryOptions = _useState10[1]; // 行业标签
|
|
154
|
+
var _useState11 = useState([]),
|
|
155
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
156
|
+
flagCategoryOptions = _useState12[0],
|
|
157
|
+
setFlagCategoryOptions = _useState12[1]; // 品类标签
|
|
158
|
+
// 获取自有商品标签 - 场景 商品 行业
|
|
159
|
+
var getSelfGoodsFlag = /*#__PURE__*/function () {
|
|
160
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
161
|
+
var res, list;
|
|
162
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
163
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
164
|
+
case 0:
|
|
165
|
+
_context2.next = 2;
|
|
166
|
+
return $http.post(api['getSelfGoodsFlag']);
|
|
167
|
+
case 2:
|
|
168
|
+
res = _context2.sent;
|
|
169
|
+
if (res === null || res === void 0 ? void 0 : res.success) {
|
|
170
|
+
list = (res === null || res === void 0 ? void 0 : res.data) || [];
|
|
171
|
+
setFlagSceneOptions(list[3]);
|
|
172
|
+
setFlagTagsOptions(list[1]);
|
|
173
|
+
setFlagIndustryOptions(list[2]);
|
|
174
|
+
}
|
|
175
|
+
case 4:
|
|
176
|
+
case "end":
|
|
177
|
+
return _context2.stop();
|
|
178
|
+
}
|
|
179
|
+
}, _callee2);
|
|
180
|
+
}));
|
|
181
|
+
return function getSelfGoodsFlag() {
|
|
182
|
+
return _ref2.apply(this, arguments);
|
|
183
|
+
};
|
|
184
|
+
}();
|
|
185
|
+
// 获取自有商品标签 - 品类
|
|
186
|
+
var getSelfGoodsFlagCategory = /*#__PURE__*/function () {
|
|
187
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
188
|
+
var res;
|
|
189
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
190
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
191
|
+
case 0:
|
|
192
|
+
_context3.next = 2;
|
|
193
|
+
return $http.get(api['getSelfGoodsFlagCategory']);
|
|
194
|
+
case 2:
|
|
195
|
+
res = _context3.sent;
|
|
196
|
+
if (res === null || res === void 0 ? void 0 : res.success) {
|
|
197
|
+
setFlagCategoryOptions((res === null || res === void 0 ? void 0 : res.data) || []);
|
|
198
|
+
}
|
|
199
|
+
case 4:
|
|
200
|
+
case "end":
|
|
201
|
+
return _context3.stop();
|
|
202
|
+
}
|
|
203
|
+
}, _callee3);
|
|
204
|
+
}));
|
|
205
|
+
return function getSelfGoodsFlagCategory() {
|
|
206
|
+
return _ref3.apply(this, arguments);
|
|
207
|
+
};
|
|
208
|
+
}();
|
|
209
|
+
useEffect(function () {
|
|
210
|
+
if (open) {
|
|
211
|
+
var _formRef$current;
|
|
212
|
+
var values = (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getFieldsValue();
|
|
213
|
+
getGoodsList(_objectSpread(_objectSpread({}, searchParams), values));
|
|
214
|
+
getSelfGoodsFlag();
|
|
215
|
+
getSelfGoodsFlagCategory();
|
|
216
|
+
} else {
|
|
217
|
+
var _formRef$current2;
|
|
218
|
+
setSearchParams(DefaultParams);
|
|
219
|
+
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.resetFields();
|
|
220
|
+
}
|
|
221
|
+
}, [open]);
|
|
222
|
+
// 选择 begin
|
|
223
|
+
var _useState13 = useState([]),
|
|
224
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
225
|
+
selectedRowKeys = _useState14[0],
|
|
226
|
+
setSelectedRowKeys = _useState14[1];
|
|
227
|
+
var _useState15 = useState([]),
|
|
228
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
229
|
+
selectedRows = _useState16[0],
|
|
230
|
+
setSelectedRows = _useState16[1];
|
|
231
|
+
var onSelectChange = function onSelectChange(newSelectedRowKeys, newSelectedRows) {
|
|
232
|
+
setSelectedRowKeys(newSelectedRowKeys);
|
|
233
|
+
setSelectedRows(newSelectedRows);
|
|
234
|
+
};
|
|
235
|
+
var rowSelection = {
|
|
236
|
+
selectedRowKeys: selectedRowKeys,
|
|
237
|
+
onChange: onSelectChange,
|
|
238
|
+
getCheckboxProps: function getCheckboxProps(row) {
|
|
239
|
+
return {
|
|
240
|
+
disabled: defaultSelectedGoodsIds.includes(row[rowKey])
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
useEffect(function () {
|
|
245
|
+
setSelectedRowKeys(defaultSelectedGoodsIds);
|
|
246
|
+
}, [defaultSelectedGoodsIds]);
|
|
247
|
+
var defaultColumns = [{
|
|
248
|
+
title: '商品信息',
|
|
249
|
+
key: 'goodsInfo',
|
|
250
|
+
align: 'center',
|
|
251
|
+
width: 250,
|
|
252
|
+
fixed: 'left',
|
|
253
|
+
render: function render(_, record) {
|
|
254
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
255
|
+
className: 'table-goods-wrap'
|
|
256
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
257
|
+
className: 'table-goods-img-wrap'
|
|
258
|
+
}, /*#__PURE__*/React.createElement(ProImage, {
|
|
259
|
+
preview: true,
|
|
260
|
+
src: record.mainImage,
|
|
261
|
+
className: "pro-image",
|
|
262
|
+
needOssProcess: false
|
|
263
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
264
|
+
className: 'table-goods-content'
|
|
265
|
+
}, /*#__PURE__*/React.createElement(_Typography.Paragraph, {
|
|
266
|
+
ellipsis: {
|
|
267
|
+
rows: 2
|
|
268
|
+
},
|
|
269
|
+
className: "table-goods-content-title"
|
|
270
|
+
}, record.name), /*#__PURE__*/React.createElement("div", {
|
|
271
|
+
title: record.goodsId,
|
|
272
|
+
className: 'table-goods-content-sub-title'
|
|
273
|
+
}, "\u5546\u54C1ID\uFF1A", record.goodsId)));
|
|
274
|
+
}
|
|
275
|
+
}, {
|
|
276
|
+
title: '商品品牌',
|
|
277
|
+
dataIndex: 'brandName',
|
|
278
|
+
key: 'brandName',
|
|
279
|
+
align: 'center',
|
|
280
|
+
width: 120
|
|
281
|
+
}, {
|
|
282
|
+
title: '商品分类',
|
|
283
|
+
key: 'flagCategoryInfo',
|
|
284
|
+
align: 'center',
|
|
285
|
+
width: 150,
|
|
286
|
+
render: function render(_, record) {
|
|
287
|
+
var _record$flagCategoryI;
|
|
288
|
+
return (record === null || record === void 0 ? void 0 : (_record$flagCategoryI = record.flagCategoryInfo) === null || _record$flagCategoryI === void 0 ? void 0 : _record$flagCategoryI.treeName) || '-';
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
title: '所属供应商',
|
|
292
|
+
dataIndex: 'subSupplierName',
|
|
293
|
+
key: 'subSupplierName',
|
|
294
|
+
align: 'center',
|
|
295
|
+
width: 150
|
|
296
|
+
}, {
|
|
297
|
+
title: '一件代发价格',
|
|
298
|
+
key: 'oncePrice',
|
|
299
|
+
align: 'center',
|
|
300
|
+
render: function render(_, record) {
|
|
301
|
+
var _record$onceInfo, _record$onceInfo2, _record$onceInfo3, _record$onceInfo4, _record$onceInfo5, _record$onceInfo6, _record$onceInfo7, _record$onceInfo8, _record$onceInfo9, _record$onceInfo10, _record$onceInfo11, _record$onceInfo12, _record$onceInfo13, _record$onceInfo14, _record$onceInfo15, _record$onceInfo16, _record$onceInfo17, _record$onceInfo18, _record$onceInfo19, _record$onceInfo20;
|
|
302
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !lodash.isNil(record === null || record === void 0 ? void 0 : (_record$onceInfo = record.onceInfo) === null || _record$onceInfo === void 0 ? void 0 : _record$onceInfo.purchasePriceMin) && /*#__PURE__*/React.createElement("div", null, "\u91C7\u8D2D\u4EF7\uFF1A", showMoney(record === null || record === void 0 ? void 0 : (_record$onceInfo2 = record.onceInfo) === null || _record$onceInfo2 === void 0 ? void 0 : _record$onceInfo2.purchasePriceMin), (record === null || record === void 0 ? void 0 : (_record$onceInfo3 = record.onceInfo) === null || _record$onceInfo3 === void 0 ? void 0 : _record$onceInfo3.purchasePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$onceInfo4 = record.onceInfo) === null || _record$onceInfo4 === void 0 ? void 0 : _record$onceInfo4.purchasePriceMin) ? "~".concat(showMoney(record.onceInfo.purchasePriceMax)) : ''), !lodash.isNil(record === null || record === void 0 ? void 0 : (_record$onceInfo5 = record.onceInfo) === null || _record$onceInfo5 === void 0 ? void 0 : _record$onceInfo5.marketPriceMin) && /*#__PURE__*/React.createElement("div", null, "\u5E02\u573A\u4EF7\uFF1A", showMoney(record === null || record === void 0 ? void 0 : (_record$onceInfo6 = record.onceInfo) === null || _record$onceInfo6 === void 0 ? void 0 : _record$onceInfo6.marketPriceMin), (record === null || record === void 0 ? void 0 : (_record$onceInfo7 = record.onceInfo) === null || _record$onceInfo7 === void 0 ? void 0 : _record$onceInfo7.marketPriceMax) !== (record === null || record === void 0 ? void 0 : (_record$onceInfo8 = record.onceInfo) === null || _record$onceInfo8 === void 0 ? void 0 : _record$onceInfo8.marketPriceMin) ? "~".concat(showMoney(record.onceInfo.marketPriceMax)) : ''), !lodash.isNil(record === null || record === void 0 ? void 0 : (_record$onceInfo9 = record.onceInfo) === null || _record$onceInfo9 === void 0 ? void 0 : _record$onceInfo9.salePriceMin) && /*#__PURE__*/React.createElement("div", null, "\u9500\u552E\u4EF7\uFF1A", showMoney(record === null || record === void 0 ? void 0 : (_record$onceInfo10 = record.onceInfo) === null || _record$onceInfo10 === void 0 ? void 0 : _record$onceInfo10.salePriceMin), (record === null || record === void 0 ? void 0 : (_record$onceInfo11 = record.onceInfo) === null || _record$onceInfo11 === void 0 ? void 0 : _record$onceInfo11.salePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$onceInfo12 = record.onceInfo) === null || _record$onceInfo12 === void 0 ? void 0 : _record$onceInfo12.salePriceMin) ? "~".concat(showMoney(record.onceInfo.salePriceMax)) : ''), !lodash.isNil(record === null || record === void 0 ? void 0 : (_record$onceInfo13 = record.onceInfo) === null || _record$onceInfo13 === void 0 ? void 0 : _record$onceInfo13.sitePriceMin) && /*#__PURE__*/React.createElement("div", null, "\u5206\u9500\u4EF7\uFF1A", showMoney(record === null || record === void 0 ? void 0 : (_record$onceInfo14 = record.onceInfo) === null || _record$onceInfo14 === void 0 ? void 0 : _record$onceInfo14.sitePriceMin), (record === null || record === void 0 ? void 0 : (_record$onceInfo15 = record.onceInfo) === null || _record$onceInfo15 === void 0 ? void 0 : _record$onceInfo15.sitePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$onceInfo16 = record.onceInfo) === null || _record$onceInfo16 === void 0 ? void 0 : _record$onceInfo16.sitePriceMin) ? "~".concat(showMoney(record.onceInfo.sitePriceMax)) : ''), [record === null || record === void 0 ? void 0 : (_record$onceInfo17 = record.onceInfo) === null || _record$onceInfo17 === void 0 ? void 0 : _record$onceInfo17.purchasePriceMin, record === null || record === void 0 ? void 0 : (_record$onceInfo18 = record.onceInfo) === null || _record$onceInfo18 === void 0 ? void 0 : _record$onceInfo18.marketPriceMin, record === null || record === void 0 ? void 0 : (_record$onceInfo19 = record.onceInfo) === null || _record$onceInfo19 === void 0 ? void 0 : _record$onceInfo19.salePriceMin, record === null || record === void 0 ? void 0 : (_record$onceInfo20 = record.onceInfo) === null || _record$onceInfo20 === void 0 ? void 0 : _record$onceInfo20.sitePriceMin].every(function (num) {
|
|
303
|
+
return num == null;
|
|
304
|
+
}) && '-');
|
|
305
|
+
}
|
|
306
|
+
}, {
|
|
307
|
+
title: '集采批发价格',
|
|
308
|
+
key: 'purchasePrice',
|
|
309
|
+
align: 'center',
|
|
310
|
+
render: function render(_, record) {
|
|
311
|
+
var _record$purchaseInfo, _record$purchaseInfo2, _record$purchaseInfo3, _record$purchaseInfo4, _record$purchaseInfo5, _record$purchaseInfo6, _record$purchaseInfo7, _record$purchaseInfo8, _record$purchaseInfo9, _record$purchaseInfo10, _record$purchaseInfo11, _record$purchaseInfo12, _record$purchaseInfo13, _record$purchaseInfo14, _record$purchaseInfo15, _record$purchaseInfo16, _record$purchaseInfo17, _record$purchaseInfo18, _record$purchaseInfo19, _record$purchaseInfo20;
|
|
312
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !lodash.isNil(record === null || record === void 0 ? void 0 : (_record$purchaseInfo = record.purchaseInfo) === null || _record$purchaseInfo === void 0 ? void 0 : _record$purchaseInfo.purchasePriceMin) && /*#__PURE__*/React.createElement("div", null, "\u91C7\u8D2D\u4EF7\uFF1A", showMoney(record === null || record === void 0 ? void 0 : (_record$purchaseInfo2 = record.purchaseInfo) === null || _record$purchaseInfo2 === void 0 ? void 0 : _record$purchaseInfo2.purchasePriceMin), (record === null || record === void 0 ? void 0 : (_record$purchaseInfo3 = record.purchaseInfo) === null || _record$purchaseInfo3 === void 0 ? void 0 : _record$purchaseInfo3.purchasePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$purchaseInfo4 = record.purchaseInfo) === null || _record$purchaseInfo4 === void 0 ? void 0 : _record$purchaseInfo4.purchasePriceMin) ? "~".concat(showMoney(record.purchaseInfo.purchasePriceMax)) : ''), !lodash.isNil(record === null || record === void 0 ? void 0 : (_record$purchaseInfo5 = record.purchaseInfo) === null || _record$purchaseInfo5 === void 0 ? void 0 : _record$purchaseInfo5.marketPriceMin) && /*#__PURE__*/React.createElement("div", null, "\u5E02\u573A\u4EF7\uFF1A", showMoney(record === null || record === void 0 ? void 0 : (_record$purchaseInfo6 = record.purchaseInfo) === null || _record$purchaseInfo6 === void 0 ? void 0 : _record$purchaseInfo6.marketPriceMin), (record === null || record === void 0 ? void 0 : (_record$purchaseInfo7 = record.purchaseInfo) === null || _record$purchaseInfo7 === void 0 ? void 0 : _record$purchaseInfo7.marketPriceMax) !== (record === null || record === void 0 ? void 0 : (_record$purchaseInfo8 = record.purchaseInfo) === null || _record$purchaseInfo8 === void 0 ? void 0 : _record$purchaseInfo8.marketPriceMin) ? "~".concat(showMoney(record.purchaseInfo.marketPriceMax)) : ''), !lodash.isNil(record === null || record === void 0 ? void 0 : (_record$purchaseInfo9 = record.purchaseInfo) === null || _record$purchaseInfo9 === void 0 ? void 0 : _record$purchaseInfo9.salePriceMin) && /*#__PURE__*/React.createElement("div", null, "\u9500\u552E\u4EF7\uFF1A", showMoney(record === null || record === void 0 ? void 0 : (_record$purchaseInfo10 = record.purchaseInfo) === null || _record$purchaseInfo10 === void 0 ? void 0 : _record$purchaseInfo10.salePriceMin), (record === null || record === void 0 ? void 0 : (_record$purchaseInfo11 = record.purchaseInfo) === null || _record$purchaseInfo11 === void 0 ? void 0 : _record$purchaseInfo11.salePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$purchaseInfo12 = record.purchaseInfo) === null || _record$purchaseInfo12 === void 0 ? void 0 : _record$purchaseInfo12.salePriceMin) ? "~".concat(showMoney(record.purchaseInfo.salePriceMax)) : ''), !lodash.isNil(record === null || record === void 0 ? void 0 : (_record$purchaseInfo13 = record.purchaseInfo) === null || _record$purchaseInfo13 === void 0 ? void 0 : _record$purchaseInfo13.sitePriceMin) && /*#__PURE__*/React.createElement("div", null, "\u5206\u9500\u4EF7\uFF1A", showMoney(record === null || record === void 0 ? void 0 : (_record$purchaseInfo14 = record.purchaseInfo) === null || _record$purchaseInfo14 === void 0 ? void 0 : _record$purchaseInfo14.sitePriceMin), (record === null || record === void 0 ? void 0 : (_record$purchaseInfo15 = record.purchaseInfo) === null || _record$purchaseInfo15 === void 0 ? void 0 : _record$purchaseInfo15.sitePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$purchaseInfo16 = record.purchaseInfo) === null || _record$purchaseInfo16 === void 0 ? void 0 : _record$purchaseInfo16.sitePriceMin) ? "~".concat(showMoney(record.purchaseInfo.sitePriceMax / 100)) : ''), [record === null || record === void 0 ? void 0 : (_record$purchaseInfo17 = record.purchaseInfo) === null || _record$purchaseInfo17 === void 0 ? void 0 : _record$purchaseInfo17.purchasePriceMin, record === null || record === void 0 ? void 0 : (_record$purchaseInfo18 = record.purchaseInfo) === null || _record$purchaseInfo18 === void 0 ? void 0 : _record$purchaseInfo18.marketPriceMin, record === null || record === void 0 ? void 0 : (_record$purchaseInfo19 = record.purchaseInfo) === null || _record$purchaseInfo19 === void 0 ? void 0 : _record$purchaseInfo19.salePriceMin, record === null || record === void 0 ? void 0 : (_record$purchaseInfo20 = record.purchaseInfo) === null || _record$purchaseInfo20 === void 0 ? void 0 : _record$purchaseInfo20.sitePriceMin].every(function (num) {
|
|
313
|
+
return num == null;
|
|
314
|
+
}) && '-');
|
|
315
|
+
}
|
|
316
|
+
}, {
|
|
317
|
+
title: '库存',
|
|
318
|
+
dataIndex: 'stock',
|
|
319
|
+
key: 'stock',
|
|
320
|
+
align: 'center',
|
|
321
|
+
width: 100
|
|
322
|
+
}, {
|
|
323
|
+
title: '操作',
|
|
324
|
+
dataIndex: 'action',
|
|
325
|
+
key: 'action',
|
|
326
|
+
align: 'center',
|
|
327
|
+
fixed: 'right',
|
|
328
|
+
width: 80,
|
|
329
|
+
hideInTable: !multiple,
|
|
330
|
+
render: function render(text, record) {
|
|
331
|
+
if (defaultSelectedGoodsIds.includes(record[rowKey])) {
|
|
332
|
+
return /*#__PURE__*/React.createElement(_Button, {
|
|
333
|
+
disabled: true,
|
|
334
|
+
type: "link",
|
|
335
|
+
size: "small"
|
|
336
|
+
}, "\u5DF2\u6311\u9009");
|
|
337
|
+
}
|
|
338
|
+
return /*#__PURE__*/React.createElement(_Button, {
|
|
339
|
+
onClick: function onClick() {
|
|
340
|
+
return onOk([record[rowKey]], [record]);
|
|
341
|
+
},
|
|
342
|
+
type: "link",
|
|
343
|
+
size: "small"
|
|
344
|
+
}, "\u6311\u9009");
|
|
345
|
+
}
|
|
346
|
+
}];
|
|
347
|
+
return /*#__PURE__*/React.createElement(PlusConfigProvider, null, /*#__PURE__*/React.createElement(_Modal, {
|
|
348
|
+
title: "\u6311\u9009\u5546\u54C1",
|
|
349
|
+
open: open,
|
|
350
|
+
footer: null,
|
|
351
|
+
width: 1366,
|
|
352
|
+
onCancel: onCancel,
|
|
353
|
+
className: "choose-goods-modal",
|
|
354
|
+
centered: true
|
|
355
|
+
}, /*#__PURE__*/React.createElement(QueryFilter, {
|
|
356
|
+
className: "fle-choose-mall-filter",
|
|
357
|
+
formRef: formRef,
|
|
358
|
+
colProps: {
|
|
359
|
+
span: 8
|
|
360
|
+
},
|
|
361
|
+
defaultCollapsed: false,
|
|
362
|
+
loading: getGoodsListLoading,
|
|
363
|
+
initialValues: {
|
|
364
|
+
orderName: sortOptions[0].value,
|
|
365
|
+
orderWay: 'desc'
|
|
366
|
+
},
|
|
367
|
+
onFinish: function onFinish(values) {
|
|
368
|
+
var params = _objectSpread(_objectSpread({}, DefaultParams), values);
|
|
369
|
+
setSearchParams(params);
|
|
370
|
+
getGoodsList(params);
|
|
371
|
+
},
|
|
372
|
+
onReset: function onReset(values) {
|
|
373
|
+
var params = _objectSpread(_objectSpread({}, DefaultParams), values);
|
|
374
|
+
setSearchParams(params);
|
|
375
|
+
getGoodsList(params);
|
|
376
|
+
}
|
|
377
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
378
|
+
name: "keyword"
|
|
379
|
+
}, /*#__PURE__*/React.createElement(_Input, {
|
|
380
|
+
className: "prod-search",
|
|
381
|
+
placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0/ID/\u54C1\u724C",
|
|
382
|
+
maxLength: 20
|
|
383
|
+
})), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
384
|
+
name: "flagCategory"
|
|
385
|
+
}, /*#__PURE__*/React.createElement(_Cascader, {
|
|
386
|
+
allowClear: true,
|
|
387
|
+
changeOnSelect: true,
|
|
388
|
+
placeholder: "\u9009\u62E9\u5546\u54C1\u5206\u7C7B",
|
|
389
|
+
fieldNames: {
|
|
390
|
+
label: 'name',
|
|
391
|
+
value: 'id'
|
|
392
|
+
},
|
|
393
|
+
options: flagCategoryOptions,
|
|
394
|
+
expandTrigger: "hover"
|
|
395
|
+
})), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
396
|
+
label: /*#__PURE__*/React.createElement(_Form.Item, {
|
|
397
|
+
noStyle: true,
|
|
398
|
+
name: "priceType",
|
|
399
|
+
initialValue: "purchaseMarketPrice"
|
|
400
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
|
401
|
+
dropdownStyle: {
|
|
402
|
+
width: 120
|
|
403
|
+
},
|
|
404
|
+
className: "price-type",
|
|
405
|
+
placeholder: "\u4EF7\u683C\u7C7B\u578B",
|
|
406
|
+
options: priceRangeForPurchase,
|
|
407
|
+
variant: "borderless"
|
|
408
|
+
}))
|
|
409
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
410
|
+
name: "rangePrice",
|
|
411
|
+
noStyle: true
|
|
412
|
+
}, /*#__PURE__*/React.createElement(PlusRangeInput, {
|
|
413
|
+
placeholder: ['最低', '最高'],
|
|
414
|
+
precision: 2
|
|
415
|
+
}))), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
416
|
+
name: "flagScene"
|
|
417
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
|
418
|
+
options: flagSceneOptions,
|
|
419
|
+
fieldNames: {
|
|
420
|
+
label: 'flag',
|
|
421
|
+
value: 'id'
|
|
422
|
+
},
|
|
423
|
+
placeholder: "\u9009\u62E9\u573A\u666F\u6807\u7B7E",
|
|
424
|
+
allowClear: true
|
|
425
|
+
})), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
426
|
+
name: "flagTags"
|
|
427
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
|
428
|
+
options: flagTagsOptions,
|
|
429
|
+
fieldNames: {
|
|
430
|
+
label: 'flag',
|
|
431
|
+
value: 'id'
|
|
432
|
+
},
|
|
433
|
+
placeholder: "\u9009\u62E9\u5546\u54C1\u6807\u7B7E",
|
|
434
|
+
allowClear: true
|
|
435
|
+
})), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
436
|
+
name: "flagIndustry"
|
|
437
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
|
438
|
+
options: flagIndustryOptions,
|
|
439
|
+
fieldNames: {
|
|
440
|
+
label: 'flag',
|
|
441
|
+
value: 'id'
|
|
442
|
+
},
|
|
443
|
+
placeholder: "\u9009\u62E9\u884C\u4E1A\u6807\u7B7E",
|
|
444
|
+
allowClear: true
|
|
445
|
+
})), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
446
|
+
name: "orderName"
|
|
447
|
+
}, /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
448
|
+
optionType: "button",
|
|
449
|
+
buttonStyle: "solid",
|
|
450
|
+
onChange: function onChange() {
|
|
451
|
+
var _formRef$current3;
|
|
452
|
+
return (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.submit();
|
|
453
|
+
}
|
|
454
|
+
}, sortOptions.map(function (item) {
|
|
455
|
+
return /*#__PURE__*/React.createElement(_Radio.Button, {
|
|
456
|
+
key: item.value,
|
|
457
|
+
value: item.value
|
|
458
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
459
|
+
className: "sort-item"
|
|
460
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
461
|
+
className: "sort-item-label"
|
|
462
|
+
}, item.label), /*#__PURE__*/React.createElement(Icon, {
|
|
463
|
+
type: "icon-paixu",
|
|
464
|
+
className: "sort-item-icon"
|
|
465
|
+
})));
|
|
466
|
+
}))), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
467
|
+
name: "orderWay",
|
|
468
|
+
hidden: true
|
|
469
|
+
}, /*#__PURE__*/React.createElement(_Input, null))), /*#__PURE__*/React.createElement(ProTable, {
|
|
470
|
+
bordered: true,
|
|
471
|
+
size: "small",
|
|
472
|
+
search: false,
|
|
473
|
+
options: false,
|
|
474
|
+
onRow: function onRow(record) {
|
|
475
|
+
return {
|
|
476
|
+
onClick: function onClick(event) {
|
|
477
|
+
event.preventDefault();
|
|
478
|
+
if (defaultSelectedGoodsIds.includes(record[rowKey])) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
var newSelectedRowKeys = selectedRowKeys.includes(record[rowKey]);
|
|
482
|
+
if (multiple && !newSelectedRowKeys) {
|
|
483
|
+
setSelectedRows([].concat(_toConsumableArray(selectedRows), [record]));
|
|
484
|
+
setSelectedRowKeys([].concat(_toConsumableArray(selectedRowKeys), [record[rowKey]]));
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
},
|
|
489
|
+
dataSource: goodsData === null || goodsData === void 0 ? void 0 : goodsData.list,
|
|
490
|
+
columns: columns.length ? columns : defaultColumns,
|
|
491
|
+
pagination: {
|
|
492
|
+
pageSize: pageSize,
|
|
493
|
+
current: searchParams.pageNo,
|
|
494
|
+
position: ['bottomCenter'],
|
|
495
|
+
total: goodsData === null || goodsData === void 0 ? void 0 : goodsData.total,
|
|
496
|
+
showQuickJumper: false,
|
|
497
|
+
showSizeChanger: true,
|
|
498
|
+
size: 'default',
|
|
499
|
+
onChange: function onChange(page, pageSize) {
|
|
500
|
+
setSearchParams(function (params) {
|
|
501
|
+
var newParams = _objectSpread(_objectSpread({}, params), {}, {
|
|
502
|
+
pageSize: pageSize,
|
|
503
|
+
pageNo: page
|
|
504
|
+
});
|
|
505
|
+
getGoodsList(newParams);
|
|
506
|
+
setPageSize(pageSize);
|
|
507
|
+
return newParams;
|
|
508
|
+
});
|
|
509
|
+
},
|
|
510
|
+
showTotal: function showTotal(total) {
|
|
511
|
+
return "\u5171 ".concat(total, " \u6761\u6570\u636E");
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
rowKey: rowKey,
|
|
515
|
+
tableAlertRender: false,
|
|
516
|
+
loading: getGoodsListLoading,
|
|
517
|
+
scroll: scroll,
|
|
518
|
+
rowSelection: multiple ? rowSelection : undefined
|
|
519
|
+
}), multiple && /*#__PURE__*/React.createElement(_Button, {
|
|
520
|
+
type: "primary",
|
|
521
|
+
style: {
|
|
522
|
+
position: 'absolute',
|
|
523
|
+
bottom: 16,
|
|
524
|
+
right: 24
|
|
525
|
+
},
|
|
526
|
+
onClick: function onClick() {
|
|
527
|
+
return onOk(selectedRowKeys, selectedRows);
|
|
528
|
+
},
|
|
529
|
+
disabled: selectedRowKeys.length === 0
|
|
530
|
+
}, "\u6279\u91CF\u6311\u9009(", selectedRowKeys.length, ")")));
|
|
531
|
+
};
|
|
532
|
+
export default ChooseSiteGoods;
|