improvedExWaehousingDetail.vue 28 KB

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