ex_warehouse.vue 28 KB

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