@gct-paas/word 0.2.36-beta.0 → 0.2.36-beta.2
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/base/input/src/input.vue.d.ts +1 -1
- package/dist/domain/table/business/material/material-consume/profile/product-fields.d.ts +6 -0
- package/dist/domain/table/design/hooks/on-field-attach.d.ts +3 -0
- package/dist/index.es.js +1364 -922
- package/dist/runtime/canvas/table/render/material-consume/bom-validator.d.ts +8 -3
- package/dist/runtime/canvas/table/render/material-consume/initial-product-autofill.d.ts +6 -0
- package/dist/runtime/canvas/table/render/material-consume/material-consume-table-controller.d.ts +11 -7
- package/dist/runtime/canvas/table/render/material-consume/product-autofill.d.ts +7 -0
- package/dist/runtime/canvas/table/render/material-consume/product-source.d.ts +4 -0
- package/dist/runtime/canvas/table/render/material-consume/scan-fill.d.ts +7 -2
- package/dist/runtime/designer/toolkit/toolkit-item.vue.d.ts +2 -16
- package/dist/runtime/designer/toolkit/toolkit.vue.d.ts +2 -16
- package/dist/runtime/factories/createDesignWidgetFactory.d.ts +2 -0
- package/dist/runtime/renderer/dialogs/device-scan/device-scan-dialog.vue.d.ts +3 -3
- package/dist/runtime/renderer/dropdowns/components/option-dropdown.vue.d.ts +3 -3
- package/dist/runtime/renderer/dropdowns/components/tables/rdo-table-dropdown.vue.d.ts +3 -3
- package/dist/runtime/renderer/dropdowns/components/tables/table-dropdown.vue.d.ts +3 -3
- package/dist/runtime/renderer/dropdowns/components/tables/table-option-dropdown.vue.d.ts +3 -3
- package/dist/runtime/renderer/dropdowns/components/tree/tree-dropdown.vue.d.ts +3 -3
- package/dist/suites/shared/panel/config/editor/ref-autofill-editor/autofill-runtime.d.ts +2 -0
- package/dist/utils/func/base-formula-functions.d.ts +6 -0
- package/dist/utils/func/number-util.d.ts +9 -0
- package/dist/word.css +46 -46
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/*! @gct-paas/word v0.2.36-beta.
|
|
1
|
+
/*! @gct-paas/word v0.2.36-beta.2 */
|
|
2
2
|
import { Fragment, Suspense, Teleport, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, render, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toRaw, toRef, toValue, unref, useAttrs, useCssVars, useModel, useSlots, vModelRadio, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
3
3
|
import fa, { PopperWrapper } from "floating-vue";
|
|
4
4
|
import VueKonva from "vue-konva";
|
|
5
5
|
import { HttpUtil, api } from "@gct-paas/api";
|
|
6
|
+
import { cloneDeep, debounce, defaults, get, groupBy, has, isBoolean, isEmpty, isEqual, isNil, isNumber, isPlainObject, keyBy, merge, omit, pick, pickBy, range, set } from "lodash-es";
|
|
6
7
|
import dayjs from "dayjs";
|
|
7
8
|
import BigNumber from "bignumber.js";
|
|
8
|
-
import { cloneDeep, debounce, defaults, get, groupBy, has, isBoolean, isEmpty, isEqual, isNil, isNumber, keyBy, merge, omit, pick, pickBy, range, set } from "lodash-es";
|
|
9
9
|
import { VxeGrid } from "vxe-table";
|
|
10
10
|
import { PlusOutlined } from "@ant-design/icons-vue";
|
|
11
11
|
import Ha, { ConfigProvider, Modal, message } from "ant-design-vue";
|
|
@@ -426,9 +426,60 @@ var init_asset_helper_util = __esmMin((() => {
|
|
|
426
426
|
//#region src/style.css
|
|
427
427
|
init_asset_helper_util();
|
|
428
428
|
//#endregion
|
|
429
|
+
//#region src/utils/func/base-formula-functions.ts
|
|
430
|
+
/** 判断字段是否未填写,0、false 和空格文本均视为已填写。 */
|
|
431
|
+
function ISUNFILLED(value) {
|
|
432
|
+
if (value === null || value === void 0 || Number.isNaN(value)) return true;
|
|
433
|
+
if (typeof value === "string" || Array.isArray(value)) return value.length === 0;
|
|
434
|
+
return isPlainObject(value) && Object.keys(value).length === 0;
|
|
435
|
+
}
|
|
436
|
+
/** 注册基础函数执行体,供表单填报和预览时计算公式。 */
|
|
437
|
+
function registerBaseFormulaFuncs() {
|
|
438
|
+
const register = window.gct_expression.register;
|
|
439
|
+
if (!register) return;
|
|
440
|
+
Object.entries(BASE_FORMULA_FUNCS).forEach(([name, func]) => {
|
|
441
|
+
register(name, func);
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
/** 保留调用方已有函数,并按各自分组追加基础函数描述。 */
|
|
445
|
+
function appendBaseFormulaFunctions(options) {
|
|
446
|
+
return {
|
|
447
|
+
...options,
|
|
448
|
+
functions: [...options.functions ?? [], ...BASE_FORMULA_FUNCTION_GROUPS]
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
var BASE_FORMULA_FUNCS, BASE_FORMULA_FUNCTION_GROUPS;
|
|
452
|
+
var init_base_formula_functions = __esmMin((() => {
|
|
453
|
+
BASE_FORMULA_FUNCS = { ISUNFILLED };
|
|
454
|
+
BASE_FORMULA_FUNCTION_GROUPS = [{
|
|
455
|
+
group: {
|
|
456
|
+
id: "LOGIC",
|
|
457
|
+
mode: "extend",
|
|
458
|
+
name: "逻辑"
|
|
459
|
+
},
|
|
460
|
+
functions: [{
|
|
461
|
+
id: "ISUNFILLED",
|
|
462
|
+
afterIndex: 1,
|
|
463
|
+
returnType: "boolean",
|
|
464
|
+
args: ["value"],
|
|
465
|
+
desc: `ISUNFILLED(值)
|
|
466
|
+
判断值是否未填写:null、undefined、空文本、空数组、空对象均视为空
|
|
467
|
+
示例
|
|
468
|
+
ISUNFILLED('') 返回 true
|
|
469
|
+
ISUNFILLED(null) 返回 true
|
|
470
|
+
ISUNFILLED(undefined) 返回 true
|
|
471
|
+
ISUNFILLED([]) 返回 true
|
|
472
|
+
ISUNFILLED({}) 返回 true
|
|
473
|
+
ISUNFILLED(0) 返回 false`,
|
|
474
|
+
definition: "declare function ISUNFILLED(value: any): boolean;"
|
|
475
|
+
}]
|
|
476
|
+
}];
|
|
477
|
+
}));
|
|
478
|
+
//#endregion
|
|
429
479
|
//#region src/utils/adapters/TriggerUtil.ts
|
|
430
480
|
var TriggerUtil, triggerUtil;
|
|
431
481
|
var init_TriggerUtil = __esmMin((() => {
|
|
482
|
+
init_base_formula_functions();
|
|
432
483
|
init_defineProperty();
|
|
433
484
|
TriggerUtil = class TriggerUtil {
|
|
434
485
|
constructor() {
|
|
@@ -458,7 +509,7 @@ var init_TriggerUtil = __esmMin((() => {
|
|
|
458
509
|
console.warn("[TriggerUtil] handle method not injected");
|
|
459
510
|
return;
|
|
460
511
|
}
|
|
461
|
-
return this._handle(name, options);
|
|
512
|
+
return this._handle(name, name === "OPEN_FORMULA_EDITOR_MODAL" ? appendBaseFormulaFunctions(options) : options);
|
|
462
513
|
}
|
|
463
514
|
};
|
|
464
515
|
_defineProperty(TriggerUtil, "instance", void 0);
|
|
@@ -7664,10 +7715,7 @@ var _hoisted_1$162, _hoisted_2$102, _hoisted_3$72, _hoisted_4$57, TimePicker_vue
|
|
|
7664
7715
|
var init_TimePicker_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
7665
7716
|
init_base$2();
|
|
7666
7717
|
_hoisted_1$162 = { class: "gct-time-picker" };
|
|
7667
|
-
_hoisted_2$102 = { style: {
|
|
7668
|
-
"width": "248px",
|
|
7669
|
-
"height": "248px"
|
|
7670
|
-
} };
|
|
7718
|
+
_hoisted_2$102 = { style: { "height": "248px" } };
|
|
7671
7719
|
_hoisted_3$72 = {
|
|
7672
7720
|
key: 0,
|
|
7673
7721
|
class: "text"
|
|
@@ -7772,17 +7820,17 @@ var init_TimePicker_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
7772
7820
|
});
|
|
7773
7821
|
}));
|
|
7774
7822
|
//#endregion
|
|
7775
|
-
//#region src/base/time-picker/src/TimePicker.vue?vue&type=style&index=0&scoped=
|
|
7776
|
-
var
|
|
7823
|
+
//#region src/base/time-picker/src/TimePicker.vue?vue&type=style&index=0&scoped=ae06f530&lang.less
|
|
7824
|
+
var init_TimePicker_vue_vue_type_style_index_0_scoped_ae06f530_lang = __esmMin((() => {}));
|
|
7777
7825
|
//#endregion
|
|
7778
7826
|
//#region src/base/time-picker/src/TimePicker.vue
|
|
7779
7827
|
var TimePicker_default;
|
|
7780
7828
|
var init_TimePicker = __esmMin((() => {
|
|
7781
7829
|
init_TimePicker_vue_vue_type_script_setup_true_lang();
|
|
7782
7830
|
init_TimePicker_vue_vue_type_script_setup_true_lang();
|
|
7783
|
-
|
|
7831
|
+
init_TimePicker_vue_vue_type_style_index_0_scoped_ae06f530_lang();
|
|
7784
7832
|
init__plugin_vue_export_helper();
|
|
7785
|
-
TimePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(TimePicker_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
7833
|
+
TimePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(TimePicker_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ae06f530"]]);
|
|
7786
7834
|
}));
|
|
7787
7835
|
//#endregion
|
|
7788
7836
|
//#region src/base/time-picker/index.ts
|
|
@@ -8161,7 +8209,7 @@ function Ht() {
|
|
|
8161
8209
|
const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
8162
8210
|
return e.charAt(Math.floor(Math.random() * 62)) + e.charAt(Math.floor(Math.random() * 62));
|
|
8163
8211
|
}
|
|
8164
|
-
var ze, je, xe, ut$1, K$1, Ee, ye, ve$1, I$1, Ue$1, bt, Pe, Fe$1, Ge, gt$1, mt, N$1, Se, $e, _t, yt, Ct, q$1, le, pe, oe, Ft, St, At, M, De, fe, se, Vt, Bt, Lt, Et
|
|
8212
|
+
var ze, je, xe, ut$1, K$1, Ee, ye, ve$1, I$1, Ue$1, bt, Pe, Fe$1, Ge, gt$1, mt, N$1, Se, $e, _t, yt, Ct, q$1, le, pe, oe, Ft, St, At, M, De, fe, se, Vt, Bt, Lt, Et, Dt, Nt, Tt$1, It, Ut, Pt$1, Gt$1, Ot, Kt, zt, jt, Xt, Yt, qt, Wt, Zt$1, Jt$1, Qt$1, ea, ta, gn;
|
|
8165
8213
|
var init_vue_color = __esmMin((() => {
|
|
8166
8214
|
ze = /^\s+/;
|
|
8167
8215
|
je = /\s+$/;
|
|
@@ -9042,10 +9090,10 @@ var init_vue_color = __esmMin((() => {
|
|
|
9042
9090
|
Vt = { class: "saturation" };
|
|
9043
9091
|
Bt = { class: "body" };
|
|
9044
9092
|
Lt = { class: "controls" };
|
|
9045
|
-
Et
|
|
9093
|
+
Et = { class: "color-wrap" };
|
|
9046
9094
|
Dt = ["aria-label"];
|
|
9047
9095
|
Nt = { class: "sliders" };
|
|
9048
|
-
Tt = { class: "hue-wrap" };
|
|
9096
|
+
Tt$1 = { class: "hue-wrap" };
|
|
9049
9097
|
It = {
|
|
9050
9098
|
key: 0,
|
|
9051
9099
|
class: "alpha-wrap"
|
|
@@ -9055,11 +9103,11 @@ var init_vue_color = __esmMin((() => {
|
|
|
9055
9103
|
class: "fieldsWrap",
|
|
9056
9104
|
"data-testid": "fields"
|
|
9057
9105
|
};
|
|
9058
|
-
Pt = {
|
|
9106
|
+
Pt$1 = {
|
|
9059
9107
|
key: 0,
|
|
9060
9108
|
class: "fields"
|
|
9061
9109
|
};
|
|
9062
|
-
Gt = { class: "field" };
|
|
9110
|
+
Gt$1 = { class: "field" };
|
|
9063
9111
|
Ot = { class: "field" };
|
|
9064
9112
|
Kt = { class: "field" };
|
|
9065
9113
|
zt = {
|
|
@@ -9070,19 +9118,19 @@ var init_vue_color = __esmMin((() => {
|
|
|
9070
9118
|
key: 1,
|
|
9071
9119
|
class: "fields"
|
|
9072
9120
|
};
|
|
9073
|
-
Xt
|
|
9121
|
+
Xt = { class: "field" };
|
|
9074
9122
|
Yt = {
|
|
9075
9123
|
key: 2,
|
|
9076
9124
|
class: "fields"
|
|
9077
9125
|
};
|
|
9078
9126
|
qt = { class: "field" };
|
|
9079
|
-
Wt
|
|
9127
|
+
Wt = { class: "field" };
|
|
9080
9128
|
Zt$1 = { class: "field" };
|
|
9081
9129
|
Jt$1 = {
|
|
9082
9130
|
key: 0,
|
|
9083
9131
|
class: "field"
|
|
9084
9132
|
};
|
|
9085
|
-
Qt = {
|
|
9133
|
+
Qt$1 = {
|
|
9086
9134
|
class: "toggle-icon",
|
|
9087
9135
|
role: "presentation"
|
|
9088
9136
|
};
|
|
@@ -9181,21 +9229,21 @@ var init_vue_color = __esmMin((() => {
|
|
|
9181
9229
|
tinyColor: unref(l),
|
|
9182
9230
|
"onUpdate:tinyColor": x[0] || (x[0] = (F) => isRef(l) ? l.value = F : null),
|
|
9183
9231
|
hue: unref(n)
|
|
9184
|
-
}, null, 8, ["tinyColor", "hue"])]), createElementVNode("div", Bt, [createElementVNode("div", Lt, [createElementVNode("div", Et
|
|
9232
|
+
}, null, 8, ["tinyColor", "hue"])]), createElementVNode("div", Bt, [createElementVNode("div", Lt, [createElementVNode("div", Et, [createElementVNode("div", {
|
|
9185
9233
|
class: "active-color",
|
|
9186
9234
|
style: normalizeStyle({ backgroundColor: s.value }),
|
|
9187
9235
|
role: "presentation",
|
|
9188
9236
|
"aria-live": "polite",
|
|
9189
9237
|
"aria-label": `Current color is ${s.value}`
|
|
9190
|
-
}, null, 12, Dt), t.disableAlpha ? createCommentVNode("", !0) : (openBlock(), createBlock(pe, { key: 0 }))]), createElementVNode("div", Nt, [createElementVNode("div", Tt, [createVNode(le, {
|
|
9238
|
+
}, null, 12, Dt), t.disableAlpha ? createCommentVNode("", !0) : (openBlock(), createBlock(pe, { key: 0 }))]), createElementVNode("div", Nt, [createElementVNode("div", Tt$1, [createVNode(le, {
|
|
9191
9239
|
modelValue: unref(n),
|
|
9192
9240
|
"onUpdate:modelValue": unref(i)
|
|
9193
9241
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])]), t.disableAlpha ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", It, [createVNode(oe, {
|
|
9194
9242
|
tinyColor: unref(l),
|
|
9195
9243
|
"onUpdate:tinyColor": x[1] || (x[1] = (F) => isRef(l) ? l.value = F : null)
|
|
9196
9244
|
}, null, 8, ["tinyColor"])]))])]), S.value ? (openBlock(), createElementBlock("div", Ut, [
|
|
9197
|
-
k("rgb") ? withDirectives((openBlock(), createElementBlock("div", Pt, [
|
|
9198
|
-
createElementVNode("div", Gt, [createVNode(M, {
|
|
9245
|
+
k("rgb") ? withDirectives((openBlock(), createElementBlock("div", Pt$1, [
|
|
9246
|
+
createElementVNode("div", Gt$1, [createVNode(M, {
|
|
9199
9247
|
label: "r",
|
|
9200
9248
|
value: b.value.r,
|
|
9201
9249
|
onChange: x[2] || (x[2] = (F) => h("r", F)),
|
|
@@ -9222,7 +9270,7 @@ var init_vue_color = __esmMin((() => {
|
|
|
9222
9270
|
a11y: { label: "Transparency" }
|
|
9223
9271
|
}, null, 8, ["value"])]))
|
|
9224
9272
|
], 512)), [[vShow, o.value === V("rgb")]]) : createCommentVNode("", !0),
|
|
9225
|
-
k("hex") ? withDirectives((openBlock(), createElementBlock("div", jt, [createElementVNode("div", Xt
|
|
9273
|
+
k("hex") ? withDirectives((openBlock(), createElementBlock("div", jt, [createElementVNode("div", Xt, [createVNode(fe, {
|
|
9226
9274
|
type: _.value === 1 ? "hex" : "hex8",
|
|
9227
9275
|
label: "hex",
|
|
9228
9276
|
value: unref(l).toHex8String(),
|
|
@@ -9236,7 +9284,7 @@ var init_vue_color = __esmMin((() => {
|
|
|
9236
9284
|
onChange: x[6] || (x[6] = (F) => v("h", F)),
|
|
9237
9285
|
a11y: { label: "Hue" }
|
|
9238
9286
|
}, null, 8, ["value"])]),
|
|
9239
|
-
createElementVNode("div", Wt
|
|
9287
|
+
createElementVNode("div", Wt, [createVNode(M, {
|
|
9240
9288
|
label: "s",
|
|
9241
9289
|
value: u.value.s,
|
|
9242
9290
|
onChange: x[7] || (x[7] = (F) => v("s", F)),
|
|
@@ -9270,7 +9318,7 @@ var init_vue_color = __esmMin((() => {
|
|
|
9270
9318
|
role: "button",
|
|
9271
9319
|
"aria-label": "Change color format",
|
|
9272
9320
|
tabindex: "0"
|
|
9273
|
-
}, [createElementVNode("div", Qt, [(openBlock(), createElementBlock("svg", ea, x[10] || (x[10] = [createElementVNode("path", {
|
|
9321
|
+
}, [createElementVNode("div", Qt$1, [(openBlock(), createElementBlock("svg", ea, x[10] || (x[10] = [createElementVNode("path", {
|
|
9274
9322
|
fill: "currentColor",
|
|
9275
9323
|
d: "M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"
|
|
9276
9324
|
}, null, -1)])))]), withDirectives(createElementVNode("div", ta, null, 512), [[vShow, unref(f)]])], 32)) : createCommentVNode("", !0)
|
|
@@ -9532,7 +9580,7 @@ var init_base$2 = __esmMin((() => {
|
|
|
9532
9580
|
//#region ../../node_modules/.pnpm/floating-vue@5.2.2_vue@3.5.24_typescript@5.9.3_/node_modules/floating-vue/dist/style.css
|
|
9533
9581
|
var init_style = __esmMin((() => {}));
|
|
9534
9582
|
//#endregion
|
|
9535
|
-
//#region ../../node_modules/.pnpm/@gct-paas+form-base@0.1.
|
|
9583
|
+
//#region ../../node_modules/.pnpm/@gct-paas+form-base@0.1.8-beta.0_@gct-paas+api@6.2.0-dev.2_axios@1.13.2__@vueuse+core@1_2f0839f269373580ee9a463669b7ccff/node_modules/@gct-paas/form-base/dist/index.es.js
|
|
9536
9584
|
function Wo() {
|
|
9537
9585
|
if (typeof globalThis < "u") {
|
|
9538
9586
|
const e = globalThis._api;
|
|
@@ -9541,17 +9589,17 @@ function Wo() {
|
|
|
9541
9589
|
return api;
|
|
9542
9590
|
}
|
|
9543
9591
|
function is() {
|
|
9544
|
-
|
|
9592
|
+
Pt = document.createElement("div"), document.body.appendChild(Pt);
|
|
9545
9593
|
const e = createVNode(ss);
|
|
9546
|
-
render(e,
|
|
9594
|
+
render(e, Pt), Zt = e.component.exposed;
|
|
9547
9595
|
}
|
|
9548
9596
|
function us(e) {
|
|
9549
9597
|
return typeof e == "function" ? e() : (isVNode(e), e);
|
|
9550
9598
|
}
|
|
9551
9599
|
function Ue(e) {
|
|
9552
|
-
|
|
9600
|
+
Zt || is();
|
|
9553
9601
|
const o = ++rs;
|
|
9554
|
-
|
|
9602
|
+
Zt.add({
|
|
9555
9603
|
id: o,
|
|
9556
9604
|
type: e.type ?? "info",
|
|
9557
9605
|
message: us(e.message),
|
|
@@ -9698,147 +9746,147 @@ function Hr(e) {
|
|
|
9698
9746
|
var _c$children;
|
|
9699
9747
|
c.rawValue && a.value.set(String(c.rawValue), c), (_c$children = c.children) === null || _c$children === void 0 || _c$children.forEach(n);
|
|
9700
9748
|
}
|
|
9701
|
-
function l(c, g,
|
|
9702
|
-
const
|
|
9703
|
-
key:
|
|
9704
|
-
title:
|
|
9705
|
-
displayLabel: `${c}:${
|
|
9706
|
-
rawValue:
|
|
9707
|
-
_info:
|
|
9708
|
-
isDefault: !!
|
|
9749
|
+
function l(c, g, C) {
|
|
9750
|
+
const y = C.__LABEL__ || C.version_, R = `${g}:${C.id_}`, T = {
|
|
9751
|
+
key: R,
|
|
9752
|
+
title: y,
|
|
9753
|
+
displayLabel: `${c}:${y}`,
|
|
9754
|
+
rawValue: R,
|
|
9755
|
+
_info: C,
|
|
9756
|
+
isDefault: !!C.default_
|
|
9709
9757
|
};
|
|
9710
|
-
return n(
|
|
9758
|
+
return n(T), T;
|
|
9711
9759
|
}
|
|
9712
9760
|
function s(c = []) {
|
|
9713
9761
|
return c.map((g) => {
|
|
9714
9762
|
var _g$__CHILDREN__;
|
|
9715
|
-
const
|
|
9763
|
+
const C = g.__LABEL__ || g.name_, y = (_g$__CHILDREN__ = g.__CHILDREN__) === null || _g$__CHILDREN__ === void 0 ? void 0 : _g$__CHILDREN__.find((T) => T.default_), R = {
|
|
9716
9764
|
key: g.id_,
|
|
9717
|
-
title:
|
|
9718
|
-
displayLabel:
|
|
9765
|
+
title: C,
|
|
9766
|
+
displayLabel: C,
|
|
9719
9767
|
rawValue: g.id_,
|
|
9720
|
-
_info:
|
|
9721
|
-
showDefaultTag: !!
|
|
9768
|
+
_info: y,
|
|
9769
|
+
showDefaultTag: !!y,
|
|
9722
9770
|
disabled: !0,
|
|
9723
|
-
children: (g.__CHILDREN__ || []).map((
|
|
9771
|
+
children: (g.__CHILDREN__ || []).map((T) => l(C, g.id_, T))
|
|
9724
9772
|
};
|
|
9725
|
-
return n(
|
|
9773
|
+
return n(R), R;
|
|
9726
9774
|
});
|
|
9727
9775
|
}
|
|
9728
9776
|
async function f(c = {}) {
|
|
9729
9777
|
var _c$keyword, _e$getQueryData;
|
|
9730
|
-
const g = c.pageNo ?? 1,
|
|
9778
|
+
const g = c.pageNo ?? 1, C = c.pageSize ?? 30, y = ((_c$keyword = c.keyword) === null || _c$keyword === void 0 ? void 0 : _c$keyword.trim()) || void 0, R = (_e$getQueryData = e.getQueryData) === null || _e$getQueryData === void 0 ? void 0 : _e$getQueryData.call(e), T = await ka.handleRequest(`rdo-tree-list:${e.modelKey}`, {
|
|
9731
9779
|
pageNo: g,
|
|
9732
|
-
pageSize:
|
|
9780
|
+
pageSize: C,
|
|
9733
9781
|
modelCategory: o,
|
|
9734
|
-
keyword:
|
|
9735
|
-
queryData:
|
|
9782
|
+
keyword: y,
|
|
9783
|
+
queryData: R
|
|
9736
9784
|
}, () => Pr(e.modelKey, o, {
|
|
9737
9785
|
pageNo: g,
|
|
9738
|
-
pageSize:
|
|
9739
|
-
keyword:
|
|
9740
|
-
queryData:
|
|
9786
|
+
pageSize: C,
|
|
9787
|
+
keyword: y,
|
|
9788
|
+
queryData: R
|
|
9741
9789
|
}), 3e5);
|
|
9742
9790
|
return {
|
|
9743
|
-
complete: (
|
|
9744
|
-
nodes: s((
|
|
9791
|
+
complete: (T === null || T === void 0 ? void 0 : T.totalPage) ? T.totalPage <= g : !0,
|
|
9792
|
+
nodes: s((T === null || T === void 0 ? void 0 : T.data) || [])
|
|
9745
9793
|
};
|
|
9746
9794
|
}
|
|
9747
9795
|
async function r(c) {
|
|
9748
9796
|
var _await$ka$handleReque;
|
|
9749
9797
|
const [g] = c.split(":");
|
|
9750
9798
|
if (!g) return null;
|
|
9751
|
-
const
|
|
9799
|
+
const y = (_await$ka$handleReque = await ka.handleRequest(`rdo-tree-version:${e.modelKey}:${c}`, { id: c }, () => xa("rdoListVersionByRefIdsWithParent", e.modelKey, o, { foreignFields: [] }, {
|
|
9752
9800
|
refIds: c,
|
|
9753
9801
|
includeDeleted: 1
|
|
9754
9802
|
}), 3e5)) === null || _await$ka$handleReque === void 0 || (_await$ka$handleReque = _await$ka$handleReque.data) === null || _await$ka$handleReque === void 0 ? void 0 : _await$ka$handleReque[0];
|
|
9755
|
-
if (!
|
|
9756
|
-
const
|
|
9757
|
-
let
|
|
9803
|
+
if (!y) return null;
|
|
9804
|
+
const R = y.__LABEL__ || y.name_;
|
|
9805
|
+
let T = [];
|
|
9758
9806
|
try {
|
|
9759
9807
|
var _await$xa;
|
|
9760
|
-
|
|
9808
|
+
T = (((_await$xa = await xa("rdoListVersionById", e.modelKey, o, { foreignFields: [] }, { id: g })) === null || _await$xa === void 0 ? void 0 : _await$xa.data) || []).map((A) => l(R, g, A));
|
|
9761
9809
|
} catch {
|
|
9762
|
-
|
|
9810
|
+
T = [];
|
|
9763
9811
|
}
|
|
9764
|
-
const
|
|
9812
|
+
const q = T.find(($) => $.isDefault), O = {
|
|
9765
9813
|
key: g,
|
|
9766
|
-
title:
|
|
9767
|
-
displayLabel:
|
|
9814
|
+
title: R,
|
|
9815
|
+
displayLabel: R,
|
|
9768
9816
|
rawValue: g,
|
|
9769
|
-
_info:
|
|
9770
|
-
showDefaultTag: !!
|
|
9817
|
+
_info: q === null || q === void 0 ? void 0 : q._info,
|
|
9818
|
+
showDefaultTag: !!q,
|
|
9771
9819
|
disabled: !0,
|
|
9772
|
-
children:
|
|
9820
|
+
children: T
|
|
9773
9821
|
};
|
|
9774
|
-
return n(
|
|
9822
|
+
return n(O), O;
|
|
9775
9823
|
}
|
|
9776
9824
|
async function i(c = {}) {
|
|
9777
9825
|
var _t$value$at;
|
|
9778
|
-
const g = c.pageNo ?? 1, { complete:
|
|
9779
|
-
g > 1 ? ((_t$value$at = t.value.at(-1)) !== null && _t$value$at !== void 0 && _t$value$at.isLoadMore && t.value.pop(), t.value.push(...
|
|
9826
|
+
const g = c.pageNo ?? 1, { complete: C, nodes: y } = await f(c);
|
|
9827
|
+
g > 1 ? ((_t$value$at = t.value.at(-1)) !== null && _t$value$at !== void 0 && _t$value$at.isLoadMore && t.value.pop(), t.value.push(...y)) : t.value = y, C || t.value.push({
|
|
9780
9828
|
key: `__load_more__:${g}`,
|
|
9781
9829
|
title: "加载更多...",
|
|
9782
9830
|
isLoadMore: !0,
|
|
9783
9831
|
disabled: !1
|
|
9784
9832
|
});
|
|
9785
9833
|
}
|
|
9786
|
-
async function
|
|
9834
|
+
async function _(c) {
|
|
9787
9835
|
if (!c) return;
|
|
9788
9836
|
const [g] = c.split(":");
|
|
9789
|
-
if (a.value.has(c) || t.value.some((
|
|
9790
|
-
const
|
|
9791
|
-
|
|
9837
|
+
if (a.value.has(c) || t.value.some((R) => R.key === g)) return;
|
|
9838
|
+
const y = await r(c);
|
|
9839
|
+
y && t.value.unshift(y);
|
|
9792
9840
|
}
|
|
9793
|
-
function
|
|
9841
|
+
function k(c) {
|
|
9794
9842
|
return a.value.get(c) || t.value.find((g) => String(g.key) === c);
|
|
9795
9843
|
}
|
|
9796
|
-
function
|
|
9797
|
-
var
|
|
9798
|
-
const [g] = c.split(":"),
|
|
9799
|
-
return a.value.get(c) || (
|
|
9844
|
+
function m(c) {
|
|
9845
|
+
var _C$children;
|
|
9846
|
+
const [g] = c.split(":"), C = k(g || "");
|
|
9847
|
+
return a.value.get(c) || (C === null || C === void 0 || (_C$children = C.children) === null || _C$children === void 0 ? void 0 : _C$children.find((y) => String(y.rawValue) === c));
|
|
9800
9848
|
}
|
|
9801
9849
|
function d(c, g = !1) {
|
|
9802
9850
|
if (!c) return { text: "" };
|
|
9803
|
-
const [
|
|
9804
|
-
if (
|
|
9805
|
-
const
|
|
9806
|
-
if (
|
|
9807
|
-
}
|
|
9808
|
-
if (
|
|
9809
|
-
const
|
|
9810
|
-
if (
|
|
9811
|
-
text:
|
|
9851
|
+
const [C, y] = c.split(":");
|
|
9852
|
+
if (C && y) {
|
|
9853
|
+
const T = Qa(c, m, k);
|
|
9854
|
+
if (T) return T;
|
|
9855
|
+
}
|
|
9856
|
+
if (C && !y && !g) {
|
|
9857
|
+
const T = k(C);
|
|
9858
|
+
if (T) return {
|
|
9859
|
+
text: T.title,
|
|
9812
9860
|
showDefaultTag: !0
|
|
9813
9861
|
};
|
|
9814
9862
|
}
|
|
9815
|
-
const
|
|
9816
|
-
return (
|
|
9817
|
-
text:
|
|
9818
|
-
showDefaultTag: !g && !!
|
|
9863
|
+
const R = a.value.get(c);
|
|
9864
|
+
return (R === null || R === void 0 ? void 0 : R.displayLabel) ? {
|
|
9865
|
+
text: R.displayLabel,
|
|
9866
|
+
showDefaultTag: !g && !!R.showDefaultTag
|
|
9819
9867
|
} : {
|
|
9820
9868
|
text: c,
|
|
9821
9869
|
showDefaultTag: !1
|
|
9822
9870
|
};
|
|
9823
9871
|
}
|
|
9824
|
-
async function S(c, g = 9999,
|
|
9872
|
+
async function S(c, g = 9999, C = !1) {
|
|
9825
9873
|
if (c) return t.value.length || await i({
|
|
9826
9874
|
pageNo: 1,
|
|
9827
9875
|
pageSize: g
|
|
9828
|
-
}), await
|
|
9876
|
+
}), await _(c), d(c, C);
|
|
9829
9877
|
}
|
|
9830
|
-
function
|
|
9878
|
+
function h() {
|
|
9831
9879
|
t.value = [], a.value = /* @__PURE__ */ new Map();
|
|
9832
9880
|
}
|
|
9833
9881
|
return {
|
|
9834
9882
|
treeData: t,
|
|
9835
9883
|
loadOptions: i,
|
|
9836
|
-
ensureSelectedNode:
|
|
9884
|
+
ensureSelectedNode: _,
|
|
9837
9885
|
getNodeDisplay: d,
|
|
9838
9886
|
initByValue: S,
|
|
9839
|
-
findChildNode:
|
|
9840
|
-
findParentNode:
|
|
9841
|
-
resetTreeData:
|
|
9887
|
+
findChildNode: m,
|
|
9888
|
+
findParentNode: k,
|
|
9889
|
+
resetTreeData: h
|
|
9842
9890
|
};
|
|
9843
9891
|
}
|
|
9844
9892
|
function Te(e) {
|
|
@@ -9871,19 +9919,19 @@ function _o(e) {
|
|
|
9871
9919
|
function Yf(e, o) {
|
|
9872
9920
|
if (!o) throw new Error("请传入解析规则");
|
|
9873
9921
|
const { separator: n, nullSymbol: l, fieldList: s } = _o(JSON.parse(o));
|
|
9874
|
-
return e.split(n).reduce((r, i,
|
|
9875
|
-
const
|
|
9876
|
-
if (
|
|
9877
|
-
let
|
|
9878
|
-
if (
|
|
9922
|
+
return e.split(n).reduce((r, i, _) => {
|
|
9923
|
+
const k = s[_];
|
|
9924
|
+
if (k) {
|
|
9925
|
+
let m = l && i === l ? null : i;
|
|
9926
|
+
if (m !== null) switch (k.type) {
|
|
9879
9927
|
case gt.qty:
|
|
9880
|
-
|
|
9928
|
+
m = Number(m);
|
|
9881
9929
|
break;
|
|
9882
9930
|
case gt.expiration:
|
|
9883
|
-
|
|
9931
|
+
m = dayjs(m, k.format).format("YYYY-MM-DD HH:mm:ss");
|
|
9884
9932
|
break;
|
|
9885
9933
|
}
|
|
9886
|
-
r[
|
|
9934
|
+
r[k.key] = m;
|
|
9887
9935
|
}
|
|
9888
9936
|
return r;
|
|
9889
9937
|
}, {});
|
|
@@ -10020,7 +10068,7 @@ function G2(e, o, t) {
|
|
|
10020
10068
|
function Xp() {
|
|
10021
10069
|
ua.closeAll();
|
|
10022
10070
|
}
|
|
10023
|
-
var ie,
|
|
10071
|
+
var ie, Tt, ja, Wa, ln, G$1, ut, ae, He, ts, as, os, ns, ss, rs, Zt, Pt, Ss, As, qs, Vs, Ls, et, Or, Tr, qr, Vr, Lr, $r, zr, Fr, Nr, Dr, wa, Ir, ka, Kr, Ca, jr, Wr, Zr, Gr, Xr, Jr, Qr, Yr, ei, ti, ai, oi, ni, na, Hi, ji, Wi, Zi, Gt, Xi, Ji, Qi, Yi, ve, Jt, xf, Sf, Mf, Af, Rf, Of, Tf, wt, ra, Qt, Vf, Lf, lt, $f, Bf, zf, Ff, yo, Ta, Uf, go, Kf, Ef, Pf, Hf, Wf, Zf, Xf, gt, Jf, a2, o2, n2, l2, s2, r2, i2, u2, c2, d2, f2, ho, m2, v2, y2, g2, h2, b2, w2, C2, x2, S2, M2, A2, O2, T2, V2, L2, z2, bo, qa, st, Z2, ua, Gp;
|
|
10024
10072
|
var init_index_es = __esmMin((() => {
|
|
10025
10073
|
init_ResizeObserver_es();
|
|
10026
10074
|
init_vue_color();
|
|
@@ -10029,7 +10077,7 @@ var init_index_es = __esmMin((() => {
|
|
|
10029
10077
|
const t = Wo();
|
|
10030
10078
|
return Reflect.get(t, o, t);
|
|
10031
10079
|
} });
|
|
10032
|
-
|
|
10080
|
+
Tt = /* @__PURE__ */ ((e) => (e.PRIMARY_KEY = "primary_key", e.ASSOCIATED_PRIMARY_KEY = "associated_primary_key", e.TEXT = "text", e.LONG_TEXT = "long_text", e.INTEGER = "integer", e.LONG = "long", e.DOUBLE = "double", e.DECIMAL = "decimal", e.BOOLEAN = "boolean", e.DATE = "date", e.TIME = "time", e.DATE_TIME = "date_time", e.IMAGE = "image", e.ATTACHMENT = "attachment", e.SERIAL = "serial_number", e.MASTERSLAVE = "master_slave", e.USER = "user", e.USER_MULTI = "user_multi", e.ORG = "org", e.ORG_MULTI = "org_multi", e.ENUM = "enum", e.ENUM_MULTI = "enum_multi", e.OPTION = "option", e.OPTION_MULTI = "option_multi", e.REF = "ref", e.REF_MULTI = "ref_multi", e.RDO_REF = "rdo_ref", e.EXPRESSION = "expression", e.EXPRESSION_CONDITION = "expression_condition", e.FUNCTION = "function", e.AGG = "agg", e.ESOP = "esop", e.TRANSACTION = "transaction", e.LABEL_TEMPLATE = "label_template", e.LABEL_TEMPLATE_REF = "label_template_ref", e.DOCUMENT_TEMPLATE = "document_template", e.SERIALRULE = "serial_number_rule", e.PRINTER = "printer", e.MESSAGE_TMPL = "message_tmpl", e.RANGE_USER = "range_user", e.SIGNATURE = "electronic_signature", e.ONLINE_FORM_TEMPLATE = "online_form_tmpl", e.E_DHR_TEMPLATE = "edhr_tmpl", e.DATA_TABLE_FORMULA = "data_table_formula", e.READONLYCMP = "readonlycmp", e.MATERIAL_NO = "material_no", e.STERILIZE_LOT = "sterilization_container", e.MATERIAL_LOT = "material_container", e.RELATED_LOT_NO = "related_lot_no", e.PRODUCT = "product", e.DEVICE = "device", e.Biz_Process = "biz_process", e.Approval_Process = "approval_process", e.MFG_ORDER = "mfg_order", e.RECORD_NO = "record_no", e.TRACE_DATE = "trace_date", e.ORDER_NO = "order_no", e.ROUTING_OPERATION = "routing_operation", e.GOOD_QTY = "good_qty", e.NOT_GOOD_QTY = "not_good_qty", e.REPORT_START_TIME = "report_start_time", e.REPORT_END_TIME = "report_end_time", e.WORK_HOURS = "work_hours", e.PRODUCTION_DATE = "production_date", e.REPORTER = "reporter", e.NOT_GOOD_REASON = "not_good_reason", e.NOT_GOOD_GROUP = "not_good_group", e.SCRAP_REASON = "scrap_reason", e.SCRAP_GROUP = "scrap_group", e.SCRAP_QTY = "scrap_qty", e.SCRAP_MATERIAL = "scrap_material", e.SCRAP_MATERIAL_NO = "scrap_material_no", e.DESTRUCTIVE_TEST_QTY = "destructive_test_qty", e.PRODUCT_CHECK_QTY = "product_check_qty", e.MATERIAL_CHECK_QTY = "material_check_qty", e.OF_INST_NUM = "of_inst_num", e.DEVICE_REF = "device_ref", e.DEVICE_REF_MULTI = "device_ref_multi", e.PRODUCT_FAMILY = "product_family", e.WAREHOUSE_RECEIPT_NO = "warehouse_receipt_no", e.WAREHOUSE_RECEIPT_DATE = "warehouse_receipt_date", e.WAREHOUSE_MANAGER = "warehouse_manager", e.WAREHOUSE_IN_OUT = "warehouse_in_out", e.STOCKTAKE = "stocktake", e.ALLOCATE = "allocate", e.STERILIZE_BATCH = "sterilize_batch", e.PRETREATMENT_LIST = "pretreatment_list", e.INSPECTION = "inspection", e.WAREHOUSE = "warehouse", e.LOCATION = "location", e.QTY_REQUIRED = "qty_required", e.QTY_CONSUMED = "qty_consumed", e.QTY = "qty", e.MODEL_RELATION = "model_relation", e.EXTERNAL_REF_NO = "external_reference_no", e.OBJECT_TYPE = "object_type", e.MATERIAL_CONSUME = "material_consume", e.MATERIAL_CONSUME_TABLE = "material_consume_table", e.MATERIAL_BALANCE_TABLE = "material_balance_table", e.SHOPFLOOR = "shopfloor", e.E_SOP = "e_sop", e.E_SOP_VERSION = "e_sop_version", e))(Tt || {});
|
|
10033
10081
|
ja = /* @__PURE__ */ ((e) => (e.MATERIAL_CONSUME = "material_consume", e.EXTERNAL_REF_NO = "external_reference_no", e.WAREHOUSE = "warehouse", e.MODEL_RELATION = "model_relation", e.QTY = "qty", e.QTY_CONSUMED = "qty_consumed", e.QTY_REQUIRED = "qty_required", e.PRODUCT = "product", e.MATERIAL_NO = "material_no", e.ROUTING_OPERATION = "routing_operation", e.OPERATION = "operation", e.BOM_ENTRY_ID = "bom_entry_id", e))(ja || {});
|
|
10034
10082
|
Wa = {
|
|
10035
10083
|
na: "N/A",
|
|
@@ -10278,20 +10326,20 @@ var init_index_es = __esmMin((() => {
|
|
|
10278
10326
|
l.fillStyle = "#ffffff", l.fillRect(0, 0, t, a);
|
|
10279
10327
|
let s = Math.floor(a / 3);
|
|
10280
10328
|
l.font = `${s}px Arial`;
|
|
10281
|
-
const f = (d, S,
|
|
10329
|
+
const f = (d, S, h) => {
|
|
10282
10330
|
const c = d.split(""), g = [];
|
|
10283
|
-
let
|
|
10284
|
-
for (const
|
|
10285
|
-
const
|
|
10286
|
-
|
|
10331
|
+
let C = "";
|
|
10332
|
+
for (const y of c) {
|
|
10333
|
+
const R = C + y;
|
|
10334
|
+
h.measureText(R).width > S && C ? (g.push(C), C = y) : C = R;
|
|
10287
10335
|
}
|
|
10288
|
-
return
|
|
10336
|
+
return C && g.push(C), g;
|
|
10289
10337
|
}, r = t * .9;
|
|
10290
|
-
let i = f(o, r, l),
|
|
10291
|
-
for (; i.length *
|
|
10292
|
-
const
|
|
10338
|
+
let i = f(o, r, l), _ = s * 1.2;
|
|
10339
|
+
for (; i.length * _ > a && s > 10;) s--, _ = s * 1.2, l.font = `${s}px Arial`, i = f(o, r, l);
|
|
10340
|
+
const m = (a - i.length * _) / 2 + _ / 2;
|
|
10293
10341
|
return l.fillStyle = "#000", l.textAlign = "center", l.textBaseline = "middle", i.forEach((d, S) => {
|
|
10294
|
-
l.fillText(d, t / 2,
|
|
10342
|
+
l.fillText(d, t / 2, m + S * _);
|
|
10295
10343
|
}), n.toDataURL("image/png");
|
|
10296
10344
|
}
|
|
10297
10345
|
static clear() {
|
|
@@ -10363,8 +10411,8 @@ var init_index_es = __esmMin((() => {
|
|
|
10363
10411
|
function l(i) {
|
|
10364
10412
|
if (!i.timer) return;
|
|
10365
10413
|
clearTimeout(i.timer), i.timer = void 0;
|
|
10366
|
-
const
|
|
10367
|
-
i.remaining = i.remaining -
|
|
10414
|
+
const _ = Date.now() - (i.startTime || 0);
|
|
10415
|
+
i.remaining = i.remaining - _;
|
|
10368
10416
|
}
|
|
10369
10417
|
function s(i) {
|
|
10370
10418
|
i.timer || i.remaining <= 0 || n(i);
|
|
@@ -10373,32 +10421,32 @@ var init_index_es = __esmMin((() => {
|
|
|
10373
10421
|
i.remaining = i.duration, t.push(i), i.duration > 0 && n(i);
|
|
10374
10422
|
}
|
|
10375
10423
|
function r(i) {
|
|
10376
|
-
const
|
|
10377
|
-
if (
|
|
10378
|
-
const
|
|
10379
|
-
|
|
10424
|
+
const _ = t.findIndex((k) => k.id === i);
|
|
10425
|
+
if (_ !== -1) {
|
|
10426
|
+
const k = t[_];
|
|
10427
|
+
k !== null && k !== void 0 && k.timer && clearTimeout(k.timer), t.splice(_, 1);
|
|
10380
10428
|
}
|
|
10381
10429
|
}
|
|
10382
10430
|
return o({
|
|
10383
10431
|
add: f,
|
|
10384
10432
|
remove: r
|
|
10385
|
-
}), (i,
|
|
10433
|
+
}), (i, _) => (openBlock(), createElementBlock("div", ts, [createVNode(TransitionGroup, {
|
|
10386
10434
|
name: "message",
|
|
10387
10435
|
tag: "div",
|
|
10388
10436
|
class: "message-list"
|
|
10389
10437
|
}, {
|
|
10390
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(t, (
|
|
10391
|
-
key:
|
|
10392
|
-
class: normalizeClass(["message", `message--${
|
|
10393
|
-
onMouseenter: (
|
|
10394
|
-
onMouseleave: (
|
|
10438
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(t, (k) => (openBlock(), createElementBlock("div", {
|
|
10439
|
+
key: k.id,
|
|
10440
|
+
class: normalizeClass(["message", `message--${k.type}`]),
|
|
10441
|
+
onMouseenter: (m) => l(k),
|
|
10442
|
+
onMouseleave: (m) => s(k)
|
|
10395
10443
|
}, [
|
|
10396
|
-
createElementVNode("i", { class: normalizeClass(["message-icon icon iconfont", a[
|
|
10397
|
-
createElementVNode("div", os, toDisplayString(
|
|
10398
|
-
|
|
10444
|
+
createElementVNode("i", { class: normalizeClass(["message-icon icon iconfont", a[k.type]]) }, null, 2),
|
|
10445
|
+
createElementVNode("div", os, toDisplayString(k.message), 1),
|
|
10446
|
+
k.closeable ? (openBlock(), createElementBlock("i", {
|
|
10399
10447
|
key: 0,
|
|
10400
10448
|
class: "message-close icon iconfont icon-guanbi",
|
|
10401
|
-
onClick: (
|
|
10449
|
+
onClick: (m) => r(k.id)
|
|
10402
10450
|
}, null, 8, ns)) : createCommentVNode("", !0)
|
|
10403
10451
|
], 42, as))), 128))]),
|
|
10404
10452
|
_: 1
|
|
@@ -10457,28 +10505,28 @@ var init_index_es = __esmMin((() => {
|
|
|
10457
10505
|
move: Number
|
|
10458
10506
|
},
|
|
10459
10507
|
setup(e) {
|
|
10460
|
-
const o = getCurrentInstance(), t = ref(), a = inject("scroll-bar-wrap", {}), n = computed(() => As[e.vertical ? "vertical" : "horizontal"]), l = ref({}), s = ref(), f = (
|
|
10508
|
+
const o = getCurrentInstance(), t = ref(), a = inject("scroll-bar-wrap", {}), n = computed(() => As[e.vertical ? "vertical" : "horizontal"]), l = ref({}), s = ref(), f = (m) => {
|
|
10461
10509
|
var _window$getSelection;
|
|
10462
|
-
|
|
10463
|
-
}, r = (
|
|
10510
|
+
m.ctrlKey || m.button === 2 || ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 || _window$getSelection.removeAllRanges(), i(m), l.value[n.value.axis] = m.currentTarget[n.value.offset] - (m[n.value.client] - m.currentTarget.getBoundingClientRect()[n.value.direction]));
|
|
10511
|
+
}, r = (m) => {
|
|
10464
10512
|
var _o$vnode$el;
|
|
10465
|
-
const
|
|
10466
|
-
a.value[n.value.scroll] =
|
|
10467
|
-
}, i = (
|
|
10468
|
-
|
|
10469
|
-
},
|
|
10513
|
+
const h = (Math.abs(m.target.getBoundingClientRect()[n.value.direction] - m[n.value.client]) - t.value[n.value.offset] / 2) * 100 / (o === null || o === void 0 || (_o$vnode$el = o.vnode.el) === null || _o$vnode$el === void 0 ? void 0 : _o$vnode$el[n.value.offset]);
|
|
10514
|
+
a.value[n.value.scroll] = h * a.value[n.value.scrollSize] / 100;
|
|
10515
|
+
}, i = (m) => {
|
|
10516
|
+
m.stopImmediatePropagation(), s.value = !0, ha(document, "mousemove", _), ha(document, "mouseup", k), document.onselectstart = () => !1;
|
|
10517
|
+
}, _ = (m) => {
|
|
10470
10518
|
var _o$vnode$el2, _o$vnode$el3;
|
|
10471
10519
|
if (s.value === !1) return;
|
|
10472
10520
|
const d = l.value[n.value.axis];
|
|
10473
10521
|
if (!d) return;
|
|
10474
|
-
const c = (((o === null || o === void 0 || (_o$vnode$el2 = o.vnode.el) === null || _o$vnode$el2 === void 0 ? void 0 : _o$vnode$el2.getBoundingClientRect()[n.value.direction]) -
|
|
10522
|
+
const c = (((o === null || o === void 0 || (_o$vnode$el2 = o.vnode.el) === null || _o$vnode$el2 === void 0 ? void 0 : _o$vnode$el2.getBoundingClientRect()[n.value.direction]) - m[n.value.client]) * -1 - (t.value[n.value.offset] - d)) * 100 / (o === null || o === void 0 || (_o$vnode$el3 = o.vnode.el) === null || _o$vnode$el3 === void 0 ? void 0 : _o$vnode$el3[n.value.offset]);
|
|
10475
10523
|
a.value[n.value.scroll] = c * a.value[n.value.scrollSize] / 100;
|
|
10476
10524
|
};
|
|
10477
|
-
function
|
|
10478
|
-
s.value = !1, l.value[n.value.axis] = 0, ba(document, "mousemove",
|
|
10525
|
+
function k() {
|
|
10526
|
+
s.value = !1, l.value[n.value.axis] = 0, ba(document, "mousemove", _), document.onselectstart = null;
|
|
10479
10527
|
}
|
|
10480
10528
|
return onUnmounted(() => {
|
|
10481
|
-
ba(document, "mouseup",
|
|
10529
|
+
ba(document, "mouseup", k);
|
|
10482
10530
|
}), () => h("div", {
|
|
10483
10531
|
class: ["scrollbar__bar", "is-" + n.value.key],
|
|
10484
10532
|
onMousedown: r
|
|
@@ -10535,14 +10583,14 @@ var init_index_es = __esmMin((() => {
|
|
|
10535
10583
|
e.native || (n.value = unref(l).scrollTop * 100 / unref(l).clientHeight, a.value = unref(l).scrollLeft * 100 / unref(l).clientWidth);
|
|
10536
10584
|
}, i = () => {
|
|
10537
10585
|
if (!unref(l)) return;
|
|
10538
|
-
const
|
|
10539
|
-
t.value =
|
|
10540
|
-
},
|
|
10586
|
+
const m = unref(l).clientHeight * 100 / unref(l).scrollHeight, d = unref(l).clientWidth * 100 / unref(l).scrollWidth;
|
|
10587
|
+
t.value = m < 100 ? m + "%" : "", o.value = d < 100 ? d + "%" : "";
|
|
10588
|
+
}, _ = (m) => {
|
|
10541
10589
|
const d = unref(l);
|
|
10542
|
-
d && (typeof
|
|
10543
|
-
},
|
|
10590
|
+
d && (typeof m == "number" ? d.scrollTop = m : d.scrollTo(m));
|
|
10591
|
+
}, k = (m) => {
|
|
10544
10592
|
const d = unref(l);
|
|
10545
|
-
d && (d.scrollTop =
|
|
10593
|
+
d && (d.scrollTop = m);
|
|
10546
10594
|
};
|
|
10547
10595
|
return onMounted(() => {
|
|
10548
10596
|
e.native || (nextTick(i), e.noresize || (ga(unref(s), i), ga(unref(l), i), addEventListener("resize", i)));
|
|
@@ -10558,8 +10606,8 @@ var init_index_es = __esmMin((() => {
|
|
|
10558
10606
|
resize: s,
|
|
10559
10607
|
update: i,
|
|
10560
10608
|
handleScroll: r,
|
|
10561
|
-
scrollTo:
|
|
10562
|
-
setScrollTop:
|
|
10609
|
+
scrollTo: _,
|
|
10610
|
+
setScrollTop: k
|
|
10563
10611
|
};
|
|
10564
10612
|
}
|
|
10565
10613
|
});
|
|
@@ -10616,8 +10664,8 @@ var init_index_es = __esmMin((() => {
|
|
|
10616
10664
|
function r() {
|
|
10617
10665
|
f.value || a("select", t.node);
|
|
10618
10666
|
}
|
|
10619
|
-
return (i,
|
|
10620
|
-
const
|
|
10667
|
+
return (i, _) => {
|
|
10668
|
+
const k = resolveComponent("RdoTreeSelectNode", !0);
|
|
10621
10669
|
return openBlock(), createElementBlock("div", Tr, [createElementVNode("div", {
|
|
10622
10670
|
class: normalizeClass(["rdo-tree-select-node__row", {
|
|
10623
10671
|
selected: s.value,
|
|
@@ -10630,22 +10678,22 @@ var init_index_es = __esmMin((() => {
|
|
|
10630
10678
|
}, [n.value ? (openBlock(), createElementBlock("span", {
|
|
10631
10679
|
key: 0,
|
|
10632
10680
|
class: normalizeClass(["rdo-tree-select-node__switcher", { expanded: l.value }]),
|
|
10633
|
-
onClick:
|
|
10681
|
+
onClick: _[0] || (_[0] = withModifiers((m) => a("toggle", e.node.key), ["stop"]))
|
|
10634
10682
|
}, [createVNode(unref(ae), {
|
|
10635
10683
|
icon: "icon-arrow_zhankai",
|
|
10636
10684
|
color: "#212528",
|
|
10637
10685
|
size: "13",
|
|
10638
10686
|
version: "v2"
|
|
10639
|
-
})], 2)) : (openBlock(), createElementBlock("span", qr)), createElementVNode("span", Vr, [createElementVNode("span", Lr, toDisplayString(e.node.title), 1), e.node.isDefault && !n.value ? (openBlock(), createElementBlock("span", $r, "默认")) : createCommentVNode("", !0)])], 6), n.value && l.value ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(e.node.children, (
|
|
10640
|
-
key:
|
|
10641
|
-
node:
|
|
10687
|
+
})], 2)) : (openBlock(), createElementBlock("span", qr)), createElementVNode("span", Vr, [createElementVNode("span", Lr, toDisplayString(e.node.title), 1), e.node.isDefault && !n.value ? (openBlock(), createElementBlock("span", $r, "默认")) : createCommentVNode("", !0)])], 6), n.value && l.value ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(e.node.children, (m) => (openBlock(), createBlock(k, {
|
|
10688
|
+
key: m.key,
|
|
10689
|
+
node: m,
|
|
10642
10690
|
level: e.level + 1,
|
|
10643
10691
|
"expanded-keys": e.expandedKeys,
|
|
10644
10692
|
"selected-key": e.selectedKey,
|
|
10645
10693
|
"disabled-parent": e.disabledParent,
|
|
10646
10694
|
"parent-to-default": e.parentToDefault,
|
|
10647
|
-
onToggle:
|
|
10648
|
-
onSelect:
|
|
10695
|
+
onToggle: _[1] || (_[1] = (d) => a("toggle", d)),
|
|
10696
|
+
onSelect: _[2] || (_[2] = (d) => a("select", d))
|
|
10649
10697
|
}, null, 8, [
|
|
10650
10698
|
"node",
|
|
10651
10699
|
"level",
|
|
@@ -10739,11 +10787,11 @@ var init_index_es = __esmMin((() => {
|
|
|
10739
10787
|
const r = this.cacheMap.get(l);
|
|
10740
10788
|
if (r && r.expireAt > s) return this.log("info", `[cache] 命中缓存: ${l}`), r.data;
|
|
10741
10789
|
if (r && this.cacheMap.delete(l), this.pendingMap.has(l)) return this.log("warn", `[pending] 返回进行中的 Promise: ${l}`), this.pendingMap.get(l);
|
|
10742
|
-
const i = a(t).then((
|
|
10743
|
-
data:
|
|
10790
|
+
const i = a(t).then((_) => (this.cacheMap.size >= this.maxCacheSize && (this.log("debug", "[cache] 缓存已满,执行清理"), this.clearExpiredFirst()), this.cacheMap.set(l, {
|
|
10791
|
+
data: _,
|
|
10744
10792
|
expireAt: Date.now() + f
|
|
10745
|
-
}),
|
|
10746
|
-
throw this.log("error", `[request] 请求失败: ${l}`,
|
|
10793
|
+
}), _)).catch((_) => {
|
|
10794
|
+
throw this.log("error", `[request] 请求失败: ${l}`, _), _;
|
|
10747
10795
|
}).finally(() => {
|
|
10748
10796
|
this.pendingMap.delete(l);
|
|
10749
10797
|
});
|
|
@@ -10936,11 +10984,11 @@ var init_index_es = __esmMin((() => {
|
|
|
10936
10984
|
"change"
|
|
10937
10985
|
],
|
|
10938
10986
|
setup(e, { emit: o }) {
|
|
10939
|
-
const t = e, a = o, n = ref(), l = ref(), s = ref(), f = ref(), r = ref(!1), i = ref(!1),
|
|
10987
|
+
const t = e, a = o, n = ref(), l = ref(), s = ref(), f = ref(), r = ref(!1), i = ref(!1), _ = ref(!1), k = ref({}), m = ref(!1), d = ref([]), S = ref(1), h = ref(""), c = ref(""), g = ref({ text: "" }), { treeData: C, loadOptions: y, ensureSelectedNode: R, getNodeDisplay: T, initByValue: q, findChildNode: O, findParentNode: $, resetTreeData: A } = Hr({
|
|
10940
10988
|
modelKey: t.modelKey,
|
|
10941
10989
|
modelCategory: t.modelCategory,
|
|
10942
10990
|
getQueryData: () => t.queryData
|
|
10943
|
-
}),
|
|
10991
|
+
}), V = computed(() => t.modelValue || void 0), M = computed(() => g.value.text || ""), L = computed(() => t.allowClear && !t.disabled && !r.value && M.value && _.value ? "clear" : r.value ? "search" : "arrow"), N = computed(() => t.allowClear && !t.disabled && V.value && _.value ? "clear" : "arrow"), J = computed(() => t.disabledParent ? C.value : C.value.map((Y) => ({
|
|
10944
10992
|
...Y,
|
|
10945
10993
|
disabled: !1
|
|
10946
10994
|
})));
|
|
@@ -10948,14 +10996,14 @@ var init_index_es = __esmMin((() => {
|
|
|
10948
10996
|
g.value = Y;
|
|
10949
10997
|
}
|
|
10950
10998
|
function E() {
|
|
10951
|
-
if (!
|
|
10999
|
+
if (!V.value) {
|
|
10952
11000
|
oe({
|
|
10953
11001
|
text: "",
|
|
10954
11002
|
showDefaultTag: !1
|
|
10955
11003
|
});
|
|
10956
11004
|
return;
|
|
10957
11005
|
}
|
|
10958
|
-
const Y =
|
|
11006
|
+
const Y = T(V.value, t.parentToDefault);
|
|
10959
11007
|
Y.text && oe({
|
|
10960
11008
|
text: Y.text,
|
|
10961
11009
|
showDefaultTag: Y.showDefaultTag ?? !1
|
|
@@ -10965,14 +11013,14 @@ var init_index_es = __esmMin((() => {
|
|
|
10965
11013
|
d.value = J.value.filter((Y) => !Y.isLoadMore).map((Y) => Y.key);
|
|
10966
11014
|
}
|
|
10967
11015
|
async function ne() {
|
|
10968
|
-
if (!
|
|
11016
|
+
if (!V.value) {
|
|
10969
11017
|
oe({
|
|
10970
11018
|
text: "",
|
|
10971
11019
|
showDefaultTag: !1
|
|
10972
11020
|
});
|
|
10973
11021
|
return;
|
|
10974
11022
|
}
|
|
10975
|
-
const Y = await
|
|
11023
|
+
const Y = await q(V.value, t.pageSize, t.parentToDefault);
|
|
10976
11024
|
if (Y === null || Y === void 0 ? void 0 : Y.text) {
|
|
10977
11025
|
oe(Y);
|
|
10978
11026
|
return;
|
|
@@ -10980,24 +11028,24 @@ var init_index_es = __esmMin((() => {
|
|
|
10980
11028
|
E();
|
|
10981
11029
|
}
|
|
10982
11030
|
async function me(Y = !0) {
|
|
10983
|
-
|
|
11031
|
+
m.value = !0;
|
|
10984
11032
|
try {
|
|
10985
|
-
Y && (S.value = 1), await
|
|
11033
|
+
Y && (S.value = 1), await y({
|
|
10986
11034
|
pageNo: S.value,
|
|
10987
11035
|
pageSize: t.pageSize,
|
|
10988
11036
|
keyword: t.showSearch && c.value || void 0
|
|
10989
11037
|
}), Y && X(), E();
|
|
10990
11038
|
} finally {
|
|
10991
|
-
|
|
11039
|
+
m.value = !1;
|
|
10992
11040
|
}
|
|
10993
11041
|
}
|
|
10994
11042
|
const ue = debounce(() => {
|
|
10995
|
-
c.value =
|
|
11043
|
+
c.value = h.value.trim(), me(!0);
|
|
10996
11044
|
}, 300);
|
|
10997
11045
|
function Q() {
|
|
10998
11046
|
if (!n.value) return;
|
|
10999
11047
|
const Y = n.value.getBoundingClientRect(), se = t.popperWidth ?? Y.width;
|
|
11000
|
-
|
|
11048
|
+
k.value = {
|
|
11001
11049
|
position: "fixed",
|
|
11002
11050
|
top: `${Y.bottom + 4}px`,
|
|
11003
11051
|
left: `${Y.left}px`,
|
|
@@ -11008,33 +11056,33 @@ var init_index_es = __esmMin((() => {
|
|
|
11008
11056
|
async function Se(Y = {}) {
|
|
11009
11057
|
const { forceRefresh: se = !1 } = Y;
|
|
11010
11058
|
if (c.value) {
|
|
11011
|
-
await me(!0), await
|
|
11059
|
+
await me(!0), await R(V.value), E();
|
|
11012
11060
|
return;
|
|
11013
11061
|
}
|
|
11014
11062
|
if (se) {
|
|
11015
|
-
|
|
11063
|
+
A(), await me(!0), await R(V.value), E();
|
|
11016
11064
|
return;
|
|
11017
11065
|
}
|
|
11018
|
-
if (!
|
|
11019
|
-
await me(!0), await
|
|
11066
|
+
if (!C.value.length) {
|
|
11067
|
+
await me(!0), await R(V.value), E();
|
|
11020
11068
|
return;
|
|
11021
11069
|
}
|
|
11022
|
-
X(), E(), await
|
|
11070
|
+
X(), E(), await R(V.value), E();
|
|
11023
11071
|
}
|
|
11024
11072
|
async function ce() {
|
|
11025
11073
|
var _l$value8;
|
|
11026
|
-
t.disabled || (Q(), r.value = !0,
|
|
11074
|
+
t.disabled || (Q(), r.value = !0, h.value = "", c.value = "", await Se({ forceRefresh: !0 }), await nextTick(), (_l$value8 = l.value) === null || _l$value8 === void 0 || _l$value8.focus());
|
|
11027
11075
|
}
|
|
11028
11076
|
function Ie() {
|
|
11029
|
-
ue.cancel(), r.value = !1,
|
|
11077
|
+
ue.cancel(), r.value = !1, h.value = "", c.value = "";
|
|
11030
11078
|
}
|
|
11031
11079
|
function kt() {
|
|
11032
11080
|
t.disabled || r.value || ce();
|
|
11033
11081
|
}
|
|
11034
|
-
function
|
|
11035
|
-
|
|
11082
|
+
function Bt(Y) {
|
|
11083
|
+
h.value = Y.target.value, ue();
|
|
11036
11084
|
}
|
|
11037
|
-
function
|
|
11085
|
+
function zt() {
|
|
11038
11086
|
St(), Ie();
|
|
11039
11087
|
}
|
|
11040
11088
|
function tt(Y) {
|
|
@@ -11046,10 +11094,10 @@ var init_index_es = __esmMin((() => {
|
|
|
11046
11094
|
function at() {
|
|
11047
11095
|
r.value && Q();
|
|
11048
11096
|
}
|
|
11049
|
-
async function
|
|
11097
|
+
async function Ft() {
|
|
11050
11098
|
i.value = !0, await Se();
|
|
11051
11099
|
}
|
|
11052
|
-
function
|
|
11100
|
+
function Nt() {
|
|
11053
11101
|
i.value = !1;
|
|
11054
11102
|
}
|
|
11055
11103
|
async function dt() {
|
|
@@ -11059,7 +11107,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11059
11107
|
const se = new Set(d.value);
|
|
11060
11108
|
se.has(Y) ? se.delete(Y) : se.add(Y), d.value = Array.from(se);
|
|
11061
11109
|
}
|
|
11062
|
-
function
|
|
11110
|
+
function Dt(Y) {
|
|
11063
11111
|
var _Y$_info;
|
|
11064
11112
|
const se = String(Y.rawValue ?? Y.key), [, Ve] = se.split(":");
|
|
11065
11113
|
return t.parentToDefault && !Ve && ((_Y$_info = Y._info) === null || _Y$_info === void 0 ? void 0 : _Y$_info.id_) ? `${se}:${Y._info.id_}` : se;
|
|
@@ -11071,13 +11119,13 @@ var init_index_es = __esmMin((() => {
|
|
|
11071
11119
|
return;
|
|
11072
11120
|
}
|
|
11073
11121
|
if (Y.disabled && t.disabledParent) return;
|
|
11074
|
-
const se =
|
|
11122
|
+
const se = Dt(Y);
|
|
11075
11123
|
if (!se.includes(":") && t.disabledParent) return;
|
|
11076
|
-
const Ve = Ar(se, Y,
|
|
11124
|
+
const Ve = Ar(se, Y, O, $, t.parentToDefault);
|
|
11077
11125
|
oe(Ve), a("update:modelValue", se), a("update:fullPathValue", se), a("change", se, Y, Ve), t.showSearch ? Ie() : (_f$value = f.value) === null || _f$value === void 0 || (_f$value$hide = _f$value.hide) === null || _f$value$hide === void 0 || _f$value$hide.call(_f$value);
|
|
11078
11126
|
}
|
|
11079
11127
|
function St() {
|
|
11080
|
-
ue.cancel(),
|
|
11128
|
+
ue.cancel(), h.value = "", c.value = "", oe({
|
|
11081
11129
|
text: "",
|
|
11082
11130
|
showDefaultTag: !1
|
|
11083
11131
|
}), a("update:modelValue", null), a("update:fullPathValue", null), a("change", null);
|
|
@@ -11087,12 +11135,12 @@ var init_index_es = __esmMin((() => {
|
|
|
11087
11135
|
oe({
|
|
11088
11136
|
text: "",
|
|
11089
11137
|
showDefaultTag: !1
|
|
11090
|
-
}),
|
|
11138
|
+
}), h.value = "";
|
|
11091
11139
|
return;
|
|
11092
11140
|
}
|
|
11093
11141
|
(t.showSearch ? r.value : i.value) || ne();
|
|
11094
11142
|
}), onMounted(() => {
|
|
11095
|
-
|
|
11143
|
+
V.value && ne(), t.showSearch && (document.addEventListener("click", tt, !0), window.addEventListener("resize", at), window.addEventListener("scroll", at, !0));
|
|
11096
11144
|
}), onBeforeUnmount(() => {
|
|
11097
11145
|
t.showSearch && (document.removeEventListener("click", tt, !0), window.removeEventListener("resize", at), window.removeEventListener("scroll", at, !0));
|
|
11098
11146
|
}), (Y, se) => e.showSearch ? (openBlock(), createElementBlock("div", {
|
|
@@ -11103,28 +11151,28 @@ var init_index_es = __esmMin((() => {
|
|
|
11103
11151
|
}, [createElementVNode("div", {
|
|
11104
11152
|
class: normalizeClass(["rdo-tree-select__trigger rdo-tree-select__trigger--searchable", { open: r.value }]),
|
|
11105
11153
|
onClick: kt,
|
|
11106
|
-
onMouseenter: se[1] || (se[1] = (Ve) =>
|
|
11107
|
-
onMouseleave: se[2] || (se[2] = (Ve) =>
|
|
11108
|
-
}, [createElementVNode("div", { class: normalizeClass(["rdo-tree-select__field", { "is-open": r.value }]) }, [r.value ? (openBlock(), createElementBlock("div", jr, [
|
|
11154
|
+
onMouseenter: se[1] || (se[1] = (Ve) => _.value = !0),
|
|
11155
|
+
onMouseleave: se[2] || (se[2] = (Ve) => _.value = !1)
|
|
11156
|
+
}, [createElementVNode("div", { class: normalizeClass(["rdo-tree-select__field", { "is-open": r.value }]) }, [r.value ? (openBlock(), createElementBlock("div", jr, [M.value && !h.value ? (openBlock(), createElementBlock("div", Wr, [createElementVNode("span", Zr, toDisplayString(M.value), 1), g.value.showDefaultTag ? (openBlock(), createElementBlock("span", Gr, "默认")) : createCommentVNode("", !0)])) : createCommentVNode("", !0), createElementVNode("input", {
|
|
11109
11157
|
ref_key: "inputRef",
|
|
11110
11158
|
ref: l,
|
|
11111
|
-
class: normalizeClass(["rdo-tree-select__input", { "has-mirror": !!
|
|
11159
|
+
class: normalizeClass(["rdo-tree-select__input", { "has-mirror": !!M.value && !h.value }]),
|
|
11112
11160
|
type: "text",
|
|
11113
|
-
value:
|
|
11114
|
-
placeholder:
|
|
11161
|
+
value: h.value,
|
|
11162
|
+
placeholder: M.value ? "" : e.placeholder,
|
|
11115
11163
|
disabled: e.disabled,
|
|
11116
|
-
onInput:
|
|
11164
|
+
onInput: Bt,
|
|
11117
11165
|
onKeydown: [withKeys(withModifiers(Ie, ["stop"]), ["esc"]), withKeys(Ie, ["tab"])]
|
|
11118
|
-
}, null, 42, Xr)])) : (openBlock(), createElementBlock("span", Jr, [createElementVNode("span", { class: normalizeClass(["rdo-tree-select__value-text", { "is-placeholder": !
|
|
11166
|
+
}, null, 42, Xr)])) : (openBlock(), createElementBlock("span", Jr, [createElementVNode("span", { class: normalizeClass(["rdo-tree-select__value-text", { "is-placeholder": !M.value }]) }, toDisplayString(M.value || e.placeholder), 3), g.value.showDefaultTag ? (openBlock(), createElementBlock("span", Qr, "默认")) : createCommentVNode("", !0)]))], 2), L.value === "clear" ? (openBlock(), createElementBlock("span", {
|
|
11119
11167
|
key: 0,
|
|
11120
11168
|
class: "rdo-tree-select__clear",
|
|
11121
11169
|
onMousedown: se[0] || (se[0] = withModifiers(() => {}, ["prevent"])),
|
|
11122
|
-
onClick: withModifiers(
|
|
11170
|
+
onClick: withModifiers(zt, ["stop"])
|
|
11123
11171
|
}, [createVNode(unref(ae), {
|
|
11124
11172
|
icon: "icon-cuowu2",
|
|
11125
11173
|
color: "rgba(0, 0, 0, 0.25)",
|
|
11126
11174
|
size: "14"
|
|
11127
|
-
})], 32)) :
|
|
11175
|
+
})], 32)) : L.value === "search" ? (openBlock(), createElementBlock("span", Yr, [createVNode(unref(ae), {
|
|
11128
11176
|
icon: "icon-sousuo",
|
|
11129
11177
|
color: "rgba(0, 0, 0, 0.45)",
|
|
11130
11178
|
size: "14"
|
|
@@ -11137,13 +11185,13 @@ var init_index_es = __esmMin((() => {
|
|
|
11137
11185
|
ref_key: "searchDropdownRef",
|
|
11138
11186
|
ref: s,
|
|
11139
11187
|
class: "rdo-tree-select__dropdown",
|
|
11140
|
-
style: normalizeStyle(
|
|
11188
|
+
style: normalizeStyle(k.value),
|
|
11141
11189
|
onMousedown: se[3] || (se[3] = withModifiers(() => {}, ["prevent"]))
|
|
11142
11190
|
}, [createVNode(wa, {
|
|
11143
11191
|
"display-tree-data": J.value,
|
|
11144
11192
|
"expanded-keys": d.value,
|
|
11145
|
-
"inner-value":
|
|
11146
|
-
loading:
|
|
11193
|
+
"inner-value": V.value,
|
|
11194
|
+
loading: m.value,
|
|
11147
11195
|
"disabled-parent": e.disabledParent,
|
|
11148
11196
|
"parent-to-default": e.parentToDefault,
|
|
11149
11197
|
"empty-text": c.value ? "暂无搜索" : "暂无数据",
|
|
@@ -11167,8 +11215,8 @@ var init_index_es = __esmMin((() => {
|
|
|
11167
11215
|
distance: 4,
|
|
11168
11216
|
placement: "bottom-start",
|
|
11169
11217
|
disabled: e.disabled,
|
|
11170
|
-
onShow:
|
|
11171
|
-
onHide:
|
|
11218
|
+
onShow: Ft,
|
|
11219
|
+
onHide: Nt
|
|
11172
11220
|
}, {
|
|
11173
11221
|
popper: withCtx(() => [createElementVNode("div", {
|
|
11174
11222
|
class: "rdo-tree-select__popper",
|
|
@@ -11176,8 +11224,8 @@ var init_index_es = __esmMin((() => {
|
|
|
11176
11224
|
}, [createVNode(wa, {
|
|
11177
11225
|
"display-tree-data": J.value,
|
|
11178
11226
|
"expanded-keys": d.value,
|
|
11179
|
-
"inner-value":
|
|
11180
|
-
loading:
|
|
11227
|
+
"inner-value": V.value,
|
|
11228
|
+
loading: m.value,
|
|
11181
11229
|
"disabled-parent": e.disabledParent,
|
|
11182
11230
|
"parent-to-default": e.parentToDefault,
|
|
11183
11231
|
onToggle: Ct,
|
|
@@ -11193,13 +11241,13 @@ var init_index_es = __esmMin((() => {
|
|
|
11193
11241
|
])], 4)]),
|
|
11194
11242
|
default: withCtx(() => [createElementVNode("div", {
|
|
11195
11243
|
class: normalizeClass(["rdo-tree-select__trigger", { active: i.value }]),
|
|
11196
|
-
onMouseenter: se[5] || (se[5] = (Ve) =>
|
|
11197
|
-
onMouseleave: se[6] || (se[6] = (Ve) =>
|
|
11244
|
+
onMouseenter: se[5] || (se[5] = (Ve) => _.value = !0),
|
|
11245
|
+
onMouseleave: se[6] || (se[6] = (Ve) => _.value = !1)
|
|
11198
11246
|
}, [g.value.text ? (openBlock(), createElementBlock("span", {
|
|
11199
11247
|
key: 0,
|
|
11200
11248
|
class: "rdo-tree-select__value",
|
|
11201
11249
|
title: g.value.text
|
|
11202
|
-
}, [createElementVNode("span", ai, toDisplayString(g.value.text), 1), g.value.showDefaultTag ? (openBlock(), createElementBlock("span", oi, "默认")) : createCommentVNode("", !0)], 8, ti)) : (openBlock(), createElementBlock("span", ni, toDisplayString(e.placeholder), 1)),
|
|
11250
|
+
}, [createElementVNode("span", ai, toDisplayString(g.value.text), 1), g.value.showDefaultTag ? (openBlock(), createElementBlock("span", oi, "默认")) : createCommentVNode("", !0)], 8, ti)) : (openBlock(), createElementBlock("span", ni, toDisplayString(e.placeholder), 1)), N.value === "clear" ? (openBlock(), createElementBlock("span", {
|
|
11203
11251
|
key: 2,
|
|
11204
11252
|
class: "rdo-tree-select__clear",
|
|
11205
11253
|
onMousedown: se[4] || (se[4] = withModifiers(() => {}, ["prevent"])),
|
|
@@ -11224,7 +11272,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11224
11272
|
ji = ["innerHTML"];
|
|
11225
11273
|
Wi = { class: "gct-form-base-common-help" };
|
|
11226
11274
|
Zi = ["src"];
|
|
11227
|
-
|
|
11275
|
+
Gt = /* @__PURE__ */ G$1(/* @__PURE__ */ defineComponent({
|
|
11228
11276
|
__name: "Help",
|
|
11229
11277
|
props: { info: {} },
|
|
11230
11278
|
setup(e) {
|
|
@@ -11262,7 +11310,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11262
11310
|
return (o, t) => (openBlock(), createElementBlock("div", Xi, [createElementVNode("div", Ji, [renderSlot(o.$slots, "default", {}, void 0, !0), e.description ? (openBlock(), createElementBlock("span", Qi, toDisplayString(e.description), 1)) : createCommentVNode("", !0)]), o.$slots.right ? (openBlock(), createElementBlock("div", Yi, [renderSlot(o.$slots, "right", {}, void 0, !0)])) : createCommentVNode("", !0)]));
|
|
11263
11311
|
}
|
|
11264
11312
|
}), [["__scopeId", "data-v-8aa5da31"]]);
|
|
11265
|
-
|
|
11313
|
+
Jt = /* @__PURE__ */ ((e) => (e.Lot = "lot", e.UniqueCode = "uniqueCode", e))(Jt || {});
|
|
11266
11314
|
xf = "data:image/svg+xml,%3csvg%20width='1em'%20height='1em'%20fill='currentColor'%20aria-hidden='true'%20viewBox='64%2064%20896%20896'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M290%20236.4l43.9-43.9a8.01%208.01%200%2000-4.7-13.6L169%20160c-5.1-.6-9.5%203.7-8.9%208.9L179%20329.1c.8%206.6%208.9%209.4%2013.6%204.7l43.7-43.7L370%20423.7c3.1%203.1%208.2%203.1%2011.3%200l42.4-42.3c3.1-3.1%203.1-8.2%200-11.3L290%20236.4zm352.7%20187.3c3.1%203.1%208.2%203.1%2011.3%200l133.7-133.6%2043.7%2043.7a8.01%208.01%200%200013.6-4.7L863.9%20169c.6-5.1-3.7-9.5-8.9-8.9L694.8%20179c-6.6.8-9.4%208.9-4.7%2013.6l43.9%2043.9L600.3%20370a8.03%208.03%200%20000%2011.3l42.4%2042.4zM845%20694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7%2043.7L654%20600.3a8.03%208.03%200%2000-11.3%200l-42.4%2042.3a8.03%208.03%200%20000%2011.3L734%20787.6l-43.9%2043.9a8.01%208.01%200%20004.7%2013.6L855%20864c5.1.6%209.5-3.7%208.9-8.9L845%20694.9zm-463.7-94.6a8.03%208.03%200%2000-11.3%200L236.3%20733.9l-43.7-43.7a8.01%208.01%200%2000-13.6%204.7L160.1%20855c-.6%205.1%203.7%209.5%208.9%208.9L329.2%20845c6.6-.8%209.4-8.9%204.7-13.6L290%20787.6%20423.7%20654c3.1-3.1%203.1-8.2%200-11.3l-42.4-42.4z'%3e%3c/path%3e%3c/svg%3e";
|
|
11267
11315
|
Sf = "data:image/svg+xml,%3csvg%20width='1em'%20height='1em'%20fill='currentColor'%20aria-hidden='true'%20viewBox='64%2064%20896%20896'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M391%20240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7%2043.7L200%20146.3a8.03%208.03%200%2000-11.3%200l-42.4%2042.3a8.03%208.03%200%20000%2011.3L280%20333.6l-43.9%2043.9a8.01%208.01%200%20004.7%2013.6L401%20410c5.1.6%209.5-3.7%208.9-8.9L391%20240.9zm10.1%20373.2L240.8%20633c-6.6.8-9.4%208.9-4.7%2013.6l43.9%2043.9L146.3%20824a8.03%208.03%200%20000%2011.3l42.4%2042.3c3.1%203.1%208.2%203.1%2011.3%200L333.7%20744l43.7%2043.7A8.01%208.01%200%2000391%20783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2%20391c6.6-.8%209.4-8.9%204.7-13.6L744%20333.6%20877.7%20200c3.1-3.1%203.1-8.2%200-11.3l-42.4-42.3a8.03%208.03%200%2000-11.3%200L690.3%20279.9l-43.7-43.7a8.01%208.01%200%2000-13.6%204.7L614.1%20401c-.6%205.2%203.7%209.5%208.8%208.9zM744%20690.4l43.9-43.9a8.01%208.01%200%2000-4.7-13.6L623%20614c-5.1-.6-9.5%203.7-8.9%208.9L633%20783.1c.8%206.6%208.9%209.4%2013.6%204.7l43.7-43.7L824%20877.7c3.1%203.1%208.2%203.1%2011.3%200l42.4-42.3c3.1-3.1%203.1-8.2%200-11.3L744%20690.4z'%3e%3c/path%3e%3c/svg%3e";
|
|
11268
11316
|
Mf = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%2010.6001C5.55228%2010.6001%206%2011.0478%206%2011.6001C5.99987%2012.1523%205.5522%2012.6001%205%2012.6001C4.4478%2012.6001%204.00013%2012.1523%204%2011.6001C4%2011.0478%204.44772%2010.6001%205%2010.6001ZM9%2010.6001C9.55228%2010.6001%2010%2011.0478%2010%2011.6001C9.99987%2012.1523%209.5522%2012.6001%209%2012.6001C8.4478%2012.6001%208.00013%2012.1523%208%2011.6001C8%2011.0478%208.44772%2010.6001%209%2010.6001ZM5%205.99951C5.55216%205.99951%205.9998%206.4474%206%206.99951C6%207.5518%205.55228%207.99951%205%207.99951C4.44772%207.99951%204%207.5518%204%206.99951C4.0002%206.4474%204.44784%205.99951%205%205.99951ZM9%205.99951C9.55216%205.99951%209.9998%206.4474%2010%206.99951C10%207.5518%209.55228%207.99951%209%207.99951C8.44772%207.99951%208%207.5518%208%206.99951C8.0002%206.4474%208.44784%205.99951%209%205.99951ZM5%201.3999C5.55228%201.3999%206%201.84762%206%202.3999C6%202.95219%205.55228%203.3999%205%203.3999C4.44772%203.3999%204%202.95219%204%202.3999C4%201.84762%204.44772%201.3999%205%201.3999ZM9%201.3999C9.55228%201.3999%2010%201.84762%2010%202.3999C10%202.95219%209.55228%203.3999%209%203.3999C8.44772%203.3999%208%202.95219%208%202.3999C8%201.84762%208.44772%201.3999%209%201.3999Z'%20fill='%238B8B8B'/%3e%3c/svg%3e";
|
|
@@ -11320,60 +11368,60 @@ var init_index_es = __esmMin((() => {
|
|
|
11320
11368
|
x: 0,
|
|
11321
11369
|
y: 0
|
|
11322
11370
|
});
|
|
11323
|
-
let f = 0, r = 0, i = 0,
|
|
11324
|
-
const
|
|
11371
|
+
let f = 0, r = 0, i = 0, _ = 0;
|
|
11372
|
+
const k = computed(() => [
|
|
11325
11373
|
"gct-form-base-modal",
|
|
11326
11374
|
n.wrapClassName,
|
|
11327
11375
|
t.mask ? "" : "gct-form-base-modal--maskless",
|
|
11328
11376
|
l.value ? "gct-form-base-modal--fullscreen" : ""
|
|
11329
|
-
].filter(Boolean).join(" ")),
|
|
11330
|
-
const { title:
|
|
11331
|
-
return
|
|
11377
|
+
].filter(Boolean).join(" ")), m = computed(() => {
|
|
11378
|
+
const { title: y, wrapClassName: R, ...T } = n;
|
|
11379
|
+
return T;
|
|
11332
11380
|
}), d = computed(() => {
|
|
11333
11381
|
if (!(!t.draggable || l.value) && !(s.x === 0 && s.y === 0)) return { transform: `translate(${s.x}px, ${s.y}px)` };
|
|
11334
11382
|
});
|
|
11335
11383
|
function S() {
|
|
11336
11384
|
s.x = 0, s.y = 0;
|
|
11337
11385
|
}
|
|
11338
|
-
function
|
|
11386
|
+
function h() {
|
|
11339
11387
|
t.fullscreen && (l.value = !l.value, S());
|
|
11340
11388
|
}
|
|
11341
|
-
function c(
|
|
11342
|
-
s.x = i +
|
|
11389
|
+
function c(y) {
|
|
11390
|
+
s.x = i + y.clientX - f, s.y = _ + y.clientY - r;
|
|
11343
11391
|
}
|
|
11344
11392
|
function g() {
|
|
11345
11393
|
document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", g);
|
|
11346
11394
|
}
|
|
11347
|
-
function
|
|
11348
|
-
if (!t.draggable || l.value ||
|
|
11349
|
-
const
|
|
11350
|
-
|
|
11395
|
+
function C(y) {
|
|
11396
|
+
if (!t.draggable || l.value || y.button !== 0) return;
|
|
11397
|
+
const R = y.target;
|
|
11398
|
+
R.closest(".ant-modal-header") && (R.closest([
|
|
11351
11399
|
"button",
|
|
11352
11400
|
"a",
|
|
11353
11401
|
"input",
|
|
11354
11402
|
"textarea",
|
|
11355
11403
|
"select",
|
|
11356
11404
|
"[role=\"button\"]"
|
|
11357
|
-
].join(",")) || (f =
|
|
11405
|
+
].join(",")) || (f = y.clientX, r = y.clientY, i = s.x, _ = s.y, document.addEventListener("mousemove", c), document.addEventListener("mouseup", g), y.preventDefault()));
|
|
11358
11406
|
}
|
|
11359
|
-
return watch(() => t.fullscreen, (
|
|
11360
|
-
|
|
11361
|
-
}), watch(() => t.visible, (
|
|
11362
|
-
|
|
11407
|
+
return watch(() => t.fullscreen, (y) => {
|
|
11408
|
+
y || (l.value = !1, S());
|
|
11409
|
+
}), watch(() => t.visible, (y) => {
|
|
11410
|
+
y && (l.value = !1, S());
|
|
11363
11411
|
}), onBeforeUnmount(() => {
|
|
11364
11412
|
g();
|
|
11365
|
-
}), (
|
|
11413
|
+
}), (y, R) => (openBlock(), createBlock(unref(Modal), mergeProps({
|
|
11366
11414
|
centered: "",
|
|
11367
11415
|
"ok-text": "确定",
|
|
11368
11416
|
"cancel-text": "取消",
|
|
11369
11417
|
width: 640
|
|
11370
|
-
},
|
|
11418
|
+
}, m.value, {
|
|
11371
11419
|
visible: e.visible,
|
|
11372
11420
|
mask: e.mask,
|
|
11373
|
-
"wrap-class-name":
|
|
11374
|
-
onCancel:
|
|
11375
|
-
onOk:
|
|
11376
|
-
onAfterClose:
|
|
11421
|
+
"wrap-class-name": k.value,
|
|
11422
|
+
onCancel: R[1] || (R[1] = (T) => a("cancel", T)),
|
|
11423
|
+
onOk: R[2] || (R[2] = (T) => a("ok", T)),
|
|
11424
|
+
onAfterClose: R[3] || (R[3] = (T) => a("afterClose"))
|
|
11377
11425
|
}), createSlots({
|
|
11378
11426
|
title: withCtx(() => [createElementVNode("div", Af, [
|
|
11379
11427
|
e.draggable ? (openBlock(), createElementBlock("img", {
|
|
@@ -11381,29 +11429,29 @@ var init_index_es = __esmMin((() => {
|
|
|
11381
11429
|
src: unref(Mf),
|
|
11382
11430
|
class: "title-draggable"
|
|
11383
11431
|
}, null, 8, Rf)) : createCommentVNode("", !0),
|
|
11384
|
-
renderSlot(
|
|
11432
|
+
renderSlot(y.$slots, "title", {}, () => [createTextVNode(toDisplayString(unref(n).title), 1)]),
|
|
11385
11433
|
e.fullscreen ? (openBlock(), createElementBlock("button", {
|
|
11386
11434
|
key: 1,
|
|
11387
11435
|
type: "button",
|
|
11388
11436
|
class: "form-base-modal__fullscreen",
|
|
11389
11437
|
title: l.value ? "退出全屏" : "全屏",
|
|
11390
|
-
onMousedown:
|
|
11391
|
-
onClick: withModifiers(
|
|
11438
|
+
onMousedown: R[0] || (R[0] = withModifiers(() => {}, ["stop"])),
|
|
11439
|
+
onClick: withModifiers(h, ["stop"])
|
|
11392
11440
|
}, [createElementVNode("img", {
|
|
11393
11441
|
src: l.value ? unref(Sf) : unref(xf),
|
|
11394
11442
|
alt: ""
|
|
11395
11443
|
}, null, 8, Tf)], 40, Of)) : createCommentVNode("", !0)
|
|
11396
11444
|
])]),
|
|
11397
|
-
modalRender: withCtx(({ originVNode:
|
|
11445
|
+
modalRender: withCtx(({ originVNode: T }) => [createElementVNode("div", {
|
|
11398
11446
|
class: normalizeClass(["form-base-modal__render", { "form-base-modal__render--draggable": e.draggable && !l.value }]),
|
|
11399
11447
|
style: normalizeStyle(d.value),
|
|
11400
|
-
onMousedown:
|
|
11401
|
-
}, [(openBlock(), createBlock(resolveDynamicComponent(
|
|
11402
|
-
default: withCtx(() => [renderSlot(
|
|
11448
|
+
onMousedown: C
|
|
11449
|
+
}, [(openBlock(), createBlock(resolveDynamicComponent(T)))], 38)]),
|
|
11450
|
+
default: withCtx(() => [renderSlot(y.$slots, "default")]),
|
|
11403
11451
|
_: 2
|
|
11404
|
-
}, [
|
|
11452
|
+
}, [y.$slots.footer ? {
|
|
11405
11453
|
name: "footer",
|
|
11406
|
-
fn: withCtx(() => [renderSlot(
|
|
11454
|
+
fn: withCtx(() => [renderSlot(y.$slots, "footer")]),
|
|
11407
11455
|
key: "0"
|
|
11408
11456
|
} : void 0]), 1040, [
|
|
11409
11457
|
"visible",
|
|
@@ -11413,7 +11461,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11413
11461
|
}
|
|
11414
11462
|
});
|
|
11415
11463
|
ra = "BOM_ENTRY_MODAL_BIZ";
|
|
11416
|
-
|
|
11464
|
+
Qt = {
|
|
11417
11465
|
FIELD_DISPLAY: 1,
|
|
11418
11466
|
ONLINE_FORM_FIELD_FORMULA: 13
|
|
11419
11467
|
};
|
|
@@ -11435,15 +11483,15 @@ var init_index_es = __esmMin((() => {
|
|
|
11435
11483
|
}),
|
|
11436
11484
|
emits: ["update:formState"],
|
|
11437
11485
|
setup(e) {
|
|
11438
|
-
const o = e, t = useModel(e, "formState"), a = ref([]), n = ref([]), l = ref([]), s = ref(!1), f = ref({}), r = /* @__PURE__ */ new WeakMap(), i = ref({}),
|
|
11439
|
-
let
|
|
11440
|
-
function
|
|
11486
|
+
const o = e, t = useModel(e, "formState"), a = ref([]), n = ref([]), l = ref([]), s = ref(!1), f = ref({}), r = /* @__PURE__ */ new WeakMap(), i = ref({}), _ = ref(!1), k = ref(!1), m = ref(!1), d = ref({}), S = ref({});
|
|
11487
|
+
let h = !1, c, g = !1, C, y = !1;
|
|
11488
|
+
function R(I) {
|
|
11441
11489
|
return [...new Set((I ?? "").split(",").map((H) => H.trim()).filter(Boolean))];
|
|
11442
11490
|
}
|
|
11443
|
-
const
|
|
11491
|
+
const T = computed(() => l.value.map((I) => ({
|
|
11444
11492
|
...I,
|
|
11445
|
-
shopfloorIds:
|
|
11446
|
-
}))),
|
|
11493
|
+
shopfloorIds: R(I.shopfloor_ids_)
|
|
11494
|
+
}))), q = computed(() => new Map(T.value.map((I) => [I.id_, I]))), O = computed(() => T.value.filter((I) => I.operating_state_ === !0));
|
|
11447
11495
|
function $(I) {
|
|
11448
11496
|
return {
|
|
11449
11497
|
label: I.name_ || I.code_ || I.id_,
|
|
@@ -11451,31 +11499,31 @@ var init_index_es = __esmMin((() => {
|
|
|
11451
11499
|
searchText: `${I.name_ ?? ""} ${I.code_ ?? ""}`
|
|
11452
11500
|
};
|
|
11453
11501
|
}
|
|
11454
|
-
function
|
|
11502
|
+
function A(I, H) {
|
|
11455
11503
|
return (H.searchText ?? H.label).toLowerCase().includes(I.trim().toLowerCase());
|
|
11456
11504
|
}
|
|
11457
|
-
function
|
|
11458
|
-
const H =
|
|
11505
|
+
function V(I) {
|
|
11506
|
+
const H = O.value;
|
|
11459
11507
|
let le;
|
|
11460
11508
|
if (!I.shopfloor_id_) le = H.map($);
|
|
11461
11509
|
else {
|
|
11462
11510
|
const we = f.value[I.__key], _e = (we === null || we === void 0 ? void 0 : we.shopfloorId) === I.shopfloor_id_ ? we.warehouses : H.filter((Ke) => Ke.shopfloorIds.includes(I.shopfloor_id_)), Je = H.filter((Ke) => !Ke.shopfloorIds.length);
|
|
11463
11511
|
le = [...new Map([..._e, ...Je].map((Ke) => [Ke.id_, Ke])).values()].map($);
|
|
11464
11512
|
}
|
|
11465
|
-
const ge =
|
|
11513
|
+
const ge = q.value.get(I.warehouse_id_), de = ge ? $(ge) : a.value.find((we) => we.value === I.warehouse_id_);
|
|
11466
11514
|
return de ? E(le, [de]) : le;
|
|
11467
11515
|
}
|
|
11468
|
-
function
|
|
11469
|
-
var
|
|
11470
|
-
const H = ((
|
|
11516
|
+
function M(I) {
|
|
11517
|
+
var _q$value$get;
|
|
11518
|
+
const H = ((_q$value$get = q.value.get(I.warehouse_id_)) === null || _q$value$get === void 0 ? void 0 : _q$value$get.shopfloorIds) ?? [], le = n.value.filter((de) => de.enabled && (!H.length || H.includes(de.value))), ge = n.value.find((de) => de.value === I.shopfloor_id_);
|
|
11471
11519
|
return ge ? E(le, [ge]) : le;
|
|
11472
11520
|
}
|
|
11473
|
-
function
|
|
11521
|
+
function L(I) {
|
|
11474
11522
|
const H = (r.get(I) ?? 0) + 1;
|
|
11475
|
-
return r.set(I, H), delete f.value[I.__key], () => !
|
|
11523
|
+
return r.set(I, H), delete f.value[I.__key], () => !y && r.get(I) === H && t.value.consume_storage_entries_.includes(I) && t.value.consume_enabled_ !== !1 && t.value.consume_source_config_ !== "follow_common_policy";
|
|
11476
11524
|
}
|
|
11477
|
-
async function
|
|
11478
|
-
if (await nextTick(),
|
|
11525
|
+
async function N(I, H, le) {
|
|
11526
|
+
if (await nextTick(), y || !le()) return;
|
|
11479
11527
|
const ge = t.value.consume_storage_entries_.indexOf(I), de = o.form;
|
|
11480
11528
|
if (ge < 0 || !de || !H.length) return;
|
|
11481
11529
|
const we = H.map((_e) => [
|
|
@@ -11538,7 +11586,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11538
11586
|
}), H;
|
|
11539
11587
|
}
|
|
11540
11588
|
async function ue(I) {
|
|
11541
|
-
|
|
11589
|
+
_.value = !0;
|
|
11542
11590
|
try {
|
|
11543
11591
|
const H = await J({
|
|
11544
11592
|
modelKey: "em_warehouse",
|
|
@@ -11546,19 +11594,19 @@ var init_index_es = __esmMin((() => {
|
|
|
11546
11594
|
});
|
|
11547
11595
|
a.value = await X("em_warehouse", H, ne());
|
|
11548
11596
|
} finally {
|
|
11549
|
-
|
|
11597
|
+
_.value = !1;
|
|
11550
11598
|
}
|
|
11551
11599
|
}
|
|
11552
11600
|
async function Q() {
|
|
11553
|
-
if (
|
|
11601
|
+
if (C) return C;
|
|
11554
11602
|
if (!g) {
|
|
11555
|
-
|
|
11603
|
+
k.value = !0, C = (async () => {
|
|
11556
11604
|
const I = await ie.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({
|
|
11557
11605
|
modelCategory: lt,
|
|
11558
11606
|
modelKey: "em_shopfloor",
|
|
11559
11607
|
bsKey: "listAll"
|
|
11560
11608
|
}, {}, {});
|
|
11561
|
-
|
|
11609
|
+
y || (n.value = ((I === null || I === void 0 ? void 0 : I.data) ?? []).map((H) => ({
|
|
11562
11610
|
label: H.name_ || H.code_ || H.id_,
|
|
11563
11611
|
value: H.id_,
|
|
11564
11612
|
searchText: `${H.name_ ?? ""} ${H.code_ ?? ""}`,
|
|
@@ -11566,15 +11614,15 @@ var init_index_es = __esmMin((() => {
|
|
|
11566
11614
|
})), g = !0);
|
|
11567
11615
|
})();
|
|
11568
11616
|
try {
|
|
11569
|
-
await
|
|
11617
|
+
await C;
|
|
11570
11618
|
} finally {
|
|
11571
|
-
|
|
11619
|
+
C = void 0, k.value = !1;
|
|
11572
11620
|
}
|
|
11573
11621
|
}
|
|
11574
11622
|
}
|
|
11575
11623
|
async function Se(I, H) {
|
|
11576
11624
|
if (H) {
|
|
11577
|
-
|
|
11625
|
+
m.value = !0;
|
|
11578
11626
|
try {
|
|
11579
11627
|
const le = await J({
|
|
11580
11628
|
modelKey: "em_location",
|
|
@@ -11586,7 +11634,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11586
11634
|
[H]: await X("em_location", le, me(H))
|
|
11587
11635
|
};
|
|
11588
11636
|
} finally {
|
|
11589
|
-
|
|
11637
|
+
m.value = !1;
|
|
11590
11638
|
}
|
|
11591
11639
|
}
|
|
11592
11640
|
}
|
|
@@ -11596,15 +11644,15 @@ var init_index_es = __esmMin((() => {
|
|
|
11596
11644
|
ue(),
|
|
11597
11645
|
Q(),
|
|
11598
11646
|
Mt()
|
|
11599
|
-
]),
|
|
11647
|
+
]), y) return;
|
|
11600
11648
|
const I = [...new Set(ne().filter(Boolean))];
|
|
11601
11649
|
await Promise.all(I.map((H) => Se("", H)));
|
|
11602
11650
|
} catch {
|
|
11603
|
-
|
|
11651
|
+
y || message.error("消耗库存选项加载失败,请重试");
|
|
11604
11652
|
}
|
|
11605
11653
|
}
|
|
11606
|
-
const Ie = debounce((I) => ue(I), 300), kt = debounce((I, H) => Se(I, H), 300),
|
|
11607
|
-
function
|
|
11654
|
+
const Ie = debounce((I) => ue(I), 300), kt = debounce((I, H) => Se(I, H), 300), Bt = computed(() => i.value[t.value.default_warehouse_id_ ?? ""] ?? []);
|
|
11655
|
+
function zt(I) {
|
|
11608
11656
|
return i.value[I.warehouse_id_ ?? ""] ?? [];
|
|
11609
11657
|
}
|
|
11610
11658
|
function tt(I) {
|
|
@@ -11617,13 +11665,13 @@ var init_index_es = __esmMin((() => {
|
|
|
11617
11665
|
const H = I.warehouse_id_;
|
|
11618
11666
|
return H && S.value[H] === !1 ? [] : tt($t("sys.pageDesigner.fieldCmp.location"));
|
|
11619
11667
|
}
|
|
11620
|
-
const
|
|
11668
|
+
const Ft = [{
|
|
11621
11669
|
value: "follow_common_policy",
|
|
11622
11670
|
label: $t("sys.edhr.mcTable.consumeSourceFollowCommon")
|
|
11623
11671
|
}, {
|
|
11624
11672
|
value: "custom",
|
|
11625
11673
|
label: $t("sys.edhr.mcTable.consumeSourceCustom")
|
|
11626
|
-
}],
|
|
11674
|
+
}], Nt = [
|
|
11627
11675
|
{
|
|
11628
11676
|
title: $t("sys.edhr.mcTable.shopfloor"),
|
|
11629
11677
|
key: "shopfloor_id_",
|
|
@@ -11655,7 +11703,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11655
11703
|
t.value.default_location_id_ = void 0, t.value.default_warehouse_id_ && Se("", t.value.default_warehouse_id_);
|
|
11656
11704
|
}
|
|
11657
11705
|
async function Ct(I) {
|
|
11658
|
-
const H =
|
|
11706
|
+
const H = L(I), le = I.shopfloor_id_;
|
|
11659
11707
|
if (le) try {
|
|
11660
11708
|
const [, ge] = await Promise.all([Mt(), ie.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({
|
|
11661
11709
|
modelCategory: lt,
|
|
@@ -11666,7 +11714,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11666
11714
|
"shopfloor_ids_.containAny": [le]
|
|
11667
11715
|
} })]);
|
|
11668
11716
|
if (!H()) return;
|
|
11669
|
-
const de = ((ge === null || ge === void 0 ? void 0 : ge.data) ?? []).filter((_e) => _e.operating_state_ === !0 &&
|
|
11717
|
+
const de = ((ge === null || ge === void 0 ? void 0 : ge.data) ?? []).filter((_e) => _e.operating_state_ === !0 && R(_e.shopfloor_ids_).includes(le));
|
|
11670
11718
|
f.value[I.__key] = {
|
|
11671
11719
|
shopfloorId: le,
|
|
11672
11720
|
warehouses: de
|
|
@@ -11684,21 +11732,21 @@ var init_index_es = __esmMin((() => {
|
|
|
11684
11732
|
}
|
|
11685
11733
|
if (de.length === 1) {
|
|
11686
11734
|
const _e = I.warehouse_id_ !== de[0].id_;
|
|
11687
|
-
if (_e && (I.warehouse_id_ = de[0].id_, I.location_id_ = void 0), await
|
|
11735
|
+
if (_e && (I.warehouse_id_ = de[0].id_, I.location_id_ = void 0), await N(I, ["warehouse_id_"], H), !H()) return;
|
|
11688
11736
|
_e && await Se("", I.warehouse_id_);
|
|
11689
11737
|
}
|
|
11690
11738
|
} catch {
|
|
11691
11739
|
H() && message.error("加载车间关联仓库失败,请重试");
|
|
11692
11740
|
}
|
|
11693
11741
|
}
|
|
11694
|
-
async function
|
|
11695
|
-
const H =
|
|
11742
|
+
async function Dt(I) {
|
|
11743
|
+
const H = L(I), le = I.warehouse_id_;
|
|
11696
11744
|
I.location_id_ = void 0;
|
|
11697
11745
|
try {
|
|
11698
|
-
var
|
|
11746
|
+
var _q$value$get2;
|
|
11699
11747
|
if (await Promise.all([Mt(), Q()]), !H()) return;
|
|
11700
|
-
const ge = ((
|
|
11701
|
-
if (ge.length && (ge.includes(I.shopfloor_id_) || (I.shopfloor_id_ = ge[0]), await
|
|
11748
|
+
const ge = ((_q$value$get2 = q.value.get(le)) === null || _q$value$get2 === void 0 ? void 0 : _q$value$get2.shopfloorIds) ?? [];
|
|
11749
|
+
if (ge.length && (ge.includes(I.shopfloor_id_) || (I.shopfloor_id_ = ge[0]), await N(I, ["shopfloor_id_"], H), !H())) return;
|
|
11702
11750
|
le && await Se("", le);
|
|
11703
11751
|
} catch {
|
|
11704
11752
|
H() && message.error("加载仓库关联数据失败,请重试");
|
|
@@ -11708,12 +11756,12 @@ var init_index_es = __esmMin((() => {
|
|
|
11708
11756
|
try {
|
|
11709
11757
|
await Mt(!0);
|
|
11710
11758
|
} catch {
|
|
11711
|
-
|
|
11759
|
+
y || message.error("仓库选项加载失败,请重试");
|
|
11712
11760
|
}
|
|
11713
11761
|
}
|
|
11714
11762
|
function St() {
|
|
11715
11763
|
Q().catch(() => {
|
|
11716
|
-
|
|
11764
|
+
y || message.error("车间选项加载失败,请重试");
|
|
11717
11765
|
});
|
|
11718
11766
|
}
|
|
11719
11767
|
function Y() {
|
|
@@ -11740,15 +11788,15 @@ var init_index_es = __esmMin((() => {
|
|
|
11740
11788
|
modelKey: "em_material_loading_policy_global",
|
|
11741
11789
|
bsKey: "getOne"
|
|
11742
11790
|
}, { includeSubModel: 1 }, { query: {} });
|
|
11743
|
-
d.value = I.data || {}, t.value.consume_enabled_ && t.value.consume_source_config_ === "follow_common_policy" &&
|
|
11791
|
+
d.value = I.data || {}, t.value.consume_enabled_ && t.value.consume_source_config_ === "follow_common_policy" && Ut();
|
|
11744
11792
|
}
|
|
11745
11793
|
function Ro(I) {
|
|
11746
|
-
I && (t.value.consume_source_config_ = "follow_common_policy",
|
|
11794
|
+
I && (t.value.consume_source_config_ = "follow_common_policy", Ut());
|
|
11747
11795
|
}
|
|
11748
11796
|
function Oo(I) {
|
|
11749
|
-
I === "follow_common_policy" &&
|
|
11797
|
+
I === "follow_common_policy" && Ut();
|
|
11750
11798
|
}
|
|
11751
|
-
function
|
|
11799
|
+
function Ut() {
|
|
11752
11800
|
f.value = {}, t.value.default_warehouse_id_ = d.value.default_warehouse_id_, t.value.default_location_id_ = d.value.default_location_id_, t.value.consume_storage_entries_ = (d.value.consume_storage_entries_ || []).map((I) => ({
|
|
11753
11801
|
...I,
|
|
11754
11802
|
__key: I.__key || Ze(8)
|
|
@@ -11756,14 +11804,14 @@ var init_index_es = __esmMin((() => {
|
|
|
11756
11804
|
}
|
|
11757
11805
|
async function Mt(I = !1) {
|
|
11758
11806
|
if (c) return c;
|
|
11759
|
-
if (!(
|
|
11807
|
+
if (!(h && !I)) {
|
|
11760
11808
|
s.value = !0, c = (async () => {
|
|
11761
11809
|
const H = await ie.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({
|
|
11762
11810
|
modelCategory: lt,
|
|
11763
11811
|
modelKey: "em_warehouse",
|
|
11764
11812
|
bsKey: "listAll"
|
|
11765
11813
|
}, {}, {});
|
|
11766
|
-
|
|
11814
|
+
y || (l.value = (H === null || H === void 0 ? void 0 : H.data) ?? [], S.value = Object.fromEntries(l.value.map((le) => [le.id_, le.location_management_enabled_])), f.value = {}, h = !0);
|
|
11767
11815
|
})();
|
|
11768
11816
|
try {
|
|
11769
11817
|
await c;
|
|
@@ -11775,7 +11823,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11775
11823
|
return onMounted(() => {
|
|
11776
11824
|
Ao(), ce();
|
|
11777
11825
|
}), onBeforeUnmount(() => {
|
|
11778
|
-
|
|
11826
|
+
y = !0, Ie.cancel(), kt.cancel();
|
|
11779
11827
|
}), (I, H) => {
|
|
11780
11828
|
const le = resolveComponent("a-radio"), ge = resolveComponent("a-radio-group"), de = resolveComponent("a-form-item"), we = resolveComponent("a-select"), _e = resolveComponent("a-col"), Je = resolveComponent("a-row"), da = resolveComponent("a-button"), Ke = resolveComponent("a-table");
|
|
11781
11829
|
return openBlock(), createElementBlock(Fragment, null, [createVNode(de, {
|
|
@@ -11810,7 +11858,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11810
11858
|
value: t.value.consume_source_config_,
|
|
11811
11859
|
"onUpdate:value": H[1] || (H[1] = (ke) => t.value.consume_source_config_ = ke),
|
|
11812
11860
|
placeholder: I.$t("sys.chooseText"),
|
|
11813
|
-
options:
|
|
11861
|
+
options: Ft,
|
|
11814
11862
|
onChange: Oo
|
|
11815
11863
|
}, null, 8, ["value", "placeholder"])]),
|
|
11816
11864
|
_: 1
|
|
@@ -11834,7 +11882,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11834
11882
|
"filter-option": !1,
|
|
11835
11883
|
placeholder: I.$t("sys.chooseText"),
|
|
11836
11884
|
options: a.value,
|
|
11837
|
-
loading:
|
|
11885
|
+
loading: _.value,
|
|
11838
11886
|
disabled: t.value.consume_source_config_ === "follow_common_policy",
|
|
11839
11887
|
onSearch: Ve,
|
|
11840
11888
|
onChange: dt
|
|
@@ -11860,8 +11908,8 @@ var init_index_es = __esmMin((() => {
|
|
|
11860
11908
|
"allow-clear": "",
|
|
11861
11909
|
"filter-option": !1,
|
|
11862
11910
|
placeholder: I.$t("sys.chooseText"),
|
|
11863
|
-
options:
|
|
11864
|
-
loading:
|
|
11911
|
+
options: Bt.value,
|
|
11912
|
+
loading: m.value,
|
|
11865
11913
|
disabled: t.value.consume_source_config_ === "follow_common_policy" || !t.value.default_warehouse_id_ || !S.value[t.value.default_warehouse_id_],
|
|
11866
11914
|
onSearch: H[4] || (H[4] = (ke) => ca(ke, t.value.default_warehouse_id_)),
|
|
11867
11915
|
onFocus: H[5] || (H[5] = () => Se("", t.value.default_warehouse_id_))
|
|
@@ -11890,7 +11938,7 @@ var init_index_es = __esmMin((() => {
|
|
|
11890
11938
|
createVNode(Ke, {
|
|
11891
11939
|
class: "consume-policy-item__storage-table",
|
|
11892
11940
|
"data-source": t.value.consume_storage_entries_,
|
|
11893
|
-
columns:
|
|
11941
|
+
columns: Nt,
|
|
11894
11942
|
pagination: !1,
|
|
11895
11943
|
size: "small",
|
|
11896
11944
|
"row-key": "__key",
|
|
@@ -11914,10 +11962,10 @@ var init_index_es = __esmMin((() => {
|
|
|
11914
11962
|
class: "consume-policy-item__table-select",
|
|
11915
11963
|
"show-search": "",
|
|
11916
11964
|
"allow-clear": "",
|
|
11917
|
-
"filter-option":
|
|
11965
|
+
"filter-option": A,
|
|
11918
11966
|
placeholder: I.$t("sys.chooseText"),
|
|
11919
|
-
options:
|
|
11920
|
-
loading:
|
|
11967
|
+
options: M(Me),
|
|
11968
|
+
loading: k.value,
|
|
11921
11969
|
disabled: t.value.consume_source_config_ === "follow_common_policy",
|
|
11922
11970
|
onFocus: St,
|
|
11923
11971
|
onChange: () => Ct(Me)
|
|
@@ -11947,13 +11995,13 @@ var init_index_es = __esmMin((() => {
|
|
|
11947
11995
|
class: "consume-policy-item__table-select",
|
|
11948
11996
|
"show-search": "",
|
|
11949
11997
|
"allow-clear": "",
|
|
11950
|
-
"filter-option":
|
|
11998
|
+
"filter-option": A,
|
|
11951
11999
|
placeholder: I.$t("sys.chooseText"),
|
|
11952
|
-
options:
|
|
12000
|
+
options: V(Me),
|
|
11953
12001
|
loading: s.value,
|
|
11954
12002
|
disabled: t.value.consume_source_config_ === "follow_common_policy",
|
|
11955
12003
|
onFocus: xt,
|
|
11956
|
-
onChange: () =>
|
|
12004
|
+
onChange: () => Dt(Me)
|
|
11957
12005
|
}, null, 8, [
|
|
11958
12006
|
"value",
|
|
11959
12007
|
"onUpdate:value",
|
|
@@ -11982,8 +12030,8 @@ var init_index_es = __esmMin((() => {
|
|
|
11982
12030
|
"allow-clear": "",
|
|
11983
12031
|
"filter-option": !1,
|
|
11984
12032
|
placeholder: I.$t("sys.chooseText"),
|
|
11985
|
-
options:
|
|
11986
|
-
loading:
|
|
12033
|
+
options: zt(Me),
|
|
12034
|
+
loading: m.value,
|
|
11987
12035
|
disabled: t.value.consume_source_config_ === "follow_common_policy" || !Me.warehouse_id_ || !S.value[Me.warehouse_id_],
|
|
11988
12036
|
onSearch: (Ee) => ca(Ee, Me.warehouse_id_),
|
|
11989
12037
|
onFocus: () => Se("", Me.warehouse_id_)
|
|
@@ -12040,7 +12088,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12040
12088
|
expr: a.value.expr,
|
|
12041
12089
|
returnType: o.returnType || Lf.Number,
|
|
12042
12090
|
disabledReturnType: o.disabledReturnType,
|
|
12043
|
-
mode: o.mode ??
|
|
12091
|
+
mode: o.mode ?? Qt.ONLINE_FORM_FIELD_FORMULA,
|
|
12044
12092
|
identifiers: { [Vf.FIELD]: await s() }
|
|
12045
12093
|
});
|
|
12046
12094
|
if (!f) return;
|
|
@@ -12053,7 +12101,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12053
12101
|
async function s() {
|
|
12054
12102
|
if (!o.modelKey) return [];
|
|
12055
12103
|
let r = await ie.apaas.fieldMeta.getList({ modelKey: o.modelKey }) ?? [];
|
|
12056
|
-
return o.filterFunc && (r = r.reduce((i,
|
|
12104
|
+
return o.filterFunc && (r = r.reduce((i, _) => (o.filterFunc(_) && i.push(_), i), [])), r.map((i) => ({
|
|
12057
12105
|
id: i.key,
|
|
12058
12106
|
name: i.name,
|
|
12059
12107
|
valueType: i.type
|
|
@@ -12102,7 +12150,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12102
12150
|
}
|
|
12103
12151
|
];
|
|
12104
12152
|
return (a, n) => {
|
|
12105
|
-
const l = resolveComponent("a-radio"), s = resolveComponent("a-radio-group"), f = resolveComponent("a-form-item"), r = resolveComponent("a-select"), i = resolveComponent("a-col"),
|
|
12153
|
+
const l = resolveComponent("a-radio"), s = resolveComponent("a-radio-group"), f = resolveComponent("a-form-item"), r = resolveComponent("a-select"), i = resolveComponent("a-col"), _ = resolveComponent("a-row");
|
|
12106
12154
|
return openBlock(), createElementBlock(Fragment, null, [createVNode(f, {
|
|
12107
12155
|
label: a.$t("sys.edhr.mcTable.qtyValidationEnabled"),
|
|
12108
12156
|
name: "qty_validation_enabled_",
|
|
@@ -12110,7 +12158,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12110
12158
|
}, {
|
|
12111
12159
|
default: withCtx(() => [createVNode(s, {
|
|
12112
12160
|
value: o.value.qty_validation_enabled_,
|
|
12113
|
-
"onUpdate:value": n[0] || (n[0] = (
|
|
12161
|
+
"onUpdate:value": n[0] || (n[0] = (k) => o.value.qty_validation_enabled_ = k)
|
|
12114
12162
|
}, {
|
|
12115
12163
|
default: withCtx(() => [createVNode(l, { value: !0 }, {
|
|
12116
12164
|
default: withCtx(() => [createTextVNode(toDisplayString(a.$t("sys.true")), 1)]),
|
|
@@ -12122,7 +12170,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12122
12170
|
_: 1
|
|
12123
12171
|
}, 8, ["value"])]),
|
|
12124
12172
|
_: 1
|
|
12125
|
-
}, 8, ["label", "rules"]), o.value.qty_validation_enabled_ ? (openBlock(), createElementBlock("div", Uf, [createVNode(
|
|
12173
|
+
}, 8, ["label", "rules"]), o.value.qty_validation_enabled_ ? (openBlock(), createElementBlock("div", Uf, [createVNode(_, { gutter: 16 }, {
|
|
12126
12174
|
default: withCtx(() => [createVNode(i, { span: 12 }, {
|
|
12127
12175
|
default: withCtx(() => [createVNode(f, {
|
|
12128
12176
|
label: a.$t("sys.edhr.mcTable.qtyValidationRule"),
|
|
@@ -12131,7 +12179,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12131
12179
|
}, {
|
|
12132
12180
|
default: withCtx(() => [createVNode(r, {
|
|
12133
12181
|
value: o.value.qty_validation_rule_,
|
|
12134
|
-
"onUpdate:value": n[1] || (n[1] = (
|
|
12182
|
+
"onUpdate:value": n[1] || (n[1] = (k) => o.value.qty_validation_rule_ = k),
|
|
12135
12183
|
placeholder: a.$t("sys.chooseText"),
|
|
12136
12184
|
options: t
|
|
12137
12185
|
}, null, 8, ["value", "placeholder"])]),
|
|
@@ -12140,7 +12188,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12140
12188
|
_: 1
|
|
12141
12189
|
})]),
|
|
12142
12190
|
_: 1
|
|
12143
|
-
}), o.value.qty_validation_rule_ === "bounds" ? (openBlock(), createBlock(
|
|
12191
|
+
}), o.value.qty_validation_rule_ === "bounds" ? (openBlock(), createBlock(_, {
|
|
12144
12192
|
key: 0,
|
|
12145
12193
|
gutter: 16
|
|
12146
12194
|
}, {
|
|
@@ -12152,11 +12200,11 @@ var init_index_es = __esmMin((() => {
|
|
|
12152
12200
|
}, {
|
|
12153
12201
|
default: withCtx(() => [createVNode(Ta, {
|
|
12154
12202
|
value: o.value.max_value_,
|
|
12155
|
-
"onUpdate:value": n[2] || (n[2] = (
|
|
12203
|
+
"onUpdate:value": n[2] || (n[2] = (k) => o.value.max_value_ = k),
|
|
12156
12204
|
"model-key": "em_material_consume",
|
|
12157
|
-
mode: unref(
|
|
12205
|
+
mode: unref(Qt).FIELD_DISPLAY,
|
|
12158
12206
|
"disabled-return-type": !0,
|
|
12159
|
-
"filter-func": (
|
|
12207
|
+
"filter-func": (k) => k.key === "qty_required_"
|
|
12160
12208
|
}, null, 8, [
|
|
12161
12209
|
"value",
|
|
12162
12210
|
"mode",
|
|
@@ -12173,11 +12221,11 @@ var init_index_es = __esmMin((() => {
|
|
|
12173
12221
|
}, {
|
|
12174
12222
|
default: withCtx(() => [createVNode(Ta, {
|
|
12175
12223
|
value: o.value.min_value_,
|
|
12176
|
-
"onUpdate:value": n[3] || (n[3] = (
|
|
12224
|
+
"onUpdate:value": n[3] || (n[3] = (k) => o.value.min_value_ = k),
|
|
12177
12225
|
"model-key": "em_material_consume",
|
|
12178
|
-
mode: unref(
|
|
12226
|
+
mode: unref(Qt).FIELD_DISPLAY,
|
|
12179
12227
|
"disabled-return-type": !0,
|
|
12180
|
-
"filter-func": (
|
|
12228
|
+
"filter-func": (k) => k.key === "qty_required_"
|
|
12181
12229
|
}, null, 8, [
|
|
12182
12230
|
"value",
|
|
12183
12231
|
"mode",
|
|
@@ -12252,43 +12300,43 @@ var init_index_es = __esmMin((() => {
|
|
|
12252
12300
|
await ((_n$value9 = n.value) === null || _n$value9 === void 0 ? void 0 : _n$value9.validate());
|
|
12253
12301
|
}
|
|
12254
12302
|
return o({ validate: f }), (r, i) => {
|
|
12255
|
-
const
|
|
12303
|
+
const _ = resolveComponent("a-select"), k = resolveComponent("a-form-item"), m = resolveComponent("a-switch"), d = resolveComponent("a-radio"), S = resolveComponent("a-radio-group"), h = resolveComponent("a-form");
|
|
12256
12304
|
return openBlock(), createElementBlock("div", null, [createVNode(unref(ve), null, {
|
|
12257
12305
|
default: withCtx(() => [...i[5] || (i[5] = [createTextVNode("用料策略", -1)])]),
|
|
12258
12306
|
_: 1
|
|
12259
|
-
}), createVNode(
|
|
12307
|
+
}), createVNode(h, {
|
|
12260
12308
|
ref_key: "formRef",
|
|
12261
12309
|
ref: n,
|
|
12262
12310
|
model: a.value,
|
|
12263
12311
|
rules: s.value
|
|
12264
12312
|
}, {
|
|
12265
|
-
default: withCtx(() => [createVNode(
|
|
12313
|
+
default: withCtx(() => [createVNode(k, {
|
|
12266
12314
|
name: "material_consumption_pattern_",
|
|
12267
12315
|
required: ""
|
|
12268
12316
|
}, {
|
|
12269
|
-
label: withCtx(() => [i[6] || (i[6] = createElementVNode("span", null, "物料消耗模式", -1)), createVNode(unref(
|
|
12270
|
-
default: withCtx(() => [createVNode(
|
|
12317
|
+
label: withCtx(() => [i[6] || (i[6] = createElementVNode("span", null, "物料消耗模式", -1)), createVNode(unref(Gt), { info: e.hasBomCofig ? Pf : "记录模式:不支持库存扣减。" }, null, 8, ["info"])]),
|
|
12318
|
+
default: withCtx(() => [createVNode(_, {
|
|
12271
12319
|
value: a.value.material_consumption_pattern_,
|
|
12272
12320
|
"onUpdate:value": i[0] || (i[0] = (c) => a.value.material_consumption_pattern_ = c),
|
|
12273
12321
|
placeholder: "请选择",
|
|
12274
12322
|
options: l.value
|
|
12275
12323
|
}, null, 8, ["value", "options"])]),
|
|
12276
12324
|
_: 1
|
|
12277
|
-
}), e.hasBomCofig ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(
|
|
12325
|
+
}), e.hasBomCofig ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(k, {
|
|
12278
12326
|
name: "personal_bom_enabled_",
|
|
12279
12327
|
label: "自定义用料策略"
|
|
12280
12328
|
}, {
|
|
12281
|
-
default: withCtx(() => [createElementVNode("div", Kf, [createVNode(
|
|
12329
|
+
default: withCtx(() => [createElementVNode("div", Kf, [createVNode(m, {
|
|
12282
12330
|
checked: a.value.personal_bom_enabled_,
|
|
12283
12331
|
"onUpdate:checked": i[1] || (i[1] = (c) => a.value.personal_bom_enabled_ = c)
|
|
12284
12332
|
}, null, 8, ["checked"])])]),
|
|
12285
12333
|
_: 1
|
|
12286
12334
|
}), a.value.personal_bom_enabled_ ? (openBlock(), createElementBlock("div", Ef, [
|
|
12287
|
-
createVNode(
|
|
12335
|
+
createVNode(k, {
|
|
12288
12336
|
name: "type_",
|
|
12289
12337
|
required: ""
|
|
12290
12338
|
}, {
|
|
12291
|
-
label: withCtx(() => [i[7] || (i[7] = createElementVNode("span", null, "上料方式", -1)), createVNode(unref(
|
|
12339
|
+
label: withCtx(() => [i[7] || (i[7] = createElementVNode("span", null, "上料方式", -1)), createVNode(unref(Gt), { info: Hf })]),
|
|
12292
12340
|
default: withCtx(() => [createVNode(S, {
|
|
12293
12341
|
value: a.value.type_,
|
|
12294
12342
|
"onUpdate:value": i[2] || (i[2] = (c) => a.value.type_ = c),
|
|
@@ -12365,7 +12413,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12365
12413
|
max_value_: void 0,
|
|
12366
12414
|
min_value_: void 0,
|
|
12367
12415
|
disableBarcodeParsing: !1,
|
|
12368
|
-
scanParamType:
|
|
12416
|
+
scanParamType: Jt.Lot
|
|
12369
12417
|
};
|
|
12370
12418
|
}
|
|
12371
12419
|
const r = ref(f()), i = ref({
|
|
@@ -12392,87 +12440,117 @@ var init_index_es = __esmMin((() => {
|
|
|
12392
12440
|
title: "默认值",
|
|
12393
12441
|
slots: { default: "value_default" }
|
|
12394
12442
|
}]
|
|
12395
|
-
}),
|
|
12443
|
+
}), _ = computed(() => !!t.bizOptions.editingItem), k = computed(() => !!Object.keys(r.value.parseRuleProps || {}).length), m = computed(() => t.bizOptions.objectFields.filter((q) => {
|
|
12396
12444
|
var _t$bizOptions$configu, _t$bizOptions$configu2;
|
|
12397
|
-
return
|
|
12398
|
-
}).map((
|
|
12399
|
-
label:
|
|
12400
|
-
value:
|
|
12401
|
-
}))), d = computed(() => r.value.objectField ? t.bizOptions.allFields.filter((
|
|
12402
|
-
key:
|
|
12403
|
-
name:
|
|
12404
|
-
field:
|
|
12405
|
-
}))),
|
|
12445
|
+
return _.value || !((_t$bizOptions$configu = t.bizOptions.configuredItems) === null || _t$bizOptions$configu === void 0 ? void 0 : _t$bizOptions$configu.length) ? !0 : !((_t$bizOptions$configu2 = t.bizOptions.configuredItems) === null || _t$bizOptions$configu2 === void 0 ? void 0 : _t$bizOptions$configu2.find((O) => O.objectField === q.key));
|
|
12446
|
+
}).map((q) => ({
|
|
12447
|
+
label: q.name,
|
|
12448
|
+
value: q.key
|
|
12449
|
+
}))), d = computed(() => r.value.objectField ? t.bizOptions.allFields.filter((T) => T.type === Tt.REF && T.bizType === ja.BOM_ENTRY_ID ? !1 : T.belongingObject === r.value.objectField) : []), S = computed(() => d.value.map((T) => ({
|
|
12450
|
+
key: T.key,
|
|
12451
|
+
name: T.name,
|
|
12452
|
+
field: T
|
|
12453
|
+
}))), h = [
|
|
12454
|
+
{
|
|
12455
|
+
prefix: "product_id_name_",
|
|
12456
|
+
source: "name_"
|
|
12457
|
+
},
|
|
12458
|
+
{
|
|
12459
|
+
prefix: "product_id_code_",
|
|
12460
|
+
source: "code_"
|
|
12461
|
+
},
|
|
12462
|
+
{
|
|
12463
|
+
prefix: "product_id_spec_",
|
|
12464
|
+
source: "spec_"
|
|
12465
|
+
}
|
|
12466
|
+
], c = () => {
|
|
12467
|
+
r.value.values = {};
|
|
12468
|
+
}, g = (T, q) => {
|
|
12469
|
+
if (T.belongingObject !== r.value.objectField || (T.bizType || T.type) !== Tt.PRODUCT) return;
|
|
12470
|
+
const O = {};
|
|
12471
|
+
for (const $ of d.value) {
|
|
12472
|
+
const A = h.find(({ prefix: V }) => $.key.startsWith(V));
|
|
12473
|
+
A && (O[$.key] = (q === null || q === void 0 ? void 0 : q[A.source]) ?? null);
|
|
12474
|
+
}
|
|
12406
12475
|
r.value.values = {
|
|
12407
12476
|
...r.value.values,
|
|
12408
|
-
|
|
12477
|
+
...O
|
|
12409
12478
|
};
|
|
12410
|
-
},
|
|
12479
|
+
}, C = (T, q) => {
|
|
12480
|
+
const O = d.value.find(($) => $.key === T);
|
|
12481
|
+
!O || Object.is(r.value.values[T], q) || (r.value.values = {
|
|
12482
|
+
...r.value.values,
|
|
12483
|
+
[T]: q
|
|
12484
|
+
}, (q == null || q === "") && g(O, null));
|
|
12485
|
+
}, y = () => {
|
|
12411
12486
|
G2("PARSE_RULE_MODAL", {
|
|
12412
12487
|
config: r.value.parseRuleProps,
|
|
12413
|
-
formFieldOptions: d.value.map((
|
|
12414
|
-
label:
|
|
12415
|
-
value:
|
|
12488
|
+
formFieldOptions: d.value.map((T) => ({
|
|
12489
|
+
label: T.name,
|
|
12490
|
+
value: T.key
|
|
12416
12491
|
})),
|
|
12417
12492
|
formFieldsLabel: "对象字段",
|
|
12418
12493
|
ruleTip: "默认条码映射字段:条码批次映射批次字段,条码物料编码映射物料编码字段,条码有效期映射有效期字段"
|
|
12419
|
-
}).then((
|
|
12420
|
-
|
|
12494
|
+
}).then((T) => {
|
|
12495
|
+
T.success && (r.value.parseRuleProps = T.result ?? {});
|
|
12421
12496
|
});
|
|
12422
12497
|
};
|
|
12423
|
-
watch(() => t.bizOptions.editingItem, (
|
|
12424
|
-
if (!
|
|
12425
|
-
const
|
|
12498
|
+
watch(() => t.bizOptions.editingItem, (T) => {
|
|
12499
|
+
if (!T) return;
|
|
12500
|
+
const q = f(), O = cloneDeep(T);
|
|
12426
12501
|
r.value = {
|
|
12427
|
-
...
|
|
12428
|
-
...
|
|
12429
|
-
values:
|
|
12430
|
-
parseRuleProps:
|
|
12431
|
-
consume_source_config_:
|
|
12432
|
-
qty_validation_rule_:
|
|
12433
|
-
consume_storage_entries_: (
|
|
12434
|
-
|
|
12435
|
-
__key:
|
|
12502
|
+
...q,
|
|
12503
|
+
...O,
|
|
12504
|
+
values: O.values ?? q.values,
|
|
12505
|
+
parseRuleProps: O.parseRuleProps ?? q.parseRuleProps,
|
|
12506
|
+
consume_source_config_: O.consume_source_config_ ?? q.consume_source_config_,
|
|
12507
|
+
qty_validation_rule_: O.qty_validation_rule_ ?? q.qty_validation_rule_,
|
|
12508
|
+
consume_storage_entries_: (O.consume_storage_entries_ ?? []).map(($) => ({
|
|
12509
|
+
...$,
|
|
12510
|
+
__key: $.__key || Ze(8)
|
|
12436
12511
|
}))
|
|
12437
12512
|
};
|
|
12438
12513
|
}, { immediate: !0 });
|
|
12439
|
-
const
|
|
12514
|
+
const R = async () => {
|
|
12440
12515
|
try {
|
|
12441
12516
|
var _n$value10, _l$value14;
|
|
12442
12517
|
await Promise.all([(_n$value10 = n.value) === null || _n$value10 === void 0 ? void 0 : _n$value10.validate(), (_l$value14 = l.value) === null || _l$value14 === void 0 ? void 0 : _l$value14.validate()]);
|
|
12443
12518
|
} catch {
|
|
12444
12519
|
return;
|
|
12445
12520
|
}
|
|
12446
|
-
const
|
|
12447
|
-
r.value.objectFieldName =
|
|
12521
|
+
const T = t.bizOptions.objectFields.find((O) => O.key === r.value.objectField);
|
|
12522
|
+
r.value.objectFieldName = T === null || T === void 0 ? void 0 : T.name, r.value.objectBizType = T === null || T === void 0 ? void 0 : T.bizType;
|
|
12523
|
+
const q = r.value.values;
|
|
12524
|
+
r.value.values = Object.fromEntries(d.value.filter((O) => Object.prototype.hasOwnProperty.call(q, O.key)).map((O) => [O.key, q[O.key]])), t.modalInst.confirm(r.value);
|
|
12448
12525
|
};
|
|
12449
|
-
return (
|
|
12450
|
-
const
|
|
12526
|
+
return (T, q) => {
|
|
12527
|
+
const O = resolveComponent("a-select"), $ = resolveComponent("a-form-item"), A = resolveComponent("a-form"), V = resolveComponent("a-switch"), M = resolveComponent("a-button"), L = resolveComponent("a-select-option");
|
|
12451
12528
|
return openBlock(), createBlock(wt, mergeProps(e.modalProps, {
|
|
12452
12529
|
visible: e.modalVisible,
|
|
12453
12530
|
onCancel: e.modalInst.cancel,
|
|
12454
|
-
onOk:
|
|
12455
|
-
onAfterClose:
|
|
12531
|
+
onOk: R,
|
|
12532
|
+
onAfterClose: q[4] || (q[4] = (N) => a("afterClose"))
|
|
12456
12533
|
}), {
|
|
12457
12534
|
default: withCtx(() => [
|
|
12458
|
-
createVNode(
|
|
12535
|
+
createVNode(A, {
|
|
12459
12536
|
ref_key: "objectFieldFormRef",
|
|
12460
12537
|
ref: n,
|
|
12461
12538
|
layout: "vertical",
|
|
12462
12539
|
model: r.value,
|
|
12463
12540
|
rules: s
|
|
12464
12541
|
}, {
|
|
12465
|
-
default: withCtx(() => [createVNode(
|
|
12542
|
+
default: withCtx(() => [createVNode($, {
|
|
12466
12543
|
label: "对象字段",
|
|
12467
12544
|
name: "objectField",
|
|
12468
12545
|
required: ""
|
|
12469
12546
|
}, {
|
|
12470
|
-
default: withCtx(() => [createVNode(
|
|
12547
|
+
default: withCtx(() => [createVNode(O, {
|
|
12471
12548
|
value: r.value.objectField,
|
|
12472
|
-
"onUpdate:value":
|
|
12549
|
+
"onUpdate:value": q[0] || (q[0] = (N) => r.value.objectField = N),
|
|
12550
|
+
onChange: c,
|
|
12473
12551
|
placeholder: "请选择",
|
|
12474
|
-
options:
|
|
12475
|
-
disabled:
|
|
12552
|
+
options: m.value,
|
|
12553
|
+
disabled: _.value
|
|
12476
12554
|
}, null, 8, [
|
|
12477
12555
|
"value",
|
|
12478
12556
|
"options",
|
|
@@ -12483,43 +12561,45 @@ var init_index_es = __esmMin((() => {
|
|
|
12483
12561
|
_: 1
|
|
12484
12562
|
}, 8, ["model"]),
|
|
12485
12563
|
r.value.objectField ? (openBlock(), createElementBlock("div", Zf, [createVNode(unref(ve), null, {
|
|
12486
|
-
default: withCtx(() => [...
|
|
12564
|
+
default: withCtx(() => [...q[5] || (q[5] = [createTextVNode("默认值", -1)])]),
|
|
12487
12565
|
_: 1
|
|
12488
12566
|
}), createVNode(unref(VxeGrid), mergeProps({
|
|
12489
12567
|
class: "object-table",
|
|
12490
12568
|
data: S.value
|
|
12491
12569
|
}, i.value), {
|
|
12492
|
-
value_default: withCtx(({ row:
|
|
12493
|
-
key:
|
|
12494
|
-
field:
|
|
12495
|
-
modelValue: r.value.values[
|
|
12496
|
-
"onUpdate:modelValue": (
|
|
12497
|
-
|
|
12570
|
+
value_default: withCtx(({ row: N }) => [e.bizOptions.RenderFieldWrapper ? (openBlock(), createBlock(resolveDynamicComponent(e.bizOptions.RenderFieldWrapper), {
|
|
12571
|
+
key: N.key,
|
|
12572
|
+
field: N.field,
|
|
12573
|
+
modelValue: r.value.values[N.key],
|
|
12574
|
+
"onUpdate:modelValue": (J) => C(N.key, J),
|
|
12575
|
+
onMaterialSelect: (J) => g(N.field, J)
|
|
12576
|
+
}, null, 40, [
|
|
12498
12577
|
"field",
|
|
12499
12578
|
"modelValue",
|
|
12500
|
-
"onUpdate:modelValue"
|
|
12579
|
+
"onUpdate:modelValue",
|
|
12580
|
+
"onMaterialSelect"
|
|
12501
12581
|
])) : createCommentVNode("", !0)]),
|
|
12502
12582
|
_: 1
|
|
12503
12583
|
}, 16, ["data"])])) : createCommentVNode("", !0),
|
|
12504
12584
|
createElementVNode("div", null, [createVNode(unref(ve), null, {
|
|
12505
|
-
default: withCtx(() => [...
|
|
12585
|
+
default: withCtx(() => [...q[6] || (q[6] = [createTextVNode("条码解析规则", -1)])]),
|
|
12506
12586
|
_: 1
|
|
12507
|
-
}), createVNode(
|
|
12587
|
+
}), createVNode(A, {
|
|
12508
12588
|
ref: "barcodeRulesFormRef",
|
|
12509
12589
|
model: r.value,
|
|
12510
12590
|
layout: "horizontal"
|
|
12511
12591
|
}, {
|
|
12512
|
-
default: withCtx(() => [createVNode(
|
|
12592
|
+
default: withCtx(() => [createVNode($, {
|
|
12513
12593
|
label: "是否启用条码解析规则",
|
|
12514
12594
|
name: "disableBarcodeParsing"
|
|
12515
12595
|
}, {
|
|
12516
|
-
default: withCtx(() => [createVNode(
|
|
12596
|
+
default: withCtx(() => [createVNode(V, {
|
|
12517
12597
|
size: "small",
|
|
12518
12598
|
checked: !r.value.disableBarcodeParsing,
|
|
12519
|
-
onChange:
|
|
12599
|
+
onChange: q[1] || (q[1] = (N) => r.value.disableBarcodeParsing = !r.value.disableBarcodeParsing)
|
|
12520
12600
|
}, null, 8, ["checked"])]),
|
|
12521
12601
|
_: 1
|
|
12522
|
-
}), r.value.disableBarcodeParsing ? (openBlock(), createBlock(
|
|
12602
|
+
}), r.value.disableBarcodeParsing ? (openBlock(), createBlock($, {
|
|
12523
12603
|
key: 1,
|
|
12524
12604
|
label: "参数",
|
|
12525
12605
|
name: "scanParamType",
|
|
@@ -12528,29 +12608,29 @@ var init_index_es = __esmMin((() => {
|
|
|
12528
12608
|
message: "请选择参数"
|
|
12529
12609
|
}]
|
|
12530
12610
|
}, {
|
|
12531
|
-
default: withCtx(() => [createVNode(
|
|
12611
|
+
default: withCtx(() => [createVNode(O, {
|
|
12532
12612
|
value: r.value.scanParamType,
|
|
12533
|
-
"onUpdate:value":
|
|
12534
|
-
placeholder:
|
|
12613
|
+
"onUpdate:value": q[2] || (q[2] = (N) => r.value.scanParamType = N),
|
|
12614
|
+
placeholder: T.$t("sys.chooseText")
|
|
12535
12615
|
}, {
|
|
12536
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(Object.values(unref(
|
|
12537
|
-
key:
|
|
12538
|
-
value:
|
|
12616
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(Object.values(unref(Jt)), (N) => (openBlock(), createBlock(L, {
|
|
12617
|
+
key: N,
|
|
12618
|
+
value: N
|
|
12539
12619
|
}, {
|
|
12540
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
12620
|
+
default: withCtx(() => [createTextVNode(toDisplayString(T.$t(`sys.ScanParamType.${N}`)), 1)]),
|
|
12541
12621
|
_: 2
|
|
12542
12622
|
}, 1032, ["value"]))), 128))]),
|
|
12543
12623
|
_: 1
|
|
12544
12624
|
}, 8, ["value", "placeholder"])]),
|
|
12545
12625
|
_: 1
|
|
12546
|
-
}, 8, ["rules"])) : (openBlock(), createBlock(
|
|
12626
|
+
}, 8, ["rules"])) : (openBlock(), createBlock(M, {
|
|
12547
12627
|
key: 0,
|
|
12548
12628
|
block: "",
|
|
12549
|
-
ghost: !
|
|
12629
|
+
ghost: !k.value,
|
|
12550
12630
|
type: "primary",
|
|
12551
|
-
onClick:
|
|
12631
|
+
onClick: y
|
|
12552
12632
|
}, {
|
|
12553
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
12633
|
+
default: withCtx(() => [createTextVNode(toDisplayString(k.value ? "编辑" : "添加") + "规则 ", 1)]),
|
|
12554
12634
|
_: 1
|
|
12555
12635
|
}, 8, ["ghost"]))]),
|
|
12556
12636
|
_: 1
|
|
@@ -12559,7 +12639,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12559
12639
|
ref_key: "materialStrategyRef",
|
|
12560
12640
|
ref: l,
|
|
12561
12641
|
"form-state": r.value,
|
|
12562
|
-
"onUpdate:formState":
|
|
12642
|
+
"onUpdate:formState": q[3] || (q[3] = (N) => r.value = N),
|
|
12563
12643
|
showConsumePolicy: e.bizOptions.showConsumePolicy,
|
|
12564
12644
|
hasBomCofig: e.bizOptions.showMaterialStrategy
|
|
12565
12645
|
}, null, 8, [
|
|
@@ -12572,7 +12652,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12572
12652
|
}, 16, ["visible", "onCancel"]);
|
|
12573
12653
|
};
|
|
12574
12654
|
}
|
|
12575
|
-
}), [["__scopeId", "data-v-
|
|
12655
|
+
}), [["__scopeId", "data-v-48983740"]]);
|
|
12576
12656
|
gt = /* @__PURE__ */ ((e) => (e.materialCode = "materialCode", e.lot = "lot", e.qty = "qty", e.expiration = "expiration", e.deviceCode = "deviceCode", e.other = "other", e))(gt || {});
|
|
12577
12657
|
Jf = ie.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey;
|
|
12578
12658
|
a2 = { class: "field-mapping__rule-control" };
|
|
@@ -12649,9 +12729,9 @@ var init_index_es = __esmMin((() => {
|
|
|
12649
12729
|
...c,
|
|
12650
12730
|
label: `${c.label}[${c.value}]`
|
|
12651
12731
|
})));
|
|
12652
|
-
const
|
|
12732
|
+
const _ = () => {
|
|
12653
12733
|
console.log("change", i.fillMapArr), n("update:fillMapArr", l(i.fillMapArr));
|
|
12654
|
-
},
|
|
12734
|
+
}, k = async (c) => {
|
|
12655
12735
|
if (!c) {
|
|
12656
12736
|
r.value = [], n("ruleConfigChange", void 0);
|
|
12657
12737
|
return;
|
|
@@ -12661,36 +12741,36 @@ var init_index_es = __esmMin((() => {
|
|
|
12661
12741
|
r.value = [], n("ruleConfigChange", void 0);
|
|
12662
12742
|
return;
|
|
12663
12743
|
}
|
|
12664
|
-
r.value = g.fieldList.map((
|
|
12665
|
-
label:
|
|
12666
|
-
value:
|
|
12744
|
+
r.value = g.fieldList.map((C) => ({
|
|
12745
|
+
label: C.alias ?? $t(`sys.edhr.labelConfigFields.${C.type}`),
|
|
12746
|
+
value: C.key
|
|
12667
12747
|
})), n("ruleConfigChange", g);
|
|
12668
|
-
},
|
|
12748
|
+
}, m = (c) => {
|
|
12669
12749
|
if (a.disabled) return;
|
|
12670
12750
|
const g = c ?? void 0;
|
|
12671
|
-
g !== i.parsingRuleId && (i.parsingRuleId = g, i.fillMapArr = [], n("update:parsingRuleId", g), n("update:fillMapArr", []),
|
|
12751
|
+
g !== i.parsingRuleId && (i.parsingRuleId = g, i.fillMapArr = [], n("update:parsingRuleId", g), n("update:fillMapArr", []), k(g));
|
|
12672
12752
|
}, d = () => {
|
|
12673
|
-
a.disabled || (i.fillMapArr.push({ formFields: [] }),
|
|
12753
|
+
a.disabled || (i.fillMapArr.push({ formFields: [] }), _());
|
|
12674
12754
|
}, S = (c) => {
|
|
12675
|
-
a.disabled || (i.fillMapArr.splice(c, 1),
|
|
12676
|
-
},
|
|
12677
|
-
const
|
|
12678
|
-
return
|
|
12755
|
+
a.disabled || (i.fillMapArr.splice(c, 1), _());
|
|
12756
|
+
}, h = (c, g) => {
|
|
12757
|
+
const C = c.trim().toLowerCase();
|
|
12758
|
+
return C ? g.label.toLowerCase().includes(C) || String(g.value ?? "").toLowerCase().includes(C) : !0;
|
|
12679
12759
|
};
|
|
12680
12760
|
return onMounted(() => {
|
|
12681
|
-
i.parsingRuleId &&
|
|
12761
|
+
i.parsingRuleId && k(i.parsingRuleId);
|
|
12682
12762
|
}), o({ validate: () => {
|
|
12683
12763
|
var _s$value6;
|
|
12684
12764
|
return (_s$value6 = s.value) === null || _s$value6 === void 0 ? void 0 : _s$value6.validate();
|
|
12685
12765
|
} }), (c, g) => {
|
|
12686
|
-
const
|
|
12687
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(["field-mapping", { "field-mapping--bordered": e.bordered }]) }, [createVNode(
|
|
12766
|
+
const C = resolveComponent("a-form-item"), y = resolveComponent("a-alert"), R = resolveComponent("a-select"), T = resolveComponent("a-button"), q = resolveComponent("a-form");
|
|
12767
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(["field-mapping", { "field-mapping--bordered": e.bordered }]) }, [createVNode(q, {
|
|
12688
12768
|
ref_key: "formRef",
|
|
12689
12769
|
ref: s,
|
|
12690
12770
|
model: i,
|
|
12691
12771
|
layout: "horizontal"
|
|
12692
12772
|
}, {
|
|
12693
|
-
default: withCtx(() => [createVNode(
|
|
12773
|
+
default: withCtx(() => [createVNode(C, {
|
|
12694
12774
|
class: "field-mapping__rule",
|
|
12695
12775
|
label: c.$t("sys.edhr.mcTable.parseRule") + ":",
|
|
12696
12776
|
name: "parsingRuleId"
|
|
@@ -12702,32 +12782,32 @@ var init_index_es = __esmMin((() => {
|
|
|
12702
12782
|
disabled: e.disabled,
|
|
12703
12783
|
disabledParent: !1,
|
|
12704
12784
|
"parent-to-default": !1,
|
|
12705
|
-
"onUpdate:modelValue":
|
|
12785
|
+
"onUpdate:modelValue": m
|
|
12706
12786
|
}, null, 8, ["model-value", "disabled"]), e.collapsible ? (openBlock(), createElementBlock("div", {
|
|
12707
12787
|
key: 0,
|
|
12708
12788
|
class: "field-mapping__expand primary-gct",
|
|
12709
|
-
onClick: g[0] || (g[0] = (
|
|
12789
|
+
onClick: g[0] || (g[0] = (O) => f.value = !f.value)
|
|
12710
12790
|
}, [createTextVNode(toDisplayString(f.value ? c.$t("sys.collapseConfig") : c.$t("sys.expandConfig")) + " ", 1), createElementVNode("i", { class: normalizeClass(["iconfont ml4px", f.value ? "icon-arrow_up_pad" : "icon-arrow_down_pad"]) }, null, 2)])) : createCommentVNode("", !0)])]),
|
|
12711
12791
|
_: 1
|
|
12712
12792
|
}, 8, ["label"]), withDirectives(createElementVNode("div", null, [
|
|
12713
|
-
e.ruleTip && e.tipPlacement === "before" ? (openBlock(), createElementBlock("div", o2, [createVNode(
|
|
12793
|
+
e.ruleTip && e.tipPlacement === "before" ? (openBlock(), createElementBlock("div", o2, [createVNode(y, {
|
|
12714
12794
|
message: e.ruleTip,
|
|
12715
12795
|
type: "info",
|
|
12716
12796
|
"show-icon": ""
|
|
12717
12797
|
}, null, 8, ["message"])])) : createCommentVNode("", !0),
|
|
12718
12798
|
createElementVNode("div", n2, toDisplayString(c.$t("sys.onlineForm.fieldMapping")), 1),
|
|
12719
|
-
e.ruleTip && e.tipPlacement === "after" ? (openBlock(), createElementBlock("div", l2, [createVNode(
|
|
12799
|
+
e.ruleTip && e.tipPlacement === "after" ? (openBlock(), createElementBlock("div", l2, [createVNode(y, {
|
|
12720
12800
|
message: e.ruleTip,
|
|
12721
12801
|
type: "info",
|
|
12722
12802
|
"show-icon": ""
|
|
12723
12803
|
}, null, 8, ["message"])])) : createCommentVNode("", !0),
|
|
12724
12804
|
createElementVNode("div", s2, [
|
|
12725
12805
|
i.fillMapArr.length ? (openBlock(), createElementBlock("div", r2, [createElementVNode("div", i2, toDisplayString(c.$t("sys.onlineForm.barcodeField")), 1), createElementVNode("div", u2, toDisplayString(e.formFieldsLabel || c.$t("sys.onlineForm.formFields")), 1)])) : createCommentVNode("", !0),
|
|
12726
|
-
createElementVNode("div", c2, [(openBlock(!0), createElementBlock(Fragment, null, renderList(i.fillMapArr, (
|
|
12806
|
+
createElementVNode("div", c2, [(openBlock(!0), createElementBlock(Fragment, null, renderList(i.fillMapArr, (O, $) => (openBlock(), createElementBlock("div", {
|
|
12727
12807
|
key: $,
|
|
12728
12808
|
class: "field-mapping__row"
|
|
12729
12809
|
}, [
|
|
12730
|
-
createVNode(
|
|
12810
|
+
createVNode(C, {
|
|
12731
12811
|
class: "field-mapping__barcodeField",
|
|
12732
12812
|
name: [
|
|
12733
12813
|
"fillMapArr",
|
|
@@ -12739,13 +12819,13 @@ var init_index_es = __esmMin((() => {
|
|
|
12739
12819
|
message: c.$t("sys.chooseText")
|
|
12740
12820
|
}]
|
|
12741
12821
|
}, {
|
|
12742
|
-
default: withCtx(() => [createVNode(
|
|
12743
|
-
value:
|
|
12744
|
-
"onUpdate:value": (
|
|
12822
|
+
default: withCtx(() => [createVNode(R, {
|
|
12823
|
+
value: O.barcodeField,
|
|
12824
|
+
"onUpdate:value": (A) => O.barcodeField = A,
|
|
12745
12825
|
placeholder: c.$t("sys.chooseText"),
|
|
12746
12826
|
options: r.value,
|
|
12747
12827
|
disabled: e.disabled,
|
|
12748
|
-
onChange:
|
|
12828
|
+
onChange: _
|
|
12749
12829
|
}, null, 8, [
|
|
12750
12830
|
"value",
|
|
12751
12831
|
"onUpdate:value",
|
|
@@ -12756,7 +12836,7 @@ var init_index_es = __esmMin((() => {
|
|
|
12756
12836
|
_: 2
|
|
12757
12837
|
}, 1032, ["name", "rules"]),
|
|
12758
12838
|
g[1] || (g[1] = createElementVNode("div", { class: "field-mapping__divider" }, [createElementVNode("i", { class: "gct-iconfont icon-lianjie field-mapping__link-icon" })], -1)),
|
|
12759
|
-
createVNode(
|
|
12839
|
+
createVNode(C, {
|
|
12760
12840
|
class: "field-mapping__formFields",
|
|
12761
12841
|
name: [
|
|
12762
12842
|
"fillMapArr",
|
|
@@ -12770,17 +12850,17 @@ var init_index_es = __esmMin((() => {
|
|
|
12770
12850
|
message: c.$t("sys.chooseText")
|
|
12771
12851
|
}]
|
|
12772
12852
|
}, {
|
|
12773
|
-
default: withCtx(() => [createVNode(
|
|
12774
|
-
value:
|
|
12775
|
-
"onUpdate:value": (
|
|
12853
|
+
default: withCtx(() => [createVNode(R, {
|
|
12854
|
+
value: O.formFields,
|
|
12855
|
+
"onUpdate:value": (A) => O.formFields = A,
|
|
12776
12856
|
mode: "multiple",
|
|
12777
12857
|
"allow-clear": "",
|
|
12778
12858
|
"show-search": "",
|
|
12779
12859
|
placeholder: c.$t("sys.chooseText"),
|
|
12780
12860
|
options: e.formFieldOptions,
|
|
12781
|
-
"filter-option":
|
|
12861
|
+
"filter-option": h,
|
|
12782
12862
|
disabled: e.disabled,
|
|
12783
|
-
onChange:
|
|
12863
|
+
onChange: _
|
|
12784
12864
|
}, null, 8, [
|
|
12785
12865
|
"value",
|
|
12786
12866
|
"onUpdate:value",
|
|
@@ -12793,10 +12873,10 @@ var init_index_es = __esmMin((() => {
|
|
|
12793
12873
|
e.disabled ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", d2, [createElementVNode("i", {
|
|
12794
12874
|
class: "field-mapping__remove-btn iconfont icon-shanchu1",
|
|
12795
12875
|
title: c.$t("sys.delete"),
|
|
12796
|
-
onClick: (
|
|
12876
|
+
onClick: (A) => S($)
|
|
12797
12877
|
}, null, 8, f2)]))
|
|
12798
12878
|
]))), 128))]),
|
|
12799
|
-
e.disabled ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
12879
|
+
e.disabled ? createCommentVNode("", !0) : (openBlock(), createBlock(T, {
|
|
12800
12880
|
key: 1,
|
|
12801
12881
|
class: "field-mapping__add-btn",
|
|
12802
12882
|
type: "link",
|
|
@@ -12834,50 +12914,50 @@ var init_index_es = __esmMin((() => {
|
|
|
12834
12914
|
parsingRuleId: (_t$bizOptions$scanRul = t.bizOptions.scanRules) === null || _t$bizOptions$scanRul === void 0 ? void 0 : _t$bizOptions$scanRul.parsingRuleId,
|
|
12835
12915
|
fillMapArr: cloneDeep((_t$bizOptions$scanRul2 = t.bizOptions.scanRules) === null || _t$bizOptions$scanRul2 === void 0 ? void 0 : _t$bizOptions$scanRul2.fillMapArr) ?? []
|
|
12836
12916
|
}), f = ref();
|
|
12837
|
-
function r(
|
|
12838
|
-
n.value =
|
|
12917
|
+
function r(k) {
|
|
12918
|
+
n.value = k;
|
|
12839
12919
|
}
|
|
12840
|
-
const i = (
|
|
12841
|
-
f.value =
|
|
12842
|
-
},
|
|
12920
|
+
const i = (k) => {
|
|
12921
|
+
f.value = k;
|
|
12922
|
+
}, _ = async () => {
|
|
12843
12923
|
if (!f.value && !t.bizOptions.scanParam) {
|
|
12844
12924
|
message.error($t("sys.edhr.mcTable.scanRuleNotFound"));
|
|
12845
12925
|
return;
|
|
12846
12926
|
}
|
|
12847
|
-
let
|
|
12927
|
+
let k, m = {};
|
|
12848
12928
|
const d = s.value.fillMapArr;
|
|
12849
|
-
f.value ?
|
|
12929
|
+
f.value ? k = Yf(s.value.str, JSON.stringify(f.value)) : t.bizOptions.scanParam && (k = { [t.bizOptions.scanParam]: s.value.str }), d !== null && d !== void 0 && d.length && k && (m = t2(k, d));
|
|
12850
12930
|
const S = {
|
|
12851
12931
|
str: s.value.str,
|
|
12852
|
-
parsedValue:
|
|
12853
|
-
transformedData:
|
|
12932
|
+
parsedValue: k,
|
|
12933
|
+
transformedData: m,
|
|
12854
12934
|
type: t.bizOptions.showScanAdjustBtn ? n.value : void 0
|
|
12855
|
-
},
|
|
12856
|
-
s.value.str = "",
|
|
12935
|
+
}, h = await t.bizOptions.onScan(S);
|
|
12936
|
+
s.value.str = "", h && t.modalInst.cancel();
|
|
12857
12937
|
};
|
|
12858
|
-
return (
|
|
12859
|
-
const d = resolveComponent("a-input"), S = resolveComponent("a-form-item"),
|
|
12938
|
+
return (k, m) => {
|
|
12939
|
+
const d = resolveComponent("a-input"), S = resolveComponent("a-form-item"), h = resolveComponent("a-form"), c = resolveComponent("a-divider");
|
|
12860
12940
|
return openBlock(), createBlock(wt, mergeProps(t.modalProps, {
|
|
12861
12941
|
class: "gct-form-base-modal-common-scan",
|
|
12862
12942
|
visible: t.modalVisible,
|
|
12863
|
-
title: t.bizOptions.title ||
|
|
12943
|
+
title: t.bizOptions.title || k.$t("sys.edhr.mcTable.scanEntry"),
|
|
12864
12944
|
width: 460,
|
|
12865
12945
|
mask: !1,
|
|
12866
12946
|
"mask-closable": !1,
|
|
12867
12947
|
footer: !1,
|
|
12868
12948
|
draggable: "",
|
|
12869
12949
|
onCancel: t.modalInst.cancel,
|
|
12870
|
-
onAfterClose:
|
|
12950
|
+
onAfterClose: m[5] || (m[5] = (g) => a("afterClose"))
|
|
12871
12951
|
}), {
|
|
12872
12952
|
default: withCtx(() => [createElementVNode("div", v2, [
|
|
12873
12953
|
l.value ? (openBlock(), createElementBlock("div", y2, [createElementVNode("div", {
|
|
12874
12954
|
class: normalizeClass(["bg-radio-item", [n.value === "add" && "active"]]),
|
|
12875
|
-
onClick:
|
|
12876
|
-
}, [...
|
|
12955
|
+
onClick: m[0] || (m[0] = (g) => r("add"))
|
|
12956
|
+
}, [...m[6] || (m[6] = [createElementVNode("i", { class: "iconfont icon-chuangjian" }, null, -1), createTextVNode(" " + toDisplayString("添加实盘数量"), -1)])], 2), createElementVNode("div", {
|
|
12877
12957
|
class: normalizeClass(["bg-radio-item", [n.value === "minus" && "active"]]),
|
|
12878
|
-
onClick:
|
|
12879
|
-
}, [...
|
|
12880
|
-
createVNode(
|
|
12958
|
+
onClick: m[1] || (m[1] = (g) => r("minus"))
|
|
12959
|
+
}, [...m[7] || (m[7] = [createElementVNode("i", { class: "iconfont icon-jiantouxia_arrow-down" }, null, -1), createTextVNode(" " + toDisplayString("减去实盘数量"), -1)])], 2)])) : createCommentVNode("", !0),
|
|
12960
|
+
createVNode(h, {
|
|
12881
12961
|
ref: "formRef",
|
|
12882
12962
|
model: s.value,
|
|
12883
12963
|
layout: "horizontal"
|
|
@@ -12888,10 +12968,10 @@ var init_index_es = __esmMin((() => {
|
|
|
12888
12968
|
}, {
|
|
12889
12969
|
default: withCtx(() => [createVNode(d, {
|
|
12890
12970
|
value: s.value.str,
|
|
12891
|
-
"onUpdate:value":
|
|
12971
|
+
"onUpdate:value": m[2] || (m[2] = (g) => s.value.str = g),
|
|
12892
12972
|
size: "large",
|
|
12893
|
-
placeholder:
|
|
12894
|
-
onKeyup: withKeys(
|
|
12973
|
+
placeholder: k.$t("sys.edhr.mcTable.pleaseScanEntry"),
|
|
12974
|
+
onKeyup: withKeys(_, ["enter"])
|
|
12895
12975
|
}, {
|
|
12896
12976
|
prefix: withCtx(() => [createElementVNode("img", {
|
|
12897
12977
|
src: unref(m2),
|
|
@@ -12911,9 +12991,9 @@ var init_index_es = __esmMin((() => {
|
|
|
12911
12991
|
} }),
|
|
12912
12992
|
createVNode(unref(ho), {
|
|
12913
12993
|
"parsing-rule-id": s.value.parsingRuleId,
|
|
12914
|
-
"onUpdate:parsingRuleId":
|
|
12994
|
+
"onUpdate:parsingRuleId": m[3] || (m[3] = (g) => s.value.parsingRuleId = g),
|
|
12915
12995
|
"fill-map-arr": s.value.fillMapArr,
|
|
12916
|
-
"onUpdate:fillMapArr":
|
|
12996
|
+
"onUpdate:fillMapArr": m[4] || (m[4] = (g) => s.value.fillMapArr = g),
|
|
12917
12997
|
collapsible: "",
|
|
12918
12998
|
"form-field-options": t.bizOptions.formFieldOptions,
|
|
12919
12999
|
"form-fields-label": t.bizOptions.formFieldsLabel,
|
|
@@ -12975,38 +13055,38 @@ var init_index_es = __esmMin((() => {
|
|
|
12975
13055
|
width: 88
|
|
12976
13056
|
}
|
|
12977
13057
|
];
|
|
12978
|
-
function l(
|
|
12979
|
-
return
|
|
13058
|
+
function l(h) {
|
|
13059
|
+
return h ? h.split(":")[0] : "";
|
|
12980
13060
|
}
|
|
12981
|
-
function s(
|
|
12982
|
-
return !
|
|
13061
|
+
function s(h, c) {
|
|
13062
|
+
return !h || !c ? !1 : h === c ? !0 : l(h) === l(c);
|
|
12983
13063
|
}
|
|
12984
|
-
function f(
|
|
13064
|
+
function f(h, c) {
|
|
12985
13065
|
var _o$hasIds;
|
|
12986
|
-
const g = c ??
|
|
12987
|
-
return g ? ((_o$hasIds = o.hasIds) === null || _o$hasIds === void 0 ? void 0 : _o$hasIds.includes(g)) ? $t("sys.edhr.mcTable.materialAlreadyExists") : s(g, t.value.product_id_) ? $t("sys.edhr.mcTable.substituteContainsMainMaterial") : (t.value.substitute_material_entries_ ?? []).some((
|
|
13066
|
+
const g = c ?? h.product_id_;
|
|
13067
|
+
return g ? ((_o$hasIds = o.hasIds) === null || _o$hasIds === void 0 ? void 0 : _o$hasIds.includes(g)) ? $t("sys.edhr.mcTable.materialAlreadyExists") : s(g, t.value.product_id_) ? $t("sys.edhr.mcTable.substituteContainsMainMaterial") : (t.value.substitute_material_entries_ ?? []).some((y) => y.__key !== h.__key && s(y.product_id_, g)) ? $t("sys.edhr.mcTable.substituteMaterialDuplicated") : "" : "";
|
|
12988
13068
|
}
|
|
12989
|
-
function r(
|
|
13069
|
+
function r(h) {
|
|
12990
13070
|
return [{
|
|
12991
13071
|
required: !0,
|
|
12992
13072
|
message: $t("sys.pleaseSelectSth", { sth: $t("sys.material") })
|
|
12993
13073
|
}, { validator: async (c, g) => {
|
|
12994
|
-
const
|
|
12995
|
-
if (
|
|
13074
|
+
const C = f(h, g);
|
|
13075
|
+
if (C) return Promise.reject(C);
|
|
12996
13076
|
} }];
|
|
12997
13077
|
}
|
|
12998
|
-
function i(
|
|
12999
|
-
const c = (
|
|
13078
|
+
function i(h) {
|
|
13079
|
+
const c = (h === null || h === void 0 ? void 0 : h._info) ?? {}, g = ((h === null || h === void 0 ? void 0 : h.displayLabel) || "").split(":"), C = g.length > 1 ? g[0] : typeof (h === null || h === void 0 ? void 0 : h.title) == "string" ? h.title : "";
|
|
13000
13080
|
return {
|
|
13001
13081
|
product_code_: c.code_ ?? "",
|
|
13002
|
-
product_name_: c.name_ ??
|
|
13082
|
+
product_name_: c.name_ ?? C ?? "",
|
|
13003
13083
|
product_version_: c.version_ ?? c.__LABEL__ ?? "",
|
|
13004
13084
|
product_spec_: c.spec_ ?? c.specification_ ?? ""
|
|
13005
13085
|
};
|
|
13006
13086
|
}
|
|
13007
|
-
function h
|
|
13008
|
-
return
|
|
13009
|
-
product_id_:
|
|
13087
|
+
function _(h, c) {
|
|
13088
|
+
return h ? {
|
|
13089
|
+
product_id_: h,
|
|
13010
13090
|
...i(c)
|
|
13011
13091
|
} : {
|
|
13012
13092
|
product_id_: void 0,
|
|
@@ -13016,17 +13096,17 @@ var init_index_es = __esmMin((() => {
|
|
|
13016
13096
|
product_spec_: void 0
|
|
13017
13097
|
};
|
|
13018
13098
|
}
|
|
13019
|
-
function
|
|
13099
|
+
function k() {
|
|
13020
13100
|
var _o$form;
|
|
13021
|
-
const
|
|
13101
|
+
const h = (t.value.substitute_material_entries_ ?? []).map((c, g) => [
|
|
13022
13102
|
"substitute_material_entries_",
|
|
13023
13103
|
g,
|
|
13024
13104
|
"product_id_"
|
|
13025
13105
|
]);
|
|
13026
|
-
if (
|
|
13106
|
+
if (h.length) return (_o$form = o.form) === null || _o$form === void 0 ? void 0 : _o$form.validateFields(h).catch(() => {});
|
|
13027
13107
|
}
|
|
13028
|
-
function
|
|
13029
|
-
Object.assign(
|
|
13108
|
+
function m(h, c, g) {
|
|
13109
|
+
Object.assign(h, _(c ?? null, g)), nextTick(() => k());
|
|
13030
13110
|
}
|
|
13031
13111
|
function d() {
|
|
13032
13112
|
t.value.substitute_material_entries_.push({
|
|
@@ -13039,44 +13119,44 @@ var init_index_es = __esmMin((() => {
|
|
|
13039
13119
|
qty_required_: t.value.qty_required_ ?? 0
|
|
13040
13120
|
});
|
|
13041
13121
|
}
|
|
13042
|
-
function S(
|
|
13043
|
-
t.value.substitute_material_entries_.splice(
|
|
13122
|
+
function S(h) {
|
|
13123
|
+
t.value.substitute_material_entries_.splice(h, 1), nextTick(() => k());
|
|
13044
13124
|
}
|
|
13045
13125
|
return watch(() => t.value.product_id_, () => {
|
|
13046
|
-
nextTick(() =>
|
|
13047
|
-
}), (
|
|
13048
|
-
const g = resolveComponent("a-radio"),
|
|
13049
|
-
return openBlock(), createElementBlock(Fragment, null, [createVNode(
|
|
13050
|
-
label:
|
|
13126
|
+
nextTick(() => k());
|
|
13127
|
+
}), (h, c) => {
|
|
13128
|
+
const g = resolveComponent("a-radio"), C = resolveComponent("a-radio-group"), y = resolveComponent("a-form-item"), R = resolveComponent("a-select"), T = resolveComponent("a-col"), q = resolveComponent("a-row"), O = resolveComponent("a-button"), $ = resolveComponent("a-table");
|
|
13129
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(y, {
|
|
13130
|
+
label: h.$t("sys.edhr.mcTable.substituteMaterialEnabled"),
|
|
13051
13131
|
name: "substitute_material_enabled_",
|
|
13052
|
-
rules: [unref(Te)(
|
|
13132
|
+
rules: [unref(Te)(h.$t("sys.edhr.mcTable.substituteMaterialEnabled"))]
|
|
13053
13133
|
}, {
|
|
13054
|
-
default: withCtx(() => [createVNode(
|
|
13134
|
+
default: withCtx(() => [createVNode(C, {
|
|
13055
13135
|
value: t.value.substitute_material_enabled_,
|
|
13056
|
-
"onUpdate:value": c[0] || (c[0] = (
|
|
13136
|
+
"onUpdate:value": c[0] || (c[0] = (A) => t.value.substitute_material_enabled_ = A)
|
|
13057
13137
|
}, {
|
|
13058
13138
|
default: withCtx(() => [createVNode(g, { value: !0 }, {
|
|
13059
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13139
|
+
default: withCtx(() => [createTextVNode(toDisplayString(h.$t("sys.true")), 1)]),
|
|
13060
13140
|
_: 1
|
|
13061
13141
|
}), createVNode(g, { value: !1 }, {
|
|
13062
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13142
|
+
default: withCtx(() => [createTextVNode(toDisplayString(h.$t("sys.false")), 1)]),
|
|
13063
13143
|
_: 1
|
|
13064
13144
|
})]),
|
|
13065
13145
|
_: 1
|
|
13066
13146
|
}, 8, ["value"])]),
|
|
13067
13147
|
_: 1
|
|
13068
13148
|
}, 8, ["label", "rules"]), t.value.substitute_material_enabled_ ? (openBlock(), createElementBlock("div", b2, [
|
|
13069
|
-
createVNode(
|
|
13070
|
-
default: withCtx(() => [createVNode(
|
|
13071
|
-
default: withCtx(() => [createVNode(
|
|
13072
|
-
label:
|
|
13149
|
+
createVNode(q, { gutter: 16 }, {
|
|
13150
|
+
default: withCtx(() => [createVNode(T, { span: 12 }, {
|
|
13151
|
+
default: withCtx(() => [createVNode(y, {
|
|
13152
|
+
label: h.$t("sys.edhr.mcTable.substitutePolicy"),
|
|
13073
13153
|
name: "substitute_policy_",
|
|
13074
13154
|
required: ""
|
|
13075
13155
|
}, {
|
|
13076
|
-
default: withCtx(() => [createVNode(
|
|
13156
|
+
default: withCtx(() => [createVNode(R, {
|
|
13077
13157
|
value: t.value.substitute_policy_,
|
|
13078
|
-
"onUpdate:value": c[1] || (c[1] = (
|
|
13079
|
-
placeholder:
|
|
13158
|
+
"onUpdate:value": c[1] || (c[1] = (A) => t.value.substitute_policy_ = A),
|
|
13159
|
+
placeholder: h.$t("sys.chooseText"),
|
|
13080
13160
|
options: a
|
|
13081
13161
|
}, null, 8, ["value", "placeholder"])]),
|
|
13082
13162
|
_: 1
|
|
@@ -13085,12 +13165,12 @@ var init_index_es = __esmMin((() => {
|
|
|
13085
13165
|
})]),
|
|
13086
13166
|
_: 1
|
|
13087
13167
|
}),
|
|
13088
|
-
createElementVNode("div", w2, [createVNode(
|
|
13168
|
+
createElementVNode("div", w2, [createVNode(O, {
|
|
13089
13169
|
type: "link",
|
|
13090
13170
|
class: "substitute-policy-item__add-row",
|
|
13091
13171
|
onClick: d
|
|
13092
13172
|
}, {
|
|
13093
|
-
default: withCtx(() => [createVNode(unref(PlusOutlined)), createTextVNode(" " + toDisplayString(
|
|
13173
|
+
default: withCtx(() => [createVNode(unref(PlusOutlined)), createTextVNode(" " + toDisplayString(h.$t("sys.edhr.addRow")), 1)]),
|
|
13094
13174
|
_: 1
|
|
13095
13175
|
})]),
|
|
13096
13176
|
createVNode($, {
|
|
@@ -13099,41 +13179,41 @@ var init_index_es = __esmMin((() => {
|
|
|
13099
13179
|
pagination: !1,
|
|
13100
13180
|
size: "small",
|
|
13101
13181
|
"row-key": "__key",
|
|
13102
|
-
locale: { emptyText:
|
|
13182
|
+
locale: { emptyText: h.$t("sys.noData") }
|
|
13103
13183
|
}, {
|
|
13104
|
-
headerCell: withCtx(({ column:
|
|
13105
|
-
bodyCell: withCtx(({ column:
|
|
13184
|
+
headerCell: withCtx(({ column: A }) => [A.key === "product_id_" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [c[2] || (c[2] = createElementVNode("span", { class: "substitute-policy-item__required-mark" }, "*", -1)), createTextVNode(" " + toDisplayString(A.title), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(A.title), 1)], 64))]),
|
|
13185
|
+
bodyCell: withCtx(({ column: A, record: V, index: M }) => [A.key === "index" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(M + 1), 1)], 64)) : A.key === "product_id_" ? (openBlock(), createBlock(y, {
|
|
13106
13186
|
key: 1,
|
|
13107
13187
|
class: "substitute-policy-item__table-item",
|
|
13108
13188
|
name: [
|
|
13109
13189
|
"substitute_material_entries_",
|
|
13110
|
-
|
|
13190
|
+
M,
|
|
13111
13191
|
"product_id_"
|
|
13112
13192
|
],
|
|
13113
|
-
rules: r(
|
|
13193
|
+
rules: r(V)
|
|
13114
13194
|
}, {
|
|
13115
13195
|
default: withCtx(() => [createVNode(unref(na), {
|
|
13116
|
-
"model-value":
|
|
13196
|
+
"model-value": V.product_id_ || void 0,
|
|
13117
13197
|
"model-key": "em_product",
|
|
13118
|
-
placeholder:
|
|
13198
|
+
placeholder: h.$t("sys.chooseText"),
|
|
13119
13199
|
"parent-to-default": !1,
|
|
13120
13200
|
"disabled-parent": !1,
|
|
13121
13201
|
"show-search": !0,
|
|
13122
13202
|
"query-data": { "product_type_.ne": "finishedProduct" },
|
|
13123
|
-
onChange: (
|
|
13203
|
+
onChange: (L, N) => m(V, L, N)
|
|
13124
13204
|
}, null, 8, [
|
|
13125
13205
|
"model-value",
|
|
13126
13206
|
"placeholder",
|
|
13127
13207
|
"onChange"
|
|
13128
13208
|
])]),
|
|
13129
13209
|
_: 2
|
|
13130
|
-
}, 1032, ["name", "rules"])) :
|
|
13210
|
+
}, 1032, ["name", "rules"])) : A.key === "action" ? (openBlock(), createBlock(O, {
|
|
13131
13211
|
key: 2,
|
|
13132
13212
|
type: "link",
|
|
13133
13213
|
danger: "",
|
|
13134
|
-
onClick: (
|
|
13214
|
+
onClick: (L) => S(M)
|
|
13135
13215
|
}, {
|
|
13136
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13216
|
+
default: withCtx(() => [createTextVNode(toDisplayString(h.$t("sys.delete")), 1)]),
|
|
13137
13217
|
_: 1
|
|
13138
13218
|
}, 8, ["onClick"])) : createCommentVNode("", !0)]),
|
|
13139
13219
|
_: 1
|
|
@@ -13189,14 +13269,14 @@ var init_index_es = __esmMin((() => {
|
|
|
13189
13269
|
force_loading_enabled_: !0
|
|
13190
13270
|
};
|
|
13191
13271
|
}
|
|
13192
|
-
function f(
|
|
13193
|
-
return (
|
|
13272
|
+
function f(O) {
|
|
13273
|
+
return (O ?? []).map(($) => ({
|
|
13194
13274
|
...cloneDeep($),
|
|
13195
13275
|
__key: Ze(8)
|
|
13196
13276
|
}));
|
|
13197
13277
|
}
|
|
13198
|
-
function r(
|
|
13199
|
-
return (
|
|
13278
|
+
function r(O) {
|
|
13279
|
+
return (O ?? []).map(($) => ({
|
|
13200
13280
|
...cloneDeep($),
|
|
13201
13281
|
__key: Ze(8)
|
|
13202
13282
|
}));
|
|
@@ -13207,14 +13287,14 @@ var init_index_es = __esmMin((() => {
|
|
|
13207
13287
|
substitute_material_entries_: f((_t$bizOptions$data = t.bizOptions.data) === null || _t$bizOptions$data === void 0 ? void 0 : _t$bizOptions$data.substitute_material_entries_),
|
|
13208
13288
|
consume_storage_entries_: r((_t$bizOptions$data2 = t.bizOptions.data) === null || _t$bizOptions$data2 === void 0 ? void 0 : _t$bizOptions$data2.consume_storage_entries_)
|
|
13209
13289
|
});
|
|
13210
|
-
const
|
|
13211
|
-
const
|
|
13290
|
+
const _ = computed(() => {
|
|
13291
|
+
const O = {
|
|
13212
13292
|
product_id_: [{
|
|
13213
13293
|
required: !0,
|
|
13214
13294
|
message: $t("sys.pleaseSelectSth", { sth: $t("sys.material") })
|
|
13215
|
-
}, { validator: async ($,
|
|
13216
|
-
const
|
|
13217
|
-
if (
|
|
13295
|
+
}, { validator: async ($, A) => {
|
|
13296
|
+
const V = c(A);
|
|
13297
|
+
if (V) return Promise.reject(V);
|
|
13218
13298
|
} }],
|
|
13219
13299
|
qty_required_: [{
|
|
13220
13300
|
required: !0,
|
|
@@ -13226,42 +13306,42 @@ var init_index_es = __esmMin((() => {
|
|
|
13226
13306
|
}],
|
|
13227
13307
|
force_loading_enabled_: [Te($t("sys.edhr.mcTable.forceLoadingEnabled"))]
|
|
13228
13308
|
};
|
|
13229
|
-
return i.type_ !== "view" && (
|
|
13309
|
+
return i.type_ !== "view" && (O.consume_enabled_ = [Te($t("sys.edhr.mcTable.consumeEnabled"))], i.consume_enabled_ && (O.consume_source_config_ = [{
|
|
13230
13310
|
required: !0,
|
|
13231
13311
|
message: $t("sys.pleaseSelectSth", { sth: $t("sys.edhr.mcTable.consumeSourceConfig") })
|
|
13232
|
-
}], i.consume_source_config_ === "custom" && (
|
|
13312
|
+
}], i.consume_source_config_ === "custom" && (O.default_warehouse_id_ = [{
|
|
13233
13313
|
required: !0,
|
|
13234
13314
|
message: $t("sys.pleaseSelectSth", { sth: $t("sys.edhr.mcTable.defaultWarehouse") })
|
|
13235
|
-
}])),
|
|
13315
|
+
}])), O.qty_validation_enabled_ = [Te($t("sys.edhr.mcTable.qtyValidationEnabled"))], i.qty_validation_enabled_ && (O.qty_validation_rule_ = [{
|
|
13236
13316
|
required: !0,
|
|
13237
13317
|
message: $t("sys.pleaseSelectSth", { sth: $t("sys.edhr.mcTable.qtyValidationRule") })
|
|
13238
|
-
}], i.qty_validation_rule_ === "bounds" && (
|
|
13318
|
+
}], i.qty_validation_rule_ === "bounds" && (O.max_value_ = [{
|
|
13239
13319
|
required: !0,
|
|
13240
13320
|
message: $t("sys.pleaseInputSth", { sth: $t("sys.edhr.mcTable.qtyValidationMax") })
|
|
13241
|
-
}],
|
|
13321
|
+
}], O.min_value_ = [{
|
|
13242
13322
|
required: !0,
|
|
13243
13323
|
message: $t("sys.pleaseInputSth", { sth: $t("sys.edhr.mcTable.qtyValidationMin") })
|
|
13244
|
-
}])),
|
|
13324
|
+
}])), O.substitute_material_enabled_ = [Te($t("sys.edhr.mcTable.substituteMaterialEnabled"))], i.substitute_material_enabled_ && (O.substitute_policy_ = [{
|
|
13245
13325
|
required: !0,
|
|
13246
13326
|
message: $t("sys.pleaseSelectSth", { sth: $t("sys.edhr.mcTable.substitutePolicy") })
|
|
13247
|
-
}])), i.type_ === "by_lot" && (
|
|
13327
|
+
}])), i.type_ === "by_lot" && (O.lot_mixing_enabled_ = [Te($t("sys.edhr.mcTable.lotMixingEnabled"))], i.lot_mixing_enabled_ && (O.lot_mixing_times_ = [{
|
|
13248
13328
|
required: !0,
|
|
13249
13329
|
message: $t("sys.pleaseInputSth", { sth: $t("sys.edhr.mcTable.lotMixingTimes") })
|
|
13250
|
-
}])),
|
|
13330
|
+
}])), O;
|
|
13251
13331
|
});
|
|
13252
|
-
function
|
|
13253
|
-
const $ = (
|
|
13332
|
+
function k(O) {
|
|
13333
|
+
const $ = (O === null || O === void 0 ? void 0 : O._info) ?? {}, A = ((O === null || O === void 0 ? void 0 : O.displayLabel) || "").split(":"), V = A.length > 1 ? A[0] : typeof (O === null || O === void 0 ? void 0 : O.title) == "string" ? O.title : "";
|
|
13254
13334
|
return {
|
|
13255
13335
|
product_code_: $.code_ ?? "",
|
|
13256
|
-
product_name_: $.name_ ??
|
|
13336
|
+
product_name_: $.name_ ?? V ?? "",
|
|
13257
13337
|
product_version_: $.version_ ?? $.__LABEL__ ?? "",
|
|
13258
13338
|
product_spec_: $.spec_ ?? $.specification_ ?? ""
|
|
13259
13339
|
};
|
|
13260
13340
|
}
|
|
13261
|
-
function
|
|
13262
|
-
return
|
|
13263
|
-
product_id_:
|
|
13264
|
-
...
|
|
13341
|
+
function m(O, $) {
|
|
13342
|
+
return O ? {
|
|
13343
|
+
product_id_: O,
|
|
13344
|
+
...k($)
|
|
13265
13345
|
} : {
|
|
13266
13346
|
product_id_: void 0,
|
|
13267
13347
|
product_code_: void 0,
|
|
@@ -13270,49 +13350,49 @@ var init_index_es = __esmMin((() => {
|
|
|
13270
13350
|
product_spec_: void 0
|
|
13271
13351
|
};
|
|
13272
13352
|
}
|
|
13273
|
-
function d(
|
|
13274
|
-
return
|
|
13353
|
+
function d(O) {
|
|
13354
|
+
return O ? O.split(":")[0] : "";
|
|
13275
13355
|
}
|
|
13276
|
-
function S(
|
|
13277
|
-
return !
|
|
13356
|
+
function S(O, $) {
|
|
13357
|
+
return !O || !$ ? !1 : O === $ ? !0 : d(O) === d($);
|
|
13278
13358
|
}
|
|
13279
|
-
function
|
|
13280
|
-
return
|
|
13359
|
+
function h(O) {
|
|
13360
|
+
return O ? (t.bizOptions.hasIds ?? []).some(($) => S($, O)) : !1;
|
|
13281
13361
|
}
|
|
13282
|
-
function c(
|
|
13283
|
-
const $ =
|
|
13284
|
-
return $ &&
|
|
13362
|
+
function c(O) {
|
|
13363
|
+
const $ = O ?? i.product_id_;
|
|
13364
|
+
return $ && h($) ? $t("sys.edhr.mcTable.materialAlreadyExists") : "";
|
|
13285
13365
|
}
|
|
13286
|
-
function g(
|
|
13287
|
-
Object.assign(i,
|
|
13366
|
+
function g(O, $) {
|
|
13367
|
+
Object.assign(i, m(O ?? null, $));
|
|
13288
13368
|
}
|
|
13289
|
-
function
|
|
13290
|
-
return
|
|
13291
|
-
const { __key:
|
|
13369
|
+
function C(O = []) {
|
|
13370
|
+
return O.map(($) => {
|
|
13371
|
+
const { __key: A, ...V } = $;
|
|
13292
13372
|
return {
|
|
13293
|
-
...
|
|
13294
|
-
qty_required_: i.qty_required_ ??
|
|
13373
|
+
...V,
|
|
13374
|
+
qty_required_: i.qty_required_ ?? V.qty_required_ ?? 0
|
|
13295
13375
|
};
|
|
13296
13376
|
});
|
|
13297
13377
|
}
|
|
13298
|
-
function
|
|
13299
|
-
return
|
|
13300
|
-
const { __key:
|
|
13301
|
-
return
|
|
13378
|
+
function y(O = []) {
|
|
13379
|
+
return O.map(($) => {
|
|
13380
|
+
const { __key: A, ...V } = $;
|
|
13381
|
+
return V;
|
|
13302
13382
|
});
|
|
13303
13383
|
}
|
|
13304
|
-
function
|
|
13305
|
-
|
|
13384
|
+
function R(O) {
|
|
13385
|
+
O.consume_enabled_ = !1, O.consume_source_config_ = void 0, O.default_warehouse_id_ = void 0, O.default_location_id_ = void 0, O.consume_storage_entries_ = [];
|
|
13306
13386
|
}
|
|
13307
|
-
function
|
|
13308
|
-
const { substitute_material_entries_: $ = [], consume_storage_entries_:
|
|
13309
|
-
...
|
|
13387
|
+
function T() {
|
|
13388
|
+
const { substitute_material_entries_: $ = [], consume_storage_entries_: A = [], ...V } = cloneDeep(i), M = {
|
|
13389
|
+
...V,
|
|
13310
13390
|
substitute_material_entries_: [],
|
|
13311
13391
|
consume_storage_entries_: []
|
|
13312
13392
|
};
|
|
13313
|
-
return
|
|
13393
|
+
return M.type_ === "view" ? (M.qty_validation_enabled_ = !1, M.qty_validation_rule_ = "eq", M.max_value_ = void 0, M.min_value_ = void 0, M.lot_mixing_enabled_ = !1, M.lot_mixing_times_ = 1, M.substitute_material_enabled_ = !1, M.substitute_policy_ = "only_one", M.substitute_material_entries_ = [], R(M), M) : (M.consume_enabled_ ? M.consume_source_config_ !== "custom" ? (M.default_warehouse_id_ = void 0, M.default_location_id_ = void 0, M.consume_storage_entries_ = []) : M.consume_storage_entries_ = y(A) : (R(M), M.consume_enabled_ = !1), M.qty_validation_enabled_ ? M.qty_validation_rule_ !== "bounds" && (M.max_value_ = void 0, M.min_value_ = void 0) : (M.qty_validation_rule_ = "eq", M.max_value_ = void 0, M.min_value_ = void 0), M.substitute_material_enabled_ ? M.substitute_material_entries_ = C($) : (M.substitute_policy_ = "only_one", M.substitute_material_entries_ = []), M.type_ !== "by_lot" ? (M.lot_mixing_enabled_ = !1, M.lot_mixing_times_ = 1) : M.lot_mixing_enabled_ || (M.lot_mixing_times_ = 1), M);
|
|
13314
13394
|
}
|
|
13315
|
-
const
|
|
13395
|
+
const q = async () => {
|
|
13316
13396
|
var _i$substitute_materia;
|
|
13317
13397
|
try {
|
|
13318
13398
|
var _l$value15;
|
|
@@ -13324,10 +13404,10 @@ var init_index_es = __esmMin((() => {
|
|
|
13324
13404
|
message.warning($t("sys.edhr.mcTable.substituteMaterialRequired"));
|
|
13325
13405
|
return;
|
|
13326
13406
|
}
|
|
13327
|
-
t.modalInst.confirm(
|
|
13407
|
+
t.modalInst.confirm(T());
|
|
13328
13408
|
};
|
|
13329
|
-
return (
|
|
13330
|
-
const
|
|
13409
|
+
return (O, $) => {
|
|
13410
|
+
const A = resolveComponent("a-form-item"), V = resolveComponent("a-col"), M = resolveComponent("a-input-number"), L = resolveComponent("a-row"), N = resolveComponent("a-radio"), J = resolveComponent("a-radio-group"), oe = resolveComponent("a-form");
|
|
13331
13411
|
return openBlock(), createBlock(wt, mergeProps(t.modalProps, {
|
|
13332
13412
|
class: "gct-form-base-modal-bom-entry-modal",
|
|
13333
13413
|
visible: t.modalVisible,
|
|
@@ -13339,21 +13419,21 @@ var init_index_es = __esmMin((() => {
|
|
|
13339
13419
|
overflow: "hidden"
|
|
13340
13420
|
},
|
|
13341
13421
|
onCancel: t.modalInst.cancel,
|
|
13342
|
-
onOk:
|
|
13422
|
+
onOk: q,
|
|
13343
13423
|
onAfterClose: $[8] || ($[8] = (E) => a("afterClose"))
|
|
13344
13424
|
}), {
|
|
13345
13425
|
default: withCtx(() => [createElementVNode("div", x2, [createVNode(oe, {
|
|
13346
13426
|
ref_key: "formRef",
|
|
13347
13427
|
ref: l,
|
|
13348
13428
|
model: unref(i),
|
|
13349
|
-
rules:
|
|
13429
|
+
rules: _.value
|
|
13350
13430
|
}, {
|
|
13351
13431
|
default: withCtx(() => [
|
|
13352
|
-
createElementVNode("div", S2, toDisplayString(
|
|
13353
|
-
createVNode(
|
|
13354
|
-
default: withCtx(() => [createVNode(
|
|
13355
|
-
default: withCtx(() => [createVNode(
|
|
13356
|
-
label:
|
|
13432
|
+
createElementVNode("div", S2, toDisplayString(O.$t("sys.appDesigner.basicInformation")), 1),
|
|
13433
|
+
createVNode(L, { gutter: 16 }, {
|
|
13434
|
+
default: withCtx(() => [createVNode(V, { span: 12 }, {
|
|
13435
|
+
default: withCtx(() => [createVNode(A, {
|
|
13436
|
+
label: O.$t("sys.material"),
|
|
13357
13437
|
name: "product_id_",
|
|
13358
13438
|
required: "",
|
|
13359
13439
|
"validate-status": c() ? "error" : void 0,
|
|
@@ -13362,7 +13442,7 @@ var init_index_es = __esmMin((() => {
|
|
|
13362
13442
|
default: withCtx(() => [createVNode(unref(na), {
|
|
13363
13443
|
"model-value": unref(i).product_id_ || void 0,
|
|
13364
13444
|
"model-key": "em_product",
|
|
13365
|
-
placeholder:
|
|
13445
|
+
placeholder: O.$t("sys.chooseText"),
|
|
13366
13446
|
"parent-to-default": !1,
|
|
13367
13447
|
"disabled-parent": !1,
|
|
13368
13448
|
"show-search": !0,
|
|
@@ -13376,17 +13456,17 @@ var init_index_es = __esmMin((() => {
|
|
|
13376
13456
|
"help"
|
|
13377
13457
|
])]),
|
|
13378
13458
|
_: 1
|
|
13379
|
-
}), createVNode(
|
|
13380
|
-
default: withCtx(() => [createVNode(
|
|
13381
|
-
label:
|
|
13459
|
+
}), createVNode(V, { span: 12 }, {
|
|
13460
|
+
default: withCtx(() => [createVNode(A, {
|
|
13461
|
+
label: O.$t("sys.edhr.unitQty"),
|
|
13382
13462
|
name: "qty_required_",
|
|
13383
13463
|
required: ""
|
|
13384
13464
|
}, {
|
|
13385
|
-
default: withCtx(() => [createVNode(
|
|
13465
|
+
default: withCtx(() => [createVNode(M, {
|
|
13386
13466
|
value: unref(i).qty_required_,
|
|
13387
13467
|
"onUpdate:value": $[0] || ($[0] = (E) => unref(i).qty_required_ = E),
|
|
13388
13468
|
style: { width: "100%" },
|
|
13389
|
-
placeholder:
|
|
13469
|
+
placeholder: O.$t("sys.inputText"),
|
|
13390
13470
|
min: 0
|
|
13391
13471
|
}, null, 8, ["value", "placeholder"])]),
|
|
13392
13472
|
_: 1
|
|
@@ -13395,30 +13475,30 @@ var init_index_es = __esmMin((() => {
|
|
|
13395
13475
|
})]),
|
|
13396
13476
|
_: 1
|
|
13397
13477
|
}),
|
|
13398
|
-
createElementVNode("div", M2, toDisplayString(
|
|
13399
|
-
createVNode(
|
|
13478
|
+
createElementVNode("div", M2, toDisplayString(O.$t("sys.edhr.mcTable.materialStrategyConfig")), 1),
|
|
13479
|
+
createVNode(A, {
|
|
13400
13480
|
name: "type_",
|
|
13401
13481
|
required: ""
|
|
13402
13482
|
}, {
|
|
13403
|
-
label: withCtx(() => [createElementVNode("span", null, toDisplayString(
|
|
13483
|
+
label: withCtx(() => [createElementVNode("span", null, toDisplayString(O.$t("sys.edhr.mcTable.loadingType")), 1), createVNode(unref(Gt), {
|
|
13404
13484
|
class: "bom-entry-modal__label-tip",
|
|
13405
|
-
info:
|
|
13485
|
+
info: O.$t("sys.edhr.mcTable.loadingTypeTip")
|
|
13406
13486
|
}, null, 8, ["info"])]),
|
|
13407
13487
|
default: withCtx(() => [createVNode(J, {
|
|
13408
13488
|
value: unref(i).type_,
|
|
13409
13489
|
"onUpdate:value": $[1] || ($[1] = (E) => unref(i).type_ = E)
|
|
13410
13490
|
}, {
|
|
13411
13491
|
default: withCtx(() => [
|
|
13412
|
-
createVNode(
|
|
13413
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13492
|
+
createVNode(N, { value: "view" }, {
|
|
13493
|
+
default: withCtx(() => [createTextVNode(toDisplayString(O.$t("sys.edhr.mcTable.loadingTypeView")), 1)]),
|
|
13414
13494
|
_: 1
|
|
13415
13495
|
}),
|
|
13416
|
-
createVNode(
|
|
13417
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13496
|
+
createVNode(N, { value: "by_number" }, {
|
|
13497
|
+
default: withCtx(() => [createTextVNode(toDisplayString(O.$t("sys.edhr.mcTable.loadingTypeByNumber")), 1)]),
|
|
13418
13498
|
_: 1
|
|
13419
13499
|
}),
|
|
13420
|
-
createVNode(
|
|
13421
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13500
|
+
createVNode(N, { value: "by_lot" }, {
|
|
13501
|
+
default: withCtx(() => [createTextVNode(toDisplayString(O.$t("sys.edhr.mcTable.loadingTypeByLot")), 1)]),
|
|
13422
13502
|
_: 1
|
|
13423
13503
|
})
|
|
13424
13504
|
]),
|
|
@@ -13437,36 +13517,36 @@ var init_index_es = __esmMin((() => {
|
|
|
13437
13517
|
"form-state": unref(i),
|
|
13438
13518
|
"onUpdate:formState": $[3] || ($[3] = (E) => isRef(i) ? i.value = E : i = E)
|
|
13439
13519
|
}, null, 8, ["form-state"])) : createCommentVNode("", !0),
|
|
13440
|
-
unref(i).type_ === "by_lot" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createVNode(
|
|
13441
|
-
label:
|
|
13520
|
+
unref(i).type_ === "by_lot" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createVNode(A, {
|
|
13521
|
+
label: O.$t("sys.edhr.mcTable.lotMixingEnabled"),
|
|
13442
13522
|
name: "lot_mixing_enabled_"
|
|
13443
13523
|
}, {
|
|
13444
13524
|
default: withCtx(() => [createVNode(J, {
|
|
13445
13525
|
value: unref(i).lot_mixing_enabled_,
|
|
13446
13526
|
"onUpdate:value": $[4] || ($[4] = (E) => unref(i).lot_mixing_enabled_ = E)
|
|
13447
13527
|
}, {
|
|
13448
|
-
default: withCtx(() => [createVNode(
|
|
13449
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13528
|
+
default: withCtx(() => [createVNode(N, { value: !0 }, {
|
|
13529
|
+
default: withCtx(() => [createTextVNode(toDisplayString(O.$t("sys.true")), 1)]),
|
|
13450
13530
|
_: 1
|
|
13451
|
-
}), createVNode(
|
|
13452
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13531
|
+
}), createVNode(N, { value: !1 }, {
|
|
13532
|
+
default: withCtx(() => [createTextVNode(toDisplayString(O.$t("sys.false")), 1)]),
|
|
13453
13533
|
_: 1
|
|
13454
13534
|
})]),
|
|
13455
13535
|
_: 1
|
|
13456
13536
|
}, 8, ["value"])]),
|
|
13457
13537
|
_: 1
|
|
13458
|
-
}, 8, ["label"]), unref(i).lot_mixing_enabled_ ? (openBlock(), createElementBlock("div", A2, [createVNode(
|
|
13459
|
-
default: withCtx(() => [createVNode(
|
|
13460
|
-
default: withCtx(() => [createVNode(
|
|
13461
|
-
label:
|
|
13538
|
+
}, 8, ["label"]), unref(i).lot_mixing_enabled_ ? (openBlock(), createElementBlock("div", A2, [createVNode(L, { gutter: 16 }, {
|
|
13539
|
+
default: withCtx(() => [createVNode(V, { span: 12 }, {
|
|
13540
|
+
default: withCtx(() => [createVNode(A, {
|
|
13541
|
+
label: O.$t("sys.edhr.mcTable.lotMixingTimes"),
|
|
13462
13542
|
name: "lot_mixing_times_",
|
|
13463
13543
|
required: ""
|
|
13464
13544
|
}, {
|
|
13465
|
-
default: withCtx(() => [createVNode(
|
|
13545
|
+
default: withCtx(() => [createVNode(M, {
|
|
13466
13546
|
value: unref(i).lot_mixing_times_,
|
|
13467
13547
|
"onUpdate:value": $[5] || ($[5] = (E) => unref(i).lot_mixing_times_ = E),
|
|
13468
13548
|
style: { width: "100%" },
|
|
13469
|
-
placeholder:
|
|
13549
|
+
placeholder: O.$t("sys.inputText"),
|
|
13470
13550
|
min: 1,
|
|
13471
13551
|
precision: 0
|
|
13472
13552
|
}, null, 8, ["value", "placeholder"])]),
|
|
@@ -13487,19 +13567,19 @@ var init_index_es = __esmMin((() => {
|
|
|
13487
13567
|
"form",
|
|
13488
13568
|
"hasIds"
|
|
13489
13569
|
])) : createCommentVNode("", !0),
|
|
13490
|
-
createVNode(
|
|
13491
|
-
label:
|
|
13570
|
+
createVNode(A, {
|
|
13571
|
+
label: O.$t("sys.edhr.mcTable.forceLoadingEnabled"),
|
|
13492
13572
|
name: "force_loading_enabled_"
|
|
13493
13573
|
}, {
|
|
13494
13574
|
default: withCtx(() => [createVNode(J, {
|
|
13495
13575
|
value: unref(i).force_loading_enabled_,
|
|
13496
13576
|
"onUpdate:value": $[7] || ($[7] = (E) => unref(i).force_loading_enabled_ = E)
|
|
13497
13577
|
}, {
|
|
13498
|
-
default: withCtx(() => [createVNode(
|
|
13499
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13578
|
+
default: withCtx(() => [createVNode(N, { value: !0 }, {
|
|
13579
|
+
default: withCtx(() => [createTextVNode(toDisplayString(O.$t("sys.true")), 1)]),
|
|
13500
13580
|
_: 1
|
|
13501
|
-
}), createVNode(
|
|
13502
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
13581
|
+
}), createVNode(N, { value: !1 }, {
|
|
13582
|
+
default: withCtx(() => [createTextVNode(toDisplayString(O.$t("sys.false")), 1)]),
|
|
13503
13583
|
_: 1
|
|
13504
13584
|
})]),
|
|
13505
13585
|
_: 1
|
|
@@ -13544,15 +13624,15 @@ var init_index_es = __esmMin((() => {
|
|
|
13544
13624
|
if (t.bizOptions.readonly) return;
|
|
13545
13625
|
try {
|
|
13546
13626
|
var _n$value11;
|
|
13547
|
-
const
|
|
13548
|
-
|
|
13627
|
+
const k = (_n$value11 = n.value) === null || _n$value11 === void 0 ? void 0 : _n$value11.validate;
|
|
13628
|
+
k && await k();
|
|
13549
13629
|
} catch {
|
|
13550
13630
|
return;
|
|
13551
13631
|
}
|
|
13552
|
-
const
|
|
13553
|
-
t.modalInst.confirm(
|
|
13632
|
+
const _ = r() ? void 0 : cloneDeep(toRaw(l));
|
|
13633
|
+
t.modalInst.confirm(_);
|
|
13554
13634
|
};
|
|
13555
|
-
return (
|
|
13635
|
+
return (_, k) => (openBlock(), createBlock(wt, mergeProps(f.value, {
|
|
13556
13636
|
class: "gct-form-base-modal-parse-rule",
|
|
13557
13637
|
visible: t.modalVisible,
|
|
13558
13638
|
title: s.value,
|
|
@@ -13560,7 +13640,7 @@ var init_index_es = __esmMin((() => {
|
|
|
13560
13640
|
draggable: "",
|
|
13561
13641
|
onCancel: t.modalInst.cancel,
|
|
13562
13642
|
onOk: i,
|
|
13563
|
-
onAfterClose:
|
|
13643
|
+
onAfterClose: k[2] || (k[2] = (m) => a("afterClose"))
|
|
13564
13644
|
}), {
|
|
13565
13645
|
default: withCtx(() => {
|
|
13566
13646
|
var _e$bizOptions;
|
|
@@ -13568,9 +13648,9 @@ var init_index_es = __esmMin((() => {
|
|
|
13568
13648
|
ref_key: "fieldMappingRef",
|
|
13569
13649
|
ref: n,
|
|
13570
13650
|
"parsing-rule-id": l.parsingRuleId,
|
|
13571
|
-
"onUpdate:parsingRuleId":
|
|
13651
|
+
"onUpdate:parsingRuleId": k[0] || (k[0] = (m) => l.parsingRuleId = m),
|
|
13572
13652
|
"fill-map-arr": l.fillMapArr,
|
|
13573
|
-
"onUpdate:fillMapArr":
|
|
13653
|
+
"onUpdate:fillMapArr": k[1] || (k[1] = (m) => l.fillMapArr = m),
|
|
13574
13654
|
bordered: "",
|
|
13575
13655
|
"tip-placement": "before",
|
|
13576
13656
|
"rule-tip": t.bizOptions.ruleTip,
|
|
@@ -13613,22 +13693,31 @@ var init_index_es = __esmMin((() => {
|
|
|
13613
13693
|
const t = {
|
|
13614
13694
|
type: "radio",
|
|
13615
13695
|
width: 48
|
|
13616
|
-
}, a = [
|
|
13617
|
-
|
|
13618
|
-
|
|
13619
|
-
|
|
13620
|
-
|
|
13621
|
-
|
|
13622
|
-
|
|
13696
|
+
}, a = [
|
|
13697
|
+
{
|
|
13698
|
+
field: "materialName",
|
|
13699
|
+
title: "物料名称",
|
|
13700
|
+
showOverflow: "tooltip",
|
|
13701
|
+
minWidth: 140,
|
|
13702
|
+
formatter({ row: m }) {
|
|
13703
|
+
return m.materialName || m.productId || "";
|
|
13704
|
+
}
|
|
13705
|
+
},
|
|
13706
|
+
{
|
|
13707
|
+
field: "materialNo",
|
|
13708
|
+
title: "物料批次",
|
|
13709
|
+
showOverflow: "tooltip",
|
|
13710
|
+
minWidth: 160
|
|
13711
|
+
},
|
|
13712
|
+
{
|
|
13713
|
+
field: "uniqueCode",
|
|
13714
|
+
title: "唯一码",
|
|
13715
|
+
showOverflow: "tooltip",
|
|
13716
|
+
minWidth: 120
|
|
13623
13717
|
}
|
|
13624
|
-
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
showOverflow: "tooltip",
|
|
13628
|
-
minWidth: 160
|
|
13629
|
-
}], n = e, l = o, s = ref(), f = computed(() => (n.bizOptions.rows ?? []).map((v, d) => ({
|
|
13630
|
-
...v,
|
|
13631
|
-
_rowKey: `${v.materialId ?? ""}_${v.productionIdentificationId ?? ""}_${d}`
|
|
13718
|
+
], n = e, l = o, s = ref(), f = computed(() => (n.bizOptions.rows ?? []).map((m, d) => ({
|
|
13719
|
+
...m,
|
|
13720
|
+
_rowKey: `${m.materialId ?? ""}_${m.productionIdentificationId ?? ""}_${d}`
|
|
13632
13721
|
}))), r = computed(() => {
|
|
13633
13722
|
var _n$bizOptions$columns;
|
|
13634
13723
|
return {
|
|
@@ -13642,40 +13731,40 @@ var init_index_es = __esmMin((() => {
|
|
|
13642
13731
|
trigger: "row",
|
|
13643
13732
|
highlight: !0
|
|
13644
13733
|
},
|
|
13645
|
-
columns: [t, ...((_n$bizOptions$columns = n.bizOptions.columns) === null || _n$bizOptions$columns === void 0 ? void 0 : _n$bizOptions$columns.filter((
|
|
13734
|
+
columns: [t, ...((_n$bizOptions$columns = n.bizOptions.columns) === null || _n$bizOptions$columns === void 0 ? void 0 : _n$bizOptions$columns.filter((m) => m.type !== "radio")) ?? a]
|
|
13646
13735
|
};
|
|
13647
|
-
}), i = { radioChange({ row:
|
|
13648
|
-
s.value =
|
|
13736
|
+
}), i = { radioChange({ row: m }) {
|
|
13737
|
+
s.value = m;
|
|
13649
13738
|
} };
|
|
13650
|
-
async function
|
|
13739
|
+
async function _(m) {
|
|
13651
13740
|
const { data: d = {}, dict: S = {} } = await ie.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({
|
|
13652
13741
|
modelCategory: "entity",
|
|
13653
13742
|
modelKey: "em_production_identification_lock_record",
|
|
13654
13743
|
bsKey: "biz_get_one_lock_record"
|
|
13655
|
-
}, {}, { production_identification_id_:
|
|
13744
|
+
}, {}, { production_identification_id_: m });
|
|
13656
13745
|
return `该物料批次已被锁定;锁定人:${S.lock_user_id_[d.lock_user_id_]};锁定原因:${d.lock_reason_}`;
|
|
13657
13746
|
}
|
|
13658
|
-
const
|
|
13747
|
+
const k = async () => {
|
|
13659
13748
|
if (!s.value) {
|
|
13660
13749
|
message.error("请选择一条数据");
|
|
13661
13750
|
return;
|
|
13662
13751
|
}
|
|
13663
|
-
const { _rowKey:
|
|
13752
|
+
const { _rowKey: m, productionIdentificationIsLocked: d, productionIdentificationId: S, ...h } = s.value;
|
|
13664
13753
|
if (d) {
|
|
13665
|
-
const c = await
|
|
13754
|
+
const c = await _(S);
|
|
13666
13755
|
message.error(c);
|
|
13667
13756
|
return;
|
|
13668
13757
|
}
|
|
13669
|
-
n.modalInst.confirm(
|
|
13758
|
+
n.modalInst.confirm(h);
|
|
13670
13759
|
};
|
|
13671
|
-
return (
|
|
13760
|
+
return (m, d) => (openBlock(), createBlock(wt, mergeProps(n.modalProps, {
|
|
13672
13761
|
class: "gct-form-base-modal-scan-multi-rows",
|
|
13673
13762
|
visible: n.modalVisible,
|
|
13674
13763
|
title: "选择物料",
|
|
13675
13764
|
width: 800,
|
|
13676
13765
|
fullscreen: !1,
|
|
13677
13766
|
onCancel: n.modalInst.cancel,
|
|
13678
|
-
onOk:
|
|
13767
|
+
onOk: k,
|
|
13679
13768
|
onAfterClose: d[0] || (d[0] = (S) => l("afterClose"))
|
|
13680
13769
|
}), {
|
|
13681
13770
|
default: withCtx(() => [createElementVNode("div", L2, [createVNode(unref(VxeGrid), mergeProps({
|
|
@@ -13686,7 +13775,7 @@ var init_index_es = __esmMin((() => {
|
|
|
13686
13775
|
_: 1
|
|
13687
13776
|
}, 16, ["visible", "onCancel"]));
|
|
13688
13777
|
}
|
|
13689
|
-
}), [["__scopeId", "data-v-
|
|
13778
|
+
}), [["__scopeId", "data-v-765a7e5e"]])
|
|
13690
13779
|
};
|
|
13691
13780
|
bo = /* @__PURE__ */ Object.assign({
|
|
13692
13781
|
"./en-US/sys.ts": /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -13804,7 +13893,10 @@ var init_index_es = __esmMin((() => {
|
|
|
13804
13893
|
lot: "批次",
|
|
13805
13894
|
qty: "数量",
|
|
13806
13895
|
expiration: "有效期",
|
|
13807
|
-
|
|
13896
|
+
uniqueCode: "唯一码",
|
|
13897
|
+
other: "自定义",
|
|
13898
|
+
mfgOrderCode: "工单编号",
|
|
13899
|
+
sterilizationLot: "灭菌批号"
|
|
13808
13900
|
},
|
|
13809
13901
|
mcTable: {
|
|
13810
13902
|
materialStrategyConfig: "用料策略配置",
|
|
@@ -13906,15 +13998,15 @@ var init_index_es = __esmMin((() => {
|
|
|
13906
13998
|
zIndex: a.zIndex ?? 1e3 + ++this.zIndexSeed * 2
|
|
13907
13999
|
};
|
|
13908
14000
|
return new Promise((r, i) => {
|
|
13909
|
-
let
|
|
13910
|
-
const S = (
|
|
13911
|
-
|
|
13912
|
-
},
|
|
14001
|
+
let _ = !1, k = !1, m = !1, d;
|
|
14002
|
+
const S = (y) => {
|
|
14003
|
+
_ || (_ = !0, k = !0, s.visible = !1, r(y));
|
|
14004
|
+
}, h$2 = {
|
|
13913
14005
|
id: l,
|
|
13914
|
-
confirm(
|
|
14006
|
+
confirm(y) {
|
|
13915
14007
|
S({
|
|
13916
14008
|
success: !0,
|
|
13917
|
-
result:
|
|
14009
|
+
result: y
|
|
13918
14010
|
});
|
|
13919
14011
|
},
|
|
13920
14012
|
cancel() {
|
|
@@ -13924,17 +14016,17 @@ var init_index_es = __esmMin((() => {
|
|
|
13924
14016
|
});
|
|
13925
14017
|
}
|
|
13926
14018
|
}, c = async () => {
|
|
13927
|
-
if (
|
|
13928
|
-
|
|
13929
|
-
const
|
|
13930
|
-
d = void 0,
|
|
13931
|
-
}, g = () => this.resolveAntdConfig(),
|
|
14019
|
+
if (m) return;
|
|
14020
|
+
m = !0, this.modalMap.delete(l);
|
|
14021
|
+
const y = d;
|
|
14022
|
+
d = void 0, y && await y.destroy();
|
|
14023
|
+
}, g = () => this.resolveAntdConfig(), C = defineComponent({
|
|
13932
14024
|
name: "FormBaseModalRoot",
|
|
13933
14025
|
setup() {
|
|
13934
14026
|
return () => h(ConfigProvider, g(), { default: () => h(n, {
|
|
13935
14027
|
modalVisible: s.visible,
|
|
13936
14028
|
modalProps: f,
|
|
13937
|
-
modalInst:
|
|
14029
|
+
modalInst: h$2,
|
|
13938
14030
|
bizOptions: t,
|
|
13939
14031
|
onAfterClose: c
|
|
13940
14032
|
}) });
|
|
@@ -13942,13 +14034,13 @@ var init_index_es = __esmMin((() => {
|
|
|
13942
14034
|
});
|
|
13943
14035
|
this.modalMap.set(l, {
|
|
13944
14036
|
id: l,
|
|
13945
|
-
cancel:
|
|
13946
|
-
isClosing: () =>
|
|
14037
|
+
cancel: h$2.cancel,
|
|
14038
|
+
isClosing: () => k
|
|
13947
14039
|
});
|
|
13948
14040
|
try {
|
|
13949
|
-
d = W2(
|
|
13950
|
-
} catch (
|
|
13951
|
-
this.modalMap.delete(l), i(
|
|
14041
|
+
d = W2(C, this.appContext, l);
|
|
14042
|
+
} catch (y) {
|
|
14043
|
+
this.modalMap.delete(l), i(y);
|
|
13952
14044
|
}
|
|
13953
14045
|
});
|
|
13954
14046
|
}
|
|
@@ -13973,7 +14065,7 @@ var init_index_es = __esmMin((() => {
|
|
|
13973
14065
|
} };
|
|
13974
14066
|
}));
|
|
13975
14067
|
//#endregion
|
|
13976
|
-
//#region ../../node_modules/.pnpm/@gct-paas+form-base@0.1.
|
|
14068
|
+
//#region ../../node_modules/.pnpm/@gct-paas+form-base@0.1.8-beta.0_@gct-paas+api@6.2.0-dev.2_axios@1.13.2__@vueuse+core@1_2f0839f269373580ee9a463669b7ccff/node_modules/@gct-paas/form-base/dist/form-base.css
|
|
13977
14069
|
init_TriggerUtil();
|
|
13978
14070
|
init_index_es();
|
|
13979
14071
|
//#endregion
|
|
@@ -13981,6 +14073,7 @@ init_index_es();
|
|
|
13981
14073
|
init_asset_helper_util();
|
|
13982
14074
|
init_ServiceUtil();
|
|
13983
14075
|
init_base$2();
|
|
14076
|
+
init_base_formula_functions();
|
|
13984
14077
|
/**
|
|
13985
14078
|
* 平台适配器注册 **全局唯一,整个应用生命周期内只需调用一次**
|
|
13986
14079
|
* @description 注册 HTTP 拦截器、平台服务、Suite 插件等宿主能力
|
|
@@ -14022,6 +14115,7 @@ function setupPlatformAdapters(options) {
|
|
|
14022
14115
|
formulaIdentify,
|
|
14023
14116
|
formulaCalculate
|
|
14024
14117
|
});
|
|
14118
|
+
registerBaseFormulaFuncs();
|
|
14025
14119
|
triggerUtil.register({ handle: triggerHandler });
|
|
14026
14120
|
plugins === null || plugins === void 0 || plugins.forEach((plugin) => plugin.install());
|
|
14027
14121
|
}
|
|
@@ -96156,7 +96250,7 @@ function collectAttachFieldItems(props) {
|
|
|
96156
96250
|
return items;
|
|
96157
96251
|
}
|
|
96158
96252
|
async function resolveFieldDefaults(params) {
|
|
96159
|
-
const { props, field, ctx, context, instances } = params;
|
|
96253
|
+
const { props, field, ctx, context, instances, masterSlaveList } = params;
|
|
96160
96254
|
const manifest = ctx.getFieldManifest(field.fieldType);
|
|
96161
96255
|
if (!(manifest === null || manifest === void 0 ? void 0 : manifest.computed)) return;
|
|
96162
96256
|
const { defaultValueRule } = manifest.computed;
|
|
@@ -96170,7 +96264,8 @@ async function resolveFieldDefaults(params) {
|
|
|
96170
96264
|
else if (field.fieldType === FIELD_TYPE.E_SOP_VERSION && props.sopId) {
|
|
96171
96265
|
if (!skipRuntimeDefaultEnrichment) defaults = await enrichESopVersionDefaultValues(defaults, field.valuePath, props, context);
|
|
96172
96266
|
} else defaults = enrichContextDefaultValues(defaults, field.valuePath, field.fieldType, context, { skipRuntimeDefaultEnrichment });
|
|
96173
|
-
const
|
|
96267
|
+
const subKey = parseValuePath(field.valuePath).parentFieldKey;
|
|
96268
|
+
const autofillDefaultValues = field.fieldType === FIELD_TYPE.PRODUCT && !field.isLinkedModelField && !!subKey && masterSlaveList.some((item) => item.key === subKey && item.refModelType === "MATERIAL_CONSUME") ? {} : await loadDefaultValueByAutofillRules(instances, props.autofillRules, field, context, props.autofillEnabled);
|
|
96174
96269
|
return Object.assign(defaults ?? {}, autofillDefaultValues);
|
|
96175
96270
|
}
|
|
96176
96271
|
function mergeDefaultsIntoMap(defaultDataMap, defaults) {
|
|
@@ -96188,7 +96283,8 @@ async function loadDefaultValuesByFields(instances, ctx, context, masterSlaveLis
|
|
|
96188
96283
|
field,
|
|
96189
96284
|
ctx,
|
|
96190
96285
|
context,
|
|
96191
|
-
instances
|
|
96286
|
+
instances,
|
|
96287
|
+
masterSlaveList
|
|
96192
96288
|
}));
|
|
96193
96289
|
for (const item of collectAttachFieldItems(props)) {
|
|
96194
96290
|
var _item$fieldData;
|
|
@@ -96198,7 +96294,8 @@ async function loadDefaultValuesByFields(instances, ctx, context, masterSlaveLis
|
|
|
96198
96294
|
field: item.fieldData,
|
|
96199
96295
|
ctx,
|
|
96200
96296
|
context,
|
|
96201
|
-
instances
|
|
96297
|
+
instances,
|
|
96298
|
+
masterSlaveList
|
|
96202
96299
|
}));
|
|
96203
96300
|
}
|
|
96204
96301
|
});
|
|
@@ -100019,6 +100116,18 @@ function resolveAutofillRuntimeValuePaths(templatePath, rule, opts) {
|
|
|
100019
100116
|
const targetRowIndexes = subFieldKey ? resolveSubTableRowIndexes(opts.doc, subFieldKey, opts.rawData ?? {}, opts.rowIndexes) : opts.rowIndexes;
|
|
100020
100117
|
return expandAutofillSubTablePaths(templatePath, opts.rawData ?? {}, targetRowIndexes, opts.doc);
|
|
100021
100118
|
}
|
|
100119
|
+
/** 只解析目标路径,不执行来源取值或填充。 */
|
|
100120
|
+
function getAutofillTargetPaths(autofillRules, opts) {
|
|
100121
|
+
const paths = /* @__PURE__ */ new Set();
|
|
100122
|
+
for (const rule of autofillRules) {
|
|
100123
|
+
if (!rule.fromField) continue;
|
|
100124
|
+
const normalized = normalizeAutofillRule(rule, opts);
|
|
100125
|
+
const template = buildAutofillTargetTemplatePath(normalized);
|
|
100126
|
+
if (!template) continue;
|
|
100127
|
+
for (const path of resolveAutofillRuntimeValuePaths(template, normalized, opts)) paths.add(path);
|
|
100128
|
+
}
|
|
100129
|
+
return [...paths];
|
|
100130
|
+
}
|
|
100022
100131
|
function applyAutofillRules(record, autofillRules, opts) {
|
|
100023
100132
|
const result = {};
|
|
100024
100133
|
for (const ruleItem of autofillRules) {
|
|
@@ -106369,10 +106478,71 @@ var init_warehouse_allocate = __esmMin((() => {
|
|
|
106369
106478
|
init_actions$3();
|
|
106370
106479
|
}));
|
|
106371
106480
|
//#endregion
|
|
106481
|
+
//#region src/domain/table/business/material/material-consume/profile/product-fields.ts
|
|
106482
|
+
/** 对象字段的后缀独立生成,从同模型、同对象中读取真实 key。 */
|
|
106483
|
+
function getMaterialConsumeObjectFieldProfile(field, modelFields) {
|
|
106484
|
+
if (!field.belongingObject) return void 0;
|
|
106485
|
+
const fields = modelFields.filter((item) => item.modelKey === field.modelKey);
|
|
106486
|
+
const owner = fields.find((item) => item.key === field.belongingObject);
|
|
106487
|
+
if (!owner || resolveFieldManifestType(owner) !== FIELD_TYPE.MATERIAL_CONSUME) return;
|
|
106488
|
+
if (DETAILS.some(({ fieldKey }) => field.key.startsWith(fieldKey))) return {
|
|
106489
|
+
match: { fieldKey: field.key },
|
|
106490
|
+
defaultProps: { ...detailProps }
|
|
106491
|
+
};
|
|
106492
|
+
if (resolveFieldManifestType(field) !== FIELD_TYPE.PRODUCT) return void 0;
|
|
106493
|
+
const siblings = fields.filter((item) => item.belongingObject === field.belongingObject);
|
|
106494
|
+
const autofillTemplates = DETAILS.flatMap(({ fromField, fieldKey }) => {
|
|
106495
|
+
const targets = siblings.filter((item) => item.key.startsWith(fieldKey));
|
|
106496
|
+
if (targets.length !== 1) return [];
|
|
106497
|
+
return [{
|
|
106498
|
+
fromField,
|
|
106499
|
+
toField: targets[0].key
|
|
106500
|
+
}];
|
|
106501
|
+
});
|
|
106502
|
+
return autofillTemplates.length ? {
|
|
106503
|
+
match: { fieldKey: field.key },
|
|
106504
|
+
autofillTemplates
|
|
106505
|
+
} : void 0;
|
|
106506
|
+
}
|
|
106507
|
+
var DETAILS, detailProps, materialConsumeProductFields;
|
|
106508
|
+
var init_product_fields = __esmMin((() => {
|
|
106509
|
+
init_field_type();
|
|
106510
|
+
DETAILS = [
|
|
106511
|
+
{
|
|
106512
|
+
fromField: "name_",
|
|
106513
|
+
fieldKey: "product_id_name_"
|
|
106514
|
+
},
|
|
106515
|
+
{
|
|
106516
|
+
fromField: "code_",
|
|
106517
|
+
fieldKey: "product_id_code_"
|
|
106518
|
+
},
|
|
106519
|
+
{
|
|
106520
|
+
fromField: "spec_",
|
|
106521
|
+
fieldKey: "product_id_spec_"
|
|
106522
|
+
}
|
|
106523
|
+
];
|
|
106524
|
+
detailProps = {
|
|
106525
|
+
disabled: true,
|
|
106526
|
+
required: false,
|
|
106527
|
+
modelRequiredOverride: false
|
|
106528
|
+
};
|
|
106529
|
+
materialConsumeProductFields = [{
|
|
106530
|
+
match: { fieldKey: "product_id_" },
|
|
106531
|
+
autofillTemplates: DETAILS.map(({ fromField, fieldKey }) => ({
|
|
106532
|
+
fromField,
|
|
106533
|
+
toField: fieldKey
|
|
106534
|
+
}))
|
|
106535
|
+
}, {
|
|
106536
|
+
match: { fieldKey: DETAILS.map(({ fieldKey }) => fieldKey) },
|
|
106537
|
+
defaultProps: { ...detailProps }
|
|
106538
|
+
}];
|
|
106539
|
+
}));
|
|
106540
|
+
//#endregion
|
|
106372
106541
|
//#region src/domain/table/business/material/material-consume/profile/fields.ts
|
|
106373
106542
|
var fields$5;
|
|
106374
106543
|
var init_fields$6 = __esmMin((() => {
|
|
106375
106544
|
init_enum();
|
|
106545
|
+
init_product_fields();
|
|
106376
106546
|
fields$5 = [{
|
|
106377
106547
|
match: { fieldKey: ["qty_", "qty_required_"] },
|
|
106378
106548
|
defaultProps: {
|
|
@@ -106380,7 +106550,7 @@ var init_fields$6 = __esmMin((() => {
|
|
|
106380
106550
|
minValidateMode: RangeValidateModeTypeConst.Fixed_Number,
|
|
106381
106551
|
minValue: 0
|
|
106382
106552
|
}
|
|
106383
|
-
}];
|
|
106553
|
+
}, ...materialConsumeProductFields];
|
|
106384
106554
|
}));
|
|
106385
106555
|
//#endregion
|
|
106386
106556
|
//#region src/domain/table/business/material/material-consume/profile/index.ts
|
|
@@ -108026,7 +108196,7 @@ var init_BoundedRegion = __esmMin((() => {
|
|
|
108026
108196
|
props: {
|
|
108027
108197
|
autoFill: true,
|
|
108028
108198
|
fillDirection: "x",
|
|
108029
|
-
quickFill:
|
|
108199
|
+
quickFill: false,
|
|
108030
108200
|
...((_options$widgetMeta = options.widgetMeta) === null || _options$widgetMeta === void 0 ? void 0 : _options$widgetMeta.props) ?? {}
|
|
108031
108201
|
}
|
|
108032
108202
|
};
|
|
@@ -117540,8 +117710,7 @@ function applyLockedProps(props, locked) {
|
|
|
117540
117710
|
*/
|
|
117541
117711
|
function applyFieldProfileOnAttach(widget, field, options = {}) {
|
|
117542
117712
|
var _fieldProfile$autofil;
|
|
117543
|
-
|
|
117544
|
-
const fieldProfile = getBusinessFieldProfileByRefModelType(options.refModelType, field);
|
|
117713
|
+
const fieldProfile = options.fieldProfile !== void 0 ? options.fieldProfile : options.parentFieldKey && options.refModelType ? getBusinessFieldProfileByRefModelType(options.refModelType, field) : void 0;
|
|
117545
117714
|
if (!fieldProfile) return widget;
|
|
117546
117715
|
const props = {
|
|
117547
117716
|
...widget.props,
|
|
@@ -117552,8 +117721,8 @@ function applyFieldProfileOnAttach(widget, field, options = {}) {
|
|
|
117552
117721
|
const inSubTable = Boolean(options.parentFieldKey);
|
|
117553
117722
|
props.autofillRules = expandAutofillTemplates(fieldProfile.autofillTemplates, {
|
|
117554
117723
|
sourceFieldKey: field.key,
|
|
117555
|
-
toModelKey:
|
|
117556
|
-
toSubModel: inSubTable ? 1 :
|
|
117724
|
+
toModelKey: field.modelKey,
|
|
117725
|
+
toSubModel: inSubTable ? 1 : 0,
|
|
117557
117726
|
toSubFieldKey: inSubTable ? options.parentFieldKey : void 0
|
|
117558
117727
|
});
|
|
117559
117728
|
props.autofillEnabled = true;
|
|
@@ -127139,6 +127308,24 @@ var init_service$5 = __esmMin((() => {
|
|
|
127139
127308
|
postApi = getApi().apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey;
|
|
127140
127309
|
}));
|
|
127141
127310
|
//#endregion
|
|
127311
|
+
//#region src/utils/func/number-util.ts
|
|
127312
|
+
function plus(a, b) {
|
|
127313
|
+
return new BigNumber(a).plus(b);
|
|
127314
|
+
}
|
|
127315
|
+
function minus(a, b) {
|
|
127316
|
+
return new BigNumber(a).minus(b);
|
|
127317
|
+
}
|
|
127318
|
+
function multiply(a, b) {
|
|
127319
|
+
return new BigNumber(a).times(b);
|
|
127320
|
+
}
|
|
127321
|
+
function sum(values, initial = 0) {
|
|
127322
|
+
return values.reduce((total, value) => total.plus(value), new BigNumber(initial));
|
|
127323
|
+
}
|
|
127324
|
+
function compare(a, b) {
|
|
127325
|
+
return new BigNumber(a).comparedTo(b);
|
|
127326
|
+
}
|
|
127327
|
+
var init_number_util = __esmMin((() => {}));
|
|
127328
|
+
//#endregion
|
|
127142
127329
|
//#region src/runtime/canvas/table/render/material-consume/bom-validator.ts
|
|
127143
127330
|
function findLastIndex(array, predicate) {
|
|
127144
127331
|
if (!Array.isArray(array)) throw new TypeError("Expected an array");
|
|
@@ -127159,6 +127346,7 @@ function setGroupEditState(table, util, editing) {
|
|
|
127159
127346
|
var McRowValidateError, BomEntryValidator, BomEntriesValidator;
|
|
127160
127347
|
var init_bom_validator$1 = __esmMin((() => {
|
|
127161
127348
|
init_service$5();
|
|
127349
|
+
init_number_util();
|
|
127162
127350
|
init_defineProperty();
|
|
127163
127351
|
McRowValidateError = class extends Error {
|
|
127164
127352
|
constructor(message, targetFieldId, row) {
|
|
@@ -127170,17 +127358,26 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127170
127358
|
}
|
|
127171
127359
|
};
|
|
127172
127360
|
BomEntryValidator = class {
|
|
127361
|
+
get hasConsumed() {
|
|
127362
|
+
return this.historyQty.toNumber();
|
|
127363
|
+
}
|
|
127364
|
+
get remainingQty() {
|
|
127365
|
+
return minus(this.totalQty, this.historyQty);
|
|
127366
|
+
}
|
|
127173
127367
|
/** 剩于可消耗数量 */
|
|
127174
127368
|
get remainingNum() {
|
|
127175
|
-
return this.
|
|
127369
|
+
return this.remainingQty.toNumber();
|
|
127176
127370
|
}
|
|
127177
127371
|
/** 批次/生产数量(用时读取,避免构造快照过期) */
|
|
127178
127372
|
get materialNoNum() {
|
|
127179
127373
|
return Number(this.getMaterialNoNum()) || 0;
|
|
127180
127374
|
}
|
|
127181
127375
|
/** 需求总量 = 数量倍数 × BOM 单位用量 */
|
|
127376
|
+
get totalQty() {
|
|
127377
|
+
return multiply(Number(this.bomEntry.qty_required_), this.materialNoNum);
|
|
127378
|
+
}
|
|
127182
127379
|
get total() {
|
|
127183
|
-
return this.
|
|
127380
|
+
return this.totalQty.toNumber();
|
|
127184
127381
|
}
|
|
127185
127382
|
constructor(bomEntry, enableSequenceLoading, getMaterialNoNum, historyData, mainMaterialNo, noBomMode) {
|
|
127186
127383
|
_defineProperty(this, "bomEntry", void 0);
|
|
@@ -127204,8 +127401,8 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127204
127401
|
_defineProperty(
|
|
127205
127402
|
this,
|
|
127206
127403
|
/** 历史数据中已经消耗的 */
|
|
127207
|
-
"
|
|
127208
|
-
0
|
|
127404
|
+
"historyQty",
|
|
127405
|
+
void 0
|
|
127209
127406
|
);
|
|
127210
127407
|
this.bomEntry = bomEntry;
|
|
127211
127408
|
this.enableSequenceLoading = enableSequenceLoading;
|
|
@@ -127219,7 +127416,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127219
127416
|
this.productIds.push(i.product_id_);
|
|
127220
127417
|
this.productCodes[i.product_id_] = i.product_code_;
|
|
127221
127418
|
});
|
|
127222
|
-
this.
|
|
127419
|
+
this.historyQty = this.calcQtyConsumed(this.historyData, "history");
|
|
127223
127420
|
}
|
|
127224
127421
|
/**
|
|
127225
127422
|
* 翻译物料的code
|
|
@@ -127334,13 +127531,13 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127334
127531
|
if (!this.bomEntry.qty_validation_enabled_) return;
|
|
127335
127532
|
if (this.bomEntry.type_ === "view") return;
|
|
127336
127533
|
const consumeNum = this.calcQtyConsumed(arr);
|
|
127337
|
-
if (consumeNum === 0) return;
|
|
127338
|
-
if (["eq", "lte"].includes(this.bomEntry.qty_validation_rule_) && consumeNum
|
|
127534
|
+
if (compare(consumeNum, 0) === 0) return;
|
|
127535
|
+
if (["eq", "lte"].includes(this.bomEntry.qty_validation_rule_) && compare(consumeNum, this.remainingQty) === 1) throw new Error("当前物料上料总消耗不能大于需求数量");
|
|
127339
127536
|
if (this.bomEntry.qty_validation_rule_ === "bounds") {
|
|
127340
127537
|
const groupData = this.filterGroupData(arr);
|
|
127341
|
-
const consumeSum = this.
|
|
127538
|
+
const consumeSum = this.calcTotalForBounds(arr);
|
|
127342
127539
|
const { max } = await this.calcCustomNumberLimit(groupData[0]);
|
|
127343
|
-
if (consumeSum
|
|
127540
|
+
if (max !== void 0 && compare(consumeSum, max) === 1) throw new Error(`当前物料的上料总消耗不能大于 ${max}`);
|
|
127344
127541
|
}
|
|
127345
127542
|
}
|
|
127346
127543
|
/**
|
|
@@ -127360,11 +127557,17 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127360
127557
|
* @return {*}
|
|
127361
127558
|
*/
|
|
127362
127559
|
calcQtyConsumed(arr, source = "current") {
|
|
127363
|
-
return this.filterGroupData(arr, source).
|
|
127560
|
+
return sum(this.filterGroupData(arr, source).map((row) => Number(row.qty_ ?? 0)));
|
|
127364
127561
|
}
|
|
127365
127562
|
/** 上下限校验优先使用单位转换后的数量,历史数据未转换时兼容原数量。 */
|
|
127366
127563
|
calcQtyForBounds(arr, source = "current") {
|
|
127367
|
-
return this.filterGroupData(arr, source).
|
|
127564
|
+
return sum(this.filterGroupData(arr, source).map((row) => Number(row.qty_transfer_ ?? row.qty_ ?? 0)));
|
|
127565
|
+
}
|
|
127566
|
+
calcTotalForBounds(arr) {
|
|
127567
|
+
return plus(this.calcQtyForBounds(arr), this.calcQtyForBounds(this.historyData, "history"));
|
|
127568
|
+
}
|
|
127569
|
+
calcRunningQtyConsumed(arr) {
|
|
127570
|
+
return sum(this.filterGroupData(arr).map((row) => Number(row.qty_ || 0)), this.historyQty).toNumber();
|
|
127368
127571
|
}
|
|
127369
127572
|
/**
|
|
127370
127573
|
* 计算自定义的数量校验的最大值和最小值
|
|
@@ -127397,8 +127600,8 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127397
127600
|
const entry = this.bomEntry;
|
|
127398
127601
|
if (!entry.qty_validation_enabled_ || entry.type_ === "view") return;
|
|
127399
127602
|
const loaded = this.calcQtyConsumed(arr);
|
|
127400
|
-
const required = this.
|
|
127401
|
-
const diff = loaded
|
|
127603
|
+
const required = this.remainingQty;
|
|
127604
|
+
const diff = compare(minus(loaded, required), 0);
|
|
127402
127605
|
const rule = entry.qty_validation_rule_;
|
|
127403
127606
|
const fail = (msg) => {
|
|
127404
127607
|
const prefix = groupNo != null && groupNo > 0 ? `序号: ${groupNo}` : "";
|
|
@@ -127408,19 +127611,19 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127408
127611
|
case "eq":
|
|
127409
127612
|
if (sequential) {
|
|
127410
127613
|
if (diff !== 0) fail("上料数量必须等于需求数量");
|
|
127411
|
-
} else if (loaded
|
|
127614
|
+
} else if (compare(loaded, required) === 1) fail("本次上料汇总数量必须小于等于需求数量");
|
|
127412
127615
|
break;
|
|
127413
127616
|
case "gte":
|
|
127414
|
-
if (diff
|
|
127617
|
+
if (diff === -1) fail("上料数量必须大于等于需求数量");
|
|
127415
127618
|
break;
|
|
127416
127619
|
case "lte":
|
|
127417
|
-
if (diff
|
|
127620
|
+
if (diff === 1) fail("上料数量必须小于等于需求数量");
|
|
127418
127621
|
break;
|
|
127419
127622
|
case "bounds": {
|
|
127420
127623
|
const groupData = this.filterGroupData(arr);
|
|
127421
|
-
const consumeSum = this.
|
|
127624
|
+
const consumeSum = this.calcTotalForBounds(arr);
|
|
127422
127625
|
const { min, max } = await this.calcCustomNumberLimit(groupData[0]);
|
|
127423
|
-
if (min !== void 0 && consumeSum
|
|
127626
|
+
if (min !== void 0 && compare(consumeSum, min) === -1 || max !== void 0 && compare(consumeSum, max) === 1) fail(`上料数量必须在[${min}, ${max}]范围内`);
|
|
127424
127627
|
break;
|
|
127425
127628
|
}
|
|
127426
127629
|
}
|
|
@@ -127440,21 +127643,22 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127440
127643
|
}
|
|
127441
127644
|
if (this.bomEntry.type_ === "view") return;
|
|
127442
127645
|
const consumeNum = this.calcQtyConsumed(groupData);
|
|
127443
|
-
|
|
127646
|
+
const zeroComparison = compare(consumeNum, 0);
|
|
127647
|
+
if (!this.bomEntry.qty_validation_enabled_ && zeroComparison !== null && zeroComparison !== 0) return;
|
|
127444
127648
|
switch (this.bomEntry.qty_validation_rule_) {
|
|
127445
127649
|
case "eq":
|
|
127446
|
-
if (consumeNum
|
|
127650
|
+
if (compare(consumeNum, this.remainingQty) === -1) throw new Error(message);
|
|
127447
127651
|
break;
|
|
127448
127652
|
case "gte":
|
|
127449
|
-
if (consumeNum
|
|
127653
|
+
if (compare(consumeNum, this.remainingQty) === -1) throw new Error(message);
|
|
127450
127654
|
break;
|
|
127451
127655
|
case "lte":
|
|
127452
|
-
if (
|
|
127656
|
+
if (zeroComparison === -1 || zeroComparison === 0) throw new Error(message);
|
|
127453
127657
|
break;
|
|
127454
127658
|
case "bounds":
|
|
127455
|
-
const consumeSum = consumeNum
|
|
127659
|
+
const consumeSum = plus(consumeNum, this.historyQty);
|
|
127456
127660
|
const { min } = await this.calcCustomNumberLimit(groupData[0]);
|
|
127457
|
-
if (consumeSum
|
|
127661
|
+
if (min !== void 0 && compare(consumeSum, min) === -1) throw new Error(message);
|
|
127458
127662
|
}
|
|
127459
127663
|
}
|
|
127460
127664
|
};
|
|
@@ -128096,23 +128300,26 @@ var init_uom_convert_runtime = __esmMin((() => {
|
|
|
128096
128300
|
//#endregion
|
|
128097
128301
|
//#region src/runtime/canvas/table/render/material-consume/scan-fill.ts
|
|
128098
128302
|
/**
|
|
128099
|
-
* 按 ScanFillPlan 切组 / 建组 /
|
|
128303
|
+
* 按 ScanFillPlan 切组 / 建组 / 填充,返回新表及本次写入行的身份(不改入参 arr)。
|
|
128100
128304
|
* needSwitch 时通过 options.validateCurrentGroupForSwitch 先校验当前组。
|
|
128101
128305
|
*/
|
|
128102
128306
|
async function applyScanFillPlan(arr, scanRow, plan, options) {
|
|
128103
128307
|
const table = cloneDeep(arr);
|
|
128104
|
-
|
|
128105
|
-
|
|
128106
|
-
|
|
128107
|
-
|
|
128108
|
-
|
|
128109
|
-
|
|
128110
|
-
|
|
128308
|
+
let filledIndex;
|
|
128309
|
+
if (!plan) filledIndex = fillNoBomRow(table, scanRow);
|
|
128310
|
+
else {
|
|
128311
|
+
if (plan.needSwitch) {
|
|
128312
|
+
var _options$validateCurr;
|
|
128313
|
+
await (options === null || options === void 0 || (_options$validateCurr = options.validateCurrentGroupForSwitch) === null || _options$validateCurr === void 0 ? void 0 : _options$validateCurr.call(options, table, plan.current));
|
|
128314
|
+
}
|
|
128315
|
+
const fillAt = plan.needInsert ? insertEmptyGroupRow(table, plan) : void 0;
|
|
128316
|
+
if (plan.needSwitch) applyGroupEditState(table, plan);
|
|
128317
|
+
filledIndex = fillTargetGroup(table, scanRow, plan, fillAt);
|
|
128111
128318
|
}
|
|
128112
|
-
|
|
128113
|
-
|
|
128114
|
-
|
|
128115
|
-
|
|
128319
|
+
return {
|
|
128320
|
+
rows: table,
|
|
128321
|
+
filledRowKey: ensureFrontRowKey(table[filledIndex])
|
|
128322
|
+
};
|
|
128116
128323
|
}
|
|
128117
128324
|
/**
|
|
128118
128325
|
* 将扫码行完整写入目标行(含 transformedData / qty_required_ 等扩展字段)。
|
|
@@ -128133,7 +128340,7 @@ function fillNoBomRow(table, scanRow) {
|
|
|
128133
128340
|
const emptyIdx = table.findIndex((r) => !r.deleted_ && !r.product_id_);
|
|
128134
128341
|
if (emptyIdx >= 0) {
|
|
128135
128342
|
writeScanFields(table[emptyIdx], scanRow);
|
|
128136
|
-
return;
|
|
128343
|
+
return emptyIdx;
|
|
128137
128344
|
}
|
|
128138
128345
|
const row = {
|
|
128139
128346
|
is_confirmed_: false,
|
|
@@ -128142,6 +128349,7 @@ function fillNoBomRow(table, scanRow) {
|
|
|
128142
128349
|
ensureFrontRowKey(row);
|
|
128143
128350
|
writeScanFields(row, scanRow);
|
|
128144
128351
|
table.push(row);
|
|
128352
|
+
return table.length - 1;
|
|
128145
128353
|
}
|
|
128146
128354
|
/** 在 groupInsertIndex 插占位,返回该下标 */
|
|
128147
128355
|
function insertEmptyGroupRow(table, plan) {
|
|
@@ -128164,16 +128372,16 @@ function fillTargetGroup(table, scanRow, plan, fillAt) {
|
|
|
128164
128372
|
const bomId = plan.target.bomEntry.id_;
|
|
128165
128373
|
if (fillAt !== void 0) {
|
|
128166
128374
|
writeScanFields(table[fillAt], scanRow, bomId);
|
|
128167
|
-
return;
|
|
128375
|
+
return fillAt;
|
|
128168
128376
|
}
|
|
128169
128377
|
if (plan.emptyProductIndexes.length) {
|
|
128170
128378
|
writeScanFields(table[plan.emptyProductIndexes[0]], scanRow, bomId);
|
|
128171
|
-
return;
|
|
128379
|
+
return plan.emptyProductIndexes[0];
|
|
128172
128380
|
}
|
|
128173
128381
|
const action = resolveInGroupFill(scanRow, table, plan);
|
|
128174
128382
|
if (action.type === "fill") {
|
|
128175
128383
|
writeScanFields(table[action.index], scanRow, bomId);
|
|
128176
|
-
return;
|
|
128384
|
+
return action.index;
|
|
128177
128385
|
}
|
|
128178
128386
|
const nr = {
|
|
128179
128387
|
is_confirmed_: false,
|
|
@@ -128182,6 +128390,7 @@ function fillTargetGroup(table, scanRow, plan, fillAt) {
|
|
|
128182
128390
|
ensureFrontRowKey(nr);
|
|
128183
128391
|
writeScanFields(nr, scanRow, bomId);
|
|
128184
128392
|
table.splice(plan.appendIndex, 0, nr);
|
|
128393
|
+
return plan.appendIndex;
|
|
128185
128394
|
}
|
|
128186
128395
|
/** 文档填充逻辑 2~4(物料相同 / 混用替代 / 未命中) */
|
|
128187
128396
|
function resolveInGroupFill(scanRow, table, plan) {
|
|
@@ -128404,9 +128613,7 @@ function withGroupSerialNumber(cell, groupOrderIndex) {
|
|
|
128404
128613
|
/** 计算某一 BOM 组的总上料数量 */
|
|
128405
128614
|
function calcGroupQtyConsumedTotal(entryIdx, tableData, validator) {
|
|
128406
128615
|
if (entryIdx < 0) return 0;
|
|
128407
|
-
return tableData.
|
|
128408
|
-
return validator.resolveEntryIndex(row) === entryIdx ? sum + Number(row.qty_ ?? 0) : sum;
|
|
128409
|
-
}, 0);
|
|
128616
|
+
return sum(tableData.filter((row) => validator.resolveEntryIndex(row) === entryIdx).map((row) => Number(row.qty_ ?? 0))).toNumber();
|
|
128410
128617
|
}
|
|
128411
128618
|
/** 回写全表 qty_consumed_total_(组内每行写相同值,便于提交) */
|
|
128412
128619
|
function syncGroupQtyConsumedTotals(tableData, validator) {
|
|
@@ -128424,6 +128631,7 @@ function syncGroupQtyConsumedTotals(tableData, validator) {
|
|
|
128424
128631
|
var getRowId, GROUP_MERGE_FIELDS;
|
|
128425
128632
|
var init_material_consume_group_merge = __esmMin((() => {
|
|
128426
128633
|
init_data();
|
|
128634
|
+
init_number_util();
|
|
128427
128635
|
getRowId = (row) => {
|
|
128428
128636
|
if (!row) return "";
|
|
128429
128637
|
if (row["front_row_key_"] != null && String(row["front_row_key_"]).trim() !== "") return String(row[FRONT_ROW_KEY]);
|
|
@@ -128477,6 +128685,220 @@ function resolveConsumedQtyWithoutProduct(value) {
|
|
|
128477
128685
|
}
|
|
128478
128686
|
var init_derived_qty = __esmMin((() => {}));
|
|
128479
128687
|
//#endregion
|
|
128688
|
+
//#region src/runtime/canvas/table/render/material-consume/product-source.ts
|
|
128689
|
+
function productVersionId(value) {
|
|
128690
|
+
return typeof value === "string" ? parseFormTmplRefId(value.trim()).id ?? "" : "";
|
|
128691
|
+
}
|
|
128692
|
+
/** 初始化专用:单次批量查询,失败不抛错、不逐条补查。 */
|
|
128693
|
+
async function loadConsumeInitialProducts(productRefs) {
|
|
128694
|
+
const ids = [...new Set(productRefs.map(productVersionId).filter(Boolean))];
|
|
128695
|
+
const records = /* @__PURE__ */ new Map();
|
|
128696
|
+
if (!ids.length) return records;
|
|
128697
|
+
try {
|
|
128698
|
+
const result = await callBizService({
|
|
128699
|
+
modelCategory: "entity",
|
|
128700
|
+
modelKey: "em_product",
|
|
128701
|
+
bsKey: "rdoListAllVersion",
|
|
128702
|
+
method: "post"
|
|
128703
|
+
}, {
|
|
128704
|
+
query: { "id_.in": ids },
|
|
128705
|
+
exp: ""
|
|
128706
|
+
}, { __useWordMessage: false });
|
|
128707
|
+
if (isBizServiceFailure(result)) {
|
|
128708
|
+
console.warn("[material-consume] 初始化物料详情查询失败,跳过填充");
|
|
128709
|
+
return records;
|
|
128710
|
+
}
|
|
128711
|
+
const requested = new Set(ids);
|
|
128712
|
+
for (const record of unwrapBizServiceList(result)) {
|
|
128713
|
+
if (!record || typeof record !== "object") continue;
|
|
128714
|
+
const id = productVersionId(record.id_);
|
|
128715
|
+
if (requested.has(id)) records.set(id, record);
|
|
128716
|
+
}
|
|
128717
|
+
const missing = ids.filter((id) => !records.has(id));
|
|
128718
|
+
if (missing.length) console.warn("[material-consume] 部分物料详情缺失,跳过对应物料", missing);
|
|
128719
|
+
return records;
|
|
128720
|
+
} catch (error) {
|
|
128721
|
+
console.warn("[material-consume] 初始化物料详情查询异常,跳过填充", error);
|
|
128722
|
+
return /* @__PURE__ */ new Map();
|
|
128723
|
+
}
|
|
128724
|
+
}
|
|
128725
|
+
var init_product_source = __esmMin((() => {
|
|
128726
|
+
init_biz_service_api();
|
|
128727
|
+
init_core$1();
|
|
128728
|
+
}));
|
|
128729
|
+
//#endregion
|
|
128730
|
+
//#region src/runtime/canvas/table/render/material-consume/initial-product-autofill.ts
|
|
128731
|
+
/** 初值仅填 undefined,详情或规则错误均不阻断基础行初始化。 */
|
|
128732
|
+
async function prepareConsumeInitialWrite(doc, subFieldKey, rows) {
|
|
128733
|
+
const tableKey = subFieldKey.replace(/^\$\./, "");
|
|
128734
|
+
const tablePath = `$.${tableKey}`;
|
|
128735
|
+
const baseRows = cloneDeep(rows);
|
|
128736
|
+
const baseWrite = { [tablePath]: baseRows };
|
|
128737
|
+
try {
|
|
128738
|
+
var _doc$model, _props$autofillRules;
|
|
128739
|
+
const source = (((_doc$model = doc.model) === null || _doc$model === void 0 ? void 0 : _doc$model.getWidgetInstances()) ?? []).flatMap((instance) => "widgetMeta" in instance ? [instance.widgetMeta] : []).find((meta) => {
|
|
128740
|
+
const field = meta === null || meta === void 0 ? void 0 : meta.field;
|
|
128741
|
+
return !!field && field.fieldType === FIELD_TYPE.PRODUCT && !field.isLinkedModelField && !field.belongingObject && getLastSegment$1(field.fieldLink) === "product_id_" && parseValuePath(field.valuePath).parentFieldKey === tableKey;
|
|
128742
|
+
});
|
|
128743
|
+
const props = source === null || source === void 0 ? void 0 : source.props;
|
|
128744
|
+
if (!props || !resolveAutofillEnabled(props) || !((_props$autofillRules = props.autofillRules) === null || _props$autofillRules === void 0 ? void 0 : _props$autofillRules.length)) return baseWrite;
|
|
128745
|
+
const records = await loadConsumeInitialProducts(baseRows.filter((row) => !row.deleted_).map((row) => row.product_id_));
|
|
128746
|
+
const raw = {
|
|
128747
|
+
...doc.dataManager.getRawData(),
|
|
128748
|
+
[tableKey]: baseRows
|
|
128749
|
+
};
|
|
128750
|
+
const additions = {};
|
|
128751
|
+
const current = (path) => Object.prototype.hasOwnProperty.call(additions, path) ? additions[path] : get(raw, path.replace(/^\$\./, ""));
|
|
128752
|
+
baseRows.forEach((row, index) => {
|
|
128753
|
+
if (row.deleted_) return;
|
|
128754
|
+
const record = records.get(productVersionId(row.product_id_));
|
|
128755
|
+
if (!record) return;
|
|
128756
|
+
const sourcePath = `${tablePath}[${index}].product_id_`;
|
|
128757
|
+
try {
|
|
128758
|
+
const filled = applyAutofillRules(record, props.autofillRules, {
|
|
128759
|
+
doc,
|
|
128760
|
+
rawData: raw,
|
|
128761
|
+
sourceValuePath: sourcePath,
|
|
128762
|
+
needReplacePathIndexPlaceholder: true
|
|
128763
|
+
});
|
|
128764
|
+
if (Object.prototype.hasOwnProperty.call(filled, sourcePath)) throw new Error("物料填充规则不能回写自身");
|
|
128765
|
+
const rowUpdates = Object.fromEntries(Object.entries(filled).filter(([path]) => current(path) === void 0));
|
|
128766
|
+
const label = record.__SHOW_LABEL__ || record.__LABEL__ || record.name_;
|
|
128767
|
+
const labelPath = getLabelPath(sourcePath);
|
|
128768
|
+
if (current(labelPath) === void 0 && typeof label === "string" && label !== "") rowUpdates[labelPath] = label;
|
|
128769
|
+
Object.assign(additions, rowUpdates);
|
|
128770
|
+
} catch (error) {
|
|
128771
|
+
console.warn("[material-consume] 初始化行填充失败,跳过该行", index, error);
|
|
128772
|
+
}
|
|
128773
|
+
});
|
|
128774
|
+
const writes = { ...baseWrite };
|
|
128775
|
+
for (const [path, value] of Object.entries(additions)) if (path.startsWith(`${tablePath}[`)) set(baseRows, path.slice(tablePath.length), value);
|
|
128776
|
+
else writes[path] = value;
|
|
128777
|
+
return writes;
|
|
128778
|
+
} catch (error) {
|
|
128779
|
+
console.warn("[material-consume] 初始化填充异常,保留基础行", error);
|
|
128780
|
+
return { [tablePath]: cloneDeep(rows) };
|
|
128781
|
+
}
|
|
128782
|
+
}
|
|
128783
|
+
var init_initial_product_autofill = __esmMin((() => {
|
|
128784
|
+
init_field_paths();
|
|
128785
|
+
init_field_type();
|
|
128786
|
+
init_core$1();
|
|
128787
|
+
init_autofill_runtime();
|
|
128788
|
+
init_types$7();
|
|
128789
|
+
init_product_source();
|
|
128790
|
+
}));
|
|
128791
|
+
//#endregion
|
|
128792
|
+
//#region src/runtime/canvas/table/render/material-consume/product-autofill.ts
|
|
128793
|
+
function isConsumeProduct(doc, field) {
|
|
128794
|
+
if (field.fieldType !== FIELD_TYPE.PRODUCT || field.isLinkedModelField) return false;
|
|
128795
|
+
if (field.belongingObject) {
|
|
128796
|
+
const owner = doc.fieldModelQuery.getFieldList(getLastSegment$1(field.modelLink)).find((item) => item.key === field.belongingObject);
|
|
128797
|
+
return !!owner && resolveFieldManifestType(owner) === FIELD_TYPE.MATERIAL_CONSUME;
|
|
128798
|
+
}
|
|
128799
|
+
const subKey = parseValuePath(field.valuePath).parentFieldKey;
|
|
128800
|
+
return !!subKey && doc.fieldModelQuery.getFieldList(doc.mainModelKey).some((item) => item.key === subKey && item.refModelType === "MATERIAL_CONSUME");
|
|
128801
|
+
}
|
|
128802
|
+
/** 仅对指定来源生成填充更新;详情查询失败时保留业务更新。 */
|
|
128803
|
+
async function prepareConsumeWrite(doc, pending, sourcePaths) {
|
|
128804
|
+
var _doc$model;
|
|
128805
|
+
const raw = doc.dataManager.getRawData();
|
|
128806
|
+
const input = Object.fromEntries(Object.entries(pending).map(([path, value]) => [canonical(path), value]));
|
|
128807
|
+
const changedPaths = Object.keys(input);
|
|
128808
|
+
const requestedSources = [...new Set(sourcePaths.map(canonical))].filter((path) => changedPaths.some((changed) => under(path, changed)));
|
|
128809
|
+
if (!requestedSources.length) return input;
|
|
128810
|
+
const failedProducts = /* @__PURE__ */ new Set();
|
|
128811
|
+
const projected = { ...raw };
|
|
128812
|
+
const clonedRoots = /* @__PURE__ */ new Set();
|
|
128813
|
+
const put = (path, value) => {
|
|
128814
|
+
const key = keyOf(path);
|
|
128815
|
+
const root = key.split(/[.[]/, 1)[0];
|
|
128816
|
+
if (!clonedRoots.has(root)) {
|
|
128817
|
+
projected[root] = cloneDeep(raw[root]);
|
|
128818
|
+
clonedRoots.add(root);
|
|
128819
|
+
}
|
|
128820
|
+
set(projected, key, cloneDeep(value));
|
|
128821
|
+
};
|
|
128822
|
+
for (const path of [...changedPaths].sort((a, b) => a.length - b.length)) put(path, input[path]);
|
|
128823
|
+
const additions = {};
|
|
128824
|
+
const seen = /* @__PURE__ */ new Set();
|
|
128825
|
+
for (const instance of ((_doc$model = doc.model) === null || _doc$model === void 0 ? void 0 : _doc$model.getWidgetInstances()) ?? []) {
|
|
128826
|
+
var _instance$widgetMeta, _instance$widgetMeta2;
|
|
128827
|
+
if (!("widgetMeta" in instance)) continue;
|
|
128828
|
+
const field = (_instance$widgetMeta = instance.widgetMeta) === null || _instance$widgetMeta === void 0 ? void 0 : _instance$widgetMeta.field;
|
|
128829
|
+
const props = (_instance$widgetMeta2 = instance.widgetMeta) === null || _instance$widgetMeta2 === void 0 ? void 0 : _instance$widgetMeta2.props;
|
|
128830
|
+
if (!field || !props || !isConsumeProduct(doc, field) || !resolveAutofillEnabled(props) || seen.has(field.valuePath)) continue;
|
|
128831
|
+
const rules = props.autofillRules;
|
|
128832
|
+
if (!(rules === null || rules === void 0 ? void 0 : rules.length)) continue;
|
|
128833
|
+
seen.add(field.valuePath);
|
|
128834
|
+
for (const path of requestedSources) {
|
|
128835
|
+
if (replacePathIndexPlaceholders({
|
|
128836
|
+
refPath: path,
|
|
128837
|
+
templatePath: canonical(field.valuePath)
|
|
128838
|
+
}) !== path) continue;
|
|
128839
|
+
const rowPath = parseValuePath(path).isSubTable ? path.slice(0, path.lastIndexOf(".")) : void 0;
|
|
128840
|
+
const row = rowPath ? get(projected, keyOf(rowPath)) : void 0;
|
|
128841
|
+
if (row === null || row === void 0 ? void 0 : row.deleted_) continue;
|
|
128842
|
+
const value = get(projected, keyOf(path));
|
|
128843
|
+
const applyOptions = {
|
|
128844
|
+
doc,
|
|
128845
|
+
rawData: projected,
|
|
128846
|
+
sourceValuePath: path,
|
|
128847
|
+
needReplacePathIndexPlaceholder: true
|
|
128848
|
+
};
|
|
128849
|
+
if (!getAutofillTargetPaths(rules, applyOptions).length) continue;
|
|
128850
|
+
let record = {};
|
|
128851
|
+
if (value != null && value !== "") {
|
|
128852
|
+
if (failedProducts.has(value)) continue;
|
|
128853
|
+
try {
|
|
128854
|
+
record = await withRequestCache.handleRequest("material-consume-product", {
|
|
128855
|
+
model: field.modelLink,
|
|
128856
|
+
value
|
|
128857
|
+
}, async () => {
|
|
128858
|
+
const fetched = await fetchAutofillSource(field, {
|
|
128859
|
+
...doc.paramsConfig,
|
|
128860
|
+
[FIELD_TYPE.PRODUCT]: value
|
|
128861
|
+
});
|
|
128862
|
+
if (!fetched || typeof fetched !== "object" || Array.isArray(fetched) || !Object.keys(fetched).length) throw new Error(`物料 ${value} 的填充详情获取失败`);
|
|
128863
|
+
return fetched;
|
|
128864
|
+
}, 3e4);
|
|
128865
|
+
} catch (error) {
|
|
128866
|
+
failedProducts.add(value);
|
|
128867
|
+
console.warn("[material-consume] 物料详情查询失败,跳过填充", value, error);
|
|
128868
|
+
continue;
|
|
128869
|
+
}
|
|
128870
|
+
}
|
|
128871
|
+
const filled = applyAutofillRules(record, rules, applyOptions);
|
|
128872
|
+
if (Object.prototype.hasOwnProperty.call(filled, path)) throw new Error("物料填充规则不能回写自身");
|
|
128873
|
+
for (const [target, value] of Object.entries(filled)) {
|
|
128874
|
+
additions[target] = value;
|
|
128875
|
+
put(target, value);
|
|
128876
|
+
}
|
|
128877
|
+
}
|
|
128878
|
+
}
|
|
128879
|
+
const result = {
|
|
128880
|
+
...input,
|
|
128881
|
+
...additions
|
|
128882
|
+
};
|
|
128883
|
+
for (const root of changedPaths.filter((path) => !/[.[]/.test(keyOf(path)))) {
|
|
128884
|
+
result[root] = get(projected, keyOf(root));
|
|
128885
|
+
for (const path of Object.keys(result)) if (path !== root && under(path, root)) delete result[path];
|
|
128886
|
+
}
|
|
128887
|
+
return result;
|
|
128888
|
+
}
|
|
128889
|
+
var canonical, keyOf, under;
|
|
128890
|
+
var init_product_autofill = __esmMin((() => {
|
|
128891
|
+
init_field_type();
|
|
128892
|
+
init_core$1();
|
|
128893
|
+
init_withRequestCache();
|
|
128894
|
+
init_computed();
|
|
128895
|
+
init_autofill_runtime();
|
|
128896
|
+
init_types$7();
|
|
128897
|
+
canonical = (path) => path.startsWith("$.") ? path : `$.${path}`;
|
|
128898
|
+
keyOf = (path) => canonical(path).slice(2);
|
|
128899
|
+
under = (path, parent) => path === parent || path.startsWith(`${parent}.`) || path.startsWith(`${parent}[`);
|
|
128900
|
+
}));
|
|
128901
|
+
//#endregion
|
|
128480
128902
|
//#region src/runtime/canvas/table/render/material-consume/material-consume-table-controller.ts
|
|
128481
128903
|
/**
|
|
128482
128904
|
* 解析规则配置字符串解析成对象
|
|
@@ -128509,6 +128931,9 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
128509
128931
|
init_index_es();
|
|
128510
128932
|
init_transform();
|
|
128511
128933
|
init_derived_qty();
|
|
128934
|
+
init_initial_product_autofill();
|
|
128935
|
+
init_product_autofill();
|
|
128936
|
+
init_number_util();
|
|
128512
128937
|
init_defineProperty();
|
|
128513
128938
|
MCDataUtil = class MCDataUtil {
|
|
128514
128939
|
/**
|
|
@@ -128820,7 +129245,7 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
128820
129245
|
return {
|
|
128821
129246
|
product_id_: i.product_id_,
|
|
128822
129247
|
qty_required_uom_id_: i.uom_id_,
|
|
128823
|
-
...materialNoNum === void 0 ? {} : { qty_required_: Number(i.qty_required_)
|
|
129248
|
+
...materialNoNum === void 0 ? {} : { qty_required_: multiply(Number(i.qty_required_), materialNoNum).toNumber() },
|
|
128824
129249
|
bom_entry_id_: i.id_
|
|
128825
129250
|
};
|
|
128826
129251
|
});
|
|
@@ -128830,10 +129255,15 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
128830
129255
|
* 未填报时初始化消耗表行数据
|
|
128831
129256
|
* @param defaultData 子表行默认值(含工序等)
|
|
128832
129257
|
*/
|
|
128833
|
-
initTableData(
|
|
129258
|
+
async initTableData(doc, subFieldKey, defaultData) {
|
|
129259
|
+
const dataManager = doc.dataManager;
|
|
128834
129260
|
if (this.isDataProcessed) return [];
|
|
128835
129261
|
const existingRows = dataManager.getRawData()[subFieldKey];
|
|
128836
|
-
if (Array.isArray(existingRows) && existingRows.some((row) => row && !row.deleted_ && !row.__gw_default))
|
|
129262
|
+
if (Array.isArray(existingRows) && existingRows.some((row) => row && !row.deleted_ && !row.__gw_default)) {
|
|
129263
|
+
const writes = await prepareConsumeInitialWrite(doc, subFieldKey, existingRows);
|
|
129264
|
+
dataManager.setMultiple(writes, "hydrate");
|
|
129265
|
+
return existingRows.flatMap((row, index) => row && !row.deleted_ ? [index] : []);
|
|
129266
|
+
}
|
|
128837
129267
|
const rows = this.calcFormState();
|
|
128838
129268
|
if (!(rows === null || rows === void 0 ? void 0 : rows.length)) return [];
|
|
128839
129269
|
const tableRows = transformUtils.transformSourceData2SubTable(rows, {}, defaultData);
|
|
@@ -128842,7 +129272,9 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
128842
129272
|
if (!row.routing_operation_id_) row.routing_operation_id_ = this.tmplBomController.operationId;
|
|
128843
129273
|
row.is_confirmed_ = i > 0 && this.enableSequenceLoading;
|
|
128844
129274
|
});
|
|
128845
|
-
|
|
129275
|
+
const deletedRows = Array.isArray(existingRows) ? existingRows.filter((row) => row === null || row === void 0 ? void 0 : row.deleted_) : [];
|
|
129276
|
+
const writes = await prepareConsumeInitialWrite(doc, subFieldKey, [...tableRows, ...deletedRows]);
|
|
129277
|
+
dataManager.setMultiple(writes, "hydrate");
|
|
128846
129278
|
tableRows.forEach((row, i) => {
|
|
128847
129279
|
const rowPath = `$.${subFieldKey}[${i}]`;
|
|
128848
129280
|
if (row.is_confirmed_) MCDataUtil.updateConfirmableFieldsDisablement({
|
|
@@ -129008,10 +129440,15 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
129008
129440
|
};
|
|
129009
129441
|
if (isRecordPattern && !row.product_id_) row._scanFallback = true;
|
|
129010
129442
|
Object.assign(row, transformedData);
|
|
129011
|
-
|
|
129443
|
+
Object.assign(row, this.getDefaultValue(row));
|
|
129012
129444
|
try {
|
|
129013
129445
|
const plan = await this.bomEntriesValidator.validateScanCanInsert(row, this.actualTableData);
|
|
129014
|
-
|
|
129446
|
+
const { rows: nextRows, filledRowKey } = await applyScanFillPlan(this.actualTableData, row, plan, { validateCurrentGroupForSwitch: (table, current) => this.bomEntriesValidator.validateCurrentGroupForSwitch(table, current) });
|
|
129447
|
+
const deletedRows = this.tableDataRef.value.filter((item) => item.deleted_);
|
|
129448
|
+
const filledIndex = nextRows.findIndex((item) => getFrontRowKey(item) === filledRowKey);
|
|
129449
|
+
const sourcePaths = filledIndex >= 0 && nextRows[filledIndex].product_id_ ? [`${this.subTableInfo.valuePath}[${filledIndex}].product_id_`] : [];
|
|
129450
|
+
const writes = await prepareConsumeWrite(doc, { [this.subTableInfo.valuePath]: [...nextRows, ...deletedRows] }, sourcePaths);
|
|
129451
|
+
doc.dataManager.setMultiple(writes, "user");
|
|
129015
129452
|
this.updateDerivedQtyFields(doc);
|
|
129016
129453
|
} catch (e) {
|
|
129017
129454
|
console.error(e);
|
|
@@ -129061,7 +129498,7 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
129061
129498
|
(_this$setupUomUnsubsc = this.setupUomUnsubscribe) === null || _this$setupUomUnsubsc === void 0 || _this$setupUomUnsubsc.call(this);
|
|
129062
129499
|
this.setupDoc = opts.doc;
|
|
129063
129500
|
this.unitConversionRules = getUnitConversionRulesFromDoc(opts.doc);
|
|
129064
|
-
const initializedRowIndexes = shouldInitializeDocumentData(opts.doc) ? this.initTableData(opts.doc
|
|
129501
|
+
const initializedRowIndexes = shouldInitializeDocumentData(opts.doc) ? await this.initTableData(opts.doc, opts.subTableInfo.subFieldKey, opts.defaultRowData) : [];
|
|
129065
129502
|
await hydrateSubtableRowLabels(opts.doc, opts.subTableInfo.subFieldKey, initializedRowIndexes);
|
|
129066
129503
|
let materialNoNum = this.materialNoNum;
|
|
129067
129504
|
if (this.dataStatus !== "SUBMIT") this.syncQtyRequiredFromBom(opts.doc);
|
|
@@ -129449,16 +129886,10 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
129449
129886
|
doc.dataManager.set(fieldKey, resolveConsumedQtyWithoutProduct(row.qty_), "user");
|
|
129450
129887
|
return;
|
|
129451
129888
|
}
|
|
129452
|
-
let total = 0;
|
|
129453
129889
|
const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
|
|
129454
|
-
const beforeArr = this.actualTableData.slice(0, rowIndex + 1);
|
|
129455
129890
|
if (util) {
|
|
129456
|
-
|
|
129457
|
-
|
|
129458
|
-
util.filterGroupData(beforeArr).forEach((i) => {
|
|
129459
|
-
total += Number(i.qty_ || 0);
|
|
129460
|
-
});
|
|
129461
|
-
doc.dataManager.set(fieldKey, total, "user");
|
|
129891
|
+
const rows = this.actualTableData.slice(0, rowIndex + 1);
|
|
129892
|
+
doc.dataManager.set(fieldKey, util.calcRunningQtyConsumed(rows), "user");
|
|
129462
129893
|
}
|
|
129463
129894
|
};
|
|
129464
129895
|
setTimeout(() => {
|
|
@@ -129515,89 +129946,65 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
129515
129946
|
}
|
|
129516
129947
|
return value;
|
|
129517
129948
|
}
|
|
129518
|
-
/**
|
|
129519
|
-
|
|
129520
|
-
|
|
129521
|
-
|
|
129522
|
-
const
|
|
129523
|
-
|
|
129524
|
-
|
|
129525
|
-
|
|
129526
|
-
|
|
129527
|
-
|
|
129528
|
-
|
|
129529
|
-
|
|
129530
|
-
|
|
129531
|
-
|
|
129532
|
-
|
|
129533
|
-
|
|
129534
|
-
|
|
129535
|
-
|
|
129536
|
-
|
|
129537
|
-
|
|
129538
|
-
|
|
129539
|
-
|
|
129540
|
-
|
|
129541
|
-
|
|
129542
|
-
|
|
129543
|
-
|
|
129544
|
-
|
|
129545
|
-
|
|
129546
|
-
|
|
129547
|
-
|
|
129548
|
-
|
|
129549
|
-
|
|
129550
|
-
|
|
129551
|
-
|
|
129552
|
-
|
|
129553
|
-
|
|
129554
|
-
|
|
129555
|
-
|
|
129556
|
-
|
|
129557
|
-
|
|
129558
|
-
|
|
129559
|
-
|
|
129560
|
-
|
|
129561
|
-
|
|
129562
|
-
|
|
129563
|
-
|
|
129564
|
-
|
|
129565
|
-
|
|
129566
|
-
|
|
129567
|
-
|
|
129568
|
-
|
|
129569
|
-
|
|
129570
|
-
|
|
129571
|
-
|
|
129572
|
-
|
|
129573
|
-
|
|
129574
|
-
|
|
129575
|
-
try {
|
|
129576
|
-
await this.validateReinspectionDate({
|
|
129577
|
-
product_id_: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.product_id_) ?? row.product_id_,
|
|
129578
|
-
material_no_: materialNo,
|
|
129579
|
-
material_no_id_: selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id_
|
|
129580
|
-
});
|
|
129581
|
-
} catch (e) {
|
|
129582
|
-
doc.dataManager.setMultiple({
|
|
129583
|
-
[`${rowPath}.material_no_`]: void 0,
|
|
129584
|
-
[`${rowPath}.material_no__id_`]: void 0,
|
|
129585
|
-
[`${rowPath}.material_no__lb_`]: void 0
|
|
129586
|
-
}, "user");
|
|
129587
|
-
this.error(e.message);
|
|
129588
|
-
return;
|
|
129589
|
-
}
|
|
129590
|
-
if (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.product_id_) doc.dataManager.setMultiple({ [`${rowPath}.product_id_`]: selectedOption.product_id_ }, "user");
|
|
129591
|
-
}
|
|
129592
|
-
const rowData = doc.dataManager.getRawData()[parentFieldKey][dataIndex];
|
|
129593
|
-
const value = this.getDefaultValue(rowData);
|
|
129594
|
-
const wordValue = Object.entries(value).reduce((data, [key, value]) => {
|
|
129595
|
-
data[`${rowPath}.${key}`] = value;
|
|
129596
|
-
return data;
|
|
129597
|
-
}, {});
|
|
129598
|
-
doc.dataManager.setMultiple(wordValue, "user");
|
|
129599
|
-
this.updateDerivedQtyFields(doc);
|
|
129949
|
+
/** 下拉写入前校验,只生成更新,不修改当前行。 */
|
|
129950
|
+
async prepareSelectChange({ pending, selectedOption, doc, parsed, dataIndex }) {
|
|
129951
|
+
const { fieldKey, parentFieldPath } = parsed;
|
|
129952
|
+
if (!["product_id_", "material_no_"].includes(fieldKey)) return {};
|
|
129953
|
+
const rowPath = `${parentFieldPath}[${dataIndex}]`;
|
|
129954
|
+
const row = { ...doc.dataManager.get(rowPath) ?? {} };
|
|
129955
|
+
const updates = {};
|
|
129956
|
+
for (const [path, value] of Object.entries(pending)) if (path.startsWith(`${rowPath}.`)) row[path.slice(rowPath.length + 1)] = value;
|
|
129957
|
+
const put = (key, value) => {
|
|
129958
|
+
row[key] = value;
|
|
129959
|
+
updates[`${rowPath}.${key}`] = value;
|
|
129960
|
+
};
|
|
129961
|
+
if (fieldKey === "product_id_") {
|
|
129962
|
+
if (!row.product_id_) {
|
|
129963
|
+
put("qty_required_uom_id_", null);
|
|
129964
|
+
put("qty_required_uom_id__lb_", null);
|
|
129965
|
+
}
|
|
129966
|
+
if (row._scanFallback) {
|
|
129967
|
+
await this.validateReinspectionDate({
|
|
129968
|
+
product_id_: row.product_id_,
|
|
129969
|
+
material_no_: row.material_no_,
|
|
129970
|
+
material_no_id_: row.material_no__id_
|
|
129971
|
+
});
|
|
129972
|
+
return updates;
|
|
129973
|
+
}
|
|
129974
|
+
for (const key of [
|
|
129975
|
+
"material_no_",
|
|
129976
|
+
"material_no__id_",
|
|
129977
|
+
"material_no__lb_",
|
|
129978
|
+
"expiration_date_"
|
|
129979
|
+
]) put(key, null);
|
|
129980
|
+
} else {
|
|
129981
|
+
if (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.is_locked_) throw new Error(await getLotLockedReason(selectedOption.id_));
|
|
129982
|
+
if (!row.material_no_) return updates;
|
|
129983
|
+
await this.validateReinspectionDate({
|
|
129984
|
+
product_id_: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.product_id_) ?? row.product_id_,
|
|
129985
|
+
material_no_: row.material_no_,
|
|
129986
|
+
material_no_id_: row.material_no__id_
|
|
129987
|
+
});
|
|
129988
|
+
if (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.product_id_) put("product_id_", selectedOption.product_id_);
|
|
129989
|
+
}
|
|
129990
|
+
for (const [key, value] of Object.entries(this.getDefaultValue(row))) put(key, value);
|
|
129991
|
+
return updates;
|
|
129992
|
+
}
|
|
129993
|
+
/** 提交成功后刷新查询条件、禁用状态及派生数量。 */
|
|
129994
|
+
afterSelectChange({ doc, parsed, dataIndex }) {
|
|
129995
|
+
const { fieldKey, parentFieldPath } = parsed;
|
|
129996
|
+
if (!["product_id_", "material_no_"].includes(fieldKey)) return;
|
|
129997
|
+
const rowPath = `${parentFieldPath}[${dataIndex}]`;
|
|
129998
|
+
const row = doc.dataManager.get(rowPath);
|
|
129999
|
+
if (!row) return;
|
|
130000
|
+
if (fieldKey === "product_id_" && row._scanFallback) return;
|
|
130001
|
+
if (fieldKey === "product_id_") {
|
|
130002
|
+
var _row$product_id_;
|
|
130003
|
+
const versionId = (_row$product_id_ = row.product_id_) === null || _row$product_id_ === void 0 ? void 0 : _row$product_id_.split(":").pop();
|
|
130004
|
+
if (versionId) getSubFieldConfig(doc.paramsConfig).set(`${rowPath}.material_no_`, { "product_id_.versionIn": [versionId] });
|
|
130005
|
+
this.syncEditingRowDisablement(doc.dataManager, rowPath, row);
|
|
129600
130006
|
}
|
|
130007
|
+
this.updateDerivedQtyFields(doc);
|
|
129601
130008
|
}
|
|
129602
130009
|
};
|
|
129603
130010
|
}));
|
|
@@ -138638,6 +139045,7 @@ async function prepareObjectProductAutofills({ enabled, instances, objectInitial
|
|
|
138638
139045
|
const pending = [];
|
|
138639
139046
|
if (!enabled || !objectInitialValues.length) return pending;
|
|
138640
139047
|
const productRecords = /* @__PURE__ */ new Map();
|
|
139048
|
+
const failedProducts = /* @__PURE__ */ new Set();
|
|
138641
139049
|
for (const instance of instances) {
|
|
138642
139050
|
var _instance$widgetMeta, _instance$widgetMeta2;
|
|
138643
139051
|
const field = (_instance$widgetMeta = instance.widgetMeta) === null || _instance$widgetMeta === void 0 ? void 0 : _instance$widgetMeta.field;
|
|
@@ -138650,15 +139058,20 @@ async function prepareObjectProductAutofills({ enabled, instances, objectInitial
|
|
|
138650
139058
|
if (!(configured === null || configured === void 0 ? void 0 : configured.values) || !Object.prototype.hasOwnProperty.call(configured.values, fieldKey)) continue;
|
|
138651
139059
|
const value = configured.values[fieldKey];
|
|
138652
139060
|
if (typeof value !== "string" || value === "" || rawData[fieldKey] !== value) continue;
|
|
139061
|
+
if (failedProducts.has(value)) continue;
|
|
138653
139062
|
let sourceData = productRecords.get(value);
|
|
138654
|
-
if (!sourceData) {
|
|
139063
|
+
if (!sourceData) try {
|
|
138655
139064
|
const fetched = await fetchAutofillSource(field, {
|
|
138656
139065
|
...context,
|
|
138657
139066
|
[FIELD_TYPE.PRODUCT]: value
|
|
138658
139067
|
});
|
|
138659
|
-
if (!fetched || typeof fetched !== "object" || Array.isArray(fetched) || Object.keys(fetched).length === 0) throw new Error(
|
|
139068
|
+
if (!fetched || typeof fetched !== "object" || Array.isArray(fetched) || Object.keys(fetched).length === 0) throw new Error(`未获取到物料 ${value} 的详情`);
|
|
138660
139069
|
sourceData = fetched;
|
|
138661
139070
|
productRecords.set(value, sourceData);
|
|
139071
|
+
} catch (error) {
|
|
139072
|
+
failedProducts.add(value);
|
|
139073
|
+
console.warn("[material-consume] 对象初值详情查询失败,跳过填充", fieldKey, error);
|
|
139074
|
+
continue;
|
|
138662
139075
|
}
|
|
138663
139076
|
defaultDataMap[field.valuePath] = value;
|
|
138664
139077
|
pending.push({
|
|
@@ -138674,14 +139087,18 @@ async function prepareObjectProductAutofills({ enabled, instances, objectInitial
|
|
|
138674
139087
|
function applyObjectProductAutofills(doc, pending) {
|
|
138675
139088
|
for (const item of pending) {
|
|
138676
139089
|
if (doc.dataManager.get(item.field.valuePath) !== item.value) continue;
|
|
138677
|
-
|
|
138678
|
-
|
|
138679
|
-
|
|
138680
|
-
|
|
138681
|
-
|
|
138682
|
-
|
|
138683
|
-
|
|
138684
|
-
|
|
139090
|
+
try {
|
|
139091
|
+
const updates = applyAutofillRules(item.sourceData, item.rules, {
|
|
139092
|
+
needReplacePathIndexPlaceholder: true,
|
|
139093
|
+
sourceValuePath: item.field.valuePath,
|
|
139094
|
+
rawData: doc.dataManager.getRawData(),
|
|
139095
|
+
doc
|
|
139096
|
+
});
|
|
139097
|
+
const initialUpdates = Object.fromEntries(Object.entries(updates).filter(([path]) => doc.dataManager.getStoredValue(path) === void 0));
|
|
139098
|
+
if (Object.keys(initialUpdates).length) doc.dataManager.setMultiple(initialUpdates, "hydrate");
|
|
139099
|
+
} catch (error) {
|
|
139100
|
+
console.warn("[material-consume] 对象初值规则执行失败,跳过填充", item.field.valuePath, error);
|
|
139101
|
+
}
|
|
138685
139102
|
}
|
|
138686
139103
|
}
|
|
138687
139104
|
//#endregion
|
|
@@ -146573,6 +146990,7 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
146573
146990
|
init_dialog_container();
|
|
146574
146991
|
init_useWidgetRenderData();
|
|
146575
146992
|
init_computed();
|
|
146993
|
+
init_product_autofill();
|
|
146576
146994
|
init__register_();
|
|
146577
146995
|
init_useDependency();
|
|
146578
146996
|
init_useWidgetInitializer();
|
|
@@ -146817,10 +147235,10 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
146817
147235
|
if (isMaterialObjectScanOpen) return;
|
|
146818
147236
|
isMaterialObjectScanOpen = true;
|
|
146819
147237
|
try {
|
|
146820
|
-
var _fieldMeta$value3, _tmplBomCRef$value
|
|
147238
|
+
var _fieldMeta$value3, _tmplBomCRef$value;
|
|
146821
147239
|
const belongingObject = (_fieldMeta$value3 = fieldMeta.value) === null || _fieldMeta$value3 === void 0 ? void 0 : _fieldMeta$value3.belongingObject;
|
|
146822
147240
|
const objectBom = tmplBomCRef === null || tmplBomCRef === void 0 || (_tmplBomCRef$value = tmplBomCRef.value) === null || _tmplBomCRef$value === void 0 || (_tmplBomCRef$value = _tmplBomCRef$value.formInstBom) === null || _tmplBomCRef$value === void 0 || (_tmplBomCRef$value = _tmplBomCRef$value.formTmplObjectBomList) === null || _tmplBomCRef$value === void 0 ? void 0 : _tmplBomCRef$value.find((item) => item.object_key_ === belongingObject);
|
|
146823
|
-
const scanRules = !!(
|
|
147241
|
+
const scanRules = !!(objectBom === null || objectBom === void 0 ? void 0 : objectBom.disable_barcode_parsing_) ? void 0 : toParseRuleConfig(objectBom === null || objectBom === void 0 ? void 0 : objectBom.barcode_parsing_rules_id_);
|
|
146824
147242
|
const objectFields = fieldList.value.filter((item) => item.belongingObject === belongingObject);
|
|
146825
147243
|
await G2("COMMON_SCAN", {
|
|
146826
147244
|
title: "扫码录入",
|
|
@@ -146900,7 +147318,8 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
146900
147318
|
}
|
|
146901
147319
|
if (transformedData && typeof transformedData === "object") Object.assign(updates, Object.fromEntries(Object.entries(transformedData).map(([key, value]) => [rootPath(key), value])));
|
|
146902
147320
|
if (updates[runtimeValuePath.value] !== material.productionIdentificationName) updates[getIdPath(runtimeValuePath.value)] = null;
|
|
146903
|
-
props.doc
|
|
147321
|
+
const writes = await prepareConsumeWrite(props.doc, updates);
|
|
147322
|
+
props.doc.dataManager.setMultiple(writes, "user");
|
|
146904
147323
|
await props.doc.dataManager.whenEmitSettled();
|
|
146905
147324
|
return true;
|
|
146906
147325
|
} catch (e) {
|
|
@@ -146961,15 +147380,20 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
146961
147380
|
});
|
|
146962
147381
|
}
|
|
146963
147382
|
async function onChange(data, record) {
|
|
146964
|
-
var _widgetProps$value, _widgetProps$value2, _props$widget$widgetM, _props$widget$dataSlo,
|
|
147383
|
+
var _widgetProps$value, _widgetProps$value2, _props$widget$widgetM, _props$widget$dataSlo, _tmplBomCRef$value6;
|
|
147384
|
+
const field = fieldMeta.value;
|
|
146965
147385
|
const dataValues = loadDataValuesByAutofillRules(record, (_widgetProps$value = widgetProps.value) === null || _widgetProps$value === void 0 ? void 0 : _widgetProps$value.autofillRules, runtimeValuePath.value, (_widgetProps$value2 = widgetProps.value) === null || _widgetProps$value2 === void 0 ? void 0 : _widgetProps$value2.autofillEnabled, props.doc, data);
|
|
146966
147386
|
const subFieldValuePath = (_props$widget$widgetM = props.widget.widgetMeta) === null || _props$widget$widgetM === void 0 || (_props$widget$widgetM = _props$widget$widgetM.field) === null || _props$widget$widgetM === void 0 ? void 0 : _props$widget$widgetM.valuePath;
|
|
146967
147387
|
const dataIndex = (_props$widget$dataSlo = props.widget.dataSlotIndex) === null || _props$widget$dataSlo === void 0 ? void 0 : _props$widget$dataSlo.dataIndex;
|
|
147388
|
+
const parsed = subFieldValuePath && isNumber(dataIndex) ? parseValuePath(subFieldValuePath) : void 0;
|
|
147389
|
+
const consumeController = (parsed === null || parsed === void 0 ? void 0 : parsed.parentFieldPath) ? tmplBomCRef === null || tmplBomCRef === void 0 || (_tmplBomCRef$value6 = tmplBomCRef.value) === null || _tmplBomCRef$value6 === void 0 ? void 0 : _tmplBomCRef$value6.tableControllers[parsed.parentFieldPath] : void 0;
|
|
147390
|
+
const owner = (field === null || field === void 0 ? void 0 : field.belongingObject) ? fieldList.value.find((item) => item.key === field.belongingObject) : void 0;
|
|
147391
|
+
const isConsumeObject = !!owner && resolveFieldManifestType(owner) === FIELD_TYPE.MATERIAL_CONSUME;
|
|
146968
147392
|
const tableRuntime = new TableRuntime(props.doc);
|
|
146969
147393
|
let reverseFill = {};
|
|
146970
147394
|
let optionFill = {};
|
|
146971
|
-
if (
|
|
146972
|
-
const { parentFieldKey, fieldKey } =
|
|
147395
|
+
if (parsed && isNumber(dataIndex) && record) {
|
|
147396
|
+
const { parentFieldKey, fieldKey } = parsed;
|
|
146973
147397
|
if (parentFieldKey && fieldKey) {
|
|
146974
147398
|
reverseFill = tableRuntime.buildSelectReverseFill({
|
|
146975
147399
|
subFieldKey: parentFieldKey,
|
|
@@ -146987,13 +147411,13 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
146987
147411
|
}
|
|
146988
147412
|
const dateObjectRuntime = new DateObjectRuntime(props.doc);
|
|
146989
147413
|
const dateObjectFill = dateObjectRuntime.buildFillFromOption({
|
|
146990
|
-
belongingObject:
|
|
146991
|
-
bizType:
|
|
147414
|
+
belongingObject: field === null || field === void 0 ? void 0 : field.belongingObject,
|
|
147415
|
+
bizType: field === null || field === void 0 ? void 0 : field.fieldType,
|
|
146992
147416
|
selectedOption: record
|
|
146993
147417
|
});
|
|
146994
147418
|
const dateObjectClears = dateObjectRuntime.buildDownstreamClears({
|
|
146995
|
-
belongingObject:
|
|
146996
|
-
bizType:
|
|
147419
|
+
belongingObject: field === null || field === void 0 ? void 0 : field.belongingObject,
|
|
147420
|
+
bizType: field === null || field === void 0 ? void 0 : field.fieldType,
|
|
146997
147421
|
pending: data
|
|
146998
147422
|
});
|
|
146999
147423
|
const pending = {
|
|
@@ -147004,55 +147428,45 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
147004
147428
|
...dateObjectFill
|
|
147005
147429
|
};
|
|
147006
147430
|
const linkageClears = tableRuntime.buildDownstreamClears(pending);
|
|
147007
|
-
let consumeUpdates = {};
|
|
147008
147431
|
try {
|
|
147009
|
-
var
|
|
147010
|
-
consumeUpdates = await buildConsumeObjectSelectUpdates({
|
|
147432
|
+
var _tmplBomCRef$value7;
|
|
147433
|
+
const consumeUpdates = await buildConsumeObjectSelectUpdates({
|
|
147011
147434
|
doc: props.doc,
|
|
147012
|
-
belongingObject:
|
|
147013
|
-
fieldType:
|
|
147435
|
+
belongingObject: field === null || field === void 0 ? void 0 : field.belongingObject,
|
|
147436
|
+
fieldType: field === null || field === void 0 ? void 0 : field.fieldType,
|
|
147014
147437
|
selectedOption: record,
|
|
147015
147438
|
pending: data,
|
|
147016
|
-
formInstBom: tmplBomCRef === null || tmplBomCRef === void 0 || (_tmplBomCRef$
|
|
147439
|
+
formInstBom: tmplBomCRef === null || tmplBomCRef === void 0 || (_tmplBomCRef$value7 = tmplBomCRef.value) === null || _tmplBomCRef$value7 === void 0 ? void 0 : _tmplBomCRef$value7.formInstBom
|
|
147017
147440
|
});
|
|
147018
|
-
|
|
147019
|
-
|
|
147020
|
-
|
|
147021
|
-
|
|
147022
|
-
|
|
147023
|
-
|
|
147024
|
-
|
|
147025
|
-
|
|
147026
|
-
|
|
147027
|
-
|
|
147028
|
-
|
|
147029
|
-
|
|
147030
|
-
|
|
147031
|
-
|
|
147032
|
-
|
|
147033
|
-
|
|
147034
|
-
|
|
147035
|
-
|
|
147036
|
-
|
|
147037
|
-
|
|
147038
|
-
|
|
147039
|
-
|
|
147040
|
-
|
|
147041
|
-
|
|
147042
|
-
|
|
147043
|
-
|
|
147044
|
-
|
|
147045
|
-
|
|
147046
|
-
|
|
147047
|
-
const tableController = tmplBomCRef.value.tableControllers[parentFieldPath];
|
|
147048
|
-
tableController === null || tableController === void 0 || tableController.handleSelectChange({
|
|
147049
|
-
changedData: data,
|
|
147050
|
-
selectedOption: record,
|
|
147051
|
-
doc: props.doc,
|
|
147052
|
-
parsed,
|
|
147053
|
-
dataIndex
|
|
147054
|
-
});
|
|
147055
|
-
}
|
|
147441
|
+
const nextValues = {
|
|
147442
|
+
...pending,
|
|
147443
|
+
...linkageClears,
|
|
147444
|
+
...dateObjectClears,
|
|
147445
|
+
...consumeUpdates
|
|
147446
|
+
};
|
|
147447
|
+
if (consumeController && parsed && isNumber(dataIndex)) Object.assign(nextValues, await consumeController.prepareSelectChange({
|
|
147448
|
+
pending: nextValues,
|
|
147449
|
+
selectedOption: record,
|
|
147450
|
+
doc: props.doc,
|
|
147451
|
+
parsed,
|
|
147452
|
+
dataIndex
|
|
147453
|
+
}));
|
|
147454
|
+
const reinspection = getConsumeObjectReinspectionParams({
|
|
147455
|
+
doc: props.doc,
|
|
147456
|
+
belongingObject: field === null || field === void 0 ? void 0 : field.belongingObject,
|
|
147457
|
+
fieldType: field === null || field === void 0 ? void 0 : field.fieldType,
|
|
147458
|
+
nextValues
|
|
147459
|
+
});
|
|
147460
|
+
if (reinspection) await assertReinspectionDate(reinspection);
|
|
147461
|
+
const writes = (field === null || field === void 0 ? void 0 : field.fieldType) === FIELD_TYPE.MATERIAL_NO && (consumeController || isConsumeObject) ? await prepareConsumeWrite(props.doc, nextValues) : nextValues;
|
|
147462
|
+
props.doc.dataManager.setMultiple(writes, "user");
|
|
147463
|
+
if (consumeController && parsed && isNumber(dataIndex)) consumeController.afterSelectChange({
|
|
147464
|
+
doc: props.doc,
|
|
147465
|
+
parsed,
|
|
147466
|
+
dataIndex
|
|
147467
|
+
});
|
|
147468
|
+
} catch (error) {
|
|
147469
|
+
GctMessage.error(error instanceof Error ? error.message : String(error));
|
|
147056
147470
|
}
|
|
147057
147471
|
}
|
|
147058
147472
|
return (_ctx, _cache) => {
|
|
@@ -147170,8 +147584,8 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
147170
147584
|
//#region src/runtime/canvas/__common__/widget-container/overlay-render.vue?vue&type=style&index=0&lang.less
|
|
147171
147585
|
var init_overlay_render_vue_vue_type_style_index_0_lang = __esmMin((() => {}));
|
|
147172
147586
|
//#endregion
|
|
147173
|
-
//#region src/runtime/canvas/__common__/widget-container/overlay-render.vue?vue&type=style&index=1&scoped=
|
|
147174
|
-
var
|
|
147587
|
+
//#region src/runtime/canvas/__common__/widget-container/overlay-render.vue?vue&type=style&index=1&scoped=30ffcbd4&lang.less
|
|
147588
|
+
var init_overlay_render_vue_vue_type_style_index_1_scoped_30ffcbd4_lang = __esmMin((() => {}));
|
|
147175
147589
|
//#endregion
|
|
147176
147590
|
//#region src/runtime/canvas/__common__/widget-container/overlay-render.vue
|
|
147177
147591
|
var overlay_render_default;
|
|
@@ -147179,9 +147593,9 @@ var init_overlay_render = __esmMin((() => {
|
|
|
147179
147593
|
init_overlay_render_vue_vue_type_script_setup_true_lang();
|
|
147180
147594
|
init_overlay_render_vue_vue_type_script_setup_true_lang();
|
|
147181
147595
|
init_overlay_render_vue_vue_type_style_index_0_lang();
|
|
147182
|
-
|
|
147596
|
+
init_overlay_render_vue_vue_type_style_index_1_scoped_30ffcbd4_lang();
|
|
147183
147597
|
init__plugin_vue_export_helper();
|
|
147184
|
-
overlay_render_default = /*#__PURE__*/ _plugin_vue_export_helper_default(overlay_render_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
147598
|
+
overlay_render_default = /*#__PURE__*/ _plugin_vue_export_helper_default(overlay_render_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-30ffcbd4"]]);
|
|
147185
147599
|
}));
|
|
147186
147600
|
//#endregion
|
|
147187
147601
|
//#region src/utils/composables/useHoverDelay.ts
|
|
@@ -150981,7 +151395,7 @@ var init_bounded_table_action_vue_vue_type_script_setup_true_name_sub_table_acti
|
|
|
150981
151395
|
var _widgetMeta$props;
|
|
150982
151396
|
const { type, widgetMeta } = props.cell.subRenderer || {};
|
|
150983
151397
|
const quickFill = widgetMeta === null || widgetMeta === void 0 || (_widgetMeta$props = widgetMeta.props) === null || _widgetMeta$props === void 0 ? void 0 : _widgetMeta$props.quickFill;
|
|
150984
|
-
return { canQuickFill: type === "fixed-table" &&
|
|
151398
|
+
return { canQuickFill: type === "fixed-table" && !!quickFill };
|
|
150985
151399
|
});
|
|
150986
151400
|
const refreshEmptyGroupState = () => {
|
|
150987
151401
|
hasEmptyGroup.value = hasFixedTableEmptyGroup(props.doc, getSubFieldKey());
|
|
@@ -151287,6 +151701,8 @@ var init_table_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
151287
151701
|
tableDataRef,
|
|
151288
151702
|
subTableInfo,
|
|
151289
151703
|
mainFormState
|
|
151704
|
+
}).catch((error) => {
|
|
151705
|
+
console.warn("[material-consume] 表格初始化异常,跳过后续处理", error);
|
|
151290
151706
|
});
|
|
151291
151707
|
});
|
|
151292
151708
|
});
|
|
@@ -155159,7 +155575,7 @@ var toolkit_item_vue_vue_type_script_setup_true_name_toolkit_item_lang_default =
|
|
|
155159
155575
|
const emit = __emit;
|
|
155160
155576
|
const isVisible = ref(false);
|
|
155161
155577
|
const dropdownRef = ref();
|
|
155162
|
-
const isActive = computed(() => props.active
|
|
155578
|
+
const isActive = computed(() => props.noDropdown ? props.active : isVisible.value);
|
|
155163
155579
|
watch(isVisible, (newVal) => {
|
|
155164
155580
|
emit("visible-change", newVal);
|
|
155165
155581
|
});
|
|
@@ -155183,7 +155599,7 @@ var toolkit_item_vue_vue_type_script_setup_true_name_toolkit_item_lang_default =
|
|
|
155183
155599
|
isVisible
|
|
155184
155600
|
});
|
|
155185
155601
|
return (_ctx, _cache) => {
|
|
155186
|
-
return openBlock(), createElementBlock("div", _hoisted_1$120, [
|
|
155602
|
+
return openBlock(), createElementBlock("div", _hoisted_1$120, [(openBlock(), createBlock(resolveDynamicComponent(__props.noDropdown ? "div" : unref(dropdown_default)), {
|
|
155187
155603
|
ref_key: "dropdownRef",
|
|
155188
155604
|
ref: dropdownRef,
|
|
155189
155605
|
popperClass: "toolkit-item-dropdown",
|
|
@@ -155193,7 +155609,10 @@ var toolkit_item_vue_vue_type_script_setup_true_name_toolkit_item_lang_default =
|
|
|
155193
155609
|
onShow: handleShow,
|
|
155194
155610
|
onHide: handleHide
|
|
155195
155611
|
}, createSlots({
|
|
155196
|
-
default: withCtx(() => [createElementVNode("div", {
|
|
155612
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
155613
|
+
class: normalizeClass(["area", { active: isActive.value }]),
|
|
155614
|
+
onClick: _cache[0] || (_cache[0] = ($event) => __props.noDropdown && emit("visible-change", true))
|
|
155615
|
+
}, [createVNode(toolkit_svg_icon_default, {
|
|
155197
155616
|
name: __props.icon,
|
|
155198
155617
|
size: 20
|
|
155199
155618
|
}, null, 8, ["name"]), createElementVNode("span", _hoisted_5$27, toDisplayString(__props.label), 1)], 2)]),
|
|
@@ -155214,14 +155633,14 @@ var toolkit_item_vue_vue_type_script_setup_true_name_toolkit_item_lang_default =
|
|
|
155214
155633
|
})])
|
|
155215
155634
|
]), renderSlot(_ctx.$slots, "default", {}, void 0, true)])]),
|
|
155216
155635
|
key: "0"
|
|
155217
|
-
} : void 0]),
|
|
155636
|
+
} : void 0]), 1568))]);
|
|
155218
155637
|
};
|
|
155219
155638
|
}
|
|
155220
155639
|
});
|
|
155221
155640
|
//#endregion
|
|
155222
155641
|
//#region src/runtime/designer/toolkit/toolkit-item.vue
|
|
155223
155642
|
init__plugin_vue_export_helper();
|
|
155224
|
-
var toolkit_item_default = /*#__PURE__*/ _plugin_vue_export_helper_default(toolkit_item_vue_vue_type_script_setup_true_name_toolkit_item_lang_default, [["__scopeId", "data-v-
|
|
155643
|
+
var toolkit_item_default = /*#__PURE__*/ _plugin_vue_export_helper_default(toolkit_item_vue_vue_type_script_setup_true_name_toolkit_item_lang_default, [["__scopeId", "data-v-c90f4687"]]);
|
|
155225
155644
|
//#endregion
|
|
155226
155645
|
//#region src/runtime/designer/toolkit/renderer/add-field-btn.vue?vue&type=script&setup=true&lang.ts
|
|
155227
155646
|
init_base$2();
|
|
@@ -155357,6 +155776,7 @@ function useDragdrop(allowTypes, callbacks = {}) {
|
|
|
155357
155776
|
//#region src/runtime/factories/createDesignWidgetFactory.ts
|
|
155358
155777
|
init_core$1();
|
|
155359
155778
|
init_on_field_attach();
|
|
155779
|
+
init_product_fields();
|
|
155360
155780
|
init_quick_search_util();
|
|
155361
155781
|
init_field_config_visibility();
|
|
155362
155782
|
init_field_type();
|
|
@@ -155417,7 +155837,8 @@ function createDesignFieldToWidgetFactory(getFieldManifestForField) {
|
|
|
155417
155837
|
extra: buildPaletteExtra(manifest, field.name, opts)
|
|
155418
155838
|
}, field, {
|
|
155419
155839
|
parentFieldKey: opts.parentFieldKey,
|
|
155420
|
-
refModelType: opts.refModelType
|
|
155840
|
+
refModelType: opts.refModelType,
|
|
155841
|
+
fieldProfile: field.belongingObject ? getMaterialConsumeObjectFieldProfile(field, opts.modelFields ?? []) ?? null : void 0
|
|
155421
155842
|
});
|
|
155422
155843
|
};
|
|
155423
155844
|
}
|
|
@@ -155562,6 +155983,7 @@ init__plugin_vue_export_helper();
|
|
|
155562
155983
|
var field_palette_default = /*#__PURE__*/ _plugin_vue_export_helper_default(field_palette_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b61f4e94"]]);
|
|
155563
155984
|
//#endregion
|
|
155564
155985
|
//#region src/runtime/designer/toolkit/renderer/toolkit-content-fields.vue?vue&type=script&setup=true&lang.ts
|
|
155986
|
+
init_base$2();
|
|
155565
155987
|
init__register_();
|
|
155566
155988
|
init_field_type();
|
|
155567
155989
|
init_core$1();
|
|
@@ -155656,13 +156078,19 @@ var toolkit_content_fields_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
155656
156078
|
}
|
|
155657
156079
|
};
|
|
155658
156080
|
const handleDragStart = (field, e) => {
|
|
155659
|
-
|
|
155660
|
-
|
|
155661
|
-
|
|
155662
|
-
|
|
155663
|
-
|
|
155664
|
-
|
|
155665
|
-
|
|
156081
|
+
try {
|
|
156082
|
+
setDndTransferData(e, {
|
|
156083
|
+
type: DndTransferTypeConst.Field,
|
|
156084
|
+
data: createFieldToWidget(field, {
|
|
156085
|
+
parentFieldKey: subFieldKey.value,
|
|
156086
|
+
refModelType: refModelType.value,
|
|
156087
|
+
modelFields: fields.value
|
|
156088
|
+
})
|
|
156089
|
+
}, false);
|
|
156090
|
+
} catch (error) {
|
|
156091
|
+
e.preventDefault();
|
|
156092
|
+
GctMessage.error(error instanceof Error ? error.message : String(error));
|
|
156093
|
+
}
|
|
155666
156094
|
};
|
|
155667
156095
|
return (_ctx, _cache) => {
|
|
155668
156096
|
return openBlock(), createElementBlock("div", _hoisted_1$117, [(openBlock(true), createElementBlock(Fragment, null, renderList(palletteFieldsList.value, (fields, colIndex) => {
|
|
@@ -155684,7 +156112,7 @@ var toolkit_content_fields_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
155684
156112
|
//#endregion
|
|
155685
156113
|
//#region src/runtime/designer/toolkit/renderer/toolkit-content-fields.vue
|
|
155686
156114
|
init__plugin_vue_export_helper();
|
|
155687
|
-
var toolkit_content_fields_default = /*#__PURE__*/ _plugin_vue_export_helper_default(toolkit_content_fields_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
156115
|
+
var toolkit_content_fields_default = /*#__PURE__*/ _plugin_vue_export_helper_default(toolkit_content_fields_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a0642e8f"]]);
|
|
155688
156116
|
//#endregion
|
|
155689
156117
|
//#region src/runtime/designer/toolkit/renderer/toolkit-content-widgets.vue?vue&type=script&setup=true&lang.ts
|
|
155690
156118
|
init_base$2();
|
|
@@ -155772,24 +156200,29 @@ var toolkit_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
|
|
|
155772
156200
|
const activePanelToolkit = computed(() => {
|
|
155773
156201
|
var _interCtx$panelData;
|
|
155774
156202
|
const panelType = (_interCtx$panelData = interCtx.panelData) === null || _interCtx$panelData === void 0 ? void 0 : _interCtx$panelData.panelType;
|
|
155775
|
-
|
|
156203
|
+
const toolkit = panelType ? PANEL_TYPE_TO_TOOLKIT[panelType] : null;
|
|
156204
|
+
return toolkit === activeToolkit.value ? toolkit : null;
|
|
155776
156205
|
});
|
|
155777
156206
|
const handleVisibleChange = (type, isVisible) => {
|
|
155778
|
-
if (PANEL_TRIGGER_TYPES.includes(type) && isVisible) {
|
|
155779
|
-
docInst.value.eventManager.dispatchCustom("inter:active", { type: `panel:${type}` });
|
|
155780
|
-
return;
|
|
155781
|
-
}
|
|
155782
156207
|
if (isVisible) {
|
|
156208
|
+
var _interCtx$panelData2;
|
|
155783
156209
|
activeToolkit.value = type;
|
|
155784
156210
|
closeOtherToolkit(type);
|
|
156211
|
+
if (PANEL_TRIGGER_TYPES.includes(type) && ((_interCtx$panelData2 = interCtx.panelData) === null || _interCtx$panelData2 === void 0 ? void 0 : _interCtx$panelData2.panelType) !== `panel:${type}`) docInst.value.eventManager.dispatchCustom("inter:active", { type: `panel:${type}` });
|
|
155785
156212
|
} else if (activeToolkit.value === type) activeToolkit.value = null;
|
|
155786
156213
|
};
|
|
155787
156214
|
const handleToolkitClose = (type) => {
|
|
155788
156215
|
if (activeToolkit.value === type) activeToolkit.value = null;
|
|
155789
156216
|
};
|
|
155790
156217
|
const closeOtherToolkit = (currentType) => {
|
|
155791
|
-
if (currentType
|
|
155792
|
-
|
|
156218
|
+
if (currentType !== "widget") {
|
|
156219
|
+
var _widgetToolkitRef$val;
|
|
156220
|
+
(_widgetToolkitRef$val = widgetToolkitRef.value) === null || _widgetToolkitRef$val === void 0 || _widgetToolkitRef$val.close();
|
|
156221
|
+
}
|
|
156222
|
+
if (currentType !== "field") {
|
|
156223
|
+
var _fieldToolkitRef$valu;
|
|
156224
|
+
(_fieldToolkitRef$valu = fieldToolkitRef.value) === null || _fieldToolkitRef$valu === void 0 || _fieldToolkitRef$valu.close();
|
|
156225
|
+
}
|
|
155793
156226
|
};
|
|
155794
156227
|
return (_ctx, _cache) => {
|
|
155795
156228
|
return openBlock(), createElementBlock("div", _hoisted_1$115, [
|
|
@@ -155854,7 +156287,7 @@ var toolkit_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
|
|
|
155854
156287
|
//#endregion
|
|
155855
156288
|
//#region src/runtime/designer/toolkit/toolkit.vue
|
|
155856
156289
|
init__plugin_vue_export_helper();
|
|
155857
|
-
var toolkit_default = /*#__PURE__*/ _plugin_vue_export_helper_default(toolkit_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
156290
|
+
var toolkit_default = /*#__PURE__*/ _plugin_vue_export_helper_default(toolkit_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-6e9afe76"]]);
|
|
155858
156291
|
//#endregion
|
|
155859
156292
|
//#region src/runtime/designer/panel/panel-nav.ts
|
|
155860
156293
|
/** 面包屑点击后保持当前 panel,不做跳转 */
|
|
@@ -166163,6 +166596,10 @@ var parse_rule_add_btn_vue_vue_type_script_setup_true_name_parse_rule_add_btn_la
|
|
|
166163
166596
|
const designCtx = useDesignSuiteContext();
|
|
166164
166597
|
const props = __props;
|
|
166165
166598
|
const emit = __emit;
|
|
166599
|
+
const hasParseRules = computed(() => {
|
|
166600
|
+
var _props$modelValue, _props$modelValue2;
|
|
166601
|
+
return !!(((_props$modelValue = props.modelValue) === null || _props$modelValue === void 0 ? void 0 : _props$modelValue.parsingRuleId) || ((_props$modelValue2 = props.modelValue) === null || _props$modelValue2 === void 0 || (_props$modelValue2 = _props$modelValue2.fillMapArr) === null || _props$modelValue2 === void 0 ? void 0 : _props$modelValue2.length));
|
|
166602
|
+
});
|
|
166166
166603
|
const handleClick = async () => {
|
|
166167
166604
|
const subFieldOptions = designCtx.runtime.getFieldList(props.subModelKey).map(({ key, name }) => ({
|
|
166168
166605
|
label: name,
|
|
@@ -166179,21 +166616,21 @@ var parse_rule_add_btn_vue_vue_type_script_setup_true_name_parse_rule_add_btn_la
|
|
|
166179
166616
|
return (_ctx, _cache) => {
|
|
166180
166617
|
return openBlock(), createBlock(unref(button_default), {
|
|
166181
166618
|
full: "",
|
|
166182
|
-
plain:
|
|
166619
|
+
plain: !hasParseRules.value,
|
|
166183
166620
|
type: "primary",
|
|
166184
166621
|
class: "add-button",
|
|
166185
166622
|
onClick: handleClick
|
|
166186
166623
|
}, {
|
|
166187
|
-
default: withCtx(() => [
|
|
166624
|
+
default: withCtx(() => [createTextVNode(toDisplayString(hasParseRules.value ? "编辑条码解析" : "添加条码解析"), 1)]),
|
|
166188
166625
|
_: 1
|
|
166189
|
-
});
|
|
166626
|
+
}, 8, ["plain"]);
|
|
166190
166627
|
};
|
|
166191
166628
|
}
|
|
166192
166629
|
});
|
|
166193
166630
|
//#endregion
|
|
166194
166631
|
//#region src/suites/edhr/panel-schema/material-consume-table/parse-rule-add-btn.vue
|
|
166195
166632
|
init__plugin_vue_export_helper();
|
|
166196
|
-
var parse_rule_add_btn_default = /*#__PURE__*/ _plugin_vue_export_helper_default(parse_rule_add_btn_vue_vue_type_script_setup_true_name_parse_rule_add_btn_lang_default, [["__scopeId", "data-v-
|
|
166633
|
+
var parse_rule_add_btn_default = /*#__PURE__*/ _plugin_vue_export_helper_default(parse_rule_add_btn_vue_vue_type_script_setup_true_name_parse_rule_add_btn_lang_default, [["__scopeId", "data-v-a13b10b0"]]);
|
|
166197
166634
|
//#endregion
|
|
166198
166635
|
//#region src/suites/edhr/panel-schema/material-consume-table/parse-rule-editor.vue
|
|
166199
166636
|
var parse_rule_editor_default = /* @__PURE__ */ defineComponent({
|
|
@@ -169172,6 +169609,7 @@ var object_init_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
169172
169609
|
};
|
|
169173
169610
|
};
|
|
169174
169611
|
const handleAddClick = () => {
|
|
169612
|
+
var _window$NocodeAdapter;
|
|
169175
169613
|
if (!RenderFieldWrapper) {
|
|
169176
169614
|
console.error("未找到字段渲染组件");
|
|
169177
169615
|
return;
|
|
@@ -169182,14 +169620,15 @@ var object_init_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
169182
169620
|
objectFields: objectFields.filter((f) => !filledObjectFieldKeys.value.includes(f.key)),
|
|
169183
169621
|
RenderFieldWrapper,
|
|
169184
169622
|
showMaterialStrategy: canUseMaxEditionTables.value,
|
|
169185
|
-
showConsumePolicy: shouldShowConsumePolicy()
|
|
169623
|
+
showConsumePolicy: shouldShowConsumePolicy(),
|
|
169624
|
+
openFormulaEditor: (_window$NocodeAdapter = window.NocodeAdapter) === null || _window$NocodeAdapter === void 0 || (_window$NocodeAdapter = _window$NocodeAdapter.utils) === null || _window$NocodeAdapter === void 0 ? void 0 : _window$NocodeAdapter.openFormulaEditor
|
|
169186
169625
|
}, { title: "配置" }).then(({ success, result }) => {
|
|
169187
169626
|
if (!success || !result) return;
|
|
169188
169627
|
emit("update:objects", [...props.objects, normalizeObjectConfig(result)]);
|
|
169189
169628
|
});
|
|
169190
169629
|
};
|
|
169191
169630
|
const handleEditClick = (index, obj) => {
|
|
169192
|
-
var _window$
|
|
169631
|
+
var _window$NocodeAdapter2;
|
|
169193
169632
|
if (!RenderFieldWrapper) {
|
|
169194
169633
|
console.error("未找到字段渲染组件");
|
|
169195
169634
|
return;
|
|
@@ -169200,7 +169639,7 @@ var object_init_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
169200
169639
|
RenderFieldWrapper,
|
|
169201
169640
|
showMaterialStrategy: canUseMaxEditionTables.value,
|
|
169202
169641
|
showConsumePolicy: shouldShowConsumePolicy(obj),
|
|
169203
|
-
openFormulaEditor: (_window$
|
|
169642
|
+
openFormulaEditor: (_window$NocodeAdapter2 = window.NocodeAdapter) === null || _window$NocodeAdapter2 === void 0 || (_window$NocodeAdapter2 = _window$NocodeAdapter2.utils) === null || _window$NocodeAdapter2 === void 0 ? void 0 : _window$NocodeAdapter2.openFormulaEditor
|
|
169204
169643
|
}, { title: "配置" }).then(({ success, result }) => {
|
|
169205
169644
|
if (!success || !result) return;
|
|
169206
169645
|
const objects = [...props.objects];
|
|
@@ -169247,7 +169686,7 @@ var object_init_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
169247
169686
|
//#endregion
|
|
169248
169687
|
//#region src/suites/edhr/panel-schema/data-init/object-init/object-init.vue
|
|
169249
169688
|
init__plugin_vue_export_helper();
|
|
169250
|
-
var object_init_default = /*#__PURE__*/ _plugin_vue_export_helper_default(object_init_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
169689
|
+
var object_init_default = /*#__PURE__*/ _plugin_vue_export_helper_default(object_init_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a6d047cf"]]);
|
|
169251
169690
|
//#endregion
|
|
169252
169691
|
//#region src/suites/edhr/panel-schema/data-init/DataInitPanel.vue?vue&type=script&setup=true&name=panel-data-init&lang.ts
|
|
169253
169692
|
init_core$1();
|
|
@@ -172470,7 +172909,8 @@ var input_prop_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
172470
172909
|
required: { type: Boolean },
|
|
172471
172910
|
disabled: { type: Boolean },
|
|
172472
172911
|
fieldDisabled: { type: Boolean },
|
|
172473
|
-
fieldInfo: {}
|
|
172912
|
+
fieldInfo: {},
|
|
172913
|
+
modelRequiredOverride: { type: Boolean }
|
|
172474
172914
|
},
|
|
172475
172915
|
emits: ["update:required", "update:disabled"],
|
|
172476
172916
|
setup(__props, { emit: __emit }) {
|
|
@@ -172479,7 +172919,7 @@ var input_prop_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
172479
172919
|
/** 模型元数据强制必填 */
|
|
172480
172920
|
const fieldRequired = computed(() => {
|
|
172481
172921
|
var _props$fieldInfo;
|
|
172482
|
-
return Boolean((_props$fieldInfo = props.fieldInfo) === null || _props$fieldInfo === void 0 ? void 0 : _props$fieldInfo.required);
|
|
172922
|
+
return props.modelRequiredOverride ?? Boolean((_props$fieldInfo = props.fieldInfo) === null || _props$fieldInfo === void 0 ? void 0 : _props$fieldInfo.required);
|
|
172483
172923
|
});
|
|
172484
172924
|
/**
|
|
172485
172925
|
* 必填勾选锁定:模型强制必填,或业务表固定禁用(fieldDisabled)时都不允许切换
|
|
@@ -172533,7 +172973,7 @@ var input_prop_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
172533
172973
|
//#endregion
|
|
172534
172974
|
//#region src/suites/shared/panel/config/editor/input-prop-editor.vue
|
|
172535
172975
|
init__plugin_vue_export_helper();
|
|
172536
|
-
var input_prop_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(input_prop_editor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
172976
|
+
var input_prop_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(input_prop_editor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-aefdaa0c"]]);
|
|
172537
172977
|
//#endregion
|
|
172538
172978
|
//#region src/suites/shared/panel/config/editor/keep-exception-highlight-editor.vue?vue&type=script&setup=true&name=keep-exception-highlight-editor&lang.ts
|
|
172539
172979
|
init_base$2();
|
|
@@ -177891,12 +178331,14 @@ var field_text_config_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
177891
178331
|
required: formState.value.required,
|
|
177892
178332
|
"onUpdate:required": _cache[2] || (_cache[2] = ($event) => formState.value.required = $event),
|
|
177893
178333
|
fieldDisabled: formState.value.fieldDisabled,
|
|
177894
|
-
fieldInfo: __props.fieldInfo
|
|
178334
|
+
fieldInfo: __props.fieldInfo,
|
|
178335
|
+
modelRequiredOverride: formState.value.modelRequiredOverride
|
|
177895
178336
|
}, null, 8, [
|
|
177896
178337
|
"disabled",
|
|
177897
178338
|
"required",
|
|
177898
178339
|
"fieldDisabled",
|
|
177899
|
-
"fieldInfo"
|
|
178340
|
+
"fieldInfo",
|
|
178341
|
+
"modelRequiredOverride"
|
|
177900
178342
|
]),
|
|
177901
178343
|
createVNode(FormSegmentEditor_default, {
|
|
177902
178344
|
label: "查看时渲染方式",
|
|
@@ -177951,7 +178393,7 @@ var field_text_config_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
177951
178393
|
//#region src/suites/edhr/panel-config/field/text/field-text-config.vue
|
|
177952
178394
|
var field_text_config_exports = /* @__PURE__ */ __exportAll({ default: () => field_text_config_default });
|
|
177953
178395
|
init__plugin_vue_export_helper();
|
|
177954
|
-
var field_text_config_default = /*#__PURE__*/ _plugin_vue_export_helper_default(field_text_config_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
178396
|
+
var field_text_config_default = /*#__PURE__*/ _plugin_vue_export_helper_default(field_text_config_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-aff862f4"]]);
|
|
177955
178397
|
//#endregion
|
|
177956
178398
|
//#region src/suites/shared/panel/config/editor/assoc-filter-editor/utils.ts
|
|
177957
178399
|
init_field_type();
|