improvedExWaehousingDetail.vue 27 KB

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