warehouseManagementTare.vue 55 KB

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