index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  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-dropdown trigger="click" :disabled="selection?.length === 0">
  211. <el-button type="primary" class="el-icon-printer" size="small">
  212. 打印<i class="el-icon-arrow-down el-icon--right"></i>
  213. </el-button>
  214. <el-dropdown-menu slot="dropdown">
  215. <el-dropdown-item
  216. @click.native="print"
  217. >打印</el-dropdown-item
  218. >
  219. <el-dropdown-item
  220. v-if="$hasPermission('wms:outin:printIn')"
  221. @click.native="printkEnter"
  222. >打印入库单</el-dropdown-item
  223. >
  224. <el-dropdown-item
  225. v-if="$hasPermission('wms:outin:printInHt')"
  226. @click.native="printkEnterHt"
  227. >打印入库单</el-dropdown-item
  228. >
  229. <el-dropdown-item
  230. v-if="$hasPermission('wms:outin:printIn1')"
  231. @click.native="handlePrint('printTemplateTrRef')"
  232. >打印采购入库单</el-dropdown-item
  233. >
  234. </el-dropdown-menu>
  235. </el-dropdown>
  236. <!-- <el-button icon="el-icon-printer" type="primary" @click="print"
  237. >打印</el-button
  238. > -->
  239. <!-- <el-button icon="el-icon-printer" type="primary" @click="printkEnter" v-if="$hasPermission('wms:outin:printIn')"
  240. >打印入库单</el-button
  241. > -->
  242. <!-- <el-button icon="el-icon-printer" type="primary" @click="printkEnterHt" v-if="$hasPermission('wms:outin:printInHt')"
  243. >打印入库单</el-button
  244. > -->
  245. <!-- <el-button icon="el-icon-printer" type="primary" @click="handlePrint('printTemplateTrRef')" v-if="$hasPermission('wms:outin:printIn1')"
  246. >打印采购入库单</el-button
  247. > -->
  248. <!-- <el-button
  249. icon="el-icon-plus"
  250. v-if="clientEnvironmentId == 4"
  251. type="primary"
  252. @click="exportExcel"
  253. >导入</el-button
  254. > -->
  255. </template>
  256. <!-- 状态 -->
  257. <template v-slot:verifyStatus="{ row }">
  258. <span :class="status[row.verifyStatus]?.class">
  259. {{ status[row.verifyStatus]?.label }}
  260. </span>
  261. </template>
  262. <!-- 单号链接 -->
  263. <template v-slot:bizNo="{ row }">
  264. <el-link type="primary" @click="details(row)">
  265. {{ row.bizNo }}
  266. </el-link>
  267. </template>
  268. <!-- 操作列 -->
  269. <template v-slot:action="{ row }">
  270. <el-link
  271. type="success"
  272. :underline="false"
  273. icon="el-icon-position"
  274. v-if="row.verifyStatus == 0 || row.verifyStatus == 3"
  275. @click="submit(row)"
  276. >
  277. 提交
  278. </el-link>
  279. <el-link
  280. type="primary"
  281. :underline="false"
  282. icon="el-icon-view"
  283. @click="edit(row)"
  284. v-if="row.verifyStatus == 0 || row.verifyStatus == 3"
  285. >
  286. 修改
  287. </el-link>
  288. <!-- <el-link v-if="row.verifyStatus == 2 && clientEnvironmentId == 3" type="primary" :underline="false"
  289. icon="el-icon-view" @click="quality(row)">
  290. 质检
  291. </el-link> -->
  292. <el-link
  293. v-if="row.verifyStatus == 2"
  294. type="primary"
  295. :underline="false"
  296. icon="el-icon-sort-up"
  297. @click="handleShelving(row, 'list')"
  298. >
  299. 上架
  300. </el-link>
  301. <el-link
  302. v-if="row.verifyStatus == 2"
  303. type="primary"
  304. :underline="false"
  305. icon="el-icon-sort-down"
  306. @click="handleShelving(row, 'list', 'down')"
  307. >
  308. 下架
  309. </el-link>
  310. <el-link
  311. type="primary"
  312. v-if="row.verifyStatus == 0 || row.verifyStatus == 3"
  313. :underline="false"
  314. icon="el-icon-delete"
  315. @click="deleted(row)"
  316. >
  317. 删除
  318. </el-link>
  319. </template>
  320. <template v-slot:bizType="{ row }">
  321. {{ handleBizType(row.bizType) }}
  322. </template>
  323. <template v-slot:assetType="{ row }">
  324. {{ handleAssetType(row.extInfo.assetType) }}
  325. </template>
  326. </ele-pro-table>
  327. </el-card>
  328. <printQRCode ref="printQRCodeRef"></printQRCode>
  329. <printStockEnter ref="printStockEnterRef" :groupName="groupName"></printStockEnter>
  330. <printTemplateTr ref="printTemplateTrRef" :groupName="groupName"></printTemplateTr>
  331. <printStockEnterHt ref="printStockEnterHtRef" :groupName="groupName"></printStockEnterHt>
  332. <ItemListed ref="itemListedRef" @done="search" />
  333. <!-- <priceMaintenanceDialog ref="priceMaintenanceDialogRef" /> -->
  334. </div>
  335. </template>
  336. <script>
  337. import storageApi from '@/api/warehouseManagement';
  338. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  339. /* import priceMaintenanceDialog from './components/priceMaintenanceDialog.vue'; */
  340. import { allCategoryLevel } from '@/api/classifyManage';
  341. import { parameterGetByCode } from '@/api/sys/index.js';
  342. ('@/view/warehouseManagement/stockManagement/components/priceMaintenanceDialog.vue');
  343. import printQRCode from './components/printQRCode.vue';
  344. import printStockEnter from './components/printStockEnter.vue';
  345. import printTemplateTr from './components/print-template-tr.vue';
  346. import printStockEnterHt from './components/printStockEnterHt.vue';
  347. import ItemListed from './components/itemListed.vue';
  348. import tabMixins from '@/mixins/tableColumnsMixin';
  349. import {
  350. warehousingType,
  351. sceneState,
  352. auditStatus,
  353. useDict
  354. } from '@/utils/dict/index';
  355. import { enterprisePage } from '@/api/bpm/index.js';
  356. export default {
  357. mixins: [tabMixins],
  358. components: { printQRCode, printStockEnter, printTemplateTr, printStockEnterHt, ItemListed },
  359. data() {
  360. return {
  361. cacheKeyUrl: '202606011119-wms-stockManagement-index',
  362. auditStatus,
  363. selection: [],
  364. warehousingType,
  365. sceneState,
  366. codeList: [],
  367. factoryList: [],
  368. warehouseList: [],
  369. tableData: [],
  370. formData: {
  371. deptIds: '',
  372. categoryCode: '',
  373. categoryName: '',
  374. sourceBizNo: '',
  375. startTime: '',
  376. endTime: '',
  377. status: '',
  378. factoryId: '',
  379. time: [],
  380. warehouseId: '',
  381. colorKey: '',
  382. modelType: '',
  383. bizNo: '',
  384. bizType: '',
  385. // type: 1
  386. },
  387. loading: false,
  388. isPrice: 1,
  389. total: 0,
  390. status: [
  391. { label: '未审核', class: 'ele-text-info' },
  392. { label: '审核中', class: 'ele-text-primary' },
  393. { label: '审核通过', class: 'ele-text-success' },
  394. { label: '驳回', class: 'ele-text-danger' }
  395. ],
  396. currentRow: {},
  397. columns: [
  398. // {
  399. // slot: 'selection',
  400. // label: '选择',
  401. // width: 50,
  402. // align: 'center'
  403. // },
  404. {
  405. width: 45,
  406. type: 'selection',
  407. columnKey: 'selection',
  408. align: 'center'
  409. },
  410. {
  411. type: 'index',
  412. label: '序号',
  413. width: 50,
  414. align: 'center'
  415. },
  416. {
  417. prop: 'bizNo',
  418. label: '单号',
  419. align: 'center',
  420. slot: 'bizNo',
  421. showOverflowTooltip: true,
  422. width: 150
  423. },
  424. {
  425. prop: 'warehouseName',
  426. label: '仓库名称',
  427. align: 'center',
  428. showOverflowTooltip: true,
  429. minWidth: 100,
  430. },
  431. {
  432. prop: 'bizType',
  433. slot: 'bizType',
  434. label: '入库类型',
  435. align: 'center',
  436. showOverflowTooltip: true,
  437. width: 100
  438. },
  439. {
  440. prop: 'assetType',
  441. slot: 'assetType',
  442. label: '物品类型',
  443. align: 'center',
  444. showOverflowTooltip: true,
  445. width: 120
  446. },
  447. {
  448. prop: 'categoryNames',
  449. label: '物品名称',
  450. align: 'center',
  451. showOverflowTooltip: true,
  452. width: 150
  453. },
  454. {
  455. prop: 'categoryCodes',
  456. label: '物品编码',
  457. align: 'center',
  458. showOverflowTooltip: true,
  459. width: 150
  460. },
  461. {
  462. prop: 'totalQuantity',
  463. label: '数量',
  464. align: 'center',
  465. showOverflowTooltip: true
  466. },
  467. {
  468. prop: 'specification',
  469. label: '规格',
  470. align: 'center',
  471. showOverflowTooltip: true
  472. },
  473. {
  474. prop: 'modelType',
  475. label: '型号',
  476. align: 'center',
  477. showOverflowTooltip: true
  478. },
  479. {
  480. prop: 'colorKey',
  481. label: '颜色',
  482. align: 'center',
  483. showOverflowTooltip: true
  484. },
  485. {
  486. prop: 'modelKey',
  487. label: '机型',
  488. align: 'center',
  489. showOverflowTooltip: true
  490. },
  491. {
  492. prop: 'sourceBizNo',
  493. label: '来源单据',
  494. align: 'center',
  495. showOverflowTooltip: true
  496. },
  497. {
  498. prop: 'createUserName',
  499. label: '入库人',
  500. align: 'center',
  501. showOverflowTooltip: true
  502. },
  503. {
  504. width: 160,
  505. prop: 'storageTime',
  506. label: '入库时间',
  507. align: 'center',
  508. showOverflowTooltip: true
  509. },
  510. {
  511. prop: 'verifyName',
  512. label: '审核人',
  513. align: 'center',
  514. showOverflowTooltip: true
  515. },
  516. // {
  517. // prop: 'startTime',
  518. // label: '开始时间',
  519. // align: 'center',
  520. // showOverflowTooltip: true
  521. // },
  522. {
  523. prop: 'outInStatus',
  524. label: '入库状态',
  525. align: 'center',
  526. showOverflowTooltip: true,
  527. width: 100,
  528. formatter: (row, column, cellValue) => {
  529. if (row.verifyStatus == 2) {
  530. return row.outInStatus == 1
  531. ? '预入库'
  532. : row.outInStatus == 2
  533. ? '部分入库'
  534. : row.outInStatus == 3
  535. ? '已入库'
  536. : '';
  537. }
  538. }
  539. },
  540. {
  541. prop: 'verifyStatus',
  542. label: '状态',
  543. align: 'center',
  544. slot: 'verifyStatus',
  545. showOverflowTooltip: true,
  546. width: 100
  547. },
  548. {
  549. columnKey: 'action',
  550. label: '操作',
  551. width: 250,
  552. align: 'center',
  553. slot: 'action',
  554. showOverflowTooltip: true
  555. }
  556. ],
  557. groupName:'',
  558. };
  559. },
  560. computed: {
  561. clientEnvironmentId() {
  562. return this.$store.state.user.info.clientEnvironmentId;
  563. },
  564. // 是否开启响应式布局
  565. styleResponsive() {
  566. return this.$store.state.theme.styleResponsive;
  567. }
  568. },
  569. created() {
  570. //仓库出入库是否显示金额(0:不显示 1:显示)
  571. parameterGetByCode({
  572. code: 'wms_price'
  573. }).then((res) => {
  574. this.isPrice = res.value;
  575. });
  576. },
  577. mounted() {
  578. this.getCompanyInfo();
  579. this.getTypeList();
  580. this.getFactoryList();
  581. this.getTreeData();
  582. },
  583. methods: {
  584. getCompanyInfo() {
  585. enterprisePage({
  586. pageNum: 1,
  587. size: 200
  588. }).then((res) => {
  589. if (res.list?.length > 0) {
  590. this.groupName = res.list[0].name;
  591. }
  592. });
  593. },
  594. async getTreeData() {
  595. this.formData.warehouseId = '';
  596. try {
  597. let res = await storageApi.getWarehouseTrees({
  598. factoryId: this.formData.factoryId
  599. });
  600. if (res?.code === '0') {
  601. this.warehouseList = res.data;
  602. }
  603. } catch (error) {
  604. console.log(error);
  605. }
  606. },
  607. //获取工厂列表
  608. async getFactoryList() {
  609. const res = await warehouseDefinition.getFactoryarea({
  610. pageNum: 1,
  611. size: 9999,
  612. type: 1
  613. });
  614. this.factoryList = res.list;
  615. },
  616. // 单击获取id
  617. cellClick(row) {
  618. this.currentRow = row;
  619. },
  620. shelves() {
  621. console.log('上架');
  622. },
  623. handleShelving(row, type, action) {
  624. this.$refs.itemListedRef.open(row, type, action);
  625. },
  626. unShelves() {
  627. console.log('下架');
  628. },
  629. priceMaintenance() {
  630. if (this.selection.length != 1) {
  631. return this.$message.error('请选择一条单据');
  632. } else {
  633. if (this.selection[0].verifyStatus == 2) {
  634. this.$router.push({
  635. path: '/warehouseManagement/stockManagement/priceMaintenance',
  636. query: {
  637. ids: this.selection[0].id
  638. }
  639. });
  640. /* this.$refs.priceMaintenanceDialogRef.open(this.selection[0].id); */
  641. } else {
  642. this.$message.error('该单据未审核通过');
  643. }
  644. }
  645. },
  646. async outbound() {
  647. if (this.selection.length != 1) {
  648. return this.$message.warning('请选择一条单据');
  649. } else {
  650. if (this.selection[0].verifyStatus == 2) {
  651. const res = await storageApi.getInboundDetailsById(
  652. this.selection[0].id
  653. );
  654. const arr = [];
  655. for (const key in res.outInDetailList) {
  656. for (const k in res.outInDetailList[key]
  657. .outInDetailRecordRequestList) {
  658. arr.push({
  659. ...res.outInDetailList[key].outInDetailRecordRequestList[k]
  660. });
  661. }
  662. }
  663. let ids = arr.map((item) => item.id).join(',');
  664. this.$router.push({
  665. path: '/warehouseManagement/outgoingManagement/add',
  666. query: {
  667. ids,
  668. bizType: this.currentRow.bizType,
  669. assetType: this.currentRow.extInfo.assetType
  670. }
  671. });
  672. } else {
  673. this.$message.error('该单据未审核通过');
  674. }
  675. }
  676. },
  677. handleAssetType(r) {
  678. let arr = r?.split(',') || [];
  679. const filteredData = this.codeList.filter((item) =>
  680. arr.includes(item.dictCode)
  681. );
  682. return filteredData.map((item) => item.dictValue).join(',');
  683. },
  684. async getTypeList() {
  685. const { data } = await allCategoryLevel();
  686. this.codeList = data.map((item) => {
  687. return { dictCode: item.id, dictValue: item.name };
  688. });
  689. },
  690. submit(row) {
  691. this.$confirm('此操作将提交流程, 是否继续?', '提示', {
  692. confirmButtonText: '确定',
  693. cancelButtonText: '取消',
  694. type: 'warning'
  695. })
  696. .then(async () => {
  697. this.loading = true;
  698. const data = await storageApi.submitTwo({ outInId: row.id });
  699. this.loading = false;
  700. if (data.code == 0) {
  701. this.$message.success(data.message);
  702. this.getList();
  703. }
  704. })
  705. .catch(() => {});
  706. },
  707. handleBizType(code) {
  708. for (const key in this.sceneState) {
  709. if (this.sceneState[key].code == code) {
  710. return this.sceneState[key].label;
  711. }
  712. }
  713. },
  714. async datasource({ page, limit, where }) {
  715. const params = Object.assign({}, this.formData);
  716. if (params.time?.length) {
  717. params.startTime = params.time[0];
  718. params.endTime = params.time[1];
  719. }
  720. delete params.time;
  721. // params.bizStatus = 1;
  722. const res = await storageApi.getInboundList({
  723. pageNum: page,
  724. size: limit,
  725. type: 1,
  726. ...params
  727. });
  728. return res;
  729. },
  730. getAuditStatus: useDict(auditStatus),
  731. getList() {
  732. this.$refs.table.reload();
  733. },
  734. add(row) {
  735. const query = {};
  736. if (row?.id) {
  737. query.id = row.id;
  738. }
  739. this.$router.push({
  740. path: '/warehouseManagement/stockManagement/add'
  741. // query
  742. });
  743. },
  744. quality(row) {
  745. this.$router.push({
  746. path: '/warehouseManagement/stockManagement/quality',
  747. query: {
  748. id: row.id
  749. }
  750. });
  751. },
  752. exportExcel() {
  753. this.$router.push({
  754. path: '/warehouseManagement/stockManagement/add_export'
  755. // query
  756. });
  757. },
  758. edit(row) {
  759. this.$router.push({
  760. path: '/warehouseManagement/stockManagement/add',
  761. query: {
  762. detailId: row.id
  763. }
  764. });
  765. },
  766. details(row) {
  767. this.$router.push({
  768. path: '/warehouseManagement/stockManagement/details',
  769. query: {
  770. id: row.id,
  771. verifyStatus: row.verifyStatus
  772. }
  773. });
  774. },
  775. async deleted(row) {
  776. this.$confirm('是否确定删除?', '提示', {
  777. confirmButtonText: '确定',
  778. cancelButtonText: '取消',
  779. type: 'warning'
  780. })
  781. .then(async () => {
  782. const data = await storageApi.delete([row.id]);
  783. if (data.code == '0') {
  784. this.$message.success('删除成功!');
  785. this.getList();
  786. }
  787. })
  788. .catch(() => {});
  789. },
  790. handleCurrentChange() {
  791. this.getList();
  792. },
  793. handleSizeChange() {
  794. this.formData.page = 1;
  795. this.getList();
  796. },
  797. search() {
  798. this.formData.page = 1;
  799. this.getList();
  800. },
  801. reset() {
  802. this.$refs.formName.resetFields();
  803. this.search();
  804. },
  805. print() {
  806. if (this.selection.length != 1) {
  807. return this.$message({
  808. message: '请先选择一条单据',
  809. type: 'warning',
  810. duration: 2000
  811. });
  812. }
  813. if (this.selection[0].verifyStatus !== 2) {
  814. return this.$message({
  815. message: '该单据未审核通过',
  816. type: 'warning',
  817. duration: 2000
  818. });
  819. }
  820. console.log(this.selection[0]);
  821. this.$refs.printQRCodeRef.init(this.selection[0].id);
  822. console.log('print');
  823. },
  824. printkEnter() {
  825. if (this.selection.length != 1) {
  826. return this.$message({
  827. message: '请先选择一条单据',
  828. type: 'warning',
  829. duration: 2000
  830. });
  831. }
  832. this.$refs.printStockEnterRef.init(this.selection[0].id, this.selection[0]);
  833. },
  834. printkEnterHt() {
  835. if (this.selection.length == 0) {
  836. return this.$message({
  837. message: '请先选择单据',
  838. type: 'warning',
  839. duration: 2000
  840. });
  841. }
  842. this.$refs.printStockEnterHtRef.init( this.selection.map(item => item.id), this.selection);
  843. },
  844. handlePrint(refName) {
  845. if (this.selection.length != 1) {
  846. return this.$message({
  847. message: '请先选择一条单据',
  848. type: 'warning',
  849. duration: 2000
  850. });
  851. }
  852. if (this.selection[0].verifyStatus !== 2) {
  853. return this.$message({
  854. message: '该单据未审核通过',
  855. type: 'warning',
  856. duration: 2000
  857. });
  858. }
  859. this.$refs[refName].init(this.selection[0].id, this.selection[0]);
  860. }
  861. }
  862. };
  863. </script>
  864. <style lang="scss" scoped>
  865. #stockManagement_index {
  866. height: calc(100vh - 96px);
  867. width: 100%;
  868. padding: 10px;
  869. box-sizing: border-box;
  870. // element-ui样式穿透
  871. :deep(.el-card) {
  872. height: 100%;
  873. .el-card__body {
  874. height: 100%;
  875. box-sizing: border-box;
  876. display: flex;
  877. flex-direction: column;
  878. .ele-pro-table {
  879. flex: 1;
  880. display: flex;
  881. flex-direction: column;
  882. .el-table {
  883. flex: 1;
  884. // display: flex;
  885. // flex-direction: column;
  886. // .el-table__body-wrapper {
  887. // flex: 1;
  888. // }
  889. }
  890. }
  891. }
  892. .el-form-item {
  893. margin-bottom: 5px !important;
  894. }
  895. }
  896. .w100 {
  897. width: 100% !important;
  898. }
  899. .p20 {
  900. padding: 20px;
  901. }
  902. .mt20 {
  903. margin-top: 20px;
  904. }
  905. .mt10 {
  906. margin-top: 10px;
  907. }
  908. .el-form {
  909. overflow: hidden;
  910. }
  911. .float-right {
  912. float: right;
  913. text-align: right;
  914. margin-right: 20px;
  915. }
  916. .right {
  917. text-align: right;
  918. }
  919. .col {
  920. color: #aaa;
  921. }
  922. .pr10 {
  923. padding-right: 10px;
  924. }
  925. }
  926. </style>