exWarehousing.vue 29 KB

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