improvedExWaehousingDetail.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  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' class="right-bottom" placeholder="请输入箱号"></input>
  108. <input v-model='detailData.boxNoOther' 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' class="right-bottom"
  114. placeholder="请输入封号"></input>
  115. <input v-model='detailData.titleNoOther' 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.wingNumber' @input="toUpperCase2" class="right-bottom"
  121. placeholder="请输入车厢号"></input>
  122. <input v-model='detailData.wingNumberOther' @input="toUpperCase3" 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. toUpperCase2(val) {
  368. this.detailData.wingNumber = val.detail.value.toUpperCase()
  369. },
  370. toUpperCase3(val) {
  371. this.detailData.wingNumberOther = val.detail.value.toUpperCase()
  372. },
  373. outtypeChange(e) {
  374. this.detailData.outType = this.multiSelector[e].name
  375. console.log(e)
  376. },
  377. //计算纯重
  378. pureWeightCount() {
  379. if (this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this
  380. .detailData.tidalGrainWater) {
  381. // 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
  382. this.detailData.pureWeight = 100 - (this.detailData.tidalGrainWater - this.detailData
  383. .solidGrainWater) * this.netWeight * this.detailData.buckleWeightRatio / 100
  384. this.detailData.pureWeight = this.detailData.pureWeight.toFixed(3)
  385. }
  386. },
  387. outWarehouse() {
  388. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  389. constId: 'CON6'
  390. }).then(res => {
  391. this.warehousingTypeList = res.data.data
  392. })
  393. },
  394. handler() {
  395. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  396. compId: helper.erpWarehouse.compId,
  397. warehouseId: helper.erpWarehouse.warehouseId
  398. }).then(res => {
  399. this.handlerList = res.data.data
  400. })
  401. },
  402. contractNopicker(e) {
  403. },
  404. typePicker(e) {
  405. this.detailData.type = this.typeList[e].type
  406. },
  407. pjPicker(e) {
  408. this.detailData.gradeKey = e[0]
  409. this.detailData.grade = this.pjList[e].type
  410. },
  411. handlerPicker(e) {
  412. this.detailData.agentKey = e[0]
  413. this.detailData.agent = this.handlerList[e].staffName
  414. },
  415. dateChange(e) {
  416. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  417. },
  418. warehousingTypePicker(e) {
  419. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  420. if (this.detailData.inOutType == '销售出库') {
  421. this.detailData.inOutTypeKey = 1
  422. } else if (this.detailData.inOutType == '移库出库') {
  423. this.detailData.inOutTypeKey = 3
  424. } else if (this.detailData.inOutType == '暂存出库') {
  425. this.detailData.inOutTypeKey = 4
  426. } else if (this.detailData.inOutType == '贸易服务出库') {
  427. this.detailData.inOutTypeKey = 5
  428. } else if (this.detailData.inOutType == '采购出库') {
  429. this.detailData.inOutTypeKey = 6
  430. }
  431. },
  432. filterFileType(index, lists) {
  433. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  434. lists.splice(index, 1);
  435. // 当前文件不支持
  436. uni.showModal({
  437. title: '暂不支持当前图片类型',
  438. showCancel: false
  439. });
  440. } else {
  441. this.isAdd = false;
  442. }
  443. },
  444. calculate() {
  445. if (this.detailData.grossWeight && this.detailData.tare) {
  446. this.netWeight = this.detailData.grossWeight - this.detailData.tare
  447. }
  448. },
  449. getImgUrl(res) {
  450. this.detailData.addressUrl = res
  451. console.log(res)
  452. console.log('------------res-----------')
  453. },
  454. onError(error) {
  455. alert(error)
  456. console.log('------------error-----------')
  457. console.log(error)
  458. },
  459. binNumberpicker(e) {
  460. this.detailData.binNumber = this.positionList[e[0]].binNumber
  461. },
  462. onProgress(e) {},
  463. onRemove(index) {},
  464. submit(num) {
  465. if (!this.detailData.contractNo) {
  466. this.$api.msg('合同编号不能为空')
  467. return
  468. }
  469. if (!this.detailData.goodsName) {
  470. this.$api.msg('货名不能为空')
  471. return
  472. }
  473. if (!this.detailData.grossWeight && num == 2) {
  474. this.$api.msg('毛重不能为空')
  475. return
  476. }
  477. if (isNaN(this.detailData.grossWeight) ||
  478. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  479. String(this.detailData.grossWeight).length -
  480. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  481. 3) ||
  482. this.detailData.grossWeight < 0 ||
  483. this.detailData.grossWeight > 10000
  484. ) {
  485. this.$api.msg('毛重输入错误!')
  486. return
  487. }
  488. if (!this.detailData.tare && num == 2) {
  489. this.$api.msg('皮重不能为空')
  490. return
  491. }
  492. if (isNaN(this.detailData.tare) ||
  493. (String(this.detailData.tare).indexOf('.') != -1 &&
  494. String(this.detailData.tare).length -
  495. (String(this.detailData.tare).indexOf('.') + 1) >
  496. 3) ||
  497. this.detailData.tare < 0 ||
  498. this.detailData.tare > 10000
  499. ) {
  500. this.$api.msg('皮重输入错误!')
  501. return
  502. }
  503. if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
  504. this.$api.msg('皮重不能大于毛重')
  505. return
  506. }
  507. if (this.netWeight <= 0 && num == 2) {
  508. this.$api.msg('净重不能小于等于0')
  509. return
  510. }
  511. if (this.detailData.type == "潮粮") {
  512. if (!this.detailData.buckleWeightRatio && num == 2) {
  513. this.$api.msg('扣重比不能为空')
  514. return
  515. }
  516. if (isNaN(this.detailData.buckleWeightRatio) ||
  517. (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
  518. String(this.detailData.buckleWeightRatio).length -
  519. (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
  520. 2) ||
  521. this.detailData.buckleWeightRatio < 0 ||
  522. this.detailData.buckleWeightRatio > 2
  523. ) {
  524. this.$api.msg('扣重比输入错误!')
  525. return
  526. }
  527. if (!this.detailData.solidGrainWater && num == 2) {
  528. this.$api.msg('干粮水分不能为空')
  529. return
  530. }
  531. if (isNaN(this.detailData.solidGrainWater) ||
  532. (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
  533. String(this.detailData.solidGrainWater).length -
  534. (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
  535. 1) ||
  536. this.detailData.solidGrainWater < 1 ||
  537. this.detailData.solidGrainWater > 40
  538. ) {
  539. this.$api.msg('干粮水分输入错误!')
  540. return
  541. }
  542. if (!this.detailData.tidalGrainWater && num == 2) {
  543. this.$api.msg('潮粮水分不能为空')
  544. return
  545. }
  546. if (isNaN(this.detailData.tidalGrainWater) ||
  547. (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
  548. String(this.detailData.tidalGrainWater).length -
  549. (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
  550. 1) ||
  551. this.detailData.tidalGrainWater < 1 ||
  552. this.detailData.tidalGrainWater > 40
  553. ) {
  554. this.$api.msg('潮粮水分输入错误!')
  555. return
  556. }
  557. if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
  558. this.$api.msg('潮粮水分输入错误!')
  559. return
  560. }
  561. if (!this.detailData.pureWeight && num == 2) {
  562. this.$api.msg('纯重不能为空')
  563. return
  564. }
  565. }
  566. if (this.detailData.grade == "请输入品级") {
  567. this.$api.msg('品级不能为空')
  568. return
  569. }
  570. if (this.detailData.agent == "请选择经办人") {
  571. this.$api.msg('经办人不能为空')
  572. return
  573. }
  574. if (this.detailData.inOutDate == "请选择出库日期") {
  575. this.$api.msg('出库日期不能为空')
  576. return
  577. }
  578. if (this.detailData.inOutType == "请选择出库类型") {
  579. this.$api.msg('出库类型不能为空')
  580. return
  581. }
  582. if (!this.detailData.carNo && num == 2) {
  583. this.$api.msg('车牌号不能为空')
  584. return
  585. }
  586. if (this.detailData.carNo.length != 7) {
  587. this.$api.msg('车牌号输入有误!')
  588. return
  589. }
  590. if (!this.detailData.addressUrl && num == 2) {
  591. this.$api.msg('请上传磅单')
  592. return
  593. }
  594. if (this.detailData.warehouseInOutDetail.qualityInspector) {
  595. if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
  596. .qualityInspector > 10) {
  597. this.$api.msg('质检员姓名需要2-10个字')
  598. return
  599. }
  600. }
  601. if (this.detailData.warehouseInOutDetail.waterContent) {
  602. if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
  603. .detailData.tidalGrainWater) {
  604. this.$api.msg('水分占比与潮粮水分不一致')
  605. return
  606. }
  607. if (this.detailData.type == "干粮") {
  608. if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
  609. .waterContent > 40) {
  610. this.$api.msg('水分占比输入错误')
  611. return
  612. }
  613. }
  614. if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
  615. .detailData.warehouseInOutDetail.waterContent).length - (String(
  616. this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
  617. this.$api.msg('水分占比输入错误')
  618. return
  619. }
  620. }
  621. if (this.detailData.warehouseInOutDetail.bulkDensity) {
  622. if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
  623. .bulkDensity > 1000) {
  624. this.$api.msg('容重输入错误')
  625. return
  626. }
  627. if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
  628. .detailData.warehouseInOutDetail.bulkDensity).length - (
  629. String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
  630. this.$api.msg('容重输入错误')
  631. return
  632. }
  633. }
  634. if (this.detailData.warehouseInOutDetail.jiaorenli) {
  635. if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
  636. .jiaorenli > 40) {
  637. this.$api.msg('热损伤占比输入错误')
  638. return
  639. }
  640. if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
  641. .warehouseInOutDetail.jiaorenli).length - (String(
  642. this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
  643. this.$api.msg('热损伤占比输入错误')
  644. return
  645. }
  646. }
  647. if (this.detailData.warehouseInOutDetail.impurity) {
  648. if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
  649. .impurity > 40) {
  650. this.$api.msg('杂质占比输入错误')
  651. return
  652. }
  653. if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
  654. .warehouseInOutDetail.impurity).length - (String(
  655. this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
  656. this.$api.msg('杂质占比输入错误')
  657. return
  658. }
  659. }
  660. if (this.detailData.warehouseInOutDetail.mildewGrain) {
  661. if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
  662. .mildewGrain > 40) {
  663. this.$api.msg('霉变粒占比输入错误')
  664. return
  665. }
  666. if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
  667. .detailData
  668. .warehouseInOutDetail.mildewGrain).length - (String(
  669. this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
  670. this.$api.msg('霉变粒占比输入错误')
  671. return
  672. }
  673. }
  674. if (this.detailData.warehouseInOutDetail.imperfectGrain) {
  675. if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
  676. .imperfectGrain > 40) {
  677. this.$api.msg('不完善粒占比输入错误')
  678. return
  679. }
  680. if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
  681. .detailData
  682. .warehouseInOutDetail.imperfectGrain).length - (String(
  683. this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
  684. this.$api.msg('不完善粒占比输入错误')
  685. return
  686. }
  687. }
  688. if (this.detailData.boxNo) {
  689. this.detailData.boxNo = this.detailData.boxNo.toUpperCase()
  690. }
  691. if (this.detailData.boxNoOther) {
  692. this.detailData.boxNoOther = this.detailData.boxNoOther.toUpperCase()
  693. }
  694. this.detailData.baseId = helper.erpWarehouse.warehouseId
  695. this.detailData.positionId = helper.erpWarehouse.positionId
  696. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  697. this.detailData.binNumber = this.binNumber
  698. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
  699. this.detailData.compId = helper.erpWarehouse.compId
  700. this.detailData.netWeight = this.netWeight
  701. this.detailData.inOutFlag = 1
  702. this.detailData.taskType = "出库任务"
  703. this.detailData.pcFlag = 0
  704. let title = ""
  705. if (num == 1) {
  706. this.detailData.statusFlag = 1
  707. this.detailData.backOffice = this.userInfo.userName
  708. this.detailData.backOfficeId = this.userInfo.id
  709. title = "暂存成功"
  710. } else if (num == 2) {
  711. this.detailData.statusFlag = 3
  712. this.detailData.backOffice = this.userInfo.userName
  713. this.detailData.backOfficeId = this.userInfo.id
  714. title = "提交成功"
  715. }
  716. let that = this
  717. uni.showModal({
  718. content: "确定提交出库信息?",
  719. success(res) {
  720. if (res.confirm) {
  721. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  722. that.detailData).then(res => {
  723. if (res.data.code == 200) {
  724. that.$api.msg(title)
  725. setTimeout(() => {
  726. uni.navigateBack()
  727. }, 1000)
  728. } else {
  729. that.$api.msg(res.data.message)
  730. }
  731. })
  732. }
  733. }
  734. })
  735. },
  736. slectcontractNo() {
  737. uni.navigateTo({
  738. url: '/pages/erp/warehousing/selectContractNo?flag=' + 5
  739. })
  740. },
  741. slectCarNo() {
  742. uni.navigateTo({
  743. url: '/pages/erp/exWarehousing/selectCarNo'
  744. })
  745. },
  746. }
  747. }
  748. </script>
  749. <style scoped lang="scss">
  750. uni-page-body {
  751. overflow: hidden;
  752. }
  753. .warp {
  754. margin: 10rpx;
  755. padding: 20rpx 20rpx 300rpx 20rpx;
  756. .top {
  757. display: flex;
  758. margin-bottom: 20rpx;
  759. .top-left {
  760. margin-right: 20rpx;
  761. }
  762. }
  763. }
  764. .content,
  765. .content1,
  766. .content2 {
  767. border-radius: 20rpx;
  768. background: white;
  769. padding: 20rpx;
  770. .title {
  771. font-size: 28rpx;
  772. font-weight: 600;
  773. color: #333333;
  774. }
  775. .row {
  776. display: flex;
  777. justify-content: space-between;
  778. border-bottom: 1px solid #EEEEEE;
  779. padding: 21rpx 0;
  780. .right,
  781. input {
  782. font-size: 28rpx;
  783. color: #333333;
  784. }
  785. }
  786. .row-bottom {
  787. // border: 0;
  788. .right-bottom {
  789. width: 280rpx;
  790. text-align: right;
  791. }
  792. }
  793. }
  794. .content1 {
  795. margin-top: 20rpx;
  796. }
  797. .content2 {
  798. margin-top: 10px;
  799. // display: flex;
  800. align-items: center;
  801. .left {
  802. margin-right: 20px;
  803. }
  804. }
  805. .submit {
  806. width: 40%;
  807. background: #22C572;
  808. border-radius: 10rpx;
  809. }
  810. .edit-btn {
  811. background: #22C572;
  812. width: 100rpx;
  813. height: 50rpx;
  814. margin: 0;
  815. color: white;
  816. }
  817. .has-btn {
  818. align-items: center;
  819. }
  820. .bottom-btn {
  821. padding: 30rpx;
  822. background: #FFFFFF;
  823. width: 92%;
  824. position: fixed;
  825. bottom: 0rpx;
  826. display: flex;
  827. z-index: 9999;
  828. }
  829. </style>