ex_warehouse.vue 26 KB

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