exWarehousing.vue 30 KB

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