exWarehousing.vue 22 KB

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