warehouseManagementGross.vue 74 KB

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