exWarehousing.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  1. <template>
  2. <view class="warp">
  3. <view class="top">
  4. <view class="top-left">{{warehouseName}}</view>
  5. <view>{{binNumber}}仓位</view>
  6. </view>
  7. <view class="content">
  8. <view class="row">
  9. <view class="left">任务编号</view>
  10. <view @click='inOutShow=true'>{{detailData.inOutTaskNo ? detailData.inOutTaskNo : "暂未获取到任务编号"}}</view>
  11. <u-picker :range="inOutNoList" range-key="inOutTaskNo" @confirm='inOutChange' v-model="inOutShow"
  12. mode="selector">
  13. </u-picker>
  14. </view>
  15. <view class="row row-bottom">
  16. <view class="left">合同编号</view>
  17. <!-- <view @click='slectcontractNo'>{{detailData.contractNo}}</view> -->
  18. <input v-model='detailData.contractNo' class="right-bottom" placeholder="暂未获取到合同编号" disabled=""></input>
  19. </view>
  20. <view class="row">
  21. <view class="left">提示</view>
  22. <view class="right">{{detailData.tips}}</view>
  23. </view>
  24. <view class="row">
  25. <view class="left">货名</view>
  26. <view class="right">{{detailData.goodsName ? detailData.goodsName : "选择合同,自动获取"}}
  27. </view>
  28. </view>
  29. <view class="row">
  30. <view class="left">类型</view>
  31. <view @click='show1=true'>{{detailData.type}}</view>
  32. <u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
  33. mode="selector">
  34. <view class="">{{detailData.type}}</view>
  35. </u-picker>
  36. </view>
  37. <view class="row row-bottom">
  38. <view class="left">毛重(吨)</view>
  39. <input type="digit" @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  40. placeholder="输入毛重"></input>
  41. </view>
  42. <view class="row row-bottom">
  43. <view class="left">皮重(吨)</view>
  44. <input type="digit" @input='calculate' v-model='detailData.tare' class="right-bottom"
  45. placeholder="输入皮重"></input>
  46. </view>
  47. <view class="row row-bottom">
  48. <view class="left">净重(吨)</view>
  49. <input v-model='netWeight' disabled class="right-bottom" placeholder="不可编辑,自动计算"></input>
  50. </view>
  51. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  52. <view class="left">扣重比</view>
  53. <input type="digit" v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"
  54. @input="pureWeightCount"></input>
  55. </view>
  56. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  57. <view class="left">干粮水分(%)</view>
  58. <input type="digit" v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"
  59. @input="pureWeightCount"></input>
  60. </view>
  61. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  62. <view class="left">潮粮水分(%)</view>
  63. <input type="digit" v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"
  64. @input="pureWeightCount"></input>
  65. </view>
  66. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  67. <view class="left">纯重(吨)</view>
  68. <input v-model='detailData.pureWeight' class="right-bottom" placeholder="不可编辑,自动计算"></input>
  69. </view>
  70. <view class="row">
  71. <view class="left">品级</view>
  72. <view @click='show3=true'>{{detailData.grade}}</view>
  73. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show3" mode="selector">
  74. </u-picker>
  75. </view>
  76. <view class="row">
  77. <view class="left">经办人</view>
  78. <view @click='show6=true'>{{detailData.agent}}</view>
  79. <u-picker :range="handlerList" range-key="staffName" @confirm='handlerPicker($event)' v-model="show6"
  80. mode="selector">
  81. </u-picker>
  82. </view>
  83. <view class="row">
  84. <view class="left">出库日期</view>
  85. <view @click='show7=true'>{{detailData.inOutDate}}</view>
  86. <u-picker v-model="show7" mode="time" @confirm='dateChange($event)' :params="params">
  87. </u-picker>
  88. </view>
  89. <view class="row row-bottom">
  90. <view class="left">出库类型</view>
  91. <input v-model='detailData.inOutType' class="right-bottom" :disabled="isSelectType"
  92. placeholder="自动获取"></input>
  93. <!-- <u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)'
  94. v-model="show5" mode="selector">
  95. </u-picker> -->
  96. </view>
  97. <view class="row">
  98. <view class="left">出库方式</view>
  99. <view @click='show8=true'>{{detailData.outType?detailData.outType:'汽运'}}</view>
  100. <u-picker v-model="show8" mode="selector" range-key="name" :range="multiSelector"
  101. @confirm='outtypeChange($event)'>
  102. </u-picker>
  103. </view>
  104. <view class="row row-bottom" v-if="detailData.outType!='火运' && detailData.outType!='散船'">
  105. <!-- <view class="left">车牌号</view>
  106. <input v-if="!isPC" v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input>
  107. <view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view> -->
  108. <view class="left">车牌号</view>
  109. <!-- 他运合同车牌号输入 -->
  110. <input v-model='detailData.carNo' @click.stop="handleShowKeyboard":disabled="true" class="right-bottom" placeholder="请输入车牌号" v-if="!showCar"></input>
  111. <master-keyboard ref="keyboard" keyboardtype="car" :randomNumber="true" :newCar="false" :defaultValue="detailData.carNo" @keyboardClick="handleClick"></master-keyboard>
  112. <!-- <view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view> -->
  113. <!-- 自运合同车牌号需下拉 -->
  114. <view v-show="showCar" @click="carno = true">
  115. {{detailData.carNo?detailData.carNo :"请选择车牌号"}}
  116. </view>
  117. <u-picker :range="carList" range-key="carNo" @confirm='carPicker($event)' v-model="carno"
  118. mode="selector">
  119. </u-picker>
  120. </view>
  121. <view class="row row-bottom" v-if="detailData.outType=='火运'">
  122. <view class="left">车号</view>
  123. <input v-model='detailData.carNo' class="right-bottom" placeholder="请输入车号"></input>
  124. </view>
  125. <view v-if='detailData.outType=="集装箱船"||!detailData.outType||detailData.outType=="汽运"'
  126. class="row row-bottom">
  127. <view class="left">箱号</view>
  128. <input v-model='detailData.boxNo' class="right-bottom" placeholder="请输入箱号" type="digit"></input>
  129. <input v-model='detailData.boxNoOther' class="right-bottom" type="digit" placeholder="请输入箱号"></input>
  130. </view>
  131. <view v-if='!detailData.outType||detailData.outType=="汽运" || detailData.outType=="集装箱船"'
  132. class="row row-bottom">
  133. <view class="left">封号</view>
  134. <input v-model='detailData.titleNo' class="right-bottom" placeholder="请输入封号" type="digit"></input>
  135. <input v-model='detailData.titleNoOther' class="right-bottom" placeholder="请输入封号" type="digit"></input>
  136. </view>
  137. <view v-if='detailData.outType=="火运"' class="row row-bottom">
  138. <view class="left">车厢号</view>
  139. <input v-model='detailData.wingNumber' @input="toUpperCase2" class="right-bottom" placeholder="请输入车厢号"
  140. type="digit"></input>
  141. <input v-model='detailData.wingNumberOther' @input="toUpperCase3" class="right-bottom"
  142. placeholder="请输入车厢号" type="digit"></input>
  143. </view>
  144. <view v-if='detailData.outType=="散船"' class="row row-bottom">
  145. <view class="left">航次</view>
  146. <input v-model='detailData.shipNumber' class="right-bottom" placeholder="请输入航次"></input>
  147. </view>
  148. <view v-if='detailData.outType=="散船"' class="row row-bottom">
  149. <view class="left">船名</view>
  150. <input v-model='detailData.shipName' class="right-bottom" placeholder="请输入船名"></input>
  151. </view>
  152. </view>
  153. <view class="content2">
  154. <view class="left">上传磅单</view>
  155. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  156. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  157. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  158. </view>
  159. <view class="content1">
  160. <view class="title">
  161. 质检数据(选填)
  162. </view>
  163. <view class="row row-bottom">
  164. <view class="left">质检员</view>
  165. <input v-model='detailData.warehouseInOutDetail.qualityInspector' class="right-bottom"
  166. placeholder="输入质检员姓名"></input>
  167. </view>
  168. <view class="row row-bottom">
  169. <view class="left">水分(%)</view>
  170. <input type="digit" v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom"
  171. placeholder="输入水分占比"></input>
  172. </view>
  173. <view class="row row-bottom">
  174. <view class="left">容重(克/升)</view>
  175. <input type="digit" v-model='detailData.warehouseInOutDetail.bulkDensity' class="right-bottom"
  176. placeholder="输入容重"></input>
  177. </view>
  178. <view class="row row-bottom">
  179. <view class="left">热损伤(%)</view>
  180. <input type="digit" v-model='detailData.warehouseInOutDetail.jiaorenli' class="right-bottom"
  181. placeholder="输入热损伤占比"></input>
  182. </view>
  183. <view class="row row-bottom">
  184. <view class="left">杂质(%)</view>
  185. <input type="digit" v-model='detailData.warehouseInOutDetail.impurity' class="right-bottom"
  186. placeholder="输入杂质占比"></input>
  187. </view>
  188. <view class="row row-bottom">
  189. <view class="left">霉变粒(%)</view>
  190. <input type="digit" v-model='detailData.warehouseInOutDetail.mildewGrain' class="right-bottom"
  191. placeholder="输入霉变粒占比"></input>
  192. </view>
  193. <view class="row row-bottom">
  194. <view class="left">不完善粒(%)</view>
  195. <input type="digit" v-model='detailData.warehouseInOutDetail.imperfectGrain' class="right-bottom"
  196. placeholder="输入不完善粒占比"></input>
  197. </view>
  198. </view>
  199. <u-toast ref="uToast" />
  200. <view class="bottom-btn">
  201. <u-button type="primary" class="submit" hover-class="none" @click="submit(1)">暂存</u-button>
  202. <u-button type="primary" class="submit" hover-class="none" @click="submit(2)">提交</u-button>
  203. </view>
  204. <u-popup v-model="isShowPrint" class="popup" @close="close" mode="bottom" border-radius="30" :closeable="true">
  205. <view class="buns_item">
  206. <view class="but_css" @click="print">打印小票</view>
  207. <view class="but_css" @click="close">返回</view>
  208. </view>
  209. </u-popup>
  210. </view>
  211. </template>
  212. <script>
  213. import upload from '@/components/upload.vue';
  214. import helper from '@/common/helper.js';
  215. import keyboard from "@/components/master-keyboard/master-keyboard.vue";
  216. import {
  217. mapState
  218. } from 'vuex';
  219. export default {
  220. components: {
  221. upload,
  222. keyboard
  223. },
  224. data() {
  225. return {
  226. weightbills: {},
  227. isShowPrint: false,
  228. show: false,
  229. show1: false,
  230. show2: false,
  231. show3: false,
  232. show4: false,
  233. show5: false,
  234. show6: false,
  235. show7: false,
  236. isPC: true,
  237. show8: false,
  238. carno: false,
  239. usestart: '',
  240. multiSelector: [{
  241. name: '汽运',
  242. value: '0'
  243. },
  244. {
  245. name: '火运',
  246. value: '1'
  247. },
  248. {
  249. name: '集装箱船',
  250. value: '2'
  251. },
  252. {
  253. name: '散船',
  254. value: '3'
  255. },
  256. ],
  257. show9: false,
  258. multiSelector1: [{
  259. name: '汽运',
  260. value: '0'
  261. },
  262. {
  263. name: '火运',
  264. value: '1'
  265. },
  266. {
  267. name: '集装箱船',
  268. value: '2'
  269. },
  270. {
  271. name: '散船',
  272. value: '3'
  273. },
  274. ],
  275. isSelectType: true,
  276. // contractNoList: [{
  277. // contractNo: ""
  278. // }],
  279. typeList: [{
  280. type: "干粮"
  281. },
  282. {
  283. type: "潮粮"
  284. }
  285. ],
  286. pjList: [{
  287. type: "一等品"
  288. },
  289. {
  290. type: "二等品"
  291. },
  292. {
  293. type: "三等品"
  294. },
  295. {
  296. type: "等外"
  297. }
  298. ],
  299. handlerList: [],
  300. warehousingTypeList: [],
  301. action: this.$uploadUrl,
  302. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  303. btnLoading: false, //防止重复点击
  304. isAdd: true,
  305. warehouseName: '',
  306. binNumber: '',
  307. detailData: {
  308. outType: '汽运',
  309. contractNo: "",
  310. type: "干粮",
  311. grade: "请输入品级",
  312. agent: "请选择经办人",
  313. inOutDate: "请选择出库日期",
  314. inOutType: "请选择出库类型",
  315. warehouseInOutDetail: {},
  316. gradeKey: "",
  317. grossWeight: "",
  318. tare: "",
  319. tips: '',
  320. carNo:''
  321. },
  322. params: {
  323. year: true,
  324. month: true,
  325. day: true,
  326. },
  327. netWeight: "",
  328. inOutShow: false,
  329. inOutNoList: [],
  330. carList: [], //车牌号下拉
  331. showCar: false,
  332. }
  333. },
  334. computed: {
  335. ...mapState(['hasLogin', 'userInfo'])
  336. },
  337. watch: {
  338. netWeight: function(v) {
  339. this.pureWeightCount()
  340. },
  341. },
  342. onLoad(options) {
  343. this.id = options.id
  344. this.cangId = options.cangId
  345. },
  346. onShow() {
  347. uni.showLoading({
  348. title:"加载中...",
  349. mask:true
  350. })
  351. let _data = uni.getStorageSync('erpContractNoCK') == '' ? {} : uni.getStorageSync('erpContractNoCK')
  352. this.binNumber = helper.erpWarehouse.binNumber
  353. this.warehouseName = helper.erpWarehouse.warehouseName
  354. this.detailData.goodsName = _data.goodsName;
  355. this.detailData.inOutType = _data.inOutType ? _data.inOutType : '';
  356. if (this.detailData.inOutType == '销售出库') {
  357. this.detailData.inOutTypeKey = 1
  358. } else if (this.detailData.inOutType == '移库出库') {
  359. this.detailData.inOutTypeKey = 3
  360. } else if (this.detailData.inOutType == '暂存出库') {
  361. this.detailData.inOutTypeKey = 4
  362. } else if (this.detailData.inOutType == '贸易服务出库') {
  363. this.detailData.inOutTypeKey = 5
  364. } else if (this.detailData.inOutType == '采购出库') {
  365. this.detailData.inOutTypeKey = 6
  366. }
  367. // if (_data.contractNo) {
  368. // this.detailData.contractNo = _data.contractNo;
  369. // }
  370. this.detailData.goodsNameKey = _data.goodsNameKey ? _data.goodsNameKey : '';
  371. if (!_data.tranCarInfoList) {
  372. this.isPC = false
  373. _data.tranCarInfoList = []
  374. } else {
  375. this.isPC = true
  376. if (uni.getStorageSync('ContractNoCarCK')) {
  377. this.detailData.carNo = uni.getStorageSync('ContractNoCarCK')
  378. } else {
  379. this.detailData.carNo = _data.tranCarInfoList[0].carNo
  380. }
  381. }
  382. if (this.detailData.carNo) {
  383. for (let i = 0; i < uni.getStorageSync('erpContractNoCK').tranCarInfoList.length; i++) {
  384. if (uni.getStorageSync('erpContractNoCK').tranCarInfoList[i].carNo == this.detailData.carNo)
  385. this.detailData.tranCarNo = uni.getStorageSync('erpContractNoCK').tranCarInfoList[i].tranCarNo
  386. }
  387. }
  388. if (!this.detailData.contractNo) {
  389. this.detailData.contractNo = '请选择合同编号'
  390. } else {
  391. if (_data.tranCarInfoList.length == 0) {
  392. this.isPC = false
  393. }
  394. }
  395. if (!this.detailData.goodsName) {
  396. this.detailData.goodsName = '货名'
  397. }
  398. let _day = new Date();
  399. _day.setTime(_day.getTime());
  400. this.detailData.inOutDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
  401. //出库类型
  402. this.outWarehouse()
  403. if (helper.erpWarehouse.personCharge) {
  404. this.detailData.agent = helper.erpWarehouse.personCharge
  405. }
  406. //查看任务编号
  407. this.inOutNo()
  408. //经办人
  409. this.handler()
  410. },
  411. methods: {
  412. print() {
  413. uni.navigateTo({
  414. url: '/pages/erpbusiness/exbleConnect'
  415. })
  416. },
  417. close() {
  418. this.isShowPrint = false
  419. uni.navigateBack({})
  420. },
  421. hidden(){
  422. this.$refs.keyboard.open(false)
  423. },
  424. handleShowKeyboard(){
  425. if(this.$refs.keyboard.open){
  426. this.$refs.keyboard.open(true)//true 键盘显示 false 键盘隐藏
  427. }else{
  428. this.$refs.keyboard[0].open(true)
  429. }
  430. },
  431. handleClick(e){
  432. this.detailData.carNo = e.value //键盘输入值
  433. },
  434. inOutNo() {
  435. this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
  436. flag: 1,
  437. warehouseName: this.warehouseName,
  438. agentKey: this.userInfo.id
  439. }).then(res => {
  440. this.inOutNoList = res.data.data
  441. this.detailData.inOutTaskNo = this.inOutNoList[0].inOutTaskNo ? this.inOutNoList[0]
  442. .inOutTaskNo : ''
  443. this.detailData.agent = this.inOutNoList[0].agent
  444. if (this.inOutNoList[0].contractNo) {
  445. this.detailData.contractNo = this.inOutNoList[0].contractNo
  446. } else {
  447. this.detailData.contractNo = this.inOutNoList[0].moveTaskNo
  448. }
  449. this.detailData.goodsName = this.inOutNoList[0].goodsName
  450. this.detailData.goodsNameKey = this.inOutNoList[0].goodsNameKey
  451. this.detailData.grade = this.inOutNoList[0].grade
  452. this.detailData.inOutType = this.inOutNoList[0].inOutType
  453. if (this.detailData.inOutType == '销售出库') {
  454. this.detailData.inOutTypeKey = 1
  455. } else if (this.detailData.inOutType == '移库出库') {
  456. this.detailData.inOutTypeKey = 3
  457. } else if (this.detailData.inOutType == '暂存出库') {
  458. this.detailData.inOutTypeKey = 4
  459. } else if (this.detailData.inOutType == '贸易服务出库') {
  460. this.detailData.inOutTypeKey = 5
  461. } else if (this.detailData.inOutType == '采购出库') {
  462. this.detailData.inOutTypeKey = 6
  463. }
  464. console.log(this.detailData.inOutType)
  465. //查询所有的合同 进行获取车牌号
  466. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  467. flag: 5,
  468. compId: helper.erpWarehouse.compId,
  469. }).then(res => {
  470. if (res.data.code == 200) {
  471. for (let i = 0; i < res.data.data.length; i++) {
  472. // "MYCGYMHLJ2021102401"
  473. if (res.data.data[i].contractNo == this.detailData.contractNo) {
  474. if (this.detailData.inOutType == '销售出库') {
  475. this.detailData.tips = '买方' + res.data.data[i].buyer
  476. } else if (this.detailData.inOutType == '移库出库') {
  477. this.detailData.tips = '入货库' + this.inOutNoList[0].warehouseName
  478. }
  479. //如果查到该合同
  480. res.data.data[i].deliverType = !res.data.data[i].deliverType?'1':res.data.data[i].deliverType
  481. if (res.data.data[i].deliverType == '1') { //判断自运1,他运2合同
  482. this.showCar = true
  483. } else {
  484. this.showCar = false
  485. }
  486. if (res.data.data[i].tranCarInfoList) {
  487. this.carList = res.data.data[i].tranCarInfoList //车牌号下拉列表
  488. }
  489. }
  490. }
  491. uni.hideLoading()
  492. }
  493. })
  494. })
  495. // this.$api.doRequest('get', 'warehouseBaseInfo/selectContractNoList', ).then(res => {
  496. // this.contractNoList = res.data.data
  497. // for (var i = 0; i < this.contractNoList.length; i++) {
  498. // if (this.contractNoList[i].contractNo == this.detailData.contractNo) {
  499. // if (this.detailData.inOutType == '销售出库') {
  500. // this.detailData.tips = '买方' + this.contractNoList[i].buyer
  501. // } else if (this.detailData.inOutType == '移库出库') {
  502. // this.detailData.tips = '入货库' + this.inOutNoList[0].warehouseName
  503. // }
  504. // }
  505. // }
  506. // })
  507. },
  508. inOutChange(e) {
  509. this.detailData.inOutTaskNo = this.inOutNoList[e[0]].inOutTaskNo
  510. this.detailData.agent = this.inOutNoList[e[0]].agent
  511. if (this.inOutNoList[e[0]].contractNo) {
  512. this.detailData.contractNo = this.inOutNoList[e[0]].contractNo
  513. } else {
  514. this.detailData.contractNo = this.inOutNoList[e[0]].moveTaskNo
  515. }
  516. this.detailData.goodsName = this.inOutNoList[e[0]].goodsName
  517. this.detailData.goodsNameKey = this.inOutNoList[e[0]].goodsNameKey
  518. this.detailData.grade = this.inOutNoList[e[0]].grade
  519. this.detailData.inOutType = this.inOutNoList[e[0]].inOutType
  520. this.weightbills.goodsName = this.inOutNoList[e[0]].goodsName
  521. if (this.detailData.inOutType == '销售出库') {
  522. this.weightbills.buyer = this.inOutNoList[e[0]].buyer
  523. this.weightbills.seller = uni.getStorageSync('compName')
  524. if (this.detailData.tips = '买方' + this.contractNoList[e[0]].buyer) {
  525. this.detailData.tips = '买方' + this.contractNoList[e[0]].buyer +
  526. '( ' +
  527. this.contractNoList[e[0]].unitContractPrice +
  528. '元/吨)'
  529. } else {
  530. this.detailData.tips = '买方' + this.contractNoList[e[0]].buyer
  531. }
  532. } else if (this.detailData.inOutType == '移库出库') {
  533. this.weightbills.buyer = this.inOutNoList[e[0]].receiveWarehouse
  534. this.weightbills.seller = uni.getStorageSync('compName')
  535. this.detailData.tips = '入货库' + this.inOutNoList[e[0]].warehouseName
  536. }
  537. },
  538. toUpperCase(val) {
  539. this.detailData.boxNo = val.detail.value.toUpperCase()
  540. },
  541. toUpperCase1(val) {
  542. this.detailData.boxNoOther = val.detail.value.toUpperCase()
  543. },
  544. usestartChange(e) {
  545. this.usestart = this.multiSelector1[e].name
  546. },
  547. //计算纯重
  548. pureWeightCount() {
  549. if (this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this
  550. .detailData.tidalGrainWater) {
  551. // 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
  552. this.detailData.pureWeight = 100 - (this.detailData.tidalGrainWater - this.detailData
  553. .solidGrainWater) * this.netWeight * this.detailData.buckleWeightRatio / 100
  554. this.detailData.pureWeight = this.detailData.pureWeight.toFixed(3)
  555. }
  556. },
  557. outtypeChange(e) {
  558. this.detailData.outType = this.multiSelector[e].name
  559. console.log(e)
  560. },
  561. toUpperCase2(val) {
  562. this.detailData.wingNumber = val.detail.value.toUpperCase()
  563. },
  564. toUpperCase3(val) {
  565. this.detailData.wingNumberOther = val.detail.value.toUpperCase()
  566. },
  567. outWarehouse() {
  568. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  569. constId: 'CON6'
  570. }).then(res => {
  571. this.warehousingTypeList = res.data.data
  572. })
  573. },
  574. handler() {
  575. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  576. compId: helper.erpWarehouse.compId,
  577. warehouseId: helper.erpWarehouse.warehouseId
  578. }).then(res => {
  579. this.handlerList = res.data.data
  580. })
  581. },
  582. contractNopicker(e) {
  583. },
  584. typePicker(e) {
  585. this.detailData.type = this.typeList[e].type
  586. },
  587. pjPicker(e) {
  588. this.detailData.gradeKey = e[0] + 1
  589. this.detailData.grade = this.pjList[e].type
  590. },
  591. handlerPicker(e) {
  592. this.detailData.agentKey = e[0]
  593. this.detailData.agent = this.handlerList[e].staffName
  594. },
  595. dateChange(e) {
  596. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  597. },
  598. warehousingTypePicker(e) {
  599. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  600. if (this.detailData.inOutType == '销售出库') {
  601. this.detailData.inOutTypeKey = 1
  602. } else if (this.detailData.inOutType == '移库出库') {
  603. this.detailData.inOutTypeKey = 3
  604. } else if (this.detailData.inOutType == '暂存出库') {
  605. this.detailData.inOutTypeKey = 4
  606. } else if (this.detailData.inOutType == '贸易服务出库') {
  607. this.detailData.inOutTypeKey = 5
  608. } else if (this.detailData.inOutType == '采购出库') {
  609. this.detailData.inOutTypeKey = 6
  610. }
  611. },
  612. filterFileType(index, lists) {
  613. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  614. lists.splice(index, 1);
  615. // 当前文件不支持
  616. uni.showModal({
  617. title: '暂不支持当前图片类型',
  618. showCancel: false
  619. });
  620. } else {
  621. this.isAdd = false;
  622. }
  623. },
  624. calculate() {
  625. if (this.detailData.grossWeight && this.detailData.tare) {
  626. this.netWeight =(this.detailData.grossWeight - this.detailData.tare).toFixed(3)
  627. }
  628. },
  629. getImgUrl(res) {
  630. this.detailData.addressUrl = res
  631. },
  632. onError(error) {
  633. console.log('------------error-----------')
  634. console.log(error)
  635. },
  636. binNumberpicker(e) {
  637. this.detailData.binNumber = this.positionList[e[0]].binNumber
  638. },
  639. carPicker(e) {
  640. // this.detailData.gradeKey = e[0] + 1
  641. this.detailData.carNo = this.carList[e].carNo
  642. this.detailData.carId = this.carList[e].id
  643. },
  644. onProgress(e) {},
  645. onRemove() {
  646. this.detailData.addressUrl = ""
  647. },
  648. submit(num) {
  649. if (!this.detailData.contractNo) {
  650. this.$api.msg('合同编号不能为空')
  651. return
  652. }
  653. if (!this.detailData.goodsName) {
  654. this.$api.msg('货名不能为空')
  655. return
  656. }
  657. if (!this.detailData.grossWeight && num == 2) {
  658. this.$api.msg('毛重不能为空')
  659. return
  660. }
  661. if (isNaN(this.detailData.grossWeight) ||
  662. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  663. String(this.detailData.grossWeight).length -
  664. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  665. 3) ||
  666. this.detailData.grossWeight < 0 ||
  667. this.detailData.grossWeight > 10000
  668. ) {
  669. this.$api.msg('毛重输入错误!')
  670. return
  671. }
  672. if (!this.detailData.tare && num == 2) {
  673. this.$api.msg('皮重不能为空')
  674. return
  675. }
  676. if (isNaN(this.detailData.tare) ||
  677. (String(this.detailData.tare).indexOf('.') != -1 &&
  678. String(this.detailData.tare).length -
  679. (String(this.detailData.tare).indexOf('.') + 1) >
  680. 3) ||
  681. this.detailData.tare < 0 ||
  682. this.detailData.tare > 10000
  683. ) {
  684. this.$api.msg('皮重输入错误!')
  685. return
  686. }
  687. if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
  688. this.$api.msg('皮重不能大于毛重')
  689. return
  690. }
  691. if (this.netWeight <= 0 && num == 2) {
  692. this.$api.msg('净重不能小于等于0')
  693. return
  694. }
  695. if (this.detailData.type == "潮粮") {
  696. if (!this.detailData.buckleWeightRatio && num == 2) {
  697. this.$api.msg('扣重比不能为空')
  698. return
  699. }
  700. if (isNaN(this.detailData.buckleWeightRatio) ||
  701. (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
  702. String(this.detailData.buckleWeightRatio).length -
  703. (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
  704. 2) ||
  705. this.detailData.buckleWeightRatio < 0 ||
  706. this.detailData.buckleWeightRatio > 3
  707. ) {
  708. this.$api.msg('扣重比输入错误!')
  709. return
  710. }
  711. if (!this.detailData.solidGrainWater && num == 2) {
  712. this.$api.msg('干粮水分不能为空')
  713. return
  714. }
  715. if (isNaN(this.detailData.solidGrainWater) ||
  716. (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
  717. String(this.detailData.solidGrainWater).length -
  718. (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
  719. 1) ||
  720. this.detailData.solidGrainWater < 1 ||
  721. this.detailData.solidGrainWater > 40
  722. ) {
  723. this.$api.msg('干粮水分输入错误!')
  724. return
  725. }
  726. if (!this.detailData.tidalGrainWater && num == 2) {
  727. this.$api.msg('潮粮水分不能为空')
  728. return
  729. }
  730. if (isNaN(this.detailData.tidalGrainWater) ||
  731. (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
  732. String(this.detailData.tidalGrainWater).length -
  733. (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
  734. 1) ||
  735. this.detailData.tidalGrainWater < 1 ||
  736. this.detailData.tidalGrainWater > 40
  737. ) {
  738. this.$api.msg('潮粮水分输入错误!')
  739. return
  740. }
  741. if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
  742. this.$api.msg('潮粮水分输入错误!')
  743. return
  744. }
  745. if (!this.detailData.pureWeight && num == 2) {
  746. this.$api.msg('纯重不能为空')
  747. return
  748. }
  749. }
  750. if (this.detailData.grade == "请输入品级" && num == 2) {
  751. this.$api.msg('品级不能为空')
  752. return
  753. }
  754. if (this.detailData.agent == "请选择经办人") {
  755. this.$api.msg('经办人不能为空')
  756. return
  757. }
  758. if (this.detailData.inOutDate == "请选择出库日期") {
  759. this.$api.msg('出库日期不能为空')
  760. return
  761. }
  762. if (this.detailData.inOutType == "请选择出库类型") {
  763. this.$api.msg('出库类型不能为空')
  764. return
  765. }
  766. if (this.detailData.outType == "集装箱船" || this.detailData.outType == "汽运") {
  767. if (!this.detailData.carNo && num == 2) {
  768. this.$api.msg('车牌号不能为空')
  769. return
  770. }
  771. if (this.detailData.carNo.length != 7) {
  772. this.$api.msg('车牌号输入有误!')
  773. return
  774. }
  775. }
  776. if (!this.detailData.addressUrl && num == 2) {
  777. this.$api.msg('请上传磅单')
  778. return
  779. }
  780. if (this.detailData.warehouseInOutDetail.qualityInspector) {
  781. if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
  782. .qualityInspector > 10) {
  783. this.$api.msg('质检员姓名需要2-10个字')
  784. return
  785. }
  786. }
  787. if (this.detailData.warehouseInOutDetail.waterContent) {
  788. if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
  789. .detailData.tidalGrainWater) {
  790. this.$api.msg('水分占比与潮粮水分不一致')
  791. return
  792. }
  793. if (this.detailData.type == "干粮") {
  794. if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
  795. .waterContent > 40) {
  796. this.$api.msg('水分占比输入错误')
  797. return
  798. }
  799. }
  800. if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
  801. .detailData.warehouseInOutDetail.waterContent).length - (String(
  802. this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
  803. this.$api.msg('水分占比输入错误')
  804. return
  805. }
  806. }
  807. if (this.detailData.warehouseInOutDetail.bulkDensity) {
  808. if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
  809. .bulkDensity > 1000) {
  810. this.$api.msg('容重输入错误')
  811. return
  812. }
  813. if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
  814. .detailData.warehouseInOutDetail.bulkDensity).length - (
  815. String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
  816. this.$api.msg('容重输入错误')
  817. return
  818. }
  819. }
  820. if (this.detailData.warehouseInOutDetail.jiaorenli) {
  821. if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
  822. .jiaorenli > 40) {
  823. this.$api.msg('热损伤占比输入错误')
  824. return
  825. }
  826. if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
  827. .warehouseInOutDetail.jiaorenli).length - (String(
  828. this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
  829. this.$api.msg('热损伤占比输入错误')
  830. return
  831. }
  832. }
  833. if (this.detailData.warehouseInOutDetail.impurity) {
  834. if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
  835. .impurity > 40) {
  836. this.$api.msg('杂质占比输入错误')
  837. return
  838. }
  839. if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
  840. .warehouseInOutDetail.impurity).length - (String(
  841. this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
  842. this.$api.msg('杂质占比输入错误')
  843. return
  844. }
  845. }
  846. if (this.detailData.warehouseInOutDetail.mildewGrain) {
  847. if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
  848. .mildewGrain > 40) {
  849. this.$api.msg('霉变粒占比输入错误')
  850. return
  851. }
  852. if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
  853. .detailData
  854. .warehouseInOutDetail.mildewGrain).length - (String(
  855. this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
  856. this.$api.msg('霉变粒占比输入错误')
  857. return
  858. }
  859. }
  860. if (this.detailData.warehouseInOutDetail.imperfectGrain) {
  861. if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
  862. .imperfectGrain > 40) {
  863. this.$api.msg('不完善粒占比输入错误')
  864. return
  865. }
  866. if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
  867. .detailData
  868. .warehouseInOutDetail.imperfectGrain).length - (String(
  869. this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
  870. this.$api.msg('不完善粒占比输入错误')
  871. return
  872. }
  873. }
  874. if (this.detailData.boxNo) {
  875. this.detailData.boxNo = this.detailData.boxNo.toUpperCase()
  876. }
  877. if (this.detailData.boxNoOther) {
  878. this.detailData.boxNoOther = this.detailData.boxNoOther.toUpperCase()
  879. }
  880. this.detailData.baseId = helper.erpWarehouse.warehouseId
  881. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  882. this.detailData.positionId = helper.erpWarehouse.positionId
  883. this.detailData.binNumber = this.binNumber
  884. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNoCK').goodsNameKey;
  885. this.detailData.compId = helper.erpWarehouse.compId
  886. this.detailData.netWeight = this.netWeight
  887. this.detailData.inOutFlag = 1
  888. this.detailData.taskType = "出库任务"
  889. this.detailData.pcFlag = 0
  890. let title = ""
  891. if (num == 1) {
  892. this.detailData.statusFlag = 1
  893. this.detailData.backOffice = this.userInfo.userName
  894. this.detailData.backOfficeId = this.userInfo.id
  895. title = "暂存成功"
  896. } else if (num == 2) {
  897. this.detailData.statusFlag = 3
  898. this.detailData.backOffice = this.userInfo.userName
  899. this.detailData.backOfficeId = this.userInfo.id
  900. title = "提交成功"
  901. }
  902. let that = this
  903. uni.showModal({
  904. content: "确定提交出库信息?",
  905. success(res) {
  906. if (res.confirm) {
  907. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  908. that.detailData).then(res => {
  909. console.log(res, "报异常")
  910. if (res.data.code == 200) {
  911. that.weightbills.carNo = that.detailData.carNo
  912. that.weightbills.boxNo = that.detailData.boxNo
  913. that.weightbills.boxNoOther = that.detailData.boxNoOther
  914. that.weightbills.wingNumber = that.detailData.wingNumber
  915. that.weightbills.wingNumberOther = that.detailData.wingNumberOther
  916. that.weightbills.shipName = that.detailData.shipName
  917. that.weightbills.shipNumber = that.detailData.shipNumber
  918. that.weightbills.type = that.detailData.type
  919. that.weightbills.grossWeight = that.detailData.grossWeight
  920. that.weightbills.tare = that.detailData.tare
  921. that.weightbills.netWeight = that.detailData.netWeight
  922. that.weightbills.outType = that.detailData.outType
  923. that.weightbills.backOffice = that.detailData.outType
  924. var date = new Date()
  925. that.weightbills.updateDate = date.getFullYear() + '-' + (date
  926. .getMonth() + 1) + '-' + date.getDate() + ' ' + date
  927. .getHours() + ':' + date.getMinutes() + ':' + date.getSeconds()
  928. that.$api.msg(title)
  929. that.isShowPrint = true
  930. uni.setStorageSync("exWarehousing_print", that.weightbills)
  931. // setTimeout(() => {
  932. // uni.navigateBack()
  933. // }, 1000)
  934. } else {
  935. that.$api.msg(res.data.message)
  936. }
  937. })
  938. }
  939. }
  940. })
  941. },
  942. slectcontractNo() {
  943. uni.navigateTo({
  944. url: '/pages/erp/exWarehousing/selectContractNo?flag=' + 5
  945. })
  946. },
  947. slectCarNo() {
  948. uni.navigateTo({
  949. url: '/pages/erp/exWarehousing/selectCarNo'
  950. })
  951. },
  952. }
  953. }
  954. </script>
  955. <style scoped lang="scss">
  956. uni-page-body {
  957. overflow: hidden;
  958. }
  959. .warp {
  960. margin: 10rpx;
  961. padding: 20rpx 20rpx 300rpx 20rpx;
  962. .top {
  963. display: flex;
  964. margin-bottom: 20rpx;
  965. .top-left {
  966. margin-right: 20rpx;
  967. }
  968. }
  969. }
  970. .content,
  971. .content1,
  972. .content2 {
  973. border-radius: 20rpx;
  974. background: white;
  975. padding: 20rpx;
  976. .title {
  977. font-size: 28rpx;
  978. font-weight: 600;
  979. color: #333333;
  980. }
  981. .row {
  982. display: flex;
  983. justify-content: space-between;
  984. border-bottom: 1px solid #EEEEEE;
  985. padding: 21rpx 0;
  986. .right,
  987. input {
  988. font-size: 28rpx;
  989. color: #333333;
  990. }
  991. }
  992. .row-bottom {
  993. // border: 0;
  994. .right-bottom {
  995. width: 280rpx;
  996. text-align: right;
  997. }
  998. }
  999. }
  1000. .content1 {
  1001. margin-top: 20rpx;
  1002. }
  1003. .content2 {
  1004. margin-top: 10px;
  1005. // display: flex;
  1006. align-items: center;
  1007. .left {
  1008. margin-right: 20px;
  1009. }
  1010. }
  1011. .submit {
  1012. width: 40%;
  1013. background: #22C572;
  1014. border-radius: 10rpx;
  1015. }
  1016. .edit-btn {
  1017. background: #22C572;
  1018. width: 100rpx;
  1019. height: 50rpx;
  1020. margin: 0;
  1021. color: white;
  1022. }
  1023. .has-btn {
  1024. align-items: center;
  1025. }
  1026. .bottom-btn {
  1027. padding: 30rpx;
  1028. background: #FFFFFF;
  1029. width: 92%;
  1030. position: fixed;
  1031. bottom: 0rpx;
  1032. display: flex;
  1033. z-index: 9999;
  1034. }
  1035. .buns_item {
  1036. display: flex;
  1037. padding: 80rpx 0 50rpx 0;
  1038. justify-content: space-around;
  1039. }
  1040. .but_css {
  1041. background: #22C572;
  1042. width: 40%;
  1043. padding: 20rpx;
  1044. color: #fff;
  1045. text-align: center;
  1046. border-radius: 20rpx;
  1047. }
  1048. </style>