Переглянути джерело

1、新增床垫报价列表显示报价清单功能

MY 1 день тому
батько
коміт
85dbccbb2c

+ 38 - 0
JLHHJSvr/Com/GetComputeMattressById.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using JLHHJSvr.Com.Model;
+using LJLib.Net.SPI.Com;
+
+namespace JLHHJSvr.Com
+{
+    public sealed class GetComputeMattressByIdRequest : ILJRequest<GetComputeMattressByIdResponse>
+    {
+        public override string GetApiName()
+        {
+            return "GetComputeMattressById";
+        }
+        public string token { get; set; }
+        /// <summary>
+        /// 床垫信息:主表
+        /// </summary>
+        public int? mattressid { get; set; }
+        /// <summary>
+        /// 是否查看原公式计算
+        /// </summary>
+        public byte check_original { get; set; }
+    }
+
+    public sealed class GetComputeMattressByIdResponse : LJResponse
+    {
+        public u_mattress mattress { get; set; }
+        public List<u_mattress_mx_mtrl> mattressMx { get; set; }
+        public List<replacement> replace { get; set; }
+        public List<replacement> formulas { get; set; }
+        public List<replacement> formulas_origin { get; set; }
+        public List<u_mattress_computed> differ { get; set; }
+        public List<replacement> formulas_bednet { get; set; }
+        public string message { get; set; }
+    }
+}

+ 91 - 0
JLHHJSvr/Excutor/GetComputeMattressByIdExcutor.cs

@@ -0,0 +1,91 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms.VisualStyles;
+using DirectService.Tools;
+using JLHHJSvr.BLL;
+using JLHHJSvr.Com;
+using JLHHJSvr.Com.Model;
+using JLHHJSvr.Helper;
+using JLHHJSvr.LJException;
+using JLHHJSvr.Tools;
+using LJLib.DAL.SQL;
+using LJLib.Net.SPI.Server;
+using Newtonsoft.Json;
+using static JLHHJSvr.Helper.MattressHelper;
+
+namespace JLHHJSvr.Excutor
+{
+    internal sealed class GetComputeMattressByIdExcutor : ExcutorBase<GetComputeMattressByIdRequest, GetComputeMattressByIdResponse>
+    {
+        protected override void ExcuteInternal(GetComputeMattressByIdRequest request, object state, GetComputeMattressByIdResponse rslt)
+        {
+            var tokendata = BllHelper.GetToken(request.token);
+            if (tokendata == null)
+            {
+                rslt.ErrMsg = "会话已经中断,请重新登录";
+                return;
+            }
+            if (request.mattressid == null || request.mattressid <= 0)
+            {
+                rslt.ErrMsg = "缺少床垫id信息";
+                return;
+            }
+
+            using (var con = new SqlConnection(GlobalVar.ConnectionString))
+            using (var cmd = con.CreateCommand())
+            {
+                con.Open();
+
+                var mattressHelper = HelperBase.GetHelper<MattressHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
+                var mattress = mattressHelper.GetMattress(request.mattressid.Value);
+                var mxList = mattressHelper.GetMattressMxMtrl(request.mattressid.Value);
+
+                
+                if (mattress.dannum_type.Value == 0)
+                {
+                    mattress.dannum_type = 2; // 默认标准
+                }
+
+                var differArr = new List<u_mattress_computed>();
+                foreach (DannumType value in Enum.GetValues(typeof(MattressHelper.DannumType)))
+                {
+                    int dannum_type = (int)value;
+                    var differItem = new u_mattress_computed() { type = dannum_type };
+                    var _mattress = ObjectHelper.DeepCopy(mattress);
+                    if (mattress.dannum_type.Value == dannum_type)
+                    {
+                        mattressHelper.CalCulateFormula(_mattress, mxList, false);
+                        rslt.replace = ObjectHelper.DeepCopy(mattressHelper.Replacements);
+                        rslt.formulas = ObjectHelper.DeepCopy(mattressHelper.FormulaReplacements);
+                        rslt.formulas_bednet = ObjectHelper.DeepCopy(mattressHelper.BendetFormulasReplace);
+                    }
+                    else
+                    {
+                        _mattress.dannum_type = dannum_type;
+                        mattressHelper.CalCulateFormula(_mattress, mxList, false);
+                    }
+
+                    differItem.replace = mattressHelper.Replacements;
+                    differItem.replace_bednet = mattressHelper.BendetReplace;
+
+                    if (request.check_original == 1)
+                    {
+                        _mattress.dannum_type = dannum_type;
+
+                        mattressHelper.CalCulateFormula(_mattress, mxList, false, false);
+                        differItem.replace_origin = ObjectHelper.DeepCopy(mattressHelper.Replacements);
+                        rslt.formulas_origin = ObjectHelper.DeepCopy(mattressHelper.FormulaReplacements);
+                    }
+                    differArr.Add(differItem);
+                }
+
+                rslt.differ = differArr;
+                rslt.mattress = mattress;
+                rslt.mattressMx = mattressHelper.SortMxList(mxList);
+            }
+        }
+    }
+}

+ 1 - 0
JLHHJSvr/GlobalVar/GlobalVar.cs

@@ -202,6 +202,7 @@ namespace JLHHJSvr
                 excutorManager.AddMap("AuditBedNet", typeof(AuditBedNetRequest), new AuditBedNetExcutor());// 审核床网报价
 
                 excutorManager.AddMap("GetComputeMattress", typeof(GetComputeMattressRequest), new GetComputeMattressExcutor());// 计算床垫报价
+                excutorManager.AddMap("GetComputeMattressById", typeof(GetComputeMattressByIdRequest), new GetComputeMattressByIdExcutor());// 计算床垫报价
                 excutorManager.AddMap("GetComputeBednet", typeof(GetComputeBednetRequest), new GetComputeBednetExcutor());// 计算床网报价
                 excutorManager.AddMap("GetComputeSpring", typeof(GetComputeSpringRequest), new GetComputeSpringExcutor());// 计算弹簧数量
                 excutorManager.AddMap("CopyMattressAudited", typeof(CopyMattressAuditedRequest), new CopyMattressAuditedExcutor());// 复制审核床垫报价

+ 37 - 0
JLHHJSvr/Helper/MattressHelper.cs

@@ -2996,6 +2996,16 @@ namespace JLHHJSvr.Helper
                 return a.formulaid.Value.CompareTo(b.formulaid.Value);
             });
         }
+
+        public List<u_mattress_mx_mtrl> SortMxList(List<u_mattress_mx_mtrl> mxlist)
+        {
+            return mxlist.OrderBy(x => x.formulatype)
+                      .ThenBy(x => x.xu)
+                      .ThenBy(x => x.sortcode)
+                      .ThenBy(x => GetFormulakindOrder(x.formulakind))
+                      .ThenBy(x => x.formulaid)
+                      .ToList();
+        }
         #endregion
 
         // 普通大侧特殊排序
