warehouseManagementNoWeightIn.vue 53 KB

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