warehouseManagementNoWeightOut.vue 53 KB

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