warehouseManagementPerfectDelivery.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  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. {{ this.deptBudgetList1.warehouseName}}库
  22. <span class="position">
  23. {{this.deptBudgetList1.binNumber }}仓位
  24. </span>
  25. </h2>
  26. <div class="small-title">基本信息</div>
  27. <ws-info-table>
  28. <!-- 货名 -->
  29. <ws-form-item label="货名" span="1">
  30. <ws-select
  31. v-model="deptBudgetList.goodsName"
  32. placeholder=""
  33. class="typeselect"
  34. @change="selectgoodsName"
  35. >
  36. <ws-option
  37. v-for="item in goodnameList"
  38. :key="item.constKey"
  39. :label="item.constValue"
  40. :value="item.constValue"
  41. />
  42. </ws-select>
  43. </ws-form-item>
  44. <!--毛重(吨)-->
  45. <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
  46. <ws-input
  47. @input="grossWeightchange"
  48. v-model="deptBudgetList.grossWeight"
  49. placeholder="请输入毛重"
  50. maxlength="20"
  51. size="small"
  52. />
  53. </ws-form-item>
  54. <!--皮重(吨)-->
  55. <ws-form-item
  56. label="皮重(吨)"
  57. span="1"
  58. prop="tare"
  59. class="readonly"
  60. >
  61. <ws-input
  62. @input="tarechange"
  63. v-model="deptBudgetList.tare"
  64. placeholder="请输入皮重"
  65. maxlength="100"
  66. size="small"
  67. />
  68. </ws-form-item>
  69. <!--净重(吨)-->
  70. <ws-form-item label="净重(吨)" span="1" prop="netWeight">
  71. <ws-input
  72. v-model.number="deptBudgetList.netWeight"
  73. placeholder="不可编辑,自动计算"
  74. type="number"
  75. maxlength="120"
  76. size="small"
  77. />
  78. </ws-form-item>
  79. <!-- 品级 -->
  80. <ws-form-item label="品级" span="1" class="readonly">
  81. <ws-select
  82. v-model="deptBudgetList.grade"
  83. placeholder=""
  84. class="typeselect"
  85. @change="selectpackingMethod"
  86. >
  87. <ws-option
  88. v-for="item in gradeList"
  89. :key="item.constKey"
  90. :label="item.constValue"
  91. :value="item.constValue"
  92. />
  93. </ws-select>
  94. </ws-form-item>
  95. <!--经办人-->
  96. <ws-form-item label="经办人" span="1" prop="agent">
  97. <ws-input
  98. v-model="deptBudgetList.agent"
  99. placeholder="请输入出库经办人姓名"
  100. maxlength="100"
  101. size="small"
  102. />
  103. </ws-form-item>
  104. <!--出库日期-->
  105. <ws-form-item label="出库日期" span="1" prop="inOutDate" class="deliverydate">
  106. <ws-date-picker
  107. v-model="deptBudgetList.inOutDate"
  108. type="date"
  109. placeholder="请选择出库日期"
  110. value-format="yyyy-MM-dd"
  111. />
  112. </ws-form-item>
  113. <!-- 入库类型 -->
  114. <ws-form-item label="出库类型" span="1">
  115. <ws-select
  116. v-model="deptBudgetList.inOutType"
  117. placeholder=""
  118. class="typeselect"
  119. @change="selectstorageType"
  120. >
  121. <ws-option
  122. v-for="item in storageType"
  123. :key="item.constKey"
  124. :label="item.constValue"
  125. :value="item.constValue"
  126. />
  127. </ws-select>
  128. </ws-form-item>
  129. <!--车牌号-->
  130. <ws-form-item label="车牌号" span="1" prop="sourceGoods">
  131. <ws-input
  132. v-model="deptBudgetList.carNo"
  133. placeholder="请输入车牌号"
  134. maxlength="20"
  135. size="small"
  136. />
  137. </ws-form-item>
  138. <!--合同编号-->
  139. <ws-form-item label="合同编号" span="1" prop="contractNo">
  140. <ws-input
  141. v-model="deptBudgetList.contractNo"
  142. placeholder="请输入合同编号"
  143. maxlength="100"
  144. size="small"
  145. />
  146. </ws-form-item>
  147. </ws-info-table>
  148. </div>
  149. <div class="small-title">上传仓库照片</div>
  150. <ws-upload
  151. ref="upload"
  152. table-name="maintain_work_order"
  153. oss-key="mainPlan"
  154. :comp-id="compId"
  155. :appendix-ids="appendixIdsAdd"
  156. :vesselId="deptBudgetList.addressUrl"
  157. :size-limit="size"
  158. @uploadSuccess="uploadSuccess"
  159. @onChange="onChange"
  160. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
  161. />
  162. <div class="small-title">化验数据(选填)</div>
  163. <div class="inspector">
  164. <!--自检员-->
  165. <ws-form-item label="质检员" span="1" prop="qualityInspector" >
  166. <ws-input
  167. v-model="deptBudgetList.warehouseInOutDetail.qualityInspector"
  168. placeholder="请输入质检员姓名"
  169. maxlength="120"
  170. size="small"
  171. />
  172. </ws-form-item>
  173. </div>
  174. <div class="neifor">
  175. <ws-info-table>
  176. <!--水分(%)<=-->
  177. <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
  178. <ws-input
  179. v-model="deptBudgetList.warehouseInOutDetail.waterContent"
  180. placeholder="请输入水分占比"
  181. maxlength="120"
  182. size="small"
  183. />
  184. </ws-form-item>
  185. <!--杂质(%)<=-->
  186. <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
  187. <ws-input
  188. v-model="deptBudgetList.warehouseInOutDetail.impurity"
  189. placeholder="请输入杂质占比"
  190. maxlength="120"
  191. size="small"
  192. />
  193. </ws-form-item>
  194. <!--容重(克/升)>=-->
  195. <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
  196. <ws-input
  197. v-model="deptBudgetList.warehouseInOutDetail.bulkDensity"
  198. placeholder="请输入容重"
  199. maxlength="120"
  200. size="small"
  201. />
  202. </ws-form-item>
  203. <!--霉变粒(%)<=-->
  204. <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
  205. <ws-input
  206. v-model="deptBudgetList.warehouseInOutDetail.mildewGrain"
  207. placeholder="请输入霉变粒占比"
  208. maxlength="120"
  209. size="small"
  210. />
  211. </ws-form-item>
  212. <!--热损伤(%)<=-->
  213. <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  214. <ws-input
  215. v-model="deptBudgetList.warehouseInOutDetail.jiaorenli"
  216. placeholder="请输入热损伤占比"
  217. maxlength="120"
  218. size="small"
  219. />
  220. </ws-form-item>
  221. <!--不完整粒(%)<=-->
  222. <ws-form-item label="不完整粒(%)<=" span="1" prop="imperfectGrain">
  223. <ws-input
  224. v-model="deptBudgetList.warehouseInOutDetail.imperfectGrain"
  225. placeholder="请输入不完整粒占比"
  226. maxlength="120"
  227. size="small"
  228. />
  229. </ws-form-item>
  230. </ws-info-table>
  231. </div>
  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. // 年
  284. year: '',
  285. deptBudgetTotal: 0,
  286. currentPage: 1,
  287. pageSize: 10,
  288. searchType: 1,
  289. searchKeyWord: '',
  290. contractType: 2,
  291. startDate: null,
  292. endDate: null,
  293. goodnameList: {},
  294. // 提交类型
  295. submitType: true,
  296. storageType: [],
  297. appendixIdsAdd: '',
  298. uploadSuccess: {},
  299. onChange: {},
  300. deptBudgetList1:[],
  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. this.deptBudgetList.baseId = this.$route.query.baseId
  335. this.deptBudgetList.positionId = this.$route.query.positionId
  336. this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
  337. this.deptBudgetList1.binNumber = this.$route.query.binNumber
  338. this.getList()
  339. },
  340. methods: {
  341. //返回按钮
  342. returnWarehouse() {
  343. this.$router.push({ path: 'warehouseManagementNoComplete' })
  344. },
  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. if (this.deptBudgetList.warehouseInOutDetail.qualityInspector.length<2 || deptBudgetList.warehouseInOutDetail.qualityInspector > 10
  379. ) {
  380. this.$message({
  381. message: '质检员姓名长度错误!',
  382. type: 'warning',
  383. })
  384. return
  385. }
  386. if (this.deptBudgetList.warehouseInOutDetail.qualityInspector.length<2 || deptBudgetList.warehouseInOutDetail.qualityInspector > 10
  387. ) {
  388. this.$message({
  389. message: '质检员姓名长度错误!',
  390. type: 'warning',
  391. })
  392. return
  393. }
  394. this.$refs.deptBudgetList.validate((valid) => {
  395. if (valid) {
  396. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  397. this.deptBudgetList.inOutFlag = 1
  398. this.deptBudgetList.statusFlag = 3
  399. addstorageputList(this.deptBudgetList)
  400. .toPromise()
  401. .then((response) => {
  402. this.$message.success('添加成功')
  403. this.$router.push({ path: 'warehouseManagementList' })
  404. })
  405. } else {
  406. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  407. return false
  408. }
  409. })
  410. },
  411. //暂存按钮
  412. returnWarehouse() {
  413. this.$refs.deptBudgetList.validate((valid) => {
  414. if (valid) {
  415. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  416. this.deptBudgetList.statusFlag = 1
  417. addstorageputList(this.deptBudgetList)
  418. .toPromise()
  419. .then((response) => {
  420. this.$message.success('添加成功')
  421. this.$router.push({ path: 'warehouseManagementList' })
  422. })
  423. } else {
  424. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  425. return false
  426. }
  427. })
  428. },
  429. tarechange(e) {
  430. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  431. this.deptBudgetList.netWeight = Number(
  432. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  433. )
  434. }
  435. },
  436. grossWeightchange(e) {
  437. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  438. this.deptBudgetList.netWeight = Number(
  439. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  440. )
  441. }
  442. },
  443. selectgoodsName(e) {
  444. for (var i = 0; i < this.goodnameList.length; i++) {
  445. if (this.goodnameList[i].constValue == e) {
  446. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  447. }
  448. }
  449. },
  450. selectpackingMethod(e) {
  451. for (var i = 0; i < this.packtypeList.length; i++) {
  452. if (this.packtypeList[i].constValue == e) {
  453. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  454. }
  455. }
  456. },
  457. selectstorageType(e) {
  458. for (var i = 0; i < this.storageType.length; i++) {
  459. if (this.storageType[i].constValue == e) {
  460. this.deptBudgetList.inOutTypeKey = this.storageType[i].constKey
  461. }
  462. }
  463. },
  464. handleClose() {
  465. this.accessoryTFs = false
  466. },
  467. handleSizeChange(val) {
  468. console.log(`每页 ${val} 条`)
  469. this.pageSize = val
  470. this.getList()
  471. },
  472. handleCurrentChange(val) {
  473. this.currentPage = val
  474. console.log(`当前页: ${val}`)
  475. this.getList()
  476. },
  477. getList() {
  478. // 货名
  479. pullDown({ constId: 'CON2' })
  480. .toPromise()
  481. .then((response) => {
  482. this.goodnameList = response
  483. })
  484. // 品级
  485. pullDown({ constId: 'CON3' })
  486. .toPromise()
  487. .then((response) => {
  488. this.gradeList = response
  489. })
  490. // 类型
  491. pullDown({ constId: 'CON5' })
  492. .toPromise()
  493. .then((response) => {
  494. this.storageType = response
  495. })
  496. },
  497. selecttaskType(e) {
  498. for (var i = 0; i < this.taskTypeList.length; i++) {
  499. if (this.taskTypeList[i].value == e) {
  500. this.searchType = this.taskTypeList[i].type
  501. }
  502. }
  503. },
  504. fujian(row) {
  505. if (
  506. row.receiveAttachmentPath === null ||
  507. row.receiveAttachmentPath === ''
  508. ) {
  509. EventBus.$emit(
  510. 'warning',
  511. this.$t('system.noticeCircular.NoInformation')
  512. )
  513. } else {
  514. this.accessoryTFs = true
  515. }
  516. this.appendixIdss = row.receiveAttachmentPath
  517. },
  518. handleExamine(row) {
  519. this.$router.push({
  520. name: 'salesContractExamine',
  521. query: { id: row.id },
  522. })
  523. },
  524. // 关闭 dialog时 处理文件url 初始化upload组件
  525. handleCloe() {
  526. this.dialogViewSpareMoney = false
  527. },
  528. history(row) {
  529. console.log(row)
  530. billoperatehis({ id: row.id })
  531. .toPromise()
  532. .then((response) => {
  533. this.historyList = response
  534. })
  535. },
  536. async exportlist() {
  537. const { data } = await export1(
  538. {
  539. compId: sessionStorage.getItem('ws-pf_compId'),
  540. contractType: this.contractType,
  541. currentPage: this.currentPage,
  542. pageSize: this.pageSize,
  543. searchType: this.searchType,
  544. searchKeyWord: this.searchKeyWord,
  545. startDate: this.startDate,
  546. endDate: this.endDate,
  547. },
  548. {},
  549. { responseType: 'blob' }
  550. ).toPromise()
  551. downloadFile({
  552. res: data,
  553. fileName: `${
  554. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  555. }_采购合同`,
  556. type: 'xls',
  557. })
  558. },
  559. // deletecontract(){},
  560. //删除
  561. approve() {},
  562. listQuery() {},
  563. total() {},
  564. clearfiltQuery() {},
  565. selectCrtDuty() {},
  566. },
  567. }
  568. </script>
  569. <style lang="scss" scoped>
  570. /deep/.basicInformation {
  571. .ws-info-table {
  572. border: none;
  573. }
  574. .el-form-item {
  575. width: 33.3333%;
  576. border: none;
  577. .el-form-item__label {
  578. background: transparent;
  579. border: none;
  580. }
  581. .el-form-item__content {
  582. border: none;
  583. }
  584. }
  585. }
  586. .title {
  587. position: relative;
  588. padding-left: 10px;
  589. }
  590. .title::before {
  591. content: '';
  592. display: inline-block;
  593. width: 5px;
  594. height: 30px;
  595. background: #5473e8;
  596. position: absolute;
  597. left: 0;
  598. }
  599. .el-form {
  600. padding: 0 10%;
  601. }
  602. .el-button--primary {
  603. background-color: #5878e8;
  604. border-color: #5878e8;
  605. }
  606. .el-col {
  607. background: #f6f7fc;
  608. }
  609. .bg-right {
  610. text-align: right;
  611. padding: 16px 20px;
  612. }
  613. .center {
  614. position: relative;
  615. top: 50px;
  616. width: 40%;
  617. height: 2000px;
  618. margin: 0 auto;
  619. }
  620. /deep/.el-form-item__label {
  621. width: 160px;
  622. }
  623. //选填
  624. /deep/.el-form-item {
  625. width: 50%;
  626. }
  627. .container {
  628. overflow: scroll;
  629. height: 120vh;
  630. }
  631. /deep/.ws-info-table .el-form-item .el-form-item__label {
  632. text-align: center;
  633. }
  634. .deliverydate {
  635. display: inline-block;
  636. width: 10%;
  637. }
  638. .center {
  639. margin-top: -60px;
  640. width: 80%;
  641. }
  642. //仓位
  643. .position{
  644. width: 52px;
  645. height: 20px;
  646. background: #AFB5CB;
  647. border-radius: 2px;
  648. font-size: 12px;
  649. font-family: PingFangSC-Medium, PingFang SC;
  650. color: #FFFFFF;
  651. line-height: 20px;
  652. }
  653. //表格文字
  654. /deep/.ws-info-table .el-form-item .el-form-item__label{
  655. text-align: left;
  656. font-size: 14px;
  657. font-family: PingFangSC-Regular, PingFang SC;
  658. font-weight: 400;
  659. color: #8890B1;
  660. line-height: 16px;
  661. }
  662. //质检员
  663. .inspector .el-form-item__content{
  664. text-align: left;
  665. margin-left: 0px;
  666. }
  667. .small-title {
  668. position: relative;
  669. padding: 10px;
  670. }
  671. .small-title::before {
  672. position: absolute;
  673. content: '';
  674. display: block;
  675. background: #5473e8;
  676. width: 4px;
  677. height: 14px;
  678. left: 0px;
  679. top: 13px;
  680. }
  681. //下面列表
  682. .neifor{
  683. width: 80%;
  684. background-color: #F6F7FC;
  685. }
  686. /deep/.neifor .ws-info-table .el-form-item .el-form-item__label{
  687. width: 35%;
  688. text-align: center;
  689. }
  690. /deep/.neifor .ws-info-table .el-form-item .el-form-item__content{
  691. width: 60%;
  692. background-color: #F6F7FC;
  693. }
  694. /deep/.neifor .el-input--small .el-input__inner{
  695. width: 120%;
  696. }
  697. .el-input__inner{
  698. width: 150px;
  699. }
  700. </style>