ex_warehouse.vue 28 KB

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