product-list.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845
  1. <template>
  2. <ele-modal
  3. title="选择物品"
  4. :visible.sync="visible"
  5. v-if="visible"
  6. :before-close="handleClose"
  7. top="5vh"
  8. append-to-body
  9. width="70%"
  10. :maxable="true"
  11. >
  12. <el-card shadow="never">
  13. <searchProduct v-if="dataSources == '1'" @search="reload"></searchProduct>
  14. <el-form
  15. :model="searchForm"
  16. label-width="100px"
  17. @submit.native.prevent
  18. v-else
  19. >
  20. <el-row>
  21. <el-row>
  22. <!-- <el-col :span="6">
  23. <el-form-item label="仓库名称:">
  24. <el-select v-model="searchForm.warehouseId" style="width: 100%">
  25. <el-option
  26. v-for="item in warehouseList"
  27. :key="item.id"
  28. :value="item.id"
  29. :label="item.name"
  30. ></el-option>
  31. </el-select>
  32. </el-form-item>
  33. </el-col> -->
  34. <el-col :span="6">
  35. <el-form-item label="牌号">
  36. <el-input
  37. type="text"
  38. placeholder="搜索牌号"
  39. v-model="searchForm.brandNum"
  40. ></el-input>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="6" style="height: 43px">
  44. <el-form-item label="列表维度:" prop="dimension">
  45. <template>
  46. <el-select
  47. style="width: 100%"
  48. @change="changeDimensionHandler"
  49. v-model="dimension"
  50. placeholder="请选择"
  51. >
  52. <el-option label="物料维度" value="4"></el-option>
  53. <el-option label="包装维度" value="3"></el-option>
  54. <el-option label="批次维度" value="2"></el-option>
  55. <el-option label="物品维度" value="1"></el-option>
  56. </el-select>
  57. </template>
  58. </el-form-item>
  59. </el-col>
  60. <el-col :span="6">
  61. <el-form-item label="物品编码:">
  62. <el-input
  63. style="width: 100%"
  64. type="text"
  65. placeholder="搜索物品编码"
  66. v-model="searchForm.categoryCode"
  67. ></el-input>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :span="6">
  71. <el-form-item label="物品名称:">
  72. <el-input
  73. style="width: 100%"
  74. type="text"
  75. placeholder="搜索物品名称"
  76. v-model="searchForm.categoryName"
  77. ></el-input>
  78. </el-form-item>
  79. </el-col>
  80. <el-col style="text-align: right; margin-bottom: 10px">
  81. <el-button type="primary" @click="doSearch">搜索</el-button>
  82. <el-button icon="el-icon-refresh-left" @click="reset"
  83. >重置</el-button
  84. >
  85. </el-col>
  86. </el-row>
  87. <el-row>
  88. <el-col :span="6">
  89. <el-form-item label="批次号:">
  90. <el-input
  91. type="text"
  92. placeholder="搜索批次号"
  93. v-model="searchForm.batchNo"
  94. ></el-input>
  95. </el-form-item>
  96. </el-col>
  97. <el-col :span="6">
  98. <el-form-item label="型号:">
  99. <el-input
  100. type="text"
  101. placeholder="搜索型号"
  102. v-model="searchForm.categoryModel"
  103. ></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="6">
  107. <el-form-item label="规格:">
  108. <el-input
  109. type="text"
  110. placeholder="搜索规格"
  111. v-model="searchForm.specification"
  112. ></el-input>
  113. </el-form-item>
  114. </el-col>
  115. <el-col :span="6">
  116. <el-form-item label="颜色:">
  117. <el-input
  118. type="text"
  119. placeholder="搜索颜色"
  120. v-model="searchForm.colorKey"
  121. ></el-input>
  122. </el-form-item>
  123. </el-col>
  124. </el-row>
  125. </el-row>
  126. </el-form>
  127. <ele-split-layout
  128. width="244px"
  129. allow-collapse
  130. :right-style="{ overflow: 'hidden' }"
  131. >
  132. <div class="ele-border-lighter split-layout-right-content">
  133. <productTree
  134. @handleNodeClick="handleNodeClick"
  135. :isFirstRefreshTable="isFirstRefreshTable"
  136. ref="treeList"
  137. :ids="ids"
  138. :typeIds="typeIds"
  139. :itemType="itemType"
  140. />
  141. </div>
  142. <!-- 表格 -->
  143. <template v-slot:content>
  144. <ele-pro-table
  145. ref="table"
  146. :columns="columns"
  147. :datasource="datasource"
  148. @row-dblclick="handleDoubleClick"
  149. row-key="id"
  150. height="calc(100vh - 480px)"
  151. class="dict-table"
  152. @cell-click="cellClick"
  153. :selection.sync="selection"
  154. @done="tableDone"
  155. :row-class-name="tableRowClassName"
  156. :initLoad="!isFirstRefreshTable"
  157. @columns-change="handleColumnChange"
  158. :cache-key="cacheKeyUrl"
  159. :page-size="20"
  160. >
  161. <!-- 表头工具栏 -->
  162. <template v-slot:action="{ row }">
  163. <!-- <el-radio class="radio" v-model="radio" :label="row.code"></el-radio> -->
  164. <el-radio class="radio" v-model="radio" :label="row.id">
  165. <i></i>
  166. </el-radio>
  167. </template>
  168. <template v-slot:saleCount="{ row }">
  169. <el-input
  170. v-model="row.saleCount"
  171. style="width: 100%"
  172. placeholder="请输入"
  173. type="number"
  174. :min="0"
  175. ></el-input>
  176. </template>
  177. <template v-slot:cz="{ row }">
  178. <el-button type="text" @click="handleDoubleClick(row)"
  179. >选择PBom</el-button
  180. >
  181. </template>
  182. </ele-pro-table>
  183. </template>
  184. </ele-split-layout>
  185. </el-card>
  186. <div slot="footer">
  187. <el-button type="primary" size="small" @click="selected">选择</el-button>
  188. <el-button size="small" @click="handleClose">关闭</el-button>
  189. </div>
  190. <c-bom-list
  191. v-if="cBomListDialogFlag"
  192. :cBomListDialogFlag.sync="cBomListDialogFlag"
  193. :current-row="current"
  194. ref="cBomRef"
  195. @changeParent="getSelectionCbom"
  196. ></c-bom-list>
  197. </ele-modal>
  198. </template>
  199. <script>
  200. import {
  201. getOutindetailtwoList,
  202. getBatchList,
  203. getMaterialList,
  204. getPackingList
  205. } from '@/api/wms';
  206. import {
  207. getProductList,
  208. queryLastContractProductList
  209. } from '@/api/saleManage/quotation';
  210. import searchProduct from './searchProduct.vue';
  211. import productTree from '@/components/productTree';
  212. import {
  213. getInventoryTotalAPI,
  214. getCategoryPackageDisposition
  215. } from '@/api/wms';
  216. import cBomList from './cBom-list.vue';
  217. import { getByCode } from '@/api/system/dictionary-data';
  218. import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
  219. import { lbjtList } from '@/enum/dict.js';
  220. import tabMixins from '@/mixins/tableColumnsMixin';
  221. import { levelList } from '@/enum/dict.js';
  222. import dictMixins from '@/mixins/dictMixins';
  223. export default {
  224. mixins: [tabMixins, dictMixins],
  225. components: {
  226. productTree,
  227. searchProduct,
  228. cBomList
  229. },
  230. props: {
  231. /*是否需要获取仓库产品数量*/
  232. isGetInventoryTotal: {
  233. type: Boolean,
  234. default: false
  235. },
  236. // 是否回传库存数量
  237. showStockCount: {
  238. type: Boolean,
  239. default: false
  240. },
  241. /*已选择的产品*/
  242. data: {
  243. type: Array,
  244. default: () => []
  245. },
  246. /*是否需要cBom*/
  247. isShowCBom: {
  248. type: Boolean,
  249. default: false
  250. },
  251. /*是否需要供应商*/
  252. isSupplier: {
  253. type: Boolean,
  254. default: false
  255. },
  256. //获取上一次销售记录 1销售合同 2采购合同
  257. isSalesRecord: {
  258. default: ''
  259. },
  260. typeIds: {
  261. type: Array,
  262. default: () => []
  263. },
  264. isFirstRefreshTable: {
  265. type: Boolean,
  266. default: false
  267. },
  268. ids: {
  269. type: Array,
  270. default: () => []
  271. },
  272. itemType: {
  273. type: String,
  274. default: '1'
  275. },
  276. // 是否需要显示可填采购数量的输入框
  277. showSaleCount: {
  278. type: Boolean,
  279. default: false
  280. }
  281. },
  282. data() {
  283. return {
  284. visible: false,
  285. currentIndex: null,
  286. radio: null,
  287. cBomListDialogFlag: null,
  288. dictList: {},
  289. selection: [],
  290. isColorId: [],
  291. dataSources: '1', // 0:仓库;1:主数据
  292. dimension: '1',
  293. cacheKeyUrl: 'product-list-cache-key',
  294. searchForm: {
  295. categoryCode: '',
  296. categoryName: '',
  297. batchNo: '',
  298. brandNum: '',
  299. engrave: '',
  300. barcodes: '',
  301. categoryModel: '',
  302. specification: '',
  303. colorKey: '',
  304. categoryLevelId: '',
  305. warehouseId: '',
  306. pageNum: 1,
  307. size: 10
  308. },
  309. datasourceList: [],
  310. columnsVersion: 1
  311. };
  312. },
  313. watch: {},
  314. computed: {
  315. columns() {
  316. let columnsVersion = this.columnsVersion;
  317. let data = null;
  318. if (this.currentIndex != -1) {
  319. data = {
  320. action: 'action',
  321. slot: 'action',
  322. align: 'center',
  323. label: '选择',
  324. reserveSelection: true
  325. };
  326. }
  327. if (this.currentIndex == -1) {
  328. data = {
  329. label: '选择',
  330. width: 45,
  331. type: 'selection',
  332. columnKey: 'selection',
  333. align: 'center',
  334. reserveSelection: true
  335. };
  336. }
  337. const tempData = [
  338. data,
  339. {
  340. columnKey: 'index',
  341. type: 'index',
  342. width: 50,
  343. align: 'center',
  344. showOverflowTooltip: true,
  345. label: '序号'
  346. },
  347. {
  348. prop: 'code',
  349. label: '编码',
  350. align: 'center',
  351. showOverflowTooltip: true,
  352. minWidth: 110
  353. },
  354. {
  355. prop: 'name',
  356. label: '名称',
  357. align: 'center',
  358. showOverflowTooltip: true,
  359. minWidth: 110
  360. },
  361. {
  362. prop: 'saleCount',
  363. slot: 'saleCount',
  364. label: '订单数量',
  365. showOverflowTooltip: true,
  366. align: 'center',
  367. minWidth: 120,
  368. hide: !this.showSaleCount
  369. },
  370. {
  371. prop: 'imgCode',
  372. align: 'center',
  373. label: '图号/件号',
  374. showOverflowTooltip: true,
  375. minWidth: 110
  376. },
  377. {
  378. prop: 'componentAttribute',
  379. align: 'center',
  380. label: '属性类型',
  381. showOverflowTooltip: true,
  382. formatter: (row, column) => {
  383. if (row.componentAttribute) {
  384. return row.componentAttribute
  385. .map((item) => {
  386. return lbjtList[item];
  387. })
  388. .toString();
  389. }
  390. },
  391. minWidth: 110
  392. },
  393. {
  394. prop: 'level',
  395. align: 'center',
  396. label: '级别',
  397. showOverflowTooltip: true,
  398. minWidth: 110
  399. },
  400. {
  401. prop: 'extField.packingSpecification',
  402. align: 'center',
  403. label: '包装规格',
  404. showOverflowTooltip: true,
  405. minWidth: 110
  406. },
  407. {
  408. prop: 'brandNum',
  409. align: 'center',
  410. label: '牌号',
  411. showOverflowTooltip: true
  412. },
  413. {
  414. prop: 'modelType',
  415. label: '型号',
  416. align: 'center',
  417. showOverflowTooltip: true
  418. },
  419. {
  420. prop: 'specification',
  421. label: '规格',
  422. align: 'center',
  423. showOverflowTooltip: true
  424. },
  425. {
  426. prop: 'modelKey',
  427. label: '机型',
  428. align: 'center',
  429. showOverflowTooltip: true
  430. },
  431. {
  432. prop: 'colorKey',
  433. label: '颜色',
  434. align: 'center',
  435. showOverflowTooltip: true
  436. },
  437. {
  438. prop: 'voltage',
  439. label: '电压',
  440. align: 'center',
  441. showOverflowTooltip: true,
  442. formatter: (row, column) => {
  443. return row.extField?.voltage || '';
  444. }
  445. },
  446. {
  447. prop: 'layBy',
  448. label: '贮藏',
  449. align: 'center',
  450. showOverflowTooltip: true,
  451. formatter: (row, column) => {
  452. return row.extField?.layBy
  453. ? this.getDictValue('贮藏', row.extField?.layBy)
  454. : '';
  455. }
  456. },
  457. {
  458. prop: 'warrantyPeriod',
  459. label: '保质期',
  460. align: 'center',
  461. showOverflowTooltip: true,
  462. formatter: (row, column) => {
  463. let unit = '';
  464. if (row.warrantyPeriodUnit) {
  465. unit = this.getDictValue('保质期单位', row.warrantyPeriodUnit);
  466. }
  467. return row.warrantyPeriod ? row.warrantyPeriod + unit : '';
  468. }
  469. },
  470. {
  471. prop: 'purchaseOrigins',
  472. label: '产地',
  473. align: 'center',
  474. showOverflowTooltip: true,
  475. formatter: (row, column) => {
  476. return row.purchaseOrigins && row.purchaseOrigins.length
  477. ? row.purchaseOrigins
  478. .map((item) => this.getDictValue('产地', item))
  479. .join(',')
  480. : '';
  481. }
  482. },
  483. {
  484. prop: 'measuringUnit',
  485. label: '计量单位',
  486. showOverflowTooltip: true,
  487. align: 'center',
  488. minWidth: 90,
  489. formatter: (row, column) => {
  490. return row.measuringUnit || row.measureUnit;
  491. }
  492. },
  493. {
  494. prop: 'weightUnit',
  495. label: '重量单位',
  496. showOverflowTooltip: true,
  497. align: 'center',
  498. minWidth: 90
  499. },
  500. {
  501. prop: 'roughWeight',
  502. label: '毛重',
  503. showOverflowTooltip: true,
  504. align: 'center',
  505. minWidth: 90
  506. },
  507. {
  508. prop: 'netWeight',
  509. label: '净重',
  510. showOverflowTooltip: true,
  511. align: 'center',
  512. minWidth: 90
  513. },
  514. {
  515. prop: 'packingUnit',
  516. align: 'center',
  517. label: '包装单位',
  518. showOverflowTooltip: true
  519. },
  520. {
  521. prop: 'categoryLevelPath',
  522. label: '分类',
  523. align: 'center',
  524. showOverflowTooltip: true
  525. },
  526. {
  527. slot: 'cz',
  528. align: 'center',
  529. minWidth: 90,
  530. fixed: 'right',
  531. label: '操作',
  532. show: this.isShowCBom
  533. }
  534. ];
  535. return tempData.filter((item) => !item.hide);
  536. }
  537. },
  538. created() {
  539. this.requestDict('保质期单位');
  540. this.requestDict('贮藏');
  541. this.requestDict('产地');
  542. this.requestDict('贮藏');
  543. },
  544. methods: {
  545. getDictV(code, val) {
  546. if (!this.dictList[code]) return '';
  547. return this.dictList[code].find((item) => item.value == val)?.label;
  548. },
  549. async getDictList(code) {
  550. let { data: res } = await getByCode(code);
  551. this.dictList[code] = res.map((item) => {
  552. let values = Object.keys(item);
  553. return {
  554. value: values[0],
  555. label: item[values[0]]
  556. };
  557. });
  558. console.log('code', this.dictList[code]);
  559. },
  560. open(item, currentIndex, value) {
  561. this.dataSources = value || '1';
  562. this.currentIndex = currentIndex;
  563. this.visible = true;
  564. this.getDictList('productionType');
  565. },
  566. /* 表格数据源 */
  567. datasource({ page, limit, where, order }) {
  568. if (this.dataSources == '0') {
  569. this.searchForm.pageNum = page;
  570. return this.changeDimension(this.dimension);
  571. }
  572. // isEnabled 1:查启用 0:查停用,不传该参数查所有
  573. return getProductList({
  574. pageNum: page,
  575. size: limit,
  576. ...where,
  577. isEnabled: 1
  578. });
  579. },
  580. async tableDone() {
  581. if (this.isSalesRecord == 1 || this.isSalesRecord == 2) {
  582. this.isColorId = await queryLastContractProductList(
  583. this.isSalesRecord
  584. );
  585. }
  586. },
  587. //上次销售记录 改变背景色
  588. tableRowClassName({ row }) {
  589. if (this.isColorId?.includes(row?.id)) {
  590. return 'success-row';
  591. }
  592. return '';
  593. },
  594. /* 刷新表格 */
  595. reload(where) {
  596. where.categoryLevelId = this.curNodeData?.id;
  597. this.searchForm.categoryLevelId = this.curNodeData?.id;
  598. this.$refs.table.reload({ pageNum: 1, where: where });
  599. },
  600. handleNodeClick(data, node) {
  601. this.curNodeData = data;
  602. this.$nextTick(() => {
  603. this.reload({ categoryLevelId: data.id });
  604. });
  605. },
  606. // 单击获取id
  607. cellClick(row) {
  608. if (this.currentIndex == -1) return;
  609. this.current = row;
  610. this.radio = row.id;
  611. },
  612. handleDoubleClick(row) {
  613. if (!this.isShowCBom) return;
  614. this.cBomListDialogFlag = true;
  615. this.current = row;
  616. this.$nextTick(() => {
  617. this.$refs.cBomRef.open(row);
  618. });
  619. },
  620. async getSelectionCbom(rows = []) {
  621. console.log(rows);
  622. let list = rows;
  623. //获取供应商
  624. if (this.isSupplier) {
  625. let supplierList = await this.getSupplierObj(list, 'categoryId');
  626. list.forEach((item) => {
  627. item['supplierList'] = supplierList[item.categoryId];
  628. // item['entrustedEnterpriseIdList'] = supplierList[item.categoryId];
  629. if (supplierList[item.categoryId]?.length) {
  630. // item['entrustedEnterpriseId'] = supplierList[item.id][0].id;
  631. // item['supplierCode'] = supplierList[item.categoryId][0].code;
  632. // item['supplierId'] = supplierList[item.categoryId][0].id;
  633. // item['supplierName'] = supplierList[item.categoryId][0].name;
  634. item['supplierName'] =
  635. supplierList[item.categoryId].find(
  636. (i) => i.id == item.supplierId
  637. )?.name || '';
  638. }
  639. });
  640. }
  641. this.$emit('getSelectionCbom', list);
  642. this.handleClose();
  643. },
  644. handleClose() {
  645. this.visible = false;
  646. this.current = null;
  647. this.selection = [];
  648. this.$refs.table.clearSelection();
  649. this.radio = '';
  650. },
  651. async getSupplierObj(productList, queryName) {
  652. try {
  653. let categoryIds = productList
  654. .filter((item) => item[queryName])
  655. .map((item) => item[queryName]);
  656. if (categoryIds.length > 0) {
  657. return await contactQueryByCategoryIdsAPI({
  658. categoryIds
  659. });
  660. } else {
  661. return Promise.resolve({});
  662. }
  663. } catch (e) {
  664. return Promise.resolve({});
  665. }
  666. },
  667. async selected() {
  668. if (!this.current && !this.selection.length) {
  669. return this.$message.warning('请至少选择一条数据');
  670. }
  671. if (this.currentIndex != -1) {
  672. if (
  673. this.data
  674. .map((item) => item.productCode)
  675. .includes(this.current.code)
  676. ) {
  677. return this.$message.error('选择的物品已经存在列表了');
  678. }
  679. } else {
  680. if (
  681. this.selection.some((item) =>
  682. this.data.some((i) => i.productCode == item.code)
  683. )
  684. ) {
  685. return this.$message.error('选择的物品已经存在列表了');
  686. }
  687. }
  688. let list = this.currentIndex == -1 ? this.selection : [this.current];
  689. let codeList = list.map((item) => item.code);
  690. let idList = list.map((item) => item.id);
  691. //获取仓库库存
  692. if (this.isGetInventoryTotal) {
  693. let inventoryTotalList = await getInventoryTotalAPI(codeList);
  694. list.forEach((item) => {
  695. let find =
  696. inventoryTotalList.find((key) => key.code == item.code) || {};
  697. if (this.showStockCount) {
  698. item.stockCountBase = find.stockCountBase;
  699. item.lockQuantity = find.lockQuantity;
  700. }
  701. item.availableCountBase = find.availableCountBase;
  702. });
  703. }
  704. //获取供应商
  705. if (this.isSupplier) {
  706. let supplierList = await this.getSupplierObj(list, 'id');
  707. list.forEach((item) => {
  708. item['supplierList'] = supplierList[item.id];
  709. item['entrustedEnterpriseIdList'] = supplierList[item.id];
  710. if (supplierList[item.id]?.length) {
  711. item['entrustedEnterpriseId'] = supplierList[item.id][0].id;
  712. item['supplierCode'] = supplierList[item.id][0].code;
  713. item['supplierId'] = supplierList[item.id][0].id;
  714. item['supplierName'] = supplierList[item.id][0].name;
  715. }
  716. });
  717. }
  718. // 获取包装规格
  719. let packingSpecification = await getCategoryPackageDisposition({
  720. categoryIds: idList
  721. });
  722. list.forEach((item) => {
  723. item['packageDispositionList'] = packingSpecification
  724. .filter((ite) => item.id == ite.categoryId && ite.conversionUnit)
  725. .sort((a, b) => a.sort - b.sort);
  726. if (item.level) {
  727. item['goodsLevel'] = levelList.find(
  728. (val) => val.label == item.level
  729. )?.value;
  730. }
  731. });
  732. this.$emit('changeParent', list, this.currentIndex);
  733. this.handleClose();
  734. },
  735. // 仓库查询
  736. doSearch() {
  737. // this.searchForm.pageNum = 1;
  738. this.reload({ pageNum: 1, where: this.searchForm });
  739. },
  740. // 仓库查询重置
  741. reset() {
  742. this.searchForm = {
  743. categoryCode: '',
  744. categoryName: '',
  745. batchNo: '',
  746. brandNum: '',
  747. engrave: '',
  748. barcodes: '',
  749. categoryModel: '',
  750. specification: '',
  751. colorKey: '',
  752. categoryLevelId: this.categoryLevelId,
  753. pageNum: 1,
  754. warehouseId: '',
  755. size: 10
  756. };
  757. this.doSearch();
  758. },
  759. // 切换维度
  760. changeDimensionHandler(e) {
  761. // this.searchForm.pageNum = 1;
  762. // this.selectionList = [];
  763. // this.$refs.multipleTable.clearSelection();
  764. this.reload({ pageNum: 1, where: this.searchForm });
  765. },
  766. // 仓库数据
  767. async changeDimension(e) {
  768. this.dimension = e;
  769. let data = [];
  770. if (this.dimension == 1) {
  771. // 物品维度
  772. data = await getOutindetailtwoList(this.searchForm);
  773. } else if (this.dimension == 2) {
  774. // 批次维度
  775. data = await getBatchList(this.searchForm);
  776. } else if (this.dimension == 4) {
  777. // 物料维度
  778. data = await getMaterialList(this.searchForm);
  779. } else {
  780. // 包装维度
  781. data = await getPackingList(this.searchForm);
  782. }
  783. data.list.map((el) => {
  784. el.modelType = el.categoryModel;
  785. el.name = el.categoryName;
  786. el.code = el.categoryCode;
  787. });
  788. return data;
  789. }
  790. }
  791. };
  792. </script>
  793. <style lang="scss" scoped>
  794. :deep(.success-row) {
  795. background: #f0f9eb;
  796. }
  797. .tree_col {
  798. border: 1px solid #eee;
  799. padding: 10px 0;
  800. box-sizing: border-box;
  801. height: 500px;
  802. overflow: auto;
  803. }
  804. .table_col {
  805. padding-left: 10px;
  806. ::v-deep .el-table th.el-table__cell {
  807. background: #f2f2f2;
  808. }
  809. }
  810. .pagination {
  811. text-align: right;
  812. padding: 10px 0;
  813. }
  814. .btns {
  815. text-align: center;
  816. padding: 10px 0;
  817. }
  818. .topsearch {
  819. margin-bottom: 15px;
  820. }
  821. </style>