exWarehousing.vue 30 KB

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