detail.vue 23 KB

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