exWarehousing.vue 29 KB

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