improvedExWaehousingDetail.vue 29 KB

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