warehouseManagementNoWeightIn.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759
  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. deptCircularPage: {},
  552. packtypeList: {},
  553. date: {
  554. year: dayjs().format('YYYY'),
  555. month: dayjs().format('MM'),
  556. },
  557. options1: [],
  558. options2: [],
  559. carstatus:false,
  560. contractList: [],
  561. dataList: {
  562. id: '',
  563. grossWeight: '',
  564. contractNo: '',
  565. tare: '',
  566. netWeight: '',
  567. grade: '',
  568. agent: '',
  569. carNo: '',
  570. inOutDate: '',
  571. inOutType: '',
  572. goodsName: '',
  573. warehouseInOutDetail: {},
  574. cost:'',
  575. freight:0,
  576. type:'',
  577. buckleWeightRatio:'',
  578. tidalGrainWater:'',
  579. solidGrainWater:'',
  580. pureWeight:'',
  581. deductionAmount:'',
  582. deductionWeigh:'',
  583. },
  584. historyList: [],
  585. pickerBeginDateBefore: {
  586. disabledDate: (time) => {
  587. return time.getTime() > Date.now()
  588. },
  589. },
  590. accessoryTFs: false,
  591. param: 9600,
  592. allowEdit:true
  593. }
  594. },
  595. activated() {
  596. if(this.$route.query.allowEdit == 1){
  597. this.allowEdit = false
  598. }
  599. else{
  600. this.allowEdit = true
  601. }
  602. this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
  603. this.deptBudgetList1.binNumber = this.$route.query.binNumber
  604. this.getList()
  605. this.dataList.id = this.$route.query.id
  606. this.dataList.grossWeight = this.$route.query.grossWeight*1000
  607. this.dataList.contractNo = this.$route.query.contractNo
  608. this.dataList.baseId = this.$route.query.baseId
  609. this.dataList.positionId = this.$route.query.positionId
  610. this.dataList.warehouseName = this.$route.query.warehouseName
  611. this.dataList.binNumber = this.$route.query.binNumber
  612. this.dataList.tare = this.$route.query.tare*1000
  613. this.dataList.netWeight = this.$route.query.netWeight*1000
  614. this.dataList.grade = this.$route.query.grade
  615. this.dataList.agent = this.$route.query.agent
  616. this.dataList.carNo = this.$route.query.carNo
  617. this.dataList.inOutDate = this.$route.query.inOutDate
  618. this.dataList.contractNo = this.$route.query.contractNo
  619. this.dataList.inOutType = this.$route.query.inOutType
  620. this.dataList.compId = this.$route.query.compId
  621. this.dataList.goodsName = this.$route.query.goodsName
  622. this.dataList.goodsNameKey = Number(this.$route.query.goodsNameKey)
  623. this.dataList.inOutFlag = this.$route.inOutFlag
  624. this.dataList.inOutTypeKey = Number(this.$route.query.inOutTypeKey)
  625. this.dataList.statusFlag = this.$route.statusFlag
  626. this.dataList.warehouseInOutDetail = this.$route.query.warehouseInOutDetail
  627. this.dataList.warehouseType = this.$route.query.warehouseType
  628. this.dataList.createType = this.$route.query.createType
  629. this.dataList.temporaryOutType = this.$route.query.temporaryOutType
  630. this.dataList.cost=this.$route.query.cost
  631. this.dataList.freight=this.$route.query.freight
  632. this.dataList.type=this.$route.query.type
  633. this.dataList.buckleWeightRatio=this.$route.query.buckleWeightRatio
  634. this.dataList.tidalGrainWater=this.$route.query.tidalGrainWater
  635. this.dataList.solidGrainWater=this.$route.query.solidGrainWater
  636. this.dataList.pureWeight=this.$route.query.pureWeight*1000
  637. this.dataList.deductionAmount=this.$route.query.deductionAmount/1000
  638. this.dataList.deductionWeight=this.$route.query.deductionWeight*1000
  639. this.dataList.inOutTypeFlag=1
  640. this.dataList.inOutTaskNo = this.$route.query.inOutTaskNo
  641. if(this.dataList.cost){
  642. this.isGetCost = true
  643. this.cost = this.dataList.cost
  644. }
  645. getReceiptTaskNo().toPromise()
  646. .then((response) => {
  647. console.log(response)
  648. this.deptBudgetList2 = response
  649. })
  650. },
  651. methods: {
  652. async closePort() {
  653. console.log('closePort');
  654. this.reader.cancel()
  655. },
  656. async openPort() {
  657. console.log('openPort', navigator);
  658. if ('serial' in navigator) {
  659. // The Web Serial API is supported.
  660. console.log('the Web Serial API is supported.');
  661. console.log(this.param);
  662. const port = await navigator.serial.requestPort();
  663. await port.open({
  664. baudRate: this.param
  665. }); // set baud rate
  666. this.reader = port.readable.getReader();
  667. // 监听来自串行设备的数据
  668. while (true) {
  669. const {
  670. value,
  671. done
  672. } = await this.reader.read();
  673. // console.log("value",value);
  674. if (done) {
  675. // 允许稍后关闭串口。
  676. this.reader.releaseLock();
  677. break;
  678. }
  679. var result = '';
  680. //2。获取16进制字符串
  681. // var receData = HexConvert.ByteToString(value);
  682. // console.log("receData",receData);
  683. var flag = false;
  684. // for (var i = 0; i < value.length; i++) {
  685. // var tmp = String.fromCharCode(value[i])
  686. // if (tmp == '+') {
  687. // flag = true
  688. // }
  689. // if (flag && result.length < 6 && tmp != '+') {
  690. // result += tmp
  691. // }
  692. // }
  693. // if(parseInt(result)){
  694. // this.dataList.tare = parseInt(result)
  695. // }
  696. if(this.warehouseName&&this.warehouseName == '山东诸城迈饶库'){
  697. for (var i = 0; i < value.length; i++) {
  698. var tmp = String.fromCharCode(value[i])
  699. if (tmp == '+') {
  700. flag = true
  701. }
  702. if (flag && result.length < 6 && tmp != '+') {
  703. result += tmp
  704. }
  705. }
  706. if(parseInt(result)|| parseInt(result) == 0){
  707. this.dataList.tare = parseInt(result)
  708. }
  709. }
  710. else{
  711. for(var i=0;i<value.length;i++){
  712. var tmp = String.fromCharCode(value[i])
  713. if(value[0] != 49 && value[0] != 2){
  714. break
  715. }
  716. if (tmp == String.fromCharCode(32) ) {
  717. flag = true
  718. }
  719. if (flag && result.length < 7 && tmp != String.fromCharCode(32)) {
  720. // if(i-1 >=0 &&tmp == String.fromCharCode(48) && value[i-1] == 32){
  721. // continue
  722. // }
  723. // if(i-2 >=0 &&tmp == String.fromCharCode(48) && value[i-2] == 32){
  724. // continue
  725. // }
  726. result += tmp
  727. }
  728. }
  729. if(parseInt(result)|| parseInt(result) == 0){
  730. this.dataList.tare = parseInt(result)*100
  731. }
  732. }
  733. setTimeout(1000)
  734. // value 是一个 Uint8Array
  735. }
  736. await port.close();
  737. } else {
  738. console.log('the Web Serial API is not supported.', navigator);
  739. }
  740. },
  741. kkInput(val){
  742. console.log(val)
  743. if(this.isGetCost){
  744. if(this.dataList.cost>val){
  745. this.dataList.cost = this.cost - this.dataList.deductionAmount
  746. }
  747. }
  748. },
  749. qualityInspectorChange(e){
  750. console.log(e)
  751. },
  752. uploadSuccessHandle1(res){
  753. this.dataList.addressUrl=res.url
  754. },
  755. pureweight(status){
  756. console.log(this.dataList)
  757. if(this.dataList.netWeight&&this.dataList.tidalGrainWater&&this.dataList.solidGrainWater&&this.dataList.buckleWeightRatio){
  758. this.dataList.pureWeight=(this.dataList.netWeight*(100-(this.dataList.tidalGrainWater-this.dataList.solidGrainWater)*this.dataList.buckleWeightRatio))/100
  759. }
  760. },
  761. //返回按钮
  762. revert() {
  763. this.$router.go(-1)
  764. },
  765. carChange(e){
  766. for (let i = 0; i < this.tranCarInfoList.length; i++) {
  767. if(this.tranCarInfoList[i].carNo==this.dataList.carNo){
  768. this.dataList.tranCarNo=this.tranCarInfoList[i].tranCarNo
  769. this.dataList.freight=this.tranCarInfoList[i].tranPrice
  770. }
  771. }
  772. },
  773. typeChange(e){
  774. },
  775. contractNoChange(e){
  776. for(let i = 0 ; i < this.deptBudgetList2.length ; i++){
  777. if(this.deptBudgetList2[i].inOutTaskNo == e){
  778. this.dataList.contractNo = this.deptBudgetList2[i].contractNo
  779. return
  780. }
  781. }
  782. for (var i = 0; i < this.outContractNo.length; i++) {
  783. if (this.outContractNo[i].contractNo == e) {
  784. if (this.outContractNo[i].inOutType == '采购入库') {
  785. this.dataList.inOutTypeKey = 1
  786. } else if (this.outContractNo[i].inOutType == '移库入库') {
  787. this.dataList.inOutTypeKey = 3
  788. } else if (this.outContractNo[i].inOutType == '暂存入库') {
  789. this.dataList.inOutTypeKey = 4
  790. } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
  791. this.dataList.inOutTypeKey = 5
  792. } else if (this.detailData.inOutType == '退库') {
  793. this.dataList.inOutTypeKey = 6
  794. }
  795. this.dataList.goodsName = this.outContractNo[i].goodsName
  796. this.dataList.goodsNameKey = this.outContractNo[i].goodsNameKey
  797. this.cost = this.outContractNo[i].contractPrice
  798. if(this.cost){
  799. this.isGetCost = true
  800. this.dataList.cost = this.cost - this.dataList.deductionAmount
  801. }else{
  802. this.isGetCost = false
  803. this.dataList.cost = this.dataList.cost
  804. }
  805. this.dataList.inOutType = this.outContractNo[i].inOutType
  806. if(this.outContractNo[i].inOutType=='移库入库'){
  807. this.isSelectType = false
  808. }else{
  809. this.isSelectType = true
  810. }
  811. if(this.outContractNo[i].tranCarInfoList){
  812. this.options2=this.outContractNo[i].tranCarInfoList
  813. this.tranCarInfoList=this.outContractNo[i].tranCarInfoList
  814. this.carstatus=true
  815. }
  816. }
  817. }
  818. },
  819. dataFilter1(val) {
  820. console.log(val)
  821. this.dataList.contractNo = val;
  822. if (val) { //val存在
  823. this.options1 = this.outContractNo1.filter((item) => {
  824. if (!!~item.contractNo.indexOf(val) || !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())) {
  825. return true
  826. }
  827. })
  828. } else { //val为空时,还原数组
  829. this.options1 = this.outContractNo;
  830. }
  831. },
  832. dataFilter2(val) {
  833. this.dataList.carNo = val;
  834. if (val) { //val存在
  835. this.options1 = this.outContractNo1.filter((item) => {
  836. if (!!~item.carNo.indexOf(val) || !!~item.carNo.toUpperCase().indexOf(val.toUpperCase())) {
  837. return true
  838. }
  839. })
  840. } else { //val为空时,还原数组
  841. this.options2 = this.tranCarInfoList;
  842. }
  843. },
  844. dataFilter(val) {
  845. // console.log(val,"名")
  846. this.dataList.staffList = val
  847. if (val) {
  848. //val存在
  849. this.options = this.staffList.filter((item) => {
  850. if (
  851. !!~item.staffName.indexOf(val) ||
  852. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  853. ) {
  854. return true
  855. }
  856. })
  857. } else {
  858. //val为空时,还原数组
  859. this.options = this.staffList
  860. }
  861. },
  862. editClick(status){
  863. this.isGetCost = false
  864. if(status==1){
  865. this.disabled1=!this.disabled1
  866. }else{
  867. this.disabled2=!this.disabled2
  868. }
  869. },
  870. selectstaff(e) {
  871. for (var i = 0; i < this.staffList.length; i++) {
  872. if (this.staffList[i].staffName == e) {
  873. this.dataList.personChargeKey = this.staffList[i].staffId
  874. }
  875. }
  876. },
  877. //暂存按钮
  878. temporaryStorage() {
  879. this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
  880. cancelButtonText: '取消',
  881. confirmButtonText: '确定',
  882. type: 'warning',
  883. })
  884. .then(() => {
  885. this.$refs.dataList.validate((valid) => {
  886. if (valid) {
  887. this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
  888. this.dataList.inOutFlag = 2
  889. this.dataList.statusFlag = 1
  890. let _data = JSON.parse(sessionStorage.getItem('winseaview-userInfo'))
  891. this.dataList.backOffice = _data.content.showCompName+'-' +_data.content.staffName
  892. addstorageputList(this.dataList)
  893. .toPromise()
  894. .then((response) => {
  895. this.$message.success('暂存成功')
  896. this.$router.push({ path: 'warehouseManagementList' })
  897. })
  898. } else {
  899. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  900. return false
  901. }
  902. })
  903. })
  904. .catch(() => {
  905. return false
  906. })
  907. },
  908. //提交按钮
  909. submit() {
  910. if (!this.dataList.goodsName) {
  911. this.$message({
  912. message: '货名不能为空',
  913. type: 'warning',
  914. })
  915. return
  916. }
  917. if (!this.dataList.grossWeight) {
  918. this.$message({
  919. message: '毛重不能为空',
  920. type: 'warning',
  921. })
  922. return
  923. }
  924. if (
  925. this.dataList.grossWeight <= 0 ||
  926. this.dataList.grossWeight > 300000 ||
  927. (String(this.dataList.grossWeight).indexOf('.') != -1 &&
  928. String(this.dataList.grossWeight).length -
  929. (String(this.dataList.grossWeight).indexOf('.') + 1) >
  930. 3)
  931. ) {
  932. this.$message({
  933. message: '毛重输入错误',
  934. type: 'warning',
  935. })
  936. return
  937. }
  938. if (
  939. this.dataList.tare < 0 ||
  940. this.dataList.tare > 200000 ||
  941. (String(this.dataList.tare).indexOf('.') != -1 &&
  942. String(this.dataList.tare).length -
  943. (String(this.dataList.tare).indexOf('.') + 1) >
  944. 3)
  945. ) {
  946. this.$message({
  947. message: '皮重输入错误',
  948. type: 'warning',
  949. })
  950. return
  951. }
  952. if (
  953. this.dataList.deductionWeight < 0 ||
  954. this.dataList.deductionWeight > 10000 ||
  955. (String(this.dataList.deductionWeight).indexOf('.') != -1 &&
  956. String(this.dataList.deductionWeight).length -
  957. (String(this.dataList.deductionWeight).indexOf('.') + 1) >
  958. 3)
  959. ) {
  960. this.$message({
  961. message: '扣重输入错误',
  962. type: 'warning'
  963. })
  964. return
  965. }
  966. if (this.dataList.type=='潮粮'&&!this.dataList.buckleWeightRatio) {
  967. this.$message({
  968. message: '扣重比不能为空',
  969. type: 'warning'
  970. })
  971. return
  972. }
  973. if (
  974. this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio < 0 ||
  975. this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio > 3 ||
  976. (this.dataList.type=='潮粮'&&String(this.dataList.buckleWeightRatio).indexOf('.') != -1 &&
  977. String(this.dataList.buckleWeightRatio).length -
  978. (String(this.dataList.buckleWeightRatio).indexOf('.') + 1) >
  979. 2)
  980. ) {
  981. this.$message({
  982. message: '扣重比输入错误',
  983. type: 'warning'
  984. })
  985. return
  986. }
  987. if (this.dataList.type=='潮粮'&&!this.dataList.tidalGrainWater) {
  988. this.$message({
  989. message: '潮粮水分不能为空',
  990. type: 'warning'
  991. })
  992. return
  993. }
  994. if (
  995. this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater < 1 ||
  996. this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater > 40 ||
  997. (this.dataList.type=='潮粮'&&String(this.dataList.tidalGrainWater).indexOf('.') != -1 &&
  998. String(this.dataList.tidalGrainWater).length -
  999. (String(this.dataList.tidalGrainWater).indexOf('.') + 1) >
  1000. 2)
  1001. ) {
  1002. this.$message({
  1003. message: '潮粮水分输入错误',
  1004. type: 'warning'
  1005. })
  1006. return
  1007. }
  1008. if (this.dataList.type=='潮粮'&&!this.dataList.solidGrainWater) {
  1009. this.$message({
  1010. message: '干粮水分不能为空',
  1011. type: 'warning'
  1012. })
  1013. return
  1014. }
  1015. if (
  1016. this.dataList.type=='潮粮'&&this.dataList.solidGrainWater < 1 ||
  1017. this.dataList.type=='潮粮'&&this.dataList.solidGrainWater > 40 ||
  1018. (this.dataList.type=='潮粮'&&String(this.dataList.solidGrainWater).indexOf('.') != -1 &&
  1019. String(this.dataList.solidGrainWater).length -
  1020. (String(this.dataList.solidGrainWater).indexOf('.') + 1) >
  1021. 1)
  1022. ) {
  1023. this.$message({
  1024. message: '干粮水分输入错误',
  1025. type: 'warning'
  1026. })
  1027. return
  1028. }
  1029. if (
  1030. this.dataList.deductionAmount < 0 ||
  1031. this.dataList.deductionAmount > 10000 ||
  1032. (String(this.dataList.deductionAmount).indexOf('.') != -1 &&
  1033. String(this.dataList.deductionAmount).length -
  1034. (String(this.dataList.deductionAmount).indexOf('.') + 1) >
  1035. 2)
  1036. ) {
  1037. this.$message({
  1038. message: '扣款输入错误',
  1039. type: 'warning'
  1040. })
  1041. return
  1042. }
  1043. if (!this.dataList.cost) {
  1044. this.$message({
  1045. message: '未获取到成本,请编辑后提交',
  1046. type: 'warning'
  1047. })
  1048. return
  1049. }
  1050. if (
  1051. this.dataList.cost < 0 ||
  1052. this.dataList.cost > 20000 ||
  1053. (String(this.dataList.cost).indexOf('.') != -1 &&
  1054. String(this.dataList.cost).length -
  1055. (String(this.dataList.cost).indexOf('.') + 1) >
  1056. 2)
  1057. ) {
  1058. this.$message({
  1059. message: '成本输入错误',
  1060. type: 'warning'
  1061. })
  1062. return
  1063. }
  1064. if (!this.dataList.freight&&this.dataList.freight!=0) {
  1065. this.$message({
  1066. message: '运费不能为空',
  1067. type: 'warning'
  1068. })
  1069. return
  1070. }
  1071. if (
  1072. this.dataList.freight < 0 ||
  1073. this.dataList.freight > 100000 ||
  1074. (String(this.dataList.freight).indexOf('.') != -1 &&
  1075. String(this.dataList.freight).length -
  1076. (String(this.dataList.freight).indexOf('.') + 1) >
  1077. 2)
  1078. ) {
  1079. this.$message({
  1080. message: '运费输入错误',
  1081. type: 'warning'
  1082. })
  1083. return
  1084. }
  1085. if (!this.dataList.agent) {
  1086. this.$message({
  1087. message: '经办人不能为空',
  1088. type: 'warning',
  1089. })
  1090. return
  1091. }
  1092. if (this.dataList.agent.length < 2 || this.dataList.agent.length > 10) {
  1093. this.$message({
  1094. message: '经办人输入有误',
  1095. type: 'warning',
  1096. })
  1097. return
  1098. }
  1099. if (!this.dataList.grade) {
  1100. this.$message({
  1101. message: '品级不能为空!',
  1102. type: 'warning',
  1103. })
  1104. return
  1105. }
  1106. if (!this.dataList.inOutDate) {
  1107. this.$message({
  1108. message: '入库日期不能为空!',
  1109. type: 'warning',
  1110. })
  1111. return
  1112. }
  1113. if (!this.dataList.inOutType) {
  1114. this.$message({
  1115. message: '入库类型不能为空!',
  1116. type: 'warning',
  1117. })
  1118. return
  1119. }
  1120. if (!this.dataList.carNo) {
  1121. this.$message({
  1122. message: '车牌号不能为空',
  1123. type: 'warning',
  1124. })
  1125. return
  1126. }
  1127. if (this.dataList.carNo.length > 7) {
  1128. this.$message({
  1129. message: '车牌号输入错误,请输入7个字符之内',
  1130. type: 'warning',
  1131. })
  1132. return
  1133. }
  1134. if (!this.dataList.contractNo) {
  1135. this.$message({
  1136. message: '合同编号不能为空',
  1137. type: 'warning',
  1138. })
  1139. return
  1140. }
  1141. // if (
  1142. // this.dataList.contractNo.length < 6 ||
  1143. // this.dataList.contractNo.length > 20
  1144. // ) {
  1145. // this.$message({
  1146. // message: '合同编号长度不符合要求,请输入6-20个字符之内',
  1147. // type: 'warning',
  1148. // })
  1149. // return
  1150. // }
  1151. if (this.dataList.netWeight > this.$route.query.capacity) {
  1152. this.$message({
  1153. message: '入库量大于该仓库容量!',
  1154. type: 'warning',
  1155. })
  1156. return
  1157. }
  1158. //自检员
  1159. if (this.dataList.warehouseInOutDetail.qualityInspector) {
  1160. if (
  1161. this.dataList.warehouseInOutDetail.qualityInspector.length < 2 ||
  1162. this.dataList.warehouseInOutDetail.qualityInspector.length > 10
  1163. ) {
  1164. this.$message({
  1165. message: '质检员姓名长度错误!',
  1166. type: 'warning',
  1167. })
  1168. return
  1169. }
  1170. }
  1171. if (this.dataList.warehouseInOutDetail.waterContent) {
  1172. if (isNaN(this.dataList.warehouseInOutDetail.waterContent)) {
  1173. this.$message({
  1174. message: '水分(%)非数字!',
  1175. type: 'warning',
  1176. })
  1177. return
  1178. }
  1179. if (
  1180. this.dataList.warehouseInOutDetail.waterContent < 1 ||
  1181. this.dataList.warehouseInOutDetail.waterContent > 40 ||
  1182. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1183. '.'
  1184. ) != -1 &&
  1185. String(this.dataList.warehouseInOutDetail.waterContent).length -
  1186. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1187. '.'
  1188. ) +
  1189. 1) >
  1190. 2)
  1191. ) {
  1192. this.$message({
  1193. message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1194. type: 'warning',
  1195. })
  1196. return
  1197. }
  1198. }
  1199. //杂质
  1200. if (this.dataList.warehouseInOutDetail.impurity) {
  1201. if (isNaN(this.dataList.warehouseInOutDetail.impurity)) {
  1202. this.$message({
  1203. message: '杂质(%)非数字!',
  1204. type: 'warning',
  1205. })
  1206. return
  1207. }
  1208. if (
  1209. this.dataList.warehouseInOutDetail.impurity < 1 ||
  1210. this.dataList.warehouseInOutDetail.impurity > 40 ||
  1211. (String(this.dataList.warehouseInOutDetail.impurity).indexOf('.') !=
  1212. -1 &&
  1213. String(this.dataList.warehouseInOutDetail.impurity).length -
  1214. (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
  1215. '.'
  1216. ) +
  1217. 1) >
  1218. 2)
  1219. ) {
  1220. this.$message({
  1221. message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1222. type: 'warning',
  1223. })
  1224. return
  1225. }
  1226. }
  1227. //霉变
  1228. if (this.dataList.warehouseInOutDetail.mildewGrain) {
  1229. if (isNaN(this.dataList.warehouseInOutDetail.mildewGrain)) {
  1230. this.$message({
  1231. message: '霉变粒(%)非数字!',
  1232. type: 'warning',
  1233. })
  1234. return
  1235. }
  1236. if (
  1237. this.dataList.warehouseInOutDetail.mildewGrain < 1 ||
  1238. this.dataList.warehouseInOutDetail.mildewGrain > 40 ||
  1239. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1240. '.'
  1241. ) != -1 &&
  1242. String(this.dataList.warehouseInOutDetail.mildewGrain).length -
  1243. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1244. '.'
  1245. ) +
  1246. 1) >
  1247. 2)
  1248. ) {
  1249. this.$message({
  1250. message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1251. type: 'warning',
  1252. })
  1253. return
  1254. }
  1255. }
  1256. //热损伤
  1257. if (this.dataList.warehouseInOutDetail.jiaorenli) {
  1258. if (isNaN(this.dataList.warehouseInOutDetail.jiaorenli)) {
  1259. this.$message({
  1260. message: '热损伤(%)非数字!',
  1261. type: 'warning',
  1262. })
  1263. return
  1264. }
  1265. if (
  1266. this.dataList.warehouseInOutDetail.jiaorenli < 1 ||
  1267. this.dataList.warehouseInOutDetail.jiaorenli > 40 ||
  1268. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf('.') !=
  1269. -1 &&
  1270. String(this.dataList.warehouseInOutDetail.jiaorenli).length -
  1271. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
  1272. '.'
  1273. ) +
  1274. 1) >
  1275. 2)
  1276. ) {
  1277. this.$message({
  1278. message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1279. type: 'warning',
  1280. })
  1281. return
  1282. }
  1283. }
  1284. //不完善粒(%)
  1285. if (this.dataList.warehouseInOutDetail.imperfectGrain) {
  1286. if (isNaN(this.dataList.warehouseInOutDetail.imperfectGrain)) {
  1287. this.$message({
  1288. message: '不完善粒(%)非数字!',
  1289. type: 'warning',
  1290. })
  1291. return
  1292. }
  1293. if (
  1294. this.dataList.warehouseInOutDetail.imperfectGrain < 1 ||
  1295. this.dataList.warehouseInOutDetail.imperfectGrain > 40 ||
  1296. (String(this.dataList.warehouseInOutDetail.imperfectGrain).indexOf(
  1297. '.'
  1298. ) != -1 &&
  1299. String(this.dataList.warehouseInOutDetail.imperfectGrain).length -
  1300. (String(
  1301. this.dataList.warehouseInOutDetail.imperfectGrain
  1302. ).indexOf('.') +
  1303. 1) >
  1304. 2)
  1305. ) {
  1306. this.$message({
  1307. message: '不完善粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1308. type: 'warning',
  1309. })
  1310. return
  1311. }
  1312. }
  1313. //容重
  1314. if (this.dataList.warehouseInOutDetail.bulkDensity) {
  1315. if (isNaN(this.dataList.warehouseInOutDetail.bulkDensity)) {
  1316. this.$message({
  1317. message: '容重(克/升)非数字!',
  1318. type: 'warning',
  1319. })
  1320. return
  1321. }
  1322. if (
  1323. this.dataList.warehouseInOutDetail.bulkDensity > 1000 ||
  1324. this.dataList.warehouseInOutDetail.bulkDensity < 0||
  1325. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1326. '.'
  1327. ) != -1 &&
  1328. String(this.dataList.warehouseInOutDetail.bulkDensity).length -
  1329. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1330. '.'
  1331. ) +
  1332. 1) >
  1333. 0)
  1334. ) {
  1335. this.$message({
  1336. message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
  1337. type: 'warning',
  1338. })
  1339. return
  1340. }
  1341. }
  1342. this.$confirm(`确定提交皮重检斤`, {
  1343. cancelButtonText: '取消',
  1344. confirmButtonText: '确定',
  1345. type: 'warning',
  1346. })
  1347. .then(() => {
  1348. this.$refs.dataList.validate((valid) => {
  1349. if (valid) {
  1350. this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
  1351. this.dataList.inOutFlag = 2
  1352. this.dataList.statusFlag = 3
  1353. this.dataList.grossWeight /= 1000
  1354. this.dataList.tare /= 1000
  1355. this.dataList.netWeight /= 1000
  1356. this.dataList.pureWeight /= 1000
  1357. if(!this.dataList.deductionWeight){
  1358. this.dataList.deductionWeight = 0
  1359. }
  1360. if(!this.dataList.deductionAmount){
  1361. this.dataList.deductionAmount = 0
  1362. }
  1363. this.dataList.deductionWeight /= 1000
  1364. this.dataList.deductionAmount *= 1000
  1365. addstorageputList(this.dataList)
  1366. .toPromise()
  1367. .then((response) => {
  1368. this.$message.success('提交成功')
  1369. this.$confirm(`是否打印磅单`, {
  1370. cancelButtonText: '取消',
  1371. confirmButtonText: '确定',
  1372. type: 'warning',
  1373. })
  1374. .then(() => {
  1375. getPrintInfo({
  1376. id: this.dataList.id
  1377. })
  1378. .toPromise()
  1379. .then((response) => {
  1380. window.open( '../../../../static/weightCheckInOut.html?type=2&tableData=' +JSON.stringify(response))
  1381. })
  1382. this.$router.push({ path: 'warehouseManagementList' })
  1383. })
  1384. .catch(() => {
  1385. return false
  1386. })
  1387. })
  1388. } else {
  1389. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1390. return false
  1391. }
  1392. })
  1393. })
  1394. .catch(() => {
  1395. return false
  1396. })
  1397. },
  1398. //暂存按钮
  1399. returnWarehouse() {
  1400. this.$refs.dataList.validate((valid) => {
  1401. if (valid) {
  1402. this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
  1403. this.dataList.statusFlag = 1
  1404. addstorageputList(this.dataList)
  1405. .toPromise()
  1406. .then((response) => {
  1407. this.$message.success('添加成功')
  1408. this.$router.push({ path: 'warehouseManagementList' })
  1409. })
  1410. } else {
  1411. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1412. return false
  1413. }
  1414. })
  1415. },
  1416. tarechange(e) {
  1417. if (this.dataList.grossWeight && this.dataList.tare) {
  1418. this.dataList.netWeight = Number(
  1419. this.dataList.grossWeight - this.dataList.tare
  1420. )
  1421. }
  1422. },
  1423. grossWeightchange(e) {
  1424. if (this.dataList.grossWeight && this.dataList.tare) {
  1425. this.dataList.netWeight = Number(
  1426. this.dataList.grossWeight - this.dataList.tare
  1427. )
  1428. }
  1429. },
  1430. selectgoodsName(e) {
  1431. for (var i = 0; i < this.goodnameList.length; i++) {
  1432. if (this.goodnameList[i].constValue == e) {
  1433. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  1434. }
  1435. }
  1436. },
  1437. selectpackingMethod(e) {
  1438. for (var i = 0; i < this.packtypeList.length; i++) {
  1439. if (this.packtypeList[i].constValue == e) {
  1440. this.dataList.packingMethodKey = this.packtypeList[i].constKey
  1441. }
  1442. }
  1443. },
  1444. selectstorageType(e) {
  1445. for (var i = 0; i < this.storageType.length; i++) {
  1446. if (this.storageType[i].constValue == e) {
  1447. this.dataList.inOutTypeKey = this.storageType[i].constKey
  1448. }
  1449. }
  1450. },
  1451. handleClose() {
  1452. this.accessoryTFs = false
  1453. },
  1454. handleSizeChange(val) {
  1455. console.log(`每页 ${val} 条`)
  1456. this.pageSize = val
  1457. this.getList()
  1458. },
  1459. handleCurrentChange(val) {
  1460. this.currentPage = val
  1461. console.log(`当前页: ${val}`)
  1462. this.getList()
  1463. },
  1464. getList() {
  1465. // 货名
  1466. pullDown({ constId: 'CON2' })
  1467. .toPromise()
  1468. .then((response) => {
  1469. this.goodnameList = response
  1470. })
  1471. // 品级
  1472. pullDown({ constId: 'CON3' })
  1473. .toPromise()
  1474. .then((response) => {
  1475. this.gradeList = response
  1476. })
  1477. // 类型
  1478. if (this.$route.query.warehouseType == '1') {
  1479. this.storageType = []
  1480. pullDown({ constId: 'CON5' })
  1481. .toPromise()
  1482. .then((response) => {
  1483. // this.storageType = response
  1484. for(let i = 0;i<response.length;i++){
  1485. if(response[i].constValue=='移库入库'||response[i].constValue=='退库'){
  1486. this.storageType.push(response[i])
  1487. }
  1488. }
  1489. })
  1490. } else if (this.$route.query.warehouseType == '2') {
  1491. //临时仓库入库类型
  1492. pullDown({ constId: 'WARE1' })
  1493. .toPromise()
  1494. .then((response) => {
  1495. this.storageType = response
  1496. })
  1497. //临时仓库出库类型
  1498. pullDown({ constId: 'WARE2' })
  1499. .toPromise()
  1500. .then((response) => {
  1501. this.deliveryType = response
  1502. })
  1503. }
  1504. //合同编号
  1505. xialaNo({ compId: sessionStorage.getItem('ws-pf_compId'), flag: 6 })
  1506. .toPromise()
  1507. .then((response) => {
  1508. this.options1 = response
  1509. this.outContractNo = response
  1510. })
  1511. //合同编号2
  1512. xialaNo({ compId: sessionStorage.getItem('ws-pf_compId'), flag: 7 })
  1513. .toPromise()
  1514. .then((response) => {
  1515. this.outContractNo1 = response
  1516. })
  1517. //经办人
  1518. getstaff({ compId: sessionStorage.getItem('ws-pf_compId'),warehouseId:this.dataList.id })
  1519. .toPromise()
  1520. .then((response) => {
  1521. this.options = response
  1522. this.qualityInspectorList = response
  1523. this.staffList = response
  1524. // this.agent = response
  1525. })
  1526. },
  1527. selecttaskType(e) {
  1528. for (var i = 0; i < this.taskTypeList.length; i++) {
  1529. if (this.taskTypeList[i].value == e) {
  1530. this.searchType = this.taskTypeList[i].type
  1531. }
  1532. }
  1533. },
  1534. fujian(row) {
  1535. if (
  1536. row.receiveAttachmentPath === null ||
  1537. row.receiveAttachmentPath === ''
  1538. ) {
  1539. EventBus.$emit(
  1540. 'warning',
  1541. this.$t('system.noticeCircular.NoInformation')
  1542. )
  1543. } else {
  1544. this.accessoryTFs = true
  1545. }
  1546. this.appendixIdss = row.receiveAttachmentPath
  1547. },
  1548. handleExamine(row) {
  1549. this.$router.push({
  1550. name: 'salesContractExamine',
  1551. query: { id: row.id },
  1552. })
  1553. },
  1554. // 关闭 dialog时 处理文件url 初始化upload组件
  1555. handleCloe() {
  1556. this.dialogViewSpareMoney = false
  1557. },
  1558. history(row) {
  1559. console.log(row)
  1560. billoperatehis({ id: row.id })
  1561. .toPromise()
  1562. .then((response) => {
  1563. this.historyList = response
  1564. })
  1565. },
  1566. async exportlist() {
  1567. const { data } = await export1(
  1568. {
  1569. compId: sessionStorage.getItem('ws-pf_compId'),
  1570. contractType: this.contractType,
  1571. currentPage: this.currentPage,
  1572. pageSize: this.pageSize,
  1573. searchType: this.searchType,
  1574. searchKeyWord: this.searchKeyWord,
  1575. startDate: this.startDate,
  1576. endDate: this.endDate,
  1577. },
  1578. {},
  1579. { responseType: 'blob' }
  1580. ).toPromise()
  1581. downloadFile({
  1582. res: data,
  1583. fileName: `${
  1584. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  1585. }_采购合同`,
  1586. type: 'xls',
  1587. })
  1588. },
  1589. // deletecontract(){},
  1590. //删除
  1591. approve() {},
  1592. listQuery() {},
  1593. total() {},
  1594. clearfiltQuery() {},
  1595. selectCrtDuty() {},
  1596. },
  1597. }
  1598. </script>
  1599. <style lang="scss" scoped>
  1600. /deep/.basicInformation {
  1601. .ws-info-table {
  1602. border: none;
  1603. }
  1604. .el-form-item {
  1605. width: 33.3333%;
  1606. border: none;
  1607. .el-form-item__label {
  1608. background: transparent;
  1609. border: none;
  1610. }
  1611. .el-form-item__content {
  1612. border: none;
  1613. }
  1614. }
  1615. }
  1616. .title {
  1617. position: relative;
  1618. padding-left: 10px;
  1619. }
  1620. .title::before {
  1621. content: '';
  1622. display: inline-block;
  1623. width: 5px;
  1624. height: 30px;
  1625. background: #5473e8;
  1626. position: absolute;
  1627. left: 0;
  1628. }
  1629. .el-form {
  1630. padding: 0 10%;
  1631. }
  1632. .el-button--primary {
  1633. background-color: #5878e8;
  1634. border-color: #5878e8;
  1635. }
  1636. .el-col {
  1637. background: #f6f7fc;
  1638. }
  1639. .bg-right {
  1640. text-align: right;
  1641. padding: 16px 20px;
  1642. }
  1643. .center {
  1644. position: relative;
  1645. top: 50px;
  1646. width: 40%;
  1647. height: 2000px;
  1648. margin: 0 auto;
  1649. }
  1650. /deep/.el-form-item__label {
  1651. width: 160px;
  1652. }
  1653. .inspector {
  1654. width: 50%;
  1655. }
  1656. //质检员
  1657. /deep/[data-v-58803672] .el-form-item__label {
  1658. width: 60px;
  1659. }
  1660. [data-v-58803672] .el-form-item__label {
  1661. width: 60px;
  1662. }
  1663. //选填
  1664. /deep/.el-form-item {
  1665. width: 50%;
  1666. }
  1667. .container {
  1668. overflow: scroll;
  1669. height: 120vh;
  1670. }
  1671. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1672. text-align: center;
  1673. }
  1674. .deliverydate {
  1675. display: inline-block;
  1676. width: 10%;
  1677. }
  1678. .center {
  1679. margin-top: -60px;
  1680. width: 80%;
  1681. }
  1682. //仓位
  1683. .position {
  1684. width: 52px;
  1685. height: 20px;
  1686. background: #afb5cb;
  1687. border-radius: 2px;
  1688. font-size: 12px;
  1689. font-family: PingFangSC-Medium, PingFang SC;
  1690. color: #ffffff;
  1691. line-height: 20px;
  1692. }
  1693. //表格文字
  1694. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1695. text-align: left;
  1696. font-size: 14px;
  1697. font-family: PingFangSC-Regular, PingFang SC;
  1698. font-weight: 400;
  1699. color: #8890b1;
  1700. line-height: 16px;
  1701. }
  1702. //质检员
  1703. .inspector .el-form-item__content {
  1704. text-align: left;
  1705. margin-left: 0px;
  1706. }
  1707. .small-title {
  1708. position: relative;
  1709. padding: 10px;
  1710. font-weight: 600;
  1711. }
  1712. .small-title::before {
  1713. position: absolute;
  1714. content: '';
  1715. display: block;
  1716. background: #5473e8;
  1717. width: 4px;
  1718. height: 14px;
  1719. left: 0px;
  1720. top: 13px;
  1721. }
  1722. //下面列表
  1723. .neifor {
  1724. width: 80%;
  1725. background-color: #f6f7fc;
  1726. }
  1727. /deep/.neifor .ws-info-table .el-form-item .el-form-item__label {
  1728. width: 35%;
  1729. text-align: center;
  1730. }
  1731. /deep/.neifor .ws-info-table .el-form-item .el-form-item__content {
  1732. width: 60%;
  1733. background-color: #f6f7fc;
  1734. }
  1735. /deep/.neifor .el-input--small .el-input__inner {
  1736. width: 100%;
  1737. }
  1738. .el-input__inner {
  1739. width: 150px;
  1740. }
  1741. </style>