@@ -3216,5 +3226,32 @@ namespace JLHHJSvr.Helper
 
         }
         #endregion
+
+        #region 大小单类型枚举
+
+
+        public enum DannumType
+        {
+            /// <summary>
+            /// 散单
+            /// </summary>
+            Scattered = 1,
+
+            /// <summary>
+            /// 标准
+            /// </summary>
+            Standard = 2,
+
+            /// <summary>
+            /// 大单
+            /// </summary>
+            Large = 3,
+
+            /// <summary>
+            /// 小单
+            /// </summary>
+            Small = 4
+        }
+        #endregion
     }
 }

+ 2 - 0
JLHHJSvr/JLHHJSvr.csproj

@@ -107,6 +107,7 @@
     <Compile Include="Com\DeleteMattressExtraType.cs" />
     <Compile Include="Com\DeleteMattressExtra.cs" />
     <Compile Include="Com\GetBedNetInterfaceList.cs" />
+    <Compile Include="Com\GetComputeMattressById.cs" />
     <Compile Include="Com\GetResetWiptype.cs" />
     <Compile Include="Com\GetMattressSubspecs.cs" />
     <Compile Include="Com\ImportMtrlPriceByExcel.cs" />
@@ -322,6 +323,7 @@
     <Compile Include="Excutor\DeleteMattressExtraExcutor.cs" />
     <Compile Include="Excutor\FormulaCheckExcutor.cs" />
     <Compile Include="Excutor\GetBedNetInterfaceListExcutor.cs" />
+    <Compile Include="Excutor\GetComputeMattressByIdExcutor.cs" />
     <Compile Include="Excutor\GetFormulaVarListExcutor.cs" />
     <Compile Include="Excutor\GetResetWiptypeExcutor.cs" />
     <Compile Include="Excutor\GetMattressSubspecsExcutor.cs" />

+ 14 - 0
JLHWEB/src/api/interface/index.ts

@@ -1374,4 +1374,18 @@ export namespace Mattress {
   export interface ResReCalculateERPCost {
     logMsg: string;
   }
+  export interface ReqGetComputeMattressById {
+    mattressid?: number;
+    check_original: number;
+  }
+  export interface ResGetComputeMattressById {
+    mattress: any;
+    mattressMx: any;
+    replace: any;
+    formulas: any;
+    message: string;
+    formulas_origin: any;
+    formulas_bednet: any;
+    differ?: any;
+  }
 }

+ 7 - 0
JLHWEB/src/api/modules/quote.ts

@@ -205,6 +205,13 @@ export const ReCalculateERPCost = (params: Mattress.ReqMultiMattressBcp) => {
   return http.post<Mattress.ResUpdateL1Basicinfo>(PORT1 + `/ReCalculateERPCost`, params);
 };
 
+/**
+ * @name 床垫报价:获取报价清单
+ */
+export const GetComputeMattressById = (params: Mattress.ReqGetComputeMattressById) => {
+  return http.post<Mattress.ResGetComputeMattressById>(PORT1 + `/GetComputeMattressById`, params);
+};
+
 /**
  * @name 床网清单:刷新配置
  */

+ 829 - 0
JLHWEB/src/views/erpapi/bednetInterface/detail.vue

