@pisell/private-materials 6.3.220 → 6.3.222
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +13 -13
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +13 -13
- package/es/components/kioskSkuDetail/index.js +7 -7
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +53 -26
- package/es/components/scanOrder/components/Content/index.js +14 -2
- package/es/components/scanOrder/components/ExitConfirmModal/index.js +84 -0
- package/es/components/scanOrder/components/ExitConfirmModal/index.less +182 -0
- package/es/components/scanOrder/locales.js +20 -0
- package/es/index.d.ts +9 -1
- package/es/index.js +6 -2
- package/es/plus/inventory/BindingModal.js +94 -0
- package/es/plus/inventory/InventoryItemManagement.d.ts +7 -0
- package/es/plus/inventory/InventoryItemManagement.js +204 -0
- package/es/plus/inventory/InventoryLocationManagement.d.ts +7 -0
- package/es/plus/inventory/InventoryLocationManagement.js +296 -0
- package/es/plus/inventory/InventoryUnitManagement.d.ts +7 -0
- package/es/plus/inventory/InventoryUnitManagement.js +144 -0
- package/es/plus/inventory/ItemDrawer.js +266 -0
- package/es/plus/inventory/RecordDialog.js +141 -0
- package/es/plus/inventory/StockList.js +132 -0
- package/es/plus/inventory/api.js +66 -0
- package/es/plus/inventory/components.js +172 -0
- package/es/plus/inventory/context.js +118 -0
- package/es/plus/inventory/forms.js +46 -0
- package/es/plus/inventory/hooks.js +235 -0
- package/es/plus/inventory/index.less +559 -0
- package/es/plus/inventory/locales.js +277 -0
- package/es/plus/inventory/types.d.ts +10 -0
- package/es/plus/inventory/utils.js +24 -0
- package/es/plus/panpacificTask/JobCard.js +22 -0
- package/es/plus/panpacificTask/JobDrawer.js +366 -0
- package/es/plus/panpacificTask/JobForm.js +312 -0
- package/es/plus/panpacificTask/JobStatus.js +29 -0
- package/es/plus/panpacificTask/PanpacificTask.d.ts +7 -0
- package/es/plus/panpacificTask/PanpacificTask.js +552 -0
- package/es/plus/panpacificTask/PhotoPreview.js +37 -0
- package/es/plus/panpacificTask/README.md +114 -0
- package/es/plus/panpacificTask/attachments.js +64 -0
- package/es/plus/panpacificTask/index.d.ts +2 -0
- package/es/plus/panpacificTask/index.less +539 -0
- package/es/plus/panpacificTask/locales.js +586 -0
- package/es/plus/panpacificTask/model.js +260 -0
- package/es/plus/panpacificTask/saveJob.js +68 -0
- package/es/plus/panpacificTask/serve.js +243 -0
- package/es/plus/panpacificTask/tenant.js +16 -0
- package/es/plus/panpacificTask/types.d.ts +19 -0
- package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
- package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
- package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
- package/es/plus/pisellSupersetDashboard/README.md +291 -0
- package/es/plus/pisellSupersetDashboard/index.d.ts +15 -0
- package/es/plus/pisellSupersetDashboard/index.js +187 -0
- package/es/plus/pisellSupersetDashboard/index.less +83 -0
- package/es/plus/pisellSupersetDashboard/locales.js +36 -0
- package/es/plus/pisellSupersetDashboard/serve.js +51 -0
- package/es/plus/pisellSupersetDashboard/types.d.ts +17 -0
- package/es/plus/skuOptionsSelection/store/createStore.js +2 -2
- package/es/private-materials/lowcode/authmodal/meta.d.ts +1 -0
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +1 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/lib/components/kioskSkuDetail/index.js +7 -7
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +53 -26
- package/lib/components/scanOrder/components/Content/index.js +14 -2
- package/lib/components/scanOrder/components/ExitConfirmModal/index.js +86 -0
- package/lib/components/scanOrder/components/ExitConfirmModal/index.less +182 -0
- package/lib/components/scanOrder/locales.js +20 -0
- package/lib/index.d.ts +9 -1
- package/lib/index.js +136 -126
- package/lib/plus/inventory/BindingModal.js +96 -0
- package/lib/plus/inventory/InventoryItemManagement.d.ts +7 -0
- package/lib/plus/inventory/InventoryItemManagement.js +206 -0
- package/lib/plus/inventory/InventoryLocationManagement.d.ts +7 -0
- package/lib/plus/inventory/InventoryLocationManagement.js +298 -0
- package/lib/plus/inventory/InventoryUnitManagement.d.ts +7 -0
- package/lib/plus/inventory/InventoryUnitManagement.js +146 -0
- package/lib/plus/inventory/ItemDrawer.js +268 -0
- package/lib/plus/inventory/RecordDialog.js +143 -0
- package/lib/plus/inventory/StockList.js +134 -0
- package/lib/plus/inventory/api.js +66 -0
- package/lib/plus/inventory/components.js +181 -0
- package/lib/plus/inventory/context.js +121 -0
- package/lib/plus/inventory/forms.js +50 -0
- package/lib/plus/inventory/hooks.js +240 -0
- package/lib/plus/inventory/index.less +559 -0
- package/lib/plus/inventory/locales.js +277 -0
- package/lib/plus/inventory/types.d.ts +10 -0
- package/lib/plus/inventory/utils.js +30 -0
- package/lib/plus/panpacificTask/JobCard.js +24 -0
- package/lib/plus/panpacificTask/JobDrawer.js +368 -0
- package/lib/plus/panpacificTask/JobForm.js +314 -0
- package/lib/plus/panpacificTask/JobStatus.js +33 -0
- package/lib/plus/panpacificTask/PanpacificTask.d.ts +7 -0
- package/lib/plus/panpacificTask/PanpacificTask.js +555 -0
- package/lib/plus/panpacificTask/PhotoPreview.js +39 -0
- package/lib/plus/panpacificTask/README.md +114 -0
- package/lib/plus/panpacificTask/attachments.js +66 -0
- package/lib/plus/panpacificTask/index.d.ts +2 -0
- package/lib/plus/panpacificTask/index.less +539 -0
- package/lib/plus/panpacificTask/locales.js +586 -0
- package/lib/plus/panpacificTask/model.js +289 -0
- package/lib/plus/panpacificTask/saveJob.js +68 -0
- package/lib/plus/panpacificTask/serve.js +260 -0
- package/lib/plus/panpacificTask/tenant.js +17 -0
- package/lib/plus/panpacificTask/types.d.ts +19 -0
- package/lib/plus/pisellSupersetDashboard/README.md +291 -0
- package/lib/plus/pisellSupersetDashboard/index.d.ts +15 -0
- package/lib/plus/pisellSupersetDashboard/index.js +189 -0
- package/lib/plus/pisellSupersetDashboard/index.less +83 -0
- package/lib/plus/pisellSupersetDashboard/locales.js +36 -0
- package/lib/plus/pisellSupersetDashboard/serve.js +52 -0
- package/lib/plus/pisellSupersetDashboard/types.d.ts +17 -0
- package/lowcode/inventory-item-management/meta.ts +20 -0
- package/lowcode/inventory-location-management/meta.ts +20 -0
- package/lowcode/inventory-unit-management/meta.ts +20 -0
- package/lowcode/panpacific-task/meta.ts +51 -0
- package/lowcode/pisell-superset-dashboard/meta.ts +75 -0
- package/package.json +4 -2
- package/es/plus/pisellReservation/index.js +0 -17
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
3
|
+
const require_asyncToGenerator = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
4
|
+
const require_useEngineContext = require("../../hooks/useEngineContext.js");
|
|
5
|
+
const require_model = require("./model.js");
|
|
6
|
+
const require_serve = require("./serve.js");
|
|
7
|
+
const require_tenant = require("./tenant.js");
|
|
8
|
+
const require_saveJob = require("./saveJob.js");
|
|
9
|
+
let react = require("react");
|
|
10
|
+
react = require_runtime.__toESM(react);
|
|
11
|
+
let antd = require("antd");
|
|
12
|
+
let _ant_design_icons = require("@ant-design/icons");
|
|
13
|
+
//#region src/plus/panpacificTask/JobForm.tsx
|
|
14
|
+
const popupContainer = (trigger) => trigger.closest(".pp-task-overlay .ant-modal-body, .pp-task-overlay .ant-drawer-body, .pp-task-overlay .pisell-lowcode-modal-body, .pp-task-overlay .pisell-lowcode-drawer-body") || trigger.parentElement;
|
|
15
|
+
const selectProps = {
|
|
16
|
+
size: "small",
|
|
17
|
+
allowClear: true,
|
|
18
|
+
showSearch: true,
|
|
19
|
+
optionFilterProp: "label",
|
|
20
|
+
getPopupContainer: popupContainer
|
|
21
|
+
};
|
|
22
|
+
function optionsFor(rows, current, label) {
|
|
23
|
+
const options = rows.filter((row) => row.is_active !== false && row.is_active !== 0 || String(row.id) === String(current)).map((row) => ({
|
|
24
|
+
value: current != null && String(row.id) === String(current) ? current : row.id,
|
|
25
|
+
label: String(row.name || row.title || row.description || row.id)
|
|
26
|
+
}));
|
|
27
|
+
if (current != null && !options.some((option) => String(option.value) === String(current))) options.push({
|
|
28
|
+
value: current,
|
|
29
|
+
label: label || String(current)
|
|
30
|
+
});
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
33
|
+
const JobForm = (0, react.forwardRef)(({ initial, jobs, base, request, getText, onSaved, onCancel, confirmDiscard }, ref) => {
|
|
34
|
+
const context = require_useEngineContext.default();
|
|
35
|
+
const [form] = antd.Form.useForm();
|
|
36
|
+
const session = (0, react.useRef)(require_model.sessionFor(initial));
|
|
37
|
+
const manualCode = (0, react.useRef)(Boolean(initial.job_number));
|
|
38
|
+
const dirty = (0, react.useRef)(false);
|
|
39
|
+
const saving = (0, react.useRef)(false);
|
|
40
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
41
|
+
const [error, setError] = (0, react.useState)("");
|
|
42
|
+
const [uncertain, setUncertain] = (0, react.useState)(false);
|
|
43
|
+
const mounted = (0, react.useRef)(true);
|
|
44
|
+
(0, react.useEffect)(() => {
|
|
45
|
+
mounted.current = true;
|
|
46
|
+
return () => {
|
|
47
|
+
mounted.current = false;
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
const close = function() {
|
|
51
|
+
var _ref = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
52
|
+
if (saving.current) return;
|
|
53
|
+
if (dirty.current && !(yield confirmDiscard())) return;
|
|
54
|
+
onCancel();
|
|
55
|
+
});
|
|
56
|
+
return function close() {
|
|
57
|
+
return _ref.apply(this, arguments);
|
|
58
|
+
};
|
|
59
|
+
}();
|
|
60
|
+
(0, react.useImperativeHandle)(ref, () => ({ close }));
|
|
61
|
+
const syncCode = () => {
|
|
62
|
+
if (!manualCode.current && !saving.current) form.setFieldValue("job_number", require_model.nextJobCode(form.getFieldValue("supplier_state"), form.getFieldValue("supplier_name"), jobs));
|
|
63
|
+
};
|
|
64
|
+
(0, react.useEffect)(syncCode, [jobs]);
|
|
65
|
+
const change = (changed) => {
|
|
66
|
+
var _changed$job_number;
|
|
67
|
+
dirty.current = true;
|
|
68
|
+
if ("job_number" in changed) manualCode.current = !!((_changed$job_number = changed.job_number) === null || _changed$job_number === void 0 ? void 0 : _changed$job_number.trim());
|
|
69
|
+
if ("supplier_id" in changed) {
|
|
70
|
+
const supplier = base.suppliers.find((row) => String(row.id) === String(changed.supplier_id));
|
|
71
|
+
if (supplier) form.setFieldsValue(require_model.supplierSnapshot(supplier));
|
|
72
|
+
}
|
|
73
|
+
if ("payment_term_id" in changed) {
|
|
74
|
+
const term = base.paymentTerms.find((row) => String(row.id) === String(changed.payment_term_id));
|
|
75
|
+
form.setFieldValue("payment_term_days", (term === null || term === void 0 ? void 0 : term.days) == null ? null : Number(term.days));
|
|
76
|
+
}
|
|
77
|
+
if ([
|
|
78
|
+
"supplier_id",
|
|
79
|
+
"supplier_name",
|
|
80
|
+
"supplier_state",
|
|
81
|
+
"job_number"
|
|
82
|
+
].some((key) => key in changed)) syncCode();
|
|
83
|
+
};
|
|
84
|
+
const save = function() {
|
|
85
|
+
var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (values) {
|
|
86
|
+
if (saving.current || uncertain) return;
|
|
87
|
+
saving.current = true;
|
|
88
|
+
setBusy(true);
|
|
89
|
+
setError("");
|
|
90
|
+
try {
|
|
91
|
+
var _context$appHelper;
|
|
92
|
+
const tenantId = require_tenant.getCurrentTenantId(context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.store);
|
|
93
|
+
const id = yield require_saveJob.saveJob(request, values, session.current, tenantId);
|
|
94
|
+
dirty.current = false;
|
|
95
|
+
if (mounted.current) onSaved(id, values);
|
|
96
|
+
} catch (cause) {
|
|
97
|
+
manualCode.current = session.current.id != null || manualCode.current;
|
|
98
|
+
if (mounted.current) {
|
|
99
|
+
setUncertain(!!session.current.uncertain);
|
|
100
|
+
setError([
|
|
101
|
+
session.current.id != null ? getText("pisell2.panpacific.task.partialSave") : "",
|
|
102
|
+
getText(require_serve.errorText(cause)),
|
|
103
|
+
session.current.uncertain ? getText("pisell2.panpacific.task.uncertain") : ""
|
|
104
|
+
].filter(Boolean).join(" "));
|
|
105
|
+
}
|
|
106
|
+
} finally {
|
|
107
|
+
saving.current = false;
|
|
108
|
+
if (mounted.current) setBusy(false);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return function save(_x) {
|
|
112
|
+
return _ref2.apply(this, arguments);
|
|
113
|
+
};
|
|
114
|
+
}();
|
|
115
|
+
const text = (name, label, required = false, max = 255) => /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
116
|
+
key: name,
|
|
117
|
+
name,
|
|
118
|
+
label: getText(`pisell2.panpacific.task.${label}`),
|
|
119
|
+
rules: [{
|
|
120
|
+
required,
|
|
121
|
+
message: getText("pisell2.panpacific.task.required")
|
|
122
|
+
}]
|
|
123
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Input, { maxLength: max }));
|
|
124
|
+
const date = (name, label, required = false) => /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
125
|
+
key: name,
|
|
126
|
+
name,
|
|
127
|
+
label: getText(`pisell2.panpacific.task.${label}`),
|
|
128
|
+
rules: [{
|
|
129
|
+
required,
|
|
130
|
+
message: getText("pisell2.panpacific.task.required")
|
|
131
|
+
}]
|
|
132
|
+
}, /* @__PURE__ */ react.default.createElement(antd.DatePicker, {
|
|
133
|
+
format: "YYYY-MM-DD",
|
|
134
|
+
style: { width: "100%" },
|
|
135
|
+
getPopupContainer: popupContainer
|
|
136
|
+
}));
|
|
137
|
+
const select = (name, label, rows) => /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
138
|
+
key: name,
|
|
139
|
+
noStyle: true,
|
|
140
|
+
shouldUpdate: true
|
|
141
|
+
}, () => /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
142
|
+
name,
|
|
143
|
+
label: getText(`pisell2.panpacific.task.${label}`)
|
|
144
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Select, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, selectProps), {}, { options: optionsFor(rows, form.getFieldValue(name), name === "supplier_id" ? form.getFieldValue("supplier_name") : void 0) }))));
|
|
145
|
+
const enumField = (name, label, values) => /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
146
|
+
key: name,
|
|
147
|
+
name,
|
|
148
|
+
label: getText(`pisell2.panpacific.task.${label}`)
|
|
149
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Select, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, selectProps), {}, { options: values.map((value) => ({
|
|
150
|
+
value,
|
|
151
|
+
label: name === "supplier_state" ? value : getText(`pisell2.panpacific.task.${value}`)
|
|
152
|
+
})) })));
|
|
153
|
+
const section = (title, children) => /* @__PURE__ */ react.default.createElement("section", {
|
|
154
|
+
key: title,
|
|
155
|
+
className: "pp-task-section"
|
|
156
|
+
}, /* @__PURE__ */ react.default.createElement("h3", null, getText(`pisell2.panpacific.task.${title}`)), children);
|
|
157
|
+
const lines = (kind) => /* @__PURE__ */ react.default.createElement(antd.Form.List, {
|
|
158
|
+
key: kind,
|
|
159
|
+
name: kind
|
|
160
|
+
}, (fields, { add, remove }) => /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-lines-scroll" }, /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-lines" }, /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-line-head" }, [
|
|
161
|
+
"item",
|
|
162
|
+
"quantity",
|
|
163
|
+
"unit",
|
|
164
|
+
"price",
|
|
165
|
+
"status",
|
|
166
|
+
""
|
|
167
|
+
].map((key, i) => /* @__PURE__ */ react.default.createElement("span", { key: i }, key && getText(`pisell2.panpacific.task.${key}`)))), fields.map((field) => /* @__PURE__ */ react.default.createElement("div", {
|
|
168
|
+
className: "pp-task-line-wrap",
|
|
169
|
+
key: field.key
|
|
170
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
171
|
+
name: [field.name, "_key"],
|
|
172
|
+
hidden: true
|
|
173
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Input, null)), /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-line" }, /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
174
|
+
noStyle: true,
|
|
175
|
+
shouldUpdate: true
|
|
176
|
+
}, () => {
|
|
177
|
+
const relation = kind === "materials" ? "material_item_id" : "product_id";
|
|
178
|
+
const snapshot = kind === "materials" ? "material_name" : "product_name";
|
|
179
|
+
const current = form.getFieldValue([
|
|
180
|
+
kind,
|
|
181
|
+
field.name,
|
|
182
|
+
relation
|
|
183
|
+
]);
|
|
184
|
+
return /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
185
|
+
name: [field.name, relation],
|
|
186
|
+
rules: [{
|
|
187
|
+
required: kind === "materials",
|
|
188
|
+
message: getText("pisell2.panpacific.task.required")
|
|
189
|
+
}]
|
|
190
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Select, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, selectProps), {}, {
|
|
191
|
+
placeholder: getText("pisell2.panpacific.task.item"),
|
|
192
|
+
options: optionsFor(base[kind], current, form.getFieldValue([
|
|
193
|
+
kind,
|
|
194
|
+
field.name,
|
|
195
|
+
snapshot
|
|
196
|
+
])),
|
|
197
|
+
onChange: (id) => {
|
|
198
|
+
const item = base[kind].find((row) => String(row.id) === String(id));
|
|
199
|
+
form.setFieldValue([
|
|
200
|
+
kind,
|
|
201
|
+
field.name,
|
|
202
|
+
snapshot
|
|
203
|
+
], (item === null || item === void 0 ? void 0 : item.name) || "");
|
|
204
|
+
}
|
|
205
|
+
})));
|
|
206
|
+
}), /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
207
|
+
name: [field.name, "quantity"],
|
|
208
|
+
rules: [{
|
|
209
|
+
required: kind === "materials",
|
|
210
|
+
message: getText("pisell2.panpacific.task.required")
|
|
211
|
+
}]
|
|
212
|
+
}, /* @__PURE__ */ react.default.createElement(antd.InputNumber, {
|
|
213
|
+
stringMode: true,
|
|
214
|
+
min: "0",
|
|
215
|
+
max: "999999999999.99",
|
|
216
|
+
precision: 2,
|
|
217
|
+
placeholder: getText("pisell2.panpacific.task.quantity")
|
|
218
|
+
})), /* @__PURE__ */ react.default.createElement(antd.Form.Item, { name: [field.name, "price_unit"] }, /* @__PURE__ */ react.default.createElement(antd.Select, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, selectProps), {}, {
|
|
219
|
+
allowClear: false,
|
|
220
|
+
showSearch: false,
|
|
221
|
+
options: ["piece", "kg"].map((value) => ({
|
|
222
|
+
value,
|
|
223
|
+
label: getText(`pisell2.panpacific.task.${value}`)
|
|
224
|
+
}))
|
|
225
|
+
}))), /* @__PURE__ */ react.default.createElement(antd.Form.Item, { name: [field.name, "unit_price"] }, /* @__PURE__ */ react.default.createElement(antd.InputNumber, {
|
|
226
|
+
stringMode: true,
|
|
227
|
+
min: "0",
|
|
228
|
+
max: "999999999999.99",
|
|
229
|
+
precision: 2,
|
|
230
|
+
placeholder: getText("pisell2.panpacific.task.price")
|
|
231
|
+
})), /* @__PURE__ */ react.default.createElement(antd.Form.Item, { name: [field.name, "item_status"] }, /* @__PURE__ */ react.default.createElement(antd.Select, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, selectProps), {}, {
|
|
232
|
+
allowClear: false,
|
|
233
|
+
showSearch: false,
|
|
234
|
+
options: ["scheduled", "confirmed"].map((value) => ({
|
|
235
|
+
value,
|
|
236
|
+
label: getText(`pisell2.panpacific.task.${value}`)
|
|
237
|
+
}))
|
|
238
|
+
}))), /* @__PURE__ */ react.default.createElement(antd.Button, {
|
|
239
|
+
"aria-label": getText("pisell2.panpacific.task.removeLine"),
|
|
240
|
+
icon: /* @__PURE__ */ react.default.createElement(_ant_design_icons.CloseOutlined, null),
|
|
241
|
+
onClick: () => {
|
|
242
|
+
dirty.current = true;
|
|
243
|
+
remove(field.name);
|
|
244
|
+
}
|
|
245
|
+
})))))), /* @__PURE__ */ react.default.createElement(antd.Button, {
|
|
246
|
+
block: true,
|
|
247
|
+
onClick: () => {
|
|
248
|
+
dirty.current = true;
|
|
249
|
+
add(require_model.newLine());
|
|
250
|
+
}
|
|
251
|
+
}, "+ ", getText("pisell2.panpacific.task.addItem"))));
|
|
252
|
+
return /* @__PURE__ */ react.default.createElement(antd.Form, {
|
|
253
|
+
className: "pp-task-form",
|
|
254
|
+
form,
|
|
255
|
+
layout: "vertical",
|
|
256
|
+
size: "middle",
|
|
257
|
+
initialValues: initial,
|
|
258
|
+
disabled: busy || uncertain,
|
|
259
|
+
onValuesChange: change,
|
|
260
|
+
onFinish: save,
|
|
261
|
+
scrollToFirstError: true
|
|
262
|
+
}, section("basicInfo", /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-form-grid" }, select("task_category_id", "category", base.categories), date("job_created_date", "created", true), date("due_date", "due", true), date("pickup_date", "pickupDate"), enumField("logistic_type", "logisticType", [
|
|
263
|
+
"dropoff",
|
|
264
|
+
"pickup",
|
|
265
|
+
"walkin"
|
|
266
|
+
])), /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
267
|
+
name: "logistics_note",
|
|
268
|
+
label: getText("pisell2.panpacific.task.logisticsNote")
|
|
269
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Input.TextArea, { autoSize: {
|
|
270
|
+
minRows: 2,
|
|
271
|
+
maxRows: 5
|
|
272
|
+
} })))), section("supplierInfo", /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-form-grid" }, select("supplier_id", "supplier", base.suppliers), text("supplier_name", "supplierName"), enumField("supplier_state", "state", [
|
|
273
|
+
"QLD",
|
|
274
|
+
"NSW",
|
|
275
|
+
"VIC",
|
|
276
|
+
"SA",
|
|
277
|
+
"WA",
|
|
278
|
+
"TAS",
|
|
279
|
+
"NT",
|
|
280
|
+
"ACT"
|
|
281
|
+
]), text("supplier_sub_name", "branchPostcode"), text("company_contact", "contact"), text("supplier_phone", "phone", false, 64), text("supplier_email", "email"), text("lead_source", "lead"), /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-code" }, text("job_number", "code", true, 100), /* @__PURE__ */ react.default.createElement(antd.Button, { onClick: () => {
|
|
282
|
+
manualCode.current = false;
|
|
283
|
+
dirty.current = true;
|
|
284
|
+
syncCode();
|
|
285
|
+
} }, getText("pisell2.panpacific.task.reset"))))), section("materials", lines("materials")), section("products", lines("products")), section("paymentTerm", /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-form-grid" }, select("payment_term_id", "paymentTerm", base.paymentTerms), /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
286
|
+
name: "payment_term_days",
|
|
287
|
+
label: getText("pisell2.panpacific.task.days")
|
|
288
|
+
}, /* @__PURE__ */ react.default.createElement(antd.InputNumber, {
|
|
289
|
+
min: 0,
|
|
290
|
+
max: 4294967295,
|
|
291
|
+
precision: 0
|
|
292
|
+
}))), /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
293
|
+
name: "terms_note",
|
|
294
|
+
label: getText("pisell2.panpacific.task.termsNote")
|
|
295
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Input.TextArea, { autoSize: {
|
|
296
|
+
minRows: 2,
|
|
297
|
+
maxRows: 5
|
|
298
|
+
} })))), /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-form-footer" }, error && /* @__PURE__ */ react.default.createElement(antd.Alert, {
|
|
299
|
+
type: "error",
|
|
300
|
+
message: error,
|
|
301
|
+
showIcon: true
|
|
302
|
+
}), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement(antd.Button, {
|
|
303
|
+
disabled: busy,
|
|
304
|
+
onClick: close
|
|
305
|
+
}, getText("pisell2.panpacific.task.cancelAction")), /* @__PURE__ */ react.default.createElement(antd.Button, {
|
|
306
|
+
type: "primary",
|
|
307
|
+
htmlType: "submit",
|
|
308
|
+
loading: busy,
|
|
309
|
+
disabled: uncertain
|
|
310
|
+
}, getText(`pisell2.panpacific.task.${initial.id == null ? "createAction" : "save"}`)))));
|
|
311
|
+
});
|
|
312
|
+
JobForm.displayName = "PanpacificJobForm";
|
|
313
|
+
//#endregion
|
|
314
|
+
exports.JobForm = JobForm;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_model = require("./model.js");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
react = require_runtime.__toESM(react);
|
|
5
|
+
//#region src/plus/panpacificTask/JobStatus.tsx
|
|
6
|
+
function JobStatus({ job, getText }) {
|
|
7
|
+
const status = require_model.displayStatus(job);
|
|
8
|
+
return /* @__PURE__ */ react.default.createElement("span", {
|
|
9
|
+
className: "pp-task-status",
|
|
10
|
+
"data-status": status,
|
|
11
|
+
style: require_model.jobStyle(job)
|
|
12
|
+
}, getText(`pisell2.panpacific.task.${status}`), require_model.hasInvoice(job) && /* @__PURE__ */ react.default.createElement(InvoiceMark, { getText }));
|
|
13
|
+
}
|
|
14
|
+
function InvoiceMark({ getText }) {
|
|
15
|
+
return /* @__PURE__ */ react.default.createElement("svg", {
|
|
16
|
+
className: "pp-task-invoice",
|
|
17
|
+
width: "12",
|
|
18
|
+
height: "12",
|
|
19
|
+
viewBox: "0 0 16 16",
|
|
20
|
+
role: "img",
|
|
21
|
+
"aria-label": getText("pisell2.panpacific.task.invoice")
|
|
22
|
+
}, /* @__PURE__ */ react.default.createElement("path", {
|
|
23
|
+
fill: "currentColor",
|
|
24
|
+
d: "M3 1h10a1 1 0 0 1 1 1v12l-2-1.5L10 14l-2-1.5L6 14l-2-1.5L2 14V2a1 1 0 0 1 1-1zm1 3v1h8V4H4zm0 2v1h5V6H4zm0 2v1h8V8H4z"
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
function StatusLegend({ getText }) {
|
|
28
|
+
return /* @__PURE__ */ react.default.createElement("div", { className: "pp-task-legend" }, require_model.displayStatuses.map((status) => /* @__PURE__ */ react.default.createElement("span", { key: status }, /* @__PURE__ */ react.default.createElement("i", { style: { background: require_model.statusColors[status] } }), getText(`pisell2.panpacific.task.${status}`), status === "invoice" && /* @__PURE__ */ react.default.createElement(InvoiceMark, { getText }))));
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
exports.InvoiceMark = InvoiceMark;
|
|
32
|
+
exports.JobStatus = JobStatus;
|
|
33
|
+
exports.StatusLegend = StatusLegend;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PanpacificTaskProps } from "./types.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
//#region src/plus/panpacificTask/PanpacificTask.d.ts
|
|
4
|
+
/** Complete #task workspace. All UI state belongs to this component, including its overlays. */
|
|
5
|
+
declare function PanpacificTask(props: PanpacificTaskProps): React.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { PanpacificTask };
|