exWarehousing.vue 23 KB

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