index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. <template>
  2. <div class="table-box">
  3. <LjVxeTable
  4. ref="vxeTableRef"
  5. row-key="mattressid"
  6. :columns="columns"
  7. :init-param="initParams"
  8. :request-api="getData"
  9. :data-callback="dataCallback"
  10. :dwname="DwnameEnum.mattressQuote"
  11. :table-props="tableProps"
  12. :table-events="tableEvents"
  13. :auto-load-layout="false"
  14. :search-btn-size-extent="[]"
  15. pagination
  16. >
  17. <!-- 表格 header 按钮 -->
  18. <template #tableHeader>
  19. <LjHeaderMenu :update="dialogVisible" :action="action" />
  20. </template>
  21. </LjVxeTable>
  22. </div>
  23. <el-dialog v-model="dialogFormVisible" title="部门选择" width="500" draggable append-to-body>
  24. <el-form :model="formParam" label-width="80px">
  25. <el-form-item label="部门">
  26. <el-select v-model="formParam.deptid" placeholder="请选择部门" filterable>
  27. <el-option v-for="(col, index) in deptEnum" :key="index" :label="col.label" :value="col.value"></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item label="地区">
  31. <el-select v-model="formParam.area">
  32. <el-option label="维持原状" value="维持原状" />
  33. <el-option label="普通地区" value="普通地区" />
  34. <el-option label="特定地区" value="特定地区" />
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="柜型">
  38. <el-select v-model="formParam.cabinet_type">
  39. <el-option label="维持原状" value="维持原状" />
  40. <el-option label="大柜" value="大柜" />
  41. <el-option label="小柜" value="小柜" />
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="压包数量" v-if="formParam.packtype == 0">
  45. <el-input-number v-model="formParam.packqty" :min="0" :max="1000" />
  46. </el-form-item>
  47. <el-form-item label="复制到">
  48. <el-select v-model="formParam.createby" :placeholder="userInfo.username" filterable clearable>
  49. <el-option v-for="(col, index) in userListData" :key="index" :label="col.username" :value="col.username"></el-option>
  50. </el-select>
  51. </el-form-item>
  52. </el-form>
  53. <template #footer>
  54. <div class="dialog-footer">
  55. <el-button @click="dialogFormVisible = false">取消</el-button>
  56. <el-button type="primary" :loading="loadingBtn" @click="BatchCopyMattressAudited">确认</el-button>
  57. </div>
  58. </template>
  59. </el-dialog>
  60. <LjDrawerQuoteList ref="QuoteListDrawerRef" :iforigin="isShowOriginFormulaMattress" />
  61. </template>
  62. <script setup lang="ts" name="mattressQuote">
  63. import { ref, onMounted, inject, reactive } from "vue";
  64. import { useRouter } from "vue-router";
  65. import {
  66. SaveMattressAuditing,
  67. DelMattress,
  68. CopyMattressAudited,
  69. ReCalculateNoAudit,
  70. ReCalculateERPCost,
  71. GetComputeMattressById
  72. } from "@/api/modules/quote";
  73. import { getUserList } from "@/api/modules/basicinfo";
  74. import { CommonDynamicSelect } from "@/api/modules/common";
  75. import { ColumnProps } from "@/components/LjVxeTable/interface";
  76. import LjDrawer from "@/components/LjDrawer/index.vue";
  77. // import PriceListDetail from "./detail.vue";
  78. import { useHooks } from "./hooks/index";
  79. import { useHooksCpQuote } from "./hooks/cpQuote";
  80. import LjDialog from "@/components/LjDialog/index.vue";
  81. import LjHeaderMenu from "@/components/LjHeaderMenu/index.vue";
  82. import { useI18n } from "vue-i18n";
  83. import { useAuthButtons } from "@/hooks/useAuthButtons";
  84. import { DwnameEnum } from "@/enums/dwnameEnum";
  85. import { formatToDateTime, formatToDate } from "@/utils/dateUtil";
  86. import { cloneDeep } from "lodash-es";
  87. import { useGlobalStore } from "@/stores/modules/global";
  88. import { ElMessage, ElMessageBox } from "element-plus";
  89. import { detailAction } from "@/components/LjDetail/interface";
  90. import mittBus from "@/utils/mittBus";
  91. import { MittEnum } from "@/enums/mittEnum";
  92. import { getCurrentRecords } from "@/utils/index";
  93. import { useUserStore } from "@/stores/modules/user";
  94. import LjDrawerQuoteList from "./components/QuoteListNew.vue";
  95. import { storeToRefs } from "pinia";
  96. const { t } = useI18n();
  97. const router = useRouter();
  98. const globalStore = useGlobalStore();
  99. const {
  100. vxeTableRef,
  101. columns,
  102. initParams,
  103. dataCallback,
  104. gotoErpapi,
  105. getFormulakindEnum,
  106. formulaKindEnum,
  107. fabricMxTabList,
  108. funcChaifenTabPro,
  109. getQuoteListMxData
  110. } = useHooks();
  111. const { toExcelQuote } = useHooksCpQuote();
  112. const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
  113. const { userInfo } = useUserStore();
  114. // const initParams = ref({});
  115. const dialogVisible = ref(false);
  116. // const vxeTableRef = ref();
  117. const dialogFormVisible = ref(false);
  118. const loadingBtn = ref(false);
  119. const deptEnum = ref([]);
  120. const userListData = ref([]);
  121. const QuoteListDrawerRef = ref(null);
  122. const { isShowOriginFormulaMattress } = storeToRefs(globalStore);
  123. const loadingStatus = reactive({
  124. showQd: false,
  125. download: false
  126. });
  127. const formParam = ref({
  128. deptid: 0,
  129. area: "维持原状",
  130. cabinet_type: "维持原状",
  131. packtype: 0,
  132. packqty: 0,
  133. createby: ""
  134. });
  135. const getData = (params: any) => {
  136. console.log("getData mattress params :>> ", params);
  137. let newParams: any = {};
  138. params.pageNum && (newParams.pageindex = params.pageNum);
  139. params.pageSize && (newParams.pagesize = params.pageSize);
  140. params.orderstr && (newParams.orderstr = params.orderstr);
  141. delete params.arg_mattressid;
  142. delete params.pageNum;
  143. delete params.pageSize;
  144. delete params.orderstr;
  145. let _params = cloneDeep(params);
  146. switch (_params.status_flag) {
  147. case "1": // 待下单
  148. _params.arg_xd_flag = 0;
  149. break;
  150. case "2": // 已下单
  151. _params.arg_xd_flag = 1;
  152. break;
  153. case "3": // 待财务审核
  154. _params.arg_cp_flag = 1;
  155. _params.arg_flag = 0;
  156. break;
  157. case "4": // 已财务审核
  158. _params.arg_flag = 1;
  159. break;
  160. default:
  161. break;
  162. }
  163. newParams.queryParams = _params;
  164. newParams.dsname = "web_mattress";
  165. return CommonDynamicSelect(newParams, DwnameEnum.mattressQuote);
  166. // return [];
  167. };
  168. const handleDBlClickTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }: any) => {
  169. if (globalStore.detailBlank) {
  170. // 打开新的窗口
  171. const routeUrl = router.resolve({
  172. path: `/mattressQuote/detail`,
  173. query: {
  174. id: row.mattressid,
  175. code: row.mattresscode
  176. }
  177. });
  178. window.open(routeUrl.href, "_blank");
  179. } else {
  180. // if (currentLayout.value.right.hidden && globalStore.mxFloat?.includes("custCrmDetail")) {
  181. // // 弹窗
  182. // mainData.value = row;
  183. // LjDrawerRef.value.show();
  184. // } else {
  185. // 打开新的标签页
  186. router.push(`/mattressQuote/detail?id=${row.mattressid}&code=${row.mattresscode}`);
  187. // }
  188. }
  189. };
  190. const rowClsNameFunc = (data: any) => {
  191. const { row, rowIndex, $rowIndex } = data;
  192. if (Number(row.flag) == 0) {
  193. if (Number(row.xd_flag) == 0) {
  194. return "vxecol-danger";
  195. }
  196. if (Number(row.xd_flag) == 1) {
  197. return "vxecol-blue";
  198. }
  199. }
  200. return "";
  201. };
  202. const tableProps = {
  203. height: "auto",
  204. editConfig: { trigger: "click", mode: "cell" },
  205. rowClassName: rowClsNameFunc,
  206. exportConfig: {
  207. filename: t("menu.rpMsttake") + formatToDate(new Date(), "YYYY-MM-DD HH:mm:ss")
  208. },
  209. treeConfig: {
  210. expandAll: true,
  211. transform: true,
  212. rowField: "mattressid",
  213. parentField: "parentid"
  214. },
  215. checkboxConfig: {
  216. checkStrictly: true
  217. }
  218. };
  219. // 返回绑定的事件
  220. const tableEvents = {
  221. // "checkbox-change": handleCheckboxChange,
  222. // "checkbox-all": handleCheckboxChange,
  223. // "checkbox-range-change": handleCheckboxChange,
  224. // "current-change": handleCurrentChanged
  225. "cell-dblclick": handleDBlClickTable
  226. // "cell-click": handleClickTable
  227. };
  228. onMounted(() => {
  229. dialogVisible.value = true;
  230. getFormulakindEnum();
  231. });
  232. /**
  233. * @description 业务下单或财务审核操作
  234. * @param params 对象,入参
  235. */
  236. const toAuditing = (params: any, message: string) => {
  237. const { curRecords } = getCurrentRecords(vxeTableRef.value);
  238. console.log("curRecords :>> ", curRecords);
  239. if (!curRecords.length) {
  240. ElMessage.warning(t("business.tips.mattress.records"));
  241. return;
  242. }
  243. curRecords.map(o => {
  244. if (params.hasOwnProperty("xd_flag")) {
  245. if (o.yw_flag == 1) {
  246. ElMessage.warning("已业务补充审核,无法修改");
  247. return;
  248. }
  249. }
  250. });
  251. let _mattressids = curRecords.map((item: any) => Number(item.mattressid));
  252. ElMessageBox.confirm(`是否确定要对${curRecords.length}张床垫报价单进行操作`, "询问", {
  253. confirmButtonText: message,
  254. cancelButtonText: "否",
  255. type: "warning"
  256. })
  257. .then(() => {
  258. let _params = {
  259. ...params,
  260. mattressids: _mattressids
  261. };
  262. SaveMattressAuditing(_params).then(() => {
  263. ElMessage.success(t("sys.api.operationSuccess"));
  264. vxeTableRef.value.refresh();
  265. });
  266. })
  267. .catch((e: TypeError) => {
  268. ElMessage({
  269. type: "info",
  270. message: "操作取消"
  271. });
  272. });
  273. };
  274. /**
  275. * @description 按钮展示
  276. */
  277. const action: detailAction[] = [
  278. buttonDefault({
  279. label: t("common.redo"),
  280. clickFunc: item => {
  281. vxeTableRef.value.refresh();
  282. }
  283. }),
  284. buttonDefault({
  285. label: t("common.add"),
  286. power: 72,
  287. clickFunc: item => {
  288. console.log("inewss nitParams.value :>> ", vxeTableRef.value.searchParam);
  289. let _deptid = 0;
  290. if (Object.keys(vxeTableRef.value.searchParam).includes("arg_deptid")) {
  291. _deptid = vxeTableRef.value.searchParam.arg_deptid ?? 0;
  292. }
  293. if (_deptid == 0) {
  294. let enumMap = vxeTableRef.value.enumMap;
  295. let enumdata = enumMap.get("deptid");
  296. if (enumdata && enumdata.length > 0) {
  297. _deptid = enumdata[0].value;
  298. }
  299. }
  300. router.push(`/mattressQuote/new?id=0&deptid=${_deptid}`);
  301. }
  302. }),
  303. buttonDefault({
  304. label: t("common.editText"),
  305. power: 72,
  306. clickFunc: item => {
  307. const { $table, curRecords } = getCurrentRecords(vxeTableRef.value);
  308. if (!curRecords.length) {
  309. ElMessage.warning(t("business.tips.mattress.records"));
  310. return;
  311. }
  312. const _cur = curRecords[curRecords.length - 1];
  313. console.log("修改 _cur :>> ", _cur);
  314. if (_cur.parentid > 0) {
  315. ElMessage.warning("副规格无法编辑");
  316. return;
  317. }
  318. if (_cur.xd_flag == 1) {
  319. ElMessage.warning("已业务下单,不能修改");
  320. return;
  321. }
  322. if (_cur.flag == 1) {
  323. ElMessage.warning("单据已财核,不能修改");
  324. return;
  325. }
  326. router.push(`/mattressQuote/edit?id=${_cur.mattressid}&code=${_cur.mattresscode}`);
  327. }
  328. }),
  329. buttonDefault({
  330. label: t("common.delText"),
  331. power: 77,
  332. disabledTextCallBack: (data: any) => {
  333. if (!CheckPower(77)) {
  334. return "你没有【报价单-删除】的使用权限";
  335. }
  336. return "";
  337. },
  338. clickFunc: item => {
  339. const { curRecords } = getCurrentRecords(vxeTableRef.value);
  340. console.log("curRecords :>> ", curRecords);
  341. if (!curRecords.length) {
  342. ElMessage.warning(t("business.tips.mattress.records"));
  343. return;
  344. }
  345. try {
  346. curRecords.map(item => {
  347. if (item.createby !== userInfo.username && userInfo.empid != 0) {
  348. throw new Error("只能删除自己创建的报价单");
  349. }
  350. if (item.xd_flag == 1) {
  351. throw new Error("已业务下单,不能删除");
  352. }
  353. if (item.flag == 1) {
  354. throw new Error("单据已财核,不能删除");
  355. }
  356. });
  357. } catch (error) {
  358. ElMessage.error(error.message);
  359. return false;
  360. }
  361. let _mattressids = curRecords.map((item: any) => Number(item.mattressid));
  362. ElMessageBox.confirm(`是否确定要删除${curRecords.length}张床垫报价单(及其副规格报价单)吗?`, "询问", {
  363. confirmButtonText: t("common.delText"),
  364. cancelButtonText: "否",
  365. type: "warning"
  366. })
  367. .then(() => {
  368. DelMattress({ mattressids: _mattressids }).then(() => {
  369. ElMessage.success("删除成功!");
  370. vxeTableRef.value.refresh();
  371. });
  372. })
  373. .catch((e: TypeError) => {
  374. console.log("e :>> ", e);
  375. ElMessage({
  376. type: "info",
  377. message: "操作取消"
  378. });
  379. });
  380. }
  381. }),
  382. buttonDefault({
  383. label: t("common.copyQuote"),
  384. power: 75,
  385. clickFunc: item => {
  386. const { $table, curRecords } = getCurrentRecords(vxeTableRef.value);
  387. if (!curRecords.length) {
  388. ElMessage.warning(t("business.tips.mattress.records"));
  389. return;
  390. }
  391. let _cur = $table.getCurrentRecord() ?? null;
  392. if (!_cur) {
  393. _cur = curRecords[curRecords.length - 1];
  394. }
  395. router.push(`/mattressQuote/copy?id=${_cur.mattressid}&code=${_cur.mattresscode}`);
  396. }
  397. }),
  398. // [
  399. buttonDefault({
  400. label: t("common.businessOrder"),
  401. power: 94,
  402. clickFunc: item => {
  403. toAuditing({ xd_flag: 1 }, t("common.businessOrder"));
  404. }
  405. }),
  406. buttonDefault({
  407. label: t("common.businessOrderCancel"),
  408. power: 95,
  409. clickFunc: item => {
  410. toAuditing({ xd_flag: 0 }, t("common.businessOrderCancel"));
  411. }
  412. }),
  413. // ],
  414. // [
  415. buttonDefault({
  416. label: t("common.auditFinance"),
  417. power: 73,
  418. clickFunc: item => {
  419. toAuditing({ flag: 1 }, t("common.auditFinance"));
  420. }
  421. }),
  422. buttonDefault({
  423. label: t("common.withdrawAuditFinance"),
  424. power: 74,
  425. clickFunc: item => {
  426. toAuditing({ flag: 0 }, t("common.withdrawAuditFinance"));
  427. }
  428. }),
  429. // ],
  430. buttonDefault({
  431. label: t("common.copyFromMulitFlag"),
  432. power: 75,
  433. clickFunc: async item => {
  434. const { curRecords } = getCurrentRecords(vxeTableRef.value);
  435. console.log("curRecords :>> ", curRecords);
  436. if (!curRecords.length) {
  437. ElMessage.warning(t("business.tips.mattress.records"));
  438. return;
  439. }
  440. await openDeptChoosen(curRecords);
  441. }
  442. }),
  443. buttonDefault({
  444. label: t("common.recalculateFromNotFlag"),
  445. power: 72,
  446. clickFunc: item => {
  447. const { curRecords } = getCurrentRecords(vxeTableRef.value);
  448. console.log("curRecords :>> ", curRecords);
  449. if (!curRecords.length) {
  450. ElMessage.warning(t("business.tips.mattress.records"));
  451. return;
  452. }
  453. let list = curRecords.map((item: any) => {
  454. return { mattressid: Number(item.mattressid) };
  455. });
  456. ElMessageBox.confirm(`是否确定要批重算${curRecords.length}张床垫报价单吗?`, "询问", {
  457. confirmButtonText: t("common.okText"),
  458. cancelButtonText: "否",
  459. type: "warning"
  460. })
  461. .then(() => {
  462. ReCalculateNoAudit({ list }).then(() => {
  463. ElMessage.success("批重算成功!");
  464. vxeTableRef.value.refresh();
  465. });
  466. })
  467. .catch((e: TypeError) => {
  468. console.log("e :>> ", e);
  469. ElMessage({
  470. type: "info",
  471. message: "操作取消"
  472. });
  473. });
  474. }
  475. }),
  476. buttonDefault({
  477. label: t("common.viewHistoricalQuotes"),
  478. power: 72,
  479. clickFunc: item => {
  480. alert("功能维护中!");
  481. }
  482. }),
  483. buttonDefault({
  484. label: t("common.showQuoteList"),
  485. loading: () => loadingStatus.showQd,
  486. power: 72,
  487. clickFunc: async item => {
  488. loadingStatus.showQd = !loadingStatus.showQd;
  489. const { curRecords } = getCurrentRecords(vxeTableRef.value);
  490. console.log("curRecords :>> ", curRecords);
  491. if (!curRecords.length) {
  492. ElMessage.warning(t("business.tips.mattress.records"));
  493. return;
  494. } else if (curRecords.length > 1) {
  495. ElMessage.warning(`无法进行多单${t("common.showQuoteList")}`);
  496. return;
  497. }
  498. const res = await GetComputeMattressById({
  499. mattressid: curRecords[0].mattressid,
  500. check_original: Number(isShowOriginFormulaMattress.value)
  501. });
  502. const isQuoteListMxData = getQuoteListMxData(funcChaifenTabPro(res.mattress, res.mattressMx));
  503. let _data = {
  504. data: res.mattress,
  505. mxdata: isQuoteListMxData,
  506. enumMap: vxeTableRef.value.enumMap,
  507. fabricMx: fabricMxTabList.value,
  508. formulakindenum: formulaKindEnum.value,
  509. dannum_type: res.mattress.dannum_type,
  510. formula: res.formulas, //
  511. replace: res.replace, //
  512. formula_ori: res.formulas_origin, //
  513. formula_bednet: res.formulas_bednet, //
  514. differ: res.differ //
  515. };
  516. QuoteListDrawerRef.value.show(_data);
  517. loadingStatus.showQd = !loadingStatus.showQd;
  518. }
  519. }),
  520. buttonDefault({
  521. label: t("common.dataTransmission"),
  522. power: 72,
  523. clickFunc: item => {
  524. alert("功能维护中!");
  525. }
  526. }),
  527. buttonDefault({
  528. label: t("common.businessSupplement"),
  529. power: 72,
  530. clickFunc: item => {
  531. const { $table, curRecords } = getCurrentRecords(vxeTableRef.value);
  532. if (!curRecords.length) {
  533. ElMessage.warning(t("business.tips.mattress.records"));
  534. return;
  535. }
  536. let _cur = $table.getCurrentRecord() ?? curRecords[curRecords.length - 1];
  537. let type = 1;
  538. // router.push(`/erpapi/mattressInterface/${type}/edit?id=${_cur.mattressid}&code=${_cur.mattresscode}&type=${type}`);
  539. gotoErpapi(_cur, type);
  540. }
  541. }),
  542. buttonDefault({
  543. label: t("common.recalculateERPCost"),
  544. power: 72,
  545. clickFunc: async item => {
  546. const { curRecords } = getCurrentRecords(vxeTableRef.value);
  547. console.log("curRecords :>> ", curRecords);
  548. if (!curRecords.length) {
  549. ElMessage.warning(t("business.tips.mattress.records"));
  550. return;
  551. }
  552. let list = curRecords.map((item: any) => {
  553. return { mattressid: Number(item.mattressid) };
  554. });
  555. ElMessageBox.confirm(`是否确定要批重算${curRecords.length}张床垫报价单吗?`, "询问", {
  556. confirmButtonText: t("common.okText"),
  557. cancelButtonText: "否",
  558. type: "warning"
  559. })
  560. .then(() => {
  561. ReCalculateERPCost({ list }).then((res: any) => {
  562. ElMessage.success(res.logMsg);
  563. vxeTableRef.value.refresh();
  564. });
  565. })
  566. .catch((e: TypeError) => {
  567. ElMessage({
  568. type: "info",
  569. message: "操作取消"
  570. });
  571. });
  572. }
  573. })
  574. ];
  575. const openDeptChoosen = async curRecords => {
  576. try {
  577. // let newParams = {
  578. // dsname: "_Mapper_deptid",
  579. // queryparams: {}
  580. // };
  581. // let res = await CommonDynamicSelect(newParams);
  582. // if (res.datatable) {
  583. // deptEnum.value = res.datatable?.map((item: any) => {
  584. // return { label: item.deptname, value: item.deptid };
  585. // });
  586. // }
  587. let res = await getUserList({ simple: 1 });
  588. console.log("pricelist res :>> ", res);
  589. userListData.value = res.userList;
  590. let enumMap = vxeTableRef.value.enumMap;
  591. deptEnum.value = enumMap.get("deptid");
  592. console.log("openDeptChoosen deptEnum.value :>> ", deptEnum.value);
  593. if (deptEnum.value.length > 0) {
  594. formParam.value.deptid = curRecords[0].deptid;
  595. formParam.value.packtype = curRecords[0].packtype;
  596. formParam.value.packqty = curRecords[0].packqty;
  597. dialogFormVisible.value = true;
  598. // loadingBtn.value = false;
  599. } else {
  600. console.error("获取部门列表为空");
  601. }
  602. } catch (error) {
  603. console.error("获取部门列表失败", error);
  604. }
  605. };
  606. const BatchCopyMattressAudited = () => {
  607. const { curRecords } = getCurrentRecords(vxeTableRef.value);
  608. console.log("curRecords :>> ", curRecords);
  609. if (!curRecords.length) {
  610. ElMessage.warning(t("business.tips.mattress.records"));
  611. return;
  612. }
  613. loadingBtn.value = true;
  614. let list = curRecords.map((item: any) => {
  615. return {
  616. mattressid: Number(item.mattressid),
  617. deptid: formParam.value.deptid,
  618. area: formParam.value.area,
  619. cabinet_type: formParam.value.cabinet_type,
  620. packtype: formParam.value.packtype,
  621. packqty: formParam.value.packqty,
  622. createby: formParam.value.createby
  623. };
  624. });
  625. ElMessageBox.confirm(`是否确定要批复制${curRecords.length}张床垫报价单吗?`, "询问", {
  626. confirmButtonText: t("common.okText"),
  627. cancelButtonText: "否",
  628. type: "warning"
  629. })
  630. .then(() => {
  631. CopyMattressAudited({ list }).then(() => {
  632. ElMessage.success("批复制成功!");
  633. dialogFormVisible.value = false;
  634. vxeTableRef.value.refresh();
  635. loadingBtn.value = false;
  636. });
  637. })
  638. .catch((e: TypeError) => {
  639. console.log("e :>> ", e);
  640. ElMessage({
  641. type: "info",
  642. message: "操作取消"
  643. });
  644. loadingBtn.value = false;
  645. });
  646. };
  647. /**
  648. * @description 监听框架属性变化
  649. */
  650. mittBus.on(MittEnum.MattressList, () => {
  651. vxeTableRef.value.refresh();
  652. });
  653. </script>