warehouseManagementNoWeightIn.vue 64 KB

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