warehouseManagementPut.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393
  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. <img
  28. style="position: relative; top: 2px"
  29. width="19"
  30. height="19"
  31. src="../../../public/img/cangku.png"
  32. alt=""
  33. />
  34. {{ deptBudgetList.warehouseName }}库
  35. <span class="position" v-show="this.$route.query.warehouseType == 1">
  36. {{ deptBudgetList.binNumber }}仓位
  37. </span>
  38. <span v-show="this.$route.query.warehouseType == 2">(临)</span>
  39. </h2>
  40. <ws-info-table>
  41. <!-- 货名 -->
  42. <ws-form-item label="货名" span="1">
  43. <ws-select
  44. v-model="deptBudgetList.goodsName"
  45. placeholder=""
  46. class="typeselect"
  47. @change="selectgoodsName"
  48. >
  49. <ws-option
  50. v-for="item in goodnameList"
  51. :key="item.constKey"
  52. :label="item.constValue"
  53. :value="item.constValue"
  54. />
  55. </ws-select>
  56. </ws-form-item>
  57. <!--毛重(吨)-->
  58. <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
  59. <ws-input
  60. @input="grossWeightchange"
  61. v-model="deptBudgetList.grossWeight"
  62. placeholder="请输入毛重"
  63. maxlength="20"
  64. size="small"
  65. />
  66. </ws-form-item>
  67. <!--皮重(吨)-->
  68. <ws-form-item
  69. label="皮重(吨)"
  70. span="1"
  71. prop="tare"
  72. class="readonly"
  73. >
  74. <ws-input
  75. @input="tarechange"
  76. v-model="deptBudgetList.tare"
  77. placeholder="请输入皮重"
  78. maxlength="100"
  79. size="small"
  80. />
  81. </ws-form-item>
  82. <!--净重(吨)-->
  83. <ws-form-item label="净重(吨)" span="1" prop="netWeight">
  84. <ws-input
  85. readonly="readonly"
  86. v-model="deptBudgetList.netWeight"
  87. placeholder="不可编辑,自动计算"
  88. maxlength="120"
  89. size="small"
  90. />
  91. </ws-form-item>
  92. <!-- 品级 -->
  93. <ws-form-item label="品级" span="1" class="readonly">
  94. <ws-select
  95. v-model="deptBudgetList.grade"
  96. placeholder=""
  97. class="typeselect"
  98. @change="selectpackingMethod"
  99. >
  100. <ws-option
  101. v-for="item in gradeList"
  102. :key="item.constKey"
  103. :label="item.constValue"
  104. :value="item.constValue"
  105. />
  106. </ws-select>
  107. </ws-form-item>
  108. <!--经办人-->
  109. <ws-form-item label="经办人" span="1" prop="agent">
  110. <ws-select
  111. v-model="deptBudgetList.agent"
  112. placeholder=""
  113. class="typeselect"
  114. >
  115. <ws-option
  116. v-for="item in agent"
  117. :key="item.constKey"
  118. :label="item.staffName"
  119. :value="item.staffName"
  120. />
  121. </ws-select>
  122. </ws-form-item>
  123. <!--出库日期-->
  124. <ws-form-item
  125. label="入库日期"
  126. span="1"
  127. prop="inOutDate"
  128. class="deliverydate"
  129. >
  130. <ws-date-picker
  131. v-model="deptBudgetList.inOutDate"
  132. type="date"
  133. placeholder="请选择入库日期"
  134. value-format="yyyy-MM-dd"
  135. />
  136. </ws-form-item>
  137. <!-- 入库类型 -->
  138. <ws-form-item label="入库类型" span="1">
  139. <ws-select
  140. v-model="deptBudgetList.inOutType"
  141. placeholder=""
  142. class="typeselect"
  143. @change="selectstorageType"
  144. >
  145. <ws-option
  146. v-for="item in storageType"
  147. :key="item.constKey"
  148. :label="item.constValue"
  149. :value="item.constValue"
  150. />
  151. </ws-select>
  152. </ws-form-item>
  153. <!--车牌号-->
  154. <ws-form-item label="车牌号" span="1" prop="carNo">
  155. <ws-input
  156. v-model="deptBudgetList.carNo"
  157. placeholder="请输入车牌号"
  158. maxlength="20"
  159. size="small"
  160. />
  161. </ws-form-item>
  162. <!--合同编号-->
  163. <ws-form-item label="合同编号" span="1" prop="contractNo">
  164. <ws-select
  165. v-model="deptBudgetList.contractNo"
  166. placeholder="请选择合同编号或移库任务编号"
  167. class="typeselect"
  168. >
  169. <ws-option
  170. v-for="item in outContractNo"
  171. :key="item.constKey"
  172. :label="item.contractNo"
  173. :value="item.contractNo"
  174. />
  175. </ws-select>
  176. </ws-form-item>
  177. </ws-info-table>
  178. <div v-show="this.$route.query.warehouseType == 2">
  179. <el-checkbox v-model="checked" checked>退库并出库</el-checkbox>
  180. <ws-info-table
  181. v-show="checked == true && this.deptBudgetList.createType == 2"
  182. >
  183. <!-- 出库类型 -->
  184. <ws-form-item label="出库类型" span="1">
  185. <ws-select
  186. v-model="deptBudgetList.deliveryType"
  187. placeholder=""
  188. class="typeselect"
  189. >
  190. <ws-option
  191. v-for="item in deliveryType"
  192. :key="item.constKey"
  193. :label="item.constValue"
  194. :value="item.constValue"
  195. />
  196. </ws-select>
  197. </ws-form-item>
  198. <!-- 出库合同编号 -->
  199. <ws-form-item label="出库合同编号" span="1">
  200. <ws-select
  201. v-model="deptBudgetList.outContractNo"
  202. placeholder="请选择合同编号或移库任务编号"
  203. class="typeselect"
  204. >
  205. <ws-option
  206. v-for="item in outContractNo"
  207. :key="item.constKey"
  208. :label="item.contractNo"
  209. :value="item.contractNo"
  210. />
  211. </ws-select>
  212. </ws-form-item>
  213. </ws-info-table>
  214. </div>
  215. </div>
  216. <ws-upload
  217. ref="upload"
  218. table-name="maintain_work_order"
  219. oss-key="mainPlan"
  220. :comp-id="compId"
  221. :appendix-ids="appendixIdsAdd"
  222. :vesselId="deptBudgetList.addressUrl"
  223. :size-limit="size"
  224. @uploadSuccess="uploadSuccess"
  225. @onChange="onChange"
  226. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
  227. />
  228. <div class="small-title">化验数据(选填)</div>
  229. <div class="inspector">
  230. <!--自检员-->
  231. <ws-form-item label="质检员" span="1" prop="qualityInspector">
  232. <ws-input
  233. v-model="deptBudgetList.warehouseInOutDetail.qualityInspector"
  234. placeholder="请输入质检员姓名"
  235. maxlength="10"
  236. size="small"
  237. />
  238. </ws-form-item>
  239. </div>
  240. <div class="neifor">
  241. <ws-info-table>
  242. <!--水分(%)<=-->
  243. <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
  244. <ws-input
  245. v-model="deptBudgetList.warehouseInOutDetail.waterContent"
  246. placeholder="请输入水分占比"
  247. maxlength="40"
  248. size="small"
  249. />
  250. </ws-form-item>
  251. <!--杂质(%)<=-->
  252. <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
  253. <ws-input
  254. v-model="deptBudgetList.warehouseInOutDetail.impurity"
  255. placeholder="请输入杂质占比"
  256. maxlength="40"
  257. size="small"
  258. />
  259. </ws-form-item>
  260. <!--容重(克/升)>=-->
  261. <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
  262. <ws-input
  263. v-model="deptBudgetList.warehouseInOutDetail.bulkDensity"
  264. placeholder="请输入容重"
  265. maxlength="40"
  266. size="small"
  267. />
  268. </ws-form-item>
  269. <!--霉变粒(%)<=-->
  270. <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
  271. <ws-input
  272. v-model="deptBudgetList.warehouseInOutDetail.mildewGrain"
  273. placeholder="请输入霉变粒占比"
  274. maxlength="40"
  275. size="small"
  276. />
  277. </ws-form-item>
  278. <!--热损伤(%)<=-->
  279. <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  280. <ws-input
  281. v-model="deptBudgetList.warehouseInOutDetail.jiaorenli"
  282. placeholder="请输入热损伤占比"
  283. maxlength="40"
  284. size="small"
  285. />
  286. </ws-form-item>
  287. <!--不完整粒(%)<=-->
  288. <ws-form-item label="不完整粒(%)<=" span="1" prop="imperfectGrain">
  289. <ws-input
  290. v-model="deptBudgetList.warehouseInOutDetail.imperfectGrain"
  291. placeholder="请输入不完整粒占比"
  292. maxlength="40"
  293. size="small"
  294. />
  295. </ws-form-item>
  296. </ws-info-table>
  297. </div>
  298. <div style="text-align: right; padding: 10px">
  299. <el-button
  300. class="bg-bottom-up"
  301. type="primary"
  302. size="small"
  303. @click="temporaryStorage()"
  304. >暂存</el-button
  305. >
  306. <el-button
  307. class="bg-bottom-up"
  308. type="primary"
  309. size="small"
  310. @click="submit()"
  311. >提交</el-button
  312. >
  313. </div>
  314. </ws-form>
  315. </div>
  316. </template>
  317. <script>
  318. import {
  319. pullDown,
  320. addstorageputList,
  321. xialaNo,
  322. getstaff,
  323. } from '@/model/warehouse/index'
  324. import Pagination from '@/components/Pagination'
  325. import WsUpload from '@/components/WsUpload'
  326. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  327. import { dayjs, EventBus } from 'base-core-lib'
  328. export default {
  329. name: 'viewSpareMoney',
  330. components: {
  331. WsUpload,
  332. Pagination,
  333. },
  334. watch: {
  335. // vesselId(val) {
  336. // this.getList()
  337. // },
  338. isShow(val) {
  339. this.showType = val
  340. },
  341. },
  342. data() {
  343. return {
  344. //弹出框
  345. dialogViewSpareMoney: false,
  346. dialogApproveFormVisible: false,
  347. // 船舶类型
  348. monetaryKey: null,
  349. // 表格显示数据
  350. tableDate: [],
  351. // 是否显示
  352. showType: true,
  353. // 年
  354. year: '',
  355. deptBudgetTotal: 0,
  356. currentPage: 1,
  357. pageSize: 10,
  358. searchType: 1,
  359. searchKeyWord: '',
  360. contractType: 2,
  361. startDate: null,
  362. endDate: null,
  363. goodnameList: {},
  364. checked: true,
  365. agent:[],
  366. outContractNo: [],
  367. // 提交类型
  368. submitType: true,
  369. storageType: [],
  370. deliveryType: [],
  371. readonly: true,
  372. appendixIdsAdd: '',
  373. uploadSuccess: {},
  374. onChange: {},
  375. gradeList: [],
  376. rules: {
  377. netWeight: [
  378. {
  379. required: true,
  380. type: 'number',
  381. message: '请输入活动名称',
  382. trigger: 'blur',
  383. },
  384. ],
  385. },
  386. size: 10,
  387. compId: sessionStorage.getItem('ws-pf_compId'),
  388. deptCircularPage: {},
  389. packtypeList: {},
  390. date: {
  391. year: dayjs().format('YYYY'),
  392. month: dayjs().format('MM'),
  393. },
  394. contractList: [],
  395. deptBudgetList: {
  396. warehouseInOutDetail: {},
  397. },
  398. historyList: [],
  399. pickerBeginDateBefore: {
  400. disabledDate: (time) => {
  401. return time.getTime() > Date.now()
  402. },
  403. },
  404. accessoryTFs: false,
  405. }
  406. },
  407. mounted() {
  408. this.deptBudgetList.baseId = this.$route.query.baseId
  409. this.deptBudgetList.positionId = this.$route.query.positionId
  410. this.deptBudgetList.warehouseName = this.$route.query.warehouseName
  411. this.deptBudgetList.binNumber = this.$route.query.binNumber
  412. this.deptBudgetList.warehouseType = this.$route.query.warehouseType
  413. this.deptBudgetList.createType = this.$route.query.createType
  414. this.getList()
  415. this.deptBudgetList.goodsName = '玉米'
  416. this.deptBudgetList.goodsNameKey = '1'
  417. this.deptBudgetList.grade = '一等品'
  418. this.deptBudgetList.gradeKey = '1'
  419. if (this.deptBudgetList.warehouseType == 1) {
  420. this.deptBudgetList.inOutType = '采购入库'
  421. this.deptBudgetList.inOutTypeKey = '1'
  422. } else {
  423. this.deptBudgetList.inOutType = '退库'
  424. this.deptBudgetList.inOutTypeKey = '1'
  425. }
  426. },
  427. methods: {
  428. //返回按钮
  429. revert() {
  430. this.$router.push({ path: 'warehouseManagementList' })
  431. },
  432. //提交按钮
  433. submit() {
  434. if (!this.deptBudgetList.goodsName) {
  435. this.$message({
  436. message: '货名不能为空',
  437. type: 'warning',
  438. })
  439. return
  440. }
  441. if (!this.deptBudgetList.grossWeight) {
  442. this.$message({
  443. message: '毛重不能为空',
  444. type: 'warning',
  445. })
  446. return
  447. }
  448. if (
  449. this.deptBudgetList.grossWeight < 0 ||
  450. this.deptBudgetList.grossWeight > 10000 ||
  451. (String(this.deptBudgetList.grossWeight).indexOf('.') != -1 &&
  452. String(this.deptBudgetList.grossWeight).length -
  453. (String(this.deptBudgetList.grossWeight).indexOf('.') + 1) >
  454. 3)
  455. ) {
  456. this.$message({
  457. message: '毛重输入错误',
  458. type: 'warning',
  459. })
  460. return
  461. }
  462. if (!this.deptBudgetList.tare) {
  463. this.$message({
  464. message: '皮重不能为空',
  465. type: 'warning',
  466. })
  467. return
  468. }
  469. if (
  470. this.deptBudgetList.tare < 0 ||
  471. this.deptBudgetList.tare > 10000 ||
  472. (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
  473. String(this.deptBudgetList.tare).length -
  474. (String(this.deptBudgetList.tare).indexOf('.') + 1) >
  475. 3)
  476. ) {
  477. this.$message({
  478. message: '皮重输入错误',
  479. type: 'warning',
  480. })
  481. return
  482. }
  483. if (!this.deptBudgetList.agent) {
  484. this.$message({
  485. message: '经办人不能为空',
  486. type: 'warning',
  487. })
  488. return
  489. }
  490. if (
  491. this.deptBudgetList.agent.length < 2 ||
  492. this.deptBudgetList.agent.length > 10
  493. ) {
  494. this.$message({
  495. message: '经办人输入有误',
  496. type: 'warning',
  497. })
  498. return
  499. }
  500. if (!this.deptBudgetList.grade) {
  501. this.$message({
  502. message: '品级不能为空!',
  503. type: 'warning',
  504. })
  505. return
  506. }
  507. if (!this.deptBudgetList.inOutDate) {
  508. this.$message({
  509. message: '入库日期不能为空!',
  510. type: 'warning',
  511. })
  512. return
  513. }
  514. if (!this.deptBudgetList.inOutType) {
  515. this.$message({
  516. message: '入库类型不能为空!',
  517. type: 'warning',
  518. })
  519. return
  520. }
  521. if (!this.deptBudgetList.carNo) {
  522. this.$message({
  523. message: '车牌号不能为空',
  524. type: 'warning',
  525. })
  526. return
  527. }
  528. if (this.deptBudgetList.carNo.length > 7) {
  529. this.$message({
  530. message: '车牌号输入错误,请输入7个字符之内',
  531. type: 'warning',
  532. })
  533. return
  534. }
  535. if (!this.deptBudgetList.contractNo) {
  536. this.$message({
  537. message: '合同编号不能为空',
  538. type: 'warning',
  539. })
  540. return
  541. }
  542. if (
  543. this.deptBudgetList.contractNo.length < 6 ||
  544. this.deptBudgetList.contractNo.length > 20
  545. ) {
  546. this.$message({
  547. message: '合同编号长度不符合要求,请输入6-20个字符之内',
  548. type: 'warning',
  549. })
  550. return
  551. }
  552. // if (this.deptBudgetList.netWeight > this.$route.query.capacity) {
  553. // this.$message({
  554. // message: '入库量大于该仓库容量!',
  555. // type: 'warning',
  556. // })
  557. // return
  558. // }
  559. //自检员
  560. if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
  561. if (
  562. this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
  563. 2 ||
  564. this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
  565. ) {
  566. this.$message({
  567. message: '质检员姓名长度错误!',
  568. type: 'warning',
  569. })
  570. return
  571. }
  572. }
  573. if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
  574. if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
  575. this.$message({
  576. message: '水分(%)非数字!',
  577. type: 'warning',
  578. })
  579. return
  580. }
  581. if (
  582. this.deptBudgetList.warehouseInOutDetail.waterContent < 1 ||
  583. this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
  584. (String(
  585. this.deptBudgetList.warehouseInOutDetail.waterContent
  586. ).indexOf('.') != -1 &&
  587. String(this.deptBudgetList.warehouseInOutDetail.waterContent)
  588. .length -
  589. (String(
  590. this.deptBudgetList.warehouseInOutDetail.waterContent
  591. ).indexOf('.') +
  592. 1) >
  593. 2)
  594. ) {
  595. this.$message({
  596. message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
  597. type: 'warning',
  598. })
  599. return
  600. }
  601. }
  602. //杂质
  603. if (this.deptBudgetList.warehouseInOutDetail.impurity) {
  604. if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
  605. this.$message({
  606. message: '杂质(%)非数字!',
  607. type: 'warning',
  608. })
  609. return
  610. }
  611. if (
  612. this.deptBudgetList.warehouseInOutDetail.impurity < 1 ||
  613. this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
  614. (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
  615. '.'
  616. ) != -1 &&
  617. String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
  618. (String(
  619. this.deptBudgetList.warehouseInOutDetail.impurity
  620. ).indexOf('.') +
  621. 1) >
  622. 2)
  623. ) {
  624. this.$message({
  625. message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
  626. type: 'warning',
  627. })
  628. return
  629. }
  630. }
  631. //霉变
  632. if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
  633. if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
  634. this.$message({
  635. message: '霉变粒(%)非数字!',
  636. type: 'warning',
  637. })
  638. return
  639. }
  640. if (
  641. this.deptBudgetList.warehouseInOutDetail.mildewGrain < 1 ||
  642. this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
  643. (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
  644. '.'
  645. ) != -1 &&
  646. String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
  647. .length -
  648. (String(
  649. this.deptBudgetList.warehouseInOutDetail.mildewGrain
  650. ).indexOf('.') +
  651. 1) >
  652. 2)
  653. ) {
  654. this.$message({
  655. message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  656. type: 'warning',
  657. })
  658. return
  659. }
  660. }
  661. //热损伤
  662. if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
  663. if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
  664. this.$message({
  665. message: '热损伤(%)非数字!',
  666. type: 'warning',
  667. })
  668. return
  669. }
  670. if (
  671. this.deptBudgetList.warehouseInOutDetail.jiaorenli < 1 ||
  672. this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
  673. (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
  674. '.'
  675. ) != -1 &&
  676. String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
  677. (String(
  678. this.deptBudgetList.warehouseInOutDetail.jiaorenli
  679. ).indexOf('.') +
  680. 1) >
  681. 2)
  682. ) {
  683. this.$message({
  684. message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
  685. type: 'warning',
  686. })
  687. return
  688. }
  689. }
  690. //不完整粒(%)
  691. if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
  692. if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
  693. this.$message({
  694. message: '不完整粒(%)非数字!',
  695. type: 'warning',
  696. })
  697. return
  698. }
  699. if (
  700. this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
  701. this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
  702. (String(
  703. this.deptBudgetList.warehouseInOutDetail.imperfectGrain
  704. ).indexOf('.') != -1 &&
  705. String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
  706. .length -
  707. (String(
  708. this.deptBudgetList.warehouseInOutDetail.imperfectGrain
  709. ).indexOf('.') +
  710. 1) >
  711. 2)
  712. ) {
  713. this.$message({
  714. message: '不完整粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  715. type: 'warning',
  716. })
  717. return
  718. }
  719. }
  720. //容重
  721. if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
  722. if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
  723. this.$message({
  724. message: '容重(克/升)非数字!',
  725. type: 'warning',
  726. })
  727. return
  728. }
  729. if (
  730. this.deptBudgetList.warehouseInOutDetail.bulkDensity < 1 ||
  731. this.deptBudgetList.warehouseInOutDetail.bulkDensity > 40 ||
  732. (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
  733. '.'
  734. ) != -1 &&
  735. String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
  736. .length -
  737. (String(
  738. this.deptBudgetList.warehouseInOutDetail.bulkDensity
  739. ).indexOf('.') +
  740. 1) >
  741. 0)
  742. ) {
  743. this.$message({
  744. message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
  745. type: 'warning',
  746. })
  747. return
  748. }
  749. }
  750. this.deptBudgetList.id = this.$route.query.id
  751. this.$confirm(`确定提交入库信息`, {
  752. cancelButtonText: '取消',
  753. confirmButtonText: '确定',
  754. type: 'warning',
  755. })
  756. .then(() => {
  757. this.$refs.deptBudgetList.validate((valid) => {
  758. if (valid) {
  759. this.deptBudgetList.compId =
  760. sessionStorage.getItem('ws-pf_compId')
  761. this.deptBudgetList.inOutFlag = 2
  762. this.deptBudgetList.statusFlag = 3
  763. addstorageputList(this.deptBudgetList)
  764. .toPromise()
  765. .then((response) => {
  766. this.$message.success('添加成功')
  767. this.$router.push({ path: 'warehouseManagementList' })
  768. })
  769. } else {
  770. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  771. return false
  772. }
  773. })
  774. })
  775. .catch(() => {
  776. return false
  777. })
  778. },
  779. temporaryStorage() {
  780. if (!this.deptBudgetList.goodsName) {
  781. this.$message({
  782. message: '货名不能为空',
  783. type: 'warning',
  784. })
  785. return
  786. }
  787. if (!this.deptBudgetList.grossWeight) {
  788. this.$message({
  789. message: '毛重不能为空',
  790. type: 'warning',
  791. })
  792. return
  793. }
  794. if (
  795. this.deptBudgetList.grossWeight < 0 ||
  796. this.deptBudgetList.grossWeight > 10000 ||
  797. (String(this.deptBudgetList.grossWeight).indexOf('.') != -1 &&
  798. String(this.deptBudgetList.grossWeight).length -
  799. (String(this.deptBudgetList.grossWeight).indexOf('.') + 1) >
  800. 3)
  801. ) {
  802. this.$message({
  803. message: '毛重输入错误',
  804. type: 'warning',
  805. })
  806. return
  807. }
  808. if (!this.deptBudgetList.tare) {
  809. this.$message({
  810. message: '皮重不能为空',
  811. type: 'warning',
  812. })
  813. return
  814. }
  815. if (
  816. this.deptBudgetList.tare < 0 ||
  817. this.deptBudgetList.tare > 10000 ||
  818. (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
  819. String(this.deptBudgetList.tare).length -
  820. (String(this.deptBudgetList.tare).indexOf('.') + 1) >
  821. 3)
  822. ) {
  823. this.$message({
  824. message: '皮重输入错误',
  825. type: 'warning',
  826. })
  827. return
  828. }
  829. if (!this.deptBudgetList.agent) {
  830. this.$message({
  831. message: '经办人不能为空',
  832. type: 'warning',
  833. })
  834. return
  835. }
  836. if (
  837. this.deptBudgetList.agent.length < 2 ||
  838. this.deptBudgetList.agent.length > 10
  839. ) {
  840. this.$message({
  841. message: '经办人输入有误',
  842. type: 'warning',
  843. })
  844. return
  845. }
  846. if (!this.deptBudgetList.carNo) {
  847. this.$message({
  848. message: '车牌号不能为空',
  849. type: 'warning',
  850. })
  851. return
  852. }
  853. if (this.deptBudgetList.carNo.length > 7) {
  854. this.$message({
  855. message: '车牌号输入错误,请输入7个字符之内',
  856. type: 'warning',
  857. })
  858. return
  859. }
  860. if (!this.deptBudgetList.contractNo) {
  861. this.$message({
  862. message: '合同编号不能为空',
  863. type: 'warning',
  864. })
  865. return
  866. }
  867. if (
  868. this.deptBudgetList.contractNo.length < 6 ||
  869. this.deptBudgetList.contractNo.length > 20
  870. ) {
  871. this.$message({
  872. message: '合同编号长度不符合要求,请输入6-20个字符之内',
  873. type: 'warning',
  874. })
  875. return
  876. }
  877. // if (this.deptBudgetList.netWeight > this.$route.query.capacity) {
  878. // this.$message({
  879. // message: '入库量大于该仓库容量!',
  880. // type: 'warning',
  881. // })
  882. // return
  883. // }
  884. //自检员
  885. if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
  886. if (
  887. this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
  888. 2 ||
  889. this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
  890. ) {
  891. this.$message({
  892. message: '质检员姓名长度错误!',
  893. type: 'warning',
  894. })
  895. return
  896. }
  897. }
  898. if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
  899. if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
  900. this.$message({
  901. message: '水分(%)非数字!',
  902. type: 'warning',
  903. })
  904. return
  905. }
  906. if (
  907. this.deptBudgetList.warehouseInOutDetail.waterContent < 1 ||
  908. this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
  909. (String(
  910. this.deptBudgetList.warehouseInOutDetail.waterContent
  911. ).indexOf('.') != -1 &&
  912. String(this.deptBudgetList.warehouseInOutDetail.waterContent)
  913. .length -
  914. (String(
  915. this.deptBudgetList.warehouseInOutDetail.waterContent
  916. ).indexOf('.') +
  917. 1) >
  918. 2)
  919. ) {
  920. this.$message({
  921. message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
  922. type: 'warning',
  923. })
  924. return
  925. }
  926. }
  927. //杂质
  928. if (this.deptBudgetList.warehouseInOutDetail.impurity) {
  929. if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
  930. this.$message({
  931. message: '杂质(%)非数字!',
  932. type: 'warning',
  933. })
  934. return
  935. }
  936. if (
  937. this.deptBudgetList.warehouseInOutDetail.impurity < 1 ||
  938. this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
  939. (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
  940. '.'
  941. ) != -1 &&
  942. String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
  943. (String(
  944. this.deptBudgetList.warehouseInOutDetail.impurity
  945. ).indexOf('.') +
  946. 1) >
  947. 2)
  948. ) {
  949. this.$message({
  950. message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
  951. type: 'warning',
  952. })
  953. return
  954. }
  955. }
  956. //霉变
  957. if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
  958. if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
  959. this.$message({
  960. message: '霉变粒(%)非数字!',
  961. type: 'warning',
  962. })
  963. return
  964. }
  965. if (
  966. this.deptBudgetList.warehouseInOutDetail.mildewGrain < 1 ||
  967. this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
  968. (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
  969. '.'
  970. ) != -1 &&
  971. String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
  972. .length -
  973. (String(
  974. this.deptBudgetList.warehouseInOutDetail.mildewGrain
  975. ).indexOf('.') +
  976. 1) >
  977. 2)
  978. ) {
  979. this.$message({
  980. message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  981. type: 'warning',
  982. })
  983. return
  984. }
  985. }
  986. //热损伤
  987. if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
  988. if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
  989. this.$message({
  990. message: '热损伤(%)非数字!',
  991. type: 'warning',
  992. })
  993. return
  994. }
  995. if (
  996. this.deptBudgetList.warehouseInOutDetail.jiaorenli < 1 ||
  997. this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
  998. (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
  999. '.'
  1000. ) != -1 &&
  1001. String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
  1002. (String(
  1003. this.deptBudgetList.warehouseInOutDetail.jiaorenli
  1004. ).indexOf('.') +
  1005. 1) >
  1006. 2)
  1007. ) {
  1008. this.$message({
  1009. message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1010. type: 'warning',
  1011. })
  1012. return
  1013. }
  1014. }
  1015. //不完整粒(%)
  1016. if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
  1017. if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
  1018. this.$message({
  1019. message: '不完整粒(%)非数字!',
  1020. type: 'warning',
  1021. })
  1022. return
  1023. }
  1024. if (
  1025. this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
  1026. this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
  1027. (String(
  1028. this.deptBudgetList.warehouseInOutDetail.imperfectGrain
  1029. ).indexOf('.') != -1 &&
  1030. String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
  1031. .length -
  1032. (String(
  1033. this.deptBudgetList.warehouseInOutDetail.imperfectGrain
  1034. ).indexOf('.') +
  1035. 1) >
  1036. 2)
  1037. ) {
  1038. this.$message({
  1039. message: '不完整粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1040. type: 'warning',
  1041. })
  1042. return
  1043. }
  1044. }
  1045. //容重
  1046. if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
  1047. if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
  1048. this.$message({
  1049. message: '容重(克/升)非数字!',
  1050. type: 'warning',
  1051. })
  1052. return
  1053. }
  1054. if (
  1055. this.deptBudgetList.warehouseInOutDetail.bulkDensity < 1 ||
  1056. this.deptBudgetList.warehouseInOutDetail.bulkDensity > 40 ||
  1057. (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
  1058. '.'
  1059. ) != -1 &&
  1060. String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
  1061. .length -
  1062. (String(
  1063. this.deptBudgetList.warehouseInOutDetail.bulkDensity
  1064. ).indexOf('.') +
  1065. 1) >
  1066. 0)
  1067. ) {
  1068. this.$message({
  1069. message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
  1070. type: 'warning',
  1071. })
  1072. return
  1073. }
  1074. }
  1075. this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
  1076. cancelButtonText: '取消',
  1077. confirmButtonText: '确定',
  1078. type: 'warning',
  1079. })
  1080. .then(() => {
  1081. this.$refs.deptBudgetList.validate((valid) => {
  1082. if (valid) {
  1083. this.deptBudgetList.compId =
  1084. sessionStorage.getItem('ws-pf_compId')
  1085. this.deptBudgetList.inOutFlag = 2
  1086. this.deptBudgetList.statusFlag = 1
  1087. addstorageputList(this.deptBudgetList)
  1088. .toPromise()
  1089. .then((response) => {
  1090. this.$message.success('暂存成功')
  1091. this.$router.push({ path: 'warehouseManagementList' })
  1092. })
  1093. } else {
  1094. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1095. return false
  1096. }
  1097. })
  1098. })
  1099. .catch(() => {
  1100. return false
  1101. })
  1102. },
  1103. tarechange(e) {
  1104. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  1105. this.deptBudgetList.netWeight = Number(
  1106. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  1107. )
  1108. }
  1109. },
  1110. grossWeightchange(e) {
  1111. if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
  1112. this.deptBudgetList.netWeight = Number(
  1113. this.deptBudgetList.grossWeight - this.deptBudgetList.tare
  1114. )
  1115. }
  1116. },
  1117. selectgoodsName(e) {
  1118. for (var i = 0; i < this.goodnameList.length; i++) {
  1119. if (this.goodnameList[i].constValue == e) {
  1120. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1121. }
  1122. }
  1123. },
  1124. selectpackingMethod(e) {
  1125. for (var i = 0; i < this.packtypeList.length; i++) {
  1126. if (this.packtypeList[i].constValue == e) {
  1127. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1128. }
  1129. }
  1130. },
  1131. selectstorageType(e) {
  1132. for (var i = 0; i < this.storageType.length; i++) {
  1133. if (this.storageType[i].constValue == e) {
  1134. this.deptBudgetList.inOutTypeKey = this.storageType[i].constKey
  1135. }
  1136. }
  1137. },
  1138. handleClose() {
  1139. this.accessoryTFs = false
  1140. },
  1141. handleSizeChange(val) {
  1142. console.log(`每页 ${val} 条`)
  1143. this.pageSize = val
  1144. this.getList()
  1145. },
  1146. handleCurrentChange(val) {
  1147. this.currentPage = val
  1148. console.log(`当前页: ${val}`)
  1149. this.getList()
  1150. },
  1151. getList() {
  1152. // 货名
  1153. pullDown({ constId: 'CON2' })
  1154. .toPromise()
  1155. .then((response) => {
  1156. this.goodnameList = response
  1157. })
  1158. // 品级
  1159. pullDown({ constId: 'CON3' })
  1160. .toPromise()
  1161. .then((response) => {
  1162. this.gradeList = response
  1163. })
  1164. // 类型
  1165. if (this.deptBudgetList.warehouseType == '1') {
  1166. pullDown({ constId: 'CON5' })
  1167. .toPromise()
  1168. .then((response) => {
  1169. this.storageType = response
  1170. })
  1171. } else if (this.deptBudgetList.warehouseType == '2') {
  1172. pullDown({ constId: 'WARE1' })
  1173. .toPromise()
  1174. .then((response) => {
  1175. this.storageType = response
  1176. })
  1177. pullDown({ constId: 'WARE2' })
  1178. .toPromise()
  1179. .then((response) => {
  1180. this.deliveryType = response
  1181. })
  1182. }
  1183. //合同编号
  1184. xialaNo({ compId: sessionStorage.getItem('ws-pf_compId') })
  1185. .toPromise()
  1186. .then((response) => {
  1187. this.outContractNo = response
  1188. })
  1189. //经办人
  1190. getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
  1191. .toPromise()
  1192. .then((response) => {
  1193. this.agent = response
  1194. })
  1195. },
  1196. selecttaskType(e) {
  1197. for (var i = 0; i < this.taskTypeList.length; i++) {
  1198. if (this.taskTypeList[i].value == e) {
  1199. this.searchType = this.taskTypeList[i].type
  1200. }
  1201. }
  1202. },
  1203. fujian(row) {
  1204. if (
  1205. row.receiveAttachmentPath === null ||
  1206. row.receiveAttachmentPath === ''
  1207. ) {
  1208. EventBus.$emit(
  1209. 'warning',
  1210. this.$t('system.noticeCircular.NoInformation')
  1211. )
  1212. } else {
  1213. this.accessoryTFs = true
  1214. }
  1215. this.appendixIdss = row.receiveAttachmentPath
  1216. },
  1217. handleExamine(row) {
  1218. this.$router.push({
  1219. name: 'salesContractExamine',
  1220. query: { id: row.id },
  1221. })
  1222. },
  1223. // 关闭 dialog时 处理文件url 初始化upload组件
  1224. // handleCloe() {
  1225. // this.dialogViewSpareMoney = false
  1226. // },
  1227. // history(row) {
  1228. // billoperatehis({ id: row.id })
  1229. // .toPromise()
  1230. // .then((response) => {
  1231. // this.historyList = response
  1232. // })
  1233. // },
  1234. // deletecontract(){},
  1235. //删除
  1236. approve() {},
  1237. listQuery() {},
  1238. },
  1239. }
  1240. </script>
  1241. <style lang="scss" scoped>
  1242. /deep/.basicInformation {
  1243. .ws-info-table {
  1244. border: none;
  1245. }
  1246. .el-form-item {
  1247. width: 33.3333%;
  1248. border: none;
  1249. .el-form-item__label {
  1250. background: transparent;
  1251. border: none;
  1252. }
  1253. .el-form-item__content {
  1254. border: none;
  1255. }
  1256. }
  1257. }
  1258. .title {
  1259. position: relative;
  1260. padding-left: 10px;
  1261. }
  1262. .title::before {
  1263. content: '';
  1264. display: inline-block;
  1265. width: 5px;
  1266. height: 30px;
  1267. background: #5473e8;
  1268. position: absolute;
  1269. left: 0;
  1270. }
  1271. .el-form {
  1272. padding: 0 10%;
  1273. }
  1274. .el-button--primary {
  1275. background-color: #5878e8;
  1276. border-color: #5878e8;
  1277. }
  1278. .el-col {
  1279. background: #f6f7fc;
  1280. }
  1281. .bg-right {
  1282. text-align: right;
  1283. padding: 16px 20px;
  1284. }
  1285. .center {
  1286. position: relative;
  1287. top: 50px;
  1288. width: 40%;
  1289. height: 2000px;
  1290. margin: 0 auto;
  1291. }
  1292. //选填
  1293. /deep/.el-form-item {
  1294. width: 50%;
  1295. }
  1296. .container {
  1297. overflow: scroll;
  1298. height: 120vh;
  1299. }
  1300. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1301. text-align: center;
  1302. }
  1303. .deliverydate {
  1304. display: inline-block;
  1305. width: 10%;
  1306. }
  1307. .center {
  1308. margin-top: -60px;
  1309. width: 80%;
  1310. }
  1311. //仓位
  1312. .position {
  1313. background: #afb5cb;
  1314. border-radius: 2px;
  1315. font-size: 12px;
  1316. color: #ffffff;
  1317. line-height: 20px;
  1318. display: inline-grid;
  1319. padding: 2px 4px;
  1320. }
  1321. //表格文字
  1322. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1323. text-align: left;
  1324. font-size: 14px;
  1325. font-family: PingFangSC-Regular, PingFang SC;
  1326. font-weight: 400;
  1327. color: #8890b1;
  1328. line-height: 16px;
  1329. }
  1330. .inspector {
  1331. width: 50%;
  1332. }
  1333. //质检员
  1334. .inspector .el-form-item__content {
  1335. text-align: left;
  1336. margin-left: 0px;
  1337. }
  1338. .small-title {
  1339. position: relative;
  1340. padding: 10px;
  1341. font-weight: 600;
  1342. }
  1343. .small-title::before {
  1344. position: absolute;
  1345. content: '';
  1346. display: block;
  1347. background: #5473e8;
  1348. width: 4px;
  1349. height: 14px;
  1350. left: 0px;
  1351. top: 13px;
  1352. padding: 4px 2px;
  1353. }
  1354. //下面列表
  1355. .neifor {
  1356. width: 80%;
  1357. background-color: #f6f7fc;
  1358. }
  1359. /deep/.neifor .ws-info-table .el-form-item .el-form-item__label {
  1360. width: 35%;
  1361. text-align: center;
  1362. }
  1363. /deep/.neifor .ws-info-table .el-form-item .el-form-item__content {
  1364. width: 60%;
  1365. background-color: #f6f7fc;
  1366. }
  1367. /deep/.neifor .el-input--small .el-input__inner {
  1368. width: 100%;
  1369. }
  1370. </style>