improvedExWaehousingDetail.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  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='slectcontractNo'>{{detailData.contractNo}}</view>
  11. </view>
  12. <view class="row">
  13. <view class="left">货名</view>
  14. <view class="right">{{detailData.goodsName ? detailData.goodsName : "选择合同,自动获取"}}
  15. </view>
  16. </view>
  17. <view class="row">
  18. <view class="left">类型</view>
  19. <view @click='show1=true'>{{detailData.type}}</view>
  20. <u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
  21. mode="selector">
  22. </u-picker>
  23. </view>
  24. <view class="row row-bottom">
  25. <view class="left">毛重(吨)</view>
  26. <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  27. placeholder="输入毛重"></input>
  28. </view>
  29. <view class="row row-bottom">
  30. <view class="left">皮重(吨)</view>
  31. <input @input='calculate' v-model='detailData.tare' class="right-bottom" placeholder="输入皮重"></input>
  32. </view>
  33. <view class="row row-bottom">
  34. <view class="left">净重(吨)</view>
  35. <input v-model='netWeight' disabled class="right-bottom" placeholder="不可编辑,自动计算"></input>
  36. </view>
  37. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  38. <view class="left">扣重比</view>
  39. <input v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"
  40. @input="pureWeightCount"></input>
  41. </view>
  42. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  43. <view class="left">干粮水分(%)</view>
  44. <input v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"
  45. @input="pureWeightCount"></input>
  46. </view>
  47. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  48. <view class="left">潮粮水分(%)</view>
  49. <input v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"
  50. @input="pureWeightCount"></input>
  51. </view>
  52. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  53. <view class="left">纯重(吨)</view>
  54. <input v-model='detailData.pureWeight' class="right-bottom" placeholder="不可编辑,自动计算"></input>
  55. </view>
  56. <view class="row">
  57. <view class="left">品级</view>
  58. <view @click='show3=true'>{{detailData.grade}}</view>
  59. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show3" mode="selector">
  60. </u-picker>
  61. </view>
  62. <view class="row">
  63. <view class="left">经办人</view>
  64. <view @click='show6=true'>{{detailData.agent}}</view>
  65. <u-picker :range="handlerList" range-key="staffName" @confirm='handlerPicker($event)' v-model="show6"
  66. mode="selector">
  67. </u-picker>
  68. </view>
  69. <view class="row">
  70. <view class="left">出库日期</view>
  71. <view @click='show7=true'>{{detailData.inOutDate}}</view>
  72. <u-picker v-model="show7" mode="time" @confirm='dateChange($event)' :params="params">
  73. </u-picker>
  74. </view>
  75. <view class="row">
  76. <view class="left">出库类型</view>
  77. <view @click='show5=true'>{{detailData.inOutType}}</view>
  78. <u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)'
  79. v-model="show5" mode="selector">
  80. </u-picker>
  81. </view>
  82. <view class="row">
  83. <view class="left">出库方式</view>
  84. <view @click='show8=true'>{{detailData.outType?detailData.outType:'汽运'}}</view>
  85. <u-picker v-model="show8" mode="selector" range-key="name" :range="multiSelector" @confirm='outtypeChange($event)'>
  86. </u-picker>
  87. </view>
  88. <view class="row row-bottom">
  89. <!-- <view class="left">车牌号</view>
  90. <input v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input> -->
  91. <view class="left">车牌号</view>
  92. <input v-if="!isPC" v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input>
  93. <view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view>
  94. </view>
  95. <view v-if='detailData.outType=="集装箱船"||detailData.outType=="火运"' class="row row-bottom">
  96. <view class="left">箱号</view>
  97. <input v-model='detailData.boxNo' @input="toUpperCase" class="right-bottom" placeholder="请输入箱号"></input>
  98. <input v-model='detailData.boxNoOther' @input="toUpperCase1" class="right-bottom" placeholder="请输入箱号"></input>
  99. </view>
  100. <view v-if='detailData.outType=="散船"' class="row row-bottom">
  101. <view class="left">仓位号</view>
  102. <input v-model='detailData.binNo' class="right-bottom" placeholder="请输入仓位号"></input>
  103. </view>
  104. </view>
  105. <view class="content2">
  106. <view class="left">上传磅单</view>
  107. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
  108. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  109. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  110. </view>
  111. <view class="content1">
  112. <view class="title">
  113. 质检数据(选填)
  114. </view>
  115. <view class="row row-bottom">
  116. <view class="left">质检员</view>
  117. <input v-model='detailData.warehouseInOutDetail.qualityInspector' class="right-bottom"
  118. placeholder="输入质检员姓名"></input>
  119. </view>
  120. <view class="row row-bottom">
  121. <view class="left">水分(%)</view>
  122. <input v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom"
  123. placeholder="输入水分占比"></input>
  124. </view>
  125. <view class="row row-bottom">
  126. <view class="left">容重(克/升)</view>
  127. <input v-model='detailData.warehouseInOutDetail.bulkDensity' class="right-bottom"
  128. placeholder="输入容重"></input>
  129. </view>
  130. <view class="row row-bottom">
  131. <view class="left">热损伤(%)</view>
  132. <input v-model='detailData.warehouseInOutDetail.jiaorenli' class="right-bottom"
  133. placeholder="输入热损伤占比"></input>
  134. </view>
  135. <view class="row row-bottom">
  136. <view class="left">杂质(%)</view>
  137. <input v-model='detailData.warehouseInOutDetail.impurity' class="right-bottom"
  138. placeholder="输入杂质占比"></input>
  139. </view>
  140. <view class="row row-bottom">
  141. <view class="left">霉变粒(%)</view>
  142. <input v-model='detailData.warehouseInOutDetail.mildewGrain' class="right-bottom"
  143. placeholder="输入霉变粒占比"></input>
  144. </view>
  145. <view class="row row-bottom">
  146. <view class="left">不完善粒(%)</view>
  147. <input v-model='detailData.warehouseInOutDetail.imperfectGrain' class="right-bottom"
  148. placeholder="输入不完善粒占比"></input>
  149. </view>
  150. </view>
  151. <u-toast ref="uToast" />
  152. <view class="bottom-btn">
  153. <u-button type="primary" class="submit" hover-class="none" @click="submit(1)">暂存</u-button>
  154. <u-button type="primary" class="submit" hover-class="none" @click="submit(2)">提交</u-button>
  155. </view>
  156. </view>
  157. </template>
  158. <script>
  159. import upload from '@/components/upload.vue';
  160. import helper from '@/common/helper.js';
  161. import {
  162. mapState
  163. } from 'vuex';
  164. export default {
  165. components: {
  166. upload
  167. },
  168. data() {
  169. return {
  170. show: false,
  171. show1: false,
  172. show2: false,
  173. show3: false,
  174. show4: false,
  175. show5: false,
  176. show6: false,
  177. show7: false,
  178. isPC:true,
  179. typeList: [{
  180. type: "干粮"
  181. },
  182. {
  183. type: "潮粮"
  184. }
  185. ],
  186. pjList: [{
  187. type: "一等品"
  188. },
  189. {
  190. type: "二等品"
  191. },
  192. {
  193. type: "三等品"
  194. },
  195. {
  196. type: "等外"
  197. }
  198. ],
  199. show8:false,
  200. multiSelector:[
  201. {name:'汽运',value:'0'},
  202. {name:'火运',value:'1'},
  203. {name:'集装箱船',value:'2'},
  204. {name:'散船',value:'3'},
  205. ],
  206. handlerList: [],
  207. warehousingTypeList: [],
  208. action: this.$uploadUrl,
  209. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  210. btnLoading: false, //防止重复点击
  211. isAdd: true,
  212. warehouseName: '',
  213. binNumber: '',
  214. detailData: {
  215. outType:'汽运',
  216. contractNo: "请选择合同编号或移库任务编号",
  217. type: "请选择类型",
  218. grade: "请输入品级",
  219. agent: "请选择经办人",
  220. inOutDate: "请选择出库日期",
  221. inOutType: "请选择出库类型",
  222. warehouseInOutDetail: {},
  223. gradeKey: "",
  224. },
  225. params: {
  226. year: true,
  227. month: true,
  228. day: true,
  229. },
  230. netWeight: "",
  231. imgUrl: [], //图片展示
  232. }
  233. },
  234. computed: {
  235. ...mapState(['hasLogin', 'userInfo'])
  236. },
  237. watch: {
  238. netWeight: function(v) {
  239. this.pureWeightCount()
  240. },
  241. },
  242. onLoad(options) {
  243. this.detailData = JSON.parse(options.data)
  244. this.netWeight = this.detailData.netWeight
  245. if(this.detailData.addressUrl){
  246. this.imgUrl.push({
  247. url: this.detailData.addressUrl.split(",")[0]
  248. })
  249. }
  250. this.cangId = options.cangId
  251. },
  252. onShow() {
  253. this.binNumber = helper.erpWarehouse.binNumber
  254. this.warehouseName = helper.erpWarehouse.warehouseName
  255. // this.detailData.goodsName = uni.getStorageSync('erpContractNo').goodsName;
  256. // this.detailData.contractNo = uni.getStorageSync('erpContractNo').contractNo;
  257. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
  258. if (this.detailData.inOutType == '销售出库') {
  259. this.detailData.inOutTypeKey = 1
  260. } else if (this.detailData.inOutType == '移库出库') {
  261. this.detailData.inOutTypeKey = 3
  262. } else if (this.detailData.inOutType == '暂存出库') {
  263. this.detailData.inOutTypeKey = 4
  264. } else if (this.detailData.inOutType == '贸易服务出库') {
  265. this.detailData.inOutTypeKey = 5
  266. } else if (this.detailData.inOutType == '采购出库') {
  267. this.detailData.inOutTypeKey = 6
  268. }
  269. if (!this.detailData.contractNo) {
  270. this.detailData.contractNo = '请选择合同编号'
  271. }
  272. if (!this.detailData.goodsName) {
  273. this.detailData.goodsName = '货名'
  274. }
  275. let _data = uni.getStorageSync('erpContractNoCK') == '' ? {} : uni.getStorageSync('erpContractNoCK')
  276. if (!_data.tranCarInfoList) {
  277. this.isPC = false
  278. _data.tranCarInfoList = []
  279. } else {
  280. this.isPC = true
  281. if (uni.getStorageSync('ContractNoCarCK')) {
  282. this.detailData.carNo = uni.getStorageSync('ContractNoCarCK')
  283. } else {
  284. this.detailData.carNo = _data.tranCarInfoList[0].carNo
  285. }
  286. }
  287. if(this.detailData.carNo){
  288. for(let i = 0 ; i < uni.getStorageSync('erpContractNoCK').tranCarInfoList.length ;i++){
  289. if(uni.getStorageSync('erpContractNoCK').tranCarInfoList[i].carNo == this.detailData.carNo)
  290. this.detailData.tranCarNo = uni.getStorageSync('erpContractNoCK').tranCarInfoList[i].tranCarNo
  291. }
  292. }
  293. //出库类型
  294. this.outWarehouse()
  295. //经办人
  296. this.handler()
  297. },
  298. methods: {
  299. toUpperCase(val){
  300. this.detailData.boxNo = val.detail.value.toUpperCase()
  301. },
  302. toUpperCase1(val){
  303. this.detailData.boxNoOther = val.detail.value.toUpperCase()
  304. },
  305. outtypeChange(e){
  306. this.detailData.outType=this.multiSelector[e].name
  307. console.log(e)
  308. },
  309. //计算纯重
  310. pureWeightCount() {
  311. if (this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this
  312. .detailData.tidalGrainWater) {
  313. // 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
  314. this.detailData.pureWeight = 100 - (this.detailData.tidalGrainWater - this.detailData
  315. .solidGrainWater) * this.netWeight * this.detailData.buckleWeightRatio / 100
  316. this.detailData.pureWeight = this.detailData.pureWeight.toFixed(3)
  317. }
  318. },
  319. outWarehouse() {
  320. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  321. constId: 'CON6'
  322. }).then(res => {
  323. this.warehousingTypeList = res.data.data
  324. })
  325. },
  326. handler() {
  327. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  328. compId: helper.erpWarehouse.compId,
  329. warehouseId: helper.erpWarehouse.warehouseId
  330. }).then(res => {
  331. this.handlerList = res.data.data
  332. })
  333. },
  334. contractNopicker(e) {
  335. },
  336. typePicker(e) {
  337. this.detailData.type = this.typeList[e].type
  338. },
  339. pjPicker(e) {
  340. this.detailData.gradeKey = e[0]
  341. this.detailData.grade = this.pjList[e].type
  342. },
  343. handlerPicker(e) {
  344. this.detailData.agentKey = e[0]
  345. this.detailData.agent = this.handlerList[e].staffName
  346. },
  347. dateChange(e) {
  348. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  349. },
  350. warehousingTypePicker(e) {
  351. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  352. if (this.detailData.inOutType == '销售出库') {
  353. this.detailData.inOutTypeKey = 1
  354. } else if (this.detailData.inOutType == '移库出库') {
  355. this.detailData.inOutTypeKey = 3
  356. } else if (this.detailData.inOutType == '暂存出库') {
  357. this.detailData.inOutTypeKey = 4
  358. } else if (this.detailData.inOutType == '贸易服务出库') {
  359. this.detailData.inOutTypeKey = 5
  360. } else if (this.detailData.inOutType == '采购出库') {
  361. this.detailData.inOutTypeKey = 6
  362. }
  363. },
  364. filterFileType(index, lists) {
  365. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  366. lists.splice(index, 1);
  367. // 当前文件不支持
  368. uni.showModal({
  369. title: '暂不支持当前图片类型',
  370. showCancel: false
  371. });
  372. } else {
  373. this.isAdd = false;
  374. }
  375. },
  376. calculate() {
  377. if (this.detailData.grossWeight && this.detailData.tare) {
  378. this.netWeight = this.detailData.grossWeight - this.detailData.tare
  379. }
  380. },
  381. getImgUrl(res) {
  382. this.detailData.addressUrl = res
  383. console.log(res)
  384. console.log('------------res-----------')
  385. },
  386. onError(error) {
  387. alert(error)
  388. console.log('------------error-----------')
  389. console.log(error)
  390. },
  391. binNumberpicker(e) {
  392. this.detailData.binNumber = this.positionList[e[0]].binNumber
  393. },
  394. onProgress(e) {},
  395. onRemove(index) {},
  396. submit(num) {
  397. if (!this.detailData.contractNo) {
  398. this.$api.msg('合同编号不能为空')
  399. return
  400. }
  401. if (!this.detailData.goodsName) {
  402. this.$api.msg('货名不能为空')
  403. return
  404. }
  405. if (!this.detailData.grossWeight) {
  406. this.$api.msg('毛重不能为空')
  407. return
  408. }
  409. if (isNaN(this.detailData.grossWeight) ||
  410. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  411. String(this.detailData.grossWeight).length -
  412. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  413. 3) ||
  414. this.detailData.grossWeight < 0 ||
  415. this.detailData.grossWeight > 10000
  416. ) {
  417. this.$api.msg('毛重输入错误!')
  418. return
  419. }
  420. if (!this.detailData.tare) {
  421. this.$api.msg('皮重不能为空')
  422. return
  423. }
  424. if (isNaN(this.detailData.tare) ||
  425. (String(this.detailData.tare).indexOf('.') != -1 &&
  426. String(this.detailData.tare).length -
  427. (String(this.detailData.tare).indexOf('.') + 1) >
  428. 3) ||
  429. this.detailData.tare < 0 ||
  430. this.detailData.tare > 10000
  431. ) {
  432. this.$api.msg('皮重输入错误!')
  433. return
  434. }
  435. if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
  436. this.$api.msg('皮重不能大于毛重')
  437. return
  438. }
  439. if (this.netWeight <= 0) {
  440. this.$api.msg('净重不能小于等于0')
  441. return
  442. }
  443. if (this.detailData.type == "潮粮") {
  444. if (!this.detailData.buckleWeightRatio) {
  445. this.$api.msg('扣重比不能为空')
  446. return
  447. }
  448. if (isNaN(this.detailData.buckleWeightRatio) ||
  449. (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
  450. String(this.detailData.buckleWeightRatio).length -
  451. (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
  452. 2) ||
  453. this.detailData.buckleWeightRatio < 0 ||
  454. this.detailData.buckleWeightRatio > 2
  455. ) {
  456. this.$api.msg('扣重比输入错误!')
  457. return
  458. }
  459. if (!this.detailData.solidGrainWater) {
  460. this.$api.msg('干粮水分不能为空')
  461. return
  462. }
  463. if (isNaN(this.detailData.solidGrainWater) ||
  464. (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
  465. String(this.detailData.solidGrainWater).length -
  466. (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
  467. 1) ||
  468. this.detailData.solidGrainWater < 1 ||
  469. this.detailData.solidGrainWater > 40
  470. ) {
  471. this.$api.msg('干粮水分输入错误!')
  472. return
  473. }
  474. if (!this.detailData.tidalGrainWater) {
  475. this.$api.msg('潮粮水分不能为空')
  476. return
  477. }
  478. if (isNaN(this.detailData.tidalGrainWater) ||
  479. (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
  480. String(this.detailData.tidalGrainWater).length -
  481. (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
  482. 1) ||
  483. this.detailData.tidalGrainWater < 1 ||
  484. this.detailData.tidalGrainWater > 40
  485. ) {
  486. this.$api.msg('潮粮水分输入错误!')
  487. return
  488. }
  489. if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
  490. this.$api.msg('潮粮水分输入错误!')
  491. return
  492. }
  493. if (!this.detailData.pureWeight) {
  494. this.$api.msg('纯重不能为空')
  495. return
  496. }
  497. }
  498. if (this.detailData.grade == "请输入品级") {
  499. this.$api.msg('品级不能为空')
  500. return
  501. }
  502. if (this.detailData.agent == "请选择经办人") {
  503. this.$api.msg('经办人不能为空')
  504. return
  505. }
  506. if (this.detailData.inOutDate == "请选择出库日期") {
  507. this.$api.msg('出库日期不能为空')
  508. return
  509. }
  510. if (this.detailData.inOutType == "请选择出库类型") {
  511. this.$api.msg('出库类型不能为空')
  512. return
  513. }
  514. if (!this.detailData.carNo) {
  515. this.$api.msg('车牌号不能为空')
  516. return
  517. }
  518. if (this.detailData.carNo.length != 7) {
  519. this.$api.msg('车牌号输入有误!')
  520. return
  521. }
  522. if (!this.detailData.addressUrl) {
  523. this.$api.msg('请上传磅单')
  524. return
  525. }
  526. if (this.detailData.warehouseInOutDetail.qualityInspector) {
  527. if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
  528. .qualityInspector > 10) {
  529. this.$api.msg('质检员姓名需要2-10个字')
  530. return
  531. }
  532. }
  533. if (this.detailData.warehouseInOutDetail.waterContent) {
  534. if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
  535. .detailData.tidalGrainWater) {
  536. this.$api.msg('水分占比与潮粮水分不一致')
  537. return
  538. }
  539. if (this.detailData.type == "干粮") {
  540. if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
  541. .waterContent > 40) {
  542. this.$api.msg('水分占比输入错误')
  543. return
  544. }
  545. }
  546. if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
  547. .detailData.warehouseInOutDetail.waterContent).length - (String(
  548. this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
  549. this.$api.msg('水分占比输入错误')
  550. return
  551. }
  552. }
  553. if (this.detailData.warehouseInOutDetail.bulkDensity) {
  554. if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
  555. .bulkDensity > 1000) {
  556. this.$api.msg('容重输入错误')
  557. return
  558. }
  559. if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
  560. .detailData.warehouseInOutDetail.bulkDensity).length - (
  561. String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
  562. this.$api.msg('容重输入错误')
  563. return
  564. }
  565. }
  566. if (this.detailData.warehouseInOutDetail.jiaorenli) {
  567. if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
  568. .jiaorenli > 40) {
  569. this.$api.msg('热损伤占比输入错误')
  570. return
  571. }
  572. if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
  573. .warehouseInOutDetail.jiaorenli).length - (String(
  574. this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
  575. this.$api.msg('热损伤占比输入错误')
  576. return
  577. }
  578. }
  579. if (this.detailData.warehouseInOutDetail.impurity) {
  580. if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
  581. .impurity > 40) {
  582. this.$api.msg('杂质占比输入错误')
  583. return
  584. }
  585. if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
  586. .warehouseInOutDetail.impurity).length - (String(
  587. this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
  588. this.$api.msg('杂质占比输入错误')
  589. return
  590. }
  591. }
  592. if (this.detailData.warehouseInOutDetail.mildewGrain) {
  593. if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
  594. .mildewGrain > 40) {
  595. this.$api.msg('霉变粒占比输入错误')
  596. return
  597. }
  598. if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
  599. .detailData
  600. .warehouseInOutDetail.mildewGrain).length - (String(
  601. this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
  602. this.$api.msg('霉变粒占比输入错误')
  603. return
  604. }
  605. }
  606. if (this.detailData.warehouseInOutDetail.imperfectGrain) {
  607. if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
  608. .imperfectGrain > 40) {
  609. this.$api.msg('不完善粒占比输入错误')
  610. return
  611. }
  612. if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
  613. .detailData
  614. .warehouseInOutDetail.imperfectGrain).length - (String(
  615. this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
  616. this.$api.msg('不完善粒占比输入错误')
  617. return
  618. }
  619. }
  620. if(this.detailData.boxNo){
  621. this.detailData.boxNo=this.detailData.boxNo.toUpperCase()
  622. }
  623. if(this.detailData.boxNoOther){
  624. this.detailData.boxNoOther=this.detailData.boxNoOther.toUpperCase()
  625. }
  626. this.detailData.baseId = helper.erpWarehouse.warehouseId
  627. this.detailData.positionId = helper.erpWarehouse.positionId
  628. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  629. this.detailData.binNumber = this.binNumber
  630. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
  631. this.detailData.compId = helper.erpWarehouse.compId
  632. this.detailData.netWeight = this.netWeight
  633. this.detailData.inOutFlag = 1
  634. this.detailData.taskType = "出库任务"
  635. this.detailData.pcFlag = 0
  636. let title = ""
  637. if (num == 1) {
  638. this.detailData.statusFlag = 1
  639. this.detailData.backOffice = this.userInfo.userName
  640. this.detailData.backOfficeId = this.userInfo.id
  641. title = "暂存成功"
  642. } else if (num == 2) {
  643. this.detailData.statusFlag = 3
  644. this.detailData.backOffice = this.userInfo.userName
  645. this.detailData.backOfficeId = this.userInfo.id
  646. title = "提交成功"
  647. }
  648. let that = this
  649. uni.showModal({
  650. content: "确定提交出库信息?",
  651. success(res) {
  652. if (res.confirm) {
  653. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  654. that.detailData).then(res => {
  655. if (res.data.code == 200) {
  656. that.$api.msg(title)
  657. setTimeout(() => {
  658. uni.navigateBack()
  659. }, 1000)
  660. } else {
  661. that.$api.msg(res.data.message)
  662. }
  663. })
  664. }
  665. }
  666. })
  667. },
  668. slectcontractNo() {
  669. uni.navigateTo({
  670. url: '/pages/erp/warehousing/selectContractNo?flag=' + 5
  671. })
  672. },
  673. slectCarNo() {
  674. uni.navigateTo({
  675. url: '/pages/erp/exWarehousing/selectCarNo'
  676. })
  677. },
  678. }
  679. }
  680. </script>
  681. <style scoped lang="scss">
  682. uni-page-body {
  683. overflow: hidden;
  684. }
  685. .warp {
  686. margin: 10rpx;
  687. padding: 20rpx 20rpx 140rpx 20rpx;
  688. .top {
  689. display: flex;
  690. margin-bottom: 20rpx;
  691. .top-left {
  692. margin-right: 20rpx;
  693. }
  694. }
  695. }
  696. .content,
  697. .content1,
  698. .content2 {
  699. border-radius: 20rpx;
  700. background: white;
  701. padding: 20rpx;
  702. .title {
  703. font-size: 28rpx;
  704. font-weight: 600;
  705. color: #333333;
  706. }
  707. .row {
  708. display: flex;
  709. justify-content: space-between;
  710. border-bottom: 1px solid #EEEEEE;
  711. padding: 21rpx 0;
  712. .right,
  713. input {
  714. font-size: 28rpx;
  715. color: #333333;
  716. }
  717. }
  718. .row-bottom {
  719. // border: 0;
  720. .right-bottom {
  721. width: 280rpx;
  722. text-align: right;
  723. }
  724. }
  725. }
  726. .content1 {
  727. margin-top: 20rpx;
  728. }
  729. .content2 {
  730. margin-top: 10px;
  731. // display: flex;
  732. align-items: center;
  733. .left {
  734. margin-right: 20px;
  735. }
  736. }
  737. .submit {
  738. width: 40%;
  739. background: #22C572;
  740. border-radius: 10rpx;
  741. }
  742. .edit-btn {
  743. background: #22C572;
  744. width: 100rpx;
  745. height: 50rpx;
  746. margin: 0;
  747. color: white;
  748. }
  749. .has-btn {
  750. align-items: center;
  751. }
  752. .bottom-btn {
  753. padding: 30rpx;
  754. background: #FFFFFF;
  755. width: 92%;
  756. position: fixed;
  757. bottom: 0rpx;
  758. display: flex;
  759. z-index: 9999;
  760. }
  761. </style>