warehouseManagementNoWeightOut.vue 54 KB

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