warehouseManagementPerfectDelivery.vue 37 KB

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