kmkf-work-order-service-component 0.3.1 → 0.3.2-alpha.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/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/StatusSelectModal/index.js
CHANGED
@@ -21,7 +21,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
21
|
import React, { useState, useEffect } from 'react';
|
22
22
|
import { Modal, Select, Form, message } from 'antd';
|
23
23
|
import { useSelector, useDispatch } from 'react-redux';
|
24
|
-
import { debounce } from 'lodash';
|
24
|
+
import { debounce, isEmpty, isEqual } from 'lodash';
|
25
25
|
import { selectorModalVisible, selectorCurrentCustomizeRecord } from "../../../../../model/customizeWorkOrder/selector";
|
26
26
|
import { setStatusSelectModalVisible, setCurrentCustomizeRecord } from "../../../../../model/customizeWorkOrder";
|
27
27
|
import { fetchQueryWorkOrder } from "../../../../../model/workOrder";
|
@@ -56,6 +56,21 @@ var checkPaymentStatus = function checkPaymentStatus(passStatus) {
|
|
56
56
|
return passStatus.includes(status);
|
57
57
|
});
|
58
58
|
};
|
59
|
+
}; // 打款工单状态校验
|
60
|
+
|
61
|
+
|
62
|
+
var checkPaymentStatusByList = function checkPaymentStatusByList(list) {
|
63
|
+
return every(list, function (item) {
|
64
|
+
// 打款金额判断是否生成打款工单
|
65
|
+
var enterprisePaymentRefundFee = Object.keys(item).find(function (i) {
|
66
|
+
return i.endsWith('enterprisePaymentRefundFee');
|
67
|
+
});
|
68
|
+
var enterprisePaymentStatus = Object.keys(item).find(function (i) {
|
69
|
+
return i.endsWith('enterprisePaymentStatus');
|
70
|
+
});
|
71
|
+
var hasEnterprisePaymentRefundFee = isEmpty(get(item, enterprisePaymentRefundFee));
|
72
|
+
return hasEnterprisePaymentRefundFee && isEqual('未打款', get(item, enterprisePaymentStatus)) || [undefined, '标记已打款', '支付宝打款失败', '支付宝打款成功', '支付宝打款关闭'].includes(get(item, enterprisePaymentStatus));
|
73
|
+
});
|
59
74
|
};
|
60
75
|
|
61
76
|
var StatusSelectModal = function StatusSelectModal() {
|
@@ -91,7 +106,7 @@ var StatusSelectModal = function StatusSelectModal() {
|
|
91
106
|
return message.warn('当前工单不可以设置为待处理状态');
|
92
107
|
}
|
93
108
|
|
94
|
-
if (val === COMPLETED && enterprisePaymentStatus && !
|
109
|
+
if (val === COMPLETED && enterprisePaymentStatus && !checkPaymentStatusByList([record])) {
|
95
110
|
return message.warn('只有标记已打款/支付宝打款成功/支付宝打款失败/支付宝打款关闭这4种状态才可以设置为已完成');
|
96
111
|
}
|
97
112
|
|
@@ -111,15 +126,23 @@ var StatusSelectModal = function StatusSelectModal() {
|
|
111
126
|
while (1) {
|
112
127
|
switch (_context.prev = _context.next) {
|
113
128
|
case 0:
|
129
|
+
if (status) {
|
130
|
+
_context.next = 2;
|
131
|
+
break;
|
132
|
+
}
|
133
|
+
|
134
|
+
return _context.abrupt("return", message.error('请先选择工单状态'));
|
135
|
+
|
136
|
+
case 2:
|
114
137
|
params = {
|
115
138
|
updatedFlowStatus: status,
|
116
139
|
currentFlowStatus: record === null || record === void 0 ? void 0 : record.flowStatus,
|
117
140
|
workOrderUniqueKeys: [record === null || record === void 0 ? void 0 : record.id]
|
118
141
|
};
|
119
|
-
_context.next =
|
142
|
+
_context.next = 5;
|
120
143
|
return updateFlowStatus(params);
|
121
144
|
|
122
|
-
case
|
145
|
+
case 5:
|
123
146
|
_yield$updateFlowStat = _context.sent;
|
124
147
|
success = _yield$updateFlowStat.success;
|
125
148
|
errMsg = _yield$updateFlowStat.message;
|
@@ -132,7 +155,7 @@ var StatusSelectModal = function StatusSelectModal() {
|
|
132
155
|
message.error(errMsg);
|
133
156
|
}
|
134
157
|
|
135
|
-
case
|
158
|
+
case 9:
|
136
159
|
case "end":
|
137
160
|
return _context.stop();
|
138
161
|
}
|