warehouseManagementPut.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  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="temporaryStorage()"
  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. // },
  346. methods: {
  347. //返回按钮
  348. returnWarehouse() {
  349. this.$router.push({ path: 'warehouseManagementList' })
  350. },
  351. //提交按钮
  352. submit() {
  353. this.$refs.deptBudgetList.validate((valid) => {
  354. if (valid) {
  355. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  356. this.deptBudgetList.inOutFlag = 2
  357. this.deptBudgetList.statusFlag = 3
  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. temporaryStorage() {
  371. this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
  372. cancelButtonText: '取消',
  373. confirmButtonText: '确定',
  374. type: 'warning',
  375. })
  376. .then(() => {
  377. this.$refs.deptBudgetList.validate((valid) => {
  378. if (valid) {
  379. this.deptBudgetList.compId = sessionStorage.getItem(
  380. 'ws-pf_compId'
  381. )
  382. this.deptBudgetList.inOutFlag = 2
  383. this.deptBudgetList.statusFlag = 1
  384. addstorageputList(this.deptBudgetList)
  385. .toPromise()
  386. .then((response) => {
  387. this.$message.success('暂存成功')
  388. this.$router.push({ path: 'warehouseManagementList' })
  389. })
  390. } else {
  391. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  392. return false
  393. }
  394. })
  395. })
  396. .catch(() => {
  397. return false
  398. })
  399. },
  400. tarechange(e) {
  401. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  402. this.deptBudgetList.netWeight = Number(
  403. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  404. )
  405. }
  406. },
  407. grossWeightchange(e) {
  408. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  409. this.deptBudgetList.netWeight = Number(
  410. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  411. )
  412. }
  413. },
  414. selectgoodsName(e) {
  415. for (var i = 0; i < this.goodnameList.length; i++) {
  416. if (this.goodnameList[i].constValue == e) {
  417. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  418. }
  419. }
  420. },
  421. selectpackingMethod(e) {
  422. for (var i = 0; i < this.packtypeList.length; i++) {
  423. if (this.packtypeList[i].constValue == e) {
  424. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  425. }
  426. }
  427. },
  428. selectstorageType(e) {
  429. for (var i = 0; i < this.storageType.length; i++) {
  430. if (this.storageType[i].constValue == e) {
  431. this.deptBudgetList.inOutTypeKey = this.storageType[i].constKey
  432. }
  433. }
  434. },
  435. handleClose() {
  436. this.accessoryTFs = false
  437. },
  438. handleSizeChange(val) {
  439. console.log(`每页 ${val} 条`)
  440. this.pageSize = val
  441. this.getList()
  442. },
  443. handleCurrentChange(val) {
  444. this.currentPage = val
  445. console.log(`当前页: ${val}`)
  446. this.getList()
  447. },
  448. getList() {
  449. // 货名
  450. pullDown({ constId: 'CON2' })
  451. .toPromise()
  452. .then((response) => {
  453. this.goodnameList = response
  454. })
  455. // 品级
  456. pullDown({ constId: 'CON3' })
  457. .toPromise()
  458. .then((response) => {
  459. this.gradeList = response
  460. })
  461. // 类型
  462. pullDown({ constId: 'CON5' })
  463. .toPromise()
  464. .then((response) => {
  465. this.storageType = response
  466. })
  467. },
  468. selecttaskType(e) {
  469. for (var i = 0; i < this.taskTypeList.length; i++) {
  470. if (this.taskTypeList[i].value == e) {
  471. this.searchType = this.taskTypeList[i].type
  472. }
  473. }
  474. },
  475. fujian(row) {
  476. if (
  477. row.receiveAttachmentPath === null ||
  478. row.receiveAttachmentPath === ''
  479. ) {
  480. EventBus.$emit(
  481. 'warning',
  482. this.$t('system.noticeCircular.NoInformation')
  483. )
  484. } else {
  485. this.accessoryTFs = true
  486. }
  487. this.appendixIdss = row.receiveAttachmentPath
  488. },
  489. handleExamine(row) {
  490. this.$router.push({
  491. name: 'salesContractExamine',
  492. query: { id: row.id },
  493. })
  494. },
  495. // 关闭 dialog时 处理文件url 初始化upload组件
  496. handleCloe() {
  497. this.dialogViewSpareMoney = false
  498. },
  499. history(row) {
  500. console.log(row)
  501. billoperatehis({ id: row.id })
  502. .toPromise()
  503. .then((response) => {
  504. this.historyList = response
  505. })
  506. },
  507. // deletecontract(){},
  508. //删除
  509. approve() {},
  510. listQuery() {},
  511. },
  512. }
  513. </script>
  514. <style lang="scss" scoped>
  515. /deep/.basicInformation {
  516. .ws-info-table {
  517. border: none;
  518. }
  519. .el-form-item {
  520. width: 33.3333%;
  521. border: none;
  522. .el-form-item__label {
  523. background: transparent;
  524. border: none;
  525. }
  526. .el-form-item__content {
  527. border: none;
  528. }
  529. }
  530. }
  531. .title {
  532. position: relative;
  533. padding-left: 10px;
  534. }
  535. .title::before {
  536. content: '';
  537. display: inline-block;
  538. width: 5px;
  539. height: 30px;
  540. background: #5473e8;
  541. position: absolute;
  542. left: 0;
  543. }
  544. .el-form {
  545. padding: 0 10%;
  546. }
  547. .el-button--primary {
  548. background-color: #5878e8;
  549. border-color: #5878e8;
  550. }
  551. .el-col {
  552. background: #f6f7fc;
  553. }
  554. .bg-right {
  555. text-align: right;
  556. padding: 16px 20px;
  557. }
  558. .center {
  559. position: relative;
  560. top: 50px;
  561. width: 40%;
  562. height: 2000px;
  563. margin: 0 auto;
  564. }
  565. /deep/.el-form-item__label {
  566. width: 160px;
  567. }
  568. /deep/.el-input--small {
  569. width: 70%;
  570. }
  571. //选填
  572. /deep/.el-form-item {
  573. width: 50%;
  574. }
  575. .container {
  576. overflow: scroll;
  577. height: 120vh;
  578. }
  579. /deep/.ws-info-table .el-form-item .el-form-item__label {
  580. text-align: center;
  581. }
  582. .deliverydate {
  583. width: 35%;
  584. }
  585. .center {
  586. margin-top: -60px;
  587. }
  588. </style>