warehouseManagementGross.vue 84 KB

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