AllFormula.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <LjDrawer
  3. v-if="visible"
  4. ref="LjDrawerRef"
  5. :class="`${prefixCls}`"
  6. :id="prefixCls"
  7. direction="rtl"
  8. size="60%"
  9. destroy-on-close
  10. append-to-body
  11. :show-close="false"
  12. @close="autoClose"
  13. >
  14. <template #header>
  15. <div class="flx-justify-between">
  16. <div class="">详细报价</div>
  17. <div class="flx-shrink">
  18. <el-button type="danger" :icon="Close" text circle @click="cancelClick"></el-button>
  19. </div>
  20. </div>
  21. </template>
  22. <template #default>
  23. <LjHeader class="flx-1" title="单据统计" />
  24. <FormulaGroup :data="isNormalFormulas" :fields="fieldsReplace" />
  25. </template>
  26. </LjDrawer>
  27. </template>
  28. <script setup lang="ts" name="mattressQuoteDetail_AllFormula">
  29. import { ref, computed, watch, nextTick } from "vue";
  30. import LjDrawer from "@/components/LjDrawer/index.vue";
  31. import { useI18n } from "vue-i18n";
  32. import { useDesign } from "@/hooks/useDesign";
  33. import { useGlobalStore } from "@/stores/modules/global";
  34. import { Close, Search } from "@element-plus/icons-vue";
  35. import FormulaGroup from "./FormulaGroup.vue";
  36. import LjHeader from "@/components/LjHeader/index.vue";
  37. const { t } = useI18n();
  38. const { prefixCls } = useDesign("bednet-formal-detail");
  39. const globalStore = useGlobalStore();
  40. const visible = ref(false);
  41. const LjDrawerRef = ref();
  42. const formulaList = ref<any>([]);
  43. const fieldsReplace = ref<any>([]);
  44. // const mainData = ref<any>({});
  45. const formulaMxList = ref<any>([]);
  46. const isNormalFormulas = computed(() => {
  47. return formulaList.value.filter((item: any) => item.type == 0);
  48. });
  49. const isMxFormulas = computed(() => {
  50. return formulaList.value.filter((item: any) => item.type == 2);
  51. });
  52. const isWeigthFormulas = computed(() => {
  53. return formulaList.value.filter((item: any) => item.type == 3);
  54. });
  55. const autoClose = () => {
  56. setTimeout(() => {
  57. visible.value = false;
  58. }, 200);
  59. };
  60. const cancelClick = () => {
  61. // searchField.value = "";
  62. LjDrawerRef.value.hide();
  63. // selectColumn.value = [];
  64. // ifAllSelect.value = false;
  65. };
  66. /**
  67. * @description 显示组件
  68. */
  69. const open = (formulas: any, replace: any) => {
  70. visible.value = true;
  71. formulaList.value = formulas;
  72. fieldsReplace.value = replace;
  73. // mainData.value = data;
  74. formulaMxList.value;
  75. nextTick(() => {
  76. // list.value = cloneDeep(params);
  77. // oriList.value = cloneDeep(params);
  78. // let arr: string[] = [];
  79. // params.map((item: any) => {
  80. // if (item.basicinfo && item.basicinfo.hasOwnProperty("group")) {
  81. // item.basicinfo.group && !arr.includes(item.basicinfo.group) && arr.push(item.basicinfo.group);
  82. // }
  83. // });
  84. // groupList.value = arr;
  85. // selectGroup.value = group;
  86. LjDrawerRef.value.show();
  87. // console.log("open columnsDrag.value :>> ", columnsDrag.value);
  88. // nextTick(() => {
  89. // initDragSelect();
  90. // });
  91. });
  92. };
  93. defineExpose({
  94. open
  95. });
  96. </script>
  97. <style lang="scss" scoped>
  98. $prefix-cls: "#{$namespace}-bednet-formal-detail";
  99. .#{$prefix-cls} {
  100. .summary-wrapper {
  101. &__label-item {
  102. position: relative;
  103. margin-right: $space-a3;
  104. &::after {
  105. content: "=";
  106. position: absolute;
  107. bottom: 0;
  108. right: -$space-b3;
  109. font-size: 24px;
  110. color: $color-text-disable;
  111. }
  112. }
  113. }
  114. }
  115. </style>