warehouseManagementPerfectDelivery.vue 19 KB

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