warehouseManagementPerfectput.vue 34 KB

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