store-manage-2.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335
  1. <!-- 库存管理 -->
  2. <template>
  3. <div class="container">
  4. <div class="total-warp">
  5. <div class="h2">今日剩余</div>
  6. <div class="total-box">
  7. <div
  8. class="active"
  9. style="width: 7%; text-align: center"
  10. @click="getAll"
  11. :style="
  12. params.technologyType == null && params.purpose == null
  13. ? 'border:2px solid #0077ff'
  14. : ''
  15. "
  16. >
  17. 全部
  18. </div>
  19. <div
  20. class="mianliao"
  21. :style="
  22. params.technologyType == 5
  23. ? 'border:2px solid #0077ff'
  24. : ''
  25. "
  26. style="width: 50%"
  27. @click="mianliaoTbleLineCk({ name: '面料' }, 5)"
  28. >
  29. <div class="label" style="border-right: 2px solid #dcdcdc">
  30. <Icon
  31. type="md-add"
  32. v-if="!tableModalType"
  33. style="margin-right: 15px"
  34. @click.native="tableModalType = true"
  35. />
  36. <Icon
  37. type="md-remove"
  38. v-else
  39. @click="tableModalType = false"
  40. style="margin-right: 15px"
  41. />
  42. <span>面料库存</span>
  43. </div>
  44. <ul>
  45. <li>
  46. 卷数
  47. <span>{{ totalData.fabric.count }}</span>
  48. </li>
  49. <li>
  50. 米数
  51. <span>{{ totalData.fabric.sum }}</span>
  52. </li>
  53. <li>
  54. 面积
  55. <span>{{ totalData.fabric.measureArea }}</span>
  56. </li>
  57. <li>
  58. 金额
  59. <span>{{ totalData.fabric.money }}</span>
  60. </li>
  61. </ul>
  62. </div>
  63. <div
  64. class="moshui"
  65. style="width: 40%"
  66. @click="moshuiCk"
  67. :style="
  68. params.technologyType == 3
  69. ? 'border:2px solid #0077ff'
  70. : ''
  71. "
  72. >
  73. <div class="label" style="border-right: 1px solid #dcdcdc">
  74. <span>墨水库存</span>
  75. </div>
  76. <ul>
  77. <li>
  78. 件数
  79. <span>{{ totalData.ink.count }}</span>
  80. </li>
  81. <li>
  82. 千克
  83. <span>{{ totalData.ink.sum }}</span>
  84. </li>
  85. <li>
  86. 金额
  87. <span>{{ totalData.ink.money }}</span>
  88. </li>
  89. </ul>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="table-modal" v-if="tableModalType">
  94. <div style="width: 49%">
  95. <Table
  96. :columns="columns1"
  97. @on-row-click="mianliaoTbleLineCk"
  98. :row-class-name="rowClassName2"
  99. height="195"
  100. :data="totalData.typeStatistics"
  101. size="small"
  102. ></Table>
  103. </div>
  104. <div style="width: 49%">
  105. <Table
  106. @on-row-click="yongtuTbleLineCk"
  107. :row-class-name="rowClassName"
  108. :columns="columns2"
  109. height="195"
  110. :data="totalData.purposeStatistics"
  111. size="small"
  112. ></Table>
  113. </div>
  114. </div>
  115. <div class="table-filter">
  116. <div class="filter-item"></div>
  117. <div style="float: right">
  118. <div class="filter-item">
  119. <Button
  120. type="error"
  121. style="width: 90px"
  122. @click="toInventory"
  123. >发起盘点</Button
  124. >
  125. </div>
  126. </div>
  127. <div class="filter-item" style="float: right">
  128. 滞留:在库时间超过{{ delayPeriod || 0 }}天
  129. </div>
  130. <div class="filter-item">
  131. <Checkbox
  132. v-model="params.inventoryResults"
  133. true-value="0"
  134. false-value=""
  135. @on-change="errChange"
  136. >筛选异常</Checkbox
  137. >
  138. </div>
  139. <div class="filter-item" @keyup.enter="getList">
  140. <Poptip trigger="focus" width="250" placement="bottom">
  141. <div slot="content">
  142. <ul style="" class="commons-select-search">
  143. <li
  144. :key="i.id"
  145. v-for="i in materialList"
  146. @click="params.keyword = i.name"
  147. >
  148. {{ i.name }}
  149. </li>
  150. </ul>
  151. </div>
  152. <Input
  153. v-model="params.keyword"
  154. @on-change="getMaterialSelectList"
  155. placeholder="请输入物料名称"
  156. ></Input>
  157. </Poptip>
  158. </div>
  159. <div class="filter-item" style="width: 160px">
  160. <my-tree-select
  161. v-model="params.categoryCode"
  162. :treeData="materialTreeData"
  163. placeholder="请选择物料类型"
  164. ></my-tree-select>
  165. </div>
  166. <div class="filter-item" style="width: 160px">
  167. <Select v-model="params.houseId" clearable>
  168. <Option
  169. v-for="item in stockList"
  170. :value="item.value"
  171. :key="item.value"
  172. >{{ item.label }}</Option
  173. >
  174. </Select>
  175. </div>
  176. <div class="filter-item">
  177. <Button type="primary" style="width: 90px" @click="search"
  178. >查询</Button
  179. >
  180. </div>
  181. <div class="filter-item">
  182. <Button
  183. type="primary"
  184. style="width: 90px"
  185. @click="$router.push('store_warning')"
  186. >库存预警</Button
  187. >
  188. </div>
  189. <div class="filter-item">
  190. <Button type="primary" style="width: 90px" @click="exportExcel"
  191. >导出Excel</Button
  192. >
  193. </div>
  194. <div class="filter-item">
  195. <Button type="primary" style="width: 90px" @click="exportExcel2"
  196. >导出详情</Button
  197. >
  198. </div>
  199. </div>
  200. <div class="line" style="margin-bottom: 10px"></div>
  201. <!--用途(原来代码)-->
  202. <!--<div class="table-filter" style="height: auto;padding-bottom: 0">
  203. <div class="filter-item">
  204. <Button
  205. :type="itemIndex === '' ? 'primary' : 'default'"
  206. style="width: 90px;margin-bottom: 10px"
  207. @click="itemClick()">
  208. 全部
  209. </Button>
  210. </div>
  211. <div class="filter-item" v-for="(item, index) in itemData" :key="index">
  212. <Button
  213. v-if="item"
  214. :type="itemIndex === index ? 'primary' : 'default'"
  215. style="min-width: 90px;margin-bottom: 10px"
  216. @click="itemClick(index, item)">
  217. {{ item }}
  218. </Button>
  219. </div>
  220. </div>-->
  221. <!-- 表格 -->
  222. <div class="table-content-wrap">
  223. <div class="table-content">
  224. <div
  225. v-if="data.length === 0"
  226. style="
  227. font-size: 16px;
  228. font-weight: bold;
  229. height: 100%;
  230. display: flex;
  231. justify-content: center;
  232. align-items: center;
  233. "
  234. >
  235. 暂无数据
  236. </div>
  237. <Collapse
  238. :value="item.storageDetails ? '1' : '0'"
  239. v-for="(item, index) in data"
  240. :key="index"
  241. @on-change="open(item)"
  242. >
  243. <Panel name="1">
  244. <div class="table-item">
  245. <div class="row">
  246. <div class="col">
  247. 物料类型:{{ item.categoryName }}
  248. </div>
  249. <div class="col">
  250. 物料编码:{{ item.materialCode }}
  251. </div>
  252. <div class="col">
  253. 物料名称:{{ item.materialName }}
  254. </div>
  255. <div class="col"></div>
  256. <div class="col" style="flex: 0.2"></div>
  257. <div
  258. class="col blue"
  259. style="
  260. padding-right: 15px;
  261. display: flex;
  262. justify-content: space-between;
  263. flex: none;
  264. width: 140px;
  265. "
  266. >
  267. <!-- <span @click="toHistory(0)">入库记录</span>-->
  268. <!-- <span @click="toHistory(1)">出库记录</span>-->
  269. </div>
  270. </div>
  271. <div class="row">
  272. <div class="col">库存数量:{{ item.sum }}</div>
  273. <div class="col">
  274. 库存件数:{{ item.count }}
  275. </div>
  276. <div class="col orange">
  277. 滞留数量:{{ item.retentionQuantity }}
  278. </div>
  279. <div class="col">
  280. 安全库存:{{ item.materialSafetyStock }}
  281. </div>
  282. <div class="col" style="flex: 0.2"></div>
  283. <div
  284. class="col"
  285. style="flex: none; width: 140px"
  286. >
  287. <Button
  288. style="height: 30px; line-height: 1"
  289. @click.stop="showInventory(item)"
  290. >盘点记录</Button
  291. >
  292. </div>
  293. </div>
  294. <div class="row">
  295. <div class="col">
  296. {{
  297. `一楼:${item.yilouSum},四楼:${
  298. item.silouSum || 0
  299. }`
  300. }}
  301. </div>
  302. <div class="col">
  303. {{
  304. `一楼:${item.yilouCount},四楼:${
  305. item.silouCount || 0
  306. }`
  307. }}
  308. </div>
  309. <div class="col"></div>
  310. <div class="col"></div>
  311. <div class="col" style="flex: 0.2"></div>
  312. <div
  313. class="col"
  314. style="flex: none; width: 140px"
  315. ></div>
  316. </div>
  317. <div class="row">
  318. <div class="col red">
  319. 盘点结果:{{ item.inventoryResults === 1 ? '正常' : '异常' }}
  320. </div>
  321. <div
  322. class="col red"
  323. style="
  324. text-decoration: underline;
  325. cursor: pointer;
  326. "
  327. @click.stop="openTag(item)"
  328. >
  329. 库存修正量:{{ item.correctionQuantity }}
  330. </div>
  331. <div class="col">
  332. 盘点人:{{ item.operusername }}
  333. </div>
  334. <div class="col">
  335. 盘点时间:{{ item.checkTime }}
  336. </div>
  337. <div class="col" style="flex: 0.2"></div>
  338. <div
  339. class="col"
  340. style="flex: none; width: 140px"
  341. ></div>
  342. </div>
  343. </div>
  344. <div slot="content" class="content">
  345. <Table
  346. :columns="columns"
  347. :data="item.storageDetails"
  348. max-height="250"
  349. ></Table>
  350. </div>
  351. </Panel>
  352. </Collapse>
  353. <!--查看人工盘点记录-->
  354. <artificial-inventory-record
  355. v-model="inventoryRecordShow"
  356. ></artificial-inventory-record>
  357. </div>
  358. </div>
  359. <!-- 分页 -->
  360. <div class="table-page">
  361. <Page
  362. :current="params.pageNum"
  363. :total="params.total"
  364. :show-total="true"
  365. :page-size="20"
  366. show-elevator
  367. @on-change="changePage"
  368. />
  369. </div>
  370. <inventory-form
  371. v-model="inventoryShow"
  372. :formData="formData"
  373. ></inventory-form>
  374. <tag-form v-model="tagShow" :form-data="formData"></tag-form>
  375. </div>
  376. </template>
  377. <script>
  378. import { exportExcel } from '@/libs/util'
  379. import {
  380. GetStockPageList,
  381. GetStockDetailSum,
  382. GetStockMaterialPurpose,
  383. GetStockTagDetailList,
  384. } from '@/api/stock'
  385. import MyTable from '_c/my-table/my-table'
  386. import artificialInventoryRecord from './artificial-inventory-record'
  387. import InventoryForm from './inventory-form'
  388. import TagForm from './tag-form'
  389. import MyTreeSelect from '_c/my-tree-select/my-tree-select'
  390. import axios from 'axios'
  391. import {
  392. GetMaterialCategoryZTree,
  393. GetMaterialSet,
  394. GetTechnologyTypList,
  395. GetStockHouse,
  396. } from '@/api/baseData'
  397. export default {
  398. name: 'store',
  399. components: {
  400. MyTable,
  401. MyTreeSelect,
  402. artificialInventoryRecord,
  403. InventoryForm,
  404. TagForm,
  405. },
  406. data() {
  407. return {
  408. tableModalType: false,
  409. delayPeriod: 0,
  410. typeName: '属性',
  411. useName: '用途',
  412. tabName: 'open',
  413. tabIndex: 0,
  414. itemIndex: '',
  415. tabs: [],
  416. materialTreeData: [],
  417. stockList: [],
  418. materialCategoryCode: '',
  419. key: '',
  420. filterData: {},
  421. formData: {},
  422. show: false,
  423. inventoryRecordShow: false,
  424. inventoryShow: false,
  425. tagShow: false,
  426. itemData: [],
  427. titleData: {
  428. directSum: {
  429. stockSum: {
  430. sumName: '直喷',
  431. totalAmount: 0,
  432. tagCount: 0,
  433. quantity: 0,
  434. },
  435. stockSumItems: [],
  436. },
  437. heatSum: {
  438. stockSum: {
  439. sumName: '热转',
  440. totalAmount: 0,
  441. tagCount: 0,
  442. quantity: 0,
  443. },
  444. stockSumItems: [],
  445. },
  446. paperSum: {
  447. stockSum: {
  448. sumName: '打纸',
  449. totalAmount: 0,
  450. tagCount: 0,
  451. quantity: 0,
  452. },
  453. stockSumItems: [],
  454. },
  455. },
  456. data: [],
  457. columns1: [
  458. {
  459. title: '按工艺查看',
  460. key: 'name',
  461. },
  462. {
  463. title: '卷数',
  464. key: 'count',
  465. },
  466. {
  467. title: '米数',
  468. key: 'sum',
  469. },
  470. {
  471. title: '面积',
  472. key: 'measureArea',
  473. },
  474. {
  475. title: '金额',
  476. key: 'money',
  477. },
  478. ],
  479. columns2: [
  480. {
  481. title: '按用途查看',
  482. key: 'materialPurpose',
  483. },
  484. {
  485. title: '卷数',
  486. key: 'count',
  487. },
  488. {
  489. title: '米数',
  490. key: 'sum',
  491. },
  492. {
  493. title: '面积',
  494. key: 'measureArea',
  495. },
  496. {
  497. title: '金额',
  498. key: 'money',
  499. },
  500. ],
  501. columns: [
  502. {
  503. title: '序号',
  504. type: 'index',
  505. width: 60,
  506. align: 'center',
  507. },
  508. {
  509. title: '物料标签值',
  510. key: 'rfidCode',
  511. tooltip: true,
  512. minWidth: 150,
  513. },
  514. {
  515. title: '物料数量',
  516. key: 'quantity',
  517. minWidth: 150,
  518. },
  519. {
  520. title: '入库时间',
  521. key: 'createTime',
  522. minWidth: 150,
  523. },
  524. {
  525. title: '在库时间',
  526. key: 'inStockTime',
  527. minWidth: 150,
  528. render: (h, params) => {
  529. return h(
  530. 'span',
  531. {
  532. style:{
  533. color:params.row.inStockTime > 30 ? 'orange' : ''
  534. },
  535. },
  536. params.row.inStockTime
  537. )
  538. },
  539. },
  540. {
  541. title: '所在仓库',
  542. key: 'houseName',
  543. minWidth: 150,
  544. },
  545. {
  546. title: '库位',
  547. key: 'areaName',
  548. minWidth: 150,
  549. },
  550. {
  551. title: '质检状态',
  552. key: 'quantityCheckState',
  553. minWidth: 150,
  554. render: (h, params) => {
  555. return h(
  556. 'span',
  557. params.row.quantityCheckState === 0
  558. ? '未质检'
  559. : params.row.quantityCheckState === 1
  560. ? '已质检'
  561. : params.row.quantityCheckState === 2
  562. ? '无需质检'
  563. : ''
  564. )
  565. },
  566. },
  567. ],
  568. params: {
  569. pageNum: 1,
  570. pageSize: 20,
  571. total: 0,
  572. inventoryResults: '1',
  573. keyword: null,
  574. categoryCode: null,
  575. houseId: null,
  576. technologyType: null,
  577. purpose: null,
  578. },
  579. totalData: {
  580. fabric: {},
  581. ink: {},
  582. purposeStatistics: [],
  583. typeStatistics: [],
  584. },
  585. technologyTypeName: null,
  586. materialList: [],
  587. }
  588. },
  589. methods: {
  590. getMaterialSelectList() {
  591. const v = this
  592. v.loading = true
  593. axios
  594. .post('/cloudApi/material/selectList', {
  595. pageNum:1,
  596. pageSize:10,
  597. search: v.params.keyword,
  598. })
  599. .then((res) => {
  600. v.materialList = res.data.data
  601. v.loading = false
  602. })
  603. },
  604. rowClassName(row, index) {
  605. if (row.materialPurpose == this.technologyTypeName) {
  606. return 'table-info-row'
  607. }
  608. },
  609. rowClassName2(row, index) {
  610. if (this.params.technologyType == 4) {
  611. if (index == 3) return 'table-info-row'
  612. } else {
  613. if (
  614. index == this.params.technologyType &&
  615. this.params.technologyType != 3
  616. ) {
  617. return 'table-info-row'
  618. }
  619. }
  620. },
  621. getAll() {
  622. this.params.technologyType = null
  623. this.params.purpose = null
  624. this.params.pageNum = 1
  625. this.technologyTypeName = null
  626. this.getList()
  627. },
  628. yongtuTbleLineCk(row, index) {
  629. this.technologyTypeName = row.materialPurpose
  630. this.params.purpose = row.materialPurpose
  631. this.params.technologyType = null
  632. this.params.pageNum = 1
  633. this.getList()
  634. },
  635. moshuiCk() {
  636. this.params.purpose = null
  637. this.params.technologyType = 3
  638. this.params.pageNum = 1
  639. this.getList()
  640. },
  641. mianliaoTbleLineCk(row, index) {
  642. this.technologyTypeName = null
  643. this.params.purpose = null
  644. if (index == 3) {
  645. this.params.technologyType = 4
  646. } else {
  647. this.params.technologyType = index
  648. }
  649. this.getList()
  650. },
  651. getList() {
  652. axios
  653. .post('/cloudApi/stockWater/remainingTodayPage', this.params)
  654. .then((res) => {
  655. console.log(res)
  656. if (res.data.code == 200) {
  657. for (let i = 0; i < res.data.data.records.length; i++) {
  658. const element = res.data.data.records[i]
  659. element.yilouSum = 0
  660. element.yilouCount = 0
  661. element.silouSum = 0
  662. element.silouCount = 0
  663. for (let j = 0; j < element.houseInfo.length; j++) {
  664. const jelement = element.houseInfo[j]
  665. if (jelement.houseName == '一楼面料仓库') {
  666. element.yilouSum = jelement.sum || 0
  667. element.yilouCount = jelement.count || 0
  668. }
  669. if (jelement.houseName == '四楼面料仓') {
  670. element.silouSum = jelement.sum || 0
  671. element.silouCount = jelement.count || 0
  672. }
  673. }
  674. }
  675. this.data = res.data.data.records
  676. this.params.total = res.data.data.total
  677. console.log(this.data)
  678. this.resize()
  679. }
  680. })
  681. // GetStockPageList(this.params).then(res => {
  682. // if (res.code === 0) {
  683. // this.data = res.result.list
  684. // this.params.total = res.result.totalCount
  685. // this.resize()
  686. // }
  687. // })
  688. },
  689. getRemainingToday() {
  690. const v = this
  691. axios
  692. .post('/cloudApi/stockWater/remainingToday', {})
  693. .then((res) => {
  694. console.log(res)
  695. for (
  696. let i = 0;
  697. i < res.data.data.purposeStatistics.length;
  698. i++
  699. ) {
  700. const element = res.data.data.purposeStatistics[i]
  701. if (element.materialPurpose == '')
  702. element.materialPurpose = '其他'
  703. }
  704. this.totalData.fabric = res.data.data.fabric
  705. this.totalData.ink = res.data.data.ink
  706. this.totalData.purposeStatistics =
  707. res.data.data.purposeStatistics
  708. this.totalData.typeStatistics = [
  709. { ...res.data.data.typeStatistics[0], name: '直喷' },
  710. { ...res.data.data.typeStatistics[1], name: '热转' },
  711. { ...res.data.data.typeStatistics[2], name: '打纸' },
  712. { ...res.data.data.typeStatistics[4], name: '其他' },
  713. ]
  714. })
  715. },
  716. resize() {
  717. let scrollEl = document.getElementsByClassName('content-wrapper')[0]
  718. if (scrollEl) {
  719. scrollEl.scrollTop = 0
  720. } else {
  721. setTimeout(() => {
  722. this.resize()
  723. }, 500)
  724. }
  725. },
  726. errChange() {
  727. this.params.pageIndex = 1
  728. this.getList()
  729. },
  730. open(item) {
  731. if (!item.storageDetails) {
  732. axios
  733. .post('/cloudApi/stockWater/inStockList', {
  734. materialCode:item.materialCode,
  735. })
  736. .then((res) => {
  737. this.$set(item, 'storageDetails', res.data.data)
  738. })
  739. // GetStockTagDetailList({
  740. // materialCode: item.materialCode,
  741. // }).then((res) => {
  742. // if (res.code === 0) {
  743. // this.$set(item, 'storageDetails', res.result)
  744. // }
  745. // })
  746. }
  747. },
  748. openTag(item) {
  749. if (item.detailId) {
  750. this.formData = { ...item, detialId: item.detailId }
  751. this.tagShow = true
  752. }
  753. },
  754. /* 查看盘点记录 */
  755. toDetail(type) {
  756. this.$router.push({
  757. name: 'inventory_record_new',
  758. query: {
  759. technologyType: type,
  760. },
  761. })
  762. },
  763. /* 显示盘点记录 */
  764. showInventory(item) {
  765. this.inventoryShow = true
  766. this.formData = { ...item }
  767. },
  768. showArtificialInventoryRecord() {
  769. this.inventoryRecordShow = true
  770. // this.$router.push('artificial-inventory-record')
  771. },
  772. toInventory() {
  773. this.$router.push('inventory')
  774. },
  775. tabClick(index = '', value, text) {
  776. if (text) {
  777. this.useName = '全部'
  778. this.typeName = text
  779. this.tabIndex = index
  780. this.itemIndex = ''
  781. this.params.technologyType = value
  782. this.getItemData()
  783. this.getList()
  784. } else {
  785. this.typeName = text
  786. this.tabIndex = index
  787. this.itemIndex = ''
  788. this.params.technologyType = value
  789. this.getItemData()
  790. this.getList()
  791. }
  792. },
  793. itemClick(index = '', item = '') {
  794. if (item) {
  795. this.typeName = '全部'
  796. this.useName = item
  797. this.itemIndex = index
  798. this.params.purpose = item
  799. this.getList()
  800. } else {
  801. this.useName = item
  802. this.itemIndex = index
  803. this.params.purpose = item
  804. this.getList()
  805. }
  806. },
  807. // 跳转对应记录列表 0入库记录 1出库记录
  808. toHistory(type) {
  809. if (type === 0) {
  810. this.$router.push({
  811. name: 'store_in_record',
  812. })
  813. } else if (type === 1) {
  814. this.$router.push({
  815. name: 'store_out_record',
  816. })
  817. }
  818. },
  819. // 获取控件宽度
  820. getComWidth(item) {
  821. if (item.name === 'Button') {
  822. return '80px'
  823. } else if (item.name === 'Input') {
  824. return '200px'
  825. }
  826. },
  827. cfm(type, formData) {
  828. if (type === 'add') {
  829. FacPriceAdd({
  830. ...formData,
  831. materialCode: formData.code,
  832. }).then((res) => {
  833. if (res.code === 0) {
  834. this.$Message.info(res.msg)
  835. this.getList()
  836. }
  837. })
  838. } else if (type === 'edit') {
  839. FacPriceChange({
  840. ...formData,
  841. factoryPriceId: formData.id,
  842. }).then((res) => {
  843. if (res.code === 0) {
  844. this.$Message.info(res.msg)
  845. this.getList()
  846. }
  847. })
  848. }
  849. },
  850. exportExcel2(){
  851. const v = this
  852. let columns = [
  853. { title: '物料编码', key: 'materialCode' },
  854. { title: '物料名称', key: 'materialName' },
  855. { title: 'RFID', key: 'rfidCode' },
  856. { title: '物料数量', key: 'quantity' },
  857. { title: '入库时间', key: 'createTime' },
  858. { title: '在库时间', key: 'inStockTime' },
  859. { title: '所在仓库', key: 'houseName' },
  860. { title: '库位', key: 'areaName' },
  861. { title: '质检状态', key: 'quantityCheckState' },
  862. ]
  863. axios
  864. .post('/cloudApi/stockWater/remainingTodayList', v.params)
  865. .then((res) => {
  866. for (let i = 0; i < res.data.data.length; i++) {
  867. const element = res.data.data[i];
  868. element.quantityCheckState = element.quantityCheckState === 0 ? '未质检' : element.quantityCheckState === 1 ? '已质检' : '无需质检'
  869. }
  870. let data = res.data.data
  871. exportExcel(columns, data, '库存详情')
  872. })
  873. },
  874. exportExcel() {
  875. if (this.data.length < 1) return this.$Message.error('数据为空!')
  876. let columns = [
  877. { title: '物料类型', key: 'categoryName' },
  878. { title: '物料编码', key: 'materialCode' },
  879. { title: '物料名称', key: 'materialName' },
  880. { title: '安全库存', key: 'saveQuantity' },
  881. { title: '库存数量', key: 'quantity' },
  882. { title: '库存件数', key: 'tagCount' },
  883. { title: '滞留数量', key: 'retentionCount' },
  884. ]
  885. GetStockPageList({
  886. ...this.params,
  887. pageIndex: 1,
  888. pageSize: 999999,
  889. }).then((res) => {
  890. if (res.code === 0) {
  891. let data = res.result.list
  892. exportExcel(columns, data, '库存管理')
  893. }
  894. })
  895. },
  896. // 检索条件事件处理
  897. eventHandle(option) {
  898. switch (option._evnet) {
  899. case 'search':
  900. this.params.pageIndex = 1
  901. this.params.key = option.key
  902. this.params.purContractState = option.purContractState
  903. this.getList()
  904. break
  905. case 'add':
  906. this.formType = 'add'
  907. this.show = true
  908. break
  909. case 'back':
  910. this.$router.go(-1)
  911. break
  912. }
  913. },
  914. changePage(pageNum) {
  915. this.params.pageNum = pageNum
  916. this.getList()
  917. },
  918. search() {
  919. this.params.pageNum = 1
  920. // this.params.key = this.key
  921. // this.params.materialCategoryCode = this.materialCategoryCode
  922. this.getList()
  923. },
  924. handleData(data) {
  925. data.forEach((item) => {
  926. item.title = item.name
  927. // item.expand = true
  928. if (item.children) {
  929. this.handleData(item.children)
  930. }
  931. })
  932. },
  933. getTree() {
  934. GetMaterialCategoryZTree().then((res) => {
  935. if (res.code === 0) {
  936. this.materialTreeData = res.result
  937. this.handleData(this.materialTreeData)
  938. }
  939. })
  940. },
  941. getTitleData() {
  942. GetStockDetailSum().then((res) => {
  943. console.log(res)
  944. if (res.code === 0) {
  945. this.titleData = res.result
  946. }
  947. })
  948. },
  949. getItemData() {
  950. GetStockMaterialPurpose({
  951. technologyType: this.tabIndex,
  952. }).then((res) => {
  953. if (res.code === 0) {
  954. this.itemData = res.result
  955. this.itemData.unshift('全部')
  956. }
  957. })
  958. },
  959. getTechnologyTypList() {
  960. GetTechnologyTypList().then((res) => {
  961. if (res.code === 0) {
  962. this.tabs = res.result
  963. this.tabs.unshift({
  964. text: '全部',
  965. value: '',
  966. })
  967. }
  968. })
  969. },
  970. getMaterialSet() {
  971. GetMaterialSet().then((res) => {
  972. if (res.code === 0) {
  973. this.delayPeriod = res.result.delayPeriod
  974. }
  975. })
  976. },
  977. getStockHouse() {
  978. GetStockHouse().then((res) => {
  979. if (res.code === 0) {
  980. this.stockList = res.result.map((item) => {
  981. return {
  982. label: item.name,
  983. value: item.id,
  984. }
  985. })
  986. }
  987. })
  988. },
  989. },
  990. mounted() {
  991. this.getList()
  992. this.getTree()
  993. this.getTitleData()
  994. this.getItemData()
  995. this.getTechnologyTypList()
  996. this.getMaterialSet()
  997. this.getStockHouse()
  998. this.getRemainingToday()
  999. this.getMaterialSelectList()
  1000. },
  1001. }
  1002. </script>
  1003. <style>
  1004. .ivu-table .table-info-row td {
  1005. background-color: #2db7f5;
  1006. color: #fff;
  1007. }
  1008. </style>
  1009. <style lang="less" scoped>
  1010. .container {
  1011. display: flex;
  1012. flex-direction: column;
  1013. .table-modal {
  1014. background: #fff;
  1015. border: 1px solid #dcdcdc;
  1016. margin-top: 20px;
  1017. position: relative;
  1018. justify-content: space-between;
  1019. display: flex;
  1020. padding: 20px;
  1021. }
  1022. .table-modal:before {
  1023. position: absolute;
  1024. width: 20px;
  1025. height: 20px;
  1026. border-top: 1px solid #dcdcdc;
  1027. border-left: 1px solid #dcdcdc;
  1028. background: #fff;
  1029. content: ' ';
  1030. top: -11px;
  1031. transform: rotate(45deg);
  1032. left: 13%;
  1033. }
  1034. .total-warp {
  1035. .h2 {
  1036. font-size: 18px;
  1037. font-weight: bold;
  1038. color: #333;
  1039. height: 40px;
  1040. line-height: 30px;
  1041. }
  1042. .total-box {
  1043. display: flex;
  1044. justify-content: space-between;
  1045. }
  1046. .total-box > div {
  1047. background: #ffffff;
  1048. border: 1px solid #dddcdc;
  1049. font-size: 18px;
  1050. height: 60px;
  1051. line-height: 60px;
  1052. color: #3f3f3f;
  1053. ul {
  1054. display: flex;
  1055. li {
  1056. list-style: none;
  1057. font-size: 12px;
  1058. color: #838383;
  1059. line-height: 24px;
  1060. padding: 6px 0;
  1061. span {
  1062. color: #3f3f3f;
  1063. font-weight: bold;
  1064. font-size: 18px;
  1065. display: block;
  1066. }
  1067. }
  1068. }
  1069. }
  1070. .mianliao {
  1071. display: flex;
  1072. .label {
  1073. width: 20%;
  1074. text-align: center;
  1075. }
  1076. ul {
  1077. width: 80%;
  1078. li {
  1079. width: 25%;
  1080. text-align: center;
  1081. line-height: 24px;
  1082. }
  1083. }
  1084. }
  1085. .moshui {
  1086. display: flex;
  1087. .label {
  1088. width: 25%;
  1089. text-align: center;
  1090. }
  1091. ul {
  1092. width: 75%;
  1093. li {
  1094. width: 33.3%;
  1095. text-align: center;
  1096. }
  1097. }
  1098. }
  1099. }
  1100. .bar {
  1101. display: flex;
  1102. justify-content: space-between;
  1103. .item {
  1104. flex: 1;
  1105. margin-right: 20px;
  1106. display: flex;
  1107. justify-content: space-between;
  1108. align-items: center;
  1109. height: 70px;
  1110. border-radius: 3px 3px 0 0;
  1111. background-color: #ffffff;
  1112. border: 1px solid #e6e6e6;
  1113. &:last-child {
  1114. margin-right: 0;
  1115. }
  1116. .left,
  1117. .center,
  1118. .right {
  1119. height: 100%;
  1120. display: flex;
  1121. align-items: center;
  1122. justify-content: center;
  1123. flex-direction: column;
  1124. text-align: center;
  1125. border-right: 1px solid #e6e6e6;
  1126. .number {
  1127. margin-top: 5px;
  1128. font-size: 16px;
  1129. font-weight: bold;
  1130. color: #3f92f9;
  1131. &.red {
  1132. color: #db0020;
  1133. }
  1134. }
  1135. }
  1136. .left {
  1137. width: 100px;
  1138. font-size: 16px;
  1139. font-weight: bold;
  1140. .detail {
  1141. font-size: 12px;
  1142. font-weight: normal;
  1143. cursor: pointer;
  1144. }
  1145. }
  1146. .center {
  1147. flex: 5;
  1148. }
  1149. .right {
  1150. flex: 5;
  1151. &:last-child {
  1152. border-right: none;
  1153. }
  1154. }
  1155. &.more {
  1156. flex: none;
  1157. margin-right: 0;
  1158. padding: 0 20px;
  1159. justify-content: center;
  1160. width: 140px;
  1161. background-color: #333333;
  1162. color: #ffffff;
  1163. cursor: pointer;
  1164. }
  1165. }
  1166. }
  1167. .info {
  1168. display: flex;
  1169. justify-content: space-between;
  1170. margin-bottom: 16px;
  1171. .info-item {
  1172. margin-right: 20px;
  1173. flex: 1;
  1174. overflow: hidden;
  1175. border: 1px solid #e6e6e6;
  1176. background-color: #ffffff;
  1177. &:last-child {
  1178. margin-right: 0;
  1179. }
  1180. .ivu-collapse {
  1181. border: none;
  1182. }
  1183. /deep/ .ivu-collapse-header {
  1184. padding: 0;
  1185. height: auto;
  1186. line-height: 1.2;
  1187. vertical-align: middle;
  1188. .ivu-icon-ios-arrow-forward {
  1189. display: none;
  1190. }
  1191. }
  1192. .row {
  1193. display: flex;
  1194. justify-content: space-between;
  1195. align-items: stretch;
  1196. border-bottom: 1px solid #e6e6e6;
  1197. .col {
  1198. flex: 1;
  1199. overflow: hidden;
  1200. text-align: center;
  1201. padding: 5px 3px;
  1202. border-right: 1px solid #e6e6e6;
  1203. display: flex;
  1204. align-items: center;
  1205. justify-content: center;
  1206. &:first-child {
  1207. flex: 2;
  1208. }
  1209. &:last-child {
  1210. border-right: none;
  1211. }
  1212. }
  1213. }
  1214. }
  1215. .info-content {
  1216. height: 200px;
  1217. overflow: overlay;
  1218. }
  1219. /deep/ .ivu-collapse-content {
  1220. padding: 0;
  1221. }
  1222. /deep/ .ivu-collapse-content-box {
  1223. padding: 0;
  1224. }
  1225. /deep/ .ivu-collapse {
  1226. border-top: none;
  1227. border-radius: 0 0 3px 3px;
  1228. }
  1229. /deep/ .ivu-collapse-header {
  1230. height: 30px;
  1231. line-height: 30px;
  1232. background: #d7d7d7;
  1233. color: #000000;
  1234. font-weight: bold;
  1235. }
  1236. }
  1237. .table-filter {
  1238. padding-bottom: 10px;
  1239. line-height: 42px;
  1240. overflow: hidden;
  1241. .filter-item {
  1242. margin-right: 10px;
  1243. float: left;
  1244. //&:last-child {
  1245. // margin-right: 0;
  1246. //}
  1247. }
  1248. }
  1249. .line {
  1250. height: 1px;
  1251. border-bottom: 1px solid #d7d7d7;
  1252. }
  1253. .table-content-wrap {
  1254. flex: 1;
  1255. overflow: hidden;
  1256. .table-content {
  1257. overflow: auto;
  1258. height: 100%;
  1259. .table-item {
  1260. width: 100%;
  1261. .row {
  1262. display: flex;
  1263. justify-content: space-between;
  1264. align-items: center;
  1265. .col {
  1266. padding: 0 5px;
  1267. flex: 1;
  1268. display: flex;
  1269. align-items: center;
  1270. height: 30px;
  1271. overflow: hidden;
  1272. white-space: nowrap;
  1273. text-overflow: ellipsis;
  1274. &.red {
  1275. color: red;
  1276. }
  1277. &.orange {
  1278. color: orange;
  1279. }
  1280. &.blue {
  1281. color: #169bd5;
  1282. }
  1283. }
  1284. }
  1285. }
  1286. .content {
  1287. padding-left: 30px;
  1288. }
  1289. }
  1290. }
  1291. .table-page {
  1292. padding-top: 10px;
  1293. display: flex;
  1294. justify-content: center;
  1295. align-items: center;
  1296. height: 43px;
  1297. overflow: hidden;
  1298. }
  1299. }
  1300. .table-content-wrap {
  1301. /deep/ .ivu-collapse-header {
  1302. min-width: 750px;
  1303. display: flex;
  1304. height: 120px !important;
  1305. background-color: #ffffff;
  1306. border-bottom: none !important;
  1307. }
  1308. /deep/ .ivu-icon-ios-arrow-forward {
  1309. height: 30px;
  1310. display: flex;
  1311. justify-content: center;
  1312. align-items: center;
  1313. }
  1314. /deep/ .ivu-collapse-content-box {
  1315. padding: 0;
  1316. padding-bottom: 10px;
  1317. }
  1318. /deep/ .ivu-collapse {
  1319. margin-bottom: 5px;
  1320. }
  1321. }
  1322. ::-webkit-scrollbar {
  1323. //width: 0px; /*对垂直流动条有效*/
  1324. //height: 0px; /*对水平流动条有效*/
  1325. width: 5px; /*对垂直流动条有效*/
  1326. height: 10px;
  1327. background-color: #ffffff;
  1328. }
  1329. </style>