warehouseManagementPut.vue 16 KB

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