improvedExWaehousingDetail.vue 27 KB

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