ex_warehouse.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. <template>
  2. <view class="container">
  3. <view class="center">
  4. <view class="title_b ">发运信息</view>
  5. <view class="c-row ">
  6. <text class="tit">合同编号</text>
  7. <view class="con-list">
  8. <text>{{WarehouseInOutInfo.contractNo}}</text>
  9. </view>
  10. </view>
  11. <view class="c-row ">
  12. <text class="tit">收货方</text>
  13. <view class="con-list">
  14. <text>{{WarehouseInOutInfo.consignee}}</text>
  15. </view>
  16. </view>
  17. <view class="c-row ">
  18. <text class="tit">货名</text>
  19. <view class="con-list">
  20. <text>{{WarehouseInOutInfo.goodsName}}</text>
  21. </view>
  22. </view>
  23. <view class="c-row ">
  24. <text class="tit">车牌号</text>
  25. <view class="con-list">
  26. <text>{{WarehouseInOutInfo.carNo}} ({{WarehouseInOutInfo.tranCarNo}})</text>
  27. </view>
  28. </view>
  29. <view class="c-row ">
  30. <text class="tit">箱号</text>
  31. <view class="con-list">
  32. <text>{{WarehouseInOutInfo.boxNo}}</text>
  33. </view>
  34. </view>
  35. <view class="c-row ">
  36. <text class="tit">封号</text>
  37. <view class="con-list">
  38. <text>{{WarehouseInOutInfo.titleNo}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="center">
  43. <view class="title_c ">出库信息</view>
  44. <view class="c-list">
  45. <view class="c-row b-b">
  46. <text class="tit">毛重(吨)</text>
  47. <view style="color: #ff0000; padding-left: 10rpx;">*</view>
  48. <view class="con-list">
  49. <input placeholder-style="font-size:14px" placeholder="请输入毛重" name="input"
  50. v-model="WarehouseInOutInfo.grossWeight" @input="grossWeightInput"></input>
  51. </view>
  52. </view>
  53. <view class="c-row b-b">
  54. <view class="tit">皮重(吨)</view>
  55. <view style="color: #ff0000; padding-left: 10rpx;">*</view>
  56. <view class="con-list">
  57. <input placeholder-style="font-size:14px" placeholder="请输入皮重" name="input"
  58. v-model="WarehouseInOutInfo.tare" @input="tareInput"></input>
  59. </view>
  60. </view>
  61. <view class="c-row b-b">
  62. <text class="tit">净重(吨)</text>
  63. <view class="con-list">
  64. <text>{{numFilter(WarehouseInOutInfo.netWeight)}}</text>
  65. </view>
  66. </view>
  67. <view class="c-row b-b">
  68. <text class="tit">仓库</text>
  69. <view style="color: #ff0000; padding-left: 10rpx;">*</view>
  70. <view class="con-list">
  71. <picker @change="warehouseChange" :value="warehouseIndex" :range="warehouse" class="con-list">
  72. <view>
  73. {{warehouseIndex>-1?warehouse[warehouseIndex]:'请选择仓库'}}
  74. </view>
  75. </picker>
  76. </view>
  77. </view>
  78. <view class="c-row b-b">
  79. <view class="title">仓位号</view>
  80. <view style="color: #ff0000; padding-left: 10rpx;">*</view>
  81. <picker @change="warehouseChange1" :value="warehouseIndex1" :range="warehouse1" class="con-list">
  82. <view>
  83. {{warehouseIndex1>-1?warehouse1[warehouseIndex1]:'请选择仓位号'}}
  84. </view>
  85. </picker>
  86. </view>
  87. <view class="c-row b-b">
  88. <text class="tit">出库类型 </text>
  89. <picker @change="ruChange" :value="ruIndex" :range="ruType" class="con-list">
  90. <view>
  91. {{ruIndex>-1?ruType[ruIndex]:'请选择出库类型'}}
  92. </view>
  93. </picker>
  94. </view>
  95. <view class="c-row b-b">
  96. <text class="tit">出库日期</text>
  97. <view class="con-list" @click="show = true">
  98. {{WarehouseInOutInfo.inOutDate!=''?WarehouseInOutInfo.inOutDate:time}}
  99. </view>
  100. <u-picker :params='params' :default-time='time' @confirm="DateChange" v-model="show" mode="time">
  101. </u-picker>
  102. </view>
  103. <view class="c-row ">
  104. <text class="tit">上传磅单照片</text>
  105. </view>
  106. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  107. :size-type="['compressed']" @on-success="getImgUrl" @on-remove="onRemove"
  108. @on-uploaded="isAdd = true" :before-upload="filterFileType"></upload>
  109. </view>
  110. </view>
  111. <view class="center">
  112. <view class="title_c ">化验信息</view>
  113. <view class="c-list">
  114. <view class="c-row b-b">
  115. <view class="title">质检员</view>
  116. <view class="con-list">
  117. <input maxlength='10' minlength='2' placeholder-style="font-size:14px" placeholder="请输入质检员姓名"
  118. name="input" v-model="list.qualityInspector"></input>
  119. </view>
  120. </view>
  121. <view class="c-row b-b">
  122. <view class="title">蛋白(%)>=</view>
  123. <view class="con-list">
  124. <input placeholder-style="font-size:14px" placeholder="请输入蛋白占比" name="input"
  125. v-model="list.protein"></input>
  126. </view>
  127. </view>
  128. <view class="c-row b-b">
  129. <view class="title">水分(%)<= </view>
  130. <view class="con-list">
  131. <input placeholder-style="font-size:14px" placeholder="请输入水分占比" name="input"
  132. v-model="list.waterContent"></input>
  133. </view>
  134. </view>
  135. <view class="c-row b-b">
  136. <view class="title">容重(克/升)>= </view>
  137. <view class="con-list">
  138. <input placeholder-style="font-size:14px" placeholder="请输入容重" name="input"
  139. v-model="list.bulkDensity"></input>
  140. </view>
  141. </view>
  142. <view class="c-row b-b">
  143. <view class="title">热损伤(%)<= </view>
  144. <view class="con-list">
  145. <input placeholder-style="font-size:14px" placeholder="请输入热损伤占比" name="input"
  146. v-model="list.jiaorenli"></input>
  147. </view>
  148. </view>
  149. <view class="c-row b-b">
  150. <view class="title">杂质(%)<= </view>
  151. <view class="con-list">
  152. <input placeholder-style="font-size:14px" placeholder="请输入杂质占比" name="input"
  153. v-model="list.impurity"></input>
  154. </view>
  155. </view>
  156. <view class="c-row b-b">
  157. <view class="title">霉变粒(%)<= </view>
  158. <view class="con-list">
  159. <input placeholder-style="font-size:14px" placeholder="请输入霉变粒占比"
  160. name="input" v-model="list.mildewGrain"></input>
  161. </view>
  162. </view>
  163. <view class="c-row b-b">
  164. <view class="title">不完整粒(%)<= </view>
  165. <view class="con-list">
  166. <input placeholder-style="font-size:14px" placeholder="请输入不完整粒占比"
  167. name="input" v-model="list.imperfectGrain"></input>
  168. </view>
  169. </view>
  170. <view class="c-row b-b">
  171. <text class="tit">品级 </text>
  172. <picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list">
  173. <view>
  174. {{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
  175. </view>
  176. </picker>
  177. </view>
  178. </view>
  179. </view>
  180. <!-- 底部操作菜单 -->
  181. <view class="page-bottom1">
  182. <view>
  183. <button type="primary" @click="commit1">暂 存</button>
  184. <button @click="commit" type="primary" class=" action-btn no-border add-cart-btn">提
  185. 交</button>
  186. </view>
  187. </view>
  188. </view>
  189. </template>
  190. <script>
  191. import upload from '@/components/upload.vue';
  192. export default {
  193. components: {
  194. upload
  195. },
  196. data() {
  197. return {
  198. packingType: [],
  199. packingIndex: "",
  200. goods: {},
  201. list: {},
  202. WarehouseInOutInfo: {
  203. inOutDate: '',
  204. warehouseInOutDetail: {},
  205. pcFlag: 0,
  206. contractNo: {},
  207. carNo: {},
  208. },
  209. WarehouseInOutInfo1: {
  210. contractNo: {},
  211. carNo: {},
  212. },
  213. pinIndex: '不限(默认)',
  214. pinTypes: '',
  215. pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
  216. ruIndex: '销售出库',
  217. rutypes: '',
  218. ruType: ['销售出库', '移库出库', '暂存出库', '贸易服务出库', '采购出库'],
  219. action: this.$uploadUrl,
  220. maxSize: 5 * 1024 * 1024, //限制文件大小 5M
  221. btnLoading: false, //防止重复点击
  222. imgUrls: [],
  223. warehouse:[],
  224. warehouseIndex:-1,
  225. warehouse1:[],
  226. warehouseIndex1:-1,
  227. warehouselist: [],
  228. isAdd: true,
  229. params: {
  230. year: true,
  231. month: true,
  232. day: true,
  233. },
  234. show: false
  235. }
  236. },
  237. computed: {
  238. time() {
  239. var date = new Date()
  240. var year = date.getFullYear()
  241. var month = date.getMonth()
  242. var date1 = date.getDate()
  243. if (month + 1 < 10) {
  244. month = "0" + (month + 1)
  245. }
  246. if (date1 + 1 < 10) {
  247. date1 = "0" + date1
  248. }
  249. return year + '-' + month + "-" + date1
  250. },
  251. startDate() {
  252. //限制开始时间;
  253. //也可以直接限定为当天日期 var date= new Date(); return date
  254. return new Date(new Date(new Date().toLocaleDateString()).getTime() - (1 * 60 * 60 * 1000))
  255. },
  256. endDate() {
  257. return new Date()
  258. }
  259. },
  260. onShow() {
  261. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {
  262. compId: '2710b21efc1e4393930c5dc800010dc4',
  263. warehouseType: 1,
  264. }).then(res => {
  265. if (res.data.code == 200) {
  266. var arr = []
  267. for (var i = 0; i < res.data.data.length; i++) {
  268. if (res.data.data[i].warehouseName == this.WarehouseInOutInfo.warehouseName) {
  269. this.warehouseIndex = i
  270. }
  271. arr.push(res.data.data[i].warehouseName)
  272. }
  273. this.warehouselist = res.data.data
  274. this.warehouse = arr
  275. }
  276. })
  277. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  278. compId: '',
  279. warehouseType: 1,
  280. }).then(res => {})
  281. },
  282. onLoad(option) {
  283. this.WarehouseInOutInfo.contractNo = option.contractNo
  284. this.WarehouseInOutInfo.goodsName = option.goodsName
  285. this.WarehouseInOutInfo.consignee = option.consignee
  286. this.WarehouseInOutInfo.boxNo = option.boxNo
  287. this.WarehouseInOutInfo.tranCarNo = option.tranCarNo
  288. this.WarehouseInOutInfo.titleNo = option.titleNo
  289. this.WarehouseInOutInfo.id = option.id
  290. this.WarehouseInOutInfo.carNo = option.carNo
  291. var date = new Date()
  292. var year = date.getFullYear()
  293. var month = date.getMonth()
  294. var date1 = date.getDate()
  295. if (month + 1 < 10) {
  296. month = "0" + (month + 1)
  297. }
  298. this.time = year + '-' + month + "-" + date1
  299. },
  300. methods: {
  301. warehouseChange(e) {
  302. var id = ''
  303. this.warehouseIndex = e.detail.value
  304. this.WarehouseInOutInfo.warehouseName = this.warehouse[this.warehouseIndex]
  305. for (var i = 0; i < this.warehouselist.length; i++) {
  306. if (this.warehouselist[i].warehouseName == this.WarehouseInOutInfo.warehouseName) {
  307. id = this.warehouselist[i].id
  308. }
  309. }
  310. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  311. id: id,
  312. }).then(res => {
  313. var arr = []
  314. for (var i = 0; i < res.data.data.warehousePositionInfoList.length; i++) {
  315. console.log(res.data.data.warehousePositionInfoList[i])
  316. arr.push(res.data.data.warehousePositionInfoList[i].binNumber)
  317. }
  318. this.warehouse1 = arr
  319. this.warehouselist11 = res.data.data
  320. })
  321. },
  322. warehouseChange1(e) {
  323. var id = ''
  324. this.warehouseIndex1 = e.detail.value
  325. this.WarehouseInOutInfo.binNumber = this.warehouse1[this.warehouseIndex1]
  326. },
  327. DateChange(e) {
  328. this.WarehouseInOutInfo.inOutDate = e.year + '-' + e.month + '-' + e.day
  329. },
  330. filterFileType(index, lists) {
  331. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  332. lists.splice(index, 1);
  333. // 当前文件不支持
  334. uni.showModal({
  335. title: '暂不支持当前图片类型',
  336. showCancel: false
  337. });
  338. } else {
  339. this.isAdd = false;
  340. }
  341. },
  342. getImgUrl(res) {
  343. this.imgUrls.push(res.data);
  344. },
  345. onRemove(index) {
  346. this.imgUrls.splice(index, 1);
  347. },
  348. commit1() {
  349. // if (this.WarehouseInOutInfo.grossWeight > 100 || this.WarehouseInOutInfo.grossWeight < 1) {
  350. // this.$api.msg('毛重输入错误')
  351. // return
  352. // }
  353. // if (this.WarehouseInOutInfo.grossWeight.indexOf('.') != -1) {
  354. // if (this.WarehouseInOutInfo.grossWeight.split('.')[1].length > 2) {
  355. // this.$api.msg('毛重输入错误')
  356. // return
  357. // }
  358. // }
  359. // if (this.WarehouseInOutInfo.tare > 50 || this.WarehouseInOutInfo.tare < 1) {
  360. // this.$api.msg('皮重输入错误')
  361. // return
  362. // }
  363. // if (this.WarehouseInOutInfo.tare.indexOf('.') != -1) {
  364. // if (this.WarehouseInOutInfo.tare.split('.')[1].length > 2) {
  365. // this.$api.msg('皮重输入错误')
  366. // return
  367. // }
  368. // }
  369. // if (this.list.qualityInspector && this.list.qualityInspector < 2 || this.list.qualityInspector && this.list
  370. // .qualityInspector > 10) {
  371. // this.$api.msg('质检员姓名输入错误')
  372. // return
  373. // }
  374. // if (this.list.protein && this.list.protein < 1 || this.list.protein && this.list.protein > 80) {
  375. // this.$api.msg('蛋白占比输入错误')
  376. // return
  377. // }
  378. // if (this.list.protein && this.list.protein.indexOf('.') != -1) {
  379. // if (this.list.protein.split('.')[1].length > 2) {
  380. // this.$api.msg('蛋白占比输入错误')
  381. // return
  382. // }
  383. // }
  384. // if (this.list.waterContent && this.list.waterContent < 1 || this.list.waterContent && this.list
  385. // .waterContent > 40) {
  386. // this.$api.msg('水分输入错误')
  387. // return
  388. // }
  389. // if (this.list.waterContent && this.list.waterContent.indexOf('.') != -1) {
  390. // if (this.list.waterContent.split('.')[1].length > 2) {
  391. // this.$api.msg('水分输入错误')
  392. // return
  393. // }
  394. // }
  395. // if (this.list.bulkDensity && this.list.bulkDensity < 1 || this.list.bulkDensity && this.list.bulkDensity >
  396. // 40) {
  397. // this.$api.msg('容重输入错误')
  398. // return
  399. // }
  400. // if (this.list.bulkDensity && this.list.bulkDensity.indexOf('.') != -1) {
  401. // if (this.list.bulkDensity.split('.')[1].length > 2) {
  402. // this.$api.msg('容重输入错误')
  403. // return
  404. // }
  405. // }
  406. // if (this.list.jiaorenli && this.list.jiaorenli < 1 || this.list.jiaorenli && this.list.jiaorenli > 40) {
  407. // this.$api.msg('热损伤输入错误')
  408. // return
  409. // }
  410. // if (this.list.jiaorenli && this.list.jiaorenli.indexOf('.') != -1) {
  411. // if (this.list.jiaorenli.split('.')[1].length > 2) {
  412. // this.$api.msg('热损伤输入错误')
  413. // return
  414. // }
  415. // }
  416. // if (this.list.impurity && this.list.impurity < 1 || this.list.impurity && this.list.impurity > 40) {
  417. // this.$api.msg('杂质输入错误')
  418. // return
  419. // }
  420. // if (this.list.impurity && this.list.impurity.indexOf('.') != -1) {
  421. // if (this.list.impurity.split('.')[1].length > 2) {
  422. // this.$api.msg('杂质输入错误')
  423. // return
  424. // }
  425. // }
  426. // if (this.list.mildewGrain && this.list.mildewGrain < 1 || this.list.mildewGrain && this.list.mildewGrain >
  427. // 40) {
  428. // this.$api.msg('霉变粒输入错误')
  429. // return
  430. // }
  431. // if (this.list.mildewGrain && this.list.mildewGrain.indexOf('.') != -1) {
  432. // if (this.list.mildewGrain.split('.')[1].length > 2) {
  433. // this.$api.msg('霉变粒输入错误')
  434. // return
  435. // }
  436. // }
  437. // if (this.list.imperfectGrain && this.list.imperfectGrain < 1 || this.list.imperfectGrain && this.list
  438. // .imperfectGrain > 40) {
  439. // this.$api.msg('不完整粒输入错误')
  440. // return
  441. // }
  442. // if (this.list.imperfectGrain && this.list.imperfectGrain.indexOf('.') != -1) {
  443. // if (this.list.imperfectGrain.split('.')[1].length > 2) {
  444. // this.$api.msg('不完整粒输入错误')
  445. // return
  446. // }
  447. // }
  448. // uni.showLoading({
  449. // title: "正在暂存"
  450. // })
  451. this.WarehouseInOutInfo.deductionAmount = -this.WarehouseInOutInfo.deductionAmount
  452. this.WarehouseInOutInfo.warehouseInOutDetail = this.list
  453. this.WarehouseInOutInfo.statusFlag = 1
  454. if (this.imgUrls.length > 0) {
  455. this.WarehouseInOutInfo.addressUrl = this.imgUrls[0]
  456. }
  457. console.log(this.WarehouseInOutInfo,"卖粮对象")
  458. return
  459. this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
  460. if (res.data.code == 200) {
  461. uni.showToast({
  462. title: '暂存成功',
  463. icon: 'none',
  464. duration: 2000
  465. })
  466. uni.navigateBack({})
  467. } else {
  468. uni.showToast({
  469. title: res.data.message,
  470. icon: 'none',
  471. duration: 2000
  472. })
  473. }
  474. uni.hideLoading()
  475. }).catch(res => {
  476. uni.showToast({
  477. title: res.data.message,
  478. icon: 'none',
  479. duration: 2000
  480. })
  481. uni.hideLoading()
  482. })
  483. },
  484. commit() {
  485. if (!this.WarehouseInOutInfo.grossWeight) {
  486. this.$api.msg('毛重不能为空')
  487. return
  488. }
  489. if (!this.WarehouseInOutInfo.tare) {
  490. this.$api.msg('皮重不能为空')
  491. return
  492. }
  493. if (!this.WarehouseInOutInfo.warehouseName) {
  494. this.$api.msg('仓库不能为空')
  495. return
  496. }
  497. if (!this.WarehouseInOutInfo.binNumber) {
  498. this.$api.msg('仓库不能为空')
  499. return
  500. }
  501. if (this.WarehouseInOutInfo.grossWeight > 100 || this.WarehouseInOutInfo.grossWeight < 1) {
  502. this.$api.msg('毛重输入错误')
  503. return
  504. }
  505. if (this.WarehouseInOutInfo.grossWeight.indexOf('.') != -1) {
  506. if (this.WarehouseInOutInfo.grossWeight.split('.')[1].length > 2) {
  507. this.$api.msg('毛重输入错误')
  508. return
  509. }
  510. }
  511. if (this.WarehouseInOutInfo.tare > 50 || this.WarehouseInOutInfo.tare < 1) {
  512. this.$api.msg('皮重输入错误')
  513. return
  514. }
  515. if (this.WarehouseInOutInfo.tare.indexOf('.') != -1) {
  516. if (this.WarehouseInOutInfo.tare.split('.')[1].length > 2) {
  517. this.$api.msg('皮重输入错误')
  518. return
  519. }
  520. }
  521. if (this.list.qualityInspector && this.list.qualityInspector < 2 || this.list.qualityInspector && this.list
  522. .qualityInspector > 10) {
  523. this.$api.msg('质检员姓名输入错误')
  524. return
  525. }
  526. if (this.list.protein && this.list.protein < 1 || this.list.protein && this.list.protein > 80) {
  527. this.$api.msg('蛋白占比输入错误')
  528. return
  529. }
  530. if (this.list.protein && this.list.protein.indexOf('.') != -1) {
  531. if (this.list.protein.split('.')[1].length > 2) {
  532. this.$api.msg('蛋白占比输入错误')
  533. return
  534. }
  535. }
  536. if (this.list.waterContent && this.list.waterContent < 1 || this.list.waterContent && this.list
  537. .waterContent > 40) {
  538. this.$api.msg('水分输入错误')
  539. return
  540. }
  541. if (this.list.waterContent && this.list.waterContent.indexOf('.') != -1) {
  542. if (this.list.waterContent.split('.')[1].length > 2) {
  543. this.$api.msg('水分输入错误')
  544. return
  545. }
  546. }
  547. if (this.list.bulkDensity && this.list.bulkDensity < 1 || this.list.bulkDensity && this.list.bulkDensity >
  548. 40) {
  549. this.$api.msg('容重输入错误')
  550. return
  551. }
  552. if (this.list.bulkDensity && this.list.bulkDensity.indexOf('.') != -1) {
  553. if (this.list.bulkDensity.split('.')[1].length > 2) {
  554. this.$api.msg('容重输入错误')
  555. return
  556. }
  557. }
  558. if (this.list.jiaorenli && this.list.jiaorenli < 1 || this.list.jiaorenli && this.list.jiaorenli > 40) {
  559. this.$api.msg('热损伤输入错误')
  560. return
  561. }
  562. if (this.list.jiaorenli && this.list.jiaorenli.indexOf('.') != -1) {
  563. if (this.list.jiaorenli.split('.')[1].length > 2) {
  564. this.$api.msg('热损伤输入错误')
  565. return
  566. }
  567. }
  568. if (this.list.impurity && this.list.impurity < 1 || this.list.impurity && this.list.impurity > 40) {
  569. this.$api.msg('杂质输入错误')
  570. return
  571. }
  572. if (this.list.impurity && this.list.impurity.indexOf('.') != -1) {
  573. if (this.list.impurity.split('.')[1].length > 2) {
  574. this.$api.msg('杂质输入错误')
  575. return
  576. }
  577. }
  578. if (this.list.mildewGrain && this.list.mildewGrain < 1 || this.list.mildewGrain && this.list.mildewGrain >
  579. 40) {
  580. this.$api.msg('霉变粒输入错误')
  581. return
  582. }
  583. if (this.list.mildewGrain && this.list.mildewGrain.indexOf('.') != -1) {
  584. if (this.list.mildewGrain.split('.')[1].length > 2) {
  585. this.$api.msg('霉变粒输入错误')
  586. return
  587. }
  588. }
  589. if (this.list.imperfectGrain && this.list.imperfectGrain < 1 || this.list.imperfectGrain && this.list
  590. .imperfectGrain > 40) {
  591. this.$api.msg('不完整粒输入错误')
  592. return
  593. }
  594. if (this.list.imperfectGrain && this.list.imperfectGrain.indexOf('.') != -1) {
  595. if (this.list.imperfectGrain.split('.')[1].length > 2) {
  596. this.$api.msg('不完整粒输入错误')
  597. return
  598. }
  599. }
  600. this.WarehouseInOutInfo.deductionAmount = -this.WarehouseInOutInfo.deductionAmount
  601. if (this.imgUrls.length > 0) {
  602. this.WarehouseInOutInfo.addressUrl = this.imgUrls[0]
  603. }
  604. this.WarehouseInOutInfo.warehouseInOutDetail = this.list
  605. this.WarehouseInOutInfo.statusFlag = 3
  606. uni.showLoading({
  607. title: "正在提交"
  608. })
  609. this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
  610. if (res.data.code == 200) {
  611. uni.showToast({
  612. title: '提交成功',
  613. icon: 'none'
  614. })
  615. setTimeout(() => {
  616. uni.navigateBack({})
  617. }, 200)
  618. } else {
  619. uni.showToast({
  620. title: res.data.message,
  621. icon: 'none',
  622. duration: 2000
  623. })
  624. }
  625. uni.hideLoading()
  626. }).catch(res => {
  627. uni.showToast({
  628. title: res.data.message,
  629. icon: 'none',
  630. duration: 2000
  631. })
  632. uni.hideLoading()
  633. })
  634. },
  635. numFilter(value) {
  636. if (!value) {
  637. return 0
  638. }
  639. // 截取当前数据到小数点后两位
  640. let realVal = parseFloat(value).toFixed(2)
  641. return realVal
  642. },
  643. grossWeightInput(e) {
  644. this.WarehouseInOutInfo.grossWeight = e.detail.value
  645. if (this.WarehouseInOutInfo.grossWeight && this.WarehouseInOutInfo.tare) {
  646. this.WarehouseInOutInfo.netWeight = this.WarehouseInOutInfo.grossWeight - this.WarehouseInOutInfo.tare
  647. }
  648. },
  649. tareInput(e) {
  650. this.WarehouseInOutInfo.tare = e.detail.value
  651. if (this.WarehouseInOutInfo.grossWeight && this.WarehouseInOutInfo.tare) {
  652. this.WarehouseInOutInfo.netWeight = this.WarehouseInOutInfo.grossWeight - this.WarehouseInOutInfo.tare
  653. }
  654. },
  655. ruChange(e) {
  656. this.WarehouseInOutInfo.inOutTypeKey = e.detail.value
  657. this.WarehouseInOutInfo.inOutType = this.ruType[this.ruIndex];
  658. },
  659. pinChange(e) {
  660. this.WarehouseInOutInfo.gradeKey = e.detail.value
  661. this.WarehouseInOutInfo.grade = this.pinType[this.pinIndex];
  662. },
  663. }
  664. }
  665. </script>
  666. <style scoped lang='scss'>
  667. .upload {
  668. /deep/.u-list-item,
  669. .u-add-wrap {
  670. background-color: #eceae8;
  671. }
  672. }
  673. .center {
  674. margin: 15rpx 15rpx 10rpx 15rpx;
  675. padding: 0rpx 10rpx 30rpx 10rpx;
  676. background-color: #FFFFFF;
  677. border-radius: 15px;
  678. }
  679. .title_b {
  680. margin: 20rpx 20rpx 0rpx 20rpx;
  681. padding: 20rpx 10rpx 20rpx 10rpx;
  682. font-size: 18px;
  683. font-weight: 550;
  684. border-bottom: 1px solid #d6d6d6;
  685. }
  686. .title_c {
  687. margin: 20rpx 20rpx 0rpx 20rpx;
  688. padding: 20rpx 10rpx 20rpx 10rpx;
  689. font-size: 18px;
  690. font-weight: 550;
  691. }
  692. .c-row {
  693. display: -webkit-box;
  694. display: -webkit-flex;
  695. display: flex;
  696. -webkit-box-align: center;
  697. -webkit-align-items: center;
  698. align-items: center;
  699. padding: 20rpx 30rpx;
  700. position: relative;
  701. }
  702. .con-list {
  703. -webkit-box-flex: 1;
  704. -webkit-flex: 1;
  705. flex: 1;
  706. display: -webkit-box;
  707. display: -webkit-flex;
  708. display: flex;
  709. -webkit-box-orient: vertical;
  710. -webkit-box-direction: normal;
  711. -webkit-flex-direction: column;
  712. flex-direction: column;
  713. color: #303133;
  714. line-height: 40rpx;
  715. text-align: right;
  716. padding-right: 20rpx;
  717. }
  718. .d-header {
  719. display: flex;
  720. justify-content: center;
  721. align-items: center;
  722. height: 80upx;
  723. font-size: $font-base + 2upx;
  724. color: $font-color-dark;
  725. position: relative;
  726. text {
  727. padding: 0 20upx;
  728. background: #fff;
  729. position: relative;
  730. z-index: 1;
  731. }
  732. &:after {
  733. position: absolute;
  734. left: 50%;
  735. top: 50%;
  736. transform: translateX(-50%);
  737. width: 300upx;
  738. height: 0;
  739. content: '';
  740. border-bottom: 1px solid #ccc;
  741. }
  742. }
  743. /* 底部操作菜单 */
  744. .page-bottom1 {
  745. position: fixed;
  746. left: 0;
  747. bottom: 0;
  748. z-index: 95;
  749. width: 100%;
  750. height: 70px;
  751. background: rgba(255, 255, 255, .9);
  752. padding: 15px;
  753. border-radius: 0;
  754. text-align: right;
  755. button {
  756. display: inline-block;
  757. border-radius: 18px;
  758. margin: 0 10px;
  759. font-size: 14px;
  760. background: #fff;
  761. color: #333;
  762. border: 1px solid #333;
  763. padding-left: 50rpx;
  764. padding-right: 50rpx;
  765. }
  766. .action-btn {
  767. background: #22C572;
  768. color: #fff;
  769. border: 1px solid #22C572;
  770. }
  771. .p-b-btn {
  772. display: flex;
  773. flex-direction: column;
  774. align-items: center;
  775. justify-content: center;
  776. font-size: $font-sm;
  777. color: $font-color-base;
  778. width: 96upx;
  779. height: 80upx;
  780. .yticon {
  781. font-size: 40upx;
  782. line-height: 48upx;
  783. color: $font-color-light;
  784. }
  785. &.active,
  786. &.active .yticon {
  787. color: $uni-color-primary;
  788. }
  789. .icon-fenxiang2 {
  790. font-size: 42upx;
  791. transform: translateY(-2upx);
  792. }
  793. .icon-shoucang {
  794. font-size: 46upx;
  795. }
  796. }
  797. }
  798. .container {
  799. padding-bottom: 160upx;
  800. }
  801. </style>