kmkf-work-order-service-component 0.0.1-alpha.8 → 0.0.1-alpha.9

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.
@@ -28,13 +28,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
28
  * @Author: wangzhenggui jianjia.wzg@raycloud.com
29
29
  * @Date: 2022-09-16 11:19:43
30
30
  * @LastEditors: litian
31
- * @LastEditTime: 2022-09-28 15:07:36
31
+ * @LastEditTime: 2022-09-28 16:36:33
32
32
  * @FilePath: /kmkf-work-order-service-component/src/WorkOrder/index.tsx
33
33
  * @Description:
34
34
  *
35
35
  * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
36
36
  */
37
- import React, { useState, useEffect, useRef, useCallback } from 'react';
37
+ import React, { useState, useEffect, useRef } from 'react';
38
38
  import Wrapper from "./components/Wrapper";
39
39
  import { Tabs, Select, Pagination, Cascader, DatePicker, Space, Checkbox, message } from 'antd';
40
40
  import { useAppSelector, useAppDispatch } from "./model/hooks";
@@ -78,35 +78,29 @@ var WorkOrder = function WorkOrder(props) {
78
78
  tabActive = _useState2[0],
79
79
  setTabActive = _useState2[1];
80
80
 
81
- var propsValue = useCallback(function () {
82
- return {
83
- platform: platform,
84
- shopId: shopId,
85
- buyerNick: buyerNick,
86
- buyerId: buyerId,
87
- orderNo: orderNo
88
- };
89
- }, [platform, shopId, buyerNick, buyerId, orderNo]);
90
81
  useEffect(function () {
91
- // console.log('shopid---====', shopId, platformInfo.shopId);
92
- console.log('propsValue', propsValue()); //存储平台信息
82
+ if (shopId != platformInfo.shopId) {
83
+ initHandle();
84
+ } //存储平台信息
85
+
93
86
 
94
87
  dispatch({
95
88
  type: 'global/setState',
96
89
  payload: {
97
- platformInfo: _objectSpread({}, propsValue())
90
+ platformInfo: {
91
+ platform: platform,
92
+ shopId: shopId,
93
+ buyerNick: buyerNick,
94
+ buyerId: buyerId,
95
+ orderNo: orderNo
96
+ }
98
97
  }
99
98
  });
100
- initHandle();
101
- }, [propsValue]); // useEffect(() => {
102
- // initHandle();
103
- // }, []);
99
+ }, [platform, shopId, buyerNick, buyerId, orderNo]);
104
100
 
105
101
  var initHandle = function initHandle() {
106
102
  dispatch(fetchQueryGroupCustomTemplate());
107
103
  dispatch(fetchQueryCurrentCompanyUser());
108
- dispatch(fetchQueryPaymentWorkOrderList());
109
- dispatch(fetchQueryWorkOrder());
110
104
  express.initData();
111
105
  formatAddrData.initData();
112
106
  };
@@ -155,6 +149,8 @@ var OrderList = function OrderList(tabActive) {
155
149
  var platformInfo = useAppSelector(function (state) {
156
150
  return state.global.platformInfo;
157
151
  });
152
+ var buyerNick = platformInfo.buyerNick,
153
+ buyerId = platformInfo.buyerId;
158
154
  var isFirst = useRef(false);
159
155
  var openCustomizeWOrkOrderModal = openCustomizeWOrkOrder({
160
156
  shopList: shopList,
@@ -188,12 +184,12 @@ var OrderList = function OrderList(tabActive) {
188
184
  }, {
189
185
  name: '近30天',
190
186
  value: 29
191
- }]; // useEffect(() => {
192
- // if (customSearch.tempSelect.length > 1) {
193
- // onSearch();
194
- // }
195
- // }, [customSearch]);
196
- //搜索
187
+ }];
188
+ useEffect(function () {
189
+ if (customSearch.tempSelect.length > 1) {
190
+ onSearch();
191
+ }
192
+ }, [customSearch, buyerNick, buyerId]); //搜索
197
193
 
198
194
  var onSearch = function onSearch() {
199
195
  dispatch(fetchQueryWorkOrder());
@@ -459,6 +455,8 @@ var PayOrderList = function PayOrderList(tabActive) {
459
455
  var shopList = useAppSelector(function (state) {
460
456
  return state.workOrder.userInfo.shopList;
461
457
  });
458
+ var buyerNick = platformInfo.buyerNick,
459
+ buyerId = platformInfo.buyerId;
462
460
  var logRef = useRef();
463
461
  var PAY_STATUS = [{
464
462
  value: '',
@@ -491,9 +489,10 @@ var PayOrderList = function PayOrderList(tabActive) {
491
489
  value: 'ALI_PAY_CLOSE',
492
490
  label: '打款关闭',
493
491
  color: 'rgba(156,156,156)'
494
- }]; // useEffect(() => {
495
- // onSearch();
496
- // }, [paySearch]);
492
+ }];
493
+ useEffect(function () {
494
+ onSearch();
495
+ }, [paySearch, buyerNick, buyerId]);
497
496
 
498
497
  var onSearch = function onSearch() {
499
498
  dispatch(fetchQueryPaymentWorkOrderList());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kmkf-work-order-service-component",
3
- "version": "0.0.1-alpha.8",
3
+ "version": "0.0.1-alpha.9",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",