ex_warehouse.vue 28 KB

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