warehouseManagementPerfectDelivery.vue 36 KB

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