warehouseManagementPut.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  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="submit()"
  235. >提交</el-button
  236. >
  237. </div>
  238. </ws-form>
  239. </div>
  240. </template>
  241. <script>
  242. import { pullDown, addstorageputList } from '@/model/warehouse/index'
  243. import { downloadFile } from '@/utils/batchDown'
  244. import Pagination from '@/components/Pagination'
  245. import WsUpload from '@/components/WsUpload'
  246. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  247. import { dayjs, EventBus } from 'base-core-lib'
  248. export default {
  249. name: 'viewSpareMoney',
  250. components: {
  251. WsUpload,
  252. Pagination,
  253. },
  254. watch: {
  255. // vesselId(val) {
  256. // this.getList()
  257. // },
  258. isShow(val) {
  259. this.showType = val
  260. },
  261. },
  262. data() {
  263. return {
  264. //弹出框
  265. dialogViewSpareMoney: false,
  266. dialogApproveFormVisible: false,
  267. // 船舶类型
  268. monetaryKey: null,
  269. // 表格显示数据
  270. tableDate: [],
  271. // 是否显示
  272. showType: true,
  273. // 年
  274. year: '',
  275. deptBudgetTotal: 0,
  276. currentPage: 1,
  277. pageSize: 10,
  278. searchType: 1,
  279. searchKeyWord: '',
  280. contractType: 2,
  281. startDate: null,
  282. endDate: null,
  283. goodnameList: {},
  284. // 提交类型
  285. submitType: true,
  286. storageType: [],
  287. appendixIdsAdd: '',
  288. uploadSuccess: {},
  289. onChange: {},
  290. gradeList: [],
  291. rules: {
  292. netWeight: [
  293. {
  294. required: true,
  295. type: 'number',
  296. message: '请输入活动名称',
  297. trigger: 'blur',
  298. },
  299. ],
  300. },
  301. size: 10,
  302. compId: sessionStorage.getItem('ws-pf_compId'),
  303. deptCircularPage: {},
  304. packtypeList: {},
  305. date: {
  306. year: dayjs().format('YYYY'),
  307. month: dayjs().format('MM'),
  308. },
  309. contractList: [],
  310. deptBudgetList: {
  311. warehouseInOutDetail: {},
  312. },
  313. historyList: [],
  314. pickerBeginDateBefore: {
  315. disabledDate: (time) => {
  316. return time.getTime() > Date.now()
  317. },
  318. },
  319. accessoryTFs: false,
  320. }
  321. },
  322. mounted() {
  323. console.log(this.$route.query)
  324. this.deptBudgetList.baseId = this.$route.query.baseId
  325. this.deptBudgetList.positionId = this.$route.query.positionId
  326. this.deptBudgetList.warehouseName = this.$route.query.warehouseName
  327. this.deptBudgetList.binNumber = this.$route.query.binNumber
  328. this.getList()
  329. },
  330. activated() {
  331. // //cg.viewBudget
  332. // //cg.viewSpareMoney
  333. // // this.getVesselData();
  334. // console.log(2222)
  335. // this.getList()
  336. // console.log(1111)
  337. // this.showType = this.isShow
  338. // this.getList(this.$route.query.baseId,)
  339. },
  340. methods: {
  341. //返回按钮
  342. returnWarehouse() {
  343. this.$router.push({ path: 'warehouseManagementList' })
  344. },
  345. //提交按钮
  346. submit() {
  347. this.$refs.deptBudgetList.validate((valid) => {
  348. if (valid) {
  349. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  350. this.deptBudgetList.inOutFlag = 2
  351. addstorageputList(this.deptBudgetList)
  352. .toPromise()
  353. .then((response) => {
  354. this.$message.success('添加成功')
  355. this.$router.push({ path: 'warehouseManagementList' })
  356. })
  357. } else {
  358. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  359. return false
  360. }
  361. })
  362. },
  363. tarechange(e) {
  364. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  365. this.deptBudgetList.netWeight = Number(
  366. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  367. )
  368. }
  369. },
  370. grossWeightchange(e) {
  371. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  372. this.deptBudgetList.netWeight = Number(
  373. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  374. )
  375. }
  376. },
  377. selectgoodsName(e) {
  378. for (var i = 0; i < this.goodnameList.length; i++) {
  379. if (this.goodnameList[i].constValue == e) {
  380. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  381. }
  382. }
  383. },
  384. selectpackingMethod(e) {
  385. for (var i = 0; i < this.packtypeList.length; i++) {
  386. if (this.packtypeList[i].constValue == e) {
  387. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  388. }
  389. }
  390. },
  391. selectstorageType(e) {
  392. for (var i = 0; i < this.storageType.length; i++) {
  393. if (this.storageType[i].constValue == e) {
  394. this.deptBudgetList.inOutTypeKey = this.storageType[i].constKey
  395. }
  396. }
  397. },
  398. handleClose() {
  399. this.accessoryTFs = false
  400. },
  401. handleSizeChange(val) {
  402. console.log(`每页 ${val} 条`)
  403. this.pageSize = val
  404. this.getList()
  405. },
  406. handleCurrentChange(val) {
  407. this.currentPage = val
  408. console.log(`当前页: ${val}`)
  409. this.getList()
  410. },
  411. getList() {
  412. // 货名
  413. pullDown({ constId: 'CON2' })
  414. .toPromise()
  415. .then((response) => {
  416. this.goodnameList = response
  417. })
  418. // 品级
  419. pullDown({ constId: 'CON3' })
  420. .toPromise()
  421. .then((response) => {
  422. this.gradeList = response
  423. })
  424. // 类型
  425. pullDown({ constId: 'CON5' })
  426. .toPromise()
  427. .then((response) => {
  428. this.storageType = response
  429. })
  430. },
  431. selecttaskType(e) {
  432. for (var i = 0; i < this.taskTypeList.length; i++) {
  433. if (this.taskTypeList[i].value == e) {
  434. this.searchType = this.taskTypeList[i].type
  435. }
  436. }
  437. },
  438. fujian(row) {
  439. if (
  440. row.receiveAttachmentPath === null ||
  441. row.receiveAttachmentPath === ''
  442. ) {
  443. EventBus.$emit(
  444. 'warning',
  445. this.$t('system.noticeCircular.NoInformation')
  446. )
  447. } else {
  448. this.accessoryTFs = true
  449. }
  450. this.appendixIdss = row.receiveAttachmentPath
  451. },
  452. handleExamine(row) {
  453. this.$router.push({
  454. name: 'salesContractExamine',
  455. query: { id: row.id },
  456. })
  457. },
  458. // 关闭 dialog时 处理文件url 初始化upload组件
  459. handleCloe() {
  460. this.dialogViewSpareMoney = false
  461. },
  462. history(row) {
  463. console.log(row)
  464. billoperatehis({ id: row.id })
  465. .toPromise()
  466. .then((response) => {
  467. this.historyList = response
  468. })
  469. },
  470. // deletecontract(){},
  471. //删除
  472. approve() {},
  473. listQuery() {},
  474. },
  475. }
  476. </script>
  477. <style lang="scss" scoped>
  478. /deep/.basicInformation {
  479. .ws-info-table {
  480. border: none;
  481. }
  482. .el-form-item {
  483. width: 33.3333%;
  484. border: none;
  485. .el-form-item__label {
  486. background: transparent;
  487. border: none;
  488. }
  489. .el-form-item__content {
  490. border: none;
  491. }
  492. }
  493. }
  494. .title {
  495. position: relative;
  496. padding-left: 10px;
  497. }
  498. .title::before {
  499. content: '';
  500. display: inline-block;
  501. width: 5px;
  502. height: 30px;
  503. background: #5473e8;
  504. position: absolute;
  505. left: 0;
  506. }
  507. .el-form {
  508. padding: 0 10%;
  509. }
  510. .el-button--primary {
  511. background-color: #5878e8;
  512. border-color: #5878e8;
  513. }
  514. .el-col {
  515. background: #f6f7fc;
  516. }
  517. .bg-right {
  518. text-align: right;
  519. padding: 16px 20px;
  520. }
  521. .center {
  522. position: relative;
  523. top: 50px;
  524. width: 40%;
  525. height: 2000px;
  526. margin: 0 auto;
  527. }
  528. /deep/.el-form-item__label {
  529. width: 160px;
  530. }
  531. /deep/.el-input--small {
  532. width: 70%;
  533. }
  534. //选填
  535. /deep/.el-form-item {
  536. width: 50%;
  537. }
  538. .container {
  539. overflow: scroll;
  540. height: 120vh;
  541. }
  542. /deep/.ws-info-table .el-form-item .el-form-item__label {
  543. text-align: center;
  544. }
  545. .deliverydate {
  546. width: 35%;
  547. }
  548. .center {
  549. margin-top: -60px;
  550. }
  551. </style>