index-data.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894
  1. <template>
  2. <div>
  3. <!-- 数据表格 -->
  4. <ele-pro-table
  5. ref="table"
  6. :columns="newColumns"
  7. :datasource="datasource"
  8. :need-page="true"
  9. :selection.sync="selection"
  10. :current.sync="rowCurrent"
  11. @sort-change="onSortChange"
  12. highlight-current-row
  13. height="calc(100vh - 412px)"
  14. full-height="calc(100vh - 116px)"
  15. tool-class="ele-toolbar-form"
  16. :page-size="pageSize"
  17. :initLoad="false"
  18. @columns-change="handleColumnChange"
  19. :cache-key="cacheKeyUrl"
  20. v-if="pageShow"
  21. >
  22. <!-- 表头工具栏 -->
  23. <template v-slot:toolbar>
  24. <el-button
  25. size="small"
  26. type="primary"
  27. icon="el-icon-plus"
  28. class="ele-btn-icon"
  29. @click="openEdit({}, 2)"
  30. >
  31. 新建
  32. </el-button>
  33. <div class="upload" v-if="rootTreeId == 6">
  34. <el-upload
  35. v-if="!isLoading"
  36. :show-file-list="false"
  37. class="upload-demo"
  38. action=""
  39. :before-upload="beforeUpload"
  40. :on-success="successUpload"
  41. :on-error="errorUpload"
  42. >
  43. <slot>
  44. <el-button
  45. type="primary"
  46. size="small"
  47. plain
  48. icon="el-icon-upload2"
  49. >导入</el-button
  50. >
  51. </slot>
  52. </el-upload>
  53. <el-button
  54. v-else
  55. type="primary"
  56. size="small"
  57. icon="el-icon-upload2"
  58. plain
  59. :loading="isLoading"
  60. >导入</el-button
  61. >
  62. </div>
  63. <el-button
  64. v-else
  65. type="primary"
  66. size="small"
  67. icon="el-icon-upload2"
  68. plain
  69. @click="uploadFile"
  70. >导入</el-button
  71. >
  72. <el-button
  73. type="warning"
  74. icon="el-icon-download"
  75. size="mini"
  76. @click="handleExport"
  77. >导出</el-button
  78. >
  79. <el-button
  80. size="small"
  81. :disabled="selection.length == 0"
  82. icon="el-icon-thumb"
  83. class="ele-btn-icon"
  84. @click="moveTo()"
  85. >
  86. 设置采购员
  87. </el-button>
  88. <!-- <el-button
  89. v-if="rootTreeId == 9"
  90. size="small"
  91. type="primary"
  92. @click="handleLink('4')"
  93. >关联设备</el-button
  94. >
  95. <el-button
  96. v-if="rootTreeId == 9"
  97. size="small"
  98. type="primary"
  99. @click="handleLink('5')"
  100. >关联模具</el-button
  101. >
  102. <el-button
  103. v-if="rootTreeId == 9"
  104. size="small"
  105. type="primary"
  106. @click="handleLink('8')"
  107. >关联舟皿</el-button
  108. >
  109. <el-button
  110. v-if="rootTreeId == 4"
  111. size="small"
  112. type="primary"
  113. @click="handleLink('5')"
  114. >关联模具</el-button
  115. >
  116. <el-button
  117. v-if="rootTreeId == 4"
  118. size="small"
  119. type="primary"
  120. @click="handleLink('6')"
  121. >关联备品备件</el-button
  122. >-->
  123. </template>
  124. <template v-slot:componentAttribute="{ row }">
  125. <div>
  126. <!-- {{ }} -->
  127. {{ getDictValueFn(row.componentAttribute) }}
  128. </div>
  129. </template>
  130. <template v-slot:action="{ row }">
  131. <el-link type="primary" :underline="false" @click="openEdit(row, 1)">
  132. 复制
  133. </el-link>
  134. <el-link type="primary" :underline="false" @click="openEdit(row, 0)">
  135. 修改
  136. </el-link>
  137. <el-popconfirm
  138. class="ele-action"
  139. title="确定要删除此物料吗?"
  140. @confirm="remove(row)"
  141. >
  142. <template v-slot:reference>
  143. <el-link type="danger" :underline="false"> 删除 </el-link>
  144. </template>
  145. </el-popconfirm>
  146. <!-- <el-link
  147. type="primary"
  148. v-if="row.isProduct == 1"
  149. :underline="false"
  150. @click="openParam(row)"
  151. >
  152. 工艺参数
  153. </el-link> -->
  154. <el-link type="primary" :underline="false" @click="toBomManager(row)">
  155. BOM
  156. </el-link>
  157. <!-- <el-link
  158. type="primary"
  159. v-if="row.isProduct == 1"
  160. :underline="false"
  161. @click="openMaterial(row)"
  162. >
  163. 物料BOM
  164. </el-link> -->
  165. <!-- <el-link
  166. type="primary"
  167. v-if="row.isProduct == 1"
  168. :underline="false"
  169. @click="openMould(row)"
  170. >
  171. 模具
  172. </el-link> -->
  173. <el-link
  174. type="primary"
  175. v-if="row.categoryLevelPathIdParent == 7"
  176. :underline="false"
  177. @click="handAllocation(row)"
  178. >
  179. 货位
  180. </el-link>
  181. <el-link
  182. type="primary"
  183. v-if="row.categoryLevelPathIdParent == 11"
  184. :underline="false"
  185. @click="handleAridRegion(row)"
  186. >
  187. 干燥区
  188. </el-link>
  189. </template>
  190. </ele-pro-table>
  191. <!-- 编辑弹窗 -->
  192. <!-- <dict-edit :visible.sync="showEdit" :id="id" @done="reload" /> -->
  193. <!-- 选择物料 -->
  194. <MaterialModal
  195. :visible.sync="materialEdit"
  196. :data="current"
  197. ref="materialRefs"
  198. ></MaterialModal>
  199. <!-- 工艺参数 -->
  200. <ParamEdit
  201. :visible.sync="paramEditShow"
  202. :paramData="current"
  203. ref="paramRefs"
  204. ></ParamEdit>
  205. <!-- 模具 -->
  206. <mouldDialog
  207. :visible.sync="mouldShow"
  208. :data="current"
  209. ref="mouldRefs"
  210. ></mouldDialog>
  211. <linkMaterialDialog ref="linkMaterialDialogRef" @success="success" />
  212. <!-- 货位 -->
  213. <goodsAllocation ref="allocationRef"></goodsAllocation>
  214. <!-- 干燥区 -->
  215. <aridRegion ref="aridRegionRef"></aridRegion>
  216. <!-- 导入错误弹框 -->
  217. <el-dialog
  218. title="导入失败"
  219. :visible.sync="exportErrorDioalogVisible"
  220. width="60%"
  221. >
  222. <el-table :data="errorData" style="width: 100%">
  223. <el-table-column label="名称" prop="name"> </el-table-column>
  224. <el-table-column label="型号" prop="modeType"> </el-table-column>
  225. <el-table-column label="编号" prop="codeNo"> </el-table-column>
  226. <el-table-column label="物料组" prop="code"> </el-table-column>
  227. <el-table-column label="失败原因" prop="remark"> </el-table-column>
  228. </el-table>
  229. <span slot="footer" class="dialog-footer">
  230. <el-button @click="exportErrorDioalogVisible = false">取 消</el-button>
  231. <el-button type="primary" @click="exportErrorDioalogVisible = false"
  232. >确 定</el-button
  233. >
  234. </span>
  235. </el-dialog>
  236. <importDialog
  237. :defModule="moudleName"
  238. ref="importDialogRef"
  239. :fileUrl="'/main-data/importTemplate/产品_物品导入模板.xlsx'"
  240. fileName="产品_物品导入模板"
  241. @success="reload"
  242. />
  243. <!-- 产品管理 -->
  244. <BomDetailsPop ref="bomDrawer"></BomDetailsPop>
  245. <DialogMoveTo ref="DialogMoveToRef" @success="success"></DialogMoveTo>
  246. </div>
  247. </template>
  248. <script>
  249. import {
  250. getMaterialList,
  251. removeMaterial,
  252. importCategorySparePart,
  253. exportFile
  254. } from '@/api/material/list.js';
  255. import { getBomGetById } from '@/api/material/BOM.js';
  256. import MaterialModal from './MaterialModal.vue';
  257. import ParamEdit from '@/views/technology/productParam/components/user-edit.vue';
  258. import mouldDialog from './mouldDialog';
  259. import linkMaterialDialog from './link-material-dialog.vue';
  260. import goodsAllocation from './goodsAllocation.vue';
  261. import BomDetailsPop from '../../BOMmanage/detailsPop.vue';
  262. import dictMixins from '@/mixins/dictMixins';
  263. import aridRegion from './aridRegion';
  264. import importDialog from '@/components/upload/import-dialogNew.vue';
  265. import { fieldModel } from '@/api/codeManagement';
  266. import DialogMoveTo from './DialogMoveTo.vue';
  267. import tabMixins from '@/mixins/tableColumnsMixin';
  268. const attributeList = [
  269. {
  270. label: '总装',
  271. value: 1
  272. },
  273. {
  274. label: '部件',
  275. value: 2
  276. },
  277. {
  278. label: '零件',
  279. value: 3
  280. },
  281. {
  282. label: '原材料',
  283. value: 4
  284. }
  285. ];
  286. const measureTypeList = [
  287. {
  288. label: '数量',
  289. value: 1
  290. },
  291. {
  292. label: '重量',
  293. value: 2
  294. },
  295. {
  296. label: '体积',
  297. value: 3
  298. },
  299. {
  300. label: '容积',
  301. value: 4
  302. },
  303. {
  304. label: '面积',
  305. value: 5
  306. }
  307. ];
  308. const produceTypeList = [
  309. {
  310. label: '加工',
  311. value: 1
  312. },
  313. {
  314. label: '装配',
  315. value: 3
  316. }
  317. ];
  318. export default {
  319. mixins: [dictMixins, tabMixins],
  320. components: {
  321. importDialog,
  322. MaterialModal,
  323. ParamEdit,
  324. mouldDialog,
  325. linkMaterialDialog,
  326. goodsAllocation,
  327. aridRegion,
  328. BomDetailsPop,
  329. DialogMoveTo
  330. },
  331. props: {
  332. // 物料组id
  333. currentId: [Number, String],
  334. data: [Array, Object],
  335. rootId: [Number, String],
  336. rootTreeId: [Number, String],
  337. lyType: [String],
  338. oneProduct: Boolean,
  339. currentData: Object,
  340. //table-cacheKeyUrl
  341. cacheKeyUrl: String
  342. },
  343. data() {
  344. return {
  345. moudleName: 'mainCategory',
  346. errorData: [],
  347. exportErrorDioalogVisible: false,
  348. pagination: {
  349. total: 0
  350. },
  351. bomShow: false,
  352. whereData: {},
  353. pageShow: false,
  354. // 表格列配置
  355. columns: [
  356. {
  357. width: 45,
  358. type: 'selection',
  359. columnKey: 'selection',
  360. align: 'center'
  361. },
  362. {
  363. columnKey: 'index',
  364. type: 'index',
  365. width: 50,
  366. align: 'center',
  367. showOverflowTooltip: true,
  368. label: '序号'
  369. },
  370. {
  371. prop: 'code',
  372. label: '编码',
  373. align: 'center',
  374. showOverflowTooltip: true,
  375. sortable: true,
  376. minWidth: 110
  377. },
  378. {
  379. prop: 'name',
  380. label: '名称',
  381. align: 'center',
  382. showOverflowTooltip: true,
  383. minWidth: 110
  384. },
  385. {
  386. prop: 'categoryLevelPath',
  387. label: '分类',
  388. align: 'center',
  389. showOverflowTooltip: true
  390. },
  391. {
  392. prop: 'brandNum',
  393. align: 'center',
  394. label: '牌号',
  395. showOverflowTooltip: true
  396. },
  397. {
  398. prop: 'modelType',
  399. label: '型号',
  400. align: 'center',
  401. showOverflowTooltip: true
  402. },
  403. {
  404. prop: 'specification',
  405. label: '规格',
  406. align: 'center',
  407. showOverflowTooltip: true
  408. },
  409. {
  410. prop: 'level',
  411. label: '级别',
  412. align: 'center',
  413. showOverflowTooltip: true
  414. },
  415. {
  416. prop: 'isUnpack',
  417. label: '是否允许拆包',
  418. align: 'center',
  419. minWidth: 120,
  420. formatter: (row, column) => {
  421. return row.isUnpack == 1 ? '是' : '否';
  422. },
  423. showOverflowTooltip: true
  424. },
  425. {
  426. prop: 'isComeCheck',
  427. label: '是否来料检验',
  428. align: 'center',
  429. minWidth: 120,
  430. formatter: (row, column) => {
  431. return row.isComeCheck == 1 ? '是' : '否';
  432. },
  433. showOverflowTooltip: true
  434. },
  435. {
  436. prop: 'measuringUnit',
  437. label: '计量单位',
  438. showOverflowTooltip: true,
  439. minWidth: 90
  440. },
  441. {
  442. prop: 'weightUnit',
  443. label: '重量单位',
  444. showOverflowTooltip: true,
  445. minWidth: 90
  446. },
  447. {
  448. prop: 'roughWeight',
  449. label: '毛重',
  450. showOverflowTooltip: true,
  451. minWidth: 90
  452. },
  453. {
  454. prop: 'netWeight',
  455. label: '净重',
  456. showOverflowTooltip: true,
  457. minWidth: 90
  458. },
  459. {
  460. prop: 'packingUnit',
  461. align: 'center',
  462. label: '包装单位',
  463. showOverflowTooltip: true
  464. },
  465. {
  466. prop: 'componentAttribute',
  467. slot: 'componentAttribute',
  468. align: 'center',
  469. label: '属性类型',
  470. showOverflowTooltip: true
  471. // formatter: (row, column) => {
  472. // return row?.produceType
  473. // ?.map((item) => {
  474. // {{row}}
  475. // return this.getDictValueFn(item);
  476. // })
  477. // ?.toString();
  478. // }
  479. },
  480. {
  481. prop: 'attributeType',
  482. align: 'center',
  483. label: '存货类型',
  484. showOverflowTooltip: true,
  485. formatter: (row, column) => {
  486. return attributeList.find(
  487. (item) => item.value == row.attributeType
  488. )?.label;
  489. }
  490. },
  491. {
  492. prop: 'produceType',
  493. align: 'center',
  494. label: '生产类型',
  495. showOverflowTooltip: true,
  496. formatter: (row, column) => {
  497. return produceTypeList.find(
  498. (item) => item.value == row.produceType
  499. )?.label;
  500. }
  501. },
  502. {
  503. prop: 'measureType',
  504. align: 'center',
  505. label: '计量类型',
  506. showOverflowTooltip: true,
  507. formatter: (row, column) => {
  508. return measureTypeList.find(
  509. (item) => item.value == row.measureType
  510. )?.label;
  511. }
  512. },
  513. {
  514. prop: 'isEnabled',
  515. align: 'center',
  516. label: '状态',
  517. showOverflowTooltip: true,
  518. formatter: (row, column) => {
  519. return row.isEnabled === 0
  520. ? '停用'
  521. : row.isEnabled === 1
  522. ? '启用'
  523. : '';
  524. }
  525. }
  526. ],
  527. sxtList: [
  528. {
  529. label: '自制件',
  530. value: 1
  531. },
  532. {
  533. label: '采购件',
  534. value: 2
  535. },
  536. {
  537. label: '外协件',
  538. value: 3
  539. },
  540. {
  541. label: '受托件',
  542. value: 4
  543. }
  544. ],
  545. newColumns: [],
  546. // 表格选中数据
  547. selection: [],
  548. // 是否显示编辑弹窗
  549. showEdit: false,
  550. id: null,
  551. materialEdit: false,
  552. paramEditShow: false,
  553. mouldShow: false,
  554. current: null,
  555. rowCurrent: null,
  556. isLoading: false,
  557. pageSize: this.$store.state.tablePageSize
  558. };
  559. },
  560. created() {
  561. this.requestDict('生产类型');
  562. this.getFieldModel();
  563. },
  564. methods: {
  565. onSortChange(e) {
  566. console.log(e, '99999999');
  567. let sort = {
  568. orderBy: e.order,
  569. sortName: e.prop
  570. };
  571. this.sort = sort;
  572. this.reload();
  573. },
  574. getDictValueFn(e) {
  575. // console.log(e,'3333333333333');
  576. if (e.length) {
  577. let arr = [];
  578. e.map((v) => {
  579. arr.push(this.findFn(v)?.label);
  580. });
  581. return arr.join(',');
  582. } else {
  583. return '';
  584. }
  585. // let a =
  586. // return a?.label||''
  587. },
  588. findFn(e) {
  589. return this.sxtList.find((item) => item.value == Number(e));
  590. },
  591. toBomManager(row) {
  592. let rowData = {
  593. categoryId: row.id,
  594. categoryName: row.name,
  595. code: row.code,
  596. rootPathIdParent: row.categoryLevelPathIdParent,
  597. isProduct: row.isProduct == 1
  598. };
  599. this.$refs.bomDrawer.open(rowData);
  600. },
  601. //采购
  602. moveTo() {
  603. this.$refs.DialogMoveToRef.open(this.selection);
  604. },
  605. successUpload(response) {
  606. this.isLoading = false;
  607. },
  608. errorUpload(response) {
  609. this.isLoading = false;
  610. },
  611. // 上传备品备件
  612. beforeUpload(file) {
  613. if (file.size / 1024 / 1024 > this.size) {
  614. this.$message.error(`大小不能超过 ${this.size}MB`);
  615. return false;
  616. }
  617. if (this.limit > 0 && this.fileList.length === this.limit) {
  618. this.$message.error(`最多上传 ${this.limit}个文件`);
  619. return false;
  620. }
  621. let formData = new FormData();
  622. formData.append('file', file);
  623. this.isLoading = true;
  624. return importCategorySparePart(formData).then((res) => {
  625. if (res.data.length > 0) {
  626. this.exportErrorDioalogVisible = true;
  627. this.errorData = res.data;
  628. } else {
  629. this.$message.success('导入成功!');
  630. }
  631. this.isLoading = false;
  632. return false;
  633. });
  634. },
  635. /* 表格数据源 */
  636. async datasource({ page, limit, where, order }) {
  637. let labs = getMaterialList({
  638. pageNum: page,
  639. size: limit,
  640. ...this.sort,
  641. ...where,
  642. categoryLevelId: this.currentId
  643. });
  644. this.whereData = {
  645. pageNum: page,
  646. size: limit,
  647. ...this.sort,
  648. ...where,
  649. categoryLevelId: this.currentId
  650. };
  651. let a = await labs;
  652. return labs;
  653. },
  654. /* 刷新表格 */
  655. reload(where) {
  656. let labs = {
  657. page: 1,
  658. where: where,
  659. categoryLevelId: this.currentId
  660. };
  661. this.whereData = labs;
  662. this.$refs.table.reload({
  663. page: 1,
  664. where: where,
  665. categoryLevelId: this.currentId
  666. });
  667. },
  668. getFieldModel() {
  669. fieldModel({ relevance: 't_main_category' }).then((res) => {
  670. const privateColumn = [
  671. {
  672. columnKey: 'action',
  673. label: '操作',
  674. width: 220,
  675. align: 'center',
  676. resizable: false,
  677. slot: 'action',
  678. fixed: 'right'
  679. }
  680. ];
  681. let newRes = res.map((m) => {
  682. return {
  683. prop: 'extField.' + m.prop,
  684. label: m.label,
  685. align: 'center',
  686. showOverflowTooltip: true
  687. };
  688. });
  689. this.newColumns = [...this.columns, ...newRes, ...privateColumn];
  690. this.getTabColumns();
  691. this.$forceUpdate();
  692. });
  693. },
  694. /* 显示编辑 */
  695. openEdit(row, status) {
  696. console.log(status, this.currentData, 'status');
  697. let isUpdate;
  698. if (status == 2) {
  699. isUpdate = 0;
  700. } else {
  701. isUpdate = 1;
  702. }
  703. this.$router.push({
  704. path: '/material/product/detail',
  705. query: {
  706. lyType: this.lyType,
  707. id: row.id ? row.id : null,
  708. status: status,
  709. rootId: this.rootId,
  710. isUpdate: isUpdate,
  711. oneProduct: this.oneProduct,
  712. t: new Date().getTime(),
  713. rootTreeId: this.rootTreeId,
  714. ...this.currentData
  715. }
  716. });
  717. },
  718. /* 删除 */
  719. remove(row) {
  720. const loading = this.$loading({ lock: true });
  721. removeMaterial(row.id)
  722. .then((msg) => {
  723. this.$refs.table.reload({
  724. page: 1,
  725. categoryLevelId: this.currentId
  726. });
  727. loading.close();
  728. })
  729. .catch((e) => {
  730. loading.close();
  731. });
  732. },
  733. openMaterial(row) {
  734. this.current = row;
  735. this.materialEdit = true;
  736. this.$refs.materialRefs.$refs.form &&
  737. this.$refs.materialRefs.$refs.form.clearValidate();
  738. },
  739. openParam(row) {
  740. this.paramEditShow = true;
  741. this.current = row;
  742. this.$refs.paramRefs.$refs.form &&
  743. this.$refs.paramRefs.$refs.form.clearValidate();
  744. },
  745. openMould(row) {
  746. this.current = row;
  747. this.mouldShow = true;
  748. this.$refs.mouldRefs.$refs.form &&
  749. this.$refs.mouldRefs.$refs.form.clearValidate();
  750. },
  751. handleLink(type) {
  752. if (!this.rowCurrent) {
  753. return this.$message.error(
  754. this.rootTreeId == 9
  755. ? '请选择产品!'
  756. : this.rootTreeId == 4
  757. ? '请选择设备!'
  758. : ''
  759. );
  760. }
  761. this.$refs.linkMaterialDialogRef.open(type, this.rowCurrent);
  762. },
  763. success() {
  764. this.reload();
  765. },
  766. handAllocation(row) {
  767. this.$refs.allocationRef.open(row);
  768. },
  769. handleAridRegion(row) {
  770. this.$refs.aridRegionRef.open(row);
  771. },
  772. uploadFile() {
  773. this.$refs.importDialogRef.open();
  774. },
  775. /** 导出按钮操作 */
  776. handleExport() {
  777. exportFile(this.whereData);
  778. console.log(this.whereData, 'whereForm');
  779. },
  780. /** 下载模板操作 */
  781. importTemplate() {
  782. importTemplate(this.whereForm).then((res) => {
  783. this.$message.success('模板下载成功');
  784. });
  785. }
  786. },
  787. watch: {
  788. // 监听物料组id变化
  789. currentId() {
  790. this.reload();
  791. },
  792. $route: {
  793. handler(route) {
  794. this.pageShow = false;
  795. if (route.query && route.query.isWt) {
  796. getBomGetById(route.query.businessId).then((res) => {
  797. let rowData = {
  798. categoryId: res.data.categoryId,
  799. categoryName: res.data.name,
  800. code: res.data.categoryCode,
  801. rootPathIdParent: res.data.rootCategoryLevelId,
  802. isProduct: res.data.rootCategoryLevelId == 9 ? true : false,
  803. versions: res.data.versions,
  804. bomType: res.data.bomType,
  805. isWt: true,
  806. isBtn: route.query.isBtn
  807. };
  808. this.$nextTick(() => {
  809. this.$refs.bomDrawer.open(rowData);
  810. this.pageShow = true;
  811. });
  812. });
  813. } else {
  814. this.pageShow = true;
  815. }
  816. },
  817. immediate: true
  818. }
  819. }
  820. };
  821. </script>
  822. <style lang="scss" scoped>
  823. .upload {
  824. display: inline-block;
  825. width: 100px;
  826. margin-left: 10px;
  827. }
  828. </style>