improvedExWaehousingDetail.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  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' class="right-bottom" placeholder="请输入箱号"></input>
  98. <input v-model='detailData.boxNoOther' 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. outtypeChange(e){
  300. this.detailData.outType=this.multiSelector[e].name
  301. console.log(e)
  302. },
  303. //计算纯重
  304. pureWeightCount() {
  305. if (this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this
  306. .detailData.tidalGrainWater) {
  307. // 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
  308. this.detailData.pureWeight = 100 - (this.detailData.tidalGrainWater - this.detailData
  309. .solidGrainWater) * this.netWeight * this.detailData.buckleWeightRatio / 100
  310. this.detailData.pureWeight = this.detailData.pureWeight.toFixed(3)
  311. }
  312. },
  313. outWarehouse() {
  314. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  315. constId: 'CON6'
  316. }).then(res => {
  317. this.warehousingTypeList = res.data.data
  318. })
  319. },
  320. handler() {
  321. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  322. compId: helper.erpWarehouse.compId,
  323. warehouseId: helper.erpWarehouse.warehouseId
  324. }).then(res => {
  325. this.handlerList = res.data.data
  326. })
  327. },
  328. contractNopicker(e) {
  329. },
  330. typePicker(e) {
  331. this.detailData.type = this.typeList[e].type
  332. },
  333. pjPicker(e) {
  334. this.detailData.gradeKey = e[0]
  335. this.detailData.grade = this.pjList[e].type
  336. },
  337. handlerPicker(e) {
  338. this.detailData.agentKey = e[0]
  339. this.detailData.agent = this.handlerList[e].staffName
  340. },
  341. dateChange(e) {
  342. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  343. },
  344. warehousingTypePicker(e) {
  345. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  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. },
  358. filterFileType(index, lists) {
  359. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  360. lists.splice(index, 1);
  361. // 当前文件不支持
  362. uni.showModal({
  363. title: '暂不支持当前图片类型',
  364. showCancel: false
  365. });
  366. } else {
  367. this.isAdd = false;
  368. }
  369. },
  370. calculate() {
  371. if (this.detailData.grossWeight && this.detailData.tare) {
  372. this.netWeight = this.detailData.grossWeight - this.detailData.tare
  373. }
  374. },
  375. getImgUrl(res) {
  376. this.detailData.addressUrl = res
  377. console.log(res)
  378. console.log('------------res-----------')
  379. },
  380. onError(error) {
  381. alert(error)
  382. console.log('------------error-----------')
  383. console.log(error)
  384. },
  385. binNumberpicker(e) {
  386. this.detailData.binNumber = this.positionList[e[0]].binNumber
  387. },
  388. onProgress(e) {},
  389. onRemove(index) {},
  390. submit(num) {
  391. if (!this.detailData.contractNo) {
  392. this.$api.msg('合同编号不能为空')
  393. return
  394. }
  395. if (!this.detailData.goodsName) {
  396. this.$api.msg('货名不能为空')
  397. return
  398. }
  399. if (!this.detailData.grossWeight) {
  400. this.$api.msg('毛重不能为空')
  401. return
  402. }
  403. if (isNaN(this.detailData.grossWeight) ||
  404. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  405. String(this.detailData.grossWeight).length -
  406. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  407. 3) ||
  408. this.detailData.grossWeight < 0 ||
  409. this.detailData.grossWeight > 10000
  410. ) {
  411. this.$api.msg('毛重输入错误!')
  412. return
  413. }
  414. if (!this.detailData.tare) {
  415. this.$api.msg('皮重不能为空')
  416. return
  417. }
  418. if (isNaN(this.detailData.tare) ||
  419. (String(this.detailData.tare).indexOf('.') != -1 &&
  420. String(this.detailData.tare).length -
  421. (String(this.detailData.tare).indexOf('.') + 1) >
  422. 3) ||
  423. this.detailData.tare < 0 ||
  424. this.detailData.tare > 10000
  425. ) {
  426. this.$api.msg('皮重输入错误!')
  427. return
  428. }
  429. if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
  430. this.$api.msg('皮重不能大于毛重')
  431. return
  432. }
  433. if (this.netWeight <= 0) {
  434. this.$api.msg('净重不能小于等于0')
  435. return
  436. }
  437. if (this.detailData.type == "潮粮") {
  438. if (!this.detailData.buckleWeightRatio) {
  439. this.$api.msg('扣重比不能为空')
  440. return
  441. }
  442. if (isNaN(this.detailData.buckleWeightRatio) ||
  443. (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
  444. String(this.detailData.buckleWeightRatio).length -
  445. (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
  446. 2) ||
  447. this.detailData.buckleWeightRatio < 0 ||
  448. this.detailData.buckleWeightRatio > 2
  449. ) {
  450. this.$api.msg('扣重比输入错误!')
  451. return
  452. }
  453. if (!this.detailData.solidGrainWater) {
  454. this.$api.msg('干粮水分不能为空')
  455. return
  456. }
  457. if (isNaN(this.detailData.solidGrainWater) ||
  458. (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
  459. String(this.detailData.solidGrainWater).length -
  460. (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
  461. 1) ||
  462. this.detailData.solidGrainWater < 1 ||
  463. this.detailData.solidGrainWater > 40
  464. ) {
  465. this.$api.msg('干粮水分输入错误!')
  466. return
  467. }
  468. if (!this.detailData.tidalGrainWater) {
  469. this.$api.msg('潮粮水分不能为空')
  470. return
  471. }
  472. if (isNaN(this.detailData.tidalGrainWater) ||
  473. (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
  474. String(this.detailData.tidalGrainWater).length -
  475. (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
  476. 1) ||
  477. this.detailData.tidalGrainWater < 1 ||
  478. this.detailData.tidalGrainWater > 40
  479. ) {
  480. this.$api.msg('潮粮水分输入错误!')
  481. return
  482. }
  483. if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
  484. this.$api.msg('潮粮水分输入错误!')
  485. return
  486. }
  487. if (!this.detailData.pureWeight) {
  488. this.$api.msg('纯重不能为空')
  489. return
  490. }
  491. }
  492. if (this.detailData.grade == "请输入品级") {
  493. this.$api.msg('品级不能为空')
  494. return
  495. }
  496. if (this.detailData.agent == "请选择经办人") {
  497. this.$api.msg('经办人不能为空')
  498. return
  499. }
  500. if (this.detailData.inOutDate == "请选择出库日期") {
  501. this.$api.msg('出库日期不能为空')
  502. return
  503. }
  504. if (this.detailData.inOutType == "请选择出库类型") {
  505. this.$api.msg('出库类型不能为空')
  506. return
  507. }
  508. if (!this.detailData.carNo) {
  509. this.$api.msg('车牌号不能为空')
  510. return
  511. }
  512. if (this.detailData.carNo.length != 7) {
  513. this.$api.msg('车牌号输入有误!')
  514. return
  515. }
  516. if (!this.detailData.addressUrl) {
  517. this.$api.msg('请上传磅单')
  518. return
  519. }
  520. if (this.detailData.warehouseInOutDetail.qualityInspector) {
  521. if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
  522. .qualityInspector > 10) {
  523. this.$api.msg('质检员姓名需要2-10个字')
  524. return
  525. }
  526. }
  527. if (this.detailData.warehouseInOutDetail.waterContent) {
  528. if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
  529. .detailData.tidalGrainWater) {
  530. this.$api.msg('水分占比与潮粮水分不一致')
  531. return
  532. }
  533. if (this.detailData.type == "干粮") {
  534. if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
  535. .waterContent > 40) {
  536. this.$api.msg('水分占比输入错误')
  537. return
  538. }
  539. }
  540. if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
  541. .detailData.warehouseInOutDetail.waterContent).length - (String(
  542. this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
  543. this.$api.msg('水分占比输入错误')
  544. return
  545. }
  546. }
  547. if (this.detailData.warehouseInOutDetail.bulkDensity) {
  548. if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
  549. .bulkDensity > 1000) {
  550. this.$api.msg('容重输入错误')
  551. return
  552. }
  553. if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
  554. .detailData.warehouseInOutDetail.bulkDensity).length - (
  555. String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
  556. this.$api.msg('容重输入错误')
  557. return
  558. }
  559. }
  560. if (this.detailData.warehouseInOutDetail.jiaorenli) {
  561. if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
  562. .jiaorenli > 40) {
  563. this.$api.msg('热损伤占比输入错误')
  564. return
  565. }
  566. if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
  567. .warehouseInOutDetail.jiaorenli).length - (String(
  568. this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
  569. this.$api.msg('热损伤占比输入错误')
  570. return
  571. }
  572. }
  573. if (this.detailData.warehouseInOutDetail.impurity) {
  574. if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
  575. .impurity > 40) {
  576. this.$api.msg('杂质占比输入错误')
  577. return
  578. }
  579. if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
  580. .warehouseInOutDetail.impurity).length - (String(
  581. this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
  582. this.$api.msg('杂质占比输入错误')
  583. return
  584. }
  585. }
  586. if (this.detailData.warehouseInOutDetail.mildewGrain) {
  587. if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
  588. .mildewGrain > 40) {
  589. this.$api.msg('霉变粒占比输入错误')
  590. return
  591. }
  592. if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
  593. .detailData
  594. .warehouseInOutDetail.mildewGrain).length - (String(
  595. this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
  596. this.$api.msg('霉变粒占比输入错误')
  597. return
  598. }
  599. }
  600. if (this.detailData.warehouseInOutDetail.imperfectGrain) {
  601. if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
  602. .imperfectGrain > 40) {
  603. this.$api.msg('不完善粒占比输入错误')
  604. return
  605. }
  606. if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
  607. .detailData
  608. .warehouseInOutDetail.imperfectGrain).length - (String(
  609. this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
  610. this.$api.msg('不完善粒占比输入错误')
  611. return
  612. }
  613. }
  614. this.detailData.baseId = helper.erpWarehouse.warehouseId
  615. this.detailData.positionId = helper.erpWarehouse.positionId
  616. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  617. this.detailData.binNumber = this.binNumber
  618. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
  619. this.detailData.compId = helper.erpWarehouse.compId
  620. this.detailData.netWeight = this.netWeight
  621. this.detailData.inOutFlag = 1
  622. this.detailData.taskType = "出库任务"
  623. this.detailData.pcFlag = 0
  624. let title = ""
  625. if (num == 1) {
  626. this.detailData.statusFlag = 1
  627. this.detailData.backOffice = this.userInfo.userName
  628. this.detailData.backOfficeId = this.userInfo.id
  629. title = "暂存成功"
  630. } else if (num == 2) {
  631. this.detailData.statusFlag = 3
  632. this.detailData.backOffice = this.userInfo.userName
  633. this.detailData.backOfficeId = this.userInfo.id
  634. title = "提交成功"
  635. }
  636. let that = this
  637. uni.showModal({
  638. content: "确定提交出库信息?",
  639. success(res) {
  640. if (res.confirm) {
  641. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  642. that.detailData).then(res => {
  643. if (res.data.code == 200) {
  644. that.$api.msg(title)
  645. setTimeout(() => {
  646. uni.navigateBack()
  647. }, 1000)
  648. } else {
  649. that.$api.msg(res.data.message)
  650. }
  651. })
  652. }
  653. }
  654. })
  655. },
  656. slectcontractNo() {
  657. uni.navigateTo({
  658. url: '/pages/erp/warehousing/selectContractNo?flag=' + 5
  659. })
  660. },
  661. slectCarNo() {
  662. uni.navigateTo({
  663. url: '/pages/erp/exWarehousing/selectCarNo'
  664. })
  665. },
  666. }
  667. }
  668. </script>
  669. <style scoped lang="scss">
  670. uni-page-body {
  671. overflow: hidden;
  672. }
  673. .warp {
  674. margin: 10rpx;
  675. padding: 20rpx 20rpx 140rpx 20rpx;
  676. .top {
  677. display: flex;
  678. margin-bottom: 20rpx;
  679. .top-left {
  680. margin-right: 20rpx;
  681. }
  682. }
  683. }
  684. .content,
  685. .content1,
  686. .content2 {
  687. border-radius: 20rpx;
  688. background: white;
  689. padding: 20rpx;
  690. .title {
  691. font-size: 28rpx;
  692. font-weight: 600;
  693. color: #333333;
  694. }
  695. .row {
  696. display: flex;
  697. justify-content: space-between;
  698. border-bottom: 1px solid #EEEEEE;
  699. padding: 21rpx 0;
  700. .right,
  701. input {
  702. font-size: 28rpx;
  703. color: #333333;
  704. }
  705. }
  706. .row-bottom {
  707. // border: 0;
  708. .right-bottom {
  709. width: 300rpx;
  710. text-align: right;
  711. }
  712. }
  713. }
  714. .content1 {
  715. margin-top: 20rpx;
  716. }
  717. .content2 {
  718. margin-top: 10px;
  719. // display: flex;
  720. align-items: center;
  721. .left {
  722. margin-right: 20px;
  723. }
  724. }
  725. .submit {
  726. width: 40%;
  727. background: #22C572;
  728. border-radius: 10rpx;
  729. }
  730. .edit-btn {
  731. background: #22C572;
  732. width: 100rpx;
  733. height: 50rpx;
  734. margin: 0;
  735. color: white;
  736. }
  737. .has-btn {
  738. align-items: center;
  739. }
  740. .bottom-btn {
  741. padding: 30rpx;
  742. background: #FFFFFF;
  743. width: 92%;
  744. position: fixed;
  745. bottom: 0rpx;
  746. display: flex;
  747. z-index: 9999;
  748. }
  749. </style>