@@ -0,0 +1,829 @@
+<template>
+  <LjDetail
+    name="bednetInterfaceDetail"
+    ref="LjDetailRef"
+    v-bind="detailProps"
+    :data="mainData"
+    v-model:order-status="orderStatus"
+    :action="orderDefaultAction"
+    @after-mounted="funcAfterMound"
+    :if-layout-editable="false"
+    :search-col="{ xs: 3, sm: 3, md: 3, lg: 3, xl: 3 }"
+    :basic-group-col="{ xs: 3, sm: 3, md: 3, lg: 3, xl: 3 }"
+  >
+    <template #bednetYW>
+      <LjVxeTable
+        ref="VxeTableMxRef"
+        row-key="key"
+        table-cls=""
+        :data="bednetYWList"
+        :columns="columns_yw"
+        :dwname="DwnameEnum.bednetInterfaceYw"
+        :request-auto="false"
+        :table-props="tableProps_mx"
+        :tool-button="[]"
+        :auto-load-layout="false"
+        collapseButtons
+        :cellClassName="cellClassNameFn"
+      >
+      </LjVxeTable>
+    </template>
+    <template #tabNavRight="scope" v-if="orderStatus">
+      <div class="flx-center flx-end flx-1" v-if="scope.active == 'bednetQD'">
+        <LjHeaderMenu group-cls="flx-end" :action="qdAction"></LjHeaderMenu>
+      </div>
+    </template>
+    <template #bednetQD>
+      <LjFoldLayout ref="LjFoldLayoutRef" v-bind="layoutSetting">
+        <template #left>
+          <LjVxeTable
+            ref="YwTableRef"
+            row-key="key"
+            table-cls="h-full"
+            :data="bednetYWList"
+            :columns="columns_yw_qd"
+            :dwname="DwnameEnum.bednetInterfaceYw"
+            :request-auto="false"
+            :table-props="tableProps_mx"
+            :tool-button="[]"
+            :auto-load-layout="false"
+            collapseButtons
+          >
+          </LjVxeTable>
+        </template>
+        <div class="main-box flx-col">
+          <LjVxeTable
+            ref="QdTableRef"
+            row-key="key"
+            table-cls="h-full"
+            :data="bednetQDList"
+            :columns="columns_qd"
+            :dwname="DwnameEnum.bednetInterfaceQd"
+            :request-auto="false"
+            :table-props="tableProps_qd"
+            :tool-button="['setting']"
+            collapseButtons
+            @setMergeCells="resetMergeCellsQd"
+            @row-dragend="autoRowDragend"
+          >
+          </LjVxeTable>
+        </div>
+      </LjFoldLayout>
+    </template>
+  </LjDetail>
+
+  <LjDialog ref="LjDialogQdRowAdd" class="is-selector" :style="{ padding: 0 }" width="480px">
+    <template #header>
+      <div class="flx-1">
+        <span class="text-h5-b">产品清单新增</span>
+      </div>
+    </template>
+  </LjDialog>
+  <MattressDialog ref="MattressDialogRef" v-bind="MattressDialogProps" />
+  <MtrldefErpDialog ref="MtrldefErpDialogRef" v-bind="MtrldefErpDialogProps" />
+</template>
+
+<script setup lang="tsx" name="bednetInterfaceDetail">
+import { ref, watch, reactive, inject, onMounted, computed, nextTick, onBeforeMount } from "vue";
+import { DwnameEnum } from "@/enums/dwnameEnum";
+import LjDetail from "@/components/LjDetail/index.vue";
+import { DetailProp } from "@/components/LjDetail/interface";
+import { useI18n } from "vue-i18n";
+import { useRoute, useRouter } from "vue-router";
+import { useHooks } from "./hooks/index";
+import { useAuthButtons } from "@/hooks/useAuthButtons";
+import { CommonDynamicSelect, GetERPWrkGrpList, GetERPWrkGrpList2 } from "@/api/modules/common";
+import { SaveMattressInterface, GetResetWiptype, UpdateL1Basicinfo } from "@/api/modules/quote";
+import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
+import mittBus from "@/utils/mittBus";
+import { MittEnum } from "@/enums/mittEnum";
+import MattressDialog from "@/views/system/selector/mattress/index.vue";
+import MtrldefErpDialog from "@/views/system/selector/mtrldefErp/index.vue";
+import { formatToDate } from "@/utils/dateUtil";
+import LjFoldLayout from "@/components/LjFoldLayout/index.vue";
+import { detailAction } from "@/components/LjDetail/interface";
+import { transformTreeData, autoMergeCells, isFilterPrice } from "@/utils/index";
+import LjDialog from "@/components/LjDialog/index.vue";
+
+interface detailProp {
+  /**
+   * @argument any 页面数据
+   */
+  data?: any;
+  /**
+   * @argument string 请求数据的api ==> 非必传
+   */
+  requestApi?: (params: any) => Promise<any>;
+  /**
+   * @argument any 基础信息,表格展示数据
+   */
+  // columns?: any;
+  /**
+   * @description 是否可编辑
+   */
+  status: "edit" | "new" | string;
+  enum?: any;
+}
+
+const props = withDefaults(defineProps<detailProp>(), {});
+const { t } = useI18n();
+const route = useRoute();
+const router = useRouter();
+const {
+  VxeTableMxRef,
+  YwTableRef,
+  QdTableRef,
+  orderStatus,
+  LjDetailRef,
+  columns_detail,
+  columns_yw,
+  columns_yw_qd,
+  columns_qd,
+  mainData,
+  editType,
+  bednetYWList,
+  bednetQDList,
+  MattressDialogRef,
+  MattressDialogProps,
+  MtrldefErpDialogRef,
+  MtrldefErpDialogProps,
+  tableProps_mx,
+  tableProps_qd,
+  workgrpEnum,
+  workgrpEnum2,
+  configureTypeEnum,
+  RetriveMattressInterface,
+  RefreshBedNetInterfaceList,
+  RefreshBedNetInterfaceQdList,
+  fModelChoseMattress,
+  toExcel,
+  toCreateMtrl,
+  toCreateORDelMtrlPf,
+  JS2Audit,
+  resetMergeCellsQd
+} = useHooks(t);
+const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
+
+const initParams = ref({ bednetid: 0 as Number });
+
+const layoutSetting = reactive({});
+
+const detailProps = reactive<DetailProp>({
+  dwname: DwnameEnum.bednetInterfaceDetail,
+  columns: columns_detail,
+  basicDefault: {},
+  header: {
+    foldright: {
+      width: 80
+    },
+    fieldNames: {
+      code: "sptcode",
+      codeLabel: t("table.u_spt.sptcode") + ":",
+      name: "name"
+    }
+  },
+  mould: [
+    {
+      id: "bednetYW",
+      type: "table",
+      label: "产品配置"
+    },
+    {
+      id: "bednetQD",
+      type: "table",
+      label: "产品清单"
+    }
+  ]
+});
+
+const loadingStatus = reactive({
+  save: false,
+  synchsL1: false
+});
+
+const cellClassNameFn = (data: any, editable) => {
+  let { column, row } = data;
+  if (editable) {
+    if (column.field == "bj_pzname") {
+      if (
+        ["垫层", "辅料"].includes(row.itemname) ||
+        [
+          "边带",
+          "面层裥棉图案",
+          "底层裥棉图案",
+          "大侧裥棉图案",
+          "小侧1裥棉图案",
+          "小侧2裥棉图案",
+          "小侧3裥棉图案",
+          "拉手刺绣及其他工艺项目所有"
+        ].includes(row.bj_pzname)
+      ) {
+        return "vxecol-danger";
+      }
+    }
+  }
+  return null;
+};
+
+const moveData = async (index: number, nextIndex: number) => {
+  const $table = QdTableRef.value.element;
+  let { visibleData } = $table.getTableData();
+  const curRecords = $table?.getCurrentRecord();
+
+  let prevRow = visibleData[nextIndex];
+  visibleData[nextIndex] = visibleData[index];
+  visibleData[index] = prevRow;
+
+  visibleData.map((o, idx) => {
+    o.printid = idx + 1;
+    return o;
+  });
+
+  $table.reloadData(visibleData);
+  await $table.setCurrentRow(curRecords);
+  resetMergeCellsQd(() => {
+    setTimeout(() => {
+      $table.scrollToRow(curRecords);
+    }, 0);
+  });
+};
+
+const toMove = async (action: number) => {
+  const $table = QdTableRef.value.element;
+  let curRecords = $table?.getCurrentRecord();
+
+  let visibleData = $table.getTableData().visibleData;
+
+  if (!curRecords) {
+    ElMessage.warning("请先选择要移动的行");
+    return;
+  }
+
+  let curIdx = visibleData.findIndex(t => t === curRecords);
+  console.log("curIdx :>> ", curIdx);
+
+  if (action == 1) {
+    // 上移
+    if (curIdx == 0) {
+      ElMessage.warning("已经是第一条了");
+      return;
+    }
+    moveData(curIdx, curIdx - 1);
+  } else if (action == -1) {
+    // 下移
+    if (curIdx == visibleData.length - 1) {
+      ElMessage.warning("已经是最后一条了");
+      return;
+    }
+
+    moveData(curIdx, curIdx + 1);
+  }
+};
+
+const qdAction: detailAction[] = [
+  buttonDefault({
+    label: "增行",
+    clickFunc: () => {
+      interIndex.value = -1;
+      LjDialogQdRowAdd.value.show();
+    }
+  }),
+  buttonDefault({
+    label: "插行",
+    divider: true,
+    clickFunc: () => {
+      const $table = QdTableRef.value.element;
+      const curRecords = $table?.getCurrentRecord();
+      if (curRecords) {
+        interIndex.value = $table.getRowIndex(curRecords);
+      }
+      LjDialogQdRowAdd.value.show();
+    }
+  }),
+  buttonDefault({
+    label: "上移",
+    clickFunc: () => toMove(1)
+  }),
+  buttonDefault({
+    label: "下移",
+    clickFunc: () => toMove(-1),
+    divider: true
+  }),
+  buttonDefault({
+    label: "批量设置",
+    clickFunc: async () => {
+      let _cur = QdTableRef.value.currentEditCell;
+
+      if (!["wrkgrpid", "wrkgrpid2", "actual_useqty"].includes(_cur.field)) {
+        return ElMessage.warning("此列暂不支持批量设置(仅支持实际用量、工组)");
+      }
+      const $table = QdTableRef.value.element;
+
+      const { visibleData } = $table.getTableData();
+      let _data = [];
+
+      if (visibleData) {
+        let _val = visibleData[_cur.rowIndex];
+        _data = visibleData.map((o, idx) => {
+          if (o.actual_useqty > 0 && idx > _cur.rowIndex) {
+            o[_cur.field] = _val[_cur.field];
+            if (_cur.field == "wrkgrpid1") {
+              o.wrkgrpcode1 = _val.wrkgrpcode1;
+            } else if (_cur.field == "wrkgrpid2") {
+              o.wrkgrpcode2 = _val.wrkgrpcode2;
+            }
+          }
+          if (_cur.field == "actual_useqty") {
+            if (o.useqty > 0 && idx > _cur.rowIndex) {
+              o[_cur.field] = _val[_cur.field];
+            }
+          }
+          return o;
+        });
+
+        await $table.reloadData(_data);
+        resetMergeCellsQd();
+
+        ElMessage.success("批设成功(有实际用量的数据行)");
+      }
+    }
+  })
+];
+
+const orderDefaultAction = [
+  buttonDefault({
+    label: t("common.cancelText"),
+    icon: "iconchevron-left",
+    limited: () => {
+      return !orderStatus.value;
+    },
+    clickFunc: item => {
+      const _cur = mainData.value[0];
+      router.push({
+        name: "bednetInterfaceDetail",
+        params: {
+          id: _cur.bednetid
+        },
+        query: {
+          code: _cur.bednetcode
+        },
+        replace: true
+      });
+    }
+  }),
+  buttonDefault({
+    label: t("common.saveText"),
+    loading: () => loadingStatus.save,
+    limited: () => !orderStatus.value,
+    clickFunc: async item => {
+      try {
+        await LjDetailRef.value.toValidateForm();
+
+        let $tableYW = VxeTableMxRef.value.element;
+        let { visibleData } = $tableYW.getTableData();
+        visibleData.map(o => {
+          console.log("tableYW visibleData o :>> ", o);
+          if (
+            ["垫层", "辅料"].includes(o.itemname) ||
+            [
+              "边带",
+              "面层裥棉图案",
+              "底层裥棉图案",
+              "大侧裥棉图案",
+              "小侧1裥棉图案",
+              "小侧2裥棉图案",
+              "小侧3裥棉图案",
+              "拉手刺绣及其他工艺项目所有"
+            ].includes(o.bj_pzname)
+          ) {
+            if (o.bj_namemx == "") {
+              VxeTableMxRef.value.scrollTo(o, "bj_namemx");
+              throw new Error("产品配置:【" + o.bj_pzname + "】的明细是必填项,请输入/选择");
+            }
+          }
+          return o;
+        });
+
+        ElMessageBox.confirm("是否确定要保存吗?", "询问", {
+          confirmButtonText: "是",
+          cancelButtonText: "否",
+          type: "warning"
+        }).then(async () => {
+          loadingStatus.save = true;
+          try {
+            const res = await SaveMattressInterface({
+              mattress: LjDetailRef.value?._mainData,
+              interfaceList: bednetYWList.value,
+              qdList: bednetQDList.value
+            })
+              .then(res => {
+                ElNotification({
+                  title: "温馨提示",
+                  message: t("sys.api.sueccessToSave"),
+                  type: "success"
+                });
+
+                const _cur = LjDetailRef.value?._mainData;
+                router.push({
+                  name: "bednetInterfaceDetail",
+                  params: {
+                    id: _cur.bednetid
+                  },
+                  query: {
+                    code: _cur.bednetcode
+                  },
+                  replace: true
+                });
+                // LjDetailRef.value.refresh();
+                loadingStatus.save = false;
+              })
+              .catch(error => {
+                console.log("error !! :>> ", error);
+                loadingStatus.save = false;
+              });
+          } catch (error) {
+            loadingStatus.save = false;
+            ElMessage.error(t("sys.api.operationFailed"));
+          }
+        });
+      } catch (error) {
+        console.log("errorerrorerrorerror :>> ", typeof error, error);
+        if (error.hasOwnProperty("message")) {
+          ElMessage.error(error.message);
+        } else {
+          for (const key in error) {
+            if (Object.prototype.hasOwnProperty.call(error, key)) {
+              const element = error[key];
+              ElMessage.error(element[0].message);
+            }
+          }
+        }
+
+        return false;
+      }
+    }
+  }),
+  [
+    buttonDefault({
+      label: "刷新带出配置",
+      limited: () => {
+        return !orderStatus.value || editType.value == 3;
+      },
+      clickFunc: item => {
+        RefreshBedNetInterfaceList(LjDetailRef.value?._mainData.bednetid, 1, LjDetailRef.value?._mainData.erp_configcodetype);
+      }
+    }),
+    buttonDefault({
+      label: "复制配置",
+      limited: () => {
+        return !orderStatus.value || editType.value == 3;
+      },
+      clickFunc: item => {
+        fModelChoseMattress().then((res: any) => {
+          RefreshBedNetInterfaceList(res.bednetid, 1);
+        });
+      }
+    }),
+    buttonDefault({
+      label: "重新生成配置项目",
+      limited: () => {
+        return !orderStatus.value || editType.value != 1;
+      },
+      disabledTextCallBack: (data: any) => {
+        if (data.yw_flag == 1) {
+          return "已业务补充审核,无法操作";
+        }
+        return "";
+      },
+      clickFunc: item => {
+        RefreshBedNetInterfaceList(LjDetailRef.value?._mainData.bednetid, 0, LjDetailRef.value?._mainData.erp_configcodetype);
+      }
+    })
+  ],
+  [
+    buttonDefault({
+      label: "刷新清单",
+      limited: () => {
+        return !orderStatus.value;
+      },
+      clickFunc: item => {
+        RefreshBedNetInterfaceQdList(LjDetailRef.value?._mainData.bednetid, 1);
+      }
+    }),
+    buttonDefault({
+      label: "复制清单",
+      limited: () => {
+        return !orderStatus.value;
+      },
+      clickFunc: item => {
+        fModelChoseMattress().then((res: any) => {
+          RefreshBedNetInterfaceQdList(res.bednetid, 1, 0);
+        });
+      }
+    }),
+    buttonDefault({
+      label: "重新生成清单",
+      limited: () => {
+        return !orderStatus.value;
+      },
+      clickFunc: item => {
+        RefreshBedNetInterfaceQdList(LjDetailRef.value?._mainData.bednetid, 0);
+      }
+    })
+  ],
+  [
+    buttonDefault({
+      label: "增行",
+      limited: () => {
+        return !orderStatus.value;
+      },
+      clickFunc: item => {}
+    }),
+    buttonDefault({
+      label: "插行",
+      limited: () => {
+        return !orderStatus.value;
+      },
+      clickFunc: item => {},
+      divider: true
+    }),
+    buttonDefault({
+      label: "上移",
+      limited: () => {
+        return !orderStatus.value;
+      },
+      clickFunc: item => {}
+    }),
+    buttonDefault({
+      label: "下移",
+      limited: () => {
+        return !orderStatus.value;
+      },
+      clickFunc: item => {},
+      divider: true
+    })
+  ],
+  buttonDefault({
+    label: "覆盖配置到副规格产品",
+    limited: () => {
+      return !orderStatus.value || LjDetailRef.value?._mainData.child_count == 0;
+    },
+    disabledTextCallBack: (data: any) => {
+      if (data.child_count == 0) {
+        return "没有副规格产品,无法操作";
+      }
+      return "";
+    },
+    clickFunc: item => {
+      alert("功能维护中!");
+    }
+  }),
+  buttonDefault({
+    label: "重置半成品归属列数据",
+    limited: () => {
+      return !orderStatus.value;
+    },
+    clickFunc: async () => {
+      const $table = QdTableRef.value.element;
+      if ($table) {
+        const { visibleData } = $table.getTableData();
+
+        let res = await GetResetWiptype({ qdList: visibleData });
+
+        let arr = visibleData.map(o => {
+          let _itm = res.qdList.find(itm => itm.printid == o.printid);
+
+          if (_itm) {
+            o.wip_type = _itm.wip_type;
+            !o.wrkgrpcode2 && (o.wrkgrpcode2 = _itm.o.wrkgrpcode2);
+          }
+          return o;
+        });
+
+        $table.reloadData(arr);
+        resetMergeCellsQd();
+      }
+    }
+  }),
+  [
+    buttonDefault({
+      label: "清单补充",
+      power: 85,
+      limited: () => {
+        return !!orderStatus.value;
+      },
+      disabledTextCallBack: (data: any) => {
+        if (data.js2_flag == 1) {
+          return "已清单补充审核,无法修改";
+        }
+        return "";
+      },
+      clickFunc: item => {
+        routeToEdit(3);
+      }
+    }),
+    buttonDefault({
+      label: "清单补充审核",
+      power: 86,
+      limited: () => {
+        return !!orderStatus.value;
+      },
+      clickFunc: item => {
+        const curRecords = [LjDetailRef.value?._mainData];
+
+        JS2Audit(1, curRecords, () => {
+          LjDetailRef.value.refresh();
+        });
+      }
+    }),
+    buttonDefault({
+      label: "清单补充撤审",
+      power: 87,
+      limited: () => {
+        return !!orderStatus.value;
+      },
+      clickFunc: item => {
+        const curRecords = [LjDetailRef.value?._mainData];
+
+        JS2Audit(0, curRecords, () => {
+          LjDetailRef.value.refresh();
+        });
+      }
+    })
+  ],
+  buttonDefault({
+    label: "生成/更新物料",
+    power: 88,
+    limited: () => {
+      return !!orderStatus.value;
+    },
+    clickFunc: item => {
+      toCreateMtrl(1, [LjDetailRef.value?._mainData.bednetid]);
+    }
+  }),
+  [
+    buttonDefault({
+      label: "生成金蝶清单",
+      power: 90,
+      disabledTextCallBack: (data: any) => {
+        console.log("生成金蝶清单 disabledTextCallBack data", data);
+        if (data.js2_flag == 0) {
+          return "床垫清单未审核,无法生成金蝶清单";
+        }
+
+        return "";
+      },
+      limited: () => {
+        return !!orderStatus.value;
+      },
+      clickFunc: item => {
+        toCreateORDelMtrlPf(1, [LjDetailRef.value?._mainData.bednetid]);
+      }
+    })
+  ],
+  buttonDefault({
+    label: "同步L1资料",
+    loading: () => loadingStatus.synchsL1,
+    clickFunc: async () => {
+      try {
+        loadingStatus.synchsL1 = true;
+        let res = await UpdateL1Basicinfo();
+        if (res) {
+          ElNotification({
+            title: "同步成功",
+            message: `物料:${res.mtrlnum}个 <br/>工组:${res.wkgnum}个 <br/>物料类别:${res.mtrltypenum}个`,
+            dangerouslyUseHTMLString: true,
+            type: "warning"
+          });
+        }
+        loadingStatus.synchsL1 = false;
+      } catch (error) {
+        loadingStatus.synchsL1 = false;
+        console.error(error);
+      }
+    }
+  }),
+  buttonDefault({
+    label: t("common.back"),
+    clickFunc: item => {
+      router.push(`/erpapi/mattressInterface`);
+    }
+  })
+];
+
+const routeToEdit = (type: any) => {
+  console.log("routeToEdit mainData :>> ", mainData, route.fullPath);
+
+  const _cur = mainData.value[0];
+  router.push({
+    name: "mattressInterfaceEditYw",
+    params: {
+      id: _cur.bednetid
+    },
+    query: {
+      code: _cur.bednetcode,
+      type: type
+    },
+    replace: true
+  });
+};
+
+/**
+ * @description 页面数据加载完成
+ */
+const funcAfterMound = async () => {
+  console.log("onMounted detail sale start!!!! :>> ", orderStatus.value);
+  if (!orderStatus.value) {
+    // 详情页
+    // gotoSummy(8000);
+  } else {
+    // 新增/编辑
+    tableProps_mx.value.editConfig.enabled = true;
+    tableProps_qd.value.editConfig.enabled = true;
+  }
+  console.log("onMounted detail sale start!!!! :>> ", tableProps_mx.value.editConfig);
+
+  console.log("onMounted detail sale start LjDetailRef.value.mainData :>> ", LjDetailRef.value);
+
+  if (orderStatus.value != "new") {
+  }
+};
+
+onBeforeMount(() => {
+  if (route.params?.id) {
+    // 刷新数据
+    initParams.value.bednetid = Number(route.params?.id);
+    editType.value = Number(route.query?.type);
+  }
+});
+
+onMounted(async () => {
+  console.log("route onMounted:>> ", route);
+  console.log("route onMounted:>> ", route.params);
+  console.log("route onMounted:>> ", route.params.id);
+
+  const result = await GetERPWrkGrpList();
+
+  if (result.workgroupList) {
+    workgrpEnum.value = result.workgroupList.map(item => {
+      return {
+        label: item.wrkGrpName,
+        value: item.wrkGrpid,
+        code: item.wrkgrpcode
+      };
+    });
+
+    // columns_qd.value = columns_qd.value.map(item => {
+    //   if (item.field == "wrkgrpid") {
+    //     item.editRender.options = workgrpEnum.value;
+    //   }
+    //   return item;
+    // });
+  }
+
+  const result2 = await GetERPWrkGrpList2();
+  workgrpEnum2.value = result2.datatable ?? [];
+
+  if (route.params?.id) {
+    // 刷新数据
+    console.log("detail onMounted initParams.value :>> ", initParams.value);
+    console.log("领用工组领用工组领用工组领用工组 columns_qd.value :>> ", columns_qd.value);
+    await RetriveMattressInterface(initParams.value.bednetid.valueOf());
+  }
+});
+
+/** 发现4.11~4.13版本reloadData加载超慢放弃使用 */
+const autoRowDragend = async data => {
+  const $table = QdTableRef.value.element;
+
+  $table.clearMergeCells();
+  nextTick(() => {
+    let mergeCells = autoMergeCells($table, ["itemname", "bj_pzname", "bj_pzname_mx_mx"]);
+    $table.setMergeCells(mergeCells);
+  });
+};
+
+const LjDialogQdRowAdd = ref();
+const interIndex = ref(0);
+const qdFormParam = ref({
+  itemname: "",
+  bj_pzname: "",
+  bj_pzname_mx: "",
+  u_mtrl_price_mtrlname: ""
+});
+const qdDefaultAction = [
+  buttonDefault({
+    label: t("common.cancelText"),
+    icon: "iconchevron-left",
+    clickFunc: item => {
+      LjDialogQdRowAdd.value.hide();
+    }
+  }),
+  buttonDefault({
+    label: t("common.okText"),
+    clickFunc: async item => {
+      LjDialogQdRowAdd.value.hide();
+    }
+  })
+];
+</script>

