detail.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. <template>
  2. <LjDetail
  3. ref="LjDetailRef"
  4. name="rpMustPayCrmDetail"
  5. v-bind="detailProps"
  6. :request-api="getData"
  7. :data-callback="dataCallback"
  8. :init-param="initParams"
  9. v-model:order-status="orderStatus"
  10. :action="!props.onlyView ? orderDefaultAction : []"
  11. @after-mounted="funcAfterMound"
  12. :if-layout-editable="false"
  13. :default-columns-value="defaultColumnsValue"
  14. >
  15. <template #headerSuffix>
  16. <Statistic :data="cmpFormulaReplace" :precision="2" @click="gotoShowFormula" />
  17. </template>
  18. <template #bednetMx>
  19. <div class="main-box flx">
  20. <div class="h-full flx-3 overflow-hidden">
  21. <LjVxeTable
  22. v-if="bednetMxData.length"
  23. ref="vxeTableMxRef"
  24. row-key="bednetmxid"
  25. table-cls="h-full"
  26. :columns="columnsMx"
  27. :data="bednetMxData"
  28. :dwname="DwnameEnum.bednetQuoteMx"
  29. :table-props="tableProps_mx"
  30. :auto-load-layout="false"
  31. :search-btn-size-extent="[]"
  32. :request-auto="false"
  33. collapseButtons
  34. >
  35. <template #tableHeader>
  36. <LjHeader class="flx-1" title="床网多网明细" />
  37. </template>
  38. </LjVxeTable>
  39. </div>
  40. <div
  41. class="flx-1 h-full overflow-hidden pl-16"
  42. style="min-width: 542px"
  43. v-if="bednetMxData.length && Number(LjDetailRef._mainData.bednettypeid) == 11 && Number(bednetMxData[0].if_part)"
  44. >
  45. <!-- v-if="bednetMxSpringData.length" -->
  46. <LjVxeTable
  47. ref="vxeTableMxSpringRef"
  48. row-key="bednetmx_partid"
  49. table-cls="h-full"
  50. :columns="columnsMxSpring"
  51. :data="bednetMxSpringData"
  52. :dwname="DwnameEnum.bednetQuoteMxSpring"
  53. :table-props="tableProps_spring"
  54. :auto-load-layout="false"
  55. :tool-button="[]"
  56. :search-btn-size-extent="[]"
  57. collapseButtons
  58. :footer-sum-attrs="['springname', 'spring_qty_length']"
  59. :request-auto="false"
  60. >
  61. <template #tableHeader>
  62. <!-- <div class="flx"> -->
  63. <LjHeader class="flx-shrink" title="多区袋装明细" />
  64. <!-- <div class="flx-1 flx-end pb-8" v-if="AreaList.length">
  65. <span class="text-secondary-text">比例设置</span>
  66. <el-select v-model="currentArea" class="pl-4 pr-4" style="width: 80px" @change="setMxSpringLength">
  67. <el-option
  68. v-for="item in AreaList"
  69. :key="item.areaname"
  70. :label="item.areaname"
  71. :value="item.areaname"
  72. ></el-option>
  73. </el-select>
  74. </div> -->
  75. <!-- </div> -->
  76. </template>
  77. </LjVxeTable>
  78. </div>
  79. </div>
  80. </template>
  81. </LjDetail>
  82. <MtrldefDialog ref="MtrldefDialogRef" v-bind="MtrldefDialogProps" />
  83. <SpringDialog ref="SpringDialogRef" v-bind="SpringDialogProps" />
  84. <AllFormula ref="AllFormulaRef" />
  85. </template>
  86. <script setup lang="ts" name="bednetQuoteDetail">
  87. import { ref, watch, reactive, inject, nextTick, computed, onMounted, getCurrentInstance } from "vue";
  88. import { DwnameEnum } from "@/enums/dwnameEnum";
  89. import LjDetail from "@/components/LjDetail/index.vue";
  90. import { DetailProp, detailAction } from "@/components/LjDetail/interface";
  91. import { useI18n } from "vue-i18n";
  92. import { useHooks } from "./hooks/index";
  93. import { useAuthButtons } from "@/hooks/useAuthButtons";
  94. import LjVxeTable from "@/components/LjVxeTable/index.vue";
  95. // import { cloneDeep } from "lodash-es";
  96. import { useRoute, useRouter } from "vue-router";
  97. import { CommonDynamicSelect, GetFormulaCompute } from "@/api/modules/common";
  98. import { SaveBedNet, AuditBedNet, DeleteBedNet } from "@/api/modules/quote";
  99. // import ToastFormula from "@/components/ToastWidget/Formula/index.vue";
  100. import { TYPE, useToast, POSITION } from "vue-toastification";
  101. import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
  102. // import { ArrowDown } from "@element-plus/icons-vue";
  103. // import { calculateFormula } from "@/utils/index";
  104. import MtrldefDialog from "@/views/system/selector/mtrldef/index.vue";
  105. import SpringDialog from "@/views/system/selector/spring/index.vue";
  106. // import LjDrawerQuoteList from "./components/QuoteList.vue";
  107. // import mittBus from "@/utils/mittBus";
  108. // import { MittEnum } from "@/enums/mittEnum";
  109. // import { getCurrentRecords } from "@/utils/index";
  110. import { useUserStore } from "@/stores/modules/user";
  111. // import { getBedNetAreaList } from "@/api/modules/basicinfo";
  112. import AllFormula from "./components/AllFormula.vue";
  113. import Statistic from "./components/Statistic.vue";
  114. interface DetailProps {
  115. deptid?: number | string;
  116. bednetid?: number;
  117. state?: string;
  118. /**
  119. * @description 床垫宽度
  120. */
  121. mattressWidth?: number;
  122. /**
  123. * @description 床垫长度
  124. */
  125. mattressLength?: number;
  126. /**
  127. * @description 床网大单类型
  128. */
  129. dannum_type?: number;
  130. /**
  131. * @description 是否只读
  132. */
  133. onlyView?: boolean;
  134. }
  135. const props = withDefaults(defineProps<DetailProps>(), {
  136. // deptid: 0,
  137. // bednetid: 0,
  138. // state: ""
  139. onlyView: false
  140. });
  141. const emit = defineEmits(["aftersave", "aftercancel"]);
  142. const { t } = useI18n();
  143. const route = useRoute();
  144. const router = useRouter();
  145. const { userInfo } = useUserStore();
  146. const {
  147. LjDetailRef,
  148. columns,
  149. columnsMx,
  150. columnsMxSpring,
  151. initParams,
  152. initParamsMx,
  153. initParamsMxSpring,
  154. orderStatus,
  155. bednetMxData,
  156. bednetMxSpringData,
  157. vxeTableMxRef,
  158. vxeTableMxSpringRef,
  159. MtrldefDialogRef,
  160. MtrldefDialogProps,
  161. SpringDialogRef,
  162. SpringDialogProps,
  163. currentArea,
  164. AreaList,
  165. dw_bednet_mx_spring,
  166. AllFormulaRef,
  167. cmpFormulas,
  168. cmpFormulaReplace,
  169. dannum_type,
  170. reload_dw2,
  171. getData,
  172. getDataMxAdd,
  173. getDataMxSpring,
  174. dataCallback,
  175. wf_cmp_cb,
  176. setMxSpringLength,
  177. gotoSummy
  178. } = useHooks(t, props);
  179. const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
  180. // const toast = useToast();
  181. // const orderStatus = ref("");
  182. // const mainData = ref([]);
  183. const tabRemove: Function = inject("tabRemove") as Function;
  184. const defaultColumnsValue = ref<any>({});
  185. /**
  186. * @description 明细表格组件基础配置
  187. */
  188. const tableProps_mx = ref({
  189. height: "auto",
  190. align: "left",
  191. // height: "",
  192. minHeight: "300px",
  193. editConfig: { trigger: "click", mode: "row", enabled: false, autoFocus: true },
  194. editRules: {
  195. bednet_height: [
  196. { required: true, message: "请输入" },
  197. {
  198. validator({ cellValue }) {
  199. if (Number(cellValue) <= 0) {
  200. return new Error("请输入正数");
  201. }
  202. }
  203. }
  204. ],
  205. spring_qty_width: [
  206. { required: true, message: "请输入" },
  207. {
  208. validator({ cellValue }) {
  209. if (Number(cellValue) <= 0) {
  210. return new Error("请输入正数");
  211. }
  212. }
  213. }
  214. ],
  215. spring_qty_length: [
  216. { required: true, message: "请输入" },
  217. {
  218. validator({ cellValue }) {
  219. if (Number(cellValue) <= 0) {
  220. return new Error("请输入正数");
  221. }
  222. }
  223. }
  224. ],
  225. springname: [
  226. {
  227. validator({ cellValue, row }) {
  228. console.log("springname cellValue :>> ", cellValue, cellValue == "", Number(row.if_part) == 0, row);
  229. if (cellValue == "" && Number(row.if_part) == 0) {
  230. return new Error("请选择弹簧");
  231. }
  232. }
  233. }
  234. ]
  235. },
  236. keyboardConfig: {
  237. isEdit: true,
  238. isArrow: true,
  239. isEnter: true,
  240. isTab: true,
  241. isDel: true,
  242. isBack: true,
  243. isEsc: true,
  244. editMethod({ $table, row, column }) {
  245. // 先清空原先的值
  246. row[column.field] = "";
  247. // 再激活编辑状态并输入新值
  248. $table.setEditCell(row, column);
  249. }
  250. },
  251. rowConfig: { isCurrent: false },
  252. mouseConfig: {
  253. selected: true
  254. }
  255. });
  256. const tableProps_spring = ref({
  257. height: "auto",
  258. align: "left",
  259. // height: "",
  260. minHeight: "300px",
  261. editConfig: { trigger: "click", mode: "row", enabled: false, autoFocus: true },
  262. editRules: {
  263. springname: [
  264. {
  265. validator({ cellValue, row }) {
  266. console.log("springname cellValue :>> ", cellValue, row);
  267. if (cellValue == "" && Number(row.spring_qty_length) > 0) {
  268. return new Error("请选择弹簧");
  269. }
  270. }
  271. }
  272. ]
  273. },
  274. keyboardConfig: {
  275. isEdit: true,
  276. isArrow: true,
  277. isEnter: true,
  278. isTab: true,
  279. isDel: true,
  280. isBack: true,
  281. isEsc: true,
  282. editMethod({ $table, row, column }) {
  283. // 先清空原先的值
  284. row[column.field] = "";
  285. // 再激活编辑状态并输入新值
  286. $table.setEditCell(row, column);
  287. }
  288. },
  289. rowConfig: { isCurrent: false },
  290. mouseConfig: {
  291. selected: true
  292. }
  293. });
  294. const detailProps = reactive<DetailProp>({
  295. dwname: DwnameEnum.bednetQuote,
  296. columns: columns,
  297. // headerstatus: ["status", "ifamt_ok"],
  298. basicDefault: {},
  299. header: {
  300. fieldNames: {
  301. code: "sptcode",
  302. codeLabel: t("table.u_spt.sptcode") + ":",
  303. name: "name"
  304. }
  305. // icon: "iconclipboard",
  306. // tabsProp: {
  307. // scrollspy: true,
  308. // sticky: true
  309. // }
  310. // floatbtn: [
  311. // {
  312. // id: "oaFlow",
  313. // originLeft: 100,
  314. // originTop: 50
  315. // }
  316. // ]
  317. },
  318. mould: [
  319. {
  320. id: "bednetMx",
  321. type: "table",
  322. label: t("business.detail.bednetMxTitle")
  323. }
  324. ]
  325. });
  326. const loadingStatus = reactive({
  327. save: false
  328. });
  329. const orderDefaultAction: detailAction[] = [
  330. buttonDefault({
  331. label: t("common.cancelText"),
  332. icon: "iconchevron-left",
  333. limited: () => {
  334. return !orderStatus.value;
  335. },
  336. clickFunc: item => {
  337. if (typeof props.bednetid != "undefined") {
  338. emit("aftercancel");
  339. } else {
  340. tabRemove(route.fullPath);
  341. if (route.path.indexOf("/new") > -1) {
  342. router.replace("/bednetQuote");
  343. } else {
  344. router.replace(
  345. `/bednetQuote/detail?id=${LjDetailRef.value._mainData.bednetid}&code=${LjDetailRef.value._mainData.bednetcode}`
  346. );
  347. }
  348. }
  349. }
  350. }),
  351. buttonNew({
  352. label: t("common.saveText"),
  353. icon: "iconsave-01",
  354. // loading: () => loadingStatus.save,
  355. limited: () => !orderStatus.value,
  356. clickFunc: async () => {
  357. console.log("save LjDetailRef.value :>> ", LjDetailRef.value);
  358. console.log("save LjDetailRef.value._mainData :>> ", LjDetailRef.value._mainData);
  359. console.log("save LjDetailRef.value.pp :>> ", LjDetailRef.value.infoParam);
  360. try {
  361. await LjDetailRef.value.toValidateForm();
  362. const $table = vxeTableMxRef.value.element;
  363. console.log("vxeTableMxRef $table :>> ", $table);
  364. if ($table) {
  365. const errMap = await $table.validate(true);
  366. console.log("vxeTableMxRef errMap :>> ", errMap);
  367. if (errMap) {
  368. // VxeUI.modal.message({ status: 'error', content: '校验不通过!' })
  369. return false;
  370. }
  371. }
  372. const $tableSpring = vxeTableMxSpringRef.value?.element;
  373. console.log("vxeTableMxRef $tableSpring :>> ", $tableSpring);
  374. if ($tableSpring) {
  375. const errMap = await $tableSpring.validate(true);
  376. console.log("vxeTableMxRef errMap :>> ", errMap);
  377. if (errMap) {
  378. // VxeUI.modal.message({ status: 'error', content: '校验不通过!' })
  379. return false;
  380. }
  381. }
  382. if (!(await wf_cmp_cb())) return;
  383. let bednet = LjDetailRef.value._mainData;
  384. let bednetMx = vxeTableMxRef.value?.element.getTableData().fullData;
  385. console.log("bednetMx :>> ", bednetMx, vxeTableMxRef.value?.element.getTableData().fullData);
  386. bednetMx[0].if_side_iron = Number(bednetMx[0].if_side_iron);
  387. bednetMx[0].if_part = Number(bednetMx[0].if_part);
  388. bednetMx[0].if_15strip = Number(bednetMx[0].if_15strip);
  389. bednetMx[0].if_pocket_around = Number(bednetMx[0].if_pocket_around);
  390. bednetMx[0].if_hard_around = Number(bednetMx[0].if_hard_around);
  391. let spring = vxeTableMxSpringRef.value?.element.getTableData().fullData ?? [];
  392. if (!["卷包", "不压不卷"].includes(bednet.packtype)) {
  393. bednet.packmtrl = "";
  394. }
  395. if (orderStatus.value == "copy") {
  396. bednet.copy_id = bednet.bednetid;
  397. }
  398. let _param_mf = {
  399. bednet,
  400. bednetMx,
  401. spring
  402. };
  403. try {
  404. console.log("综合 _param_mf :>> ", _param_mf);
  405. await SaveBedNet(_param_mf)
  406. .then(res => {
  407. ElNotification({
  408. title: "温馨提示",
  409. message: t("sys.api.sueccessToSave"),
  410. type: "success"
  411. });
  412. if (typeof props.bednetid != "undefined") {
  413. emit("aftersave", res);
  414. } else {
  415. if (res.bednet.bednetid) {
  416. tabRemove(route.fullPath);
  417. router.replace(`/bednetQuote/detail?id=${res.bednet.bednetid}`);
  418. } else {
  419. router.replace("/bednetQuote");
  420. }
  421. }
  422. setTimeout(() => {
  423. if (res.message) {
  424. ElNotification({
  425. title: "计算失败",
  426. message: res.message,
  427. type: "warning"
  428. });
  429. }
  430. }, 100);
  431. })
  432. .catch(error => {
  433. console.log("error !! :>> ", error);
  434. });
  435. } catch (error) {
  436. ElMessage.error(t("sys.api.operationFailed"));
  437. }
  438. } catch (e) {
  439. ElMessage({
  440. type: "error",
  441. message: e.message
  442. });
  443. }
  444. }
  445. }),
  446. buttonDefault({
  447. label: t("common.add"),
  448. power: 62,
  449. limited: () => {
  450. return !!orderStatus.value;
  451. },
  452. clickFunc: item => {
  453. router.push(`/bednetQuote/new?id=0&deptid=${LjDetailRef.value._mainData?.deptid ?? 0}`);
  454. }
  455. }),
  456. buttonDefault({
  457. power: 72,
  458. label: t("common.editText"),
  459. limited: () => {
  460. return !!orderStatus.value;
  461. },
  462. disabledTextCallBack: data => {
  463. if (data.flag == 1) {
  464. return "单据已审核,不能修改";
  465. }
  466. return "";
  467. },
  468. clickFunc: item => {
  469. tabRemove(route.fullPath);
  470. router.replace(`/bednetQuote/edit?id=${LjDetailRef.value._mainData.bednetid}`);
  471. }
  472. }),
  473. buttonDefault({
  474. label: t("common.delText"),
  475. power: 76,
  476. limited: () => {
  477. return !!orderStatus.value;
  478. },
  479. disabledTextCallBack: (data: any) => {
  480. if (!CheckPower(76)) {
  481. return "你没有【报价单-删除】的使用权限";
  482. }
  483. return "";
  484. },
  485. clickFunc: item => {
  486. ElMessageBox.confirm(`是否确定要删除该报价单吗?`, "询问", {
  487. confirmButtonText: t("common.delText"),
  488. cancelButtonText: "否",
  489. type: "warning"
  490. })
  491. .then(() => {
  492. let list = [LjDetailRef.value._mainData];
  493. DeleteBedNet({ list }).then(() => {
  494. ElMessage.success("删除成功!");
  495. LjDetailRef.value.refresh();
  496. });
  497. })
  498. .catch((e: TypeError) => {
  499. console.log("e :>> ", e);
  500. ElMessage({
  501. type: "info",
  502. message: "操作取消"
  503. });
  504. });
  505. }
  506. }),
  507. [
  508. buttonDefault({
  509. label: t("common.auditText"),
  510. power: 63,
  511. limited: () => {
  512. return !!orderStatus.value;
  513. },
  514. disabledTextCallBack: (data: any) => {
  515. if (!CheckPower(63)) {
  516. return `你没有【报价单-${t("common.auditText")}】的使用权限`;
  517. }
  518. return "";
  519. },
  520. clickFunc: item => {
  521. ElMessageBox.confirm("是否确定要审核单据吗?", "询问", {
  522. confirmButtonText: "是",
  523. cancelButtonText: "否",
  524. type: "warning"
  525. })
  526. .then(() => {
  527. let list = [LjDetailRef.value._mainData];
  528. AuditBedNet({ list, type: 1 }).then(() => {
  529. ElMessage.success("审核成功!");
  530. LjDetailRef.value.refresh();
  531. });
  532. })
  533. .catch((e: TypeError) => {
  534. ElMessage({
  535. type: "info",
  536. message: "操作取消"
  537. });
  538. });
  539. }
  540. }),
  541. buttonDefault({
  542. label: t("common.withdrawAuditText"),
  543. power: 64,
  544. limited: () => {
  545. return !!orderStatus.value;
  546. },
  547. disabledTextCallBack: (data: any) => {
  548. if (!CheckPower(64)) {
  549. return `你没有【报价单-${t("common.withdrawAuditText")}】的使用权限`;
  550. }
  551. return "";
  552. },
  553. clickFunc: item => {
  554. ElMessageBox.confirm("是否确定要撤审单据吗?", "询问", {
  555. confirmButtonText: "是",
  556. cancelButtonText: "否",
  557. type: "warning"
  558. })
  559. .then(() => {
  560. let list = [LjDetailRef.value._mainData];
  561. AuditBedNet({ list, type: 0 }).then(() => {
  562. ElMessage.success("撤审成功!");
  563. LjDetailRef.value.refresh();
  564. });
  565. })
  566. .catch((e: TypeError) => {
  567. ElMessage({
  568. type: "info",
  569. message: "操作取消"
  570. });
  571. });
  572. }
  573. })
  574. ],
  575. buttonDefault({
  576. label: t("common.showQuoteDetail"),
  577. limited: () => {
  578. // 业务员模式
  579. return userInfo.usermode == 1;
  580. },
  581. clickFunc: () => gotoShowFormula()
  582. }),
  583. // buttonDefault({
  584. // label: t("common.copyQuote")
  585. // }),
  586. // buttonDefault({
  587. // label: t("common.showFormula")
  588. // // clickFunc: item => gotoSummy()
  589. // }),
  590. // buttonDefault({
  591. // label: t("common.viewHistoricalQuotes"),
  592. // clickFunc: () => {
  593. // console.log("LjDetailRef.value._mainData :>> ", LjDetailRef.value._mainData);
  594. // // gotoHisprice(0, { id: LjDetailRef.value._mainData.mattressid, typeid: 1 });
  595. // }
  596. // }),
  597. buttonDefault({
  598. label: t("common.back"),
  599. limited: () => {
  600. // 业务员模式
  601. return typeof props?.bednetid != "undefined";
  602. },
  603. clickFunc: item => {
  604. router.push("/bednetQuote");
  605. }
  606. })
  607. ];
  608. onMounted(async () => {
  609. console.log("onMounted bednet route.query :>> ", route.query, props);
  610. initParams.value.arg_bednetid = Number(route.query?.id ?? 0);
  611. initParamsMx.value.arg_bednetid = Number(route.query?.id ?? 0);
  612. if (!Number(route.query?.id)) {
  613. if (route.query?.deptid) {
  614. defaultColumnsValue.value.deptid = route.query?.deptid;
  615. initParamsMx.value.arg_deptid = route.query?.deptid;
  616. }
  617. }
  618. console.log('typeof props?.bednetid != "undefined" :>> ', typeof props?.bednetid != "undefined", props);
  619. if (typeof props?.bednetid != "undefined") {
  620. // 直接读取
  621. orderStatus.value = props.state;
  622. initParams.value.arg_bednetid = props.bednetid;
  623. initParamsMx.value.arg_deptid = props?.deptid;
  624. initParamsMx.value.arg_bednetid = props.bednetid;
  625. defaultColumnsValue.value.deptid = props?.deptid;
  626. dannum_type.value = props?.dannum_type;
  627. defaultColumnsValue.value.mattress_width = props?.mattressWidth;
  628. defaultColumnsValue.value.mattress_length = props?.mattressLength;
  629. }
  630. console.log("initParams.value :>> ", initParams.value);
  631. });
  632. /**
  633. * @description 页面数据加载完成
  634. */
  635. const funcAfterMound = async (data: any) => {
  636. console.log("onMounted detail sale start!!!! :>> ", !orderStatus.value, data);
  637. // console.log("LjDetailRef.value.currentMould :>> ", LjDetailRef.value.currentMould);
  638. // console.log(
  639. // "Boolean(Number(CheckOption(sysOptionEnum.sys_option_043))) :>> ",
  640. // Boolean(Number(CheckOption(sysOptionEnum.sys_option_043)))
  641. // );
  642. // // 流转状况
  643. // if (Boolean(Number(CheckOption(sysOptionEnum.sys_option_043))) && LjDetailRef.value.currentMould.header.floatbtn) {
  644. // let _oaflowbtn = LjDetailRef.value.currentMould.header.floatbtn.find((itm: any) => itm.id == "oaFlow");
  645. // if (_oaflowbtn) {
  646. // _oaflowbtn.originLeft && (oaFlowFloadProp.value.originLeft = _oaflowbtn.originLeft);
  647. // _oaflowbtn.originTop && (oaFlowFloadProp.value.originTop = _oaflowbtn.originTop);
  648. // }
  649. // oaFlowFloadProp.value.change = LjDetailRef.value.toSetFloatBtnChange;
  650. // if (!ALLOW_EDIT_STATE.includes(orderStatus.value)) {
  651. // // 非新增、修改时执行
  652. // getOaFlowList(initParams.value.scid, initParams.value.taskid).then(() => {
  653. // if (oaFlowList.value.length) {
  654. // gotoSummy();
  655. // }
  656. // });
  657. // }
  658. // }
  659. // if (ALLOW_EDIT_STATE.includes(orderStatus.value)) {
  660. // saleTaskMx_tableProps.value.editConfig.enabled = true;
  661. // }
  662. // if (orderStatus.value == "new") {
  663. // nextTick(async () => {
  664. // console.log("SaletaskmxListRef.value onmound new:>> ", SaletaskmxListRef.value);
  665. // if (SaletaskmxListRef.value) {
  666. // const $table = SaletaskmxListRef.value.element;
  667. // if ($table) {
  668. // const record = {};
  669. // const { row: newRow } = await $table.insertAt(record, null);
  670. // await $table.setEditCell(newRow, "mtrlcode");
  671. // console.log("onMounted saletask finish :>> ", $table);
  672. // }
  673. // }
  674. // });
  675. // }
  676. if (!orderStatus.value) {
  677. // 详情页
  678. } else {
  679. // 新增/编辑
  680. tableProps_mx.value.editConfig.enabled = true;
  681. tableProps_spring.value.editConfig.enabled = true;
  682. // let res = await getBedNetAreaList({});
  683. // if (res.datatable.length) {
  684. // AreaList.value = res.datatable;
  685. // }
  686. }
  687. // ifAfterMound.value = true;
  688. console.log(
  689. "onMounted detail sale start LjDetailRef.value.mainData :>> ",
  690. // AreaList.value,
  691. tableProps_mx.value,
  692. LjDetailRef.value
  693. );
  694. if (orderStatus.value != "new") {
  695. console.log("reload_dw2 data :>> ", data);
  696. await reload_dw2(data, (params: any) => {
  697. const { mx, spring } = params;
  698. console.log("reload_dw2 22result :>> ", params);
  699. bednetMxData.value = mx.list;
  700. bednetMxSpringData.value = spring.list;
  701. });
  702. nextTick(() => {
  703. gotoSummy(8000);
  704. });
  705. }
  706. };
  707. const gotoShowFormula = () => {
  708. AllFormulaRef.value.open(cmpFormulas.value, cmpFormulaReplace.value);
  709. };
  710. </script>