warehouseManagementPerfectput.vue 34 KB

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