warehouseManagementGross.vue 97 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031
  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. <div class="balance-row">
  42. <BalanceAlert
  43. class="left"
  44. ref="weightChild"
  45. :deptBudgetList="deptBudgetList"
  46. :information="information"
  47. v-on:balanceListen="setVal"
  48. ></BalanceAlert>
  49. <div class="top">
  50. <div class="confirmInfo">
  51. <div class="confirmWeight">确定重量</div>
  52. <div class="weight">
  53. {{ grossWeight }} <span class="kg-style">kg</span>
  54. </div>
  55. </div>
  56. <!-- <div v-else class="weight">{{weighingList.tare}} <span class="kg-style">kg</span></div> -->
  57. <div class="confirmInfo">
  58. <div class="confirmCarNo">车牌号</div>
  59. <div class="car-no">{{ deptBudgetList.carNo }}</div>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="flex">
  64. <div class="left" style="width: 66.6666%">
  65. <ws-info-table>
  66. <!--任务编号-->
  67. <ws-form-item label="任务编号" span="1" prop="inOutTaskNo">
  68. <el-select
  69. filterable
  70. clearable
  71. v-model="deptBudgetList.inOutTaskNo"
  72. placeholder="请选择任务编号"
  73. class="typeselect"
  74. @change="contractNoChange"
  75. >
  76. <el-option
  77. v-for="item in deptBudgetList1"
  78. :key="item.inOutTaskNo"
  79. :label="item.inOutTaskNo"
  80. :value="item.inOutTaskNo"
  81. />
  82. </el-select>
  83. </ws-form-item>
  84. <!--毛重(公斤)-->
  85. <ws-form-item label="毛重(公斤)" span="1" prop="grossWeight">
  86. <ws-input
  87. :disabled="allowEdit"
  88. @input="grossWeightchange"
  89. v-model="deptBudgetList.grossWeight"
  90. placeholder="请输入毛重"
  91. maxlength="20"
  92. type="number"
  93. @mousewheel.native.prevent
  94. size="small"
  95. />
  96. <el-button
  97. type="primary"
  98. v-if="information == '毛重检斤'"
  99. @click="openPort"
  100. >重新获取</el-button
  101. >
  102. </ws-form-item>
  103. <!--合同编号-->
  104. <ws-form-item label="合同编号" span="1" prop="contractNo">
  105. <el-select
  106. disabled
  107. filterable
  108. clearable
  109. v-model="deptBudgetList.contractNo"
  110. class="typeselect"
  111. @change="contractNoChange1"
  112. >
  113. <el-option
  114. v-for="item in options1"
  115. :key="item.constKey"
  116. :label="item.contractNo"
  117. :value="item.contractNo"
  118. />
  119. </el-select>
  120. </ws-form-item>
  121. <!--皮重(公斤)-->
  122. <ws-form-item
  123. label="皮重(公斤)"
  124. span="1"
  125. prop="tare"
  126. class="readonly"
  127. >
  128. <ws-input
  129. :disabled="allowEdit"
  130. @input="tarechange"
  131. v-model="deptBudgetList.tare"
  132. placeholder="请输入皮重"
  133. type="number"
  134. @mousewheel.native.prevent
  135. maxlength="100"
  136. size="small"
  137. />
  138. <el-button
  139. type="primary"
  140. v-if="information == '皮重检斤'"
  141. @click="openPort"
  142. >重新获取</el-button
  143. >
  144. </ws-form-item>
  145. <ws-form-item label="提示" span="1" prop="tips">
  146. <ws-input
  147. onmouseover="this.title=this.value"
  148. v-model="deptBudgetList.tips"
  149. maxlength="20"
  150. size="small"
  151. />
  152. </ws-form-item>
  153. <ws-form-item
  154. label="扣重(公斤)"
  155. span="1"
  156. prop="deductionWeight"
  157. class="readonly"
  158. >
  159. <ws-input
  160. @input="tarechange"
  161. v-model="deptBudgetList.deductionWeight"
  162. placeholder="请输入扣重"
  163. type="number"
  164. @mousewheel.native.prevent
  165. maxlength="100"
  166. size="small"
  167. />
  168. </ws-form-item>
  169. <!-- 货名 -->
  170. <ws-form-item label="货名" span="1">
  171. <ws-select
  172. disabled
  173. v-model="deptBudgetList.goodsName"
  174. placeholder
  175. class="typeselect"
  176. @change="selectgoodsName"
  177. >
  178. <ws-option
  179. v-for="item in goodnameList"
  180. :key="item.constKey"
  181. :label="item.constValue"
  182. :value="item.constValue"
  183. />
  184. </ws-select>
  185. </ws-form-item>
  186. <!--净重(公斤)-->
  187. <ws-form-item label="净重(公斤)" span="1" prop="netWeight">
  188. <ws-input
  189. disabled
  190. v-model="deptBudgetList.netWeight"
  191. placeholder="不可编辑,自动计算"
  192. maxlength="120"
  193. size="small"
  194. />
  195. </ws-form-item>
  196. <ws-form-item label="类型" span="1" prop="type">
  197. <ws-select
  198. disabled
  199. v-model="deptBudgetList.type"
  200. @change="typeChange"
  201. >
  202. <ws-option
  203. v-for="item in typeList"
  204. :key="item"
  205. :label="item"
  206. :value="item"
  207. />
  208. </ws-select>
  209. </ws-form-item>
  210. <ws-form-item
  211. label="扣款(元/公斤)"
  212. span="1"
  213. prop="deductionAmount"
  214. >
  215. <ws-input
  216. @input="kkInput(deptBudgetList.deductionAmount)"
  217. v-model="deptBudgetList.deductionAmount"
  218. placeholder="请输入扣款金额"
  219. maxlength="120"
  220. size="small"
  221. />
  222. </ws-form-item>
  223. <!-- <ws-form-item
  224. v-if="deptBudgetList.type == '潮粮'"
  225. label="扣重比"
  226. span="1"
  227. prop="buckleWeightRatio"
  228. class="readonly"
  229. >
  230. <ws-input
  231. @input="pureweight"
  232. v-model="deptBudgetList.buckleWeightRatio"
  233. placeholder="请输入扣重比"
  234. type="number"
  235. @mousewheel.native.prevent
  236. maxlength="100"
  237. size="small"
  238. />
  239. </ws-form-item>
  240. <ws-form-item
  241. v-if="deptBudgetList.type == '潮粮'"
  242. label="干粮水分占比"
  243. span="1"
  244. prop="solidGrainWater"
  245. class="readonly"
  246. >
  247. <ws-input
  248. @input="pureweight"
  249. v-model="deptBudgetList.solidGrainWater"
  250. placeholder="请输入干粮水分占比"
  251. maxlength="100"
  252. type="number"
  253. @mousewheel.native.prevent
  254. size="small"
  255. />
  256. </ws-form-item>
  257. <ws-form-item
  258. v-if="deptBudgetList.type == '潮粮'"
  259. label="潮粮水分占比"
  260. span="1"
  261. prop="tidalGrainWater"
  262. class="readonly"
  263. >
  264. <ws-input
  265. @input="pureweight(1)"
  266. v-model="deptBudgetList.tidalGrainWater"
  267. placeholder="请输入潮粮水分占比"
  268. maxlength="100"
  269. type="number"
  270. @mousewheel.native.prevent
  271. size="small"
  272. />
  273. </ws-form-item>
  274. <ws-form-item
  275. v-if="deptBudgetList.type == '潮粮'"
  276. label="纯重"
  277. span="1"
  278. prop="pureWeight"
  279. class="readonly"
  280. >
  281. <ws-input
  282. disabled
  283. v-model="deptBudgetList.pureWeight"
  284. placeholder="不可编辑,自动计算"
  285. maxlength="100"
  286. size="small"
  287. />
  288. </ws-form-item>
  289. -->
  290. <!-- 品级 -->
  291. <ws-form-item label="品级" span="1" class="readonly">
  292. <ws-select
  293. v-model="deptBudgetList.grade"
  294. placeholder
  295. class="typeselect"
  296. @change="selectpackingMethod"
  297. >
  298. <ws-option
  299. v-for="item in gradeList"
  300. :key="item.constKey"
  301. :label="item.constValue"
  302. :value="item.constValue"
  303. />
  304. </ws-select>
  305. </ws-form-item>
  306. <ws-form-item
  307. label="入库日期"
  308. span="1"
  309. prop="inOutDate"
  310. class="deliverydate"
  311. >
  312. <el-date-picker
  313. v-model="deptBudgetList.inOutDate"
  314. placeholder="请选择入库日期"
  315. type="date"
  316. value-format="yyyy-MM-dd"
  317. ></el-date-picker>
  318. </ws-form-item>
  319. <!--经办人-->
  320. <ws-form-item label="经办人" span="1" prop="agent">
  321. <el-select
  322. v-model="deptBudgetList.agent"
  323. placeholder="请选择经办人"
  324. filterable
  325. clearable
  326. @change="selectstaff"
  327. >
  328. <el-option
  329. v-for="item in options"
  330. :key="item.value"
  331. :label="item.staffName"
  332. :value="item.staffName"
  333. />
  334. </el-select>
  335. </ws-form-item>
  336. <!-- 经办人(可多选) -->
  337. <!-- <ws-form-item label="经办人" span="1" prop="agent">
  338. <el-select
  339. v-model="deptBudgetList.agent"
  340. multiple
  341. filterable
  342. allow-create
  343. default-first-option
  344. placeholder="请选择经办人"
  345. @change="selectstaff"
  346. >
  347. <el-option
  348. v-for="item in options"
  349. :key="item.value"
  350. :label="item.staffName"
  351. :value="item.staffName"
  352. >
  353. </el-option>
  354. </el-select>
  355. </ws-form-item> -->
  356. <!-- 入库类型 -->
  357. <ws-form-item label="入库类型" span="1">
  358. <ws-select
  359. v-model="deptBudgetList.inOutType"
  360. placeholder
  361. class="typeselect"
  362. @change="selectstorageType"
  363. :disabled="isSelectType"
  364. >
  365. <ws-option
  366. v-for="item in storageType"
  367. :key="item.constKey"
  368. :label="item.constValue"
  369. :value="item.constValue"
  370. />
  371. </ws-select>
  372. </ws-form-item>
  373. <!-- onkeyup="value=value.replace(/[^\A-\Z0-9\u4E00-\u9FA5\.]/g,'')" -->
  374. </ws-info-table>
  375. </div>
  376. <div class="right" style="width: 33.3333%">
  377. <ws-info-table>
  378. <ws-form-item label="成本(元/吨)" span="1" prop="cost">
  379. <ws-input
  380. :disabled="disabled1"
  381. v-model="deptBudgetList.cost"
  382. placeholder="请输入成本"
  383. size="small"
  384. type="number"
  385. @mousewheel.native.prevent
  386. />
  387. <img
  388. width="17"
  389. height="18"
  390. style="
  391. vertical-align: text-top;
  392. position: relative;
  393. top: -1px;
  394. "
  395. src="../../../public/img/edit.png"
  396. @click="editClick(1)"
  397. alt=""
  398. />
  399. </ws-form-item>
  400. <ws-form-item label="运费(元/吨)" span="1" prop="freight">
  401. <ws-input
  402. :disabled="disabled2"
  403. v-model="deptBudgetList.freight"
  404. placeholder="请输入运费"
  405. size="small"
  406. type="number"
  407. @mousewheel.native.prevent
  408. />
  409. <img
  410. width="17"
  411. height="18"
  412. style="
  413. vertical-align: text-top;
  414. position: relative;
  415. top: -1px;
  416. "
  417. src="../../../public/img/edit.png"
  418. @click="editClick(2)"
  419. alt=""
  420. />
  421. </ws-form-item>
  422. <!--入库方式-->
  423. <ws-form-item label="运输方式" span="1" prop="outType">
  424. <el-select
  425. v-model="deptBudgetList.outType"
  426. placeholder="请选择运输方式"
  427. >
  428. <el-option
  429. v-for="item in multiSelector"
  430. :key="item.value"
  431. :label="item.name"
  432. :value="item.name"
  433. />
  434. </el-select>
  435. </ws-form-item>
  436. <!--车牌号 -->
  437. <ws-form-item
  438. label="车牌号"
  439. span="1"
  440. prop="carNo"
  441. v-if="
  442. deptBudgetList.outType == '汽运' ||
  443. deptBudgetList.outType == '集装箱船'
  444. "
  445. >
  446. <ws-input
  447. v-if="options2.length == 0"
  448. v-model="deptBudgetList.carNo"
  449. placeholder="请输入车牌号"
  450. maxlength="7"
  451. size="small"
  452. />
  453. <el-select
  454. v-if="carstatus && options2.length > 0"
  455. filterable
  456. clearable
  457. :filter-method="dataFilter2"
  458. v-model="deptBudgetList.carNo"
  459. placeholder="请选择车牌号"
  460. class="typeselect"
  461. @change="carChange"
  462. >
  463. <el-option
  464. v-for="item in options2"
  465. :key="item.constKey"
  466. :label="item.carNo + '(' + item.tranCarNo + ')'"
  467. :value="item.carNo"
  468. />
  469. </el-select>
  470. <el-select
  471. v-if="!carstatus && options2.length > 0"
  472. filterable
  473. clearable
  474. :filter-method="dataFilter2"
  475. v-model="deptBudgetList.carNo"
  476. placeholder="请选择车牌号"
  477. class="typeselect"
  478. @change="carChange"
  479. >
  480. <el-option
  481. v-for="item in options2"
  482. :key="item.constKey"
  483. :label="item.carNo"
  484. :value="item.carNo"
  485. />
  486. </el-select>
  487. <span style="padding-left: 10px"
  488. >发货重量(吨):{{ deptBudgetList.loadNetWeight }}</span
  489. >
  490. </ws-form-item>
  491. <!--船名 -->
  492. <ws-form-item
  493. label="船名"
  494. span="1"
  495. prop="carNo"
  496. v-if="deptBudgetList.outType == '散船'"
  497. >
  498. <ws-input
  499. v-model="deptBudgetList.carNo"
  500. placeholder="请输入船名"
  501. size="small"
  502. />
  503. </ws-form-item>
  504. <ws-form-item
  505. label="航次"
  506. span="1"
  507. prop="shipNumber"
  508. v-if="deptBudgetList.outType == '散船'"
  509. >
  510. <ws-input
  511. v-model="deptBudgetList.shipNumber"
  512. placeholder="请输入航次"
  513. maxlength="20"
  514. size="small"
  515. />
  516. </ws-form-item>
  517. <!--车号 -->
  518. <ws-form-item
  519. label="车号"
  520. span="1"
  521. prop="carNo"
  522. v-if="deptBudgetList.outType == '火运'"
  523. >
  524. <ws-input
  525. v-model="deptBudgetList.carNo"
  526. placeholder="请输入车号"
  527. size="small"
  528. />
  529. </ws-form-item>
  530. <ws-form-item
  531. label="箱号-1"
  532. span="1"
  533. prop="boxNo"
  534. v-if="
  535. deptBudgetList.outType == '汽运' ||
  536. deptBudgetList.outType == '集装箱船'
  537. "
  538. >
  539. <ws-input
  540. v-model="deptBudgetList.boxNo"
  541. placeholder="请输入箱号"
  542. maxlength="20"
  543. size="small"
  544. />
  545. </ws-form-item>
  546. <ws-form-item
  547. label="箱号-2"
  548. span="1"
  549. prop="boxNoOther"
  550. v-if="
  551. deptBudgetList.outType == '汽运' ||
  552. deptBudgetList.outType == '集装箱船'
  553. "
  554. >
  555. <ws-input
  556. v-model="deptBudgetList.boxNoOther"
  557. placeholder="请输入箱号"
  558. maxlength="20"
  559. size="small"
  560. />
  561. </ws-form-item>
  562. <ws-form-item
  563. label="封号-1"
  564. span="1"
  565. prop="titleNo"
  566. v-if="
  567. deptBudgetList.outType == '汽运' ||
  568. deptBudgetList.outType == '集装箱船'
  569. "
  570. >
  571. <ws-input
  572. v-model="deptBudgetList.titleNo"
  573. placeholder="请输入封号"
  574. maxlength="20"
  575. size="small"
  576. />
  577. </ws-form-item>
  578. <ws-form-item
  579. label="封号-2"
  580. span="1"
  581. prop="titleNoOther"
  582. v-if="
  583. deptBudgetList.outType == '汽运' ||
  584. deptBudgetList.outType == '集装箱船'
  585. "
  586. >
  587. <ws-input
  588. v-model="deptBudgetList.titleNoOther"
  589. placeholder="请输入封号"
  590. maxlength="20"
  591. size="small"
  592. />
  593. </ws-form-item>
  594. <ws-form-item
  595. label="车厢号-1"
  596. span="1"
  597. prop="wingNumber"
  598. v-if="deptBudgetList.outType == '火运'"
  599. >
  600. <ws-input
  601. v-model="deptBudgetList.wingNumber"
  602. placeholder="请输入车厢号"
  603. maxlength="20"
  604. size="small"
  605. />
  606. </ws-form-item>
  607. <ws-form-item
  608. label="车厢号-2"
  609. span="1"
  610. prop="wingNumberOther"
  611. v-if="deptBudgetList.outType == '火运'"
  612. >
  613. <ws-input
  614. v-model="deptBudgetList.wingNumberOther"
  615. placeholder="请输入车厢号"
  616. maxlength="20"
  617. size="small"
  618. />
  619. </ws-form-item>
  620. <!-- onkeyup="value=value.replace(/[^\A-\Z0-9\u4E00-\u9FA5\.]/g,'')" -->
  621. </ws-info-table>
  622. </div>
  623. </div>
  624. <div
  625. v-show="
  626. this.$route.query.warehouseType == 2 &&
  627. this.deptBudgetList.createType == 2
  628. "
  629. >
  630. <el-checkbox v-model="checked" checked>退库并出库</el-checkbox>
  631. <ws-info-table
  632. v-show="checked == true && this.deptBudgetList.createType == 2"
  633. >
  634. <!-- 出库类型 -->
  635. <ws-form-item label="出库类型" span="1" prop="temporaryOutType">
  636. <!-- v-model="deptBudgetList.deliveryType" -->
  637. <ws-select
  638. v-model="deptBudgetList.temporaryOutType"
  639. placeholder
  640. class="typeselect"
  641. >
  642. <ws-option
  643. v-for="item in deliveryType"
  644. :key="item.constKey"
  645. :label="item.constValue"
  646. :value="item.constValue"
  647. />
  648. </ws-select>
  649. </ws-form-item>
  650. <!-- 出库合同编号 -->
  651. <ws-form-item label="出库合同编号" span="1">
  652. <ws-select
  653. v-model="deptBudgetList.outContractNo"
  654. placeholder="请选择合同编号或移库任务编号"
  655. class="typeselect"
  656. >
  657. <ws-option
  658. v-for="item in outContractNo"
  659. :key="item.constKey"
  660. :label="item.contractNo"
  661. :value="item.contractNo"
  662. />
  663. </ws-select>
  664. </ws-form-item>
  665. </ws-info-table>
  666. </div>
  667. </div>
  668. <!-- <div class="small-title">上传磅单照片</div>
  669. <el-upload
  670. action="https://www.zthymaoyi.com/upload/admin"
  671. :show-file-list="false"
  672. :on-success="
  673. (res) => {
  674. uploadSuccessHandle1(res)
  675. }
  676. "
  677. class="avatar-uploader"
  678. accept=".jpg, .jpeg, .png, .gif"
  679. >
  680. <el-button size="small" type="primary">点击上传</el-button>
  681. </el-upload> -->
  682. <div v-if="deptBudgetList.addressUrl != ''">
  683. <img
  684. style="width: 100px; height: 100px"
  685. :src="deptBudgetList.addressUrl"
  686. alt=""
  687. />
  688. </div>
  689. <div class="small-title">化验数据(选填)</div>
  690. <div class="inspector">
  691. <!--自检员-->
  692. <!-- <ws-form-item label="质检员" span="1" prop="qualityInspector">
  693. <ws-input
  694. v-model="deptBudgetList.warehouseInOutDetail.qualityInspector"
  695. placeholder="请输入质检员姓名"
  696. maxlength="10"
  697. size="small"
  698. />
  699. </ws-form-item> -->
  700. <ws-form-item label="质检员" span="1" prop="qualityInspector">
  701. <el-select
  702. v-model="deptBudgetList.warehouseInOutDetail.qualityInspector"
  703. placeholder="请选择质检员"
  704. filterable
  705. clearable
  706. @change="qualityInspectorChange"
  707. >
  708. <el-option
  709. v-for="item in qualityInspectorList"
  710. :key="item.value"
  711. :label="item.staffName"
  712. :value="item.staffName"
  713. />
  714. </el-select>
  715. </ws-form-item>
  716. </div>
  717. <div class="neifor">
  718. <ws-info-table>
  719. <!--水分(%)<=-->
  720. <ws-form-item label="水分(%)" span="1" prop="waterContent">
  721. <ws-input
  722. v-model="deptBudgetList.warehouseInOutDetail.waterContent"
  723. type="number"
  724. @mousewheel.native.prevent
  725. placeholder="请输入水分占比"
  726. maxlength="40"
  727. size="small"
  728. />
  729. </ws-form-item>
  730. <!--杂质(%)<=-->
  731. <ws-form-item label="杂质(%)" span="1" prop="impurity">
  732. <ws-input
  733. v-model="deptBudgetList.warehouseInOutDetail.impurity"
  734. type="number"
  735. @mousewheel.native.prevent
  736. placeholder="请输入杂质占比"
  737. maxlength="40"
  738. size="small"
  739. />
  740. </ws-form-item>
  741. <!--容重(克/升)-->
  742. <ws-form-item label="容重(克/升)" span="1" prop="bulkDensity">
  743. <ws-input
  744. v-model="deptBudgetList.warehouseInOutDetail.bulkDensity"
  745. type="number"
  746. @mousewheel.native.prevent
  747. placeholder="请输入容重"
  748. maxlength="40"
  749. size="small"
  750. />
  751. </ws-form-item>
  752. <!--霉变粒(%)<=-->
  753. <ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
  754. <ws-input
  755. v-model="deptBudgetList.warehouseInOutDetail.mildewGrain"
  756. type="number"
  757. @mousewheel.native.prevent
  758. placeholder="请输入霉变粒占比"
  759. maxlength="40"
  760. size="small"
  761. />
  762. </ws-form-item>
  763. <!--热损伤(%)<=-->
  764. <ws-form-item label="热损伤(%)" span="1" prop="jiaorenli">
  765. <ws-input
  766. v-model="deptBudgetList.warehouseInOutDetail.jiaorenli"
  767. type="number"
  768. @mousewheel.native.prevent
  769. placeholder="请输入热损伤占比"
  770. maxlength="40"
  771. size="small"
  772. />
  773. </ws-form-item>
  774. <!--不完善粒(%)<=-->
  775. <ws-form-item label="不完善粒(%)" span="1" prop="imperfectGrain">
  776. <ws-input
  777. v-model="deptBudgetList.warehouseInOutDetail.imperfectGrain"
  778. type="number"
  779. @mousewheel.native.prevent
  780. placeholder="请输入不完善粒占比"
  781. maxlength="40"
  782. size="small"
  783. />
  784. </ws-form-item>
  785. </ws-info-table>
  786. </div>
  787. <div style="text-align: right; padding: 10px">
  788. <el-button
  789. v-if="information == '毛重检斤'"
  790. class="bg-bottom-up"
  791. type="primary"
  792. size="small"
  793. @click="temporaryStorage()"
  794. >保存</el-button
  795. >
  796. <el-button
  797. v-if="!allowEdit"
  798. class="bg-bottom-up"
  799. type="primary"
  800. size="small"
  801. @click="submit()"
  802. >提交</el-button
  803. >
  804. </div>
  805. </ws-form>
  806. </div>
  807. </template>
  808. <script>
  809. import {
  810. pullDown,
  811. addstorageputList,
  812. xialaNo,
  813. getstaff,
  814. getReceiptTaskNo,
  815. } from '@/model/warehouse/index'
  816. import Pagination from '@/components/Pagination'
  817. import WsUpload from '@/components/WsUpload'
  818. import BalanceAlert from '@/components/balanceAlert'
  819. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  820. import { dayjs, EventBus } from 'base-core-lib'
  821. export default {
  822. name: 'viewSpareMoney',
  823. components: {
  824. WsUpload,
  825. Pagination,
  826. BalanceAlert,
  827. },
  828. watch: {
  829. // vesselId(val) {
  830. // this.getList()
  831. // },
  832. isShow(val) {
  833. this.showType = val
  834. },
  835. },
  836. data() {
  837. return {
  838. //有没有称
  839. // isShowBalance: false,
  840. deptBudgetList1: [],
  841. qualityInspectorList: [],
  842. isGetCost: false,
  843. isSelectType: true,
  844. //弹出框
  845. dialogViewSpareMoney: false,
  846. dialogApproveFormVisible: false,
  847. // 船舶类型
  848. monetaryKey: null,
  849. // 表格显示数据
  850. tableDate: [],
  851. // 是否显示
  852. showType: true,
  853. typeList: ['干粮', '潮粮'],
  854. // 年
  855. year: '',
  856. carstatus: false,
  857. deptBudgetTotal: 0,
  858. currentPage: 1,
  859. pageSize: 10,
  860. searchType: 1,
  861. searchKeyWord: '',
  862. contractType: 2,
  863. startDate: null,
  864. endDate: null,
  865. goodnameList: {},
  866. checked: true,
  867. agent: [],
  868. staffList: [],
  869. options: [],
  870. options1: [],
  871. options2: [],
  872. outContractNo1: [],
  873. outContractNo: [],
  874. // 提交类型
  875. submitType: true,
  876. storageType: [],
  877. deliveryType: [],
  878. readonly: true,
  879. appendixIdsAdd: '',
  880. uploadSuccess: {},
  881. onChange: {},
  882. gradeList: [],
  883. rules: {},
  884. size: 10,
  885. disabled1: true,
  886. disabled2: true,
  887. tranCarInfoList: [],
  888. compId: localStorage.getItem('ws-pf_compId'),
  889. secretaryWeigher: localStorage.getItem('ws-pf_staffName'),
  890. deptCircularPage: {},
  891. packtypeList: {},
  892. date: {
  893. year: dayjs().format('YYYY'),
  894. month: dayjs().format('MM'),
  895. },
  896. contractList: [],
  897. deptBudgetList: {
  898. type: '干粮',
  899. freight: 0,
  900. cost: '',
  901. addressUrl: '',
  902. warehouseInOutDetail: {},
  903. deductionAmount: 0,
  904. deductionWeight: 0,
  905. grossWeight: '',
  906. tare: '',
  907. inOutDate: '',
  908. },
  909. historyList: [],
  910. cost: '',
  911. pickerBeginDateBefore: {
  912. disabledDate: (time) => {
  913. return time.getTime() > Date.now()
  914. },
  915. },
  916. accessoryTFs: false,
  917. allowEdit: true,
  918. param: 9600,
  919. information: '',
  920. result1: '00',
  921. multiSelector: [
  922. {
  923. name: '汽运',
  924. value: '0',
  925. },
  926. {
  927. name: '火运',
  928. value: '1',
  929. },
  930. {
  931. name: '集装箱船',
  932. value: '2',
  933. },
  934. {
  935. name: '散船',
  936. value: '3',
  937. },
  938. ],
  939. grossWeight: '',
  940. }
  941. },
  942. mounted() {
  943. let date = new Date()
  944. var year = date.getFullYear()
  945. var month = date.getMonth() + 1
  946. var strDate = date.getDate()
  947. this.deptBudgetList.inOutDate = '' + year + '-' + month + '-' + strDate
  948. this.information = this.$route.query.information
  949. if (this.$route.query.allowEdit == 1) {
  950. this.allowEdit = false
  951. } else {
  952. this.allowEdit = true
  953. }
  954. this.deptBudgetList.baseId = this.$route.query.baseId
  955. this.deptBudgetList.positionId = this.$route.query.positionId
  956. this.deptBudgetList.warehouseName = this.$route.query.warehouseName
  957. this.deptBudgetList.binNumber = this.$route.query.binNumber
  958. this.deptBudgetList.warehouseType = this.$route.query.warehouseType
  959. this.deptBudgetList.createType = this.$route.query.createType
  960. this.getList()
  961. // this.deptBudgetList.grade = '一等品'
  962. // this.deptBudgetList.gradeKey = '1'
  963. this.deptBudgetList.inOutTypeFlag = 1
  964. if (this.deptBudgetList.cost) {
  965. if (this.deptBudgetList.cost > this.deptBudgetList.deductionAmount) {
  966. this.deptBudgetList.cost =
  967. this.cost - this.deptBudgetList.deductionAmount
  968. } else {
  969. }
  970. }
  971. getReceiptTaskNo({
  972. flag: 2,
  973. warehouseName: this.deptBudgetList.warehouseName,
  974. agentKey: localStorage.getItem('ws-pf_userId'),
  975. })
  976. .toPromise()
  977. .then((response) => {
  978. console.log(response)
  979. this.deptBudgetList1 = response
  980. })
  981. // if (this.deptBudgetList.warehouseType == 1) {
  982. // // this.deptBudgetList.inOutType = '采购入库'
  983. // this.deptBudgetList.inOutTypeKey = '1'
  984. // } else {
  985. // // this.deptBudgetList.inOutType = '退库'
  986. // this.deptBudgetList.inOutTypeKey = '1'
  987. // }
  988. // if (this.$route.query.automaticWeightAcquisition == '1') {
  989. // this.isShowBalance = true
  990. // }
  991. },
  992. methods: {
  993. setVal(data) {
  994. if (this.information == '毛重检斤') {
  995. this.deptBudgetList.grossWeight = data
  996. this.grossWeight = data
  997. } else {
  998. this.deptBudgetList.tare = data
  999. }
  1000. },
  1001. openPort() {
  1002. this.$refs.weightChild.openPort()
  1003. },
  1004. qualityInspectorChange(e) {
  1005. console.log(e)
  1006. },
  1007. kkInput(val) {
  1008. console.log(val)
  1009. if (this.isGetCost) {
  1010. if (this.deptBudgetList.cost > val) {
  1011. this.deptBudgetList.cost =
  1012. this.cost - this.deptBudgetList.deductionAmount
  1013. }
  1014. }
  1015. },
  1016. uploadSuccessHandle1(res) {
  1017. this.deptBudgetList.addressUrl = res.url
  1018. console.log(this.deptBudgetList.addressUrl)
  1019. },
  1020. dataFilter1(val) {
  1021. console.log(val)
  1022. this.deptBudgetList.contractNo = val
  1023. if (val) {
  1024. //val存在
  1025. this.options1 = this.outContractNo1.filter((item) => {
  1026. if (
  1027. !!~item.contractNo.indexOf(val) ||
  1028. !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())
  1029. ) {
  1030. return true
  1031. }
  1032. })
  1033. } else {
  1034. //val为空时,还原数组
  1035. this.options1 = this.outContractNo
  1036. }
  1037. },
  1038. dataFilter2(val) {
  1039. this.deptBudgetList.carNo = val
  1040. if (val) {
  1041. //val存在
  1042. this.options1 = this.outContractNo1.filter((item) => {
  1043. if (
  1044. !!~item.carNo.indexOf(val) ||
  1045. !!~item.carNo.toUpperCase().indexOf(val.toUpperCase())
  1046. ) {
  1047. return true
  1048. }
  1049. })
  1050. } else {
  1051. //val为空时,还原数组
  1052. this.options2 = this.tranCarInfoList
  1053. }
  1054. },
  1055. editClick(status) {
  1056. this.isGetCost = false
  1057. if (status == 1) {
  1058. this.disabled1 = !this.disabled1
  1059. } else {
  1060. this.disabled2 = !this.disabled2
  1061. }
  1062. },
  1063. //返回按钮
  1064. revert() {
  1065. this.$router.push({
  1066. path: 'warehouseManagementList',
  1067. })
  1068. },
  1069. carChange(e) {
  1070. for (let i = 0; i < this.tranCarInfoList.length; i++) {
  1071. if (this.tranCarInfoList[i].carNo == this.deptBudgetList.carNo) {
  1072. this.deptBudgetList.tranCarNo = this.tranCarInfoList[i].tranCarNo
  1073. this.deptBudgetList.carId = this.tranCarInfoList[i].id
  1074. this.deptBudgetList.freight = Math.round(
  1075. this.tranCarInfoList[i].tranPrice
  1076. )
  1077. if (this.deptBudgetList.inOutType == '移库入库') {
  1078. if (!this.deptBudgetList.cost) {
  1079. this.deptBudgetList.cost = this.tranCarInfoList[i].cost
  1080. }
  1081. this.deptBudgetList.loadNetWeight =
  1082. this.tranCarInfoList[i].loadNetWeight
  1083. }
  1084. }
  1085. }
  1086. },
  1087. dataFilter(val) {
  1088. // console.log(val,"名")
  1089. this.deptBudgetList.staffList = val
  1090. if (val) {
  1091. //val存在
  1092. this.options = this.staffList.filter((item) => {
  1093. if (
  1094. !!~item.staffName.indexOf(val) ||
  1095. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  1096. ) {
  1097. return true
  1098. }
  1099. })
  1100. } else {
  1101. //val为空时,还原数组
  1102. this.options = this.staffList
  1103. }
  1104. },
  1105. selectstaff(e) {
  1106. // console.log(this.deptBudgetList.agent)
  1107. for (var i = 0; i < this.staffList.length; i++) {
  1108. if (this.staffList[i].staffName == e) {
  1109. this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  1110. }
  1111. }
  1112. },
  1113. //提交按钮
  1114. submit() {
  1115. if (this.reader) {
  1116. this.reader.cancel()
  1117. }
  1118. if (!this.deptBudgetList.goodsName) {
  1119. this.$message({
  1120. message: '货名不能为空',
  1121. type: 'warning',
  1122. })
  1123. return
  1124. }
  1125. if (!this.deptBudgetList.grossWeight) {
  1126. this.$message({
  1127. message: '毛重不能为空',
  1128. type: 'warning',
  1129. })
  1130. return
  1131. }
  1132. if (
  1133. this.deptBudgetList.grossWeight < 100 ||
  1134. this.deptBudgetList.grossWeight > 500000 ||
  1135. (String(this.deptBudgetList.grossWeight).indexOf('.') != -1 &&
  1136. String(this.deptBudgetList.grossWeight).length -
  1137. (String(this.deptBudgetList.grossWeight).indexOf('.') + 1) >
  1138. 3)
  1139. ) {
  1140. this.$message({
  1141. message: '毛重输入错误(单位:公斤)',
  1142. type: 'warning',
  1143. })
  1144. return
  1145. }
  1146. if (!String(this.deptBudgetList.tare)) {
  1147. this.$message({
  1148. message: '皮重不能为空',
  1149. type: 'warning',
  1150. })
  1151. return
  1152. }
  1153. if (
  1154. this.deptBudgetList.tare < 0 ||
  1155. this.deptBudgetList.tare > 5000000 ||
  1156. (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
  1157. String(this.deptBudgetList.tare).length -
  1158. (String(this.deptBudgetList.tare).indexOf('.') + 1) >
  1159. 3)
  1160. ) {
  1161. this.$message({
  1162. message: '皮重输入错误(单位:公斤)',
  1163. type: 'warning',
  1164. })
  1165. return
  1166. }
  1167. if (!String(this.deptBudgetList.deductionWeight)) {
  1168. this.$message({
  1169. message: '扣重不能为空',
  1170. type: 'warning',
  1171. })
  1172. return
  1173. }
  1174. if (
  1175. this.deptBudgetList.deductionWeight < 0 ||
  1176. this.deptBudgetList.deductionWeight > 1000 ||
  1177. (String(this.deptBudgetList.deductionWeight).indexOf('.') != -1 &&
  1178. String(this.deptBudgetList.deductionWeight).length -
  1179. (String(this.deptBudgetList.deductionWeight).indexOf('.') + 1) >
  1180. 3)
  1181. ) {
  1182. this.$message({
  1183. message: '扣重输入错误',
  1184. type: 'warning',
  1185. })
  1186. return
  1187. }
  1188. if (
  1189. this.deptBudgetList.type == '潮粮' &&
  1190. !this.deptBudgetList.buckleWeightRatio
  1191. ) {
  1192. this.$message({
  1193. message: '扣重比不能为空',
  1194. type: 'warning',
  1195. })
  1196. return
  1197. }
  1198. if (
  1199. (this.deptBudgetList.type == '潮粮' &&
  1200. this.deptBudgetList.buckleWeightRatio < 0) ||
  1201. (this.deptBudgetList.type == '潮粮' &&
  1202. this.deptBudgetList.buckleWeightRatio > 3) ||
  1203. (this.deptBudgetList.type == '潮粮' &&
  1204. String(this.deptBudgetList.buckleWeightRatio).indexOf('.') != -1 &&
  1205. String(this.deptBudgetList.buckleWeightRatio).length -
  1206. (String(this.deptBudgetList.buckleWeightRatio).indexOf('.') + 1) >
  1207. 2)
  1208. ) {
  1209. this.$message({
  1210. message: '扣重比输入错误',
  1211. type: 'warning',
  1212. })
  1213. return
  1214. }
  1215. if (
  1216. this.deptBudgetList.type == '潮粮' &&
  1217. !this.deptBudgetList.tidalGrainWater
  1218. ) {
  1219. this.$message({
  1220. message: '潮粮水分不能为空',
  1221. type: 'warning',
  1222. })
  1223. return
  1224. }
  1225. if (
  1226. (this.deptBudgetList.type == '潮粮' &&
  1227. this.deptBudgetList.tidalGrainWater < 1) ||
  1228. (this.deptBudgetList.type == '潮粮' &&
  1229. this.deptBudgetList.tidalGrainWater > 40) ||
  1230. (this.deptBudgetList.type == '潮粮' &&
  1231. String(this.deptBudgetList.tidalGrainWater).indexOf('.') != -1 &&
  1232. String(this.deptBudgetList.tidalGrainWater).length -
  1233. (String(this.deptBudgetList.tidalGrainWater).indexOf('.') + 1) >
  1234. 2)
  1235. ) {
  1236. this.$message({
  1237. message: '潮粮水分输入错误',
  1238. type: 'warning',
  1239. })
  1240. return
  1241. }
  1242. if (
  1243. this.deptBudgetList.type == '潮粮' &&
  1244. !this.deptBudgetList.solidGrainWater
  1245. ) {
  1246. this.$message({
  1247. message: '干粮水分不能为空',
  1248. type: 'warning',
  1249. })
  1250. return
  1251. }
  1252. if (
  1253. (this.deptBudgetList.type == '潮粮' &&
  1254. this.deptBudgetList.solidGrainWater < 1) ||
  1255. (this.deptBudgetList.type == '潮粮' &&
  1256. this.deptBudgetList.solidGrainWater > 40) ||
  1257. (this.deptBudgetList.type == '潮粮' &&
  1258. String(this.deptBudgetList.solidGrainWater).indexOf('.') != -1 &&
  1259. String(this.deptBudgetList.solidGrainWater).length -
  1260. (String(this.deptBudgetList.solidGrainWater).indexOf('.') + 1) >
  1261. 1)
  1262. ) {
  1263. this.$message({
  1264. message: '干粮水分输入错误',
  1265. type: 'warning',
  1266. })
  1267. return
  1268. }
  1269. if (!String(this.deptBudgetList.deductionAmount)) {
  1270. this.$message({
  1271. message: '扣款不能为空',
  1272. type: 'warning',
  1273. })
  1274. return
  1275. }
  1276. if (
  1277. this.deptBudgetList.deductionAmount < 0 ||
  1278. this.deptBudgetList.deductionAmount > 10000 ||
  1279. (String(this.deptBudgetList.deductionAmount).indexOf('.') != -1 &&
  1280. String(this.deptBudgetList.deductionAmount).length -
  1281. (String(this.deptBudgetList.deductionAmount).indexOf('.') + 1) >
  1282. 2)
  1283. ) {
  1284. this.$message({
  1285. message: '扣款输入错误',
  1286. type: 'warning',
  1287. })
  1288. return
  1289. }
  1290. if (!this.deptBudgetList.cost) {
  1291. this.$message({
  1292. message: '未获取到成本,请编辑后提交',
  1293. type: 'warning',
  1294. })
  1295. return
  1296. }
  1297. if (
  1298. this.deptBudgetList.cost < 0 ||
  1299. this.deptBudgetList.cost > 20000 ||
  1300. (String(this.deptBudgetList.cost).indexOf('.') != -1 &&
  1301. String(this.deptBudgetList.cost).length -
  1302. (String(this.deptBudgetList.cost).indexOf('.') + 1) >
  1303. 2)
  1304. ) {
  1305. this.$message({
  1306. message: '成本输入错误',
  1307. type: 'warning',
  1308. })
  1309. return
  1310. }
  1311. if (!String(this.deptBudgetList.freight)) {
  1312. this.$message({
  1313. message: '运费不能为空',
  1314. type: 'warning',
  1315. })
  1316. return
  1317. }
  1318. if (
  1319. this.deptBudgetList.freight < 0 ||
  1320. this.deptBudgetList.freight > 100000 ||
  1321. (String(this.deptBudgetList.freight).indexOf('.') != -1 &&
  1322. String(this.deptBudgetList.freight).length -
  1323. (String(this.deptBudgetList.freight).indexOf('.') + 1) >
  1324. 2)
  1325. ) {
  1326. this.$message({
  1327. message: '运费输入错误',
  1328. type: 'warning',
  1329. })
  1330. return
  1331. }
  1332. if (!this.deptBudgetList.agent) {
  1333. this.$message({
  1334. message: '经办人不能为空',
  1335. type: 'warning',
  1336. })
  1337. return
  1338. }
  1339. if (
  1340. this.deptBudgetList.agent.length < 2 ||
  1341. this.deptBudgetList.agent.length > 10
  1342. ) {
  1343. this.$message({
  1344. message: '经办人输入有误',
  1345. type: 'warning',
  1346. })
  1347. return
  1348. }
  1349. if (!this.deptBudgetList.grade) {
  1350. this.$message({
  1351. message: '品级不能为空!',
  1352. type: 'warning',
  1353. })
  1354. return
  1355. }
  1356. if (!this.deptBudgetList.inOutDate) {
  1357. this.$message({
  1358. message: '入库日期不能为空!',
  1359. type: 'warning',
  1360. })
  1361. return
  1362. }
  1363. if (!this.deptBudgetList.inOutType) {
  1364. this.$message({
  1365. message: '入库类型不能为空!',
  1366. type: 'warning',
  1367. })
  1368. return
  1369. }
  1370. if (!this.deptBudgetList.carNo) {
  1371. this.$message({
  1372. message: '车牌号不能为空',
  1373. type: 'warning',
  1374. })
  1375. return
  1376. }
  1377. if (this.deptBudgetList.carNo.length > 7) {
  1378. this.$message({
  1379. message: '车牌号输入错误,请输入7个字符之内',
  1380. type: 'warning',
  1381. })
  1382. return
  1383. }
  1384. if (this.deptBudgetList.boxNo && this.deptBudgetList.boxNo.length > 20) {
  1385. this.$message({
  1386. message: '箱号-1输入错误',
  1387. type: 'warning',
  1388. })
  1389. return
  1390. }
  1391. if (
  1392. this.deptBudgetList.boxNoOther &&
  1393. this.deptBudgetList.boxNoOther.length > 20
  1394. ) {
  1395. this.$message({
  1396. message: '箱号-2输入错误',
  1397. type: 'warning',
  1398. })
  1399. return
  1400. }
  1401. if (
  1402. this.deptBudgetList.titleNo &&
  1403. this.deptBudgetList.titleNo.length > 20
  1404. ) {
  1405. this.$message({
  1406. message: '封号-1输入错误',
  1407. type: 'warning',
  1408. })
  1409. return
  1410. }
  1411. if (
  1412. this.deptBudgetList.titleNoOther &&
  1413. this.deptBudgetList.titleNoOther.length > 20
  1414. ) {
  1415. this.$message({
  1416. message: '封号-2输入错误',
  1417. type: 'warning',
  1418. })
  1419. return
  1420. }
  1421. if (!this.deptBudgetList.contractNo) {
  1422. this.$message({
  1423. message: '合同编号不能为空',
  1424. type: 'warning',
  1425. })
  1426. return
  1427. }
  1428. // if (
  1429. // this.deptBudgetList.contractNo.length < 6 ||
  1430. // this.deptBudgetList.contractNo.length > 20
  1431. // ) {
  1432. // this.$message({
  1433. // message: '合同编号长度不符合要求,请输入6-20个字符之内',
  1434. // type: 'warning',
  1435. // })
  1436. // return
  1437. // }
  1438. // if (!this.deptBudgetList.addressUrl) {
  1439. // this.$message({
  1440. // message: '附件不能为空',
  1441. // type: 'warning',
  1442. // })
  1443. // return
  1444. // }
  1445. //自检员
  1446. if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
  1447. if (
  1448. this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
  1449. 2 ||
  1450. this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
  1451. ) {
  1452. this.$message({
  1453. message: '质检员姓名长度错误!',
  1454. type: 'warning',
  1455. })
  1456. return
  1457. }
  1458. }
  1459. if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
  1460. if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
  1461. this.$message({
  1462. message: '水分(%)非数字!',
  1463. type: 'warning',
  1464. })
  1465. return
  1466. }
  1467. if (
  1468. this.deptBudgetList.warehouseInOutDetail.waterContent < 0 ||
  1469. this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
  1470. (String(
  1471. this.deptBudgetList.warehouseInOutDetail.waterContent
  1472. ).indexOf('.') != -1 &&
  1473. String(this.deptBudgetList.warehouseInOutDetail.waterContent)
  1474. .length -
  1475. (String(
  1476. this.deptBudgetList.warehouseInOutDetail.waterContent
  1477. ).indexOf('.') +
  1478. 1) >
  1479. 2)
  1480. ) {
  1481. this.$message({
  1482. message: '水分(%)输入错误! 取值范围0-40之间且可以保留2小数',
  1483. type: 'warning',
  1484. })
  1485. return
  1486. }
  1487. }
  1488. //杂质
  1489. if (this.deptBudgetList.warehouseInOutDetail.impurity) {
  1490. if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
  1491. this.$message({
  1492. message: '杂质(%)非数字!',
  1493. type: 'warning',
  1494. })
  1495. return
  1496. }
  1497. if (
  1498. this.deptBudgetList.warehouseInOutDetail.impurity < 0 ||
  1499. this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
  1500. (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
  1501. '.'
  1502. ) != -1 &&
  1503. String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
  1504. (String(
  1505. this.deptBudgetList.warehouseInOutDetail.impurity
  1506. ).indexOf('.') +
  1507. 1) >
  1508. 2)
  1509. ) {
  1510. this.$message({
  1511. message: '杂质(%)输入错误! 取值范围0-40之间且可以保留2小数',
  1512. type: 'warning',
  1513. })
  1514. return
  1515. }
  1516. }
  1517. //霉变
  1518. if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
  1519. if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
  1520. this.$message({
  1521. message: '霉变粒(%)非数字!',
  1522. type: 'warning',
  1523. })
  1524. return
  1525. }
  1526. if (
  1527. this.deptBudgetList.warehouseInOutDetail.mildewGrain < 0 ||
  1528. this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
  1529. (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
  1530. '.'
  1531. ) != -1 &&
  1532. String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
  1533. .length -
  1534. (String(
  1535. this.deptBudgetList.warehouseInOutDetail.mildewGrain
  1536. ).indexOf('.') +
  1537. 1) >
  1538. 2)
  1539. ) {
  1540. this.$message({
  1541. message: '霉变粒(%)输入错误! 取值范围0-40之间且可以保留2小数',
  1542. type: 'warning',
  1543. })
  1544. return
  1545. }
  1546. }
  1547. //热损伤
  1548. if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
  1549. if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
  1550. this.$message({
  1551. message: '热损伤(%)非数字!',
  1552. type: 'warning',
  1553. })
  1554. return
  1555. }
  1556. if (
  1557. this.deptBudgetList.warehouseInOutDetail.jiaorenli < 0 ||
  1558. this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
  1559. (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
  1560. '.'
  1561. ) != -1 &&
  1562. String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
  1563. (String(
  1564. this.deptBudgetList.warehouseInOutDetail.jiaorenli
  1565. ).indexOf('.') +
  1566. 1) >
  1567. 2)
  1568. ) {
  1569. this.$message({
  1570. message: '热损伤(%)输入错误! 取值范围0-40之间且可以保留2小数',
  1571. type: 'warning',
  1572. })
  1573. return
  1574. }
  1575. }
  1576. //不完善粒(%)
  1577. if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
  1578. if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
  1579. this.$message({
  1580. message: '不完善粒(%)非数字!',
  1581. type: 'warning',
  1582. })
  1583. return
  1584. }
  1585. if (
  1586. this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 0 ||
  1587. this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
  1588. (String(
  1589. this.deptBudgetList.warehouseInOutDetail.imperfectGrain
  1590. ).indexOf('.') != -1 &&
  1591. String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
  1592. .length -
  1593. (String(
  1594. this.deptBudgetList.warehouseInOutDetail.imperfectGrain
  1595. ).indexOf('.') +
  1596. 1) >
  1597. 2)
  1598. ) {
  1599. this.$message({
  1600. message: '不完善粒(%)输入错误! 取值范围0-40之间且可以保留2小数',
  1601. type: 'warning',
  1602. })
  1603. return
  1604. }
  1605. }
  1606. //容重
  1607. if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
  1608. if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
  1609. this.$message({
  1610. message: '容重(克/升)非数字!',
  1611. type: 'warning',
  1612. })
  1613. return
  1614. }
  1615. if (
  1616. (this.deptBudgetList.warehouseInOutDetail.bulkDensity &&
  1617. String(
  1618. this.deptBudgetList.warehouseInOutDetail.bulkDensity
  1619. ).indexOf('.') != -1 &&
  1620. String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
  1621. .length -
  1622. (String(
  1623. this.deptBudgetList.warehouseInOutDetail.bulkDensity
  1624. ).indexOf('.') +
  1625. 1) >
  1626. 2) ||
  1627. this.deptBudgetList.warehouseInOutDetail.bulkDensity > 1000 ||
  1628. this.deptBudgetList.warehouseInOutDetail.bulkDensity < 0
  1629. ) {
  1630. this.$message({
  1631. message: '容重输入错误',
  1632. type: 'warning',
  1633. })
  1634. return
  1635. }
  1636. }
  1637. console.log(this.deptBudgetList, '入库对象')
  1638. this.$confirm(`确定提交入库信息`, {
  1639. cancelButtonText: '取消',
  1640. confirmButtonText: '确定',
  1641. type: 'warning',
  1642. })
  1643. .then(() => {
  1644. this.$refs.deptBudgetList.validate((valid) => {
  1645. if (valid) {
  1646. this.deptBudgetList.compId = localStorage.getItem('ws-pf_compId')
  1647. this.deptBudgetList.secretaryWeigher =
  1648. localStorage.getItem('ws-pf_staffName')
  1649. this.deptBudgetList.inOutFlag = 2
  1650. this.deptBudgetList.pcFlag = 1
  1651. this.deptBudgetList.statusFlag = 3
  1652. this.deptBudgetList.grossWeight = (
  1653. this.deptBudgetList.grossWeight / 1000
  1654. ).toFixed(2)
  1655. this.deptBudgetList.tare = (
  1656. this.deptBudgetList.tare / 1000
  1657. ).toFixed(2)
  1658. this.deptBudgetList.netWeight = (
  1659. this.deptBudgetList.netWeight / 1000
  1660. ).toFixed(2)
  1661. if (!this.deptBudgetList.pureWeight) {
  1662. this.deptBudgetList.pureWeight = 0
  1663. }
  1664. this.deptBudgetList.pureWeight = (
  1665. this.deptBudgetList.pureWeight / 1000
  1666. ).toFixed(2)
  1667. if (!this.deptBudgetList.deductionWeight) {
  1668. this.deptBudgetList.deductionWeight = 0
  1669. }
  1670. if (!this.deptBudgetList.deductionAmount) {
  1671. this.deptBudgetList.deductionAmount = 0
  1672. }
  1673. this.deptBudgetList.deductionWeight = (
  1674. this.deptBudgetList.deductionWeight / 1000
  1675. ).toFixed(2)
  1676. this.deptBudgetList.deductionAmount = Math.round(
  1677. this.deptBudgetList.deductionAmount * 1000
  1678. )
  1679. // this.deptBudgetList.grossWeight /= 1000
  1680. // this.deptBudgetList.tare /= 1000
  1681. // this.deptBudgetList.netWeight /= 1000
  1682. // this.deptBudgetList.pureWeight /= 1000
  1683. // this.deptBudgetList.deductionAmount *= 1000
  1684. // this.deptBudgetList.deductionWeight /= 1000
  1685. addstorageputList(this.deptBudgetList)
  1686. .toPromise()
  1687. .then((response) => {
  1688. // this.deptBudgetList.grossWeight = Math.round(this.dataList.grossWeight*1000)
  1689. // this.deptBudgetList.tare = Math.round(this.dataList.tare*1000)
  1690. // this.deptBudgetList.netWeight = Math.round(this.dataList.netWeight*1000)
  1691. // this.deptBudgetList.pureWeight = Math.round(this.dataList.pureWeight*1000)
  1692. // this.deptBudgetList.deductionWeight = Math.round(this.dataList.deductionWeight*1000)
  1693. if (this.reader) {
  1694. this.reader.cancel()
  1695. }
  1696. this.$message.success('添加成功')
  1697. this.$router.push({
  1698. path: 'warehouseManagementList',
  1699. })
  1700. })
  1701. .catch((response) => {
  1702. this.deptBudgetList.grossWeight = Math.round(
  1703. this.deptBudgetList.grossWeight * 1000
  1704. )
  1705. this.deptBudgetList.tare = Math.round(
  1706. this.deptBudgetList.tare * 1000
  1707. )
  1708. this.deptBudgetList.netWeight = Math.round(
  1709. this.deptBudgetList.netWeight * 1000
  1710. )
  1711. this.deptBudgetList.pureWeight = Math.round(
  1712. this.deptBudgetList.pureWeight * 1000
  1713. )
  1714. this.deptBudgetList.deductionWeight = Math.round(
  1715. this.deptBudgetList.deductionWeight * 1000
  1716. )
  1717. })
  1718. } else {
  1719. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1720. return false
  1721. }
  1722. })
  1723. })
  1724. .catch(() => {
  1725. return false
  1726. })
  1727. },
  1728. temporaryStorage() {
  1729. if (this.reader) {
  1730. this.reader.cancel()
  1731. }
  1732. if (!this.deptBudgetList.goodsName) {
  1733. this.$message({
  1734. message: '货名不能为空',
  1735. type: 'warning',
  1736. })
  1737. return
  1738. }
  1739. if (this.information == '毛重检斤' && !this.deptBudgetList.grossWeight) {
  1740. this.$message({
  1741. message: '毛重不能为空',
  1742. type: 'warning',
  1743. })
  1744. return
  1745. }
  1746. if (
  1747. this.information == '毛重检斤' &&
  1748. (this.deptBudgetList.grossWeight < 0 ||
  1749. this.deptBudgetList.grossWeight > 2000000 ||
  1750. (String(this.deptBudgetList.grossWeight).indexOf('.') != -1 &&
  1751. String(this.deptBudgetList.grossWeight).length -
  1752. (String(this.deptBudgetList.grossWeight).indexOf('.') + 1) >
  1753. 3))
  1754. ) {
  1755. this.$message({
  1756. message: '毛重输入错误',
  1757. type: 'warning',
  1758. })
  1759. return
  1760. }
  1761. if (this.information == '皮重检斤' && !this.deptBudgetList.tare) {
  1762. this.$message({
  1763. message: '皮重不能为空',
  1764. type: 'warning',
  1765. })
  1766. return
  1767. }
  1768. if (
  1769. this.information == '皮重检斤' &&
  1770. (this.deptBudgetList.tare < 0 ||
  1771. this.deptBudgetList.tare > 1000000 ||
  1772. (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
  1773. String(this.deptBudgetList.tare).length -
  1774. (String(this.deptBudgetList.tare).indexOf('.') + 1) >
  1775. 3))
  1776. ) {
  1777. this.$message({
  1778. message: '皮重输入错误',
  1779. type: 'warning',
  1780. })
  1781. return
  1782. }
  1783. // if (!this.deptBudgetList.deductionWeight) {
  1784. // this.$message({
  1785. // message: '扣重不能为空',
  1786. // type: 'warning',
  1787. // })
  1788. // return
  1789. // }
  1790. // if (
  1791. // this.deptBudgetList.deductionWeight < 0 ||
  1792. // this.deptBudgetList.deductionWeight > 10 ||
  1793. // (String(this.deptBudgetList.deductionWeight).indexOf('.') != -1 &&
  1794. // String(this.deptBudgetList.deductionWeight).length -
  1795. // (String(this.deptBudgetList.deductionWeight).indexOf('.') + 1) >
  1796. // 3)
  1797. // ) {
  1798. // this.$message({
  1799. // message: '扣重输入错误',
  1800. // type: 'warning',
  1801. // })
  1802. // return
  1803. // }
  1804. // if (
  1805. // this.deptBudgetList.type == '潮粮' &&
  1806. // !this.deptBudgetList.buckleWeightRatio
  1807. // ) {
  1808. // this.$message({
  1809. // message: '扣重比不能为空',
  1810. // type: 'warning',
  1811. // })
  1812. // return
  1813. // }
  1814. // if (
  1815. // (this.deptBudgetList.type == '潮粮' &&
  1816. // this.deptBudgetList.buckleWeightRatio < 0) ||
  1817. // (this.deptBudgetList.type == '潮粮' &&
  1818. // this.deptBudgetList.buckleWeightRatio > 3) ||
  1819. // (this.deptBudgetList.type == '潮粮' &&
  1820. // String(this.deptBudgetList.buckleWeightRatio).indexOf('.') != -1 &&
  1821. // String(this.deptBudgetList.buckleWeightRatio).length -
  1822. // (String(this.deptBudgetList.buckleWeightRatio).indexOf('.') + 1) >
  1823. // 2)
  1824. // ) {
  1825. // this.$message({
  1826. // message: '扣重比输入错误',
  1827. // type: 'warning',
  1828. // })
  1829. // return
  1830. // }
  1831. // if (
  1832. // this.deptBudgetList.type == '潮粮' &&
  1833. // !this.deptBudgetList.tidalGrainWater
  1834. // ) {
  1835. // this.$message({
  1836. // message: '潮粮水分不能为空',
  1837. // type: 'warning',
  1838. // })
  1839. // return
  1840. // }
  1841. // if (
  1842. // (this.deptBudgetList.type == '潮粮' &&
  1843. // this.deptBudgetList.tidalGrainWater < 1) ||
  1844. // (this.deptBudgetList.type == '潮粮' &&
  1845. // this.deptBudgetList.tidalGrainWater > 40) ||
  1846. // (this.deptBudgetList.type == '潮粮' &&
  1847. // String(this.deptBudgetList.tidalGrainWater).indexOf('.') != -1 &&
  1848. // String(this.deptBudgetList.tidalGrainWater).length -
  1849. // (String(this.deptBudgetList.tidalGrainWater).indexOf('.') + 1) >
  1850. // 2)
  1851. // ) {
  1852. // this.$message({
  1853. // message: '潮粮水分输入错误',
  1854. // type: 'warning',
  1855. // })
  1856. // return
  1857. // }
  1858. // if (
  1859. // this.deptBudgetList.type == '潮粮' &&
  1860. // !this.deptBudgetList.solidGrainWater
  1861. // ) {
  1862. // this.$message({
  1863. // message: '干粮水分不能为空',
  1864. // type: 'warning',
  1865. // })
  1866. // return
  1867. // }
  1868. // if (
  1869. // (this.deptBudgetList.type == '潮粮' &&
  1870. // this.deptBudgetList.solidGrainWater < 1) ||
  1871. // (this.deptBudgetList.type == '潮粮' &&
  1872. // this.deptBudgetList.solidGrainWater > 40) ||
  1873. // (this.deptBudgetList.type == '潮粮' &&
  1874. // String(this.deptBudgetList.solidGrainWater).indexOf('.') != -1 &&
  1875. // String(this.deptBudgetList.solidGrainWater).length -
  1876. // (String(this.deptBudgetList.solidGrainWater).indexOf('.') + 1) >
  1877. // 1)
  1878. // ) {
  1879. // this.$message({
  1880. // message: '干粮水分输入错误',
  1881. // type: 'warning',
  1882. // })
  1883. // return
  1884. // }
  1885. // if (!this.deptBudgetList.deductionAmount) {
  1886. // this.$message({
  1887. // message: '扣款不能为空',
  1888. // type: 'warning',
  1889. // })
  1890. // return
  1891. // }
  1892. // if (
  1893. // this.deptBudgetList.deductionAmount < 0 ||
  1894. // this.deptBudgetList.deductionAmount > 10000 ||
  1895. // (String(this.deptBudgetList.deductionAmount).indexOf('.') != -1 &&
  1896. // String(this.deptBudgetList.deductionAmount).length -
  1897. // (String(this.deptBudgetList.deductionAmount).indexOf('.') + 1) >
  1898. // 2)
  1899. // ) {
  1900. // this.$message({
  1901. // message: '扣款输入错误',
  1902. // type: 'warning',
  1903. // })
  1904. // return
  1905. // }
  1906. // if (!this.deptBudgetList.cost) {
  1907. // this.$message({
  1908. // message: '未获取到成本,请编辑后提交',
  1909. // type: 'warning',
  1910. // })
  1911. // return
  1912. // }
  1913. // if (
  1914. // this.deptBudgetList.cost < 0 ||
  1915. // this.deptBudgetList.cost > 20000 ||
  1916. // (String(this.deptBudgetList.cost).indexOf('.') != -1 &&
  1917. // String(this.deptBudgetList.cost).length -
  1918. // (String(this.deptBudgetList.cost).indexOf('.') + 1) >
  1919. // 2)
  1920. // ) {
  1921. // this.$message({
  1922. // message: '成本输入错误',
  1923. // type: 'warning',
  1924. // })
  1925. // return
  1926. // }
  1927. // if (!this.deptBudgetList.freight) {
  1928. // this.$message({
  1929. // message: '运费不能为空',
  1930. // type: 'warning',
  1931. // })
  1932. // return
  1933. // }
  1934. // if (
  1935. // this.deptBudgetList.freight < 0 ||
  1936. // this.deptBudgetList.freight > 100000 ||
  1937. // (String(this.deptBudgetList.freight).indexOf('.') != -1 &&
  1938. // String(this.deptBudgetList.freight).length -
  1939. // (String(this.deptBudgetList.freight).indexOf('.') + 1) >
  1940. // 2)
  1941. // ) {
  1942. // this.$message({
  1943. // message: '运费输入错误',
  1944. // type: 'warning',
  1945. // })
  1946. // return
  1947. // }
  1948. // if (!this.deptBudgetList.agent) {
  1949. // this.$message({
  1950. // message: '经办人不能为空',
  1951. // type: 'warning',
  1952. // })
  1953. // return
  1954. // }
  1955. // if (
  1956. // this.deptBudgetList.agent.length < 2 ||
  1957. // this.deptBudgetList.agent.length > 10
  1958. // ) {
  1959. // this.$message({
  1960. // message: '经办人输入有误',
  1961. // type: 'warning',
  1962. // })
  1963. // return
  1964. // }
  1965. // if (!this.deptBudgetList.carNo) {
  1966. // this.$message({
  1967. // message: '车牌号不能为空',
  1968. // type: 'warning'
  1969. // })
  1970. // return
  1971. // }
  1972. // if (this.deptBudgetList.carNo.length > 7) {
  1973. // this.$message({
  1974. // message: '车牌号输入错误,请输入7个字符之内',
  1975. // type: 'warning'
  1976. // })
  1977. // return
  1978. // }
  1979. if (!this.deptBudgetList.contractNo) {
  1980. this.$message({
  1981. message: '合同编号不能为空',
  1982. type: 'warning',
  1983. })
  1984. return
  1985. }
  1986. // if (
  1987. // this.deptBudgetList.contractNo.length < 6 ||
  1988. // this.deptBudgetList.contractNo.length > 20
  1989. // ) {
  1990. // this.$message({
  1991. // message: '合同编号长度不符合要求,请输入6-20个字符之内',
  1992. // type: 'warning',
  1993. // })
  1994. // return
  1995. // }
  1996. // if (this.deptBudgetList.netWeight > this.$route.query.capacity) {
  1997. // this.$message({
  1998. // message: '入库量大于该仓库容量!',
  1999. // type: 'warning',
  2000. // })
  2001. // return
  2002. // }
  2003. //自检员
  2004. if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
  2005. if (
  2006. this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
  2007. 2 ||
  2008. this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
  2009. ) {
  2010. this.$message({
  2011. message: '质检员姓名长度错误!',
  2012. type: 'warning',
  2013. })
  2014. return
  2015. }
  2016. }
  2017. if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
  2018. if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
  2019. this.$message({
  2020. message: '水分(%)非数字!',
  2021. type: 'warning',
  2022. })
  2023. return
  2024. }
  2025. if (
  2026. this.deptBudgetList.warehouseInOutDetail.waterContent < 0 ||
  2027. this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
  2028. (String(
  2029. this.deptBudgetList.warehouseInOutDetail.waterContent
  2030. ).indexOf('.') != -1 &&
  2031. String(this.deptBudgetList.warehouseInOutDetail.waterContent)
  2032. .length -
  2033. (String(
  2034. this.deptBudgetList.warehouseInOutDetail.waterContent
  2035. ).indexOf('.') +
  2036. 1) >
  2037. 2)
  2038. ) {
  2039. this.$message({
  2040. message: '水分(%)输入错误! 取值范围0-40之间且可以保留2小数',
  2041. type: 'warning',
  2042. })
  2043. return
  2044. }
  2045. }
  2046. //杂质
  2047. if (this.deptBudgetList.warehouseInOutDetail.impurity) {
  2048. if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
  2049. this.$message({
  2050. message: '杂质(%)非数字!',
  2051. type: 'warning',
  2052. })
  2053. return
  2054. }
  2055. if (
  2056. this.deptBudgetList.warehouseInOutDetail.impurity < 0 ||
  2057. this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
  2058. (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
  2059. '.'
  2060. ) != -1 &&
  2061. String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
  2062. (String(
  2063. this.deptBudgetList.warehouseInOutDetail.impurity
  2064. ).indexOf('.') +
  2065. 1) >
  2066. 2)
  2067. ) {
  2068. this.$message({
  2069. message: '杂质(%)输入错误! 取值范围0-40之间且可以保留2小数',
  2070. type: 'warning',
  2071. })
  2072. return
  2073. }
  2074. }
  2075. //霉变
  2076. if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
  2077. if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
  2078. this.$message({
  2079. message: '霉变粒(%)非数字!',
  2080. type: 'warning',
  2081. })
  2082. return
  2083. }
  2084. if (
  2085. this.deptBudgetList.warehouseInOutDetail.mildewGrain < 0 ||
  2086. this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
  2087. (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
  2088. '.'
  2089. ) != -1 &&
  2090. String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
  2091. .length -
  2092. (String(
  2093. this.deptBudgetList.warehouseInOutDetail.mildewGrain
  2094. ).indexOf('.') +
  2095. 1) >
  2096. 2)
  2097. ) {
  2098. this.$message({
  2099. message: '霉变粒(%)输入错误! 取值范围0-40之间且可以保留2小数',
  2100. type: 'warning',
  2101. })
  2102. return
  2103. }
  2104. }
  2105. //热损伤
  2106. if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
  2107. if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
  2108. this.$message({
  2109. message: '热损伤(%)非数字!',
  2110. type: 'warning',
  2111. })
  2112. return
  2113. }
  2114. if (
  2115. this.deptBudgetList.warehouseInOutDetail.jiaorenli < 0 ||
  2116. this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
  2117. (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
  2118. '.'
  2119. ) != -1 &&
  2120. String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
  2121. (String(
  2122. this.deptBudgetList.warehouseInOutDetail.jiaorenli
  2123. ).indexOf('.') +
  2124. 1) >
  2125. 2)
  2126. ) {
  2127. this.$message({
  2128. message: '热损伤(%)输入错误! 取值范围0-40之间且可以保留2小数',
  2129. type: 'warning',
  2130. })
  2131. return
  2132. }
  2133. }
  2134. //不完善粒(%)
  2135. if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
  2136. if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
  2137. this.$message({
  2138. message: '不完善粒(%)非数字!',
  2139. type: 'warning',
  2140. })
  2141. return
  2142. }
  2143. if (
  2144. this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 0 ||
  2145. this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
  2146. (String(
  2147. this.deptBudgetList.warehouseInOutDetail.imperfectGrain
  2148. ).indexOf('.') != -1 &&
  2149. String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
  2150. .length -
  2151. (String(
  2152. this.deptBudgetList.warehouseInOutDetail.imperfectGrain
  2153. ).indexOf('.') +
  2154. 1) >
  2155. 2)
  2156. ) {
  2157. this.$message({
  2158. message: '不完善粒(%)输入错误! 取值范围0-40之间且可以保留2小数',
  2159. type: 'warning',
  2160. })
  2161. return
  2162. }
  2163. }
  2164. //容重
  2165. if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
  2166. if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
  2167. this.$message({
  2168. message: '容重(克/升)非数字!',
  2169. type: 'warning',
  2170. })
  2171. return
  2172. }
  2173. if (
  2174. (this.deptBudgetList.warehouseInOutDetail.bulkDensity &&
  2175. String(
  2176. this.deptBudgetList.warehouseInOutDetail.bulkDensity
  2177. ).indexOf('.') != -1 &&
  2178. String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
  2179. .length -
  2180. (String(
  2181. this.deptBudgetList.warehouseInOutDetail.bulkDensity
  2182. ).indexOf('.') +
  2183. 1) >
  2184. 2) ||
  2185. this.deptBudgetList.warehouseInOutDetail.bulkDensity > 1000 ||
  2186. this.deptBudgetList.warehouseInOutDetail.bulkDensity < 0
  2187. ) {
  2188. this.$message({
  2189. message: '容重输入错误',
  2190. type: 'warning',
  2191. })
  2192. return
  2193. }
  2194. }
  2195. this.$confirm(`是否保存毛重检斤`, {
  2196. cancelButtonText: '取消',
  2197. confirmButtonText: '确定',
  2198. type: 'warning',
  2199. })
  2200. .then(() => {
  2201. this.$refs.deptBudgetList.validate((valid) => {
  2202. if (valid) {
  2203. this.deptBudgetList.compId = localStorage.getItem('ws-pf_compId')
  2204. this.deptBudgetList.secretaryWeigher =
  2205. localStorage.getItem('ws-pf_staffName')
  2206. this.deptBudgetList.inOutFlag = 2
  2207. this.deptBudgetList.statusFlag = 1
  2208. let _data = JSON.parse(
  2209. localStorage.getItem('winseaview-userInfo')
  2210. )
  2211. this.deptBudgetList.backOffice =
  2212. _data.content.showCompName + '-' + _data.content.staffName
  2213. this.deptBudgetList.grossWeight /= 1000
  2214. this.deptBudgetList.tare /= 1000
  2215. this.deptBudgetList.netWeight /= 1000
  2216. this.deptBudgetList.pureWeight /= 1000
  2217. this.deptBudgetList.deductionAmount *= 1000
  2218. this.deptBudgetList.deductionWeight /= 1000
  2219. addstorageputList(this.deptBudgetList)
  2220. .toPromise()
  2221. .then((response) => {
  2222. if (this.reader) {
  2223. this.reader.cancel()
  2224. }
  2225. this.$message.success('保存成功')
  2226. this.$router.push({
  2227. path: 'warehouseManagementList',
  2228. })
  2229. })
  2230. } else {
  2231. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  2232. return false
  2233. }
  2234. })
  2235. })
  2236. .catch(() => {
  2237. return false
  2238. })
  2239. },
  2240. tarechange(e) {
  2241. if (
  2242. this.deptBudgetList.grossWeight &&
  2243. this.deptBudgetList.tare &&
  2244. (this.deptBudgetList.deductionWeight ||
  2245. this.deptBudgetList.deductionWeight == 0)
  2246. ) {
  2247. this.deptBudgetList.netWeight = Number(
  2248. this.deptBudgetList.grossWeight -
  2249. this.deptBudgetList.tare -
  2250. this.deptBudgetList.deductionWeight
  2251. ).toFixed(2)
  2252. }
  2253. },
  2254. grossWeightchange(e) {
  2255. this.grossWeight = this.deptBudgetList.grossWeight
  2256. if (
  2257. this.deptBudgetList.grossWeight &&
  2258. this.deptBudgetList.tare &&
  2259. (this.deptBudgetList.deductionWeight ||
  2260. this.deptBudgetList.deductionWeight == 0)
  2261. ) {
  2262. this.deptBudgetList.netWeight = Number(
  2263. this.deptBudgetList.grossWeight -
  2264. this.deptBudgetList.tare -
  2265. this.deptBudgetList.deductionWeight
  2266. ).toFixed(2)
  2267. }
  2268. },
  2269. contractNoChange(e) {
  2270. this.disabled1 = true
  2271. for (let i = 0; i < this.deptBudgetList1.length; i++) {
  2272. console.log(this.deptBudgetList1[i])
  2273. if (this.deptBudgetList1[i].inOutTaskNo == e) {
  2274. var data = this.deptBudgetList1[i]
  2275. if (this.deptBudgetList1[i].contractNo) {
  2276. this.deptBudgetList.contractNo = this.deptBudgetList1[i].contractNo
  2277. } else {
  2278. this.deptBudgetList.contractNo = this.deptBudgetList1[i].moveTaskNo
  2279. }
  2280. }
  2281. }
  2282. for (var i = 0; i < this.outContractNo.length; i++) {
  2283. if (
  2284. this.outContractNo[i].contractNo == this.deptBudgetList.contractNo
  2285. ) {
  2286. console.log(this.outContractNo[i])
  2287. this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
  2288. this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
  2289. this.deptBudgetList.grade = this.outContractNo[i].grade
  2290. if (this.outContractNo[i].inOutType == '采购入库') {
  2291. if (!this.outContractNo[i].unitContractPrice) {
  2292. this.deptBudgetList.tips = '卖方' + this.outContractNo[i].seller
  2293. } else {
  2294. this.deptBudgetList.tips =
  2295. '卖方' +
  2296. this.outContractNo[i].seller +
  2297. '( ' +
  2298. this.outContractNo[i].unitContractPrice +
  2299. '元/吨)'
  2300. }
  2301. this.deptBudgetList.inOutTypeKey = 1
  2302. } else if (this.outContractNo[i].inOutType == '移库入库') {
  2303. this.deptBudgetList.goodsName = data.goodsName
  2304. this.deptBudgetList.goodsNameKey = data.goodsNameKey
  2305. this.deptBudgetList.grade = data.grade
  2306. if (this.outContractNo[i].unitContractPrice) {
  2307. this.deptBudgetList.tips =
  2308. '出货库' +
  2309. data.sendWarehouse +
  2310. ' (' +
  2311. this.outContractNo[i].unitContractPrice +
  2312. '元/吨)'
  2313. } else {
  2314. this.deptBudgetList.tips = '出货库' + data.sendWarehouse
  2315. }
  2316. this.deptBudgetList.inOutTypeKey = 3
  2317. } else if (this.outContractNo[i].inOutType == '移库出库') {
  2318. this.deptBudgetList.tips = '入货库' + data.receiveWarehouse
  2319. } else if (this.outContractNo[i].inOutType == '暂存入库') {
  2320. this.deptBudgetList.inOutTypeKey = 4
  2321. } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
  2322. this.deptBudgetList.inOutTypeKey = 5
  2323. } else if (this.outContractNo[i].inOutType == '退库') {
  2324. if (this.outContractNo[i].contractNo) {
  2325. this.deptBudgetList.tips = '买方' + this.outContractNo[i].buyer
  2326. } else {
  2327. this.deptBudgetList.tips = '出货库' + data.sendWarehouse
  2328. }
  2329. this.deptBudgetList.inOutTypeKey = 6
  2330. }
  2331. // this.deptBudgetList.cost = this.outContractNo[i].contractPrice
  2332. this.cost = this.outContractNo[i].contractPrice
  2333. if (this.cost) {
  2334. this.isGetCost = true
  2335. this.deptBudgetList.cost =
  2336. this.cost - this.deptBudgetList.deductionAmount
  2337. } else {
  2338. this.isGetCost = false
  2339. this.deptBudgetList.cost = this.deptBudgetList.cost
  2340. }
  2341. this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
  2342. if (this.outContractNo[i].inOutType == '移库入库') {
  2343. this.isSelectType = false
  2344. } else {
  2345. this.isSelectType = true
  2346. }
  2347. if (this.outContractNo[i].priceType == '随行就市') {
  2348. this.disabled1 = !this.disabled1
  2349. }
  2350. if (this.outContractNo[i].deliverType == '1') {
  2351. this.carstatus = true
  2352. } else {
  2353. this.carstatus = false
  2354. }
  2355. if (this.outContractNo[i].tranCarInfoList) {
  2356. this.options2 = this.outContractNo[i].tranCarInfoList
  2357. this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
  2358. // this.carstatus = true
  2359. }
  2360. }
  2361. }
  2362. },
  2363. contractNoChange1(e) {
  2364. for (var i = 0; i < this.outContractNo.length; i++) {
  2365. if (this.outContractNo[i].contractNo == e) {
  2366. if (this.outContractNo[i].inOutType == '采购入库') {
  2367. this.deptBudgetList.inOutTypeKey = 1
  2368. } else if (this.outContractNo[i].inOutType == '移库入库') {
  2369. this.deptBudgetList.inOutTypeKey = 3
  2370. } else if (this.outContractNo[i].inOutType == '暂存入库') {
  2371. this.deptBudgetList.inOutTypeKey = 4
  2372. } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
  2373. this.deptBudgetList.inOutTypeKey = 5
  2374. } else if (this.outContractNo[i].inOutType == '退库') {
  2375. this.deptBudgetList.inOutTypeKey = 6
  2376. }
  2377. this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
  2378. this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
  2379. this.deptBudgetList.grade = this.outContractNo[i].grade
  2380. // this.deptBudgetList.cost = this.outContractNo[i].contractPrice
  2381. this.cost = this.outContractNo[i].contractPrice
  2382. if (this.cost) {
  2383. this.isGetCost = true
  2384. this.deptBudgetList.cost =
  2385. this.cost - this.deptBudgetList.deductionAmount
  2386. } else {
  2387. this.isGetCost = false
  2388. this.deptBudgetList.cost = this.deptBudgetList.cost
  2389. }
  2390. this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
  2391. if (this.outContractNo[i].inOutType == '移库入库') {
  2392. this.isSelectType = false
  2393. } else {
  2394. this.isSelectType = true
  2395. }
  2396. if (this.outContractNo[i].deliverType == '1') {
  2397. this.carstatus = true
  2398. } else {
  2399. this.carstatus = false
  2400. }
  2401. if (this.outContractNo[i].tranCarInfoList) {
  2402. this.options2 = this.outContractNo[i].tranCarInfoList
  2403. this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
  2404. this.carstatus = true
  2405. }
  2406. }
  2407. }
  2408. this.$confirm(`是否保存毛重检斤`, {
  2409. cancelButtonText: '取消',
  2410. confirmButtonText: '确定',
  2411. type: 'warning',
  2412. })
  2413. .then(() => {
  2414. this.$refs.deptBudgetList.validate((valid) => {
  2415. if (valid) {
  2416. this.deptBudgetList.compId = localStorage.getItem('ws-pf_compId')
  2417. this.deptBudgetList.secretaryWeigher =
  2418. localStorage.getItem('ws-pf_staffName')
  2419. this.deptBudgetList.inOutFlag = 2
  2420. this.deptBudgetList.statusFlag = 1
  2421. let _data = JSON.parse(
  2422. localStorage.getItem('winseaview-userInfo')
  2423. )
  2424. this.deptBudgetList.backOffice =
  2425. _data.content.showCompName + '-' + _data.content.staffName
  2426. this.deptBudgetList.grossWeight /= 1000
  2427. this.deptBudgetList.tare /= 1000
  2428. this.deptBudgetList.netWeight /= 1000
  2429. this.deptBudgetList.pureWeight /= 1000
  2430. this.deptBudgetList.deductionAmount *= 1000
  2431. this.deptBudgetList.deductionWeight /= 1000
  2432. addstorageputList(this.deptBudgetList)
  2433. .toPromise()
  2434. .then((response) => {
  2435. if (this.reader) {
  2436. this.reader.cancel()
  2437. }
  2438. this.$message.success('保存成功')
  2439. this.$router.push({
  2440. path: 'warehouseManagementList',
  2441. })
  2442. })
  2443. } else {
  2444. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  2445. return false
  2446. }
  2447. })
  2448. })
  2449. .catch(() => {
  2450. return false
  2451. })
  2452. },
  2453. tarechange(e) {
  2454. if (
  2455. this.deptBudgetList.grossWeight &&
  2456. this.deptBudgetList.tare &&
  2457. (this.deptBudgetList.deductionWeight ||
  2458. this.deptBudgetList.deductionWeight == 0)
  2459. ) {
  2460. this.deptBudgetList.netWeight = Number(
  2461. this.deptBudgetList.grossWeight -
  2462. this.deptBudgetList.tare -
  2463. this.deptBudgetList.deductionWeight
  2464. ).toFixed(2)
  2465. }
  2466. },
  2467. grossWeightchange(e) {
  2468. this.grossWeight = this.deptBudgetList.grossWeight
  2469. if (
  2470. this.deptBudgetList.grossWeight &&
  2471. this.deptBudgetList.tare &&
  2472. (this.deptBudgetList.deductionWeight ||
  2473. this.deptBudgetList.deductionWeight == 0)
  2474. ) {
  2475. this.deptBudgetList.netWeight = Number(
  2476. this.deptBudgetList.grossWeight -
  2477. this.deptBudgetList.tare -
  2478. this.deptBudgetList.deductionWeight
  2479. ).toFixed(2)
  2480. }
  2481. },
  2482. contractNoChange(e) {
  2483. this.disabled1 = true
  2484. for (let i = 0; i < this.deptBudgetList1.length; i++) {
  2485. console.log(this.deptBudgetList1[i])
  2486. if (this.deptBudgetList1[i].inOutTaskNo == e) {
  2487. var data = this.deptBudgetList1[i]
  2488. if (this.deptBudgetList1[i].contractNo) {
  2489. this.deptBudgetList.contractNo = this.deptBudgetList1[i].contractNo
  2490. } else {
  2491. this.deptBudgetList.contractNo = this.deptBudgetList1[i].moveTaskNo
  2492. }
  2493. }
  2494. }
  2495. if(!data) return
  2496. for (var i = 0; i < this.outContractNo.length; i++) {
  2497. if (
  2498. this.outContractNo[i].contractNo == this.deptBudgetList.contractNo
  2499. ) {
  2500. console.log(this.outContractNo[i])
  2501. this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
  2502. this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
  2503. this.deptBudgetList.grade = this.outContractNo[i].grade
  2504. if (this.outContractNo[i].inOutType == '采购入库') {
  2505. if (!this.outContractNo[i].unitContractPrice) {
  2506. this.deptBudgetList.tips = '卖方' + this.outContractNo[i].seller
  2507. } else {
  2508. this.deptBudgetList.tips =
  2509. '卖方' +
  2510. this.outContractNo[i].seller +
  2511. '( ' +
  2512. this.outContractNo[i].unitContractPrice +
  2513. '元/吨)'
  2514. }
  2515. this.deptBudgetList.inOutTypeKey = 1
  2516. } else if (this.outContractNo[i].inOutType == '移库入库') {
  2517. this.deptBudgetList.goodsName = data.goodsName
  2518. this.deptBudgetList.goodsNameKey = data.goodsNameKey
  2519. this.deptBudgetList.grade = data.grade
  2520. if (this.outContractNo[i].unitContractPrice) {
  2521. this.deptBudgetList.tips =
  2522. '出货库' +
  2523. data.sendWarehouse +
  2524. ' (' +
  2525. this.outContractNo[i].unitContractPrice +
  2526. '元/吨)'
  2527. } else {
  2528. this.deptBudgetList.tips = '出货库' + data.sendWarehouse
  2529. }
  2530. this.deptBudgetList.inOutTypeKey = 3
  2531. } else if (this.outContractNo[i].inOutType == '移库出库') {
  2532. this.deptBudgetList.tips = '入货库' + data.receiveWarehouse
  2533. } else if (this.outContractNo[i].inOutType == '暂存入库') {
  2534. this.deptBudgetList.inOutTypeKey = 4
  2535. } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
  2536. this.deptBudgetList.inOutTypeKey = 5
  2537. } else if (this.outContractNo[i].inOutType == '退库') {
  2538. if (this.outContractNo[i].contractNo) {
  2539. this.deptBudgetList.tips = '买方' + this.outContractNo[i].buyer
  2540. } else {
  2541. this.deptBudgetList.tips = '出货库' + data.sendWarehouse
  2542. }
  2543. this.deptBudgetList.inOutTypeKey = 6
  2544. }
  2545. // this.deptBudgetList.cost = this.outContractNo[i].contractPrice
  2546. this.cost = this.outContractNo[i].contractPrice
  2547. if (this.cost) {
  2548. this.isGetCost = true
  2549. this.deptBudgetList.cost =
  2550. this.cost - this.deptBudgetList.deductionAmount
  2551. } else {
  2552. this.isGetCost = false
  2553. this.deptBudgetList.cost = this.deptBudgetList.cost
  2554. }
  2555. this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
  2556. if (this.outContractNo[i].inOutType == '移库入库') {
  2557. this.isSelectType = false
  2558. } else {
  2559. this.isSelectType = true
  2560. }
  2561. if (this.outContractNo[i].priceType == '随行就市') {
  2562. this.disabled1 = !this.disabled1
  2563. }
  2564. if (this.outContractNo[i].deliverType == '1') {
  2565. this.carstatus = true
  2566. } else {
  2567. this.carstatus = false
  2568. }
  2569. if (this.outContractNo[i].tranCarInfoList) {
  2570. this.options2 = this.outContractNo[i].tranCarInfoList
  2571. this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
  2572. // this.carstatus = true
  2573. }
  2574. }
  2575. }
  2576. },
  2577. contractNoChange1(e) {
  2578. for (var i = 0; i < this.outContractNo.length; i++) {
  2579. if (this.outContractNo[i].contractNo == e) {
  2580. if (this.outContractNo[i].inOutType == '采购入库') {
  2581. this.deptBudgetList.inOutTypeKey = 1
  2582. } else if (this.outContractNo[i].inOutType == '移库入库') {
  2583. this.deptBudgetList.inOutTypeKey = 3
  2584. } else if (this.outContractNo[i].inOutType == '暂存入库') {
  2585. this.deptBudgetList.inOutTypeKey = 4
  2586. } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
  2587. this.deptBudgetList.inOutTypeKey = 5
  2588. } else if (this.outContractNo[i].inOutType == '退库') {
  2589. this.deptBudgetList.inOutTypeKey = 6
  2590. }
  2591. this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
  2592. this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
  2593. this.deptBudgetList.grade = this.outContractNo[i].grade
  2594. // this.deptBudgetList.cost = this.outContractNo[i].contractPrice
  2595. this.cost = this.outContractNo[i].contractPrice
  2596. if (this.cost) {
  2597. this.isGetCost = true
  2598. this.deptBudgetList.cost =
  2599. this.cost - this.deptBudgetList.deductionAmount
  2600. } else {
  2601. this.isGetCost = false
  2602. this.deptBudgetList.cost = this.deptBudgetList.cost
  2603. }
  2604. this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
  2605. if (this.outContractNo[i].inOutType == '移库入库') {
  2606. this.isSelectType = false
  2607. } else {
  2608. this.isSelectType = true
  2609. }
  2610. if (this.outContractNo[i].deliverType == '1') {
  2611. this.carstatus = true
  2612. } else {
  2613. this.carstatus = false
  2614. }
  2615. if (this.outContractNo[i].tranCarInfoList) {
  2616. this.options2 = this.outContractNo[i].tranCarInfoList
  2617. this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
  2618. this.carstatus = true
  2619. }
  2620. }
  2621. }
  2622. },
  2623. typeChange(e) {},
  2624. pureweight(status) {
  2625. console.log(this.deptBudgetList)
  2626. if (
  2627. this.deptBudgetList.netWeight &&
  2628. this.deptBudgetList.tidalGrainWater &&
  2629. this.deptBudgetList.solidGrainWater &&
  2630. this.deptBudgetList.buckleWeightRatio
  2631. ) {
  2632. this.deptBudgetList.pureWeight =
  2633. (this.deptBudgetList.netWeight *
  2634. (100 -
  2635. (this.deptBudgetList.tidalGrainWater -
  2636. this.deptBudgetList.solidGrainWater) *
  2637. this.deptBudgetList.buckleWeightRatio)) /
  2638. 100
  2639. }
  2640. },
  2641. selectgoodsName(e) {
  2642. for (var i = 0; i < this.goodnameList.length; i++) {
  2643. if (this.goodnameList[i].constValue == e) {
  2644. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  2645. if (e == '玉米(潮粮)') {
  2646. this.deptBudgetList.type = '潮粮'
  2647. } else {
  2648. this.deptBudgetList.type = '干粮'
  2649. }
  2650. }
  2651. }
  2652. },
  2653. selectpackingMethod(e) {
  2654. for (var i = 0; i < this.packtypeList.length; i++) {
  2655. if (this.packtypeList[i].constValue == e) {
  2656. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  2657. }
  2658. }
  2659. },
  2660. selectstorageType(e) {
  2661. for (var i = 0; i < this.storageType.length; i++) {
  2662. if (this.storageType[i].constValue == e) {
  2663. this.deptBudgetList.inOutTypeKey = this.storageType[i].constKey
  2664. }
  2665. }
  2666. },
  2667. handleClose() {
  2668. this.accessoryTFs = false
  2669. },
  2670. handleSizeChange(val) {
  2671. console.log(`每页 ${val} 条`)
  2672. this.pageSize = val
  2673. this.getList()
  2674. },
  2675. handleCurrentChange(val) {
  2676. this.currentPage = val
  2677. console.log(`当前页: ${val}`)
  2678. this.getList()
  2679. },
  2680. getList() {
  2681. // 货名
  2682. pullDown({
  2683. constId: 'CON2',
  2684. })
  2685. .toPromise()
  2686. .then((response) => {
  2687. this.goodnameList = response
  2688. })
  2689. // 品级
  2690. pullDown({
  2691. constId: 'CON3',
  2692. })
  2693. .toPromise()
  2694. .then((response) => {
  2695. this.gradeList = response
  2696. })
  2697. // 类型
  2698. if (this.deptBudgetList.warehouseType == '1') {
  2699. this.storageType = []
  2700. pullDown({
  2701. constId: 'CON5',
  2702. })
  2703. .toPromise()
  2704. .then((response) => {
  2705. // this.storageType = response
  2706. for (let i = 0; i < response.length; i++) {
  2707. if (
  2708. response[i].constValue == '移库入库' ||
  2709. response[i].constValue == '退库'
  2710. ) {
  2711. this.storageType.push(response[i])
  2712. }
  2713. }
  2714. })
  2715. } else if (this.deptBudgetList.warehouseType == '2') {
  2716. pullDown({
  2717. constId: 'WARE1',
  2718. })
  2719. .toPromise()
  2720. .then((response) => {
  2721. this.storageType = response
  2722. })
  2723. pullDown({
  2724. constId: 'WARE2',
  2725. })
  2726. .toPromise()
  2727. .then((response) => {
  2728. this.deliveryType = response
  2729. })
  2730. }
  2731. //合同编号
  2732. xialaNo({
  2733. compId: localStorage.getItem('ws-pf_compId'),
  2734. flag: 7,
  2735. })
  2736. .toPromise()
  2737. .then((response) => {
  2738. this.options1 = response
  2739. this.outContractNo = response
  2740. })
  2741. //经办人
  2742. getstaff({
  2743. compId: localStorage.getItem('ws-pf_compId'),
  2744. warehouseId: this.deptBudgetList.baseId,
  2745. })
  2746. .toPromise()
  2747. .then((response) => {
  2748. this.options = response
  2749. this.qualityInspectorList = response
  2750. this.staffList = response
  2751. // this.agent = response
  2752. })
  2753. },
  2754. selecttaskType(e) {
  2755. for (var i = 0; i < this.taskTypeList.length; i++) {
  2756. if (this.taskTypeList[i].value == e) {
  2757. this.searchType = this.taskTypeList[i].type
  2758. }
  2759. }
  2760. },
  2761. fujian(row) {
  2762. if (
  2763. row.receiveAttachmentPath === null ||
  2764. row.receiveAttachmentPath === ''
  2765. ) {
  2766. EventBus.$emit(
  2767. 'warning',
  2768. this.$t('system.noticeCircular.NoInformation')
  2769. )
  2770. } else {
  2771. this.accessoryTFs = true
  2772. }
  2773. this.appendixIdss = row.receiveAttachmentPath
  2774. },
  2775. handleExamine(row) {
  2776. this.$router.push({
  2777. name: 'salesContractExamine',
  2778. query: {
  2779. id: row.id,
  2780. },
  2781. })
  2782. },
  2783. },
  2784. }
  2785. </script>
  2786. <style lang="scss" scoped>
  2787. /deep/.basicInformation {
  2788. .ws-info-table {
  2789. border: none;
  2790. }
  2791. .left {
  2792. .el-form-item {
  2793. width: 50%;
  2794. // width: 33.3333%;
  2795. border: none;
  2796. .el-form-item__label {
  2797. background: transparent;
  2798. border: none;
  2799. }
  2800. .el-form-item__content {
  2801. border: none;
  2802. }
  2803. }
  2804. }
  2805. .right {
  2806. .el-form-item {
  2807. width: 100%;
  2808. // width: 33.3333%;
  2809. border: none;
  2810. .el-form-item__label {
  2811. background: transparent;
  2812. border: none;
  2813. }
  2814. .el-form-item__content {
  2815. border: none;
  2816. }
  2817. }
  2818. }
  2819. }
  2820. .title {
  2821. position: relative;
  2822. padding-left: 10px;
  2823. }
  2824. .title::before {
  2825. content: '';
  2826. display: inline-block;
  2827. width: 5px;
  2828. height: 30px;
  2829. background: #5473e8;
  2830. position: absolute;
  2831. left: 0;
  2832. }
  2833. .el-form {
  2834. padding: 0 10%;
  2835. }
  2836. .el-button--primary {
  2837. background-color: #5878e8;
  2838. border-color: #5878e8;
  2839. }
  2840. .el-col {
  2841. background: #f6f7fc;
  2842. }
  2843. .bg-right {
  2844. text-align: right;
  2845. padding: 16px 20px;
  2846. }
  2847. .center {
  2848. position: relative;
  2849. top: 50px;
  2850. width: 40%;
  2851. height: 2000px;
  2852. margin: 0 auto;
  2853. }
  2854. //选填
  2855. /deep/.el-form-item {
  2856. width: 50%;
  2857. }
  2858. /deep/.ws-info-table .el-form-item .el-form-item__label {
  2859. text-align: center;
  2860. }
  2861. .deliverydate {
  2862. display: inline-block;
  2863. width: 10%;
  2864. }
  2865. .center {
  2866. margin-top: -60px;
  2867. width: 80%;
  2868. }
  2869. //仓位
  2870. .position {
  2871. background: #afb5cb;
  2872. border-radius: 2px;
  2873. font-size: 12px;
  2874. color: #ffffff;
  2875. line-height: 20px;
  2876. display: inline-grid;
  2877. padding: 2px 4px;
  2878. }
  2879. //表格文字
  2880. /deep/.ws-info-table .el-form-item .el-form-item__label {
  2881. text-align: left;
  2882. font-size: 14px;
  2883. font-family: PingFangSC-Regular, PingFang SC;
  2884. font-weight: 400;
  2885. color: #8890b1;
  2886. line-height: 16px;
  2887. }
  2888. .inspector {
  2889. width: 50%;
  2890. }
  2891. //质检员
  2892. .inspector .el-form-item__content {
  2893. text-align: left;
  2894. margin-left: 0px;
  2895. }
  2896. .small-title {
  2897. position: relative;
  2898. padding: 10px;
  2899. font-weight: 600;
  2900. }
  2901. .small-title::before {
  2902. position: absolute;
  2903. content: '';
  2904. display: block;
  2905. background: #5473e8;
  2906. width: 4px;
  2907. height: 14px;
  2908. left: 0px;
  2909. top: 13px;
  2910. padding: 4px 2px;
  2911. }
  2912. //下面列表
  2913. .neifor {
  2914. width: 80%;
  2915. background-color: #f6f7fc;
  2916. }
  2917. /deep/.neifor .ws-info-table .el-form-item .el-form-item__label {
  2918. width: 35%;
  2919. text-align: center;
  2920. }
  2921. /deep/.neifor .ws-info-table .el-form-item .el-form-item__content {
  2922. width: 60%;
  2923. background-color: #f6f7fc;
  2924. }
  2925. /deep/.neifor .el-input--small .el-input__inner {
  2926. width: 100%;
  2927. }
  2928. .balance-row {
  2929. display: flex;
  2930. margin: 20px 0;
  2931. position: relative;
  2932. .left {
  2933. width: 90%;
  2934. // background: red;
  2935. // width: 500px;
  2936. margin-bottom: 0;
  2937. }
  2938. .top {
  2939. position: absolute;
  2940. top: 125px;
  2941. width: 87%;
  2942. background: black;
  2943. color: #2aff7c;
  2944. font-size: 32px;
  2945. text-align: right;
  2946. // padding: 20px;
  2947. border-radius: 10px;
  2948. margin: 0 20px 0px 40px;
  2949. .car-type {
  2950. text-align: left;
  2951. }
  2952. .confirmInfo {
  2953. display: flex;
  2954. .confirmWeight {
  2955. width: 50%;
  2956. text-align: left;
  2957. line-height: 90px;
  2958. }
  2959. .weight {
  2960. font-size: 68px;
  2961. width: 50%;
  2962. text-align: right;
  2963. }
  2964. .confirmCarNo {
  2965. width: 50%;
  2966. text-align: left;
  2967. }
  2968. .car-no {
  2969. width: 50%;
  2970. text-align: right;
  2971. }
  2972. }
  2973. .kg-style {
  2974. font-size: 30px;
  2975. }
  2976. }
  2977. }
  2978. </style>