improvedExWaehousingDetail.vue 25 KB

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