exWarehousing.vue 25 KB

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