improvedExWaehousingDetail.vue 23 KB

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