warehouseManagementDelivery.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. // 出库登记
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="20">
  6. <h2 class="bg-left title">出库登记</h2>
  7. </el-col>
  8. <el-col :span="4" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="returnWarehouse()"
  14. >返回</el-button
  15. >
  16. </el-col>
  17. </el-row>
  18. <ws-form ref="deptBudgetList" :model="deptBudgetList" :rules="rules">
  19. <div class="basicInformation">
  20. <h2>
  21. {{ deptBudgetList.warehouseName }}库
  22. <span class="position"> {{ deptBudgetList.binNumber }}仓位 </span>
  23. </h2>
  24. <ws-info-table>
  25. <!-- 货名 -->
  26. <ws-form-item label="货名" span="1">
  27. <ws-select
  28. v-model="deptBudgetList.goodsName"
  29. placeholder=""
  30. class="typeselect"
  31. @change="selectgoodsName"
  32. >
  33. <ws-option
  34. v-for="item in goodnameList"
  35. :key="item.constKey"
  36. :label="item.constValue"
  37. :value="item.constValue"
  38. />
  39. </ws-select>
  40. </ws-form-item>
  41. <!--毛重(吨)-->
  42. <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
  43. <ws-input
  44. @input="grossWeightchange"
  45. v-model="deptBudgetList.grossWeight"
  46. placeholder="请输入毛重"
  47. maxlength="20"
  48. size="small"
  49. />
  50. </ws-form-item>
  51. <!--皮重(吨)-->
  52. <ws-form-item
  53. label="皮重(吨)"
  54. span="1"
  55. prop="tare"
  56. class="readonly"
  57. >
  58. <ws-input
  59. @input="tarechange"
  60. v-model="deptBudgetList.tare"
  61. placeholder="请输入皮重"
  62. maxlength="100"
  63. size="small"
  64. />
  65. </ws-form-item>
  66. <!--净重(吨)-->
  67. <ws-form-item label="净重(吨)" span="1" prop="netWeight">
  68. <ws-input
  69. :readonly="readonly"
  70. v-model.number="deptBudgetList.netWeight"
  71. placeholder="不可编辑,自动计算"
  72. type="number"
  73. maxlength="120"
  74. size="small"
  75. />
  76. </ws-form-item>
  77. <!-- 品级 -->
  78. <ws-form-item label="品级" span="1" class="readonly">
  79. <ws-select
  80. v-model="deptBudgetList.grade"
  81. placeholder=""
  82. class="typeselect"
  83. @change="selectpackingMethod"
  84. >
  85. <ws-option
  86. v-for="item in gradeList"
  87. :key="item.constKey"
  88. :label="item.constValue"
  89. :value="item.constValue"
  90. />
  91. </ws-select>
  92. </ws-form-item>
  93. <!--经办人-->
  94. <ws-form-item label="经办人" span="1" prop="agent">
  95. <ws-input
  96. v-model="deptBudgetList.agent"
  97. placeholder="请输入出库经办人姓名"
  98. maxlength="100"
  99. size="small"
  100. />
  101. </ws-form-item>
  102. <!--出库日期-->
  103. <ws-form-item
  104. label="出库日期"
  105. span="1"
  106. prop="inOutDate"
  107. class="deliverydate"
  108. >
  109. <ws-date-picker
  110. v-model="deptBudgetList.inOutDate"
  111. type="date"
  112. placeholder="请选择出库日期"
  113. value-format="yyyy-MM-dd"
  114. />
  115. </ws-form-item>
  116. <!-- 入库类型 -->
  117. <ws-form-item label="出库类型" span="1">
  118. <ws-select
  119. v-model="deptBudgetList.inOutType"
  120. placeholder=""
  121. class="typeselect"
  122. @change="selectstorageType"
  123. >
  124. <ws-option
  125. v-for="item in storageType"
  126. :key="item.constKey"
  127. :label="item.constValue"
  128. :value="item.constValue"
  129. />
  130. </ws-select>
  131. </ws-form-item>
  132. <!--车牌号-->
  133. <ws-form-item label="车牌号" span="1" prop="sourceGoods">
  134. <ws-input
  135. v-model="deptBudgetList.carNo"
  136. placeholder="请输入车牌号"
  137. maxlength="20"
  138. size="small"
  139. />
  140. </ws-form-item>
  141. <!--合同编号-->
  142. <ws-form-item label="合同编号" span="1" prop="contractNo">
  143. <ws-input
  144. v-model="deptBudgetList.contractNo"
  145. placeholder="请输入合同编号"
  146. maxlength="100"
  147. size="small"
  148. />
  149. </ws-form-item>
  150. </ws-info-table>
  151. </div>
  152. <ws-upload
  153. ref="upload"
  154. table-name="maintain_work_order"
  155. oss-key="mainPlan"
  156. :comp-id="compId"
  157. :appendix-ids="appendixIdsAdd"
  158. :vesselId="deptBudgetList.addressUrl"
  159. :size-limit="size"
  160. @uploadSuccess="uploadSuccess"
  161. @onChange="onChange"
  162. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
  163. />
  164. <h2>化验数据(选填)</h2>
  165. <div class="inspector">
  166. <!--自检员-->
  167. <ws-form-item label="质检员" span="1" prop="qualityInspector">
  168. <ws-input
  169. v-model="deptBudgetList.warehouseInOutDetail.qualityInspector"
  170. placeholder="请输入质检员姓名"
  171. maxlength="120"
  172. size="small"
  173. />
  174. </ws-form-item>
  175. </div>
  176. <ws-info-table>
  177. <!--水分(%)<=-->
  178. <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
  179. <ws-input
  180. v-model="deptBudgetList.warehouseInOutDetail.waterContent"
  181. placeholder="请输入水分占比"
  182. maxlength="120"
  183. size="small"
  184. />
  185. </ws-form-item>
  186. <!--杂质(%)<=-->
  187. <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
  188. <ws-input
  189. v-model="deptBudgetList.warehouseInOutDetail.impurity"
  190. placeholder="请输入杂质占比"
  191. maxlength="120"
  192. size="small"
  193. />
  194. </ws-form-item>
  195. <!--容重(克/升)>=-->
  196. <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
  197. <ws-input
  198. v-model="deptBudgetList.warehouseInOutDetail.bulkDensity"
  199. placeholder="请输入容重"
  200. maxlength="120"
  201. size="small"
  202. />
  203. </ws-form-item>
  204. <!--霉变粒(%)<=-->
  205. <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
  206. <ws-input
  207. v-model="deptBudgetList.warehouseInOutDetail.mildewGrain"
  208. placeholder="请输入霉变粒占比"
  209. maxlength="120"
  210. size="small"
  211. />
  212. </ws-form-item>
  213. <!--热损伤(%)<=-->
  214. <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  215. <ws-input
  216. v-model="deptBudgetList.warehouseInOutDetail.jiaorenli"
  217. placeholder="请输入热损伤占比"
  218. maxlength="120"
  219. size="small"
  220. />
  221. </ws-form-item>
  222. <!--不完整粒(%)<=-->
  223. <ws-form-item label="不完整粒(%)<=" span="1" prop="imperfectGrain">
  224. <ws-input
  225. v-model="deptBudgetList.warehouseInOutDetail.imperfectGrain"
  226. placeholder="请输入不完整粒占比"
  227. maxlength="120"
  228. size="small"
  229. />
  230. </ws-form-item>
  231. </ws-info-table>
  232. <div style="text-align: right; padding: 10px">
  233. <el-button
  234. class="bg-bottom-up"
  235. type="primary"
  236. size="small"
  237. @click="temporaryStorage()"
  238. >暂存</el-button
  239. >
  240. <el-button
  241. class="bg-bottom-up"
  242. type="primary"
  243. size="small"
  244. @click="submit()"
  245. >提交</el-button
  246. >
  247. </div>
  248. </ws-form>
  249. </div>
  250. </template>
  251. <script>
  252. import { pullDown, addstorageputList } from '@/model/warehouse/index'
  253. import { downloadFile } from '@/utils/batchDown'
  254. import Pagination from '@/components/Pagination'
  255. import WsUpload from '@/components/WsUpload'
  256. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  257. import { dayjs, EventBus } from 'base-core-lib'
  258. export default {
  259. name: 'viewSpareMoney',
  260. components: {
  261. WsUpload,
  262. Pagination,
  263. },
  264. watch: {
  265. // vesselId(val) {
  266. // this.getList()
  267. // },
  268. isShow(val) {
  269. this.showType = val
  270. },
  271. },
  272. data() {
  273. return {
  274. //弹出框
  275. dialogViewSpareMoney: false,
  276. dialogApproveFormVisible: false,
  277. // 船舶类型
  278. monetaryKey: null,
  279. // 表格显示数据
  280. tableDate: [],
  281. // 是否显示
  282. showType: true,
  283. readonly: true,
  284. // 年
  285. year: '',
  286. deptBudgetTotal: 0,
  287. currentPage: 1,
  288. pageSize: 10,
  289. searchType: 1,
  290. searchKeyWord: '',
  291. contractType: 2,
  292. startDate: null,
  293. endDate: null,
  294. goodnameList: {},
  295. // 提交类型
  296. submitType: true,
  297. storageType: [],
  298. appendixIdsAdd: '',
  299. uploadSuccess: {},
  300. onChange: {},
  301. gradeList: [],
  302. rules: {
  303. netWeight: [
  304. {
  305. required: true,
  306. type: 'number',
  307. message: '请输入活动名称',
  308. trigger: 'blur',
  309. },
  310. ],
  311. },
  312. size: 10,
  313. compId: sessionStorage.getItem('ws-pf_compId'),
  314. deptCircularPage: {},
  315. packtypeList: {},
  316. date: {
  317. year: dayjs().format('YYYY'),
  318. month: dayjs().format('MM'),
  319. },
  320. contractList: [],
  321. deptBudgetList: {
  322. warehouseInOutDetail: {},
  323. },
  324. historyList: [],
  325. pickerBeginDateBefore: {
  326. disabledDate: (time) => {
  327. return time.getTime() > Date.now()
  328. },
  329. },
  330. accessoryTFs: false,
  331. }
  332. },
  333. mounted() {
  334. console.log(this.$route.query)
  335. this.deptBudgetList.baseId = this.$route.query.baseId
  336. this.deptBudgetList.positionId = this.$route.query.positionId
  337. this.deptBudgetList.warehouseName = this.$route.query.warehouseName
  338. this.deptBudgetList.binNumber = this.$route.query.binNumber
  339. this.getList()
  340. },
  341. methods: {
  342. //返回按钮
  343. returnWarehouse() {
  344. this.$router.push({ path: 'warehouseManagementList' })
  345. },
  346. temporaryStorage() {
  347. this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
  348. cancelButtonText: '取消',
  349. confirmButtonText: '确定',
  350. type: 'warning',
  351. })
  352. .then(() => {
  353. this.$refs.deptBudgetList.validate((valid) => {
  354. if (valid) {
  355. this.deptBudgetList.compId = sessionStorage.getItem(
  356. 'ws-pf_compId'
  357. )
  358. this.deptBudgetList.inOutFlag = 1
  359. this.deptBudgetList.statusFlag = 1
  360. addstorageputList(this.deptBudgetList)
  361. .toPromise()
  362. .then((response) => {
  363. this.$message.success('暂存成功')
  364. this.$router.push({ path: 'warehouseManagementList' })
  365. })
  366. } else {
  367. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  368. return false
  369. }
  370. })
  371. })
  372. .catch(() => {
  373. return false
  374. })
  375. },
  376. //提交按钮
  377. submit() {
  378. this.$refs.deptBudgetList.validate((valid) => {
  379. if (valid) {
  380. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  381. this.deptBudgetList.inOutFlag = 1
  382. this.deptBudgetList.statusFlag = 3
  383. addstorageputList(this.deptBudgetList)
  384. .toPromise()
  385. .then((response) => {
  386. this.$message.success('添加成功')
  387. this.$router.push({ path: 'warehouseManagementList' })
  388. })
  389. } else {
  390. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  391. return false
  392. }
  393. })
  394. },
  395. tarechange(e) {
  396. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  397. this.deptBudgetList.netWeight = Number(
  398. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  399. )
  400. }
  401. },
  402. grossWeightchange(e) {
  403. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  404. this.deptBudgetList.netWeight = Number(
  405. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  406. )
  407. }
  408. },
  409. selectgoodsName(e) {
  410. for (var i = 0; i < this.goodnameList.length; i++) {
  411. if (this.goodnameList[i].constValue == e) {
  412. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  413. }
  414. }
  415. },
  416. selectpackingMethod(e) {
  417. for (var i = 0; i < this.packtypeList.length; i++) {
  418. if (this.packtypeList[i].constValue == e) {
  419. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  420. }
  421. }
  422. },
  423. selectstorageType(e) {
  424. for (var i = 0; i < this.storageType.length; i++) {
  425. if (this.storageType[i].constValue == e) {
  426. this.deptBudgetList.inOutTypeKey = this.storageType[i].constKey
  427. }
  428. }
  429. },
  430. handleClose() {
  431. this.accessoryTFs = false
  432. },
  433. handleSizeChange(val) {
  434. console.log(`每页 ${val} 条`)
  435. this.pageSize = val
  436. this.getList()
  437. },
  438. handleCurrentChange(val) {
  439. this.currentPage = val
  440. console.log(`当前页: ${val}`)
  441. this.getList()
  442. },
  443. getList() {
  444. // 货名
  445. pullDown({ constId: 'CON2' })
  446. .toPromise()
  447. .then((response) => {
  448. this.goodnameList = response
  449. })
  450. // 品级
  451. pullDown({ constId: 'CON3' })
  452. .toPromise()
  453. .then((response) => {
  454. this.gradeList = response
  455. })
  456. // 类型
  457. pullDown({ constId: 'CON6' })
  458. .toPromise()
  459. .then((response) => {
  460. this.storageType = response
  461. })
  462. },
  463. selecttaskType(e) {
  464. for (var i = 0; i < this.taskTypeList.length; i++) {
  465. if (this.taskTypeList[i].value == e) {
  466. this.searchType = this.taskTypeList[i].type
  467. }
  468. }
  469. },
  470. fujian(row) {
  471. if (
  472. row.receiveAttachmentPath === null ||
  473. row.receiveAttachmentPath === ''
  474. ) {
  475. EventBus.$emit(
  476. 'warning',
  477. this.$t('system.noticeCircular.NoInformation')
  478. )
  479. } else {
  480. this.accessoryTFs = true
  481. }
  482. this.appendixIdss = row.receiveAttachmentPath
  483. },
  484. handleExamine(row) {
  485. this.$router.push({
  486. name: 'salesContractExamine',
  487. query: { id: row.id },
  488. })
  489. },
  490. // 关闭 dialog时 处理文件url 初始化upload组件
  491. handleCloe() {
  492. this.dialogViewSpareMoney = false
  493. },
  494. history(row) {
  495. console.log(row)
  496. billoperatehis({ id: row.id })
  497. .toPromise()
  498. .then((response) => {
  499. this.historyList = response
  500. })
  501. },
  502. async exportlist() {
  503. const { data } = await export1(
  504. {
  505. compId: sessionStorage.getItem('ws-pf_compId'),
  506. contractType: this.contractType,
  507. currentPage: this.currentPage,
  508. pageSize: this.pageSize,
  509. searchType: this.searchType,
  510. searchKeyWord: this.searchKeyWord,
  511. startDate: this.startDate,
  512. endDate: this.endDate,
  513. },
  514. {},
  515. { responseType: 'blob' }
  516. ).toPromise()
  517. downloadFile({
  518. res: data,
  519. fileName: `${
  520. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  521. }_采购合同`,
  522. type: 'xls',
  523. })
  524. },
  525. // deletecontract(){},
  526. //删除
  527. approve() {},
  528. listQuery() {},
  529. total() {},
  530. clearfiltQuery() {},
  531. selectCrtDuty() {},
  532. },
  533. }
  534. </script>
  535. <style lang="scss" scoped>
  536. /deep/.basicInformation {
  537. .ws-info-table {
  538. border: none;
  539. }
  540. .el-form-item {
  541. width: 33.3333%;
  542. border: none;
  543. .el-form-item__label {
  544. background: transparent;
  545. border: none;
  546. }
  547. .el-form-item__content {
  548. border: none;
  549. }
  550. }
  551. }
  552. .title {
  553. position: relative;
  554. padding-left: 10px;
  555. }
  556. .title::before {
  557. content: '';
  558. display: inline-block;
  559. width: 5px;
  560. height: 30px;
  561. background: #5473e8;
  562. position: absolute;
  563. left: 0;
  564. }
  565. .el-form {
  566. padding: 0 10%;
  567. }
  568. .el-button--primary {
  569. background-color: #5878e8;
  570. border-color: #5878e8;
  571. }
  572. .el-col {
  573. background: #f6f7fc;
  574. }
  575. .bg-right {
  576. text-align: right;
  577. padding: 16px 20px;
  578. }
  579. .center {
  580. position: relative;
  581. top: 50px;
  582. width: 40%;
  583. height: 2000px;
  584. margin: 0 auto;
  585. }
  586. /deep/.el-form-item__label {
  587. width: 160px;
  588. }
  589. /deep/.el-input--small {
  590. width: 70%;
  591. }
  592. //选填
  593. /deep/.el-form-item {
  594. width: 50%;
  595. }
  596. .container {
  597. overflow: scroll;
  598. height: 120vh;
  599. }
  600. /deep/.ws-info-table .el-form-item .el-form-item__label {
  601. text-align: center;
  602. }
  603. .deliverydate {
  604. display: inline-block;
  605. width: 10%;
  606. }
  607. .center {
  608. margin-top: -60px;
  609. width: 80%;
  610. }
  611. //仓位
  612. .position {
  613. width: 52px;
  614. height: 20px;
  615. background: #afb5cb;
  616. border-radius: 2px;
  617. font-size: 12px;
  618. font-family: PingFangSC-Medium, PingFang SC;
  619. color: #ffffff;
  620. line-height: 20px;
  621. }
  622. //表格文字
  623. /deep/.ws-info-table .el-form-item .el-form-item__label {
  624. text-align: left;
  625. font-size: 14px;
  626. font-family: PingFangSC-Regular, PingFang SC;
  627. font-weight: 400;
  628. color: #8890b1;
  629. background: #f6f7fc;
  630. line-height: 16px;
  631. }
  632. //质检员
  633. .inspector .el-form-item__content {
  634. text-align: left;
  635. margin-left: 0px;
  636. }
  637. </style>