warehouseManagementNoWeightOut.vue 58 KB

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