Різницю між файлами не показано, бо вона завелика
+ 1360 - 0
JLHWEB/src/views/erpapi/bednetInterface/hooks/index.tsx


+ 284 - 0
JLHWEB/src/views/erpapi/bednetInterface/index.vue

@@ -0,0 +1,284 @@
+<template>
+  <div class="table-box">
+    <LjVxeTable
+      ref="vxeTableRef"
+      row-key="bednetid"
+      :columns="columns"
+      :init-param="initParams"
+      :request-api="getData"
+      :data-callback="dataCallback"
+      :dwname="DwnameEnum.bednetInterface"
+      :table-props="tableProps"
+      :table-events="tableEvents"
+      :auto-load-layout="false"
+      :search-btn-size-extent="[]"
+      pagination
+    >
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader>
+        <LjHeaderMenu :update="dialogVisible" :action="action" />
+      </template>
+    </LjVxeTable>
+  </div>
+</template>
+
+<script setup lang="ts" name="bednetInterface">
+import { ref, onMounted, inject } from "vue";
+import { useRouter } from "vue-router";
+import { MattressYWAudit, MattressJSAudit, MattressJS2Audit } from "@/api/modules/quote";
+import { CommonDynamicSelect } from "@/api/modules/common";
+import { ColumnProps } from "@/components/LjVxeTable/interface";
+import LjDrawer from "@/components/LjDrawer/index.vue";
+import { useHooks } from "./hooks/index";
+import LjDialog from "@/components/LjDialog/index.vue";
+import LjHeaderMenu from "@/components/LjHeaderMenu/index.vue";
+import { useI18n } from "vue-i18n";
+import { useAuthButtons } from "@/hooks/useAuthButtons";
+import { DwnameEnum } from "@/enums/dwnameEnum";
+import { formatToDateTime, formatToDate } from "@/utils/dateUtil";
+import { cloneDeep } from "lodash-es";
+import { useGlobalStore } from "@/stores/modules/global";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { detailAction } from "@/components/LjDetail/interface";
+import mittBus from "@/utils/mittBus";
+import { MittEnum } from "@/enums/mittEnum";
+import { getCurrentRecords } from "@/utils/index";
+
+const { t } = useI18n();
+const router = useRouter();
+const globalStore = useGlobalStore();
+const { initParams, columns, toCreateMtrl, toCreateORDelMtrlPf, JS2Audit } = useHooks(t);
+// const { toExcelQuote } = useHooksCpQuote();
+const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
+
+const dialogVisible = ref(false);
+const vxeTableRef = ref();
+const enumMap = ref(new Map());
+
+const getData = (params: any) => {
+  console.log("getData mattress params :>> ", params);
+  let newParams: any = {};
+  params.pageNum && (newParams.pageindex = params.pageNum);
+  params.pageSize && (newParams.pagesize = params.pageSize);
+  params.orderstr && (newParams.orderstr = params.orderstr);
+  delete params.pageNum;
+  delete params.pageSize;
+  delete params.orderstr;
+  let _params = cloneDeep(params);
+  newParams.queryParams = _params;
+  newParams.dsname = "web_bednet_interfacelist";
+
+  return CommonDynamicSelect(newParams, DwnameEnum.bednetInterface);
+};
+
+const handleDBlClickTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }: any) => {
+  if (globalStore.detailBlank) {
+    // 打开新的窗口
+    const routeUrl = router.resolve({
+      path: `/erpapi/bednetInterface/detail`,
+      query: {
+        id: row.bednetid,
+        code: row.bednetcode
+      }
+    });
+    window.open(routeUrl.href, "_blank");
+  } else {
+    // 打开新的标签页
+    // router.push(`/erpapi/bednetInterface/detail?id=${row.bednetid}&code=${row.bednetcode}`);
+
+    router.push({
+      path: `/erpapi/bednetInterface/detail/${row.bednetid}`,
+      query: {
+        code: row.bednetcode
+      }
+    });
+  }
+};
+
+const rowClsNameFunc = (data: any) => {
+  const { row, rowIndex, $rowIndex } = data;
+  if (Number(row.creatmtrlqd_flag) != 1) {
+    if (Number(row.creatmtrl_flag) == 0) {
+      return "vxecol-danger";
+    } else {
+      return "vxecol-blue";
+    }
+  }
+  return "";
+};
+const tableProps = {
+  height: "auto",
+  editConfig: { trigger: "click", mode: "cell" },
+  rowClassName: rowClsNameFunc,
+  treeConfig: {
+    expandAll: true,
+    transform: true,
+    rowField: "bednetid",
+    parentField: "parentid"
+  },
+  checkboxConfig: {
+    showHeader: true,
+    checkStrictly: true
+  },
+  exportConfig: {
+    filename: t("menu.rpMsttake") + formatToDate(new Date(), "YYYY-MM-DD HH:mm:ss")
+  }
+};
+
+// 返回绑定的事件
+const tableEvents = {
+  "cell-dblclick": handleDBlClickTable
+};
+
+/**
+ * @description 按钮展示
+ */
+const action: detailAction[] = [
+  buttonDefault({
+    label: t("common.redo"),
+    clickFunc: item => {
+      vxeTableRef.value.refresh();
+    }
+  }),
+  buttonDefault({
+    label: t("common.view"),
+    clickFunc: item => {
+      const { curRecords } = getCurrentRecords(vxeTableRef.value);
+      handleDBlClickTable({ row: curRecords[0] });
+    }
+  }),
+  [
+    buttonDefault({
+      label: "清单补充",
+      power: 85,
+      clickFunc: item => {
+        routeToEdit(3);
+      }
+    }),
+    buttonDefault({
+      label: "清单补充审核",
+      power: 86,
+      clickFunc: item => {
+        const { curRecords } = getCurrentRecords(vxeTableRef.value);
+
+        JS2Audit(1, curRecords, () => {
+          vxeTableRef.value.refresh();
+        });
+      }
+    }),
+    buttonDefault({
+      label: "清单补充撤审",
+      power: 87,
+      clickFunc: item => {
+        const { curRecords } = getCurrentRecords(vxeTableRef.value);
+
+        JS2Audit(0, curRecords, () => {
+          vxeTableRef.value.refresh();
+        });
+      }
+    })
+  ],
+  [
+    buttonDefault({
+      label: "生成/更新物料",
+      power: 88,
+      clickFunc: item => {
+        const { curRecords } = getCurrentRecords(vxeTableRef.value);
+
+        if (!curRecords.length) {
+          ElMessage.warning(t("business.tips.mattress.records"));
+          return;
+        }
+        let list = curRecords.map(item => item.bednetid);
+        toCreateMtrl(1, list);
+      }
+    })
+  ],
+  [
+    buttonDefault({
+      label: "生成金蝶清单",
+      power: 90,
+      clickFunc: item => {
+        const { curRecords } = getCurrentRecords(vxeTableRef.value);
+
+        if (!curRecords.length) {
+          ElMessage.warning(t("business.tips.mattress.records"));
+          return;
+        }
+
+        let list = curRecords.map(item => item.bednetid);
+        toCreateORDelMtrlPf(1, list);
+      }
+    })
+    // buttonDefault({
+    //   label: "删除金蝶清单",
+    //   power: 91,
+    //   clickFunc: item => {
+    //     const { curRecords } = getCurrentRecords(vxeTableRef.value);
+
+    //     if (!curRecords.length) {
+    //       ElMessage.warning(t("business.tips.mattress.records"));
+    //       return;
+    //     }
+
+    //     toCreateORDelMtrlPf(0, curRecords[curRecords.length - 1].bednetid);
+    //   }
+    // })
+  ]
+];
+
+const dataCallback = (data: any) => {
+  if (data.tableinfo?.columns) {
+    data.tableinfo?.columns.map((item: any) => {
+      if (item?.enum) {
+        enumMap.value.set(item.field, item.enum);
+      }
+    });
+  }
+  return {
+    list: data.datatable,
+    tableinfo: data.tableinfo,
+    total: data.totalcnt,
+    pageNum: data.pageindex,
+    pageSize: data.pagesize
+  };
+};
+
+const routeToEdit = type => {
+  const { $table, curRecords } = getCurrentRecords(vxeTableRef.value);
+
+  if (!curRecords.length) {
+    ElMessage.warning(t("business.tips.mattress.records"));
+    return;
+  }
+
+  const _cur = curRecords[curRecords.length - 1];
+  // router.push(`/erpapi/bednetInterface/${type}/edit?id=${_cur.bednetid}&code=${_cur.bednetcode}&type=${type}`);
+
+  try {
+    if (type === 3) {
+      if (_cur.js2_flag == 1) {
+        throw new Error(_cur.bednetcode + ":已清单补充审核,无法修改");
+      }
+    }
+  } catch (error) {
+    ElMessage.error(error.message);
+    return false;
+  }
+
+  router.push({
+    path: `/erpapi/bednetInterface/edit/${_cur.bednetid}`,
+    query: {
+      code: _cur.bednetcode,
+      type: type
+    }
+  });
+};
+
+/**
+ * @description 监听框架属性变化
+ */
+mittBus.on(MittEnum.MattressList, () => {
+  vxeTableRef.value.refresh();
+});
+</script>

