|
@@ -12,7 +12,7 @@ import { ElButton, ElMessage, ElPopconfirm, ElMessageBox, ElNotification, ElTag
|
|
|
import { Minus, Plus, InfoFilled } from "@element-plus/icons-vue";
|
|
|
import { DwnameEnum } from "@/enums/dwnameEnum";
|
|
|
import { isArray } from "@/utils/is";
|
|
|
-import { calculateFormula, formulaPartsFormula, floatAdd, floatMul, formatFixedNumber } from "@/utils/index";
|
|
|
+import { calculateFormula, formulaPartsFormula, floatAdd, floatMul, formatFixedNumber, autoMergeCells } from "@/utils/index";
|
|
|
import { cloneDeep, defaultsDeep } from "lodash-es";
|
|
|
import { TYPE, useToast, POSITION } from "vue-toastification";
|
|
|
import ToastFormula from "@/components/ToastWidget/Formula/index.vue";
|
|
@@ -4336,6 +4336,26 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
];
|
|
|
const columnsMxInnerClothLayer: ColumnProps<any>[] = [
|
|
|
+ {
|
|
|
+ title: "计算成功?",
|
|
|
+ field: "if_success",
|
|
|
+ datatype: "checkbox",
|
|
|
+ limited: () => {
|
|
|
+ const { userInfo } = useUserStore();
|
|
|
+ return userInfo.usermode != 0;
|
|
|
+ },
|
|
|
+ render: (scope: any) => {
|
|
|
+ if (Number(scope.row.if_success)) {
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <ElTag type="danger">异常</ElTag>
|
|
|
+ </>
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return <></>;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
title: "位置",
|
|
|
field: "chastr"
|
|
@@ -4523,6 +4543,18 @@ export const useHooks = (t?: any) => {
|
|
|
};
|
|
|
let res = await CommonDynamicSelect(_params);
|
|
|
|
|
|
+ let idxStr = "";
|
|
|
+ const $table = state.innerClothLayerMxRef.element;
|
|
|
+ if ($table) {
|
|
|
+ const { visibleData } = $table.getTableData();
|
|
|
+ if (visibleData.length) {
|
|
|
+ let lastMx = visibleData[visibleData.length - 1];
|
|
|
+ idxStr = Number(lastMx.chastr.match(/\d+$/)?.[0] ?? 0) + 1 + "";
|
|
|
+ } else {
|
|
|
+ idxStr = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (res?.datatable?.length) {
|
|
|
const $table = state.innerClothLayerMxRef.element;
|
|
|
|
|
@@ -4540,7 +4572,7 @@ export const useHooks = (t?: any) => {
|
|
|
_data.sortcode = item.sortcode;
|
|
|
_data.formulakind = item.formulakind;
|
|
|
_data.formula = item.formula;
|
|
|
- _data.chastr = "内布套";
|
|
|
+ _data.chastr = "内布套" + idxStr;
|
|
|
_data.useformula = item.useformula;
|
|
|
_data.gydscrp = item.gydscrp;
|
|
|
_data.pid = index + 1;
|
|
@@ -4554,8 +4586,22 @@ export const useHooks = (t?: any) => {
|
|
|
// };
|
|
|
|
|
|
// $table.insertAt(tree, -1);
|
|
|
- $table.insertAt(_rows, -1);
|
|
|
+ await $table.insertAt(_rows, -1);
|
|
|
+
|
|
|
+ ElMessage.success("导入成功");
|
|
|
}
|
|
|
+ resetMergeCellsInner();
|
|
|
+ };
|
|
|
+
|
|
|
+ const resetMergeCellsInner = () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ const $table = state.innerClothLayerMxRef.element;
|
|
|
+ if ($table) {
|
|
|
+ let mergeCells = autoMergeCells($table, ["chastr"]);
|
|
|
+ console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
|
|
|
+ $table.setMergeCells(mergeCells);
|
|
|
+ }
|
|
|
+ }, 200);
|
|
|
};
|
|
|
|
|
|
const hanleDelMxInner = (type: number) => {
|
|
@@ -4656,6 +4702,18 @@ export const useHooks = (t?: any) => {
|
|
|
$table.insertAt(_rows, -1);
|
|
|
}
|
|
|
}
|
|
|
+ resetMergeCellsTopCotton();
|
|
|
+ };
|
|
|
+
|
|
|
+ const resetMergeCellsTopCotton = () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ const $table = state.topCottonMxRef.element;
|
|
|
+ if ($table) {
|
|
|
+ let mergeCells = autoMergeCells($table, ["chastr"]);
|
|
|
+ console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
|
|
|
+ $table.setMergeCells(mergeCells);
|
|
|
+ }
|
|
|
+ }, 1);
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -4719,6 +4777,8 @@ export const useHooks = (t?: any) => {
|
|
|
wf_del_w_butao,
|
|
|
w_mattress_add_itemname_choose,
|
|
|
wf_rtr_bednet,
|
|
|
- funcAddMtrlMx
|
|
|
+ funcAddMtrlMx,
|
|
|
+ resetMergeCellsInner,
|
|
|
+ resetMergeCellsTopCotton
|
|
|
};
|
|
|
};
|