ex_warehouse.vue 29 KB

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