kmkf-work-order-service-component 0.3.0-alpha.1 → 0.3.0-alpha.3

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/README.md CHANGED
@@ -63,10 +63,11 @@ const Text = ()=>{
63
63
 
64
64
  ```
65
65
 
66
- | 字段 | 说明 | 数据类型 |
67
- | --------- | -------- | ------------------------------------ |
68
- | platform | 平台 | TAOBAO =淘宝\|FXG=抖音\|PDD=拼多多\| |
69
- | shopId | 店铺 ID | number |
70
- | buyerNick | 买家昵称 | string |
71
- | buyerId | 买家 id | string |
72
- | orderNo | 订单 id | string |
66
+ | 字段 | 说明 | 数据类型 |
67
+ | ----------------- | ---------------- | ------------------------------------ |
68
+ | platform | 平台 | TAOBAO =淘宝\|FXG=抖音\|PDD=拼多多\| |
69
+ | shopId | 店铺 ID | number |
70
+ | buyerNick | 买家昵称 | string |
71
+ | buyerId | 买家 id | string |
72
+ | orderNo | 订单 id | string |
73
+ | onEmpowerCallback | 授权弹框点击回调 | function |
@@ -42,6 +42,7 @@ import 'moment/locale/zh-cn';
42
42
  import { calcWorkOrderList, submitDataTransOldFormat, orderBack } from "../../../common/utils/tools";
43
43
  import { factory } from "../Widget";
44
44
  import { queryTemplateDetail, addWorkOrder, queryWorkOrderDetail, updateWorkOrder } from "../../../model/servers/api";
45
+ import { useAppSelector } from "../../../model/hooks";
45
46
  import styles from "./index.module.less";
46
47
  import "./index.less";
47
48
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -91,6 +92,10 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
91
92
  setCurrentShopId = _useState14[1]; // 有些组件对于shopId有依赖
92
93
 
93
94
 
95
+ var platformInfo = useAppSelector(function (state) {
96
+ return state.global.platformInfo;
97
+ });
98
+
94
99
  var _Form$useForm = Form.useForm(),
95
100
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
96
101
  form = _Form$useForm2[0];
@@ -104,7 +109,7 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
104
109
 
105
110
  var asyncDoSave = /*#__PURE__*/function () {
106
111
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(workOrderDetail, templateDetail) {
107
- var data, res, params, submitData, _yield$updateWorkOrde, success, result, _params, hasEnterPrisePayment, getEnterPrisePaymentData, uniqueKey, componentConfig, _yield$addWorkOrder, _success, _result;
112
+ var data, res, params, submitData, _yield$updateWorkOrde, success, result, platformMap, _params, hasEnterPrisePayment, getEnterPrisePaymentData, uniqueKey, componentConfig, _yield$addWorkOrder, _success, _result;
108
113
 
109
114
  return _regeneratorRuntime().wrap(function _callee$(_context) {
110
115
  while (1) {
@@ -170,10 +175,18 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
170
175
  });
171
176
  }
172
177
 
173
- _context.next = 35;
178
+ _context.next = 36;
174
179
  break;
175
180
 
176
181
  case 23:
182
+ platformMap = {
183
+ tb: '淘宝',
184
+ fxg: '抖音',
185
+ ks: '快手',
186
+ pdd: '拼多多',
187
+ jd: '京东',
188
+ xiaozhi: '小智'
189
+ };
177
190
  _params = {
178
191
  apiName: 'addWorkOrder',
179
192
  shopId: currentShopId,
@@ -181,7 +194,8 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
181
194
  workOrderComponentVos: [],
182
195
  accessToken: get(find(shopList, function (s) {
183
196
  return s.shopId === currentShopId;
184
- }), 'accessToken', '')
197
+ }), 'accessToken', ''),
198
+ source: platformMap[platformInfo.platform] || '工单通'
185
199
  };
186
200
  _params.workOrderComponentVos = submitDataTransOldFormat(data, templateDetail, !!workOrderId, workOrderDetail, _params);
187
201
  hasEnterPrisePayment = some(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, function (item) {
@@ -207,12 +221,11 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
207
221
  };
208
222
  }
209
223
 
210
- console.debug('增加数据参数', _params); // return;
211
-
212
- _context.next = 31;
224
+ console.debug('增加数据参数', _params);
225
+ _context.next = 32;
213
226
  return addWorkOrder(_params);
214
227
 
215
- case 31:
228
+ case 32:
216
229
  _yield$addWorkOrder = _context.sent;
217
230
  _success = _yield$addWorkOrder.success;
218
231
  _result = _yield$addWorkOrder.data;
@@ -227,13 +240,13 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
227
240
  });
228
241
  }
229
242
 
230
- case 35:
243
+ case 36:
231
244
  console.groupEnd();
232
- _context.next = 41;
245
+ _context.next = 42;
233
246
  break;
234
247
 
235
- case 38:
236
- _context.prev = 38;
248
+ case 39:
249
+ _context.prev = 39;
237
250
  _context.t0 = _context["catch"](0);
238
251
 
239
252
  // 表单校验失败错误时,将错误第一项滚动到可视区域
@@ -249,12 +262,12 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
249
262
  }, 0);
250
263
  }
251
264
 
252
- case 41:
265
+ case 42:
253
266
  case "end":
254
267
  return _context.stop();
255
268
  }
256
269
  }
257
- }, _callee, null, [[0, 38]]);
270
+ }, _callee, null, [[0, 39]]);
258
271
  }));
259
272
 
260
273
  return function asyncDoSave(_x, _x2) {
@@ -1,5 +1,5 @@
1
- declare const openCustomizeWOrkOrder: (prefixParams: {
1
+ declare const openCustomizeWorkOrder: (prefixParams: {
2
2
  shopList?: [] | undefined;
3
3
  onSuccess?: ((val?: any) => void) | undefined;
4
4
  }) => (params: any) => void;
5
- export default openCustomizeWOrkOrder;
5
+ export default openCustomizeWorkOrder;
@@ -7,8 +7,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
7
7
  /*
8
8
  * @Author: wangzhenggui jianjia.wzg@raycloud.com
9
9
  * @Date: 2022-09-13 14:30:28
10
- * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
11
- * @LastEditTime: 2022-10-26 15:00:58
10
+ * @LastEditors: litian
11
+ * @LastEditTime: 2022-12-01 16:30:15
12
12
  * @FilePath: /kmkf-work-order-service-component/src/WorkOrder/components/CustomizeFormModal/wrap.tsx
13
13
  * @Description:
14
14
  *
@@ -19,7 +19,7 @@ import { render as reactRender, unmount as reactUnmount } from 'rc-util/lib/Reac
19
19
  import CustomizeFormModal from "./index";
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
 
22
- var openCustomizeWOrkOrder = function openCustomizeWOrkOrder(prefixParams) {
22
+ var openCustomizeWorkOrder = function openCustomizeWorkOrder(prefixParams) {
23
23
  return function (params) {
24
24
  var container = document.createDocumentFragment();
25
25
  var ref = /*#__PURE__*/createRef();
@@ -50,4 +50,4 @@ var openCustomizeWOrkOrder = function openCustomizeWOrkOrder(prefixParams) {
50
50
  };
51
51
  };
52
52
 
53
- export default openCustomizeWOrkOrder;
53
+ export default openCustomizeWorkOrder;
@@ -53,13 +53,22 @@ var DealerSelectModal = function DealerSelectModal() {
53
53
  while (1) {
54
54
  switch (_context.prev = _context.next) {
55
55
  case 0:
56
- _context.next = 2;
56
+ if (!((selectedCompanyUserList === null || selectedCompanyUserList === void 0 ? void 0 : selectedCompanyUserList.length) === 0)) {
57
+ _context.next = 3;
58
+ break;
59
+ }
60
+
61
+ message.error('指定处理人不能为空');
62
+ return _context.abrupt("return");
63
+
64
+ case 3:
65
+ _context.next = 5;
57
66
  return appointTo({
58
67
  workOrderUniqueKeys: [record === null || record === void 0 ? void 0 : record.id],
59
68
  companyUserKeys: selectedCompanyUserList
60
69
  });
61
70
 
62
- case 2:
71
+ case 5:
63
72
  _yield$appointTo = _context.sent;
64
73
  success = _yield$appointTo.success;
65
74
  errMsg = _yield$appointTo.message;
@@ -73,7 +82,7 @@ var DealerSelectModal = function DealerSelectModal() {
73
82
  message.error(errMsg);
74
83
  }
75
84
 
76
- case 6:
85
+ case 9:
77
86
  case "end":
78
87
  return _context.stop();
79
88
  }
@@ -35,6 +35,7 @@ import { setModalVisible } from "../../../model/statusSelect";
35
35
  import styles from "./index.module.less";
36
36
  import { jsx as _jsx } from "react/jsx-runtime";
37
37
  import { jsxs as _jsxs } from "react/jsx-runtime";
38
+ import { Fragment as _Fragment } from "react/jsx-runtime";
38
39
 
39
40
  function ListOrderItem(props) {
40
41
  var _WORK_ORDER_STATUS$it, _item$jsonMap, _item$handlerList, _item$handlerList$map;
@@ -53,31 +54,8 @@ function ListOrderItem(props) {
53
54
  var ItemHeader = function ItemHeader() {
54
55
  var _WORK_ORDER_STATUS, _WORK_ORDER_STATUS2;
55
56
 
56
- // 获取工单状态组件自定义文案
57
- var showStatusText = function showStatusText(componentDtoList) {
58
- var status = '';
59
- var len = componentDtoList.length;
60
-
61
- for (var i = 0; i < len; i++) {
62
- var obj = componentDtoList[i];
63
-
64
- if (obj.workOrderComponentType === 'STATUS') {
65
- var _obj$componentConfig = obj.componentConfig,
66
- customStatusText = _obj$componentConfig.customStatusText,
67
- isUseCustomStatus = _obj$componentConfig.isUseCustomStatus;
68
- status = isUseCustomStatus ? customStatusText : '处理';
69
- break;
70
- }
71
- }
72
-
73
- return status;
74
- };
75
-
76
- var id = item.id,
77
- templateDetailDto = item.templateDetailDto,
57
+ var templateDetailDto = item.templateDetailDto,
78
58
  jsonMap = item.jsonMap;
79
- var componentDtoList = templateDetailDto ? templateDetailDto.componentDtoList : [];
80
- var status = showStatusText(componentDtoList);
81
59
  return /*#__PURE__*/_jsx("div", {
82
60
  className: styles.orderItem,
83
61
  children: /*#__PURE__*/_jsx("div", {
@@ -102,21 +80,6 @@ function ListOrderItem(props) {
102
80
  };
103
81
 
104
82
  var ItemActions = function ItemActions() {
105
- // 售后打款组件
106
- var isAfterSalePayment = function isAfterSalePayment(componentDtoList) {
107
- var len = componentDtoList.length;
108
-
109
- for (var i = 0; i < len; i++) {
110
- var obj = componentDtoList[i];
111
-
112
- if (obj.workOrderComponentType === 'AFTER_SALE_PAYMENT') {
113
- return true;
114
- }
115
- }
116
-
117
- return false;
118
- };
119
-
120
83
  var deleteHandle = function deleteHandle(record) {
121
84
  dispatch({
122
85
  type: 'workOrder/setCurrentCustomizeRecord',
@@ -148,37 +111,36 @@ function ListOrderItem(props) {
148
111
  dispatch(setModalVisible(true));
149
112
  };
150
113
 
151
- var templateDetailDto = item.templateDetailDto,
152
- jsonMap = item.jsonMap;
153
- var componentDtoList = templateDetailDto ? templateDetailDto.componentDtoList : [];
114
+ var jsonMap = item.jsonMap;
154
115
  var unCompletedStatus = [WAITING, HANDLING, STOPPING].includes(jsonMap === null || jsonMap === void 0 ? void 0 : jsonMap.flowStatus);
155
- var editBtnShow = !isAfterSalePayment(componentDtoList) && unCompletedStatus;
156
116
  return /*#__PURE__*/_jsxs("div", {
157
117
  className: styles.orderItemRight,
158
- children: [/*#__PURE__*/_jsx("span", {
159
- className: styles.orderItemOperate,
160
- onClick: function onClick() {
161
- return handleChangeStatus(item);
162
- },
163
- children: "\u5904\u7406"
164
- }), /*#__PURE__*/_jsx("span", {
165
- className: styles.orderItemOperate,
166
- onClick: function onClick() {
167
- return transferOrder(item);
168
- },
169
- children: "\u8F6C\u4EA4"
170
- }), editBtnShow && /*#__PURE__*/_jsx("span", {
171
- className: styles.orderItemOperate,
172
- onClick: function onClick() {
173
- return onEdit(item);
174
- },
175
- children: "\u4FEE\u6539"
176
- }), unCompletedStatus && /*#__PURE__*/_jsx("span", {
177
- className: styles.orderItemOperate,
178
- onClick: function onClick() {
179
- return deleteHandle(item);
180
- },
181
- children: "\u5220\u9664"
118
+ children: [unCompletedStatus && /*#__PURE__*/_jsxs(_Fragment, {
119
+ children: [/*#__PURE__*/_jsx("span", {
120
+ className: styles.orderItemOperate,
121
+ onClick: function onClick() {
122
+ return handleChangeStatus(item);
123
+ },
124
+ children: "\u5904\u7406"
125
+ }), /*#__PURE__*/_jsx("span", {
126
+ className: styles.orderItemOperate,
127
+ onClick: function onClick() {
128
+ return transferOrder(item);
129
+ },
130
+ children: "\u8F6C\u4EA4"
131
+ }), /*#__PURE__*/_jsx("span", {
132
+ className: styles.orderItemOperate,
133
+ onClick: function onClick() {
134
+ return onEdit(item);
135
+ },
136
+ children: "\u4FEE\u6539"
137
+ }), /*#__PURE__*/_jsx("span", {
138
+ className: styles.orderItemOperate,
139
+ onClick: function onClick() {
140
+ return deleteHandle(item);
141
+ },
142
+ children: "\u5220\u9664"
143
+ })]
182
144
  }), /*#__PURE__*/_jsx("span", {
183
145
  className: styles.orderItemOperate,
184
146
  onClick: function onClick() {
@@ -207,34 +169,29 @@ function ListOrderItem(props) {
207
169
 
208
170
  return /*#__PURE__*/_jsxs("div", {
209
171
  className: styles.listOrderItemBox,
210
- children: [/*#__PURE__*/_jsx(ItemHeader, {}), ItemView({
211
- label: '提交时间',
212
- value: moment(transData.created).format('YYYY-MM-DD HH:mm:ss'),
213
- key: 'created'
214
- }), ItemView({
215
- label: '提交客服',
216
- value: transData.submitter,
217
- key: 'submitter'
218
- }), ItemView({
219
- label: '工单状态',
220
- value: (_WORK_ORDER_STATUS$it = WORK_ORDER_STATUS[item === null || item === void 0 ? void 0 : (_item$jsonMap = item.jsonMap) === null || _item$jsonMap === void 0 ? void 0 : _item$jsonMap.flowStatus]) === null || _WORK_ORDER_STATUS$it === void 0 ? void 0 : _WORK_ORDER_STATUS$it.label,
221
- key: 'flowStatus'
222
- }), ItemView({
223
- label: '处理客服',
172
+ children: [/*#__PURE__*/_jsx(ItemHeader, {}), /*#__PURE__*/_jsx(ItemView, {
173
+ label: "\u63D0\u4EA4\u65F6\u95F4",
174
+ value: moment(transData.created).format('YYYY-MM-DD HH:mm:ss')
175
+ }, "created"), /*#__PURE__*/_jsx(ItemView, {
176
+ label: "\u63D0\u4EA4\u5BA2\u670D",
177
+ value: transData.submitter
178
+ }, "submitter"), /*#__PURE__*/_jsx(ItemView, {
179
+ label: "\u5DE5\u5355\u72B6\u6001",
180
+ value: (_WORK_ORDER_STATUS$it = WORK_ORDER_STATUS[item === null || item === void 0 ? void 0 : (_item$jsonMap = item.jsonMap) === null || _item$jsonMap === void 0 ? void 0 : _item$jsonMap.flowStatus]) === null || _WORK_ORDER_STATUS$it === void 0 ? void 0 : _WORK_ORDER_STATUS$it.label
181
+ }, "flowStatus"), /*#__PURE__*/_jsx(ItemView, {
182
+ label: "\u5904\u7406\u5BA2\u670D",
224
183
  value: item === null || item === void 0 ? void 0 : (_item$handlerList = item.handlerList) === null || _item$handlerList === void 0 ? void 0 : (_item$handlerList$map = _item$handlerList.map(function (i) {
225
184
  return i.account;
226
- })) === null || _item$handlerList$map === void 0 ? void 0 : _item$handlerList$map.join('、'),
227
- key: 'handleList'
228
- }), /*#__PURE__*/_jsx(Divider, {
185
+ })) === null || _item$handlerList$map === void 0 ? void 0 : _item$handlerList$map.join('、')
186
+ }, "handleList"), /*#__PURE__*/_jsx(Divider, {
229
187
  dashed: true,
230
188
  style: {
231
189
  margin: '8px 0'
232
190
  }
233
- }), ItemView({
234
- label: '店铺名称',
235
- value: transData.shopName,
236
- key: 'shopName'
237
- }), componentDtoList.map(function (t) {
191
+ }), /*#__PURE__*/_jsx(ItemView, {
192
+ label: "\u5E97\u94FA\u540D\u79F0",
193
+ value: transData.shopName
194
+ }, "shopName"), componentDtoList.map(function (t) {
238
195
  var instance = factory(t.workOrderComponentType, {
239
196
  id: t.uniqueKey,
240
197
  name: t.name,
@@ -243,16 +200,14 @@ function ListOrderItem(props) {
243
200
  var subColumns = instance.getColumns(); // 复合组件存在多个字段展示
244
201
 
245
202
  return subColumns !== null && subColumns !== void 0 && subColumns.children ? subColumns.children.map(function (item) {
246
- return !isEmpty(transData[(item === null || item === void 0 ? void 0 : item.dataIndex) || '']) ? ItemView({
203
+ return !isEmpty(transData[(item === null || item === void 0 ? void 0 : item.dataIndex) || '']) ? /*#__PURE__*/_jsx(ItemView, {
247
204
  label: item.title,
248
- value: item.render(transData[(item === null || item === void 0 ? void 0 : item.dataIndex) || ''], transData),
249
- key: item.dataIndex
250
- }) : null;
251
- }) : !isEmpty(transData[(subColumns === null || subColumns === void 0 ? void 0 : subColumns.dataIndex) || '']) ? ItemView({
205
+ value: item.render(transData[(item === null || item === void 0 ? void 0 : item.dataIndex) || ''], transData)
206
+ }, item.dataIndex) : null;
207
+ }) : !isEmpty(transData[(subColumns === null || subColumns === void 0 ? void 0 : subColumns.dataIndex) || '']) ? /*#__PURE__*/_jsx(ItemView, {
252
208
  label: t.name,
253
- value: instance.render(transData[(subColumns === null || subColumns === void 0 ? void 0 : subColumns.dataIndex) || ''], transData),
254
- key: t.uniqueKey
255
- }) : null;
209
+ value: instance.render(transData[(subColumns === null || subColumns === void 0 ? void 0 : subColumns.dataIndex) || ''], transData)
210
+ }, t.uniqueKey) : null;
256
211
  }), /*#__PURE__*/_jsx(Divider, {
257
212
  dashed: true,
258
213
  style: {
@@ -101,9 +101,7 @@ function ModifyModal(props, ref) {
101
101
  var handleOk = function handleOk() {
102
102
  form.validateFields().then( /*#__PURE__*/function () {
103
103
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
104
- var _shopList$find;
105
-
106
- var id, shopSourceStr, newValue, api, shopId, shopName, _shopList, other, _yield$api, success;
104
+ var id, newValue, api, shopId, shopName, _shopList, other, _yield$api, success;
107
105
 
108
106
  return _regeneratorRuntime().wrap(function _callee$(_context) {
109
107
  while (1) {
@@ -111,16 +109,18 @@ function ModifyModal(props, ref) {
111
109
  case 0:
112
110
  //非淘宝账户支付宝姓名和支付宝账号必填
113
111
  id = type === 'edit' ? record.shopId : shopInfo.shopId;
114
- shopSourceStr = ((_shopList$find = shopList.find(function (item) {
115
- return item.shopId == id;
116
- })) === null || _shopList$find === void 0 ? void 0 : _shopList$find.shopSourceStr) || '';
117
112
 
118
- if (!(shopSourceStr !== 'TAOBAO' && (!values.accountNick || !values.accountNo))) {
113
+ if (!(values !== null && values !== void 0 && values.accountNick || values !== null && values !== void 0 && values.accountNo)) {
114
+ _context.next = 5;
115
+ break;
116
+ }
117
+
118
+ if (values !== null && values !== void 0 && values.accountNick && values !== null && values !== void 0 && values.accountNo) {
119
119
  _context.next = 5;
120
120
  break;
121
121
  }
122
122
 
123
- message.error('请输入支付宝姓名和支付宝账号');
123
+ message.error('支付宝姓名/账号都要填写');
124
124
  return _context.abrupt("return");
125
125
 
126
126
  case 5:
@@ -131,7 +131,9 @@ function ModifyModal(props, ref) {
131
131
  shopId = record.shopId, shopName = record.shopName, _shopList = record.shopList, other = _objectWithoutProperties(record, _excluded);
132
132
  newValue = _objectSpread(_objectSpread({}, other), values);
133
133
  } else {
134
- newValue = _objectSpread(_objectSpread({}, values), shopInfo);
134
+ newValue = _objectSpread(_objectSpread(_objectSpread({}, values), shopInfo), {}, {
135
+ buyerOpenUid: record.buyerOpenUid
136
+ });
135
137
  }
136
138
 
137
139
  _context.next = 10;
@@ -224,12 +226,12 @@ function ModifyModal(props, ref) {
224
226
  }();
225
227
 
226
228
  var TidChangeHandle = function TidChangeHandle(e) {
227
- var _shopList$find2;
229
+ var _shopList$find;
228
230
 
229
231
  var order_no = e.target.value;
230
- var taobaoId = (_shopList$find2 = shopList.find(function (item) {
232
+ var taobaoId = (_shopList$find = shopList.find(function (item) {
231
233
  return item.shopSourceStr === 'TAOBAO' && item.shopId == platformInfo.shopId;
232
- })) === null || _shopList$find2 === void 0 ? void 0 : _shopList$find2.taobaoId; //淘宝订单买家id返填
234
+ })) === null || _shopList$find === void 0 ? void 0 : _shopList$find.taobaoId; //淘宝订单买家id返填
233
235
 
234
236
  if (taobaoId) {
235
237
  clearTimeout(time.current);
@@ -330,18 +332,10 @@ function ModifyModal(props, ref) {
330
332
  label: "\u4E70\u5BB6\u6635\u79F0",
331
333
  name: "buyerNick",
332
334
  rules: [{
333
- required: true,
335
+ required: false,
334
336
  message: '请输入买家昵称'
335
337
  }],
336
338
  children: /*#__PURE__*/_jsx(Input, {})
337
- }), /*#__PURE__*/_jsx(Form.Item, {
338
- label: "\u4E70\u5BB6\u6635\u79F0id",
339
- name: "buyerOpenUid",
340
- rules: [{
341
- required: true,
342
- message: '请输入买家昵称id'
343
- }],
344
- children: /*#__PURE__*/_jsx(Input, {})
345
339
  }), /*#__PURE__*/_jsx(Form.Item, {
346
340
  label: "\u8BA2\u5355\u7F16\u53F7",
347
341
  name: "tid",
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface ReminderProps {
3
+ callback?: () => void;
4
+ }
5
+ declare function Reminder(props: ReminderProps): JSX.Element;
6
+ export default Reminder;
@@ -0,0 +1,71 @@
1
+ /*
2
+ * @Description:
3
+ * @Author: litian
4
+ * @Date: 2022-09-15 15:00:37
5
+ * @LastEditors: litian
6
+ * @LastEditTime: 2022-09-29 09:13:26
7
+ */
8
+ import React from 'react';
9
+ import { message, Button } from 'antd';
10
+ import styles from "./index.module.less";
11
+ import copy from 'copy-to-clipboard';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+
15
+ function Reminder(props) {
16
+ var callback = props.callback;
17
+
18
+ var copyHandle = function copyHandle() {
19
+ copy('https://kefu.kuaimai.com/qiye/enterprise.html#/main/shopManage');
20
+ message.success('工单授权页复制链接成功');
21
+ callback === null || callback === void 0 ? void 0 : callback();
22
+ };
23
+
24
+ return /*#__PURE__*/_jsx("div", {
25
+ className: styles.reminder,
26
+ children: /*#__PURE__*/_jsxs("div", {
27
+ className: styles.reminder_box,
28
+ children: [/*#__PURE__*/_jsx("div", {
29
+ className: styles.tip_error,
30
+ children: "\u5F02\u5E38\u63D0\u9192"
31
+ }), /*#__PURE__*/_jsxs("div", {
32
+ className: "".concat(styles.color_565960, " ").concat(styles.mb_16),
33
+ children: ["\u5E97\u94FA", /*#__PURE__*/_jsx("span", {
34
+ className: styles.color_F40500,
35
+ children: "\u672A\u6388\u6743"
36
+ }), "\u6216", /*#__PURE__*/_jsx("span", {
37
+ className: styles.color_F40500,
38
+ children: "\u6388\u6743\u5931\u6548"
39
+ }), "\u6216", /*#__PURE__*/_jsx("span", {
40
+ className: styles.color_F40500,
41
+ children: "\u6CA1\u6709\u5E97\u94FA\u6743\u9650"
42
+ })]
43
+ }), /*#__PURE__*/_jsx("div", {
44
+ className: styles.title,
45
+ children: "\u672A\u6388\u6743\u6D41\u7A0B"
46
+ }), /*#__PURE__*/_jsxs("div", {
47
+ className: styles.mb_8,
48
+ children: ["1.\u767B\u5F55\u4F01\u4E1A\u5DE5\u5355", /*#__PURE__*/_jsx("br", {}), "2.\u8FDB\u5165\u7CFB\u7EDF\u8BBE\u7F6E-\u5E97\u94FA\u7BA1\u7406-\u3010\u70B9\u51FB\u6DFB\u52A0\u5E97\u94FA\u3011"]
49
+ }), /*#__PURE__*/_jsx("div", {
50
+ className: styles.title,
51
+ children: "\u6388\u6743\u5931\u6548\u6D41\u7A0B"
52
+ }), /*#__PURE__*/_jsxs("div", {
53
+ children: ["1.\u767B\u5F55\u4F01\u4E1A\u5DE5\u5355", /*#__PURE__*/_jsx("br", {}), "2.\u8FDB\u5165\u7CFB\u7EDF\u8BBE\u7F6E-\u5E97\u94FA\u7BA1\u7406-\u627E\u5230\u5BF9\u5E94\u7684\u5E97\u94FA-\u70B9\u51FB\u3010\u91CD\u65B0\u6388\u6743\u3011"]
54
+ }), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("div", {
55
+ className: styles.title,
56
+ children: "\u6CA1\u6709\u5E97\u94FA\u6743\u9650\u6D41\u7A0B"
57
+ }), /*#__PURE__*/_jsxs("div", {
58
+ children: ["1.\u767B\u5F55\u4F01\u4E1A\u5DE5\u5355", /*#__PURE__*/_jsx("br", {}), "2.\u8FDB\u5165\u7CFB\u7EDF\u8BBE\u7F6E-\u5458\u5DE5\u6743\u9650-\u3010\u7F16\u8F91\u3011-\u4FEE\u6539\u5E97\u94FA\u6743\u9650"]
59
+ }), /*#__PURE__*/_jsx("div", {
60
+ className: styles.reminder_footer,
61
+ children: /*#__PURE__*/_jsx(Button, {
62
+ type: "primary",
63
+ onClick: copyHandle,
64
+ children: "\u7ACB\u5373\u6388\u6743"
65
+ })
66
+ })]
67
+ })
68
+ });
69
+ }
70
+
71
+ export default Reminder;
@@ -0,0 +1,57 @@
1
+ .reminder {
2
+ position: fixed;
3
+ top: 0;
4
+ right: 0;
5
+ bottom: 0;
6
+ left: 0;
7
+ z-index: 10;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ background-color: rgba(0, 0, 0, 0.3);
12
+ }
13
+
14
+ .reminder_box {
15
+ width: 320px;
16
+ padding: 24px;
17
+ color: rgba(86, 89, 96, 0.65);
18
+ font-size: 14px;
19
+ background-color: #fff;
20
+ border-radius: 4px;
21
+ }
22
+
23
+ .tip_error {
24
+ margin-bottom: 16px;
25
+ color: rgba(0, 0, 0, 0.85);
26
+ font-size: 16px;
27
+ }
28
+
29
+ .color_565960 {
30
+ color: #565960;
31
+ }
32
+
33
+ .color_F40500 {
34
+ color: #f40500;
35
+ }
36
+
37
+ .title {
38
+ margin-bottom: 8px;
39
+ color: rgba(0, 0, 0, 0.65);
40
+ }
41
+
42
+ .mb_8 {
43
+ margin-bottom: 8px;
44
+ }
45
+
46
+ .mb_16 {
47
+ margin-bottom: 16px;
48
+ }
49
+
50
+ .reminder_footer {
51
+ margin-top: 24px;
52
+ text-align: center;
53
+ }
54
+
55
+ .ant-modal-confirm .ant-modal-confirm-btns {
56
+ text-align: center !important;
57
+ }
@@ -87,7 +87,7 @@ var StatusSelectModal = function StatusSelectModal() {
87
87
  return message.warn('当前工单不可以设置为暂停中状态');
88
88
  }
89
89
 
90
- if (val === WAITING && !(existStatusWorkOrder(record === null || record === void 0 ? void 0 : record.jsonMap, HANDLING) || enterprisePaymentStatus && checkPaymentStatus(['未打款'])([record], enterprisePaymentStatus))) {
90
+ if (val === WAITING && !(existStatusWorkOrder(record === null || record === void 0 ? void 0 : record.jsonMap, HANDLING) || existStatusWorkOrder(record === null || record === void 0 ? void 0 : record.jsonMap, STOPPING) || enterprisePaymentStatus && checkPaymentStatus(['未打款'])([record], enterprisePaymentStatus))) {
91
91
  return message.warn('当前工单不可以设置为待处理状态');
92
92
  }
93
93
 
@@ -1,10 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import BasicComponent from '../../BasicComponent';
3
- import EBuyerName from '../EBuyerName';
4
- import EBuyerOpenUid from '../EBuyerOpenUid';
5
3
  declare class EBuyerNick extends BasicComponent {
6
- buyerNick: EBuyerName;
7
- buyerOpenUid: EBuyerOpenUid;
8
4
  constructor(options: any);
9
5
  customRules: (config: any) => {
10
6
  validator: (_: any, value: {
@@ -12,8 +8,7 @@ declare class EBuyerNick extends BasicComponent {
12
8
  buyerOpenUid: any;
13
9
  }) => Promise<void>;
14
10
  }[];
15
- render: () => null;
11
+ render: (value: any, record: any) => JSX.Element;
16
12
  editRender: (value: any) => JSX.Element;
17
- getColumns: () => any;
18
13
  }
19
14
  export default EBuyerNick;
@@ -31,13 +31,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
31
31
  * @Author: litian
32
32
  * @Date: 2022-06-30 17:30:05
33
33
  * @LastEditors: litian
34
- * @LastEditTime: 2022-09-20 18:02:16
34
+ * @LastEditTime: 2022-11-30 14:34:16
35
35
  */
36
36
  import React from 'react';
37
37
  import { BuyerNick } from '@raycloud-apaas-fe-setup/apaas-react-basics-widgets';
38
38
  import BasicComponent from "../../BasicComponent";
39
- import EBuyerName from "../EBuyerName";
40
- import EBuyerOpenUid from "../EBuyerOpenUid";
41
39
  import { getFormItem } from "../../common/formItemWrap";
42
40
  import { jsx as _jsx } from "react/jsx-runtime";
43
41
 
@@ -55,10 +53,6 @@ var EBuyerNick = /*#__PURE__*/function (_BasicComponent) {
55
53
 
56
54
  _this = _super.call(this, options);
57
55
 
58
- _defineProperty(_assertThisInitialized(_this), "buyerNick", void 0);
59
-
60
- _defineProperty(_assertThisInitialized(_this), "buyerOpenUid", void 0);
61
-
62
56
  _defineProperty(_assertThisInitialized(_this), "customRules", function (config) {
63
57
  return [{
64
58
  validator: function validator(_, value) {
@@ -66,53 +60,30 @@ var EBuyerNick = /*#__PURE__*/function (_BasicComponent) {
66
60
  return Promise.reject(new Error('请输入买家旺旺'));
67
61
  }
68
62
 
69
- var _this$componentConfig = _this.componentConfig,
70
- shopList = _this$componentConfig.shopList,
71
- shopId = _this$componentConfig.shopId;
72
- var isTaoBao = shopList.some(function (item) {
73
- return item.shopId === shopId && item.shopSourceStr === 'TAOBAO';
74
- });
75
-
76
- if (isTaoBao && !(value !== null && value !== void 0 && value.buyerOpenUid)) {
77
- return Promise.reject(new Error('请输入买家旺旺id'));
78
- }
79
-
80
63
  return Promise.resolve();
81
64
  }
82
65
  }];
83
66
  });
84
67
 
85
- _defineProperty(_assertThisInitialized(_this), "render", function () {
86
- return null;
68
+ _defineProperty(_assertThisInitialized(_this), "render", function (value, record) {
69
+ return /*#__PURE__*/_jsx("span", {
70
+ children: value === null || value === void 0 ? void 0 : value.buyerNick
71
+ });
87
72
  });
88
73
 
89
74
  _defineProperty(_assertThisInitialized(_this), "editRender", function (value) {
90
- var _this$componentConfig2, _this$componentConfig3;
75
+ var _this$componentConfig, _this$componentConfig2;
91
76
 
92
77
  return getFormItem(_objectSpread({
93
78
  title: _this.name,
94
79
  name: _this.id,
95
- rules: (_this$componentConfig2 = _this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? _this.customRules(_this.componentConfig) : [],
96
- required: (_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.required,
80
+ rules: (_this$componentConfig = _this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? _this.customRules(_this.componentConfig) : [],
81
+ required: (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required,
97
82
  component: /*#__PURE__*/_jsx(BuyerNick, _objectSpread({}, _this.componentConfig))
98
83
  }, value));
99
84
  });
100
85
 
101
- _defineProperty(_assertThisInitialized(_this), "getColumns", function () {
102
- return {
103
- title: _this.name,
104
- children: [_this.buyerNick.getColumns(), _this.buyerOpenUid.getColumns()],
105
- canHidden: _this.canHidden,
106
- dataIndex: _this.id
107
- };
108
- });
109
-
110
- _this.buyerNick = new EBuyerName(_objectSpread(_objectSpread({}, options), {}, {
111
- name: '买家旺旺'
112
- }));
113
- _this.buyerOpenUid = new EBuyerOpenUid(_objectSpread(_objectSpread({}, options), {}, {
114
- name: '买家旺旺id'
115
- }));
86
+ _this.canFilter = true;
116
87
  _this.canHidden = true;
117
88
  _this.effects = options.effects;
118
89
  _this.componentConfig = _objectSpread(_objectSpread({}, options.componentConfig), {}, {
@@ -4,7 +4,6 @@ import AlipayNick from './AlipayNick';
4
4
  import PaymentStatus from './PaymentStatus';
5
5
  import PaymentAmount from './PaymentAmount';
6
6
  import BuyerNick from './BuyerNick';
7
- import BuyerOpenUid from './BuyerOpenUid';
8
7
  import PaymentTid from './PaymentTid';
9
8
  import AlipayNo from './AlipayNo';
10
9
  import PayTime from './PayTime';
@@ -13,7 +12,6 @@ declare class Payment extends BasicComponent {
13
12
  paymentStatus: PaymentStatus;
14
13
  paymentAmount: PaymentAmount;
15
14
  buyerNick: BuyerNick;
16
- buyerOpenUid: BuyerOpenUid;
17
15
  paymentTid: PaymentTid;
18
16
  alipayNo: AlipayNo;
19
17
  payTime: PayTime;
@@ -40,7 +40,6 @@ import AlipayNick from "./AlipayNick";
40
40
  import PaymentStatus from "./PaymentStatus";
41
41
  import PaymentAmount from "./PaymentAmount";
42
42
  import BuyerNick from "./BuyerNick";
43
- import BuyerOpenUid from "./BuyerOpenUid";
44
43
  import PaymentTid from "./PaymentTid";
45
44
  import AlipayNo from "./AlipayNo";
46
45
  import PayTime from "./PayTime";
@@ -69,8 +68,6 @@ var Payment = /*#__PURE__*/function (_BasicComponent) {
69
68
 
70
69
  _defineProperty(_assertThisInitialized(_this), "buyerNick", void 0);
71
70
 
72
- _defineProperty(_assertThisInitialized(_this), "buyerOpenUid", void 0);
73
-
74
71
  _defineProperty(_assertThisInitialized(_this), "paymentTid", void 0);
75
72
 
76
73
  _defineProperty(_assertThisInitialized(_this), "alipayNo", void 0);
@@ -88,21 +85,6 @@ var Payment = /*#__PURE__*/function (_BasicComponent) {
88
85
  return Promise.reject(new Error('打款金额最多2位小数'));
89
86
  }
90
87
 
91
- if (config.required && !(value !== null && value !== void 0 && value.enterprisePaymentBuyerNick)) {
92
- return Promise.reject(new Error('请输入买家昵称'));
93
- }
94
-
95
- var _this$componentConfig = _this.componentConfig,
96
- shopList = _this$componentConfig.shopList,
97
- shopId = _this$componentConfig.shopId;
98
- var isTaoBao = shopList.some(function (item) {
99
- return item.shopId === shopId && item.shopSourceStr === 'TAOBAO';
100
- });
101
-
102
- if (config.required && isTaoBao && !(value !== null && value !== void 0 && value.enterprisePaymentBuyerOpenUid)) {
103
- return Promise.reject(new Error('请输入买家昵称id'));
104
- }
105
-
106
88
  if (config.required && !(value !== null && value !== void 0 && value.enterprisePaymentTid)) {
107
89
  return Promise.reject(new Error('请输入订单编号'));
108
90
  } else if (value.enterprisePaymentTid && !/^[0-9a-zA-Z_-]{1,}$/.test(value.enterprisePaymentTid)) {
@@ -117,6 +99,13 @@ var Payment = /*#__PURE__*/function (_BasicComponent) {
117
99
  return Promise.reject(new Error('请输入支付宝账号'));
118
100
  } else if (value.enterprisePaymentAlipayNo && !/^(?:1[3-9]\d{9}|[a-zA-Z\d._-]*\@[a-zA-Z\d.-]{1,10}\.[a-zA-Z\d]{1,20})$/.test(value.enterprisePaymentAlipayNo)) {
119
101
  return Promise.reject(new Error('请输入正确的支付宝账号格式'));
102
+ } //支付宝信息不能只填一个,否则不能打款
103
+
104
+
105
+ if (value !== null && value !== void 0 && value.enterprisePaymentAlipayNick || value !== null && value !== void 0 && value.enterprisePaymentAlipayNo) {
106
+ if (!(value !== null && value !== void 0 && value.enterprisePaymentAlipayNick && value !== null && value !== void 0 && value.enterprisePaymentAlipayNo)) {
107
+ return Promise.reject(new Error('支付宝姓名/账号都要填写'));
108
+ }
120
109
  }
121
110
 
122
111
  return Promise.resolve();
@@ -129,13 +118,13 @@ var Payment = /*#__PURE__*/function (_BasicComponent) {
129
118
  });
130
119
 
131
120
  _defineProperty(_assertThisInitialized(_this), "editRender", function (value) {
132
- var _this$componentConfig2;
121
+ var _this$componentConfig;
133
122
 
134
123
  return getFormItem(_objectSpread({
135
124
  title: _this.name,
136
125
  name: _this.id,
137
126
  rules: _this.customRules(_this.componentConfig),
138
- required: (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required,
127
+ required: (_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.required,
139
128
  component: /*#__PURE__*/_jsx(ApaasPayment, _objectSpread(_objectSpread({}, _this.componentConfig), {}, {
140
129
  onSearch: function onSearch(e) {
141
130
  return _this.changeHandle(e.target.value);
@@ -147,7 +136,8 @@ var Payment = /*#__PURE__*/function (_BasicComponent) {
147
136
  _defineProperty(_assertThisInitialized(_this), "getColumns", function () {
148
137
  return {
149
138
  title: _this.name,
150
- children: [_this.paymentTid.getColumns(), _this.paymentStatus.getColumns(), _this.paymentAmount.getColumns(), _this.buyerNick.getColumns(), _this.buyerOpenUid.getColumns(), _this.alipayNick.getColumns(), _this.alipayNo.getColumns(), _this.payTime.getColumns()],
139
+ children: [_this.paymentTid.getColumns(), _this.paymentStatus.getColumns(), _this.paymentAmount.getColumns(), _this.buyerNick.getColumns(), // this.buyerOpenUid.getColumns(),
140
+ _this.alipayNick.getColumns(), _this.alipayNo.getColumns(), _this.payTime.getColumns()],
151
141
  canHidden: _this.canHidden,
152
142
  dataIndex: _this.id
153
143
  };
@@ -162,9 +152,6 @@ var Payment = /*#__PURE__*/function (_BasicComponent) {
162
152
  _this.buyerNick = new BuyerNick(_objectSpread(_objectSpread({}, options), {}, {
163
153
  name: '买家昵称'
164
154
  }));
165
- _this.buyerOpenUid = new BuyerOpenUid(_objectSpread(_objectSpread({}, options), {}, {
166
- name: '买家昵称id'
167
- }));
168
155
  _this.paymentTid = new PaymentTid(_objectSpread(_objectSpread({}, options), {}, {
169
156
  name: '订单编号'
170
157
  }));
@@ -14,6 +14,7 @@ interface WorkOrderProps {
14
14
  buyerNick?: string;
15
15
  buyerId?: string;
16
16
  orderNo?: string;
17
+ onEmpowerCallback?: () => void;
17
18
  }
18
19
  declare const ProviderWrap: (props: WorkOrderProps) => JSX.Element;
19
20
  export default ProviderWrap;
@@ -26,7 +26,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
26
  *
27
27
  * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
28
28
  */
29
- import React, { useState, useEffect, useRef, useLayoutEffect } from 'react';
29
+ import React, { useState, useEffect, useRef, useLayoutEffect, useMemo } from 'react';
30
30
  import { Tabs, Select, Pagination, Cascader, DatePicker, Space, Checkbox, Spin, message } from 'antd';
31
31
  import { useAppSelector, useAppDispatch } from "../model/hooks";
32
32
  import { fetchQueryGroupCustomTemplate, fetchQueryWorkOrder, fetchQueryCurrentCompanyUser, fetchQueryPaymentWorkOrderList } from "../model/workOrder";
@@ -46,6 +46,7 @@ import UnExamineModal from "./components/UnExamineModal";
46
46
  import DeletePaymentWorkOrderModal from "./components/DeletePaymentWorkOrderModal";
47
47
  import FlagPayModal from "./components/FlagPayModal";
48
48
  import RecordLog from "./components/RecordLog";
49
+ import Reminder from "./components/Reminder";
49
50
  import store from "../model/store";
50
51
  import { Provider } from 'react-redux';
51
52
  import refreshImg from "../common/imgs/refresh.png";
@@ -54,6 +55,7 @@ import moment from 'moment';
54
55
  import "./index.less";
55
56
  import { jsx as _jsx } from "react/jsx-runtime";
56
57
  import { jsxs as _jsxs } from "react/jsx-runtime";
58
+ import { Fragment as _Fragment } from "react/jsx-runtime";
57
59
  var Option = Select.Option;
58
60
  var RangePicker = DatePicker.RangePicker;
59
61
  export var PlatForm;
@@ -72,13 +74,17 @@ var WorkOrder = function WorkOrder(props) {
72
74
  shopId = props.shopId,
73
75
  buyerNick = props.buyerNick,
74
76
  buyerId = props.buyerId,
75
- orderNo = props.orderNo;
77
+ orderNo = props.orderNo,
78
+ onEmpowerCallback = props.onEmpowerCallback;
76
79
  var dispatch = useAppDispatch();
77
80
  var loading = useAppSelector(function (state) {
78
81
  var _state$workOrder;
79
82
 
80
83
  return (_state$workOrder = state.workOrder) === null || _state$workOrder === void 0 ? void 0 : _state$workOrder.loading;
81
84
  });
85
+ var shopList = useAppSelector(function (state) {
86
+ return state.workOrder.userInfo.shopList;
87
+ });
82
88
 
83
89
  var _useState = useState('custom'),
84
90
  _useState2 = _slicedToArray(_useState, 2),
@@ -131,37 +137,48 @@ var WorkOrder = function WorkOrder(props) {
131
137
  dispatch(fetchQueryCurrentCompanyUser());
132
138
  express.initData();
133
139
  formatAddrData.initData();
134
- };
140
+ }; //判断是否店铺是否授权
135
141
 
136
- return /*#__PURE__*/_jsx(Spin, {
137
- spinning: loading,
138
- children: /*#__PURE__*/_jsxs("div", {
139
- id: "customize-work-order-component",
140
- className: "order_container ".concat(platform === PlatForm.FXG ? '' : 'order_container_padding_bottom'),
141
- children: [/*#__PURE__*/_jsx("header", {
142
- className: "order_header",
143
- children: /*#__PURE__*/_jsxs("div", {
144
- className: "order_header_tabs",
145
- children: [/*#__PURE__*/_jsx("div", {
146
- className: "order_header_tabs_button ".concat(tabActive === 'custom' ? 'active' : ''),
147
- onClick: function onClick() {
148
- return setTabActive('custom');
149
- },
150
- children: "\u81EA\u5B9A\u4E49\u5DE5\u5355"
151
- }), /*#__PURE__*/_jsx("div", {
152
- className: "order_header_tabs_button border_left ".concat(tabActive === 'payment' ? 'active' : ''),
153
- onClick: function onClick() {
154
- return setTabActive('payment');
155
- },
156
- children: "\u6253\u6B3E\u5DE5\u5355"
157
- })]
158
- })
159
- }), /*#__PURE__*/_jsx(OrderList, {
160
- tabActive: tabActive
161
- }), /*#__PURE__*/_jsx(PayOrderList, {
162
- tabActive: tabActive
163
- })]
164
- })
142
+
143
+ var isEmpower = useMemo(function () {
144
+ console.log(shopList);
145
+ return (shopList || []).some(function (item) {
146
+ return item.shopId == shopId;
147
+ });
148
+ }, [shopList]);
149
+ return /*#__PURE__*/_jsxs(_Fragment, {
150
+ children: [/*#__PURE__*/_jsx(Spin, {
151
+ spinning: loading,
152
+ children: /*#__PURE__*/_jsxs("div", {
153
+ id: "customize-work-order-component",
154
+ className: "order_container ".concat(platform === PlatForm.FXG ? '' : 'order_container_padding_bottom'),
155
+ children: [/*#__PURE__*/_jsx("header", {
156
+ className: "order_header",
157
+ children: /*#__PURE__*/_jsxs("div", {
158
+ className: "order_header_tabs",
159
+ children: [/*#__PURE__*/_jsx("div", {
160
+ className: "order_header_tabs_button ".concat(tabActive === 'custom' ? 'active' : ''),
161
+ onClick: function onClick() {
162
+ return setTabActive('custom');
163
+ },
164
+ children: "\u81EA\u5B9A\u4E49\u5DE5\u5355"
165
+ }), /*#__PURE__*/_jsx("div", {
166
+ className: "order_header_tabs_button border_left ".concat(tabActive === 'payment' ? 'active' : ''),
167
+ onClick: function onClick() {
168
+ return setTabActive('payment');
169
+ },
170
+ children: "\u6253\u6B3E\u5DE5\u5355"
171
+ })]
172
+ })
173
+ }), /*#__PURE__*/_jsx(OrderList, {
174
+ tabActive: tabActive
175
+ }), /*#__PURE__*/_jsx(PayOrderList, {
176
+ tabActive: tabActive
177
+ })]
178
+ })
179
+ }), !isEmpower && Reminder({
180
+ callback: onEmpowerCallback
181
+ })]
165
182
  });
166
183
  };
167
184
 
@@ -294,31 +294,35 @@ export var workOrderSlice = createSlice({
294
294
  var list = action.payload;
295
295
  var groupList = [];
296
296
  var tempList = [];
297
- var groupAllList = list.map(function (item) {
298
- var groupId = item.groupId,
299
- groupName = item.groupName,
300
- rankNum = item.rankNum;
301
- groupList.push({
302
- groupId: groupId,
303
- groupName: groupName,
304
- rankNum: rankNum
305
- });
306
- var children = item.workOrderTemplates.filter(function (t) {
307
- t.label = t.name;
308
- t.value = t.uniqueKey;
309
-
310
- if (t.enabled) {
311
- tempList.push(t);
312
- }
313
-
314
- return !item.enabled;
315
- });
316
- return {
317
- label: item.groupName,
318
- value: item.groupId,
319
- children: children
320
- };
321
- });
297
+ var groupAllList = list.reduce(function (prv, item) {
298
+ if (item.workOrderTemplates.length) {
299
+ var groupId = item.groupId,
300
+ groupName = item.groupName,
301
+ rankNum = item.rankNum;
302
+ groupList.push({
303
+ groupId: groupId,
304
+ groupName: groupName,
305
+ rankNum: rankNum
306
+ });
307
+ var children = item.workOrderTemplates.filter(function (t) {
308
+ t.label = t.name;
309
+ t.value = t.uniqueKey;
310
+
311
+ if (t.enabled) {
312
+ tempList.push(t);
313
+ }
314
+
315
+ return !item.enabled;
316
+ });
317
+ prv.push({
318
+ label: item.groupName,
319
+ value: item.groupId,
320
+ children: children
321
+ });
322
+ }
323
+
324
+ return prv;
325
+ }, []);
322
326
  state.groupAllList = groupAllList;
323
327
  state.customSearch.tempSelect = (groupAllList === null || groupAllList === void 0 ? void 0 : groupAllList.length) && [(_groupAllList$ = groupAllList[0]) === null || _groupAllList$ === void 0 ? void 0 : _groupAllList$.value, (_groupAllList$2 = groupAllList[0]) === null || _groupAllList$2 === void 0 ? void 0 : (_groupAllList$2$child = _groupAllList$2.children[0]) === null || _groupAllList$2$child === void 0 ? void 0 : _groupAllList$2$child.value];
324
328
  }), builder.addCase(fetchQueryWorkOrder.pending, function (state) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kmkf-work-order-service-component",
3
- "version": "0.3.0-alpha.1",
3
+ "version": "0.3.0-alpha.3",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -39,8 +39,9 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@ant-design/icons": "^4.7.0",
42
- "@raycloud-apaas-fe-setup/apaas-react-basics-widgets": "^1.0.27-alpha.1",
42
+ "@raycloud-apaas-fe-setup/apaas-react-basics-widgets": "^1.0.28-alpha.3",
43
43
  "@reduxjs/toolkit": "^1.8.5",
44
+ "copy-to-clipboard": "^3.3.3",
44
45
  "js-md5": "^0.7.3",
45
46
  "react-redux": "^7.2.8",
46
47
  "store2": "^2.14.2",