index-data.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  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/category/downLoadTemplate'"
  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. import { produceTypeList } from '@/enum/dict.js';
  269. const attributeList = [
  270. {
  271. label: '总装',
  272. value: 1
  273. },
  274. {
  275. label: '部件',
  276. value: 2
  277. },
  278. {
  279. label: '零件',
  280. value: 3
  281. },
  282. {
  283. label: '原材料',
  284. value: 4
  285. }
  286. ];
  287. const measureTypeList = [
  288. {
  289. label: '数量',
  290. value: 1
  291. },
  292. {
  293. label: '重量',
  294. value: 2
  295. },
  296. {
  297. label: '体积',
  298. value: 3
  299. },
  300. {
  301. label: '容积',
  302. value: 4
  303. },
  304. {
  305. label: '面积',
  306. value: 5
  307. }
  308. ];
  309. export default {
  310. mixins: [dictMixins, tabMixins],
  311. components: {
  312. importDialog,
  313. MaterialModal,
  314. ParamEdit,
  315. mouldDialog,
  316. linkMaterialDialog,
  317. goodsAllocation,
  318. aridRegion,
  319. BomDetailsPop,
  320. DialogMoveTo
  321. },
  322. props: {
  323. // 物料组id
  324. currentId: [Number, String],
  325. data: [Array, Object],
  326. rootId: [Number, String],
  327. rootTreeId: [Number, String],
  328. lyType: [String],
  329. oneProduct: Boolean,
  330. currentData: Object,
  331. //table-cacheKeyUrl
  332. cacheKeyUrl: String
  333. },
  334. data() {
  335. return {
  336. moudleName: 'mainCategory',
  337. errorData: [],
  338. exportErrorDioalogVisible: false,
  339. pagination: {
  340. total: 0
  341. },
  342. bomShow: false,
  343. whereData: {},
  344. pageShow: false,
  345. // 表格列配置
  346. columns: [
  347. {
  348. width: 45,
  349. type: 'selection',
  350. columnKey: 'selection',
  351. align: 'center'
  352. },
  353. {
  354. columnKey: 'index',
  355. type: 'index',
  356. width: 50,
  357. align: 'center',
  358. showOverflowTooltip: true,
  359. label: '序号'
  360. },
  361. {
  362. prop: 'code',
  363. label: '编码',
  364. align: 'center',
  365. showOverflowTooltip: true,
  366. sortable: true,
  367. minWidth: 110
  368. },
  369. {
  370. prop: 'name',
  371. label: '名称',
  372. align: 'center',
  373. showOverflowTooltip: true,
  374. minWidth: 110
  375. },
  376. {
  377. prop: 'categoryLevelPath',
  378. label: '分类',
  379. align: 'center',
  380. showOverflowTooltip: true
  381. },
  382. {
  383. prop: 'brandNum',
  384. align: 'center',
  385. label: '牌号',
  386. showOverflowTooltip: true
  387. },
  388. {
  389. prop: 'modelType',
  390. label: '型号',
  391. align: 'center',
  392. showOverflowTooltip: true
  393. },
  394. {
  395. prop: 'specification',
  396. label: '规格',
  397. align: 'center',
  398. showOverflowTooltip: true
  399. },
  400. {
  401. prop: 'level',
  402. label: '级别',
  403. align: 'center',
  404. showOverflowTooltip: true
  405. },
  406. {
  407. prop: 'isUnpack',
  408. label: '是否允许拆包',
  409. align: 'center',
  410. minWidth: 120,
  411. formatter: (row, column) => {
  412. return row.isUnpack == 1 ? '是' : '否';
  413. },
  414. showOverflowTooltip: true
  415. },
  416. {
  417. prop: 'isComeCheck',
  418. label: '是否来料检验',
  419. align: 'center',
  420. minWidth: 120,
  421. formatter: (row, column) => {
  422. return row.isComeCheck == 1 ? '是' : '否';
  423. },
  424. showOverflowTooltip: true
  425. },
  426. {
  427. prop: 'measuringUnit',
  428. label: '计量单位',
  429. showOverflowTooltip: true,
  430. minWidth: 90
  431. },
  432. {
  433. prop: 'weightUnit',
  434. label: '重量单位',
  435. showOverflowTooltip: true,
  436. minWidth: 90
  437. },
  438. {
  439. prop: 'roughWeight',
  440. label: '毛重',
  441. showOverflowTooltip: true,
  442. minWidth: 90
  443. },
  444. {
  445. prop: 'netWeight',
  446. label: '净重',
  447. showOverflowTooltip: true,
  448. minWidth: 90
  449. },
  450. {
  451. prop: 'packingUnit',
  452. align: 'center',
  453. label: '包装单位',
  454. showOverflowTooltip: true
  455. },
  456. {
  457. prop: 'componentAttribute',
  458. slot: 'componentAttribute',
  459. align: 'center',
  460. label: '属性类型',
  461. showOverflowTooltip: true
  462. // formatter: (row, column) => {
  463. // return row?.produceType
  464. // ?.map((item) => {
  465. // {{row}}
  466. // return this.getDictValueFn(item);
  467. // })
  468. // ?.toString();
  469. // }
  470. },
  471. {
  472. prop: 'attributeType',
  473. align: 'center',
  474. label: '存货类型',
  475. showOverflowTooltip: true,
  476. formatter: (row, column) => {
  477. return attributeList.find(
  478. (item) => item.value == row.attributeType
  479. )?.label;
  480. }
  481. },
  482. {
  483. prop: 'produceType',
  484. align: 'center',
  485. label: '生产类型',
  486. showOverflowTooltip: true,
  487. formatter: (row, column) => {
  488. return produceTypeList.find(
  489. (item) => item.value == row.produceType
  490. )?.label;
  491. }
  492. },
  493. {
  494. prop: 'measureType',
  495. align: 'center',
  496. label: '计量类型',
  497. showOverflowTooltip: true,
  498. formatter: (row, column) => {
  499. return measureTypeList.find(
  500. (item) => item.value == row.measureType
  501. )?.label;
  502. }
  503. },
  504. {
  505. prop: 'isEnabled',
  506. align: 'center',
  507. label: '状态',
  508. showOverflowTooltip: true,
  509. formatter: (row, column) => {
  510. return row.isEnabled === 0
  511. ? '停用'
  512. : row.isEnabled === 1
  513. ? '启用'
  514. : '';
  515. }
  516. }
  517. ],
  518. sxtList: [
  519. {
  520. label: '自制件',
  521. value: 1
  522. },
  523. {
  524. label: '采购件',
  525. value: 2
  526. },
  527. {
  528. label: '外协件',
  529. value: 3
  530. },
  531. {
  532. label: '受托件',
  533. value: 4
  534. }
  535. ],
  536. newColumns: [],
  537. // 表格选中数据
  538. selection: [],
  539. // 是否显示编辑弹窗
  540. showEdit: false,
  541. id: null,
  542. materialEdit: false,
  543. paramEditShow: false,
  544. mouldShow: false,
  545. current: null,
  546. rowCurrent: null,
  547. isLoading: false,
  548. pageSize: this.$store.state.tablePageSize
  549. };
  550. },
  551. created() {
  552. this.requestDict('生产类型');
  553. this.getFieldModel();
  554. },
  555. methods: {
  556. onSortChange(e) {
  557. console.log(e, '99999999');
  558. let sort = {
  559. orderBy: e.order,
  560. sortName: e.prop
  561. };
  562. this.sort = sort;
  563. this.reload();
  564. },
  565. getDictValueFn(e) {
  566. // console.log(e,'3333333333333');
  567. if (e.length) {
  568. let arr = [];
  569. e.map((v) => {
  570. arr.push(this.findFn(v)?.label);
  571. });
  572. return arr.join(',');
  573. } else {
  574. return '';
  575. }
  576. // let a =
  577. // return a?.label||''
  578. },
  579. findFn(e) {
  580. return this.sxtList.find((item) => item.value == Number(e));
  581. },
  582. toBomManager(row) {
  583. let rowData = {
  584. categoryId: row.id,
  585. categoryName: row.name,
  586. code: row.code,
  587. rootPathIdParent: row.categoryLevelPathIdParent,
  588. isProduct: row.isProduct == 1
  589. };
  590. this.$refs.bomDrawer.open(rowData);
  591. },
  592. //采购
  593. moveTo() {
  594. this.$refs.DialogMoveToRef.open(this.selection);
  595. },
  596. successUpload(response) {
  597. this.isLoading = false;
  598. },
  599. errorUpload(response) {
  600. this.isLoading = false;
  601. },
  602. // 上传备品备件
  603. beforeUpload(file) {
  604. if (file.size / 1024 / 1024 > this.size) {
  605. this.$message.error(`大小不能超过 ${this.size}MB`);
  606. return false;
  607. }
  608. if (this.limit > 0 && this.fileList.length === this.limit) {
  609. this.$message.error(`最多上传 ${this.limit}个文件`);
  610. return false;
  611. }
  612. let formData = new FormData();
  613. formData.append('file', file);
  614. this.isLoading = true;
  615. return importCategorySparePart(formData).then((res) => {
  616. if (res.data.length > 0) {
  617. this.exportErrorDioalogVisible = true;
  618. this.errorData = res.data;
  619. } else {
  620. this.$message.success('导入成功!');
  621. }
  622. this.isLoading = false;
  623. return false;
  624. });
  625. },
  626. /* 表格数据源 */
  627. async datasource({ page, limit, where, order }) {
  628. let labs = getMaterialList({
  629. pageNum: page,
  630. size: limit,
  631. ...this.sort,
  632. ...where,
  633. categoryLevelId: this.currentId
  634. });
  635. this.whereData = {
  636. pageNum: page,
  637. size: limit,
  638. ...this.sort,
  639. ...where,
  640. categoryLevelId: this.currentId
  641. };
  642. let a = await labs;
  643. return labs;
  644. },
  645. /* 刷新表格 */
  646. reload(where) {
  647. let labs = {
  648. page: 1,
  649. where: where,
  650. categoryLevelId: this.currentId
  651. };
  652. this.whereData = labs;
  653. this.$refs.table.reload({
  654. page: 1,
  655. where: where,
  656. categoryLevelId: this.currentId
  657. });
  658. },
  659. getFieldModel() {
  660. fieldModel({ relevance: 't_main_category' }).then((res) => {
  661. const privateColumn = [
  662. {
  663. columnKey: 'action',
  664. label: '操作',
  665. width: 220,
  666. align: 'center',
  667. resizable: false,
  668. slot: 'action',
  669. fixed: 'right'
  670. }
  671. ];
  672. let newRes = res.map((m) => {
  673. return {
  674. prop: 'extField.' + m.prop,
  675. label: m.label,
  676. align: 'center',
  677. showOverflowTooltip: true
  678. };
  679. });
  680. this.newColumns = [...this.columns, ...newRes, ...privateColumn];
  681. this.getTabColumns();
  682. this.$forceUpdate();
  683. });
  684. },
  685. /* 显示编辑 */
  686. openEdit(row, status) {
  687. console.log(status, this.currentData, 'status');
  688. let isUpdate;
  689. if (status == 2) {
  690. isUpdate = 0;
  691. } else {
  692. isUpdate = 1;
  693. }
  694. this.$router.push({
  695. path: '/material/product/detail',
  696. query: {
  697. lyType: this.lyType,
  698. id: row.id ? row.id : null,
  699. status: status,
  700. rootId: this.rootId,
  701. isUpdate: isUpdate,
  702. oneProduct: this.oneProduct,
  703. t: new Date().getTime(),
  704. rootTreeId: this.rootTreeId,
  705. ...this.currentData
  706. }
  707. });
  708. },
  709. /* 删除 */
  710. remove(row) {
  711. const loading = this.$loading({ lock: true });
  712. removeMaterial(row.id)
  713. .then((msg) => {
  714. this.$refs.table.reload({
  715. page: 1,
  716. categoryLevelId: this.currentId
  717. });
  718. loading.close();
  719. })
  720. .catch((e) => {
  721. loading.close();
  722. });
  723. },
  724. openMaterial(row) {
  725. this.current = row;
  726. this.materialEdit = true;
  727. this.$refs.materialRefs.$refs.form &&
  728. this.$refs.materialRefs.$refs.form.clearValidate();
  729. },
  730. openParam(row) {
  731. this.paramEditShow = true;
  732. this.current = row;
  733. this.$refs.paramRefs.$refs.form &&
  734. this.$refs.paramRefs.$refs.form.clearValidate();
  735. },
  736. openMould(row) {
  737. this.current = row;
  738. this.mouldShow = true;
  739. this.$refs.mouldRefs.$refs.form &&
  740. this.$refs.mouldRefs.$refs.form.clearValidate();
  741. },
  742. handleLink(type) {
  743. if (!this.rowCurrent) {
  744. return this.$message.error(
  745. this.rootTreeId == 9
  746. ? '请选择产品!'
  747. : this.rootTreeId == 4
  748. ? '请选择设备!'
  749. : ''
  750. );
  751. }
  752. this.$refs.linkMaterialDialogRef.open(type, this.rowCurrent);
  753. },
  754. success() {
  755. this.reload();
  756. },
  757. handAllocation(row) {
  758. this.$refs.allocationRef.open(row);
  759. },
  760. handleAridRegion(row) {
  761. this.$refs.aridRegionRef.open(row);
  762. },
  763. uploadFile() {
  764. this.$refs.importDialogRef.open();
  765. },
  766. /** 导出按钮操作 */
  767. handleExport() {
  768. exportFile(this.whereData);
  769. console.log(this.whereData, 'whereForm');
  770. },
  771. /** 下载模板操作 */
  772. importTemplate() {
  773. importTemplate(this.whereForm).then((res) => {
  774. this.$message.success('模板下载成功');
  775. });
  776. }
  777. },
  778. watch: {
  779. // 监听物料组id变化
  780. currentId() {
  781. this.reload();
  782. },
  783. $route: {
  784. handler(route) {
  785. this.pageShow = false;
  786. if (route.query && route.query.isWt) {
  787. getBomGetById(route.query.businessId).then((res) => {
  788. let rowData = {
  789. categoryId: res.data.categoryId,
  790. categoryName: res.data.name,
  791. code: res.data.categoryCode,
  792. rootPathIdParent: res.data.rootCategoryLevelId,
  793. isProduct: res.data.rootCategoryLevelId == 9 ? true : false,
  794. versions: res.data.versions,
  795. bomType: res.data.bomType,
  796. isWt: true,
  797. isBtn: route.query.isBtn
  798. };
  799. this.$nextTick(() => {
  800. this.$refs.bomDrawer.open(rowData);
  801. this.pageShow = true;
  802. });
  803. });
  804. } else {
  805. this.pageShow = true;
  806. }
  807. },
  808. immediate: true
  809. }
  810. }
  811. };
  812. </script>
  813. <style lang="scss" scoped>
  814. .upload {
  815. display: inline-block;
  816. width: 100px;
  817. margin-left: 10px;
  818. }
  819. </style>