ex_warehouse.vue 28 KB

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