ex_warehouse.vue 29 KB

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