warehouseManagementGross.vue 83 KB

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