exWarehousing.vue 29 KB

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