warehouseManagementNoWeightOut.vue 41 KB

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