warehouseManagementGross.vue 95 KB

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