warehouseManagementNoWeightOut.vue 57 KB

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