QuoteListNew.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. <template>
  2. <LjDrawer
  3. ref="LjDrawerRef"
  4. size="60%"
  5. :class="prefixCls"
  6. :modal="false"
  7. :close-on-click-modal="false"
  8. modal-class="dialog_class"
  9. :closed="emits('closed')"
  10. >
  11. <template #header>
  12. <div class="flx-1">
  13. {{ $t("business.detail.quoteList") }}
  14. <el-button v-if="iforigin" type="primary" size="small" @click="handleOpenOriginQuote">
  15. {{ ifShowOrigin ? "返回新报价清单" : "查看旧报价清单" }}
  16. </el-button>
  17. <el-checkbox
  18. v-if="!ifShowOrigin"
  19. v-model="ifExpandAll"
  20. label="展开明细"
  21. size="small"
  22. style="margin-left: 20px"
  23. @change="toggleRowExpansionAll()"
  24. ></el-checkbox>
  25. </div>
  26. <div class="flx-shrink">
  27. <el-button size="small" @click="handleExportExcel"> 导出Excel </el-button>
  28. </div>
  29. </template>
  30. <el-descriptions :column="3">
  31. <template #title>
  32. <span class="text-body-b">报价日期:</span>
  33. <span class="text-body-b" v-if="mainData.data.createtime">{{ isFilterTime(mainData.data.createtime) }}</span>
  34. </template>
  35. <template #extra>
  36. <template v-if="ifShowOrigin">
  37. <span class="text-body-b">报价金额:</span>
  38. <span class="text-body-b">{{ isFilterPrice(mainData.data.foreign_cost) + isCurrency }}</span>
  39. </template>
  40. <template v-else>
  41. <div class="flx-end">
  42. <div class="ml-24" v-for="(itm, idx) in getStaticData" :key="idx">
  43. <span class="text-body-b">{{ itm.label }}:</span>
  44. <span class="text-body-b">{{ isFilterPrice(itm.value) }}</span>
  45. </div>
  46. </div>
  47. </template>
  48. </template>
  49. <el-descriptions-item v-for="(item, idx) in fields" :key="idx" width="80">
  50. <template #label>
  51. <span class="text-secondary-text"> {{ item.label }}: </span>
  52. </template>
  53. <span class="text-body-m">{{
  54. Object.keys(item).includes("value") ? item.value : isFilterPrice(mainData.data[item.field])
  55. }}</span>
  56. </el-descriptions-item>
  57. </el-descriptions>
  58. <template v-if="!ifShowOrigin">
  59. <el-table
  60. :data="tableData"
  61. size="small"
  62. border
  63. style="width: 100%"
  64. :summary-method="getSummaries"
  65. :span-method="objectSpanMethod"
  66. >
  67. <el-table-column prop="level" label="类目" />
  68. <el-table-column prop="level1" label="一级项目" />
  69. <el-table-column prop="level2" label="二级项目" />
  70. <template v-if="ifExpandAll">
  71. <el-table-column prop="label" label="项目" />
  72. <el-table-column prop="dscrp" label="内容" width="160" />
  73. <el-table-column prop="qty" label="数量" align="right" />
  74. <el-table-column prop="useqty" label="用量" align="right" />
  75. <el-table-column prop="price" label="单价" align="right" v-if="pricePower" />
  76. </template>
  77. <template v-else-if="!ifExpandAll && !pricePower">
  78. <el-table-column prop="qty" label="数量" align="right" />
  79. <el-table-column prop="useqty" label="用量" align="right" />
  80. </template>
  81. <template v-if="pricePower">
  82. <el-table-column prop="costamt_2" label="标准金额" align="right" :formatter="formatter" />
  83. <el-table-column prop="costamt_1" label="散单金额" align="right" :formatter="formatter" />
  84. <el-table-column prop="costamt_4" label="小单金额" align="right" :formatter="formatter" />
  85. <el-table-column prop="costamt_3" label="大单金额" align="right" :formatter="formatter" />
  86. </template>
  87. </el-table>
  88. <!-- <vxe-table
  89. border="full"
  90. ref="tableRef"
  91. :tree-config="treeConfig"
  92. :data="tableData"
  93. @toggle-tree-expand="toggleExpandChangeEvent"
  94. >
  95. <vxe-column field="label" title="项目" tree-node width="120"></vxe-column>
  96. <vxe-column field="dscrp" title="内容" width="160"></vxe-column>
  97. <vxe-column field="qty" title="数量"></vxe-column>
  98. <vxe-column field="costamt" title="数量"></vxe-column>
  99. <template v-if="iforigin && !ifShowOrigin">
  100. <vxe-column field="costamt_1" title="散单金额"></vxe-column>
  101. <vxe-column field="costamt_1" title="标准金额"></vxe-column>
  102. <vxe-column field="costamt_1" title="大单金额"></vxe-column>
  103. <vxe-column field="costamt_1" title="小单金额"></vxe-column>
  104. </template>
  105. <vxe-column field="useqty" title="用量"></vxe-column>
  106. <vxe-column field="price" title="单价"></vxe-column>
  107. </vxe-table> -->
  108. </template>
  109. <template v-else>
  110. <el-table
  111. :data="tableData"
  112. height="100%"
  113. size="small"
  114. border
  115. style="width: 100%"
  116. show-summary
  117. :summary-method="getSummaries"
  118. :span-method="objectSpanMethod"
  119. >
  120. <el-table-column prop="label" label="项目" />
  121. <el-table-column prop="dscrp" label="内容" width="160" />
  122. <el-table-column prop="qty" label="数量" align="right" />
  123. <el-table-column prop="costamt" label="金额" align="right" />
  124. <el-table-column prop="useqty" label="用量" align="right" />
  125. <el-table-column prop="price" label="单价" align="right" />
  126. </el-table>
  127. <!-- <el-table
  128. :data="tableData"
  129. size="small"
  130. border
  131. style="width: 100%"
  132. show-summary
  133. :summary-method="getSummaries"
  134. :span-method="objectSpanMethod"
  135. >
  136. <el-table-column prop="label" label="项目" />
  137. <el-table-column prop="dscrp" label="内容" width="160" />
  138. <el-table-column prop="qty" label="数量" align="right" />
  139. <el-table-column prop="costamt" label="金额" align="right" />
  140. <template v-if="iforigin && !ifShowOrigin">
  141. <el-table-column prop="costamt_1" label="散单金额" align="right" />
  142. <el-table-column prop="costamt_2" label="标准金额" align="right" />
  143. <el-table-column prop="costamt_3" label="大单金额" align="right" />
  144. <el-table-column prop="costamt_4" label="小单金额" align="right" />
  145. </template>
  146. <el-table-column prop="useqty" label="用量" align="right" />
  147. <el-table-column prop="price" label="单价" align="right" />
  148. </el-table> -->
  149. <!-- <el-table
  150. ref="elTableRef"
  151. :data="tableData2"
  152. style="width: 100%; margin-bottom: 20px"
  153. row-key="id"
  154. border
  155. :default-expand-all="ifExpandAll"
  156. :span-method="objectSpanMethod3"
  157. :expand-change="expandChangeFunc"
  158. >
  159. <el-table-column prop="label" label="Date" />
  160. <el-table-column prop="name" label="Name" />
  161. <el-table-column prop="address" label="Address" />
  162. </el-table> -->
  163. </template>
  164. </LjDrawer>
  165. </template>
  166. <script setup lang="tsx" name="mattressQuoteLjDrawerQuoteList">
  167. import { ref, computed, reactive, nextTick } from "vue";
  168. import LjDrawer from "@/components/LjDrawer/index.vue";
  169. import { useDesign } from "@/hooks/useDesign";
  170. import { formatTime, formatAmount3, floatAdd } from "@/utils/index";
  171. import { isFunction } from "@/utils/is";
  172. import { cloneDeep, pick } from "lodash-es";
  173. import { useUserStore } from "@/stores/modules/user";
  174. import { CommonDynamicSelect } from "@/api/modules/common";
  175. import { useHooksCpQuote } from "../hooks/cpQuote";
  176. import { isFilterPrice, autoMergeCells } from "@/utils/index";
  177. interface WidgetProps {
  178. // data: any;
  179. iforigin: boolean;
  180. }
  181. // interface WidgetTableItem {
  182. // label: string;
  183. // dscrp: any;
  184. // qty?: number | string;
  185. // costamt?: number | string;
  186. // useqty?: number | string;
  187. // price?: number | string;
  188. // [key: string]: any;
  189. // }
  190. const props = withDefaults(defineProps<WidgetProps>(), {
  191. iforigin: false
  192. });
  193. const formatter = (row: any, column: any, cellValue: any, index: any) => {
  194. return isFilterPrice(cellValue);
  195. };
  196. const { prefixCls } = useDesign("ljdrawer-quotelist");
  197. const { userInfo } = useUserStore();
  198. const { enumMap, tableData, oriTableData, wf_retrieve_qingdan } = useHooksCpQuote();
  199. const pricePower = computed(() => {
  200. return userInfo.usermode == 0;
  201. });
  202. const emits = defineEmits(["export", "closed"]);
  203. const LjDrawerRef = ref();
  204. const elTableRef = ref();
  205. const tableRef = ref();
  206. const mainData = ref<any>({});
  207. // const mainData = ref<any>({});
  208. const ifExpandAll = ref<any>(true);
  209. const isCurrency = computed(() => {
  210. return mainData.value.data?.moneyrate != 1 ? "美金" : "人民币";
  211. });
  212. // const tableData2: any[] = [
  213. // {
  214. // id: 1,
  215. // label: "2016-05-02",
  216. // name: "wangxiaohu",
  217. // address: "No. 189, Grove St, Los Angeles"
  218. // },
  219. // {
  220. // id: 2,
  221. // label: "2016-05-04",
  222. // name: "wangxiaohu",
  223. // address: "No. 189, Grove St, Los Angeles"
  224. // },
  225. // {
  226. // id: 3,
  227. // label: "2016-05-01",
  228. // name: "wangxiaohu",
  229. // address: "No. 189, Grove St, Los Angeles",
  230. // children: [
  231. // {
  232. // id: 31,
  233. // label: "2016-05-01",
  234. // name: "wangxiaohu",
  235. // address: "No. 189, Grove St, Los Angeles"
  236. // },
  237. // {
  238. // id: 32,
  239. // label: "2016-05-01",
  240. // name: "wangxiaohu",
  241. // address: "No. 189, Grove St, Los Angeles"
  242. // }
  243. // ]
  244. // },
  245. // {
  246. // id: 4,
  247. // label: "2016-05-03",
  248. // name: "wangxiaohu",
  249. // address: "No. 189, Grove St, Los Angeles"
  250. // }
  251. // ];
  252. const treeConfig = reactive<any>({
  253. transform: true,
  254. rowField: "id",
  255. parentField: "parentId"
  256. });
  257. const toggleExpandChangeEvent: any = params => {
  258. const $table = tableRef.value;
  259. if ($table) {
  260. const { row, expanded } = params;
  261. console.log("节点展开事件", expanded, "获取父节点:", $table.getParentRow(row));
  262. }
  263. };
  264. const ifShowOrigin = ref(false);
  265. const originData = ref<any>();
  266. const setOriginData = () => {
  267. let _data = cloneDeep(mainData.value);
  268. if (ifShowOrigin.value) {
  269. // 旧报价
  270. fields.value.map(item => {
  271. let _rp = originData.value.find(itm => itm.label.replace(/【/g, "").replace(/】/g, "") === item.replacelabel);
  272. if (_rp) {
  273. _data.data[item.field] = _rp.value;
  274. }
  275. });
  276. let _rp = originData.value.find(itm => itm.label.replace(/【/g, "").replace(/】/g, "") === "散单金额");
  277. if (_rp) {
  278. _data.data.foreign_cost = _rp.value;
  279. }
  280. }
  281. mainData.value = _data;
  282. wf_retrieve_qingdan(_data, !ifShowOrigin.value, ifExpandAll.value);
  283. };
  284. const handleOpenOriginQuote = () => {
  285. ifShowOrigin.value = !ifShowOrigin.value;
  286. console.log("handleOpenOriginQuote>>>>> ", mainData.value);
  287. setOriginData();
  288. };
  289. const toggleRowExpansionAll = () => {
  290. wf_retrieve_qingdan(mainData.value, !ifShowOrigin.value, ifExpandAll.value);
  291. // data.forEach(async item => {
  292. // // const elTableRef = await getElTableExpose()
  293. // elTableRef.value?.toggleRowExpansion(item, isExpansion);
  294. // if (item.children !== undefined && item.children !== null) {
  295. // toggleRowExpansionAll(item.children, isExpansion);
  296. // }
  297. // });
  298. };
  299. const objectSpanMethod3 = ({ row, column, rowIndex, columnIndex }: any) => {
  300. // // console.log("objectSpanMethod row,column, rowIndex,columnIndex :>> ", data);
  301. // if (column.property == "label") {
  302. // let rowspan = 1;
  303. // let currentVal = row.label;
  304. // let lastVal = "";
  305. // // 上一个
  306. // if (rowIndex - 1 >= 0) {
  307. // lastVal = tableData2[rowIndex - 1]?.label;
  308. // }
  309. // if (lastVal) {
  310. // if (lastVal != currentVal) {
  311. // // 计算合并行数
  312. // let _span = 0;
  313. // for (let i = rowIndex + 1; i < tableData2.length; i++) {
  314. // if (tableData2[i].label == currentVal) {
  315. // _span++;
  316. // } else {
  317. // break;
  318. // }
  319. // }
  320. // rowspan += _span;
  321. // console.log("rowspan _span :>> ", lastVal, currentVal, rowspan, _span);
  322. // } else {
  323. // rowspan = 0;
  324. // }
  325. // }
  326. // return {
  327. // rowspan,
  328. // colspan: rowspan > 0 ? 1 : 0
  329. // };
  330. // }
  331. // //定义需要合并的列字段,有哪些列需要合并,就自定义添加字段即可
  332. // const fields = ["label"];
  333. // // 当前行的数据
  334. // const cellValue = row[column.property];
  335. // // 判断只合并定义字段的列数据
  336. // if (cellValue && fields.includes(column.property)) {
  337. // const prevRow = tableData2[rowIndex - 1]; //上一行数据
  338. // let nextRow = tableData2[rowIndex + 1]; //下一行数据
  339. // // 当上一行的数据等于当前行数据时,当前行单元格隐藏
  340. // if (prevRow && prevRow[column.property] === cellValue) {
  341. // return { rowspan: 0, colspan: 0 };
  342. // } else {
  343. // // 反之,则循环判断若下一行数据等于当前行数据,则当前行开始进行合并单元格
  344. // let countRowspan = 1; //用于合并计数多少单元格
  345. // while (nextRow && nextRow[column.property] === cellValue) {
  346. // nextRow = tableData2[++countRowspan + rowIndex];
  347. // }
  348. // if (countRowspan > 1) {
  349. // return { rowspan: countRowspan, colspan: 1 };
  350. // }
  351. // }
  352. // }
  353. if (columnIndex === 0) {
  354. if (rowIndex === 2) {
  355. return {
  356. rowspan: 3,
  357. colspan: 1
  358. };
  359. } else if (rowIndex >= 3 && rowIndex < 4) {
  360. return {
  361. rowspan: 0,
  362. colspan: 0
  363. };
  364. }
  365. }
  366. console.log("elTableRef.value :>> ", elTableRef.value);
  367. };
  368. const expandChangeFunc = () => {};
  369. const show = (params: any, originReplace?: any) => {
  370. console.log("show>>>>> ", params, originReplace);
  371. originData.value = [];
  372. if (ifShowOrigin.value) {
  373. setOriginData();
  374. }
  375. mainData.value = cloneDeep(params);
  376. // showData.value = cloneDeep(params);
  377. wf_retrieve_qingdan(params, !ifShowOrigin.value, ifExpandAll.value);
  378. LjDrawerRef.value.show();
  379. // nextTick(() => {
  380. // let mergeCells = autoMergeCells(tableRef.value, ["label"]);
  381. // console.log("resetMergeCellsInner autoMergeCells :>> ", mergeCells);
  382. // tableRef.value.setMergeCells(mergeCells);
  383. // });
  384. };
  385. const isFilterTime = time => {
  386. return formatTime(time, "{y}-{m}-{d}", false);
  387. };
  388. const fields = computed(() => {
  389. if (!ifShowOrigin.value) {
  390. const { data, replace } = mainData.value;
  391. console.log("fieldsfields data :>> ", mainData.value);
  392. let _enum = enumMap.value.get("mattresstypeid");
  393. let result = "";
  394. if (_enum) {
  395. result = _enum.find(t => t.value == data.mattresstypeid).label ?? "";
  396. }
  397. let arr = [];
  398. if (Number(data.if_m_chai) == 1) {
  399. arr.push("面拆");
  400. }
  401. if (Number(data.if_z_chai) == 1) {
  402. arr.push("中拆");
  403. }
  404. if (Number(data.if_d_chai) == 1) {
  405. arr.push("底拆");
  406. }
  407. if (Number(data.if_n_butao) == 1) {
  408. arr.push("内布套");
  409. }
  410. if (Number(data.if_w_butao) == 1) {
  411. arr.push("外布套");
  412. }
  413. let _managerate = 0;
  414. let isFormulaValue = replace.find(o => o.label.indexOf("管理费用点") > -1);
  415. if (isFormulaValue) {
  416. _managerate = isFilterPrice(isFormulaValue.value);
  417. }
  418. let _com_profitrate = 0;
  419. isFormulaValue = replace.find(o => o.label.indexOf("公司利润点(部门)") > -1);
  420. if (isFormulaValue) {
  421. _com_profitrate = isFilterPrice(isFormulaValue.value);
  422. }
  423. return [
  424. { label: "核价编码", value: data.mattresscode },
  425. { label: "核价名称", value: data?.mattressname == "" ? "未命名" : data?.mattressname },
  426. { label: "床垫类别", value: result },
  427. { label: "床垫规格", value: `${data.mattress_width} * ${data.mattress_length} * ${data.mattress_height}` },
  428. { label: "拆装、布套", value: arr.join(" ") },
  429. { label: "地区", value: data.area ?? "" },
  430. { label: "柜型", value: data.cabinet_type ?? "" },
  431. { label: "管理费用点", value: _managerate ?? "", type: "variable", field: "managerate" },
  432. {
  433. label: "公司利润点(部门)",
  434. value: _com_profitrate ?? "",
  435. type: "variable",
  436. field: "com_profitrate",
  437. jointo: "公司利润点"
  438. },
  439. { label: "部门利润率", value: data.dept_profitrate ?? "", type: "variable", field: "dept_profitrate" }
  440. ];
  441. } else {
  442. return [
  443. { label: "财务底价", field: "nottax_dept_cost", replacelabel: "部门不含税价" },
  444. { label: "佣金点数", field: "commission", replacelabel: "佣金点数" },
  445. { label: "税率", field: "taxrate", replacelabel: "税率" },
  446. { label: "额外点数", field: "other_rate", replacelabel: "额外点数" },
  447. { label: "额外费用", field: "extras_cost", replacelabel: "额外费用" },
  448. { label: "汇率", field: "moneyrate", replacelabel: "汇率" },
  449. { label: "款式费用", field: "hrcost", replacelabel: "人工费用" },
  450. { label: "边带费用", field: "biandaicost", replacelabel: "边带费用" },
  451. { label: "总成本", field: "total_cost", replacelabel: "车间成本" },
  452. { label: "工厂利润率", field: "profitrate", replacelabel: "工厂利润率" },
  453. { label: "工艺点数", field: "profitrate_point", replacelabel: "工艺点数" },
  454. { label: "不含税出厂价", field: "nottax_factory_cost", replacelabel: "不含税出厂价" },
  455. { label: "部门利润率", field: "dept_profitrate", replacelabel: "部门利润率" },
  456. { label: "FOB费用", field: "fob", replacelabel: "FOB" },
  457. { label: "部门售价", field: "nottax_dept_cost", replacelabel: "部门不含税价" },
  458. { label: "让利点数", field: "dept_profitrate_rangli", replacelabel: "部门让利点数" },
  459. { label: "海绵款扣点", field: "haimian_point", replacelabel: "海绵扣点" }
  460. ];
  461. }
  462. });
  463. const statisticData = ref([
  464. {
  465. label: "【散单金额】",
  466. value: 0,
  467. origin: 0,
  468. key: "【部门含税价】",
  469. type: 1
  470. },
  471. {
  472. label: "【小单金额】",
  473. value: 0,
  474. origin: 0,
  475. key: "【部门含税价】",
  476. type: 4
  477. },
  478. {
  479. label: "【标准金额】",
  480. value: 0,
  481. origin: 0,
  482. key: "【部门含税价】",
  483. type: 2
  484. },
  485. {
  486. label: "【大单金额】",
  487. value: 0,
  488. origin: 0,
  489. key: "【部门含税价】",
  490. type: 3
  491. }
  492. ]);
  493. const getStaticData = computed(() => {
  494. let arr = statisticData.value.filter(o => {
  495. // let tg = val.find(item => item.label === o.key);
  496. let tg = mainData.value.differ.find(item => item.type === o.type);
  497. if (tg) {
  498. let tgRl = tg.replace.find(item => item.label === o.key);
  499. o.label = o.label.replace("【", "").replace("】", "");
  500. o.value = tgRl ? tgRl.value : 0;
  501. console.log("tgRl, :>> ", props.iforigin, tgRl);
  502. if (props.iforigin) {
  503. let tgori = tg.replace_origin.find(item => item.label === o.key);
  504. o.origin = tgori ? tgori.value : 0;
  505. }
  506. }
  507. // if (o?.power) {
  508. // return o.power();
  509. // } else {
  510. return true;
  511. // }
  512. });
  513. return arr;
  514. });
  515. const getSummaries = (param: any) => {
  516. const { columns, data } = param;
  517. console.log("getSummaries param :>> ", param);
  518. const sums: any[] = [];
  519. columns.forEach((column, index) => {
  520. if (index === 0) {
  521. sums[index] = <div>材料合计:</div>;
  522. return;
  523. }
  524. const values = data.map(item => Number(item[column.property]?.toString().replace(/,/g, "")));
  525. if (column.property == "costamt" && !values.every(value => Number.isNaN(value))) {
  526. // console.log("values :>> ", values);
  527. sums[index] = `${values.reduce((prev, curr) => {
  528. // console.log("prev,curr :>> ", prev, curr);
  529. const value = Number(curr);
  530. if (!Number.isNaN(value)) {
  531. return floatAdd(prev, curr);
  532. } else {
  533. return prev;
  534. }
  535. }, 0)}`;
  536. } else {
  537. sums[index] = "";
  538. }
  539. });
  540. return sums;
  541. };
  542. const objectSpanMethod = (data: any) => {
  543. const { row, column, rowIndex, columnIndex } = data;
  544. // console.log("objectSpanMethod row,column, rowIndex,columnIndex :>> ", data);
  545. let columnsName = ["level", "level1", "label"];
  546. ifExpandAll.value && columnsName.push("level2");
  547. if (columnsName.includes(column.property)) {
  548. let rowspan = 1;
  549. let currentVal = row[column.property];
  550. let lastVal = "";
  551. // 上一个
  552. if (rowIndex - 1 >= 0) {
  553. lastVal = tableData.value[rowIndex - 1][column.property];
  554. }
  555. console.log(
  556. "objectSpanMethod lastVal rowIndex :>> ",
  557. lastVal,
  558. currentVal,
  559. rowIndex,
  560. lastVal || rowIndex == 0,
  561. currentVal && (lastVal || rowIndex == 0)
  562. );
  563. if (currentVal) {
  564. if (lastVal != currentVal) {
  565. // 计算合并行数
  566. let _span = 0;
  567. for (let i = rowIndex + 1; i < tableData.value.length; i++) {
  568. // console.log("tableData.value[i].label :>> ", tableData.value[i][column.property], currentVal, _span);
  569. if (tableData.value[i][column.property] == currentVal) {
  570. _span++;
  571. } else {
  572. break;
  573. }
  574. }
  575. rowspan += _span;
  576. } else {
  577. rowspan = 0;
  578. }
  579. }
  580. // console.log("rowspan _span :>> ", lastVal, currentVal, rowspan);
  581. return {
  582. rowspan,
  583. colspan: rowspan > 0 ? 1 : 0
  584. };
  585. }
  586. };
  587. const handleExportExcel = () => {
  588. emits("export", ifExpandAll.value, ifShowOrigin.value, fields.value);
  589. };
  590. defineExpose({
  591. show
  592. });
  593. </script>
  594. <style lang="scss">
  595. .longjoe-ljdrawer-quotelist,
  596. .dialog_class {
  597. pointer-events: none;
  598. }
  599. .el-drawer {
  600. pointer-events: auto;
  601. }
  602. </style>