index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928
  1. <template>
  2. <div id="stockManagement_index">
  3. <el-card shadow="never">
  4. <el-form :model="formData" ref="formName" label-width="80px">
  5. <el-row :gutter="10">
  6. <el-col :span="6">
  7. <el-form-item label="入库时间" prop="time">
  8. <el-date-picker
  9. class="w100"
  10. size="small"
  11. v-model="formData.time"
  12. type="daterange"
  13. range-separator="至"
  14. start-placeholder="开始日期"
  15. end-placeholder="结束日期"
  16. value-format="yyyy-MM-dd"
  17. ></el-date-picker>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="6">
  21. <el-form-item label="入库单号" prop="bizNo">
  22. <el-input
  23. size="small"
  24. class="w100"
  25. placeholder="请输入"
  26. v-model="formData.bizNo"
  27. ></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="6">
  31. <el-form-item label="入库类型" prop="bizType">
  32. <el-select
  33. style="width: 100%"
  34. filterable
  35. placeholder="请选择"
  36. v-model="formData.bizType"
  37. clearable
  38. >
  39. <el-option
  40. v-for="item in sceneState"
  41. :key="item.code"
  42. :value="item.code + ''"
  43. :label="item.label"
  44. ></el-option>
  45. </el-select>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="6">
  49. <el-form-item label="物品编码" prop="categoryCode">
  50. <el-input
  51. size="small"
  52. class="w100"
  53. placeholder="请输入"
  54. v-model="formData.categoryCode"
  55. ></el-input>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :span="6">
  59. <el-form-item label="物品名称" prop="categoryName">
  60. <el-input
  61. size="small"
  62. class="w100"
  63. placeholder="请输入"
  64. v-model="formData.categoryName"
  65. ></el-input>
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="6">
  69. <el-form-item label="状态" prop="status">
  70. <el-select
  71. filterable
  72. size="small"
  73. class="w100"
  74. v-model="formData.status"
  75. placeholder="请选择"
  76. clearable
  77. >
  78. <el-option
  79. v-for="item in auditStatus"
  80. :key="item.code"
  81. :value="item.code"
  82. :label="item.label"
  83. ></el-option>
  84. </el-select>
  85. </el-form-item>
  86. </el-col>
  87. <!-- <el-col :span="6">
  88. <el-form-item label="组织机构:" prop="deptIds">
  89. <auth-selection
  90. v-model="formData.deptIds"
  91. style="width: 100%"
  92. ></auth-selection>
  93. </el-form-item>
  94. </el-col> -->
  95. <el-col :span="6" style="height: 42px;">
  96. <el-form-item label="所属工厂" prop="factoryId">
  97. <el-select
  98. filterable
  99. placeholder="请选择"
  100. v-model="formData.factoryId"
  101. clearable
  102. class="w100"
  103. @change="getTreeData"
  104. >
  105. <el-option
  106. v-for="item in factoryList"
  107. :key="item.id"
  108. :label="item.name"
  109. :value="item.id"
  110. ></el-option>
  111. </el-select>
  112. </el-form-item>
  113. </el-col>
  114. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }" style="height: 42px;">
  115. <el-form-item label="仓库名称" prop="warehouseId">
  116. <el-select
  117. filterable
  118. placeholder="请选择"
  119. v-model="formData.warehouseId"
  120. clearable
  121. class="w100"
  122. >
  123. <el-option
  124. v-for="item in warehouseList"
  125. :key="item.id"
  126. :label="item.name"
  127. :value="item.id"
  128. ></el-option>
  129. </el-select>
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="6">
  133. <el-form-item label="颜色" prop="colorKey">
  134. <el-input
  135. size="small"
  136. class="w100"
  137. placeholder="请输入"
  138. v-model="formData.colorKey"
  139. ></el-input>
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="6">
  143. <el-form-item label="型号" prop="modelType">
  144. <el-input
  145. size="small"
  146. class="w100"
  147. placeholder="请输入"
  148. v-model="formData.modelType"
  149. ></el-input>
  150. </el-form-item>
  151. </el-col>
  152. <el-col
  153. style="
  154. display: flex;
  155. justify-content: flex-end;
  156. margin-bottom: 10px;
  157. "
  158. :span="6"
  159. >
  160. <div>
  161. <el-button icon="el-icon-refresh-left" size="small" @click="reset"
  162. >重置</el-button
  163. >
  164. <el-button
  165. type="primary"
  166. icon="el-icon-search"
  167. size="small"
  168. @click="search"
  169. >搜索</el-button
  170. >
  171. </div>
  172. </el-col>
  173. </el-row>
  174. </el-form>
  175. <ele-pro-table
  176. ref="table"
  177. :columns="columns"
  178. :selection.sync="selection"
  179. height="calc(100vh-300px)"
  180. :pageSize="20"
  181. :datasource="datasource"
  182. @cell-click="cellClick"
  183. v-loading="loading"
  184. :cache-key="cacheKeyUrl"
  185. @columns-change="handleColumnChange"
  186. >
  187. <template v-slot:selection="{ row }">
  188. <el-radio class="radio" v-model="currentRow.id" :label="row.id"
  189. ><i></i
  190. ></el-radio>
  191. </template>
  192. <!-- 表头工具栏 -->
  193. <template v-slot:toolbar>
  194. <el-button icon="el-icon-plus" type="primary" @click="add"
  195. >新建</el-button
  196. >
  197. <el-button
  198. icon="el-icon-edit-outline"
  199. type="primary"
  200. @click="priceMaintenance"
  201. v-if="isPrice == 1"
  202. >单价维护</el-button
  203. >
  204. <!-- <el-button icon="el-icon-top" type="primary" @click="shelves"
  205. >上下架</el-button
  206. > -->
  207. <el-button icon="el-icon-receiving" type="primary" @click="outbound"
  208. >出库</el-button
  209. >
  210. <el-button icon="el-icon-printer" type="primary" @click="print"
  211. >打印</el-button
  212. >
  213. <el-button icon="el-icon-printer" type="primary" @click="printkEnter" v-if="$hasPermission('wms:outin:printIn')"
  214. >打印入库单</el-button
  215. >
  216. <el-button icon="el-icon-printer" type="primary" @click="printkEnterHt" v-if="$hasPermission('wms:outin:printInHt')"
  217. >打印入库单</el-button
  218. >
  219. <el-button icon="el-icon-printer" type="primary" @click="handlePrint('printTemplateTrRef')" v-if="$hasPermission('wms:outin:printIn1')"
  220. >打印采购入库单</el-button
  221. >
  222. <!-- <el-button
  223. icon="el-icon-plus"
  224. v-if="clientEnvironmentId == 4"
  225. type="primary"
  226. @click="exportExcel"
  227. >导入</el-button
  228. > -->
  229. </template>
  230. <!-- 状态 -->
  231. <template v-slot:verifyStatus="{ row }">
  232. <span :class="status[row.verifyStatus]?.class">
  233. {{ status[row.verifyStatus]?.label }}
  234. </span>
  235. </template>
  236. <!-- 单号链接 -->
  237. <template v-slot:bizNo="{ row }">
  238. <el-link type="primary" @click="details(row)">
  239. {{ row.bizNo }}
  240. </el-link>
  241. </template>
  242. <!-- 操作列 -->
  243. <template v-slot:action="{ row }">
  244. <el-link
  245. type="success"
  246. :underline="false"
  247. icon="el-icon-position"
  248. v-if="row.verifyStatus == 0 || row.verifyStatus == 3"
  249. @click="submit(row)"
  250. >
  251. 提交
  252. </el-link>
  253. <el-link
  254. type="primary"
  255. :underline="false"
  256. icon="el-icon-view"
  257. @click="edit(row)"
  258. v-if="row.verifyStatus == 0 || row.verifyStatus == 3"
  259. >
  260. 修改
  261. </el-link>
  262. <!-- <el-link v-if="row.verifyStatus == 2 && clientEnvironmentId == 3" type="primary" :underline="false"
  263. icon="el-icon-view" @click="quality(row)">
  264. 质检
  265. </el-link> -->
  266. <el-link
  267. v-if="row.verifyStatus == 2"
  268. type="primary"
  269. :underline="false"
  270. icon="el-icon-sort-up"
  271. @click="details(row)"
  272. >
  273. 上架
  274. </el-link>
  275. <el-link
  276. v-if="row.verifyStatus == 2"
  277. type="primary"
  278. :underline="false"
  279. icon="el-icon-sort-down"
  280. @click="details(row)"
  281. >
  282. 下架
  283. </el-link>
  284. <el-link
  285. type="primary"
  286. v-if="row.verifyStatus == 0 || row.verifyStatus == 3"
  287. :underline="false"
  288. icon="el-icon-delete"
  289. @click="deleted(row)"
  290. >
  291. 删除
  292. </el-link>
  293. </template>
  294. <template v-slot:bizType="{ row }">
  295. {{ handleBizType(row.bizType) }}
  296. </template>
  297. <template v-slot:assetType="{ row }">
  298. {{ handleAssetType(row.extInfo.assetType) }}
  299. </template>
  300. </ele-pro-table>
  301. </el-card>
  302. <printQRCode ref="printQRCodeRef"></printQRCode>
  303. <printStockEnter ref="printStockEnterRef" :groupName="groupName"></printStockEnter>
  304. <printTemplateTr ref="printTemplateTrRef" :groupName="groupName"></printTemplateTr>
  305. <printStockEnterHt ref="printStockEnterHtRef" :groupName="groupName"></printStockEnterHt>
  306. <!-- <priceMaintenanceDialog ref="priceMaintenanceDialogRef" /> -->
  307. </div>
  308. </template>
  309. <script>
  310. import storageApi from '@/api/warehouseManagement';
  311. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  312. /* import priceMaintenanceDialog from './components/priceMaintenanceDialog.vue'; */
  313. import { allCategoryLevel } from '@/api/classifyManage';
  314. import { parameterGetByCode } from '@/api/sys/index.js';
  315. ('@/view/warehouseManagement/stockManagement/components/priceMaintenanceDialog.vue');
  316. import printQRCode from './components/printQRCode.vue';
  317. import printStockEnter from './components/printStockEnter.vue';
  318. import printTemplateTr from './components/print-template-tr.vue';
  319. import printStockEnterHt from './components/printStockEnterHt.vue';
  320. import tabMixins from '@/mixins/tableColumnsMixin';
  321. import {
  322. warehousingType,
  323. sceneState,
  324. auditStatus,
  325. useDict
  326. } from '@/utils/dict/index';
  327. import { enterprisePage } from '@/api/bpm/index.js';
  328. export default {
  329. mixins: [tabMixins],
  330. components: { printQRCode, printStockEnter, printTemplateTr, printStockEnterHt },
  331. data() {
  332. return {
  333. cacheKeyUrl: '202606011119-wms-stockManagement-index',
  334. auditStatus,
  335. selection: [],
  336. warehousingType,
  337. sceneState,
  338. codeList: [],
  339. factoryList: [],
  340. warehouseList: [],
  341. tableData: [],
  342. formData: {
  343. deptIds: '',
  344. categoryCode: '',
  345. categoryName: '',
  346. sourceBizNo: '',
  347. startTime: '',
  348. endTime: '',
  349. status: '',
  350. factoryId: '',
  351. time: [],
  352. warehouseId: '',
  353. colorKey: '',
  354. modelType: '',
  355. // type: 1
  356. },
  357. loading: false,
  358. isPrice: 1,
  359. total: 0,
  360. status: [
  361. { label: '未审核', class: 'ele-text-info' },
  362. { label: '审核中', class: 'ele-text-primary' },
  363. { label: '审核通过', class: 'ele-text-success' },
  364. { label: '驳回', class: 'ele-text-danger' }
  365. ],
  366. currentRow: {},
  367. columns: [
  368. // {
  369. // slot: 'selection',
  370. // label: '选择',
  371. // width: 50,
  372. // align: 'center'
  373. // },
  374. {
  375. width: 45,
  376. type: 'selection',
  377. columnKey: 'selection',
  378. align: 'center'
  379. },
  380. {
  381. type: 'index',
  382. label: '序号',
  383. width: 50,
  384. align: 'center'
  385. },
  386. {
  387. prop: 'bizNo',
  388. label: '单号',
  389. align: 'center',
  390. slot: 'bizNo',
  391. showOverflowTooltip: true,
  392. width: 150
  393. },
  394. {
  395. prop: 'warehouseName',
  396. label: '仓库名称',
  397. align: 'center',
  398. showOverflowTooltip: true,
  399. minWidth: 100,
  400. },
  401. {
  402. prop: 'bizType',
  403. slot: 'bizType',
  404. label: '入库类型',
  405. align: 'center',
  406. showOverflowTooltip: true,
  407. width: 100
  408. },
  409. {
  410. prop: 'assetType',
  411. slot: 'assetType',
  412. label: '物品类型',
  413. align: 'center',
  414. showOverflowTooltip: true,
  415. width: 120
  416. },
  417. {
  418. prop: 'categoryNames',
  419. label: '物品名称',
  420. align: 'center',
  421. showOverflowTooltip: true,
  422. width: 150
  423. },
  424. {
  425. prop: 'categoryCodes',
  426. label: '物品编码',
  427. align: 'center',
  428. showOverflowTooltip: true,
  429. width: 150
  430. },
  431. {
  432. prop: 'totalQuantity',
  433. label: '数量',
  434. align: 'center',
  435. showOverflowTooltip: true
  436. },
  437. {
  438. prop: 'specification',
  439. label: '规格',
  440. align: 'center',
  441. showOverflowTooltip: true
  442. },
  443. {
  444. prop: 'modelType',
  445. label: '型号',
  446. align: 'center',
  447. showOverflowTooltip: true
  448. },
  449. {
  450. prop: 'colorKey',
  451. label: '颜色',
  452. align: 'center',
  453. showOverflowTooltip: true
  454. },
  455. {
  456. prop: 'modelKey',
  457. label: '机型',
  458. align: 'center',
  459. showOverflowTooltip: true
  460. },
  461. {
  462. prop: 'sourceBizNo',
  463. label: '来源单据',
  464. align: 'center',
  465. showOverflowTooltip: true
  466. },
  467. {
  468. prop: 'createUserName',
  469. label: '入库人',
  470. align: 'center',
  471. showOverflowTooltip: true
  472. },
  473. {
  474. width: 160,
  475. prop: 'storageTime',
  476. label: '入库时间',
  477. align: 'center',
  478. showOverflowTooltip: true
  479. },
  480. {
  481. prop: 'verifyName',
  482. label: '审核人',
  483. align: 'center',
  484. showOverflowTooltip: true
  485. },
  486. // {
  487. // prop: 'startTime',
  488. // label: '开始时间',
  489. // align: 'center',
  490. // showOverflowTooltip: true
  491. // },
  492. {
  493. prop: 'outInStatus',
  494. label: '入库状态',
  495. align: 'center',
  496. showOverflowTooltip: true,
  497. width: 100,
  498. formatter: (row, column, cellValue) => {
  499. if (row.verifyStatus == 2) {
  500. return row.outInStatus == 1
  501. ? '预入库'
  502. : row.outInStatus == 2
  503. ? '部分入库'
  504. : row.outInStatus == 3
  505. ? '已入库'
  506. : '';
  507. }
  508. }
  509. },
  510. {
  511. prop: 'verifyStatus',
  512. label: '状态',
  513. align: 'center',
  514. slot: 'verifyStatus',
  515. showOverflowTooltip: true,
  516. width: 100
  517. },
  518. {
  519. columnKey: 'action',
  520. label: '操作',
  521. width: 250,
  522. align: 'center',
  523. slot: 'action',
  524. showOverflowTooltip: true
  525. }
  526. ],
  527. groupName:'',
  528. };
  529. },
  530. computed: {
  531. clientEnvironmentId() {
  532. return this.$store.state.user.info.clientEnvironmentId;
  533. },
  534. // 是否开启响应式布局
  535. styleResponsive() {
  536. return this.$store.state.theme.styleResponsive;
  537. }
  538. },
  539. created() {
  540. //仓库出入库是否显示金额(0:不显示 1:显示)
  541. parameterGetByCode({
  542. code: 'wms_price'
  543. }).then((res) => {
  544. this.isPrice = res.value;
  545. });
  546. },
  547. mounted() {
  548. this.getCompanyInfo();
  549. this.getTypeList();
  550. this.getFactoryList();
  551. this.getTreeData();
  552. },
  553. methods: {
  554. getCompanyInfo() {
  555. enterprisePage({
  556. pageNum: 1,
  557. size: 200
  558. }).then((res) => {
  559. if (res.list?.length > 0) {
  560. this.groupName = res.list[0].name;
  561. }
  562. });
  563. },
  564. async getTreeData() {
  565. this.formData.warehouseId = '';
  566. try {
  567. let res = await storageApi.getWarehouseTrees({
  568. factoryId: this.formData.factoryId
  569. });
  570. if (res?.code === '0') {
  571. this.warehouseList = res.data;
  572. }
  573. } catch (error) {
  574. console.log(error);
  575. }
  576. },
  577. //获取工厂列表
  578. async getFactoryList() {
  579. const res = await warehouseDefinition.getFactoryarea({
  580. pageNum: 1,
  581. size: 9999,
  582. type: 1
  583. });
  584. this.factoryList = res.list;
  585. },
  586. // 单击获取id
  587. cellClick(row) {
  588. this.currentRow = row;
  589. },
  590. shelves() {
  591. console.log('上架');
  592. },
  593. unShelves() {
  594. console.log('下架');
  595. },
  596. priceMaintenance() {
  597. if (this.selection.length != 1) {
  598. return this.$message.error('请选择一条单据');
  599. } else {
  600. if (this.selection[0].verifyStatus == 2) {
  601. this.$router.push({
  602. path: '/warehouseManagement/stockManagement/priceMaintenance',
  603. query: {
  604. ids: this.selection[0].id
  605. }
  606. });
  607. /* this.$refs.priceMaintenanceDialogRef.open(this.selection[0].id); */
  608. } else {
  609. this.$message.error('该单据未审核通过');
  610. }
  611. }
  612. },
  613. async outbound() {
  614. if (this.selection.length != 1) {
  615. return this.$message.warning('请选择一条单据');
  616. } else {
  617. if (this.selection[0].verifyStatus == 2) {
  618. const res = await storageApi.getInboundDetailsById(
  619. this.selection[0].id
  620. );
  621. const arr = [];
  622. for (const key in res.outInDetailList) {
  623. for (const k in res.outInDetailList[key]
  624. .outInDetailRecordRequestList) {
  625. arr.push({
  626. ...res.outInDetailList[key].outInDetailRecordRequestList[k]
  627. });
  628. }
  629. }
  630. let ids = arr.map((item) => item.id).join(',');
  631. this.$router.push({
  632. path: '/warehouseManagement/outgoingManagement/add',
  633. query: {
  634. ids,
  635. bizType: this.currentRow.bizType,
  636. assetType: this.currentRow.extInfo.assetType
  637. }
  638. });
  639. } else {
  640. this.$message.error('该单据未审核通过');
  641. }
  642. }
  643. },
  644. handleAssetType(r) {
  645. let arr = r?.split(',') || [];
  646. const filteredData = this.codeList.filter((item) =>
  647. arr.includes(item.dictCode)
  648. );
  649. return filteredData.map((item) => item.dictValue).join(',');
  650. },
  651. async getTypeList() {
  652. const { data } = await allCategoryLevel();
  653. this.codeList = data.map((item) => {
  654. return { dictCode: item.id, dictValue: item.name };
  655. });
  656. },
  657. submit(row) {
  658. this.$confirm('此操作将提交流程, 是否继续?', '提示', {
  659. confirmButtonText: '确定',
  660. cancelButtonText: '取消',
  661. type: 'warning'
  662. })
  663. .then(async () => {
  664. this.loading = true;
  665. const data = await storageApi.submitTwo({ outInId: row.id });
  666. this.loading = false;
  667. if (data.code == 0) {
  668. this.$message.success(data.message);
  669. this.getList();
  670. }
  671. })
  672. .catch(() => {});
  673. },
  674. handleBizType(code) {
  675. for (const key in this.sceneState) {
  676. if (this.sceneState[key].code == code) {
  677. return this.sceneState[key].label;
  678. }
  679. }
  680. },
  681. async datasource({ page, limit, where }) {
  682. const params = Object.assign({}, this.formData);
  683. if (params.time?.length) {
  684. params.startTime = params.time[0];
  685. params.endTime = params.time[1];
  686. }
  687. delete params.time;
  688. // params.bizStatus = 1;
  689. const res = await storageApi.getInboundList({
  690. pageNum: page,
  691. size: limit,
  692. type: 1,
  693. ...params
  694. });
  695. return res;
  696. },
  697. getAuditStatus: useDict(auditStatus),
  698. getList() {
  699. this.$refs.table.reload();
  700. },
  701. add(row) {
  702. const query = {};
  703. if (row?.id) {
  704. query.id = row.id;
  705. }
  706. this.$router.push({
  707. path: '/warehouseManagement/stockManagement/add'
  708. // query
  709. });
  710. },
  711. quality(row) {
  712. this.$router.push({
  713. path: '/warehouseManagement/stockManagement/quality',
  714. query: {
  715. id: row.id
  716. }
  717. });
  718. },
  719. exportExcel() {
  720. this.$router.push({
  721. path: '/warehouseManagement/stockManagement/add_export'
  722. // query
  723. });
  724. },
  725. edit(row) {
  726. this.$router.push({
  727. path: '/warehouseManagement/stockManagement/add',
  728. query: {
  729. detailId: row.id
  730. }
  731. });
  732. },
  733. details(row) {
  734. this.$router.push({
  735. path: '/warehouseManagement/stockManagement/details',
  736. query: {
  737. id: row.id,
  738. verifyStatus: row.verifyStatus
  739. }
  740. });
  741. },
  742. async deleted(row) {
  743. this.$confirm('是否确定删除?', '提示', {
  744. confirmButtonText: '确定',
  745. cancelButtonText: '取消',
  746. type: 'warning'
  747. })
  748. .then(async () => {
  749. const data = await storageApi.delete([row.id]);
  750. if (data.code == '0') {
  751. this.$message.success('删除成功!');
  752. this.getList();
  753. }
  754. })
  755. .catch(() => {});
  756. },
  757. handleCurrentChange() {
  758. this.getList();
  759. },
  760. handleSizeChange() {
  761. this.formData.page = 1;
  762. this.getList();
  763. },
  764. search() {
  765. this.formData.page = 1;
  766. this.getList();
  767. },
  768. reset() {
  769. this.$refs.formName.resetFields();
  770. this.search();
  771. },
  772. print() {
  773. if (this.selection.length != 1) {
  774. return this.$message({
  775. message: '请先选择一条单据',
  776. type: 'warning',
  777. duration: 2000
  778. });
  779. }
  780. if (this.selection[0].verifyStatus !== 2) {
  781. return this.$message({
  782. message: '该单据未审核通过',
  783. type: 'warning',
  784. duration: 2000
  785. });
  786. }
  787. console.log(this.selection[0]);
  788. this.$refs.printQRCodeRef.init(this.selection[0].id);
  789. console.log('print');
  790. },
  791. printkEnter() {
  792. if (this.selection.length != 1) {
  793. return this.$message({
  794. message: '请先选择一条单据',
  795. type: 'warning',
  796. duration: 2000
  797. });
  798. }
  799. this.$refs.printStockEnterRef.init(this.selection[0].id, this.selection[0]);
  800. },
  801. printkEnterHt() {
  802. // if (this.selection.length != 1) {
  803. // return this.$message({
  804. // message: '请先选择一条单据',
  805. // type: 'warning',
  806. // duration: 2000
  807. // });
  808. // }
  809. this.$refs.printStockEnterHtRef.init( this.selection.map(item => item.id), this.selection);
  810. },
  811. handlePrint(refName) {
  812. if (this.selection.length != 1) {
  813. return this.$message({
  814. message: '请先选择一条单据',
  815. type: 'warning',
  816. duration: 2000
  817. });
  818. }
  819. if (this.selection[0].verifyStatus !== 2) {
  820. return this.$message({
  821. message: '该单据未审核通过',
  822. type: 'warning',
  823. duration: 2000
  824. });
  825. }
  826. this.$refs[refName].init(this.selection[0].id, this.selection[0]);
  827. }
  828. }
  829. };
  830. </script>
  831. <style lang="scss" scoped>
  832. #stockManagement_index {
  833. height: calc(100vh - 96px);
  834. width: 100%;
  835. padding: 10px;
  836. box-sizing: border-box;
  837. // element-ui样式穿透
  838. :deep(.el-card) {
  839. height: 100%;
  840. .el-card__body {
  841. height: 100%;
  842. box-sizing: border-box;
  843. display: flex;
  844. flex-direction: column;
  845. .ele-pro-table {
  846. flex: 1;
  847. display: flex;
  848. flex-direction: column;
  849. .el-table {
  850. flex: 1;
  851. // display: flex;
  852. // flex-direction: column;
  853. // .el-table__body-wrapper {
  854. // flex: 1;
  855. // }
  856. }
  857. }
  858. }
  859. .el-form-item {
  860. margin-bottom: 5px !important;
  861. }
  862. }
  863. .w100 {
  864. width: 100% !important;
  865. }
  866. .p20 {
  867. padding: 20px;
  868. }
  869. .mt20 {
  870. margin-top: 20px;
  871. }
  872. .mt10 {
  873. margin-top: 10px;
  874. }
  875. .el-form {
  876. overflow: hidden;
  877. }
  878. .float-right {
  879. float: right;
  880. text-align: right;
  881. margin-right: 20px;
  882. }
  883. .right {
  884. text-align: right;
  885. }
  886. .col {
  887. color: #aaa;
  888. }
  889. .pr10 {
  890. padding-right: 10px;
  891. }
  892. }
  893. </style>