exWarehousing.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914
  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. }else if (this.detailData.inOutType == '退库') {
  392. if(this.outContractNo[i].contractNo){
  393. this.deptBudgetList.tips='卖方'+this.contractNoList[i].seller
  394. }
  395. else{
  396. this.deptBudgetList.tips='入货库'+this.inOutNoList[e[0]].warehouseName
  397. }
  398. }
  399. }
  400. }
  401. })
  402. },
  403. inOutChange(e){
  404. this.detailData.inOutTaskNo = this.inOutNoList[e[0]].inOutTaskNo
  405. this.detailData.agent = this.inOutNoList[e[0]].agent
  406. if(this.inOutNoList[e[0]].contractNo){
  407. this.detailData.contractNo = this.inOutNoList[e[0]].contractNo
  408. }else{
  409. this.detailData.contractNo = this.inOutNoList[e[0]].moveTaskNo
  410. }
  411. this.detailData.goodsName = this.inOutNoList[e[0]].goodsName
  412. this.detailData.grade = this.inOutNoList[e[0]].grade
  413. this.detailData.inOutType = this.inOutNoList[e[0]].inOutType
  414. if (this.detailData.inOutType == '销售出库') {
  415. this.detailData.tips='买方'+this.contractNoList[i].buyer
  416. } else if (this.detailData.inOutType == '移库出库') {
  417. this.detailData.tips='出货库'+this.inOutNoList[e[0]].warehouseName
  418. }else if (this.detailData.inOutType == '退库') {
  419. if(this.contractNoList[i].contractNo){
  420. this.deptBudgetList.tips='卖方'+this.contractNoList[i].seller
  421. }
  422. else{
  423. this.deptBudgetList.tips='入货库'+this.inOutNoList[e[0]].warehouseName
  424. }
  425. }
  426. },
  427. toUpperCase(val) {
  428. this.detailData.boxNo = val.detail.value.toUpperCase()
  429. },
  430. toUpperCase1(val) {
  431. this.detailData.boxNoOther = val.detail.value.toUpperCase()
  432. },
  433. usestartChange(e) {
  434. this.usestart = this.multiSelector1[e].name
  435. },
  436. //计算纯重
  437. pureWeightCount() {
  438. if (this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this
  439. .detailData.tidalGrainWater) {
  440. // 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
  441. this.detailData.pureWeight = 100 - (this.detailData.tidalGrainWater - this.detailData
  442. .solidGrainWater) * this.netWeight * this.detailData.buckleWeightRatio / 100
  443. this.detailData.pureWeight = this.detailData.pureWeight.toFixed(3)
  444. }
  445. },
  446. outtypeChange(e) {
  447. this.detailData.outType = this.multiSelector[e].name
  448. console.log(e)
  449. },
  450. outWarehouse() {
  451. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  452. constId: 'CON6'
  453. }).then(res => {
  454. this.warehousingTypeList = res.data.data
  455. })
  456. },
  457. handler() {
  458. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  459. compId: helper.erpWarehouse.compId,
  460. warehouseId: helper.erpWarehouse.warehouseId
  461. }).then(res => {
  462. this.handlerList = res.data.data
  463. })
  464. },
  465. contractNopicker(e) {
  466. },
  467. typePicker(e) {
  468. this.detailData.type = this.typeList[e].type
  469. },
  470. pjPicker(e) {
  471. this.detailData.gradeKey = e[0] + 1
  472. this.detailData.grade = this.pjList[e].type
  473. },
  474. handlerPicker(e) {
  475. this.detailData.agentKey = e[0]
  476. this.detailData.agent = this.handlerList[e].staffName
  477. },
  478. dateChange(e) {
  479. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  480. },
  481. warehousingTypePicker(e) {
  482. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  483. if (this.detailData.inOutType == '销售出库') {
  484. this.detailData.inOutTypeKey = 1
  485. } else if (this.detailData.inOutType == '移库出库') {
  486. this.detailData.inOutTypeKey = 3
  487. } else if (this.detailData.inOutType == '暂存出库') {
  488. this.detailData.inOutTypeKey = 4
  489. } else if (this.detailData.inOutType == '贸易服务出库') {
  490. this.detailData.inOutTypeKey = 5
  491. } else if (this.detailData.inOutType == '采购出库') {
  492. this.detailData.inOutTypeKey = 6
  493. }
  494. },
  495. filterFileType(index, lists) {
  496. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  497. lists.splice(index, 1);
  498. // 当前文件不支持
  499. uni.showModal({
  500. title: '暂不支持当前图片类型',
  501. showCancel: false
  502. });
  503. } else {
  504. this.isAdd = false;
  505. }
  506. },
  507. calculate() {
  508. if (this.detailData.grossWeight && this.detailData.tare) {
  509. this.netWeight = this.detailData.grossWeight - this.detailData.tare
  510. }
  511. },
  512. getImgUrl(res) {
  513. this.detailData.addressUrl = res
  514. },
  515. onError(error) {
  516. console.log('------------error-----------')
  517. console.log(error)
  518. },
  519. binNumberpicker(e) {
  520. this.detailData.binNumber = this.positionList[e[0]].binNumber
  521. },
  522. onProgress(e) {},
  523. onRemove() {
  524. this.detailData.addressUrl = ""
  525. },
  526. submit(num) {
  527. if (!this.detailData.contractNo) {
  528. this.$api.msg('合同编号不能为空')
  529. return
  530. }
  531. if (!this.detailData.goodsName) {
  532. this.$api.msg('货名不能为空')
  533. return
  534. }
  535. if (!this.detailData.grossWeight && num == 2) {
  536. this.$api.msg('毛重不能为空')
  537. return
  538. }
  539. if (isNaN(this.detailData.grossWeight) ||
  540. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  541. String(this.detailData.grossWeight).length -
  542. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  543. 3) ||
  544. this.detailData.grossWeight < 0 ||
  545. this.detailData.grossWeight > 10000
  546. ) {
  547. this.$api.msg('毛重输入错误!')
  548. return
  549. }
  550. if (!this.detailData.tare && num == 2) {
  551. this.$api.msg('皮重不能为空')
  552. return
  553. }
  554. if (isNaN(this.detailData.tare) ||
  555. (String(this.detailData.tare).indexOf('.') != -1 &&
  556. String(this.detailData.tare).length -
  557. (String(this.detailData.tare).indexOf('.') + 1) >
  558. 3) ||
  559. this.detailData.tare < 0 ||
  560. this.detailData.tare > 10000
  561. ) {
  562. this.$api.msg('皮重输入错误!')
  563. return
  564. }
  565. if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
  566. this.$api.msg('皮重不能大于毛重')
  567. return
  568. }
  569. if (this.netWeight <= 0 && num == 2) {
  570. this.$api.msg('净重不能小于等于0')
  571. return
  572. }
  573. if (this.detailData.type == "潮粮") {
  574. if (!this.detailData.buckleWeightRatio && num == 2) {
  575. this.$api.msg('扣重比不能为空')
  576. return
  577. }
  578. if (isNaN(this.detailData.buckleWeightRatio) ||
  579. (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
  580. String(this.detailData.buckleWeightRatio).length -
  581. (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
  582. 2) ||
  583. this.detailData.buckleWeightRatio < 0 ||
  584. this.detailData.buckleWeightRatio > 3
  585. ) {
  586. this.$api.msg('扣重比输入错误!')
  587. return
  588. }
  589. if (!this.detailData.solidGrainWater && num == 2) {
  590. this.$api.msg('干粮水分不能为空')
  591. return
  592. }
  593. if (isNaN(this.detailData.solidGrainWater) ||
  594. (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
  595. String(this.detailData.solidGrainWater).length -
  596. (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
  597. 1) ||
  598. this.detailData.solidGrainWater < 1 ||
  599. this.detailData.solidGrainWater > 40
  600. ) {
  601. this.$api.msg('干粮水分输入错误!')
  602. return
  603. }
  604. if (!this.detailData.tidalGrainWater && num == 2) {
  605. this.$api.msg('潮粮水分不能为空')
  606. return
  607. }
  608. if (isNaN(this.detailData.tidalGrainWater) ||
  609. (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
  610. String(this.detailData.tidalGrainWater).length -
  611. (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
  612. 1) ||
  613. this.detailData.tidalGrainWater < 1 ||
  614. this.detailData.tidalGrainWater > 40
  615. ) {
  616. this.$api.msg('潮粮水分输入错误!')
  617. return
  618. }
  619. if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
  620. this.$api.msg('潮粮水分输入错误!')
  621. return
  622. }
  623. if (!this.detailData.pureWeight && num == 2) {
  624. this.$api.msg('纯重不能为空')
  625. return
  626. }
  627. }
  628. if (this.detailData.grade == "请输入品级" && num == 2) {
  629. this.$api.msg('品级不能为空')
  630. return
  631. }
  632. if (this.detailData.agent == "请选择经办人") {
  633. this.$api.msg('经办人不能为空')
  634. return
  635. }
  636. if (this.detailData.inOutDate == "请选择出库日期") {
  637. this.$api.msg('出库日期不能为空')
  638. return
  639. }
  640. if (this.detailData.inOutType == "请选择出库类型") {
  641. this.$api.msg('出库类型不能为空')
  642. return
  643. }
  644. if (!this.detailData.carNo && num == 2) {
  645. this.$api.msg('车牌号不能为空')
  646. return
  647. }
  648. if (this.detailData.carNo.length != 7) {
  649. this.$api.msg('车牌号输入有误!')
  650. return
  651. }
  652. if (!this.detailData.addressUrl && num == 2) {
  653. this.$api.msg('请上传磅单')
  654. return
  655. }
  656. if (this.detailData.warehouseInOutDetail.qualityInspector) {
  657. if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
  658. .qualityInspector > 10) {
  659. this.$api.msg('质检员姓名需要2-10个字')
  660. return
  661. }
  662. }
  663. if (this.detailData.warehouseInOutDetail.waterContent) {
  664. if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
  665. .detailData.tidalGrainWater) {
  666. this.$api.msg('水分占比与潮粮水分不一致')
  667. return
  668. }
  669. if (this.detailData.type == "干粮") {
  670. if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
  671. .waterContent > 40) {
  672. this.$api.msg('水分占比输入错误')
  673. return
  674. }
  675. }
  676. if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
  677. .detailData.warehouseInOutDetail.waterContent).length - (String(
  678. this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
  679. this.$api.msg('水分占比输入错误')
  680. return
  681. }
  682. }
  683. if (this.detailData.warehouseInOutDetail.bulkDensity) {
  684. if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
  685. .bulkDensity > 1000) {
  686. this.$api.msg('容重输入错误')
  687. return
  688. }
  689. if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
  690. .detailData.warehouseInOutDetail.bulkDensity).length - (
  691. String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
  692. this.$api.msg('容重输入错误')
  693. return
  694. }
  695. }
  696. if (this.detailData.warehouseInOutDetail.jiaorenli) {
  697. if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
  698. .jiaorenli > 40) {
  699. this.$api.msg('热损伤占比输入错误')
  700. return
  701. }
  702. if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
  703. .warehouseInOutDetail.jiaorenli).length - (String(
  704. this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
  705. this.$api.msg('热损伤占比输入错误')
  706. return
  707. }
  708. }
  709. if (this.detailData.warehouseInOutDetail.impurity) {
  710. if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
  711. .impurity > 40) {
  712. this.$api.msg('杂质占比输入错误')
  713. return
  714. }
  715. if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
  716. .warehouseInOutDetail.impurity).length - (String(
  717. this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
  718. this.$api.msg('杂质占比输入错误')
  719. return
  720. }
  721. }
  722. if (this.detailData.warehouseInOutDetail.mildewGrain) {
  723. if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
  724. .mildewGrain > 40) {
  725. this.$api.msg('霉变粒占比输入错误')
  726. return
  727. }
  728. if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
  729. .detailData
  730. .warehouseInOutDetail.mildewGrain).length - (String(
  731. this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
  732. this.$api.msg('霉变粒占比输入错误')
  733. return
  734. }
  735. }
  736. if (this.detailData.warehouseInOutDetail.imperfectGrain) {
  737. if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
  738. .imperfectGrain > 40) {
  739. this.$api.msg('不完善粒占比输入错误')
  740. return
  741. }
  742. if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
  743. .detailData
  744. .warehouseInOutDetail.imperfectGrain).length - (String(
  745. this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
  746. this.$api.msg('不完善粒占比输入错误')
  747. return
  748. }
  749. }
  750. if (this.detailData.boxNo) {
  751. this.detailData.boxNo = this.detailData.boxNo.toUpperCase()
  752. }
  753. if (this.detailData.boxNoOther) {
  754. this.detailData.boxNoOther = this.detailData.boxNoOther.toUpperCase()
  755. }
  756. this.detailData.baseId = helper.erpWarehouse.warehouseId
  757. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  758. this.detailData.positionId = helper.erpWarehouse.positionId
  759. this.detailData.binNumber = this.binNumber
  760. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNoCK').goodsNameKey;
  761. this.detailData.compId = helper.erpWarehouse.compId
  762. this.detailData.netWeight = this.netWeight
  763. this.detailData.inOutFlag = 1
  764. this.detailData.taskType = "出库任务"
  765. this.detailData.pcFlag = 0
  766. let title = ""
  767. if (num == 1) {
  768. this.detailData.statusFlag = 1
  769. this.detailData.backOffice = this.userInfo.userName
  770. this.detailData.backOfficeId = this.userInfo.id
  771. title = "暂存成功"
  772. } else if (num == 2) {
  773. this.detailData.statusFlag = 3
  774. this.detailData.backOffice = this.userInfo.userName
  775. this.detailData.backOfficeId = this.userInfo.id
  776. title = "提交成功"
  777. }
  778. let that = this
  779. uni.showModal({
  780. content: "确定提交出库信息?",
  781. success(res) {
  782. if (res.confirm) {
  783. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  784. that.detailData).then(res => {
  785. console.log(res, "报异常")
  786. if (res.data.code == 200) {
  787. that.$api.msg(title)
  788. setTimeout(() => {
  789. uni.navigateBack()
  790. }, 1000)
  791. } else {
  792. that.$api.msg(res.data.message)
  793. }
  794. })
  795. }
  796. }
  797. })
  798. },
  799. slectcontractNo() {
  800. uni.navigateTo({
  801. url: '/pages/erp/exWarehousing/selectContractNo?flag=' + 5
  802. })
  803. },
  804. slectCarNo() {
  805. uni.navigateTo({
  806. url: '/pages/erp/exWarehousing/selectCarNo'
  807. })
  808. },
  809. }
  810. }
  811. </script>
  812. <style scoped lang="scss">
  813. uni-page-body {
  814. overflow: hidden;
  815. }
  816. .warp {
  817. margin: 10rpx;
  818. padding: 20rpx 20rpx 300rpx 20rpx;
  819. .top {
  820. display: flex;
  821. margin-bottom: 20rpx;
  822. .top-left {
  823. margin-right: 20rpx;
  824. }
  825. }
  826. }
  827. .content,
  828. .content1,
  829. .content2 {
  830. border-radius: 20rpx;
  831. background: white;
  832. padding: 20rpx;
  833. .title {
  834. font-size: 28rpx;
  835. font-weight: 600;
  836. color: #333333;
  837. }
  838. .row {
  839. display: flex;
  840. justify-content: space-between;
  841. border-bottom: 1px solid #EEEEEE;
  842. padding: 21rpx 0;
  843. .right,
  844. input {
  845. font-size: 28rpx;
  846. color: #333333;
  847. }
  848. }
  849. .row-bottom {
  850. // border: 0;
  851. .right-bottom {
  852. width: 280rpx;
  853. text-align: right;
  854. }
  855. }
  856. }
  857. .content1 {
  858. margin-top: 20rpx;
  859. }
  860. .content2 {
  861. margin-top: 10px;
  862. // display: flex;
  863. align-items: center;
  864. .left {
  865. margin-right: 20px;
  866. }
  867. }
  868. .submit {
  869. width: 40%;
  870. background: #22C572;
  871. border-radius: 10rpx;
  872. }
  873. .edit-btn {
  874. background: #22C572;
  875. width: 100rpx;
  876. height: 50rpx;
  877. margin: 0;
  878. color: white;
  879. }
  880. .has-btn {
  881. align-items: center;
  882. }
  883. .bottom-btn {
  884. padding: 30rpx;
  885. background: #FFFFFF;
  886. width: 92%;
  887. position: fixed;
  888. bottom: 0rpx;
  889. display: flex;
  890. z-index: 9999;
  891. }
  892. </style>