warehouseManagementNoWeightIn.vue 52 KB

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