exWarehousing.vue 35 KB

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