warehouseManagementNoWeightIn.vue 64 KB

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