warehouseManagementNoWeightIn.vue 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777
  1. // 完善入库信息
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="20">
  6. <h2 class="bg-left title">入库皮重检斤</h2>
  7. </el-col>
  8. <el-col :span="4" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="revert()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <ws-form ref="dataList" :model="dataList" :rules="rules">
  25. <div class="basicInformation">
  26. <h2>
  27. {{ deptBudgetList1.warehouseName }}
  28. <span class="position" v-show="this.$route.query.warehouseType == 1">
  29. {{ deptBudgetList1.binNumber }}仓位
  30. </span>
  31. <span v-show="this.$route.query.warehouseType == 2">(临)</span>
  32. </h2>
  33. <div class="small-title">基本信息</div>
  34. <ws-info-table>
  35. <!--任务编号-->
  36. <ws-form-item label="任务编号" span="1" prop="inOutTaskNo">
  37. <el-select
  38. filterable
  39. clearable
  40. v-model="dataList.inOutTaskNo"
  41. placeholder="请选择任务编号"
  42. class="typeselect"
  43. @change="contractNoChange"
  44. >
  45. <el-option
  46. v-for="item in deptBudgetList2"
  47. :key="item.inOutTaskNo"
  48. :label="item.inOutTaskNo"
  49. :value="item.inOutTaskNo"
  50. />
  51. </el-select>
  52. </ws-form-item>
  53. <ws-form-item label="合同编号" span="1" prop="contractNo">
  54. <el-select
  55. filterable
  56. :filter-method="dataFilter1"
  57. v-model="dataList.contractNo"
  58. placeholder="请选择合同编号或移库任务编号"
  59. class="typeselect"
  60. @change='contractNoChange'
  61. >
  62. <el-option
  63. v-for="item in options1"
  64. :key="item.constKey"
  65. :label="item.contractNo"
  66. :value="item.contractNo"
  67. />
  68. </el-select>
  69. </ws-form-item>
  70. <!-- 货名 -->
  71. <ws-form-item label="货名" span="1">
  72. <ws-select
  73. disabled
  74. v-model="dataList.goodsName"
  75. placeholder
  76. class="typeselect"
  77. @change="selectgoodsName"
  78. >
  79. <ws-option
  80. v-for="item in goodnameList"
  81. :key="item.constKey"
  82. :label="item.constValue"
  83. :value="item.constValue"
  84. />
  85. </ws-select>
  86. </ws-form-item>
  87. <ws-form-item label="类型" span="1" prop="type">
  88. <ws-select v-model="dataList.type" @change="typeChange">
  89. <ws-option v-for="item in typeList" :key="item" :label="item" :value="item" />
  90. </ws-select>
  91. </ws-form-item>
  92. <!--毛重(公斤)-->
  93. <ws-form-item label="毛重(公斤)" span="1" prop="grossWeight">
  94. <ws-input
  95. :disabled="allowEdit"
  96. @input="grossWeightchange"
  97. v-model="dataList.grossWeight"
  98. placeholder="请输入毛重"
  99. maxlength="20"
  100. size="small"
  101. />
  102. </ws-form-item>
  103. <!--皮重(公斤)-->
  104. <ws-form-item label="皮重(公斤)" span="1" prop="tare" class="readonly">
  105. <ws-input
  106. :disabled="allowEdit"
  107. @input="tarechange"
  108. v-model="dataList.tare"
  109. placeholder="请输入皮重"
  110. maxlength="100"
  111. size="small"
  112. />
  113. <el-button type="primary" @click="openPort">重新获取</el-button>
  114. </ws-form-item>
  115. <ws-form-item label="扣重(公斤)" span="1" prop="deductionWeight" class="readonly">
  116. <ws-input
  117. @input="tarechange"
  118. v-model="dataList.deductionWeight"
  119. placeholder="请输入扣重"
  120. maxlength="100"
  121. size="small"
  122. />
  123. </ws-form-item>
  124. <!--净重(公斤)-->
  125. <ws-form-item label="净重(公斤)" span="1" prop="netWeight">
  126. <ws-input
  127. disabled
  128. v-model="dataList.netWeight"
  129. placeholder="不可编辑,自动计算"
  130. maxlength="120"
  131. size="small"
  132. />
  133. </ws-form-item>
  134. <ws-form-item v-if='dataList.type=="潮粮"' label="扣重比" span="1" prop="buckleWeightRatio" class="readonly">
  135. <ws-input
  136. @input='pureweight'
  137. v-model="dataList.buckleWeightRatio"
  138. placeholder="请输入扣重比"
  139. maxlength="100"
  140. size="small"
  141. />
  142. </ws-form-item>
  143. <ws-form-item v-if='dataList.type=="潮粮"' label="干粮水分占比" span="1" prop="solidGrainWater" class="readonly">
  144. <ws-input
  145. @input='pureweight'
  146. v-model="dataList.solidGrainWater"
  147. placeholder="请输入干粮水分占比"
  148. maxlength="100"
  149. size="small"
  150. />
  151. </ws-form-item>
  152. <ws-form-item v-if='dataList.type=="潮粮"' label="潮粮水分占比" span="1" prop="tidalGrainWater" class="readonly">
  153. <ws-input
  154. @input='pureweight'
  155. v-model="dataList.tidalGrainWater"
  156. placeholder="请输入潮粮水分占比"
  157. maxlength="100"
  158. size="small"
  159. />
  160. </ws-form-item>
  161. <ws-form-item v-if='dataList.type=="潮粮"' label="纯重" span="1" prop="pureWeight" class="readonly">
  162. <ws-input
  163. disabled
  164. v-model="dataList.pureWeight"
  165. placeholder="不可编辑,自动计算"
  166. maxlength="100"
  167. size="small"
  168. />
  169. </ws-form-item>
  170. <!--净重(公斤)-->
  171. <ws-form-item label="扣款(元/公斤)" span="1" prop="deductionAmount">
  172. <ws-input
  173. @input="kkInput(dataList.deductionAmount)"
  174. v-model="dataList.deductionAmount"
  175. placeholder="请输入扣款金额"
  176. maxlength="120"
  177. size="small"
  178. />
  179. </ws-form-item>
  180. <!-- 品级 -->
  181. <ws-form-item label="品级" span="1" class="readonly">
  182. <ws-select
  183. v-model="dataList.grade"
  184. placeholder
  185. class="typeselect"
  186. @change="selectpackingMethod"
  187. >
  188. <ws-option
  189. v-for="item in gradeList"
  190. :key="item.constKey"
  191. :label="item.constValue"
  192. :value="item.constValue"
  193. />
  194. </ws-select>
  195. </ws-form-item>
  196. <!--经办人-->
  197. <ws-form-item label="经办人" span="1" prop="agent">
  198. <el-select
  199. v-model="dataList.agent"
  200. placeholder="请选择经办人"
  201. filterable
  202. @change="selectstaff"
  203. >
  204. <el-option
  205. v-for="item in options"
  206. :key="item.value"
  207. :label="item.staffName"
  208. :value="item.staffName"
  209. />
  210. </el-select>
  211. </ws-form-item>
  212. <!--出库日期-->
  213. <ws-form-item label="入库日期" span="1" prop="inOutDate" class="deliverydate">
  214. <el-date-picker
  215. v-model="dataList.inOutDate"
  216. placeholder="请选择入库日期"
  217. type="date"
  218. value-format="yyyy-MM-dd"
  219. ></el-date-picker>
  220. </ws-form-item>
  221. <!-- 入库类型 -->
  222. <ws-form-item label="入库类型" span="1">
  223. <ws-select
  224. v-model="dataList.inOutType"
  225. placeholder
  226. class="typeselect"
  227. @change="selectstorageType"
  228. :disabled="isSelectType"
  229. >
  230. <ws-option
  231. v-for="item in storageType"
  232. :key="item.constKey"
  233. :label="item.constValue"
  234. :value="item.constValue"
  235. />
  236. </ws-select>
  237. </ws-form-item>
  238. <!--车牌号 -->
  239. <ws-form-item label="车牌号" span="1" prop="carNo">
  240. <ws-input
  241. v-if='!carstatus'
  242. v-model="dataList.carNo"
  243. placeholder="请输入车牌号"
  244. maxlength="7"
  245. size="small"
  246. />
  247. <el-select
  248. v-if='carstatus'
  249. filterable
  250. :filter-method="dataFilter2"
  251. v-model="dataList.carNo"
  252. placeholder="请选择车牌号"
  253. class="typeselect"
  254. @change='carChange'
  255. >
  256. <el-option
  257. v-for="item in options2"
  258. :key="item.constKey"
  259. :label="item.carNo+'('+item.tranCarNo+')'"
  260. :value="item.carNo"
  261. />
  262. </el-select>
  263. </ws-form-item>
  264. <ws-form-item label="成本" span="1" prop="cost">
  265. <ws-input
  266. :disabled='disabled1'
  267. v-model="dataList.cost"
  268. placeholder="请输入成本"
  269. size="small"
  270. />
  271. <img
  272. width="17"
  273. height="18"
  274. style="vertical-align: text-top; position: relative; top: -1px"
  275. src="../../../public/img/edit.png"
  276. @click="editClick(1)"
  277. alt=""
  278. />
  279. </ws-form-item>
  280. <ws-form-item label="运费" span="1" prop="freight">
  281. <ws-input
  282. :disabled='disabled2'
  283. v-model="dataList.freight"
  284. placeholder="请输入运费"
  285. size="small"
  286. />
  287. <img
  288. width="17"
  289. height="18"
  290. style="vertical-align: text-top; position: relative; top: -1px"
  291. src="../../../public/img/edit.png"
  292. @click="editClick(2)"
  293. alt=""
  294. />
  295. </ws-form-item>
  296. </ws-info-table>
  297. <div v-show="this.$route.query.warehouseType == 2 && this.$route.query.createType == 2">
  298. <el-checkbox v-model="checked" checked>退库并出库</el-checkbox>
  299. <ws-info-table v-show="checked == true">
  300. <!-- 出库类型 -->
  301. <ws-form-item label="出库类型" span="1">
  302. <ws-select
  303. v-model="dataList.temporaryOutType"
  304. placeholder=""
  305. class="typeselect"
  306. >
  307. <ws-option
  308. v-for="item in deliveryType"
  309. :key="item.constKey"
  310. :label="item.constValue"
  311. :value="item.constValue"
  312. />
  313. </ws-select>
  314. </ws-form-item>
  315. <!-- 出库合同编号 -->
  316. <ws-form-item label="出库合同编号" span="1">
  317. <ws-select
  318. v-model="dataList.contractNo"
  319. placeholder="请选择合同编号或移库任务编号"
  320. class="typeselect"
  321. >
  322. <ws-option
  323. v-for="item in outContractNo"
  324. :key="item.constKey"
  325. :label="item.contractNo"
  326. :value="item.contractNo"
  327. />
  328. </ws-select>
  329. </ws-form-item>
  330. </ws-info-table>
  331. </div>
  332. </div>
  333. <!-- <div class="small-title">上传磅单照片</div>
  334. <el-upload
  335. action="https://www.zthymaoyi.com/upload/admin"
  336. :show-file-list="false"
  337. :on-success="
  338. (res) => {
  339. uploadSuccessHandle1(res)
  340. }
  341. "
  342. class="avatar-uploader"
  343. accept=".jpg, .jpeg, .png, .gif"
  344. ><el-button size="small" type="primary">点击上传</el-button>
  345. </el-upload>
  346. <div>
  347. <img v-if='dataList.addressUrl' style='width:100px;height:100px;' :src="dataList.addressUrl" alt="">
  348. </div> -->
  349. <div class="small-title">化验数据(选填)</div>
  350. <div class="inspector">
  351. <!--质检员-->
  352. <!-- <ws-form-item label="质检员" span="1" prop="qualityInspector">
  353. <ws-input
  354. v-model="dataList.warehouseInOutDetail.qualityInspector"
  355. placeholder="请输入质检员姓名"
  356. maxlength="120"
  357. size="small"
  358. />
  359. </ws-form-item> -->
  360. <ws-form-item label="质检员" span="1" prop="qualityInspector">
  361. <el-select
  362. v-model="dataList.warehouseInOutDetail.qualityInspector"
  363. placeholder="请选择质检员"
  364. filterable
  365. clearable
  366. @change="qualityInspectorChange"
  367. >
  368. <el-option
  369. v-for="item in qualityInspectorList"
  370. :key="item.value"
  371. :label="item.staffName"
  372. :value="item.staffName"
  373. />
  374. </el-select>
  375. </ws-form-item>
  376. </div>
  377. <div class="neifor">
  378. <ws-info-table>
  379. <!--水分(%)<=-->
  380. <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
  381. <ws-input
  382. v-model="dataList.warehouseInOutDetail.waterContent"
  383. placeholder="请输入水分占比"
  384. maxlength="120"
  385. size="small"
  386. />
  387. </ws-form-item>
  388. <!--杂质(%)<=-->
  389. <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
  390. <ws-input
  391. v-model="dataList.warehouseInOutDetail.impurity"
  392. placeholder="请输入杂质占比"
  393. maxlength="120"
  394. size="small"
  395. />
  396. </ws-form-item>
  397. <!--容重(克/升)>=-->
  398. <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
  399. <ws-input
  400. v-model="dataList.warehouseInOutDetail.bulkDensity"
  401. placeholder="请输入容重"
  402. maxlength="120"
  403. size="small"
  404. />
  405. </ws-form-item>
  406. <!--霉变粒(%)<=-->
  407. <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
  408. <ws-input
  409. v-model="dataList.warehouseInOutDetail.mildewGrain"
  410. placeholder="请输入霉变粒占比"
  411. maxlength="120"
  412. size="small"
  413. />
  414. </ws-form-item>
  415. <!--热损伤(%)<=-->
  416. <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  417. <ws-input
  418. v-model="dataList.warehouseInOutDetail.jiaorenli"
  419. placeholder="请输入热损伤占比"
  420. maxlength="120"
  421. size="small"
  422. />
  423. </ws-form-item>
  424. <!--不完善粒(%)<=-->
  425. <ws-form-item label="不完善粒(%)<=" span="1" prop="imperfectGrain">
  426. <ws-input
  427. v-model="dataList.warehouseInOutDetail.imperfectGrain"
  428. placeholder="请输入不完善粒占比"
  429. maxlength="120"
  430. size="small"
  431. />
  432. </ws-form-item>
  433. </ws-info-table>
  434. </div>
  435. <div style="text-align: right; padding: 10px">
  436. <!-- <el-button
  437. class="bg-bottom-up"
  438. type="primary"
  439. size="small"
  440. @click="temporaryStorage()"
  441. >暂存</el-button
  442. > -->
  443. <el-button
  444. class="bg-bottom-up"
  445. type="primary"
  446. size="small"
  447. @click="submit()"
  448. >提交</el-button
  449. >
  450. </div>
  451. </ws-form>
  452. </div>
  453. </template>
  454. <script>
  455. import {
  456. pullDown,
  457. addstorageputList,
  458. xialaNo,
  459. getstaff,
  460. getPrintInfo,
  461. getReceiptTaskNo
  462. } from '@/model/warehouse/index'
  463. import { downloadFile } from '@/utils/batchDown'
  464. import Pagination from '@/components/Pagination'
  465. import { mapActions, mapGetters, mapState } from 'vuex'
  466. import WsUpload from '@/components/WsUpload'
  467. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  468. import { dayjs, EventBus } from 'base-core-lib'
  469. export default {
  470. name: 'viewSpareMoney',
  471. components: {
  472. WsUpload,
  473. Pagination,
  474. },
  475. watch: {
  476. // vesselId(val) {
  477. // this.getList()
  478. // },
  479. isShow(val) {
  480. this.showType = val
  481. },
  482. dataList:{//深度监听,可监听到对象、数组的变化
  483. handler(val, oldVal){
  484. if(val.tare){
  485. this.dataList.netWeight = this.dataList.grossWeight - val.tare
  486. }
  487. },
  488. deep:true //true 深度监听
  489. }
  490. },
  491. computed: {
  492. ...mapGetters(['deptBudgetList']),
  493. },
  494. data() {
  495. return {
  496. deptBudgetList2:[],
  497. isSelectType:true,
  498. isGetCost:false,
  499. qualityInspectorList:[],
  500. //弹出框
  501. dialogViewSpareMoney: false,
  502. dialogApproveFormVisible: false,
  503. // 船舶类型
  504. monetaryKey: null,
  505. // 表格显示数据
  506. tableDate: [],
  507. // 是否显示
  508. showType: true,
  509. // 年
  510. year: '',
  511. deptBudgetTotal: 0,
  512. readonly: true,
  513. currentPage: 1,
  514. pageSize: 10,
  515. searchType: 1,
  516. searchKeyWord: '',
  517. contractType: 2,
  518. startDate: null,
  519. endDate: null,
  520. goodnameList: {},
  521. checked: true,
  522. disabled1:true,
  523. disabled2:true,
  524. staffList: [],
  525. options: [],
  526. storageType: [],
  527. deliveryType: [],
  528. outContractNo: [],
  529. outContractNo1: [],
  530. // 提交类型
  531. submitType: true,
  532. typeList:['干粮','潮粮'],
  533. appendixIdsAdd: '',
  534. uploadSuccess: {},
  535. warehouseInOutDetail: {},
  536. onChange: {},
  537. deptBudgetList1: [],
  538. gradeList: [],
  539. rules: {
  540. netWeight: [
  541. {
  542. required: true,
  543. type: 'number',
  544. message: '请输入活动名称',
  545. trigger: 'blur',
  546. },
  547. ],
  548. },
  549. size: 10,
  550. compId: sessionStorage.getItem('ws-pf_compId'),
  551. skinInspector: sessionStorage.getItem('ws-pf_staffName'),
  552. deptCircularPage: {},
  553. packtypeList: {},
  554. date: {
  555. year: dayjs().format('YYYY'),
  556. month: dayjs().format('MM'),
  557. },
  558. options1: [],
  559. options2: [],
  560. carstatus:false,
  561. contractList: [],
  562. dataList: {
  563. id: '',
  564. grossWeight: '',
  565. contractNo: '',
  566. tare: '',
  567. netWeight: '',
  568. grade: '',
  569. agent: '',
  570. carNo: '',
  571. inOutDate: '',
  572. inOutType: '',
  573. goodsName: '',
  574. warehouseInOutDetail: {},
  575. cost:'',
  576. freight:0,
  577. type:'',
  578. buckleWeightRatio:'',
  579. tidalGrainWater:'',
  580. solidGrainWater:'',
  581. pureWeight:'',
  582. deductionAmount:'',
  583. deductionWeigh:'',
  584. },
  585. historyList: [],
  586. pickerBeginDateBefore: {
  587. disabledDate: (time) => {
  588. return time.getTime() > Date.now()
  589. },
  590. },
  591. accessoryTFs: false,
  592. param: 9600,
  593. allowEdit:true,
  594. result1:'00'
  595. }
  596. },
  597. activated() {
  598. if(this.$route.query.allowEdit == 1){
  599. this.allowEdit = false
  600. }
  601. else{
  602. this.allowEdit = true
  603. }
  604. this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
  605. this.deptBudgetList1.binNumber = this.$route.query.binNumber
  606. this.getList()
  607. this.dataList.id = this.$route.query.id
  608. this.dataList.grossWeight = Math.round(this.$route.query.grossWeight*1000)
  609. this.dataList.contractNo = this.$route.query.contractNo
  610. this.dataList.baseId = this.$route.query.baseId
  611. this.dataList.positionId = this.$route.query.positionId
  612. this.dataList.warehouseName = this.$route.query.warehouseName
  613. this.dataList.binNumber = this.$route.query.binNumber
  614. this.dataList.tare = Math.round(this.$route.query.tare*1000)
  615. this.dataList.netWeight = Math.round(this.$route.query.netWeight*1000)
  616. this.dataList.grade = this.$route.query.grade
  617. this.dataList.agent = this.$route.query.agent
  618. this.dataList.carNo = this.$route.query.carNo
  619. this.dataList.inOutDate = this.$route.query.inOutDate
  620. this.dataList.contractNo = this.$route.query.contractNo
  621. this.dataList.inOutType = this.$route.query.inOutType
  622. this.dataList.compId = this.$route.query.compId
  623. this.dataList.goodsName = this.$route.query.goodsName
  624. this.dataList.goodsNameKey = Number(this.$route.query.goodsNameKey)
  625. this.dataList.inOutFlag = this.$route.inOutFlag
  626. this.dataList.inOutTypeKey = Number(this.$route.query.inOutTypeKey)
  627. this.dataList.statusFlag = this.$route.statusFlag
  628. this.dataList.warehouseInOutDetail = this.$route.query.warehouseInOutDetail
  629. this.dataList.warehouseType = this.$route.query.warehouseType
  630. this.dataList.createType = this.$route.query.createType
  631. this.dataList.temporaryOutType = this.$route.query.temporaryOutType
  632. this.dataList.cost=this.$route.query.cost
  633. this.dataList.freight=this.$route.query.freight
  634. this.dataList.type=this.$route.query.type
  635. this.dataList.buckleWeightRatio=this.$route.query.buckleWeightRatio
  636. this.dataList.tidalGrainWater=this.$route.query.tidalGrainWater
  637. this.dataList.solidGrainWater=this.$route.query.solidGrainWater
  638. this.dataList.pureWeight=Math.round(this.$route.query.pureWeight*1000)
  639. this.dataList.deductionAmount=this.$route.query.deductionAmount/1000
  640. this.dataList.deductionWeight=Math.round(this.$route.query.deductionWeight*1000)
  641. this.dataList.inOutTypeFlag=1
  642. this.dataList.inOutTaskNo = this.$route.query.inOutTaskNo
  643. if(this.dataList.cost){
  644. this.isGetCost = true
  645. this.cost = this.dataList.cost
  646. }
  647. getReceiptTaskNo().toPromise()
  648. .then((response) => {
  649. console.log(response)
  650. this.deptBudgetList2 = response
  651. })
  652. },
  653. methods: {
  654. async closePort() {
  655. console.log('closePort');
  656. this.reader.cancel()
  657. },
  658. async openPort() {
  659. console.log('openPort', navigator);
  660. if ('serial' in navigator) {
  661. // The Web Serial API is supported.
  662. console.log('the Web Serial API is supported.');
  663. console.log(this.param);
  664. const port = await navigator.serial.requestPort();
  665. await port.open({
  666. baudRate: this.param
  667. }); // set baud rate
  668. this.reader = port.readable.getReader();
  669. // 监听来自串行设备的数据
  670. while (true) {
  671. const {
  672. value,
  673. done
  674. } = await this.reader.read();
  675. // console.log("value",value);
  676. if (done) {
  677. // 允许稍后关闭串口。
  678. this.reader.releaseLock();
  679. break;
  680. }
  681. var result = '';
  682. //2。获取16进制字符串
  683. // var receData = HexConvert.ByteToString(value);
  684. // console.log("receData",receData);
  685. var flag = false;
  686. var flag1 = false;
  687. // for (var i = 0; i < value.length; i++) {
  688. // var tmp = String.fromCharCode(value[i])
  689. // if (tmp == '+') {
  690. // flag = true
  691. // }
  692. // if (flag && result.length < 6 && tmp != '+') {
  693. // result += tmp
  694. // }
  695. // }
  696. // if(parseInt(result)){
  697. // this.dataList.tare = parseInt(result)
  698. // }
  699. if(this.deptBudgetList1.warehouseName&&(this.deptBudgetList.warehouseName == '山东诸城迈饶库'||this.deptBudgetList.warehouseName == '克东千红库'||this.warehouseName == '鲅鱼圈祥腾库')){
  700. for (var i = 0; i < value.length; i++) {
  701. var tmp = String.fromCharCode(value[i])
  702. if (tmp == '+') {
  703. flag = true
  704. }
  705. if (flag && result.length < 6 && tmp != '+') {
  706. result += tmp
  707. }
  708. }
  709. if(parseInt(result)|| parseInt(result) == 0){
  710. this.dataList.tare = parseInt(result)
  711. }
  712. }
  713. else{
  714. for(var i=0;i<value.length;i++){
  715. var tmp = String.fromCharCode(value[i])
  716. if((value[0] != 49 && value[0] != 2)){
  717. if((value[value.length-1] == 48&&value[value.length-2] == 48)){
  718. flag1 = true
  719. }
  720. else{
  721. break
  722. }
  723. }
  724. if (tmp == String.fromCharCode(32) ) {
  725. flag = true
  726. }
  727. if (flag && result.length < 7 && tmp != String.fromCharCode(32)&&!(value[value.length-1] == 48&&value[value.length-2] == 48)) {
  728. result += tmp
  729. }
  730. if (flag1 && tmp != String.fromCharCode(32)) {
  731. if((value[value.length-1] == 48&&value[value.length-2] == 48)){
  732. if(i == 0 ){
  733. this.result1 = tmp + '0'
  734. }
  735. }
  736. }
  737. }
  738. if(parseInt(result)|| parseInt(result) == 0){
  739. this.dataList.tare = parseInt(result+this.result1)
  740. }
  741. }
  742. setTimeout(1000)
  743. // value 是一个 Uint8Array
  744. }
  745. await port.close();
  746. } else {
  747. console.log('the Web Serial API is not supported.', navigator);
  748. }
  749. },
  750. kkInput(val){
  751. console.log(val)
  752. if(this.isGetCost){
  753. if(this.dataList.cost>val){
  754. this.dataList.cost = this.cost - this.dataList.deductionAmount
  755. }
  756. }
  757. },
  758. qualityInspectorChange(e){
  759. console.log(e)
  760. },
  761. uploadSuccessHandle1(res){
  762. this.dataList.addressUrl=res.url
  763. },
  764. pureweight(status){
  765. console.log(this.dataList)
  766. if(this.dataList.netWeight&&this.dataList.tidalGrainWater&&this.dataList.solidGrainWater&&this.dataList.buckleWeightRatio){
  767. this.dataList.pureWeight=(this.dataList.netWeight*(100-(this.dataList.tidalGrainWater-this.dataList.solidGrainWater)*this.dataList.buckleWeightRatio))/100
  768. }
  769. },
  770. //返回按钮
  771. revert() {
  772. this.$router.go(-1)
  773. },
  774. carChange(e){
  775. for (let i = 0; i < this.tranCarInfoList.length; i++) {
  776. if(this.tranCarInfoList[i].carNo==this.dataList.carNo){
  777. this.dataList.tranCarNo=this.tranCarInfoList[i].tranCarNo
  778. this.dataList.freight=this.tranCarInfoList[i].tranPrice
  779. }
  780. }
  781. },
  782. typeChange(e){
  783. },
  784. contractNoChange(e){
  785. for(let i = 0 ; i < this.deptBudgetList2.length ; i++){
  786. if(this.deptBudgetList2[i].inOutTaskNo == e){
  787. this.dataList.contractNo = this.deptBudgetList2[i].contractNo
  788. return
  789. }
  790. }
  791. for (var i = 0; i < this.outContractNo.length; i++) {
  792. if (this.outContractNo[i].contractNo == e) {
  793. if (this.outContractNo[i].inOutType == '采购入库') {
  794. this.dataList.inOutTypeKey = 1
  795. } else if (this.outContractNo[i].inOutType == '移库入库') {
  796. this.dataList.inOutTypeKey = 3
  797. } else if (this.outContractNo[i].inOutType == '暂存入库') {
  798. this.dataList.inOutTypeKey = 4
  799. } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
  800. this.dataList.inOutTypeKey = 5
  801. } else if (this.detailData.inOutType == '退库') {
  802. this.dataList.inOutTypeKey = 6
  803. }
  804. this.dataList.goodsName = this.outContractNo[i].goodsName
  805. this.dataList.goodsNameKey = this.outContractNo[i].goodsNameKey
  806. this.cost = this.outContractNo[i].contractPrice
  807. if(this.cost){
  808. this.isGetCost = true
  809. this.dataList.cost = this.cost - this.dataList.deductionAmount
  810. }else{
  811. this.isGetCost = false
  812. this.dataList.cost = this.dataList.cost
  813. }
  814. this.dataList.inOutType = this.outContractNo[i].inOutType
  815. if(this.outContractNo[i].inOutType=='移库入库'){
  816. this.isSelectType = false
  817. }else{
  818. this.isSelectType = true
  819. }
  820. if(this.outContractNo[i].tranCarInfoList){
  821. this.options2=this.outContractNo[i].tranCarInfoList
  822. this.tranCarInfoList=this.outContractNo[i].tranCarInfoList
  823. this.carstatus=true
  824. }
  825. }
  826. }
  827. },
  828. dataFilter1(val) {
  829. console.log(val)
  830. this.dataList.contractNo = val;
  831. if (val) { //val存在
  832. this.options1 = this.outContractNo1.filter((item) => {
  833. if (!!~item.contractNo.indexOf(val) || !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())) {
  834. return true
  835. }
  836. })
  837. } else { //val为空时,还原数组
  838. this.options1 = this.outContractNo;
  839. }
  840. },
  841. dataFilter2(val) {
  842. this.dataList.carNo = val;
  843. if (val) { //val存在
  844. this.options1 = this.outContractNo1.filter((item) => {
  845. if (!!~item.carNo.indexOf(val) || !!~item.carNo.toUpperCase().indexOf(val.toUpperCase())) {
  846. return true
  847. }
  848. })
  849. } else { //val为空时,还原数组
  850. this.options2 = this.tranCarInfoList;
  851. }
  852. },
  853. dataFilter(val) {
  854. // console.log(val,"名")
  855. this.dataList.staffList = val
  856. if (val) {
  857. //val存在
  858. this.options = this.staffList.filter((item) => {
  859. if (
  860. !!~item.staffName.indexOf(val) ||
  861. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  862. ) {
  863. return true
  864. }
  865. })
  866. } else {
  867. //val为空时,还原数组
  868. this.options = this.staffList
  869. }
  870. },
  871. editClick(status){
  872. this.isGetCost = false
  873. if(status==1){
  874. this.disabled1=!this.disabled1
  875. }else{
  876. this.disabled2=!this.disabled2
  877. }
  878. },
  879. selectstaff(e) {
  880. for (var i = 0; i < this.staffList.length; i++) {
  881. if (this.staffList[i].staffName == e) {
  882. this.dataList.personChargeKey = this.staffList[i].staffId
  883. }
  884. }
  885. },
  886. //暂存按钮
  887. temporaryStorage() {
  888. this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
  889. cancelButtonText: '取消',
  890. confirmButtonText: '确定',
  891. type: 'warning',
  892. })
  893. .then(() => {
  894. this.$refs.dataList.validate((valid) => {
  895. if (valid) {
  896. this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
  897. this.dataList.inOutFlag = 2
  898. this.dataList.statusFlag = 1
  899. let _data = JSON.parse(sessionStorage.getItem('winseaview-userInfo'))
  900. this.dataList.backOffice = _data.content.showCompName+'-' +_data.content.staffName
  901. addstorageputList(this.dataList)
  902. .toPromise()
  903. .then((response) => {
  904. this.$message.success('暂存成功')
  905. this.$router.push({ path: 'warehouseManagementList' })
  906. })
  907. } else {
  908. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  909. return false
  910. }
  911. })
  912. })
  913. .catch(() => {
  914. return false
  915. })
  916. },
  917. //提交按钮
  918. submit() {
  919. if (!this.dataList.goodsName) {
  920. this.$message({
  921. message: '货名不能为空',
  922. type: 'warning',
  923. })
  924. return
  925. }
  926. if (!this.dataList.grossWeight) {
  927. this.$message({
  928. message: '毛重不能为空',
  929. type: 'warning',
  930. })
  931. return
  932. }
  933. if (
  934. this.dataList.grossWeight <= 0 ||
  935. this.dataList.grossWeight > 300000 ||
  936. (String(this.dataList.grossWeight).indexOf('.') != -1 &&
  937. String(this.dataList.grossWeight).length -
  938. (String(this.dataList.grossWeight).indexOf('.') + 1) >
  939. 3)
  940. ) {
  941. this.$message({
  942. message: '毛重输入错误',
  943. type: 'warning',
  944. })
  945. return
  946. }
  947. if (
  948. this.dataList.tare < 0 ||
  949. this.dataList.tare > 200000 ||
  950. (String(this.dataList.tare).indexOf('.') != -1 &&
  951. String(this.dataList.tare).length -
  952. (String(this.dataList.tare).indexOf('.') + 1) >
  953. 3)
  954. ) {
  955. this.$message({
  956. message: '皮重输入错误',
  957. type: 'warning',
  958. })
  959. return
  960. }
  961. if (
  962. this.dataList.deductionWeight < 0 ||
  963. this.dataList.deductionWeight > 10000 ||
  964. (String(this.dataList.deductionWeight).indexOf('.') != -1 &&
  965. String(this.dataList.deductionWeight).length -
  966. (String(this.dataList.deductionWeight).indexOf('.') + 1) >
  967. 3)
  968. ) {
  969. this.$message({
  970. message: '扣重输入错误',
  971. type: 'warning'
  972. })
  973. return
  974. }
  975. if (this.dataList.type=='潮粮'&&!this.dataList.buckleWeightRatio) {
  976. this.$message({
  977. message: '扣重比不能为空',
  978. type: 'warning'
  979. })
  980. return
  981. }
  982. if (
  983. this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio < 0 ||
  984. this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio > 3 ||
  985. (this.dataList.type=='潮粮'&&String(this.dataList.buckleWeightRatio).indexOf('.') != -1 &&
  986. String(this.dataList.buckleWeightRatio).length -
  987. (String(this.dataList.buckleWeightRatio).indexOf('.') + 1) >
  988. 2)
  989. ) {
  990. this.$message({
  991. message: '扣重比输入错误',
  992. type: 'warning'
  993. })
  994. return
  995. }
  996. if (this.dataList.type=='潮粮'&&!this.dataList.tidalGrainWater) {
  997. this.$message({
  998. message: '潮粮水分不能为空',
  999. type: 'warning'
  1000. })
  1001. return
  1002. }
  1003. if (
  1004. this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater < 1 ||
  1005. this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater > 40 ||
  1006. (this.dataList.type=='潮粮'&&String(this.dataList.tidalGrainWater).indexOf('.') != -1 &&
  1007. String(this.dataList.tidalGrainWater).length -
  1008. (String(this.dataList.tidalGrainWater).indexOf('.') + 1) >
  1009. 2)
  1010. ) {
  1011. this.$message({
  1012. message: '潮粮水分输入错误',
  1013. type: 'warning'
  1014. })
  1015. return
  1016. }
  1017. if (this.dataList.type=='潮粮'&&!this.dataList.solidGrainWater) {
  1018. this.$message({
  1019. message: '干粮水分不能为空',
  1020. type: 'warning'
  1021. })
  1022. return
  1023. }
  1024. if (
  1025. this.dataList.type=='潮粮'&&this.dataList.solidGrainWater < 1 ||
  1026. this.dataList.type=='潮粮'&&this.dataList.solidGrainWater > 40 ||
  1027. (this.dataList.type=='潮粮'&&String(this.dataList.solidGrainWater).indexOf('.') != -1 &&
  1028. String(this.dataList.solidGrainWater).length -
  1029. (String(this.dataList.solidGrainWater).indexOf('.') + 1) >
  1030. 1)
  1031. ) {
  1032. this.$message({
  1033. message: '干粮水分输入错误',
  1034. type: 'warning'
  1035. })
  1036. return
  1037. }
  1038. if (
  1039. this.dataList.deductionAmount < 0 ||
  1040. this.dataList.deductionAmount > 10000 ||
  1041. (String(this.dataList.deductionAmount).indexOf('.') != -1 &&
  1042. String(this.dataList.deductionAmount).length -
  1043. (String(this.dataList.deductionAmount).indexOf('.') + 1) >
  1044. 2)
  1045. ) {
  1046. this.$message({
  1047. message: '扣款输入错误',
  1048. type: 'warning'
  1049. })
  1050. return
  1051. }
  1052. if (!this.dataList.cost) {
  1053. this.$message({
  1054. message: '未获取到成本,请编辑后提交',
  1055. type: 'warning'
  1056. })
  1057. return
  1058. }
  1059. if (
  1060. this.dataList.cost < 0 ||
  1061. this.dataList.cost > 20000 ||
  1062. (String(this.dataList.cost).indexOf('.') != -1 &&
  1063. String(this.dataList.cost).length -
  1064. (String(this.dataList.cost).indexOf('.') + 1) >
  1065. 2)
  1066. ) {
  1067. this.$message({
  1068. message: '成本输入错误',
  1069. type: 'warning'
  1070. })
  1071. return
  1072. }
  1073. if (!this.dataList.freight&&this.dataList.freight!=0) {
  1074. this.$message({
  1075. message: '运费不能为空',
  1076. type: 'warning'
  1077. })
  1078. return
  1079. }
  1080. if (
  1081. this.dataList.freight < 0 ||
  1082. this.dataList.freight > 100000 ||
  1083. (String(this.dataList.freight).indexOf('.') != -1 &&
  1084. String(this.dataList.freight).length -
  1085. (String(this.dataList.freight).indexOf('.') + 1) >
  1086. 2)
  1087. ) {
  1088. this.$message({
  1089. message: '运费输入错误',
  1090. type: 'warning'
  1091. })
  1092. return
  1093. }
  1094. if (!this.dataList.agent) {
  1095. this.$message({
  1096. message: '经办人不能为空',
  1097. type: 'warning',
  1098. })
  1099. return
  1100. }
  1101. if (this.dataList.agent.length < 2 || this.dataList.agent.length > 10) {
  1102. this.$message({
  1103. message: '经办人输入有误',
  1104. type: 'warning',
  1105. })
  1106. return
  1107. }
  1108. if (!this.dataList.grade) {
  1109. this.$message({
  1110. message: '品级不能为空!',
  1111. type: 'warning',
  1112. })
  1113. return
  1114. }
  1115. if (!this.dataList.inOutDate) {
  1116. this.$message({
  1117. message: '入库日期不能为空!',
  1118. type: 'warning',
  1119. })
  1120. return
  1121. }
  1122. if (!this.dataList.inOutType) {
  1123. this.$message({
  1124. message: '入库类型不能为空!',
  1125. type: 'warning',
  1126. })
  1127. return
  1128. }
  1129. if (!this.dataList.carNo) {
  1130. this.$message({
  1131. message: '车牌号不能为空',
  1132. type: 'warning',
  1133. })
  1134. return
  1135. }
  1136. if (this.dataList.carNo.length > 7) {
  1137. this.$message({
  1138. message: '车牌号输入错误,请输入7个字符之内',
  1139. type: 'warning',
  1140. })
  1141. return
  1142. }
  1143. if (!this.dataList.contractNo) {
  1144. this.$message({
  1145. message: '合同编号不能为空',
  1146. type: 'warning',
  1147. })
  1148. return
  1149. }
  1150. // if (
  1151. // this.dataList.contractNo.length < 6 ||
  1152. // this.dataList.contractNo.length > 20
  1153. // ) {
  1154. // this.$message({
  1155. // message: '合同编号长度不符合要求,请输入6-20个字符之内',
  1156. // type: 'warning',
  1157. // })
  1158. // return
  1159. // }
  1160. if (this.dataList.netWeight > this.$route.query.capacity) {
  1161. this.$message({
  1162. message: '入库量大于该仓库容量!',
  1163. type: 'warning',
  1164. })
  1165. return
  1166. }
  1167. //自检员
  1168. if (this.dataList.warehouseInOutDetail.qualityInspector) {
  1169. if (
  1170. this.dataList.warehouseInOutDetail.qualityInspector.length < 2 ||
  1171. this.dataList.warehouseInOutDetail.qualityInspector.length > 10
  1172. ) {
  1173. this.$message({
  1174. message: '质检员姓名长度错误!',
  1175. type: 'warning',
  1176. })
  1177. return
  1178. }
  1179. }
  1180. if (this.dataList.warehouseInOutDetail.waterContent) {
  1181. if (isNaN(this.dataList.warehouseInOutDetail.waterContent)) {
  1182. this.$message({
  1183. message: '水分(%)非数字!',
  1184. type: 'warning',
  1185. })
  1186. return
  1187. }
  1188. if (
  1189. this.dataList.warehouseInOutDetail.waterContent < 1 ||
  1190. this.dataList.warehouseInOutDetail.waterContent > 40 ||
  1191. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1192. '.'
  1193. ) != -1 &&
  1194. String(this.dataList.warehouseInOutDetail.waterContent).length -
  1195. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1196. '.'
  1197. ) +
  1198. 1) >
  1199. 2)
  1200. ) {
  1201. this.$message({
  1202. message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1203. type: 'warning',
  1204. })
  1205. return
  1206. }
  1207. }
  1208. //杂质
  1209. if (this.dataList.warehouseInOutDetail.impurity) {
  1210. if (isNaN(this.dataList.warehouseInOutDetail.impurity)) {
  1211. this.$message({
  1212. message: '杂质(%)非数字!',
  1213. type: 'warning',
  1214. })
  1215. return
  1216. }
  1217. if (
  1218. this.dataList.warehouseInOutDetail.impurity < 1 ||
  1219. this.dataList.warehouseInOutDetail.impurity > 40 ||
  1220. (String(this.dataList.warehouseInOutDetail.impurity).indexOf('.') !=
  1221. -1 &&
  1222. String(this.dataList.warehouseInOutDetail.impurity).length -
  1223. (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
  1224. '.'
  1225. ) +
  1226. 1) >
  1227. 2)
  1228. ) {
  1229. this.$message({
  1230. message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1231. type: 'warning',
  1232. })
  1233. return
  1234. }
  1235. }
  1236. //霉变
  1237. if (this.dataList.warehouseInOutDetail.mildewGrain) {
  1238. if (isNaN(this.dataList.warehouseInOutDetail.mildewGrain)) {
  1239. this.$message({
  1240. message: '霉变粒(%)非数字!',
  1241. type: 'warning',
  1242. })
  1243. return
  1244. }
  1245. if (
  1246. this.dataList.warehouseInOutDetail.mildewGrain < 1 ||
  1247. this.dataList.warehouseInOutDetail.mildewGrain > 40 ||
  1248. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1249. '.'
  1250. ) != -1 &&
  1251. String(this.dataList.warehouseInOutDetail.mildewGrain).length -
  1252. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1253. '.'
  1254. ) +
  1255. 1) >
  1256. 2)
  1257. ) {
  1258. this.$message({
  1259. message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1260. type: 'warning',
  1261. })
  1262. return
  1263. }
  1264. }
  1265. //热损伤
  1266. if (this.dataList.warehouseInOutDetail.jiaorenli) {
  1267. if (isNaN(this.dataList.warehouseInOutDetail.jiaorenli)) {
  1268. this.$message({
  1269. message: '热损伤(%)非数字!',
  1270. type: 'warning',
  1271. })
  1272. return
  1273. }
  1274. if (
  1275. this.dataList.warehouseInOutDetail.jiaorenli < 1 ||
  1276. this.dataList.warehouseInOutDetail.jiaorenli > 40 ||
  1277. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf('.') !=
  1278. -1 &&
  1279. String(this.dataList.warehouseInOutDetail.jiaorenli).length -
  1280. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
  1281. '.'
  1282. ) +
  1283. 1) >
  1284. 2)
  1285. ) {
  1286. this.$message({
  1287. message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1288. type: 'warning',
  1289. })
  1290. return
  1291. }
  1292. }
  1293. //不完善粒(%)
  1294. if (this.dataList.warehouseInOutDetail.imperfectGrain) {
  1295. if (isNaN(this.dataList.warehouseInOutDetail.imperfectGrain)) {
  1296. this.$message({
  1297. message: '不完善粒(%)非数字!',
  1298. type: 'warning',
  1299. })
  1300. return
  1301. }
  1302. if (
  1303. this.dataList.warehouseInOutDetail.imperfectGrain < 1 ||
  1304. this.dataList.warehouseInOutDetail.imperfectGrain > 40 ||
  1305. (String(this.dataList.warehouseInOutDetail.imperfectGrain).indexOf(
  1306. '.'
  1307. ) != -1 &&
  1308. String(this.dataList.warehouseInOutDetail.imperfectGrain).length -
  1309. (String(
  1310. this.dataList.warehouseInOutDetail.imperfectGrain
  1311. ).indexOf('.') +
  1312. 1) >
  1313. 2)
  1314. ) {
  1315. this.$message({
  1316. message: '不完善粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1317. type: 'warning',
  1318. })
  1319. return
  1320. }
  1321. }
  1322. //容重
  1323. if (this.dataList.warehouseInOutDetail.bulkDensity) {
  1324. if (isNaN(this.dataList.warehouseInOutDetail.bulkDensity)) {
  1325. this.$message({
  1326. message: '容重(克/升)非数字!',
  1327. type: 'warning',
  1328. })
  1329. return
  1330. }
  1331. if (
  1332. this.dataList.warehouseInOutDetail.bulkDensity > 1000 ||
  1333. this.dataList.warehouseInOutDetail.bulkDensity < 0||
  1334. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1335. '.'
  1336. ) != -1 &&
  1337. String(this.dataList.warehouseInOutDetail.bulkDensity).length -
  1338. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1339. '.'
  1340. ) +
  1341. 1) >
  1342. 0)
  1343. ) {
  1344. this.$message({
  1345. message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
  1346. type: 'warning',
  1347. })
  1348. return
  1349. }
  1350. }
  1351. this.$confirm(`确定提交皮重检斤`, {
  1352. cancelButtonText: '取消',
  1353. confirmButtonText: '确定',
  1354. type: 'warning',
  1355. })
  1356. .then(() => {
  1357. this.$refs.dataList.validate((valid) => {
  1358. if (valid) {
  1359. this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
  1360. this.dataList.skinInspector = sessionStorage.getItem('ws-pf_staffName')
  1361. this.dataList.inOutFlag = 2
  1362. this.dataList.statusFlag = 3
  1363. this.dataList.grossWeight = (this.dataList.grossWeight/1000).toFixed(2)
  1364. this.dataList.tare = (this.dataList.tare/1000).toFixed(2)
  1365. this.dataList.netWeight = (this.dataList.netWeight/1000).toFixed(2)
  1366. this.dataList.pureWeight = (this.dataList.pureWeight/1000).toFixed(2)
  1367. if(!this.dataList.deductionWeight){
  1368. this.dataList.deductionWeight = 0
  1369. }
  1370. if(!this.dataList.deductionAmount){
  1371. this.dataList.deductionAmount = 0
  1372. }
  1373. this.dataList.deductionWeight = (this.dataList.deductionWeight/1000).toFixed(2)
  1374. this.dataList.deductionAmount = Math.round(this.dataList.deductionAmount*1000)
  1375. addstorageputList(this.dataList)
  1376. .toPromise()
  1377. .then((response) => {
  1378. this.dataList.grossWeight = Math.round(this.dataList.grossWeight*1000)
  1379. this.dataList.tare = Math.round(this.dataList.tare*1000)
  1380. this.dataList.netWeight = Math.round(this.dataList.netWeight*1000)
  1381. this.dataList.pureWeight = Math.round(this.dataList.pureWeight*1000)
  1382. this.dataList.deductionWeight = Math.round(this.dataList.deductionWeight*1000)
  1383. this.$message.success('提交成功')
  1384. this.$confirm(`是否打印磅单`, {
  1385. cancelButtonText: '取消',
  1386. confirmButtonText: '确定',
  1387. type: 'warning',
  1388. })
  1389. .then(() => {
  1390. getPrintInfo({
  1391. id: this.dataList.id
  1392. })
  1393. .toPromise()
  1394. .then((response) => {
  1395. window.open( '../../../../static/weightCheckInOut.html?type=2&tableData=' +JSON.stringify(response))
  1396. })
  1397. })
  1398. this.$router.push({ path: 'warehouseManagementList' })
  1399. .catch(() => {
  1400. return false
  1401. })
  1402. })
  1403. } else {
  1404. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1405. return false
  1406. }
  1407. })
  1408. })
  1409. .catch(() => {
  1410. return false
  1411. })
  1412. },
  1413. //暂存按钮
  1414. returnWarehouse() {
  1415. this.$refs.dataList.validate((valid) => {
  1416. if (valid) {
  1417. this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
  1418. this.dataList.statusFlag = 1
  1419. addstorageputList(this.dataList)
  1420. .toPromise()
  1421. .then((response) => {
  1422. this.$message.success('添加成功')
  1423. this.$router.push({ path: 'warehouseManagementList' })
  1424. })
  1425. } else {
  1426. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1427. return false
  1428. }
  1429. })
  1430. },
  1431. tarechange(e) {
  1432. if (this.dataList.grossWeight && this.dataList.tare) {
  1433. this.dataList.netWeight = Number(
  1434. this.dataList.grossWeight - this.dataList.tare
  1435. )
  1436. }
  1437. },
  1438. grossWeightchange(e) {
  1439. if (this.dataList.grossWeight && this.dataList.tare) {
  1440. this.dataList.netWeight = Number(
  1441. this.dataList.grossWeight - this.dataList.tare
  1442. )
  1443. }
  1444. },
  1445. selectgoodsName(e) {
  1446. for (var i = 0; i < this.goodnameList.length; i++) {
  1447. if (this.goodnameList[i].constValue == e) {
  1448. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  1449. }
  1450. }
  1451. },
  1452. selectpackingMethod(e) {
  1453. for (var i = 0; i < this.packtypeList.length; i++) {
  1454. if (this.packtypeList[i].constValue == e) {
  1455. this.dataList.packingMethodKey = this.packtypeList[i].constKey
  1456. }
  1457. }
  1458. },
  1459. selectstorageType(e) {
  1460. for (var i = 0; i < this.storageType.length; i++) {
  1461. if (this.storageType[i].constValue == e) {
  1462. this.dataList.inOutTypeKey = this.storageType[i].constKey
  1463. }
  1464. }
  1465. },
  1466. handleClose() {
  1467. this.accessoryTFs = false
  1468. },
  1469. handleSizeChange(val) {
  1470. console.log(`每页 ${val} 条`)
  1471. this.pageSize = val
  1472. this.getList()
  1473. },
  1474. handleCurrentChange(val) {
  1475. this.currentPage = val
  1476. console.log(`当前页: ${val}`)
  1477. this.getList()
  1478. },
  1479. getList() {
  1480. // 货名
  1481. pullDown({ constId: 'CON2' })
  1482. .toPromise()
  1483. .then((response) => {
  1484. this.goodnameList = response
  1485. })
  1486. // 品级
  1487. pullDown({ constId: 'CON3' })
  1488. .toPromise()
  1489. .then((response) => {
  1490. this.gradeList = response
  1491. })
  1492. // 类型
  1493. if (this.$route.query.warehouseType == '1') {
  1494. this.storageType = []
  1495. pullDown({ constId: 'CON5' })
  1496. .toPromise()
  1497. .then((response) => {
  1498. // this.storageType = response
  1499. for(let i = 0;i<response.length;i++){
  1500. if(response[i].constValue=='移库入库'||response[i].constValue=='退库'){
  1501. this.storageType.push(response[i])
  1502. }
  1503. }
  1504. })
  1505. } else if (this.$route.query.warehouseType == '2') {
  1506. //临时仓库入库类型
  1507. pullDown({ constId: 'WARE1' })
  1508. .toPromise()
  1509. .then((response) => {
  1510. this.storageType = response
  1511. })
  1512. //临时仓库出库类型
  1513. pullDown({ constId: 'WARE2' })
  1514. .toPromise()
  1515. .then((response) => {
  1516. this.deliveryType = response
  1517. })
  1518. }
  1519. //合同编号
  1520. xialaNo({ compId: sessionStorage.getItem('ws-pf_compId'), flag: 6 })
  1521. .toPromise()
  1522. .then((response) => {
  1523. this.options1 = response
  1524. this.outContractNo = response
  1525. })
  1526. //合同编号2
  1527. xialaNo({ compId: sessionStorage.getItem('ws-pf_compId'), flag: 7 })
  1528. .toPromise()
  1529. .then((response) => {
  1530. this.outContractNo1 = response
  1531. })
  1532. //经办人
  1533. getstaff({ compId: sessionStorage.getItem('ws-pf_compId'),warehouseId:this.dataList.id })
  1534. .toPromise()
  1535. .then((response) => {
  1536. this.options = response
  1537. this.qualityInspectorList = response
  1538. this.staffList = response
  1539. // this.agent = response
  1540. })
  1541. },
  1542. selecttaskType(e) {
  1543. for (var i = 0; i < this.taskTypeList.length; i++) {
  1544. if (this.taskTypeList[i].value == e) {
  1545. this.searchType = this.taskTypeList[i].type
  1546. }
  1547. }
  1548. },
  1549. fujian(row) {
  1550. if (
  1551. row.receiveAttachmentPath === null ||
  1552. row.receiveAttachmentPath === ''
  1553. ) {
  1554. EventBus.$emit(
  1555. 'warning',
  1556. this.$t('system.noticeCircular.NoInformation')
  1557. )
  1558. } else {
  1559. this.accessoryTFs = true
  1560. }
  1561. this.appendixIdss = row.receiveAttachmentPath
  1562. },
  1563. handleExamine(row) {
  1564. this.$router.push({
  1565. name: 'salesContractExamine',
  1566. query: { id: row.id },
  1567. })
  1568. },
  1569. // 关闭 dialog时 处理文件url 初始化upload组件
  1570. handleCloe() {
  1571. this.dialogViewSpareMoney = false
  1572. },
  1573. history(row) {
  1574. console.log(row)
  1575. billoperatehis({ id: row.id })
  1576. .toPromise()
  1577. .then((response) => {
  1578. this.historyList = response
  1579. })
  1580. },
  1581. async exportlist() {
  1582. const { data } = await export1(
  1583. {
  1584. compId: sessionStorage.getItem('ws-pf_compId'),
  1585. contractType: this.contractType,
  1586. currentPage: this.currentPage,
  1587. pageSize: this.pageSize,
  1588. searchType: this.searchType,
  1589. searchKeyWord: this.searchKeyWord,
  1590. startDate: this.startDate,
  1591. endDate: this.endDate,
  1592. },
  1593. {},
  1594. { responseType: 'blob' }
  1595. ).toPromise()
  1596. downloadFile({
  1597. res: data,
  1598. fileName: `${
  1599. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  1600. }_采购合同`,
  1601. type: 'xls',
  1602. })
  1603. },
  1604. // deletecontract(){},
  1605. //删除
  1606. approve() {},
  1607. listQuery() {},
  1608. total() {},
  1609. clearfiltQuery() {},
  1610. selectCrtDuty() {},
  1611. },
  1612. }
  1613. </script>
  1614. <style lang="scss" scoped>
  1615. /deep/.basicInformation {
  1616. .ws-info-table {
  1617. border: none;
  1618. }
  1619. .el-form-item {
  1620. width: 33.3333%;
  1621. border: none;
  1622. .el-form-item__label {
  1623. background: transparent;
  1624. border: none;
  1625. }
  1626. .el-form-item__content {
  1627. border: none;
  1628. }
  1629. }
  1630. }
  1631. .title {
  1632. position: relative;
  1633. padding-left: 10px;
  1634. }
  1635. .title::before {
  1636. content: '';
  1637. display: inline-block;
  1638. width: 5px;
  1639. height: 30px;
  1640. background: #5473e8;
  1641. position: absolute;
  1642. left: 0;
  1643. }
  1644. .el-form {
  1645. padding: 0 10%;
  1646. }
  1647. .el-button--primary {
  1648. background-color: #5878e8;
  1649. border-color: #5878e8;
  1650. }
  1651. .el-col {
  1652. background: #f6f7fc;
  1653. }
  1654. .bg-right {
  1655. text-align: right;
  1656. padding: 16px 20px;
  1657. }
  1658. .center {
  1659. position: relative;
  1660. top: 50px;
  1661. width: 40%;
  1662. height: 2000px;
  1663. margin: 0 auto;
  1664. }
  1665. /deep/.el-form-item__label {
  1666. width: 160px;
  1667. }
  1668. .inspector {
  1669. width: 50%;
  1670. }
  1671. //质检员
  1672. /deep/[data-v-58803672] .el-form-item__label {
  1673. width: 60px;
  1674. }
  1675. [data-v-58803672] .el-form-item__label {
  1676. width: 60px;
  1677. }
  1678. //选填
  1679. /deep/.el-form-item {
  1680. width: 50%;
  1681. }
  1682. .container {
  1683. overflow: scroll;
  1684. height: 120vh;
  1685. }
  1686. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1687. text-align: center;
  1688. }
  1689. .deliverydate {
  1690. display: inline-block;
  1691. width: 10%;
  1692. }
  1693. .center {
  1694. margin-top: -60px;
  1695. width: 80%;
  1696. }
  1697. //仓位
  1698. .position {
  1699. width: 52px;
  1700. height: 20px;
  1701. background: #afb5cb;
  1702. border-radius: 2px;
  1703. font-size: 12px;
  1704. font-family: PingFangSC-Medium, PingFang SC;
  1705. color: #ffffff;
  1706. line-height: 20px;
  1707. }
  1708. //表格文字
  1709. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1710. text-align: left;
  1711. font-size: 14px;
  1712. font-family: PingFangSC-Regular, PingFang SC;
  1713. font-weight: 400;
  1714. color: #8890b1;
  1715. line-height: 16px;
  1716. }
  1717. //质检员
  1718. .inspector .el-form-item__content {
  1719. text-align: left;
  1720. margin-left: 0px;
  1721. }
  1722. .small-title {
  1723. position: relative;
  1724. padding: 10px;
  1725. font-weight: 600;
  1726. }
  1727. .small-title::before {
  1728. position: absolute;
  1729. content: '';
  1730. display: block;
  1731. background: #5473e8;
  1732. width: 4px;
  1733. height: 14px;
  1734. left: 0px;
  1735. top: 13px;
  1736. }
  1737. //下面列表
  1738. .neifor {
  1739. width: 80%;
  1740. background-color: #f6f7fc;
  1741. }
  1742. /deep/.neifor .ws-info-table .el-form-item .el-form-item__label {
  1743. width: 35%;
  1744. text-align: center;
  1745. }
  1746. /deep/.neifor .ws-info-table .el-form-item .el-form-item__content {
  1747. width: 60%;
  1748. background-color: #f6f7fc;
  1749. }
  1750. /deep/.neifor .el-input--small .el-input__inner {
  1751. width: 100%;
  1752. }
  1753. .el-input__inner {
  1754. width: 150px;
  1755. }
  1756. </style>