ex_warehouse.vue 25 KB

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