warehouseManagementNoWeightIn.vue 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914
  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. {{ 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. tare:"",
  537. }
  538. },
  539. mounted() {},
  540. activated() {
  541. if (this.$route.query.allowEdit == 1) {
  542. this.allowEdit = false
  543. } else {
  544. this.allowEdit = true
  545. }
  546. this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
  547. this.deptBudgetList1.binNumber = this.$route.query.binNumber
  548. this.dataList.id = this.$route.query.id
  549. this.dataList.grossWeight = Math.round(this.$route.query.grossWeight * 1000)
  550. this.dataList.contractNo = this.$route.query.contractNo
  551. this.dataList.baseId = this.$route.query.baseId
  552. this.dataList.positionId = this.$route.query.positionId
  553. this.dataList.warehouseName = this.$route.query.warehouseName
  554. this.dataList.binNumber = this.$route.query.binNumber
  555. this.dataList.tare = Math.round(this.$route.query.tare * 1000)
  556. this.tare = this.dataList.tare
  557. this.dataList.netWeight = Math.round(this.$route.query.netWeight * 1000)
  558. this.dataList.grade = this.$route.query.grade
  559. this.dataList.agent = this.$route.query.agent
  560. this.dataList.boxNo = this.$route.query.boxNo
  561. this.dataList.boxNoOther = this.$route.query.boxNoOther
  562. this.dataList.titleNo = this.$route.query.titleNo
  563. this.dataList.titleNoOther = this.$route.query.titleNoOther
  564. this.dataList.carNo = this.$route.query.carNo
  565. this.dataList.inOutDate = this.$route.query.inOutDate
  566. this.dataList.contractNo = this.$route.query.contractNo
  567. this.dataList.inOutType = this.$route.query.inOutType
  568. this.dataList.compId = this.$route.query.compId
  569. this.dataList.goodsName = this.$route.query.goodsName
  570. this.dataList.goodsNameKey = Number(this.$route.query.goodsNameKey)
  571. this.dataList.inOutFlag = this.$route.inOutFlag
  572. this.dataList.inOutTypeKey = Number(this.$route.query.inOutTypeKey)
  573. this.dataList.statusFlag = this.$route.statusFlag
  574. this.dataList.warehouseInOutDetail = this.$route.query.warehouseInOutDetail
  575. this.dataList.warehouseType = this.$route.query.warehouseType
  576. this.dataList.createType = this.$route.query.createType
  577. this.dataList.temporaryOutType = this.$route.query.temporaryOutType
  578. this.dataList.cost = this.$route.query.cost
  579. this.dataList.freight = this.$route.query.freight
  580. this.dataList.type = this.$route.query.type
  581. this.dataList.buckleWeightRatio = this.$route.query.buckleWeightRatio
  582. this.dataList.tidalGrainWater = this.$route.query.tidalGrainWater
  583. this.dataList.solidGrainWater = this.$route.query.solidGrainWater
  584. this.dataList.pureWeight = Math.round(this.$route.query.pureWeight * 1000)
  585. this.dataList.deductionAmount = this.$route.query.deductionAmount / 1000
  586. this.dataList.deductionWeight = Math.round(
  587. this.$route.query.deductionWeight * 1000
  588. )
  589. this.dataList.inOutTypeFlag = 1
  590. this.dataList.inOutTaskNo = this.$route.query.inOutTaskNo
  591. if (this.dataList.cost) {
  592. this.isGetCost = true
  593. this.cost = this.dataList.cost
  594. }
  595. this.getList()
  596. if (this.$route.query.automaticWeightAcquisition == '1') {
  597. this.isShowBalance = true
  598. }
  599. },
  600. methods: {
  601. setVal(data) {
  602. if (this.information == '毛重检斤') {
  603. this.dataList.grossWeight = data
  604. } else {
  605. this.dataList.tare = data
  606. }
  607. },
  608. openPort() {
  609. this.$refs.weightChild.openPort()
  610. },
  611. kkInput(val) {
  612. console.log(val)
  613. if (this.isGetCost) {
  614. if (this.dataList.cost > val) {
  615. this.dataList.cost = this.cost - this.dataList.deductionAmount
  616. }
  617. }
  618. },
  619. qualityInspectorChange(e) {
  620. console.log(e)
  621. },
  622. uploadSuccessHandle1(res) {
  623. this.dataList.addressUrl = res.url
  624. },
  625. pureweight(status) {
  626. console.log(this.dataList)
  627. if (
  628. this.dataList.netWeight &&
  629. this.dataList.tidalGrainWater &&
  630. this.dataList.solidGrainWater &&
  631. this.dataList.buckleWeightRatio
  632. ) {
  633. this.dataList.pureWeight =
  634. (this.dataList.netWeight *
  635. (100 -
  636. (this.dataList.tidalGrainWater - this.dataList.solidGrainWater) *
  637. this.dataList.buckleWeightRatio)) /
  638. 100
  639. }
  640. },
  641. //返回按钮
  642. revert() {
  643. this.$router.go(-1)
  644. },
  645. carChange(e) {
  646. for (let i = 0; i < this.tranCarInfoList.length; i++) {
  647. if (this.tranCarInfoList[i].carNo == this.dataList.carNo) {
  648. this.dataList.tranCarNo = this.tranCarInfoList[i].tranCarNo
  649. this.dataList.freight = this.tranCarInfoList[i].tranPrice
  650. }
  651. if(this.dataList.inOutType=='移库入库'){
  652. if(!this.dataList.cost){
  653. this.dataList.cost=this.tranCarInfoList[i].cost
  654. }
  655. this.dataList.loadNetWeight=this.tranCarInfoList[i].loadNetWeight
  656. }
  657. }
  658. },
  659. typeChange(e) {},
  660. contractNoChange(e) {
  661. for (let i = 0; i < this.deptBudgetList2.length; i++) {
  662. if (this.deptBudgetList2[i].inOutTaskNo == e) {
  663. var data = this.deptBudgetList2[i]
  664. if (this.deptBudgetList2[i].contractNo) {
  665. this.dataList.contractNo = this.deptBudgetList2[i].contractNo
  666. } else {
  667. this.dataList.contractNo = this.deptBudgetList2[i].moveTaskNo
  668. }
  669. }
  670. }
  671. for (var i = 0; i < this.outContractNo.length; i++) {
  672. if (this.outContractNo[i].contractNo == this.dataList.contractNo) {
  673. if (this.outContractNo[i].inOutType == '采购入库') {
  674. this.dataList.tips =
  675. '卖方' +
  676. this.outContractNo[i].seller +
  677. '( ' +
  678. this.outContractNo[i].unitContractPrice +
  679. '元/吨)'
  680. this.dataList.inOutTypeKey = 1
  681. } else if (this.outContractNo[i].inOutType == '移库入库') {
  682. if (this.outContractNo[i].unitContractPrice) {
  683. this.dataList.tips =
  684. '出货库' +
  685. data.sendWarehouse +
  686. ' (' +
  687. this.outContractNo[i].unitContractPrice +
  688. '元/吨)'
  689. } else {
  690. this.dataList.tips = '出货库' + data.sendWarehouse
  691. }
  692. this.dataList.inOutTypeKey = 3
  693. } else if (this.outContractNo[i].inOutType == '移库出库') {
  694. this.dataList.tips = '出货库' + data.warehouseName
  695. } else if (this.outContractNo[i].inOutType == '暂存入库') {
  696. this.dataList.inOutTypeKey = 4
  697. } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
  698. this.dataList.inOutTypeKey = 5
  699. } else if (this.outContractNo[i].inOutType == '退库') {
  700. if (this.outContractNo[i].contractNo) {
  701. this.dataList.tips = '买方' + this.outContractNo[i].buyer
  702. } else {
  703. this.dataList.tips = '出货库' + data.sendWarehouse
  704. }
  705. this.dataList.inOutTypeKey = 6
  706. }
  707. this.dataList.goodsName = this.outContractNo[i].goodsName
  708. this.dataList.goodsNameKey = this.outContractNo[i].goodsNameKey
  709. this.cost = this.outContractNo[i].contractPrice
  710. if (this.cost) {
  711. this.isGetCost = true
  712. this.dataList.cost = this.cost - this.dataList.deductionAmount
  713. } else {
  714. this.isGetCost = false
  715. this.dataList.cost = this.dataList.cost
  716. }
  717. this.dataList.inOutType = this.outContractNo[i].inOutType
  718. if (this.outContractNo[i].inOutType == '移库入库') {
  719. this.isSelectType = false
  720. } else {
  721. this.isSelectType = true
  722. }
  723. if (this.outContractNo[i].deliverType == '1') {
  724. this.carstatus = true
  725. } else {
  726. this.carstatus = false
  727. }
  728. if (this.outContractNo[i].tranCarInfoList) {
  729. this.options2 = this.outContractNo[i].tranCarInfoList
  730. this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
  731. // this.carstatus = true
  732. }
  733. }
  734. }
  735. },
  736. dataFilter1(val) {
  737. console.log(val)
  738. this.dataList.contractNo = val
  739. if (val) {
  740. //val存在
  741. this.options1 = this.outContractNo1.filter((item) => {
  742. if (
  743. !!~item.contractNo.indexOf(val) ||
  744. !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())
  745. ) {
  746. return true
  747. }
  748. })
  749. } else {
  750. //val为空时,还原数组
  751. this.options1 = this.outContractNo
  752. }
  753. },
  754. dataFilter2(val) {
  755. this.dataList.carNo = val
  756. if (val) {
  757. //val存在
  758. this.options1 = this.outContractNo1.filter((item) => {
  759. if (
  760. !!~item.carNo.indexOf(val) ||
  761. !!~item.carNo.toUpperCase().indexOf(val.toUpperCase())
  762. ) {
  763. return true
  764. }
  765. })
  766. } else {
  767. //val为空时,还原数组
  768. this.options2 = this.tranCarInfoList
  769. }
  770. },
  771. dataFilter(val) {
  772. // console.log(val,"名")
  773. this.dataList.staffList = val
  774. if (val) {
  775. //val存在
  776. this.options = this.staffList.filter((item) => {
  777. if (
  778. !!~item.staffName.indexOf(val) ||
  779. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  780. ) {
  781. return true
  782. }
  783. })
  784. } else {
  785. //val为空时,还原数组
  786. this.options = this.staffList
  787. }
  788. },
  789. editClick(status) {
  790. this.isGetCost = false
  791. if (status == 1) {
  792. this.disabled1 = !this.disabled1
  793. } else {
  794. this.disabled2 = !this.disabled2
  795. }
  796. },
  797. selectstaff(e) {
  798. for (var i = 0; i < this.staffList.length; i++) {
  799. if (this.staffList[i].staffName == e) {
  800. this.dataList.personChargeKey = this.staffList[i].staffId
  801. }
  802. }
  803. },
  804. //暂存按钮
  805. temporaryStorage() {
  806. this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
  807. cancelButtonText: '取消',
  808. confirmButtonText: '确定',
  809. type: 'warning',
  810. })
  811. .then(() => {
  812. this.$refs.dataList.validate((valid) => {
  813. if (valid) {
  814. this.dataList.compId = localStorage.getItem('ws-pf_compId')
  815. this.dataList.inOutFlag = 2
  816. this.dataList.statusFlag = 1
  817. let _data = JSON.parse(
  818. localStorage.getItem('winseaview-userInfo')
  819. )
  820. this.dataList.backOffice =
  821. _data.content.showCompName + '-' + _data.content.staffName
  822. addstorageputList(this.dataList)
  823. .toPromise()
  824. .then((response) => {
  825. this.$message.success('暂存成功')
  826. this.$router.push({
  827. path: 'warehouseManagementList',
  828. })
  829. })
  830. } else {
  831. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  832. return false
  833. }
  834. })
  835. })
  836. .catch(() => {
  837. return false
  838. })
  839. },
  840. //提交按钮
  841. submit() {
  842. if (this.reader) {
  843. this.reader.cancel()
  844. }
  845. if (!this.dataList.goodsName) {
  846. this.$message({
  847. message: '货名不能为空',
  848. type: 'warning',
  849. })
  850. return
  851. }
  852. if (!this.dataList.grossWeight) {
  853. this.$message({
  854. message: '毛重不能为空',
  855. type: 'warning',
  856. })
  857. return
  858. }
  859. if (
  860. this.dataList.grossWeight <= 0 ||
  861. this.dataList.grossWeight > 300000 ||
  862. (String(this.dataList.grossWeight).indexOf('.') != -1 &&
  863. String(this.dataList.grossWeight).length -
  864. (String(this.dataList.grossWeight).indexOf('.') + 1) >
  865. 3)
  866. ) {
  867. this.$message({
  868. message: '毛重输入错误',
  869. type: 'warning',
  870. })
  871. return
  872. }
  873. if (
  874. this.dataList.tare < 0 ||
  875. this.dataList.tare > 200000 ||
  876. (String(this.dataList.tare).indexOf('.') != -1 &&
  877. String(this.dataList.tare).length -
  878. (String(this.dataList.tare).indexOf('.') + 1) >
  879. 3)
  880. ) {
  881. this.$message({
  882. message: '皮重输入错误',
  883. type: 'warning',
  884. })
  885. return
  886. }
  887. if (
  888. this.dataList.deductionWeight < 0 ||
  889. this.dataList.deductionWeight > 10000 ||
  890. (String(this.dataList.deductionWeight).indexOf('.') != -1 &&
  891. String(this.dataList.deductionWeight).length -
  892. (String(this.dataList.deductionWeight).indexOf('.') + 1) >
  893. 3)
  894. ) {
  895. this.$message({
  896. message: '扣重输入错误',
  897. type: 'warning',
  898. })
  899. return
  900. }
  901. if (this.dataList.type == '潮粮' && !this.dataList.buckleWeightRatio) {
  902. this.$message({
  903. message: '扣重比不能为空',
  904. type: 'warning',
  905. })
  906. return
  907. }
  908. if (
  909. (this.dataList.type == '潮粮' && this.dataList.buckleWeightRatio < 0) ||
  910. (this.dataList.type == '潮粮' && this.dataList.buckleWeightRatio > 3) ||
  911. (this.dataList.type == '潮粮' &&
  912. String(this.dataList.buckleWeightRatio).indexOf('.') != -1 &&
  913. String(this.dataList.buckleWeightRatio).length -
  914. (String(this.dataList.buckleWeightRatio).indexOf('.') + 1) >
  915. 2)
  916. ) {
  917. this.$message({
  918. message: '扣重比输入错误',
  919. type: 'warning',
  920. })
  921. return
  922. }
  923. if (this.dataList.type == '潮粮' && !this.dataList.tidalGrainWater) {
  924. this.$message({
  925. message: '潮粮水分不能为空',
  926. type: 'warning',
  927. })
  928. return
  929. }
  930. if (
  931. (this.dataList.type == '潮粮' && this.dataList.tidalGrainWater < 1) ||
  932. (this.dataList.type == '潮粮' && this.dataList.tidalGrainWater > 40) ||
  933. (this.dataList.type == '潮粮' &&
  934. String(this.dataList.tidalGrainWater).indexOf('.') != -1 &&
  935. String(this.dataList.tidalGrainWater).length -
  936. (String(this.dataList.tidalGrainWater).indexOf('.') + 1) >
  937. 2)
  938. ) {
  939. this.$message({
  940. message: '潮粮水分输入错误',
  941. type: 'warning',
  942. })
  943. return
  944. }
  945. if (this.dataList.type == '潮粮' && !this.dataList.solidGrainWater) {
  946. this.$message({
  947. message: '干粮水分不能为空',
  948. type: 'warning',
  949. })
  950. return
  951. }
  952. if (
  953. (this.dataList.type == '潮粮' && this.dataList.solidGrainWater < 1) ||
  954. (this.dataList.type == '潮粮' && this.dataList.solidGrainWater > 40) ||
  955. (this.dataList.type == '潮粮' &&
  956. String(this.dataList.solidGrainWater).indexOf('.') != -1 &&
  957. String(this.dataList.solidGrainWater).length -
  958. (String(this.dataList.solidGrainWater).indexOf('.') + 1) >
  959. 1)
  960. ) {
  961. this.$message({
  962. message: '干粮水分输入错误',
  963. type: 'warning',
  964. })
  965. return
  966. }
  967. if (
  968. this.dataList.deductionAmount < 0 ||
  969. this.dataList.deductionAmount > 10000 ||
  970. (String(this.dataList.deductionAmount).indexOf('.') != -1 &&
  971. String(this.dataList.deductionAmount).length -
  972. (String(this.dataList.deductionAmount).indexOf('.') + 1) >
  973. 2)
  974. ) {
  975. this.$message({
  976. message: '扣款输入错误',
  977. type: 'warning',
  978. })
  979. return
  980. }
  981. if (!this.dataList.cost) {
  982. this.$message({
  983. message: '未获取到成本,请编辑后提交',
  984. type: 'warning',
  985. })
  986. return
  987. }
  988. if (
  989. this.dataList.cost < 0 ||
  990. this.dataList.cost > 20000 ||
  991. (String(this.dataList.cost).indexOf('.') != -1 &&
  992. String(this.dataList.cost).length -
  993. (String(this.dataList.cost).indexOf('.') + 1) >
  994. 2)
  995. ) {
  996. this.$message({
  997. message: '成本输入错误',
  998. type: 'warning',
  999. })
  1000. return
  1001. }
  1002. if (!this.dataList.freight && this.dataList.freight != 0) {
  1003. this.$message({
  1004. message: '运费不能为空',
  1005. type: 'warning',
  1006. })
  1007. return
  1008. }
  1009. if (
  1010. this.dataList.freight < 0 ||
  1011. this.dataList.freight > 100000 ||
  1012. (String(this.dataList.freight).indexOf('.') != -1 &&
  1013. String(this.dataList.freight).length -
  1014. (String(this.dataList.freight).indexOf('.') + 1) >
  1015. 2)
  1016. ) {
  1017. this.$message({
  1018. message: '运费输入错误',
  1019. type: 'warning',
  1020. })
  1021. return
  1022. }
  1023. if (!this.dataList.agent) {
  1024. this.$message({
  1025. message: '经办人不能为空',
  1026. type: 'warning',
  1027. })
  1028. return
  1029. }
  1030. if (this.dataList.agent.length < 2 || this.dataList.agent.length > 10) {
  1031. this.$message({
  1032. message: '经办人输入有误',
  1033. type: 'warning',
  1034. })
  1035. return
  1036. }
  1037. if (!this.dataList.grade) {
  1038. this.$message({
  1039. message: '品级不能为空!',
  1040. type: 'warning',
  1041. })
  1042. return
  1043. }
  1044. if (!this.dataList.inOutDate) {
  1045. this.$message({
  1046. message: '入库日期不能为空!',
  1047. type: 'warning',
  1048. })
  1049. return
  1050. }
  1051. if (!this.dataList.inOutType) {
  1052. this.$message({
  1053. message: '入库类型不能为空!',
  1054. type: 'warning',
  1055. })
  1056. return
  1057. }
  1058. if (!this.dataList.carNo) {
  1059. this.$message({
  1060. message: '车牌号不能为空',
  1061. type: 'warning',
  1062. })
  1063. return
  1064. }
  1065. if (this.dataList.carNo.length > 7) {
  1066. this.$message({
  1067. message: '车牌号输入错误,请输入7个字符之内',
  1068. type: 'warning',
  1069. })
  1070. return
  1071. }
  1072. if (this.dataList.boxNo && this.dataList.boxNo.length > 20) {
  1073. this.$message({
  1074. message: '箱号-1输入错误',
  1075. type: 'warning',
  1076. })
  1077. return
  1078. }
  1079. if (this.dataList.boxNoOther && this.dataList.boxNoOther.length > 20) {
  1080. this.$message({
  1081. message: '箱号-2输入错误',
  1082. type: 'warning',
  1083. })
  1084. return
  1085. }
  1086. if (this.dataList.titleNo && this.dataList.titleNo.length > 20) {
  1087. this.$message({
  1088. message: '封号-1输入错误',
  1089. type: 'warning',
  1090. })
  1091. return
  1092. }
  1093. if (
  1094. this.dataList.titleNoOther &&
  1095. this.dataList.titleNoOther.length > 20
  1096. ) {
  1097. this.$message({
  1098. message: '封号-2输入错误',
  1099. type: 'warning',
  1100. })
  1101. return
  1102. }
  1103. if (!this.dataList.contractNo) {
  1104. this.$message({
  1105. message: '合同编号不能为空',
  1106. type: 'warning',
  1107. })
  1108. return
  1109. }
  1110. // if (
  1111. // this.dataList.contractNo.length < 6 ||
  1112. // this.dataList.contractNo.length > 20
  1113. // ) {
  1114. // this.$message({
  1115. // message: '合同编号长度不符合要求,请输入6-20个字符之内',
  1116. // type: 'warning',
  1117. // })
  1118. // return
  1119. // }
  1120. if (this.dataList.netWeight > this.$route.query.capacity) {
  1121. this.$message({
  1122. message: '入库量大于该仓库容量!',
  1123. type: 'warning',
  1124. })
  1125. return
  1126. }
  1127. //自检员
  1128. if (this.dataList.warehouseInOutDetail.qualityInspector) {
  1129. if (
  1130. this.dataList.warehouseInOutDetail.qualityInspector.length < 2 ||
  1131. this.dataList.warehouseInOutDetail.qualityInspector.length > 10
  1132. ) {
  1133. this.$message({
  1134. message: '质检员姓名长度错误!',
  1135. type: 'warning',
  1136. })
  1137. return
  1138. }
  1139. }
  1140. if (this.dataList.warehouseInOutDetail.waterContent) {
  1141. if (isNaN(this.dataList.warehouseInOutDetail.waterContent)) {
  1142. this.$message({
  1143. message: '水分(%)非数字!',
  1144. type: 'warning',
  1145. })
  1146. return
  1147. }
  1148. if (
  1149. this.dataList.warehouseInOutDetail.waterContent < 1 ||
  1150. this.dataList.warehouseInOutDetail.waterContent > 40 ||
  1151. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1152. '.'
  1153. ) != -1 &&
  1154. String(this.dataList.warehouseInOutDetail.waterContent).length -
  1155. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1156. '.'
  1157. ) +
  1158. 1) >
  1159. 2)
  1160. ) {
  1161. this.$message({
  1162. message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1163. type: 'warning',
  1164. })
  1165. return
  1166. }
  1167. }
  1168. //杂质
  1169. if (this.dataList.warehouseInOutDetail.impurity) {
  1170. if (isNaN(this.dataList.warehouseInOutDetail.impurity)) {
  1171. this.$message({
  1172. message: '杂质(%)非数字!',
  1173. type: 'warning',
  1174. })
  1175. return
  1176. }
  1177. if (
  1178. this.dataList.warehouseInOutDetail.impurity < 1 ||
  1179. this.dataList.warehouseInOutDetail.impurity > 40 ||
  1180. (String(this.dataList.warehouseInOutDetail.impurity).indexOf('.') !=
  1181. -1 &&
  1182. String(this.dataList.warehouseInOutDetail.impurity).length -
  1183. (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
  1184. '.'
  1185. ) +
  1186. 1) >
  1187. 2)
  1188. ) {
  1189. this.$message({
  1190. message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1191. type: 'warning',
  1192. })
  1193. return
  1194. }
  1195. }
  1196. //霉变
  1197. if (this.dataList.warehouseInOutDetail.mildewGrain) {
  1198. if (isNaN(this.dataList.warehouseInOutDetail.mildewGrain)) {
  1199. this.$message({
  1200. message: '霉变粒(%)非数字!',
  1201. type: 'warning',
  1202. })
  1203. return
  1204. }
  1205. if (
  1206. this.dataList.warehouseInOutDetail.mildewGrain < 1 ||
  1207. this.dataList.warehouseInOutDetail.mildewGrain > 40 ||
  1208. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1209. '.'
  1210. ) != -1 &&
  1211. String(this.dataList.warehouseInOutDetail.mildewGrain).length -
  1212. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1213. '.'
  1214. ) +
  1215. 1) >
  1216. 2)
  1217. ) {
  1218. this.$message({
  1219. message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1220. type: 'warning',
  1221. })
  1222. return
  1223. }
  1224. }
  1225. //热损伤
  1226. if (this.dataList.warehouseInOutDetail.jiaorenli) {
  1227. if (isNaN(this.dataList.warehouseInOutDetail.jiaorenli)) {
  1228. this.$message({
  1229. message: '热损伤(%)非数字!',
  1230. type: 'warning',
  1231. })
  1232. return
  1233. }
  1234. if (
  1235. this.dataList.warehouseInOutDetail.jiaorenli < 1 ||
  1236. this.dataList.warehouseInOutDetail.jiaorenli > 40 ||
  1237. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf('.') !=
  1238. -1 &&
  1239. String(this.dataList.warehouseInOutDetail.jiaorenli).length -
  1240. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
  1241. '.'
  1242. ) +
  1243. 1) >
  1244. 2)
  1245. ) {
  1246. this.$message({
  1247. message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1248. type: 'warning',
  1249. })
  1250. return
  1251. }
  1252. }
  1253. //不完善粒(%)
  1254. if (this.dataList.warehouseInOutDetail.imperfectGrain) {
  1255. if (isNaN(this.dataList.warehouseInOutDetail.imperfectGrain)) {
  1256. this.$message({
  1257. message: '不完善粒(%)非数字!',
  1258. type: 'warning',
  1259. })
  1260. return
  1261. }
  1262. if (
  1263. this.dataList.warehouseInOutDetail.imperfectGrain < 1 ||
  1264. this.dataList.warehouseInOutDetail.imperfectGrain > 40 ||
  1265. (String(this.dataList.warehouseInOutDetail.imperfectGrain).indexOf(
  1266. '.'
  1267. ) != -1 &&
  1268. String(this.dataList.warehouseInOutDetail.imperfectGrain).length -
  1269. (String(
  1270. this.dataList.warehouseInOutDetail.imperfectGrain
  1271. ).indexOf('.') +
  1272. 1) >
  1273. 2)
  1274. ) {
  1275. this.$message({
  1276. message: '不完善粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1277. type: 'warning',
  1278. })
  1279. return
  1280. }
  1281. }
  1282. //容重
  1283. if (this.dataList.warehouseInOutDetail.bulkDensity) {
  1284. if (isNaN(this.dataList.warehouseInOutDetail.bulkDensity)) {
  1285. this.$message({
  1286. message: '容重(克/升)非数字!',
  1287. type: 'warning',
  1288. })
  1289. return
  1290. }
  1291. if (
  1292. this.dataList.warehouseInOutDetail.bulkDensity > 1000 ||
  1293. this.dataList.warehouseInOutDetail.bulkDensity < 0 ||
  1294. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1295. '.'
  1296. ) != -1 &&
  1297. String(this.dataList.warehouseInOutDetail.bulkDensity).length -
  1298. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1299. '.'
  1300. ) +
  1301. 1) >
  1302. 0)
  1303. ) {
  1304. this.$message({
  1305. message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
  1306. type: 'warning',
  1307. })
  1308. return
  1309. }
  1310. }
  1311. this.$confirm(`确定提交皮重检斤`, {
  1312. cancelButtonText: '取消',
  1313. confirmButtonText: '确定',
  1314. type: 'warning',
  1315. })
  1316. .then(() => {
  1317. this.$refs.dataList.validate((valid) => {
  1318. if (valid) {
  1319. this.dataList.compId = localStorage.getItem('ws-pf_compId')
  1320. this.dataList.skinInspector =
  1321. localStorage.getItem('ws-pf_staffName')
  1322. this.dataList.inOutFlag = 2
  1323. this.dataList.statusFlag = 3
  1324. this.dataList.grossWeight = (
  1325. this.dataList.grossWeight / 1000
  1326. ).toFixed(2)
  1327. this.dataList.tare = (this.dataList.tare / 1000).toFixed(2)
  1328. this.dataList.netWeight = (
  1329. this.dataList.netWeight / 1000
  1330. ).toFixed(2)
  1331. this.dataList.pureWeight = (
  1332. this.dataList.pureWeight / 1000
  1333. ).toFixed(2)
  1334. if (!this.dataList.deductionWeight) {
  1335. this.dataList.deductionWeight = 0
  1336. }
  1337. if (!this.dataList.deductionAmount) {
  1338. this.dataList.deductionAmount = 0
  1339. }
  1340. this.dataList.deductionWeight = (
  1341. this.dataList.deductionWeight / 1000
  1342. ).toFixed(2)
  1343. this.dataList.deductionAmount = Math.round(
  1344. this.dataList.deductionAmount * 1000
  1345. )
  1346. addstorageputList(this.dataList)
  1347. .toPromise()
  1348. .then((response) => {
  1349. this.dataList.grossWeight = Math.round(
  1350. this.dataList.grossWeight * 1000
  1351. )
  1352. this.dataList.tare = Math.round(this.dataList.tare * 1000)
  1353. this.dataList.netWeight = Math.round(
  1354. this.dataList.netWeight * 1000
  1355. )
  1356. this.dataList.pureWeight = Math.round(
  1357. this.dataList.pureWeight * 1000
  1358. )
  1359. this.dataList.deductionWeight = Math.round(
  1360. this.dataList.deductionWeight * 1000
  1361. )
  1362. if (this.reader) {
  1363. this.reader.cancel()
  1364. }
  1365. this.$message.success('提交成功')
  1366. this.$confirm(`是否打印磅单`, {
  1367. cancelButtonText: '取消',
  1368. confirmButtonText: '确定',
  1369. type: 'warning',
  1370. }).then(() => {
  1371. getPrintInfo({
  1372. id: this.dataList.id,
  1373. })
  1374. .toPromise()
  1375. .then((response) => {
  1376. window.open(
  1377. '../../../../static/weightCheckInOut.html?type=2&tableData=' +
  1378. JSON.stringify(response)
  1379. )
  1380. })
  1381. })
  1382. this.$router
  1383. .push({
  1384. path: 'warehouseManagementList',
  1385. })
  1386. .catch(() => {
  1387. return false
  1388. })
  1389. })
  1390. .catch((response) => {
  1391. this.dataList.grossWeight = Math.round(
  1392. this.dataList.grossWeight * 1000
  1393. )
  1394. this.dataList.tare = Math.round(this.dataList.tare * 1000)
  1395. this.dataList.netWeight = Math.round(
  1396. this.dataList.netWeight * 1000
  1397. )
  1398. this.dataList.pureWeight = Math.round(
  1399. this.dataList.pureWeight * 1000
  1400. )
  1401. this.dataList.deductionWeight = Math.round(
  1402. this.dataList.deductionWeight * 1000
  1403. )
  1404. })
  1405. } else {
  1406. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1407. return false
  1408. }
  1409. })
  1410. })
  1411. .catch(() => {
  1412. return false
  1413. })
  1414. },
  1415. //暂存按钮
  1416. returnWarehouse() {
  1417. this.$refs.dataList.validate((valid) => {
  1418. if (valid) {
  1419. this.dataList.compId = localStorage.getItem('ws-pf_compId')
  1420. this.dataList.statusFlag = 1
  1421. addstorageputList(this.dataList)
  1422. .toPromise()
  1423. .then((response) => {
  1424. this.$message.success('添加成功')
  1425. this.$router.push({
  1426. path: 'warehouseManagementList',
  1427. })
  1428. })
  1429. } else {
  1430. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1431. return false
  1432. }
  1433. })
  1434. },
  1435. tarechange(e) {
  1436. this.tare = this.dataList.tare
  1437. if (this.dataList.grossWeight && this.dataList.tare) {
  1438. this.dataList.netWeight = Number(
  1439. this.dataList.grossWeight - this.dataList.tare
  1440. ).toFixed(2)
  1441. }
  1442. },
  1443. grossWeightchange(e) {
  1444. if (this.dataList.grossWeight && this.dataList.tare) {
  1445. this.dataList.netWeight = Number(
  1446. this.dataList.grossWeight - this.dataList.tare
  1447. ).toFixed(2)
  1448. }
  1449. },
  1450. selectgoodsName(e) {
  1451. for (var i = 0; i < this.goodnameList.length; i++) {
  1452. if (this.goodnameList[i].constValue == e) {
  1453. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  1454. if (e == '玉米(潮粮)') {
  1455. this.dataList.type = '潮粮'
  1456. } else {
  1457. this.dataList.type = '干粮'
  1458. }
  1459. }
  1460. }
  1461. },
  1462. selectpackingMethod(e) {
  1463. for (var i = 0; i < this.packtypeList.length; i++) {
  1464. if (this.packtypeList[i].constValue == e) {
  1465. this.dataList.packingMethodKey = this.packtypeList[i].constKey
  1466. }
  1467. }
  1468. },
  1469. selectstorageType(e) {
  1470. for (var i = 0; i < this.storageType.length; i++) {
  1471. if (this.storageType[i].constValue == e) {
  1472. this.dataList.inOutTypeKey = this.storageType[i].constKey
  1473. }
  1474. }
  1475. },
  1476. handleClose() {
  1477. this.accessoryTFs = false
  1478. },
  1479. handleSizeChange(val) {
  1480. console.log(`每页 ${val} 条`)
  1481. this.pageSize = val
  1482. this.getList()
  1483. },
  1484. handleCurrentChange(val) {
  1485. this.currentPage = val
  1486. console.log(`当前页: ${val}`)
  1487. this.getList()
  1488. },
  1489. getList() {
  1490. // 货名
  1491. pullDown({
  1492. constId: 'CON2',
  1493. })
  1494. .toPromise()
  1495. .then((response) => {
  1496. this.goodnameList = response
  1497. })
  1498. getReceiptTaskNo({
  1499. flag: 2,
  1500. warehouseName: this.deptBudgetList1.warehouseName,
  1501. agentKey: localStorage.getItem('ws-pf_userId'),
  1502. })
  1503. .toPromise()
  1504. .then((response) => {
  1505. this.deptBudgetList2 = response
  1506. })
  1507. // 品级
  1508. pullDown({
  1509. constId: 'CON3',
  1510. })
  1511. .toPromise()
  1512. .then((response) => {
  1513. this.gradeList = response
  1514. })
  1515. // 类型
  1516. if (this.$route.query.warehouseType == '1') {
  1517. this.storageType = []
  1518. pullDown({
  1519. constId: 'CON5',
  1520. })
  1521. .toPromise()
  1522. .then((response) => {
  1523. // this.storageType = response
  1524. for (let i = 0; i < response.length; i++) {
  1525. if (
  1526. response[i].constValue == '移库入库' ||
  1527. response[i].constValue == '退库'
  1528. ) {
  1529. this.storageType.push(response[i])
  1530. }
  1531. }
  1532. })
  1533. } else if (this.$route.query.warehouseType == '2') {
  1534. //临时仓库入库类型
  1535. pullDown({
  1536. constId: 'WARE1',
  1537. })
  1538. .toPromise()
  1539. .then((response) => {
  1540. this.storageType = response
  1541. })
  1542. //临时仓库出库类型
  1543. pullDown({
  1544. constId: 'WARE2',
  1545. })
  1546. .toPromise()
  1547. .then((response) => {
  1548. this.deliveryType = response
  1549. })
  1550. }
  1551. //合同编号
  1552. xialaNo({
  1553. compId: localStorage.getItem('ws-pf_compId'),
  1554. flag: 6,
  1555. })
  1556. .toPromise()
  1557. .then((response) => {
  1558. this.options1 = response
  1559. this.outContractNo = response
  1560. this.contractNoChange(this.dataList.inOutTaskNo)
  1561. })
  1562. //合同编号2
  1563. xialaNo({
  1564. compId: localStorage.getItem('ws-pf_compId'),
  1565. flag: 7,
  1566. })
  1567. .toPromise()
  1568. .then((response) => {
  1569. for (let i = 0; i < response.length; i++) {
  1570. if (this.dataList.contractNo == response[i].contractNo) {
  1571. if (response[i].deliverType == '1') {
  1572. this.carstatus = true
  1573. } else {
  1574. this.carstatus = false
  1575. }
  1576. }
  1577. }
  1578. this.outContractNo1 = response
  1579. })
  1580. //经办人
  1581. getstaff({
  1582. compId: localStorage.getItem('ws-pf_compId'),
  1583. warehouseId: this.dataList.baseId,
  1584. })
  1585. .toPromise()
  1586. .then((response) => {
  1587. this.options = response
  1588. this.qualityInspectorList = response
  1589. this.staffList = response
  1590. // this.agent = response
  1591. })
  1592. },
  1593. selecttaskType(e) {
  1594. for (var i = 0; i < this.taskTypeList.length; i++) {
  1595. if (this.taskTypeList[i].value == e) {
  1596. this.searchType = this.taskTypeList[i].type
  1597. }
  1598. }
  1599. },
  1600. fujian(row) {
  1601. if (
  1602. row.receiveAttachmentPath === null ||
  1603. row.receiveAttachmentPath === ''
  1604. ) {
  1605. EventBus.$emit(
  1606. 'warning',
  1607. this.$t('system.noticeCircular.NoInformation')
  1608. )
  1609. } else {
  1610. this.accessoryTFs = true
  1611. }
  1612. this.appendixIdss = row.receiveAttachmentPath
  1613. },
  1614. handleExamine(row) {
  1615. this.$router.push({
  1616. name: 'salesContractExamine',
  1617. query: {
  1618. id: row.id,
  1619. },
  1620. })
  1621. },
  1622. // 关闭 dialog时 处理文件url 初始化upload组件
  1623. handleCloe() {
  1624. this.dialogViewSpareMoney = false
  1625. },
  1626. history(row) {
  1627. console.log(row)
  1628. billoperatehis({
  1629. id: row.id,
  1630. })
  1631. .toPromise()
  1632. .then((response) => {
  1633. this.historyList = response
  1634. })
  1635. },
  1636. async exportlist() {
  1637. const {
  1638. data
  1639. } = await export1({
  1640. compId: localStorage.getItem('ws-pf_compId'),
  1641. contractType: this.contractType,
  1642. currentPage: this.currentPage,
  1643. pageSize: this.pageSize,
  1644. searchType: this.searchType,
  1645. searchKeyWord: this.searchKeyWord,
  1646. startDate: this.startDate,
  1647. endDate: this.endDate,
  1648. }, {}, {
  1649. responseType: 'blob',
  1650. }).toPromise()
  1651. downloadFile({
  1652. res: data,
  1653. fileName: `${
  1654. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  1655. }_采购合同`,
  1656. type: 'xls',
  1657. })
  1658. },
  1659. // deletecontract(){},
  1660. //删除
  1661. approve() {},
  1662. listQuery() {},
  1663. total() {},
  1664. clearfiltQuery() {},
  1665. selectCrtDuty() {},
  1666. },
  1667. }
  1668. </script>
  1669. <style lang="scss" scoped>
  1670. /deep/.basicInformation {
  1671. .ws-info-table {
  1672. border: none;
  1673. }
  1674. .left {
  1675. .el-form-item {
  1676. width: 50%;
  1677. // width: 33.3333%;
  1678. border: none;
  1679. .el-form-item__label {
  1680. background: transparent;
  1681. border: none;
  1682. }
  1683. .el-form-item__content {
  1684. border: none;
  1685. }
  1686. }
  1687. }
  1688. .right {
  1689. .el-form-item {
  1690. width: 100%;
  1691. // width: 33.3333%;
  1692. border: none;
  1693. .el-form-item__label {
  1694. background: transparent;
  1695. border: none;
  1696. }
  1697. .el-form-item__content {
  1698. border: none;
  1699. }
  1700. }
  1701. }
  1702. }
  1703. .title {
  1704. position: relative;
  1705. padding-left: 10px;
  1706. }
  1707. .title::before {
  1708. content: '';
  1709. display: inline-block;
  1710. width: 5px;
  1711. height: 30px;
  1712. background: #5473e8;
  1713. position: absolute;
  1714. left: 0;
  1715. }
  1716. .el-form {
  1717. padding: 0 10%;
  1718. }
  1719. .el-button--primary {
  1720. background-color: #5878e8;
  1721. border-color: #5878e8;
  1722. }
  1723. .el-col {
  1724. background: #f6f7fc;
  1725. }
  1726. .bg-right {
  1727. text-align: right;
  1728. padding: 16px 20px;
  1729. }
  1730. .center {
  1731. position: relative;
  1732. top: 50px;
  1733. width: 40%;
  1734. height: 2000px;
  1735. margin: 0 auto;
  1736. }
  1737. /deep/.el-form-item__label {
  1738. width: 160px;
  1739. }
  1740. .inspector {
  1741. width: 50%;
  1742. }
  1743. //质检员
  1744. /deep/[data-v-58803672] .el-form-item__label {
  1745. width: 60px;
  1746. }
  1747. [data-v-58803672] .el-form-item__label {
  1748. width: 60px;
  1749. }
  1750. //选填
  1751. /deep/.el-form-item {
  1752. width: 50%;
  1753. }
  1754. .container {
  1755. overflow: scroll;
  1756. height: 120vh;
  1757. }
  1758. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1759. text-align: center;
  1760. }
  1761. .deliverydate {
  1762. display: inline-block;
  1763. width: 10%;
  1764. }
  1765. .center {
  1766. margin-top: -60px;
  1767. width: 80%;
  1768. }
  1769. //仓位
  1770. .position {
  1771. width: 52px;
  1772. height: 20px;
  1773. background: #afb5cb;
  1774. border-radius: 2px;
  1775. font-size: 12px;
  1776. font-family: PingFangSC-Medium, PingFang SC;
  1777. color: #ffffff;
  1778. line-height: 20px;
  1779. }
  1780. //表格文字
  1781. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1782. text-align: left;
  1783. font-size: 14px;
  1784. font-family: PingFangSC-Regular, PingFang SC;
  1785. font-weight: 400;
  1786. color: #8890b1;
  1787. line-height: 16px;
  1788. }
  1789. //质检员
  1790. .inspector .el-form-item__content {
  1791. text-align: left;
  1792. margin-left: 0px;
  1793. }
  1794. .small-title {
  1795. position: relative;
  1796. padding: 10px;
  1797. font-weight: 600;
  1798. }
  1799. .small-title::before {
  1800. position: absolute;
  1801. content: '';
  1802. display: block;
  1803. background: #5473e8;
  1804. width: 4px;
  1805. height: 14px;
  1806. left: 0px;
  1807. top: 13px;
  1808. }
  1809. .top {
  1810. width: 100%;
  1811. background: black;
  1812. color: #2aff7c;
  1813. font-size: 32px;
  1814. text-align: right;
  1815. padding: 20px;
  1816. border-radius: 10px;
  1817. margin: 0 20px 0 20px;
  1818. .car-type {
  1819. text-align: left;
  1820. }
  1821. .kg-style {
  1822. font-size: 30px;
  1823. }
  1824. }
  1825. .weight {
  1826. font-size: 68px;
  1827. }
  1828. //下面列表
  1829. .neifor {
  1830. width: 80%;
  1831. background-color: #f6f7fc;
  1832. }
  1833. /deep/.neifor .ws-info-table .el-form-item .el-form-item__label {
  1834. width: 35%;
  1835. text-align: center;
  1836. }
  1837. /deep/.neifor .ws-info-table .el-form-item .el-form-item__content {
  1838. width: 60%;
  1839. background-color: #f6f7fc;
  1840. }
  1841. /deep/.neifor .el-input--small .el-input__inner {
  1842. width: 100%;
  1843. }
  1844. .el-input__inner {
  1845. width: 150px;
  1846. }
  1847. .balance-row {
  1848. display: flex;
  1849. margin: 20px 0;
  1850. .left {
  1851. width: 500px;
  1852. margin-bottom: 0;
  1853. }
  1854. }
  1855. </style>