+ 185 - 1
JLHWEB/src/views/quote/mattressQuote/hooks/index.tsx

@@ -2070,6 +2070,188 @@ export const useHooks = (t?: any) => {
     });
   };
 
+  /**
+   * 拆分表格数据到不同的分类
+   * @param {Object} _mainData - 主数据对象
+   * @param {Object} oriMxData - 原始明细数据对象
+   * @returns {Object} 包含所有分类数据的对象
+   */
+  const funcChaifenTabPro = (_mainData, oriMxData) => {
+    // 1. 处理面料数据
+    const processFabricData = () => {
+      const fabricMxData = oriMxData.filter(
+        t => t.formulatype == 0 || (Number(_mainData.if_bcp_type) == 1 && t.formulatype == 104)
+      );
+
+      console.log("funcChaifenTab fabricMxData :>> ", fabricMxData);
+
+      // 处理面料分页数据
+      const processFabricTab = (tabName, isExclude = false) => {
+        const tab = state.fabricMxTabList.find(t => t.name === tabName);
+        const key = `fabricMxTab${tabName.split("_")[1]}`;
+
+        const result = isExclude
+          ? fabricMxData.filter(t => !tab.type.includes(Number(t.formulakind)))
+          : fabricMxData.filter(t => tab.type.includes(Number(t.formulakind)));
+
+        // 添加序号
+        result.forEach((o, i) => {
+          o.xu = i + 1;
+        });
+
+        console.log(`funcChaifenTab ${key} :>> `, result);
+        return { [key]: result };
+      };
+
+      // 处理各个面料分页并合并结果
+      return {
+        ...processFabricTab("tabpage_8"),
+        ...processFabricTab("tabpage_9"),
+        ...processFabricTab("tabpage_10"),
+        ...processFabricTab("tabpage_11"),
+        ...processFabricTab("tabpage_12"),
+        ...processFabricTab("tabpage_13", true) // 最后一个tab是排除逻辑
+      };
+    };
+
+    // 2. 处理其他分类数据
+    const processOtherCategories = () => {
+      const categories = [
+        { key: "cushionsMxData", type: 1 }, // 垫层
+        { key: "accessoriesMxData", type: 2 }, // 辅料
+        { key: "packagMxData", type: 3 }, // 包装
+        { key: "bednetMxData", type: 99 } // 床网
+      ];
+
+      return categories.reduce((acc, { key, type }) => {
+        const result = oriMxData.filter(t => t.formulatype == type);
+        result.forEach((o, i) => {
+          o.xu = i + 1;
+        });
+        return { ...acc, [key]: result };
+      }, {});
+    };
+
+    // 处理内布套
+    const processNeiBuTaoData = () => {
+      // 处理面料分页数据
+      const otherMxTabList = [
+        {
+          label: "内布套",
+          name: "innerClothLayerMx",
+          ref: "innerClothLayerMxRef",
+          type: [101, 102]
+        },
+        {
+          label: "顶布裥棉",
+          name: "topCottonMx",
+          ref: "topCottonMxRef",
+          type: [103]
+        }
+      ];
+      const processNeiBuTaoTab = (tabName, isExclude = false) => {
+        const tab = otherMxTabList.find(t => t.name === tabName);
+        const key = `${tab.name}`;
+
+        const result = oriMxData.filter(t => tab.type.includes(Number(t.formulatype)));
+
+        // 添加序号
+        result.forEach((o, i) => {
+          o.xu = i + 1;
+        });
+
+        console.log(`funcChaifenTab ${key} :>> `, result);
+        return { [key]: result };
+      };
+
+      // 处理各个面料分页并合并结果
+      return {
+        ...processNeiBuTaoTab("innerClothLayerMx"),
+        ...processNeiBuTaoTab("topCottonMx")
+      };
+    };
+
+    // 合并所有结果并返回
+    return {
+      ...processFabricData(),
+      ...processOtherCategories(),
+      ...processNeiBuTaoData()
+    };
+  };
+
+  /**
+   * 获取报价单明细数据
+   * @returns {Array} 报价单明细数据数组
+   */
+  const getQuoteListMxData = data => {
+    return [
+      {
+        label: "面裥绵",
+        field: "tabpage_8",
+        replace: "面裥绵-",
+        data: data.fabricMxTab8 || []
+      },
+      {
+        label: "底裥绵",
+        field: "tabpage_9",
+        replace: "底裥绵-",
+        data: data.fabricMxTab9 || []
+      },
+      {
+        label: "裥大侧",
+        field: "tabpage_10",
+        replace: "大侧裥绵-",
+        data: data.fabricMxTab10 || []
+      },
+      {
+        label: "裥小侧",
+        field: "tabpage_11",
+        replace: "小侧裥绵-",
+        data: data.fabricMxTab11 || []
+      },
+      {
+        label: "裥V侧",
+        field: "tabpage_12",
+        replace: "V侧裥绵-",
+        data: data.fabricMxTab12 || []
+      },
+      {
+        label: "其他工艺",
+        field: "tabpage_13",
+        replace: "V侧裥绵-",
+        data: data.fabricMxTab13 || []
+      },
+      {
+        label: "垫层",
+        field: "cushions",
+        data: {
+          cushions: data.cushionsMxData || [],
+          bednet: data.bednetMxData || []
+        }
+      },
+      {
+        label: "辅料",
+        field: "accessories",
+        data: data.accessoriesMxData || []
+      },
+      {
+        label: "包装",
+        field: "packag",
+        data: data.packagMxData || []
+      },
+      {
+        label: "内布套",
+        field: "innerClothLayerMx",
+        data: data.innerClothLayerMx || []
+      },
+      {
+        label: "顶布裥棉",
+        field: "topCottonMx",
+        data: data.topCottonMx || []
+      }
+    ];
+  };
+
   /**
    * @description 切换包装方式select,获取默认物料
    * @param val
@@ -5730,6 +5912,8 @@ export const useHooks = (t?: any) => {
     resetMergeCellsTopCotton,
     wf_rtr_cwdc,
     gotoErpapi,
-    updateSubspecsTable
+    updateSubspecsTable,
+    funcChaifenTabPro,
+    getQuoteListMxData
   };
 };

+ 63 - 5
JLHWEB/src/views/quote/mattressQuote/index.vue

@@ -52,17 +52,20 @@
       </div>
     </template>
   </el-dialog>
+
+  <LjDrawerQuoteList ref="QuoteListDrawerRef" :iforigin="isShowOriginFormulaMattress" />
 </template>
 
 <script setup lang="ts" name="mattressQuote">
-import { ref, onMounted, inject } from "vue";
+import { ref, onMounted, inject, reactive } from "vue";
 import { useRouter } from "vue-router";
 import {
   SaveMattressAuditing,
   DelMattress,
   CopyMattressAudited,
   ReCalculateNoAudit,
-  ReCalculateERPCost
+  ReCalculateERPCost,
+  GetComputeMattressById
 } from "@/api/modules/quote";
 import { CommonDynamicSelect } from "@/api/modules/common";
 import { ColumnProps } from "@/components/LjVxeTable/interface";
@@ -84,11 +87,24 @@ import mittBus from "@/utils/mittBus";
 import { MittEnum } from "@/enums/mittEnum";
 import { getCurrentRecords } from "@/utils/index";
 import { useUserStore } from "@/stores/modules/user";
+import LjDrawerQuoteList from "./components/QuoteListNew.vue";
+import { storeToRefs } from "pinia";
 
 const { t } = useI18n();
 const router = useRouter();
 const globalStore = useGlobalStore();
-const { vxeTableRef, columns, initParams, dataCallback, gotoErpapi } = useHooks();
+const {
+  vxeTableRef,
+  columns,
+  initParams,
+  dataCallback,
+  gotoErpapi,
+  getFormulakindEnum,
+  formulaKindEnum,
+  fabricMxTabList,
+  funcChaifenTabPro,
+  getQuoteListMxData
+} = useHooks();
 const { toExcelQuote } = useHooksCpQuote();
 const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
 
@@ -97,6 +113,13 @@ const dialogVisible = ref(false);
 // const vxeTableRef = ref();
 const dialogFormVisible = ref(false);
 const deptEnum = ref([]);
+const QuoteListDrawerRef = ref(null);
+
+const { isShowOriginFormulaMattress } = storeToRefs(globalStore);
+const loadingStatus = reactive({
+  showQd: false,
+  download: false
+});
 
 const formParam = ref({
   deptid: 0,
@@ -206,6 +229,8 @@ const tableEvents = {
 
 onMounted(() => {
   dialogVisible.value = true;
+
+  getFormulakindEnum();
 });
 
 /**
@@ -484,9 +509,42 @@ const action: detailAction[] = [
   }),
   buttonDefault({
     label: t("common.showQuoteList"),
+    loading: () => loadingStatus.showQd,
     power: 72,
-    clickFunc: item => {
-      alert("功能维护中!");
+    clickFunc: async item => {
+      loadingStatus.showQd = !loadingStatus.showQd;
+      const { curRecords } = getCurrentRecords(vxeTableRef.value);
+
+      console.log("curRecords :>> ", curRecords);
+      if (!curRecords.length) {
+        ElMessage.warning(t("business.tips.mattress.records"));
+        return;
+      } else if (curRecords.length > 1) {
+        ElMessage.warning(`无法进行多单${t("common.showQuoteList")}`);
+        return;
+      }
+
+      const res = await GetComputeMattressById({
+        mattressid: curRecords[0].mattressid,
+        check_original: Number(isShowOriginFormulaMattress.value)
+      });
+      const isQuoteListMxData = getQuoteListMxData(funcChaifenTabPro(res.mattress, res.mattressMx));
+      let _data = {
+        data: res.mattress,
+        mxdata: isQuoteListMxData,
+        enumMap: vxeTableRef.value.enumMap,
+        fabricMx: fabricMxTabList.value,
+        formulakindenum: formulaKindEnum.value,
+        dannum_type: res.mattress.dannum_type,
+        formula: res.formulas, //
+        replace: res.replace, //
+        formula_ori: res.formulas_origin, //
+        formula_bednet: res.formulas_bednet, //
+        differ: res.differ //
+      };
+      QuoteListDrawerRef.value.show(_data);
+
+      loadingStatus.showQd = !loadingStatus.showQd;
     }
   }),
   buttonDefault({