detailsPop.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912
  1. <template>
  2. <div>
  3. <el-drawer
  4. title=""
  5. :visible.sync="drawer"
  6. :custom-class="isFullscreen ? 'not-fullscreen' : 'is-fullscreen'"
  7. :before-close="handleClose"
  8. :with-header="false"
  9. :append-to-body="true"
  10. >
  11. <!-- 自定义头部 -->
  12. <div class="custom-drawer-header" v-if="!isWt">
  13. <div class="radio_box rx-cc">
  14. <el-radio-group
  15. size="small"
  16. v-model="currentNodeData.bomType"
  17. @change="bomChange"
  18. >
  19. <el-radio-button
  20. :label="4"
  21. v-permissionccc="['main:bomcategory:ebom']"
  22. >EBOM
  23. </el-radio-button>
  24. <el-radio-button :label="1">PBOM </el-radio-button>
  25. <!-- v-if="
  26. searchObj.isProduct ||
  27. [1, 9].includes(searchObj.rootPathIdParent)
  28. " -->
  29. <el-radio-button
  30. :label="2"
  31. v-permissionccc="['main:bomcategory:mbom']"
  32. >MBOM
  33. </el-radio-button>
  34. <el-radio-button
  35. :label="3"
  36. v-permissionccc="['main:bomcategory:abom']"
  37. >ABOM
  38. </el-radio-button>
  39. </el-radio-group>
  40. <div style="margin-left: 100px">
  41. <el-button
  42. type="primary"
  43. size="mini"
  44. icon="el-icon-plus"
  45. @click="handleAdd"
  46. v-if="
  47. $hasPermission('main:categoryparam:saveBom') &&
  48. currentNodeData.bomType == 1 &&
  49. (currentNodeData.parentId == '0' || !currentNodeData.parentId)
  50. "
  51. >
  52. 新建
  53. </el-button>
  54. <el-button
  55. type="danger"
  56. size="mini"
  57. icon="el-icon-delete"
  58. @click="remove"
  59. v-if="
  60. (currentNodeData.approvalStatus == 0 ||
  61. currentNodeData.approvalStatus == 3) &&
  62. $hasPermission('main:categoryparam:deleteBom') &&
  63. (currentNodeData.parentId == '0' || !currentNodeData.parentId)
  64. "
  65. >
  66. 删除
  67. </el-button>
  68. <el-button
  69. v-if="
  70. currentNodeData.bomType == 1 &&
  71. (currentNodeData.parentId == '0' || !currentNodeData.parentId)
  72. "
  73. type="primary"
  74. size="mini"
  75. icon="el-icon-download"
  76. plain
  77. >导出</el-button
  78. >
  79. <el-button
  80. @click="uploadFile"
  81. v-if="
  82. currentNodeData.bomType == 1 &&
  83. (currentNodeData.parentId == '0' || !currentNodeData.parentId)
  84. "
  85. type="primary"
  86. size="mini"
  87. icon="el-icon-upload2"
  88. plain
  89. >导入</el-button
  90. >
  91. <el-button
  92. type="primary"
  93. size="mini"
  94. icon="el-icon-refresh"
  95. plain
  96. @click="transformation('P')"
  97. :disabled="currentNodeData.approvalStatus != 2"
  98. v-if="
  99. currentNodeData.bomType == 4 &&
  100. (currentNodeData.parentId == '0' || !currentNodeData.parentId)
  101. "
  102. >转换PBOM</el-button
  103. >
  104. <el-button
  105. type="primary"
  106. size="mini"
  107. icon="el-icon-refresh"
  108. plain
  109. :disabled="currentNodeData.approvalStatus != 2"
  110. @click="transformation('E')"
  111. v-if="
  112. currentNodeData.bomType == 1 &&
  113. (currentNodeData.parentId == '0' || !currentNodeData.parentId)
  114. "
  115. >转换EBOM</el-button
  116. >
  117. <el-button
  118. type="primary"
  119. size="mini"
  120. icon="el-icon-refresh"
  121. plain
  122. :disabled="currentNodeData.approvalStatus != 2"
  123. @click="transformation('M')"
  124. v-if="
  125. currentNodeData.bomType == 1 &&
  126. (searchObj.isProduct ||
  127. ['1', '9'].includes(searchObj.rootPathIdParent)) &&
  128. (currentNodeData.parentId == '0' || !currentNodeData.parentId)
  129. "
  130. >转换MBOM</el-button
  131. >
  132. <el-button
  133. type="primary"
  134. size="mini"
  135. icon="el-icon-refresh"
  136. plain
  137. :disabled="currentNodeData.approvalStatus != 2"
  138. @click="transformation('A')"
  139. v-if="
  140. currentNodeData.bomType == 1 &&
  141. (searchObj.isProduct ||
  142. ['1', '9'].includes(searchObj.rootPathIdParent)) &&
  143. (currentNodeData.parentId == '0' || !currentNodeData.parentId)
  144. "
  145. >转换ABOM</el-button
  146. >
  147. <el-button
  148. type="primary"
  149. size="mini"
  150. @click="handSubmit"
  151. v-if="
  152. (currentNodeData.approvalStatus == 0 ||
  153. currentNodeData.approvalStatus == 3) &&
  154. (currentNodeData.parentId == '0' || !currentNodeData.parentId)
  155. "
  156. >
  157. 提交发布
  158. </el-button>
  159. <el-button
  160. type="primary"
  161. size="mini"
  162. @click="handleRefresh"
  163. v-if="currentNodeData.approvalStatus != 1"
  164. >
  165. 刷新
  166. </el-button>
  167. </div>
  168. </div>
  169. <div>
  170. <el-button
  171. type="text"
  172. @click="handleDetails()"
  173. v-if="isNotData && currentNodeData.approvalStatus == 1"
  174. :underline="false"
  175. >
  176. {{ approvalStatusOpt[+currentNodeData.approvalStatus] }}
  177. </el-button>
  178. <el-button
  179. type="text"
  180. style="color: #f56c6c"
  181. v-if="isNotData && currentNodeData.approvalStatus == 3"
  182. :underline="false"
  183. >
  184. {{ approvalStatusOpt[+currentNodeData.approvalStatus] }}
  185. </el-button>
  186. <el-button
  187. icon="el-icon-full-screen"
  188. type="text"
  189. @click="handleFull"
  190. >{{ isFullscreen ? '全屏' : '缩小' }}</el-button
  191. >
  192. <el-button
  193. icon="el-icon-circle-close"
  194. type="text"
  195. @click="handleClose"
  196. >关闭</el-button
  197. >
  198. </div>
  199. </div>
  200. <!-- 抽屉内容 -->
  201. <div class="drawer_content">
  202. <ele-split-layout
  203. width="260px"
  204. allow-collapse
  205. :resizable="true"
  206. :min-size="200"
  207. :max-size="-200"
  208. :left-style="{
  209. overflow: 'hidden',
  210. width: '100%'
  211. }"
  212. :right-style="{ overflow: 'hidden' }"
  213. :responsive="false"
  214. >
  215. <!-- // tree 组件 -->
  216. <div class="ele-border-lighter sys-organization-list">
  217. <div>
  218. 版本号: &nbsp; &nbsp;
  219. <el-select
  220. size="mini"
  221. style="width: 70%; margin: 6px 0"
  222. v-model="searchObj.versions"
  223. placeholder="请选择bom版本"
  224. @change="getTreeData"
  225. :disabled="isWt"
  226. >
  227. <el-option
  228. v-for="item in versList"
  229. :label="'V' + item.versions + '.0'"
  230. :value="item.versions"
  231. :key="item.id"
  232. >
  233. </el-option>
  234. </el-select>
  235. <br />
  236. 属性类型:
  237. <el-select
  238. size="mini"
  239. style="width: 70%; margin: 6px 0"
  240. v-model="searchObj.componentAttribute"
  241. filterable
  242. multiple
  243. placeholder="请选择属性类型"
  244. @change="getTreeData"
  245. :disabled="isWt"
  246. >
  247. <el-option
  248. v-for="item in sxtList"
  249. :key="item.value"
  250. :value="item.value"
  251. :label="item.label"
  252. ></el-option>
  253. </el-select>
  254. </div>
  255. <el-tree
  256. class="treeData"
  257. :data="treeList"
  258. :expand-on-click-node="false"
  259. :props="defaultProps"
  260. ref="treeRef"
  261. :default-expanded-keys="current && current.id ? [current.id] : []"
  262. :highlight-current="true"
  263. node-key="id"
  264. @node-click="handleNodeClick"
  265. >
  266. <span class="custom-tree-node" slot-scope="{ node, data }">
  267. {{ data.categoryCode }} / {{ node.label }}
  268. </span>
  269. </el-tree>
  270. </div>
  271. <template v-slot:content v-if="isNotData">
  272. <!-- 基本信息 -->
  273. <baseInfo
  274. :dataInfo="currentNodeData"
  275. @getNewBomData="getNewBomData"
  276. />
  277. <!-- table -->
  278. <el-tabs
  279. v-model="activeName"
  280. class="tab-box"
  281. type="border-card"
  282. @tab-click="handleClick"
  283. >
  284. <el-tab-pane label="属性" name="属性">
  285. <attribute
  286. :attributeData="currentNodeData"
  287. :isWt="isWt"
  288. ></attribute>
  289. </el-tab-pane>
  290. <el-tab-pane
  291. :label="
  292. currentNodeData.bomType == 1
  293. ? 'PBOM明细表'
  294. : currentNodeData.bomType == 2
  295. ? 'MBOM明细表'
  296. : currentNodeData.bomType == 3
  297. ? 'ABOM明细表'
  298. : 'EBOM明细表'
  299. "
  300. name="明细表"
  301. >
  302. <detailedList
  303. v-if="activeName == '明细表'"
  304. :isTemp="searchObj.isTemp"
  305. :attributeData="currentNodeData"
  306. :treeId="treeId"
  307. :isWt="isWt"
  308. ></detailedList>
  309. </el-tab-pane>
  310. <el-tab-pane
  311. label="工艺路线"
  312. name="工艺路线"
  313. v-if="currentNodeData.bomType != 4"
  314. >
  315. <routing
  316. v-if="activeName == '工艺路线'"
  317. ref="routingRef"
  318. :isWt="isWt"
  319. :attributeData="currentNodeData"
  320. :taskParam="currentNodeData"
  321. :resourceBomId="resourceBomId"
  322. ></routing>
  323. </el-tab-pane>
  324. <el-tab-pane
  325. label="工序配置"
  326. name="工序配置"
  327. v-if="currentNodeData.bomType != 4"
  328. >
  329. <!-- && (searchObj.isProduct ||
  330. [1, 9].includes(searchObj.rootPathIdParent)) -->
  331. <workmanship
  332. v-if="activeName == '工序配置'"
  333. ref="workmanshipRef"
  334. :attributeData="currentNodeData"
  335. :taskParam="currentNodeData"
  336. :resourceBomId="resourceBomId"
  337. ></workmanship>
  338. </el-tab-pane>
  339. </el-tabs>
  340. </template>
  341. <template v-slot:content v-else>
  342. <el-empty
  343. :image-size="200"
  344. :description="
  345. currentNodeData.bomType == 1
  346. ? 'PBOM 暂无数据,请先新建'
  347. : currentNodeData.bomType == 2
  348. ? 'MBOM 暂无数据,请先新建'
  349. : currentNodeData.bomType == 3
  350. ? 'ABOM 暂无数据,请先新建'
  351. : 'EBOM 暂无数据,请先新建'
  352. "
  353. ></el-empty>
  354. </template>
  355. </ele-split-layout>
  356. </div>
  357. </el-drawer>
  358. <baseInfoSave
  359. v-if="baseInfoShow"
  360. @close="baseClose"
  361. :categoryObj="currentNodeData"
  362. :categoryId="searchObj.categoryId"
  363. :categoryName="searchObj.categoryName"
  364. ></baseInfoSave>
  365. <importDialog
  366. :defModule="moudleName"
  367. ref="importDialogRef"
  368. @success="getTreeData"
  369. />
  370. <el-dialog
  371. title="发布"
  372. :visible.sync="isSubmit"
  373. v-if="isSubmit"
  374. width="30%"
  375. center
  376. >
  377. <div>
  378. <el-radio v-model="radioSubmit" :label="1">药品</el-radio>
  379. <el-radio v-model="radioSubmit" :label="2">器械</el-radio>
  380. </div>
  381. <span slot="footer" class="dialog-footer">
  382. <el-button @click="isSubmit = false">取 消</el-button>
  383. <el-button type="primary" @click="handJsSubmit()">确 定</el-button>
  384. </span>
  385. </el-dialog>
  386. <LCdetail ref="detailRef"></LCdetail>
  387. </div>
  388. </template>
  389. <script>
  390. import {
  391. getBomTreeList,
  392. versionList,
  393. getBomGetById,
  394. convert,
  395. convertABom,
  396. convertEBOM,
  397. convertEBomToPBOM,
  398. deleteBomTreeList,
  399. bomSubmit,
  400. jsBomSubmit,
  401. deviceBomSubmit,
  402. hasNewVersion
  403. } from '@/api/material/BOM.js';
  404. import baseInfo from './components/baseInfo.vue';
  405. import baseInfoSave from './components/baseInfoSave.vue';
  406. import attribute from './components/attribute.vue';
  407. import detailedList from './components/detailedList.vue';
  408. import importDialog from './qualityTesting/import-dialog.vue';
  409. import LCdetail from './components/LCdetail.vue';
  410. import routing from './components/routing.vue';
  411. import workmanship from './components/workmanship.vue';
  412. export default {
  413. name: 'bomDetailsPop',
  414. components: {
  415. baseInfo,
  416. baseInfoSave,
  417. attribute,
  418. detailedList,
  419. importDialog,
  420. LCdetail,
  421. routing,
  422. workmanship
  423. },
  424. data() {
  425. return {
  426. drawer: false,
  427. isFullscreen: true,
  428. resourceBomId: '',
  429. currentNodeData: {
  430. bomType: 1,
  431. children: [],
  432. parentId: ''
  433. },
  434. current: {},
  435. treeList: [],
  436. versList: [],
  437. treeLoading: false,
  438. defaultProps: {
  439. children: 'children',
  440. label: 'name'
  441. },
  442. searchObj: {
  443. versions: '',
  444. categoryId: '',
  445. isProduct: false,
  446. componentAttribute: [],
  447. isTemp: 0
  448. },
  449. activeName: '属性',
  450. baseInfoShow: false,
  451. isNotData: true,
  452. moudleName: 'mainUser',
  453. isSubmit: false,
  454. radioSubmit: 1,
  455. treeId: null,
  456. approvalStatusOpt: {
  457. 0: '未提交',
  458. 1: '审核中',
  459. 2: '审核通过',
  460. 3: '审核不通过'
  461. },
  462. sxtList: [
  463. {
  464. label: '自制件',
  465. value: 1
  466. },
  467. {
  468. label: '采购件',
  469. value: 2
  470. },
  471. {
  472. label: '外协件',
  473. value: 3
  474. },
  475. {
  476. label: '受托件',
  477. value: 4
  478. }
  479. ],
  480. isWt: false
  481. };
  482. },
  483. computed: {
  484. clientEnvironmentId() {
  485. return this.$store.state.user.info.clientEnvironmentId;
  486. }
  487. },
  488. methods: {
  489. open(row) {
  490. this.searchObj = row;
  491. console.log(row, 'rowrowrowrowrow');
  492. if (Object.prototype.hasOwnProperty.call(row, 'isWt') && row.isWt) {
  493. this.isWt = row.isWt;
  494. this.isFullscreen = false;
  495. }
  496. if (Object.prototype.hasOwnProperty.call(row, 'bomType')) {
  497. this.currentNodeData.bomType = row.bomType;
  498. }
  499. this.drawer = true;
  500. if (
  501. this.currentNodeData.bomType == 2 ||
  502. this.currentNodeData.bomType == 3
  503. ) {
  504. this.searchObj.componentAttribute = [1];
  505. } else {
  506. this.searchObj.componentAttribute = [];
  507. }
  508. this.getTreeData();
  509. this.getVersion();
  510. },
  511. handleClose() {
  512. this.searchObj = {
  513. versions: '',
  514. categoryId: '',
  515. componentAttribute: [],
  516. isProduct: false,
  517. isTemp: 0
  518. };
  519. this.activeName = '属性';
  520. this.drawer = false;
  521. },
  522. getNewBomData(data) {
  523. let rowData = {
  524. categoryId: data.categoryId,
  525. categoryName: data.name,
  526. code: data.code,
  527. versions: data.resourceBomVersion,
  528. rootPathIdParent: data.categoryLevelPathIdParent,
  529. isProduct: true,
  530. bomType: Number(data.bomType),
  531. isTemp: data.isTemp
  532. };
  533. this.open(rowData);
  534. },
  535. handleFull() {
  536. this.isFullscreen = !this.isFullscreen;
  537. this.$forceUpdate();
  538. },
  539. bomChange(e) {
  540. this.searchObj.versions = '';
  541. this.searchObj.componentAttribute = [];
  542. this.currentNodeData.bomType = e;
  543. if (
  544. this.currentNodeData.bomType == 2 ||
  545. this.currentNodeData.bomType == 3
  546. ) {
  547. this.searchObj.componentAttribute = [1];
  548. } else {
  549. this.searchObj.componentAttribute = [];
  550. }
  551. this.getTreeData();
  552. this.getVersion();
  553. },
  554. async getTreeData() {
  555. try {
  556. this.treeLoading = true;
  557. let componentAttribute = '';
  558. console.log(this.searchObj.componentAttribute);
  559. if (
  560. this.searchObj.componentAttribute &&
  561. this.searchObj.componentAttribute.length != 0
  562. ) {
  563. componentAttribute = this.searchObj.componentAttribute.join(',');
  564. }
  565. const res = await getBomTreeList({
  566. categoryId: this.searchObj.categoryId,
  567. versions: this.searchObj.versions,
  568. bomType: this.currentNodeData.bomType,
  569. isTemp: this.searchObj.isTemp || 0,
  570. componentAttribute
  571. });
  572. this.treeLoading = false;
  573. if (res?.code === '0') {
  574. if (res.data?.length > 0) {
  575. this.treeList = res.data;
  576. this.$nextTick(() => {
  577. this.isNotData = true;
  578. // 默认高亮第一个
  579. this.$refs.treeRef.setCurrentKey(res.data[0].id);
  580. this.handleNodeClick(res.data[0]);
  581. });
  582. } else {
  583. this.isNotData = false;
  584. this.treeList = [];
  585. }
  586. return this.treeList;
  587. }
  588. } catch (error) {
  589. console.log(error);
  590. }
  591. this.treeLoading = false;
  592. },
  593. handleNodeClick(data) {
  594. this.treeId = data.id;
  595. this.resourceBomId =
  596. data.parentId != 0 ? data.resourceBomId || data.id : data.id;
  597. this.handBomDetails(this.treeId);
  598. },
  599. handBomDetails(id) {
  600. if (id) {
  601. getBomGetById(id).then((res) => {
  602. res.data.attributeType = res.data.category.attributeType;
  603. this.currentNodeData = res.data;
  604. this.searchObj.versions = this.currentNodeData.versions;
  605. this.$forceUpdate();
  606. console.log(this.currentNodeData, 'this.currentNodeData');
  607. });
  608. } else {
  609. this.currentNodeData = {
  610. bomType: 1,
  611. children: []
  612. };
  613. }
  614. },
  615. getVersion(type) {
  616. let param = {
  617. categoryId: this.searchObj.categoryId,
  618. bomType: this.currentNodeData.bomType,
  619. isTemp: this.searchObj.isTemp || 0
  620. };
  621. versionList(param).then((res) => {
  622. this.versList = res || [];
  623. if (type == 'del' || type == 'add') {
  624. if (this.versList.length >= 1) {
  625. this.searchObj.versions =
  626. this.versList[this.versList.length - 1].versions;
  627. } else {
  628. this.searchObj.versions = '';
  629. }
  630. this.getTreeData();
  631. }
  632. });
  633. },
  634. handleClick(tab) {},
  635. remove() {
  636. if (this.currentNodeData.status == 1) {
  637. return this.$message.warning('已发布版本不能删除');
  638. }
  639. this.$confirm('是否确认删除?', '提示', {
  640. confirmButtonText: '确定',
  641. cancelButtonText: '取消',
  642. type: 'warning'
  643. })
  644. .then(() => {
  645. deleteBomTreeList([this.currentNodeData.id]).then((msg) => {
  646. this.$message.success('删除' + msg);
  647. this.getVersion('del');
  648. });
  649. })
  650. .finally(() => {});
  651. },
  652. async transformation(tt) {
  653. if (this.currentNodeData.status != 1) {
  654. return this.$message.warning('只有已发布版本才可以转换');
  655. }
  656. let _type = tt == 'P' ? 1 : tt == 'M' ? 2 : tt == 'A' ? 3 : 4;
  657. if (!this.isEdit) {
  658. let isHas = await this.hasVersionFn(_type);
  659. if (!isHas) return;
  660. }
  661. this.loadingInstance = this.$loading({
  662. lock: true,
  663. text: '转换中...',
  664. background: 'rgba(0, 0, 0, 0.7)'
  665. });
  666. let ULR =
  667. tt == 'M'
  668. ? convert
  669. : tt == 'A'
  670. ? convertABom
  671. : tt == 'E'
  672. ? convertEBOM
  673. : tt == 'P'
  674. ? convertEBomToPBOM
  675. : '';
  676. ULR({
  677. versions: this.searchObj.versions,
  678. categoryId: this.searchObj.categoryId
  679. })
  680. .then((data) => {
  681. if (data.code == '0') {
  682. this.loadingInstance.close();
  683. this.$message.success('转换成功');
  684. this.currentNodeData.bomType = _type;
  685. this.searchObj.versions = '';
  686. this.getTreeData();
  687. this.getVersion();
  688. }
  689. })
  690. .catch((err) => {
  691. this.loadingInstance.close();
  692. });
  693. },
  694. handleAdd() {
  695. this.baseInfoShow = true;
  696. },
  697. baseClose(val) {
  698. if (val) {
  699. this.getVersion('add');
  700. }
  701. this.activeName = '属性';
  702. this.baseInfoShow = false;
  703. },
  704. uploadFile() {
  705. this.$refs.importDialogRef.open();
  706. },
  707. handleRefresh() {
  708. this.getTreeData();
  709. },
  710. handSubmit() {
  711. if (this.clientEnvironmentId == 5) {
  712. this.isSubmit = true;
  713. } else {
  714. this.$alert('确定要发布吗?', '提示', {
  715. confirmButtonText: '确定',
  716. cancelButtonText: '取消',
  717. type: 'warning'
  718. })
  719. .then(() => {
  720. bomSubmit({ businessId: this.currentNodeData.id }).then((res) => {
  721. if (res?.code == 0) {
  722. this.$message.success('发布成功');
  723. this.getTreeData();
  724. }
  725. });
  726. })
  727. .catch(() => {});
  728. }
  729. },
  730. handJsSubmit() {
  731. let URL = this.radioSubmit == 1 ? jsBomSubmit : deviceBomSubmit;
  732. this.$alert('确定要发布吗?', '提示', {
  733. confirmButtonText: '确定',
  734. cancelButtonText: '取消',
  735. type: 'warning'
  736. })
  737. .then(() => {
  738. URL({ businessId: this.currentNodeData.id }).then((res) => {
  739. this.isSubmit = false;
  740. this.$message.success('发布成功');
  741. this.getTreeData();
  742. });
  743. })
  744. .catch(() => {});
  745. },
  746. handleDetails() {
  747. if (!this.currentNodeData.processInstanceId) {
  748. this.$message.info('未提交没有审核流程');
  749. } else {
  750. this.$refs.detailRef.open(this.currentNodeData.processInstanceId);
  751. }
  752. },
  753. async hasVersionFn(bomType) {
  754. return new Promise((resolve) => {
  755. let param = {
  756. categoryId: this.searchObj.categoryId,
  757. bomType: bomType
  758. };
  759. hasNewVersion(param).then((res) => {
  760. if (res.data == 1) {
  761. this.$confirm('已经草稿版本存在,是否覆盖?', '提示', {
  762. confirmButtonText: '覆盖',
  763. cancelButtonText: '取消',
  764. type: 'warning'
  765. })
  766. .then(() => {
  767. resolve(true);
  768. })
  769. .catch(() => {
  770. resolve(false);
  771. });
  772. } else {
  773. resolve(true);
  774. }
  775. });
  776. });
  777. }
  778. }
  779. };
  780. </script>
  781. <style lang="scss" scoped>
  782. /* 自定义全屏样式 */
  783. ::v-deep .is-fullscreen {
  784. width: 100vw !important;
  785. height: 100vh !important;
  786. overflow: hidden !important;
  787. /* 隐藏滚动条 */
  788. }
  789. ::v-deep .not-fullscreen {
  790. width: calc(100vw - 260px) !important;
  791. height: 100vh !important;
  792. overflow: hidden !important;
  793. /* 隐藏滚动条 */
  794. }
  795. .custom-drawer-header {
  796. display: flex;
  797. justify-content: space-between;
  798. align-items: center;
  799. padding: 4px 15px;
  800. background-color: #f5f7fa;
  801. /* 自定义背景色 */
  802. border-bottom: 1px solid #ebeef5;
  803. /* 自定义边框,与抽屉内容分隔 */
  804. }
  805. .drawer_content {
  806. margin: 10px 20px;
  807. box-sizing: border-box;
  808. }
  809. .sys-organization-list {
  810. height: calc(100vh - 65px);
  811. box-sizing: border-box;
  812. border-width: 1px;
  813. border-style: solid;
  814. overflow: auto;
  815. padding: 0 10px;
  816. box-sizing: border-box;
  817. display: flex;
  818. flex-direction: column;
  819. overflow: hidden;
  820. .treeData {
  821. height: 0 1 auto;
  822. overflow-y: auto;
  823. height: calc(100vh - 125px);
  824. }
  825. }
  826. .tab-box {
  827. margin-top: 12px;
  828. }
  829. </style>