warehouseManagementTare.vue 70 KB

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