warehousings.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  1. <template>
  2. <view class="container">
  3. <view class='header flex'>
  4. <view style='flex:1.5;' class="cuIcon-back" @click="navBack"></view>
  5. <view style='flex:2;' v-if='WarehouseInOutInfo.taskType=="入库任务"'>
  6. 入库
  7. </view>
  8. <view style='flex:2;' v-if='WarehouseInOutInfo.taskType=="出库任务"'>
  9. 出库
  10. </view>
  11. </view>
  12. <view class="center">
  13. <view class="title_b ">发运信息</view>
  14. <view class="c-row ">
  15. <text class="tit">合同编号</text>
  16. <view class="con-list">
  17. <text>{{WarehouseInOutInfo.contractNo}}</text>
  18. </view>
  19. </view>
  20. <view v-if='WarehouseInOutInfo.taskType=="出库任务"' class="c-row ">
  21. <text class="tit">收货方</text>
  22. <view class="con-list">
  23. <text>{{WarehouseInOutInfo.consignee}}</text>
  24. </view>
  25. </view>
  26. <view class="c-row ">
  27. <text class="tit">货名</text>
  28. <view class="con-list">
  29. <text>{{WarehouseInOutInfo.goodsName}}</text>
  30. </view>
  31. </view>
  32. <view v-if='WarehouseInOutInfo.taskType=="入库任务"' class="c-row ">
  33. <text class="tit">发车净重(吨)</text>
  34. <view class="con-list">
  35. <text>{{WarehouseInOutInfo.startWeight}}</text>
  36. </view>
  37. </view>
  38. <view class="c-row ">
  39. <text class="tit">车牌号</text>
  40. <view class="con-list">
  41. <text>{{WarehouseInOutInfo.carNo}}({{this.WarehouseInOutInfo.tranCarNo}})</text>
  42. </view>
  43. </view>
  44. <view v-if='WarehouseInOutInfo.taskType=="出库任务"' class="c-row ">
  45. <text class="tit">箱号</text>
  46. <view class="con-list">
  47. <text>{{WarehouseInOutInfo.boxNo}}</text>
  48. </view>
  49. </view>
  50. <view v-if='WarehouseInOutInfo.taskType=="出库任务"' class="c-row ">
  51. <text class="tit">封号</text>
  52. <view class="con-list">
  53. <text>{{WarehouseInOutInfo.titleNo}}</text>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="center">
  58. <view v-if='WarehouseInOutInfo.taskType=="入库任务"' class="title_c ">入库信息</view>
  59. <view v-if='WarehouseInOutInfo.taskType=="出库任务"' class="title_c ">出库信息</view>
  60. <view class="c-list">
  61. <view class="c-row b-b">
  62. <text class="tit">毛重(吨)</text>
  63. <view style="color: #ff0000; padding-left: 10rpx;">*</view>
  64. <view class="con-list">
  65. <input placeholder-style="font-size:14px" style="font-size: 14px;" placeholder="请输入毛重"
  66. name="input" v-model="WarehouseInOutInfo.grossWeight" @input="grossWeightInput"></input>
  67. </view>
  68. </view>
  69. <view class="c-row b-b">
  70. <view class="tit">皮重(吨)</view>
  71. <view style="color: #ff0000; padding-left: 10rpx;">*</view>
  72. <view class="con-list">
  73. <input placeholder-style="font-size:14px" style="font-size: 14px;" placeholder="请输入皮重"
  74. name="input" v-model="WarehouseInOutInfo.tare" @input="tareInput"></input>
  75. </view>
  76. </view>
  77. <view class="c-row b-b">
  78. <text class="tit">净重(吨)</text>
  79. <view class="con-list">
  80. <text>{{numFilter(WarehouseInOutInfo.netWeight)}}</text>
  81. </view>
  82. </view>
  83. <view class="c-row b-b">
  84. <text class="tit">仓库</text>
  85. <view style="color: #ff0000; padding-left: 10rpx;">*</view>
  86. <view class="con-list">
  87. <picker @change="warehouseChange" :value="warehouseIndex" :range="warehouse" class="con-list">
  88. <view>
  89. {{warehouseIndex>-1?warehouse[warehouseIndex]:'请选择仓库'}}
  90. </view>
  91. </picker>
  92. </view>
  93. </view>
  94. <view class="c-row b-b">
  95. <view class="title">仓位号</view>
  96. <view style="color: #ff0000; padding-left: 10rpx;">*</view>
  97. <view class="con-list">
  98. <picker @change="warehouseChange1" :value="warehouseIndex1" :range="warehouse1"
  99. class="con-list">
  100. <view>
  101. {{warehouseIndex1>-1?warehouse1[warehouseIndex1]:'请选择仓位号'}}
  102. </view>
  103. </picker>
  104. </view>
  105. </view>
  106. <view class="c-row b-b">
  107. <text v-if='WarehouseInOutInfo.taskType=="入库任务"' class="tit">入库类型 </text>
  108. <text v-if='WarehouseInOutInfo.taskType=="出库任务"' class="tit">出库类型 </text>
  109. <picker v-if='WarehouseInOutInfo.taskType=="入库任务"' @change="ruChange" :value="ruIndex"
  110. :range="ruType" class="con-list">
  111. <view v-model="WarehouseInOutInfo.inOutType">
  112. {{ruIndex > -1?ruType[ruIndex]:'请选择入库类型'}}
  113. </view>
  114. </picker>
  115. <picker v-if='WarehouseInOutInfo.taskType=="出库任务"' @change="chuChange" :value="chuIndex"
  116. :range="chuType" class="con-list">
  117. <view v-model="WarehouseInOutInfo.inOutType">
  118. {{chuIndex > -1?chuType[chuIndex]:'请选择出库类型'}}
  119. </view>
  120. </picker>
  121. </view>
  122. <view v-if='WarehouseInOutInfo.taskType=="入库任务"' class="c-row b-b">
  123. <view class="title">扣款金额</view>
  124. <view class="con-list">
  125. <input style="font-size:14px" placeholder="请输入扣款金额" name="input"
  126. v-model="WarehouseInOutInfo.deductionAmount"></input>
  127. </view>
  128. </view>
  129. <view v-if='WarehouseInOutInfo.taskType=="入库任务"' class="c-row b-b">
  130. <view class="title">扣款项</view>
  131. <view class="con-list">
  132. <input style="font-size:14px" maxlength='16' placeholder="请输入扣款项" name="input"
  133. v-model="WarehouseInOutInfo.deductionItems"></input>
  134. </view>
  135. </view>
  136. <view class="c-row b-b">
  137. <text v-if='WarehouseInOutInfo.taskType=="入库任务"' class="tit">入库日期</text>
  138. <text v-if='WarehouseInOutInfo.taskType=="出库任务"' class="tit">出库日期</text>
  139. <view class="con-list" @click="show = true">
  140. {{WarehouseInOutInfo.inOutDate!=null?WarehouseInOutInfo.inOutDate:time1}}</view>
  141. <u-picker :params='params' :default-time='time' @confirm="DateChange" v-model="show" mode="time">
  142. </u-picker>
  143. </view>
  144. <!-- <view v-if='WarehouseInOutInfo.taskType=="出库任务"' class="c-row b-b">
  145. <text class="tit">经办人</text>
  146. <view class="con-list" @click="show1 = true">
  147. {{ WarehouseInOutInfo.agent != null ? WarehouseInOutInfo.agent :'请选择经办人' }}
  148. </view>
  149. <u-picker @confirm="DateChange" v-model="show1" :range="selectorObj" mode="selector">
  150. </u-picker>
  151. </view> -->
  152. <view class="c-row ">
  153. <text class="tit">上传磅单照片</text>
  154. </view>
  155. <upload v-if="WarehouseInOutInfo.addressUrl == null || WarehouseInOutInfo.addressUrl == ''"
  156. class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  157. :size-type="['compressed']" @on-success="getImgUrl" @on-remove="onRemove"
  158. @on-uploaded="isAdd = true" :before-upload="filterFileType"></upload>
  159. <image v-bind:src="WarehouseInOutInfo.addressUrl" mode=""
  160. v-if="WarehouseInOutInfo.addressUrl != null || WarehouseInOutInfo.addressUrl != ''" class="picture">
  161. </image>
  162. </view>
  163. </view>
  164. <view class="center">
  165. <view class="title_c ">化验信息</view>
  166. <view class="c-list">
  167. <view class="c-row b-b">
  168. <view class="title">质检员</view>
  169. <view class="con-list">
  170. <input maxlength='10' minlength='2' style="font-size:14px" placeholder="请输入质检员姓名" name="input"
  171. v-model="list.qualityInspector"></input>
  172. </view>
  173. </view>
  174. <view class="c-row b-b">
  175. <view class="title">蛋白(%)>=</view>
  176. <view class="con-list">
  177. <input style="font-size:14px" placeholder="请输入蛋白占比" name="input" v-model="list.protein"></input>
  178. </view>
  179. </view>
  180. <view class="c-row b-b">
  181. <view class="title">水分(%)<= </view>
  182. <view class="con-list">
  183. <input style="font-size:14px" placeholder="请输入水分占比" name="input"
  184. v-model="list.waterContent"></input>
  185. </view>
  186. </view>
  187. <view class="c-row b-b">
  188. <view class="title">容重(克/升)>= </view>
  189. <view class="con-list">
  190. <input style="font-size:14px" placeholder="请输入容重" name="input"
  191. v-model="list.bulkDensity"></input>
  192. </view>
  193. </view>
  194. <view class="c-row b-b">
  195. <view class="title">热损伤(%)<= </view>
  196. <view class="con-list">
  197. <input style="font-size:14px" placeholder="请输入热损伤占比" name="input"
  198. v-model="list.jiaorenli"></input>
  199. </view>
  200. </view>
  201. <view class="c-row b-b">
  202. <view class="title">杂质(%)<= </view>
  203. <view class="con-list">
  204. <input style="font-size:14px" placeholder="请输入杂质占比" name="input"
  205. v-model="list.impurity"></input>
  206. </view>
  207. </view>
  208. <view class="c-row b-b">
  209. <view class="title">霉变粒(%)<= </view>
  210. <view class="con-list">
  211. <input style="font-size:14px" placeholder="请输入霉变粒占比" name="input"
  212. v-model="list.mildewGrain"></input>
  213. </view>
  214. </view>
  215. <view class="c-row b-b">
  216. <view class="title">不完整粒(%)<= </view>
  217. <view class="con-list">
  218. <input style="font-size:14px" placeholder="请输入不完整粒占比" name="input"
  219. v-model="list.imperfectGrain"></input>
  220. </view>
  221. </view>
  222. <view class="c-row b-b">
  223. <text class="tit">品级 </text>
  224. <picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list">
  225. <view>
  226. {{pinIndex > -1 ? pinType[pinIndex]:'请选择品级'}}
  227. </view>
  228. </picker>
  229. </view>
  230. </view>
  231. </view>
  232. <!-- 底部操作菜单 -->
  233. <view class="page-bottom1">
  234. <view>
  235. <button type="primary" @click="commit1">暂 存</button>
  236. <button @click="commit" type="primary" class=" action-btn no-border add-cart-btn">提
  237. 交</button>
  238. </view>
  239. </view>
  240. </view>
  241. </template>
  242. <script>
  243. import upload from '@/components/upload.vue';
  244. export default {
  245. components: {
  246. upload
  247. },
  248. data() {
  249. return {
  250. packingType: [],
  251. packingIndex: "",
  252. goods: {},
  253. list: {},
  254. WarehouseInOutInfo: {
  255. inOutDate: '',
  256. warehouseInOutDetail: {},
  257. pcFlag: 0,
  258. contractNo: {},
  259. carNo: {},
  260. inOutType: '采购入库',
  261. inOutTypeKey: 1,
  262. },
  263. selectorObj:[],
  264. WarehouseInOutInfo1: {
  265. contractNo: {},
  266. carNo: {},
  267. },
  268. pinIndex: -1,
  269. show1:false,
  270. pinTypes: '',
  271. pinType: ['一等品', '二等品', '三等品', '等外'],
  272. ruIndex: 0,
  273. rutypes: '',
  274. warehouse: [],
  275. warehouseIndex: -1,
  276. warehouse1: [],
  277. warehouseIndex1: -1,
  278. ruType: ['采购入库', '移库入库', '暂存入库', '贸易服务入库', '退库'],
  279. chuIndex: 0,
  280. chutypes: '',
  281. chuType: ['销售出库', '移库出库', '暂存出库', '贸易服务出库', '采购出库'],
  282. action: this.$uploadUrl,
  283. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  284. btnLoading: false, //防止重复点击
  285. imgUrls: [],
  286. isAdd: true,
  287. warehouselist: [],
  288. warehouselist1: [],
  289. compId:'',
  290. params: {
  291. year: true,
  292. month: true,
  293. day: true,
  294. },
  295. show: false,
  296. warehouse2:[],
  297. }
  298. },
  299. computed: {
  300. time1() {
  301. var date = new Date()
  302. var year = date.getFullYear()
  303. var month = date.getMonth()
  304. var date1 = date.getDate()
  305. if (month + 1 < 10) {
  306. month = "0" + (month + 1)
  307. }
  308. if (date1 + 1 < 10) {
  309. date1 = "0" + date1
  310. }
  311. return year + '-' + month + "-" + date1
  312. },
  313. startDate() {
  314. //限制开始时间;
  315. //也可以直接限定为当天日期 var date= new Date(); return date
  316. return new Date(new Date(new Date().toLocaleDateString()).getTime() - (1 * 60 * 60 * 1000))
  317. },
  318. endDate() {
  319. return new Date()
  320. }
  321. },
  322. onLoad(option) {
  323. this.compId = option.compId
  324. this.WarehouseInOutInfo.goodsName = option.goodsName
  325. this.WarehouseInOutInfo.startWeight = option.startWeight
  326. this.WarehouseInOutInfo1.carNo = option.carNo + '(' + option.tranCarNo + ')'
  327. this.WarehouseInOutInfo.tranCarNo = option.tranCarNo
  328. this.WarehouseInOutInfo.id = option.id
  329. this.WarehouseInOutInfo.carNo = option.carNo
  330. this.WarehouseInOutInfo.addressUrl = option.addressUrl
  331. this.WarehouseInOutInfo.binNumber = option.binNumber
  332. this.WarehouseInOutInfo.inOutDate = option.inOutDate
  333. var date = new Date()
  334. var year = date.getFullYear()
  335. var month = date.getMonth()
  336. var date1 = date.getDate()
  337. if (month + 1 < 10) {
  338. month = "0" + (month + 1)
  339. }
  340. this.time = year + '-' + month + "-" + date1
  341. this.getList(this.WarehouseInOutInfo.id)
  342. },
  343. onShow() {
  344. var that=this
  345. setTimeout(function(){
  346. console.log(that.WarehouseInOutInfo)
  347. that.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {
  348. compId: that.compId,
  349. warehouseType: 1,
  350. }).then(res => {
  351. console.log(res,"cang")
  352. if (res.data.code == 200) {
  353. var arr = []
  354. for (var i = 0; i < res.data.data.length; i++) {
  355. console.log(res.data.data[i].warehouseName,that.WarehouseInOutInfo.warehouseName)
  356. if (res.data.data[i].warehouseName == that.WarehouseInOutInfo.warehouseName) {
  357. console.log(11111)
  358. that.warehouseIndex = i
  359. }
  360. // if(res.data.data[i].positionId==this.WarehouseInOutInfo.positionId){
  361. // this.warehouseIndex=i
  362. // }
  363. arr.push(res.data.data[i].warehouseName)
  364. // arr.push(res.data[i].positionId)
  365. }
  366. that.warehouse = arr
  367. that.warehouselist = res.data.data
  368. for (var i = 0; i < that.warehouselist.length; i++) {
  369. if (that.warehouselist[i].warehouseName == that.WarehouseInOutInfo.warehouseName) {
  370. var id = that.warehouselist[i].id
  371. that.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  372. id: id,
  373. }).then(res => {
  374. var arr = []
  375. var arr1 = []
  376. for (var i = 0; i < res.data.data.warehousePositionInfoList.length; i++) {
  377. if (res.data.data.warehousePositionInfoList[i].binNumber == that
  378. .WarehouseInOutInfo.binNumber) {
  379. that.warehouseIndex1 = i
  380. }
  381. arr.push(res.data.data.warehousePositionInfoList[i].binNumber)
  382. arr1.push(res.data.data.warehousePositionInfoList[i].binNumber.id)
  383. // arr.push(res.data.data.warehousePositionInfoList[i].positionId)
  384. }
  385. that.warehouse1 = arr
  386. that.warehouse2 = arr1
  387. that.warehouselist11 = res.data.data
  388. })
  389. }
  390. }
  391. // this.warehouse=arr
  392. }
  393. })
  394. },1000)
  395. },
  396. methods: {
  397. navBack() {
  398. uni.navigateBack();
  399. },
  400. getList(id1) {
  401. var that = this
  402. this.$api.doRequest('get', '/warehouseInOutInfo/getInfo', {
  403. id: id1
  404. }).then(res => {
  405. that.WarehouseInOutInfo = res.data.data
  406. if (that.WarehouseInOutInfo.warehouseInOutDetail != null) {
  407. that.list = that.WarehouseInOutInfo.warehouseInOutDetail
  408. }
  409. if (this.WarehouseInOutInfo.gradeKey != null) {
  410. this.pinIndex = this.WarehouseInOutInfo.gradeKey
  411. }
  412. if (this.WarehouseInOutInfo.inOutTypeKey != null) {
  413. this.ruIndex = this.WarehouseInOutInfo.inOutTypeKey
  414. }
  415. if (this.WarehouseInOutInfo.deductionAmount != null) {
  416. this.WarehouseInOutInfo.deductionAmount = Math.abs(res.data.data.deductionAmount)
  417. }
  418. })
  419. .catch(res => {
  420. if (res.errmsg) {
  421. uni.showToast({
  422. title: res.errmsg,
  423. icon: 'none',
  424. duration: 2000
  425. })
  426. } else {
  427. uni.showToast({
  428. title: "系统异常,请联系管理员",
  429. icon: 'none',
  430. duration: 2000
  431. })
  432. }
  433. });
  434. },
  435. warehouseChange(e) {
  436. var id = ''
  437. this.warehouseIndex = e.detail.value
  438. this.WarehouseInOutInfo.warehouseName = this.warehouse[this.warehouseIndex]
  439. for (var i = 0; i < this.warehouselist.length; i++) {
  440. if (this.warehouselist[i].warehouseName == this.WarehouseInOutInfo.warehouseName) {
  441. id = this.warehouselist[i].id
  442. }
  443. }
  444. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  445. id: id,
  446. }).then(res => {
  447. var arr = []
  448. var arr1 = []
  449. for (var i = 0; i < res.data.data.warehousePositionInfoList.length; i++) {
  450. arr.push(res.data.data.warehousePositionInfoList[i].binNumber)
  451. arr1.push(res.data.data.warehousePositionInfoList[i].id)
  452. }
  453. this.warehouse1 = arr
  454. this.warehouse2 = arr1
  455. console.log(this.warehouse2 ,"仓位id")
  456. this.warehouselist11 = res.data.data
  457. })
  458. },
  459. warehouseChange1(e) {
  460. this.WarehouseInOutInfo.positionId = this.warehouse2[e.detail.value]
  461. var id = ''
  462. this.warehouseIndex1 = e.detail.value
  463. this.WarehouseInOutInfo.binNumberKey = this.warehouseIndex1
  464. this.WarehouseInOutInfo.binNumber = this.warehouse1[this.warehouseIndex1]
  465. },
  466. DateChange(e) {
  467. this.WarehouseInOutInfo.inOutDate = e.year + '-' + e.month + '-' + e.day
  468. },
  469. filterFileType(index, lists) {
  470. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  471. lists.splice(index, 1);
  472. // 当前文件不支持
  473. uni.showModal({
  474. title: '暂不支持当前图片类型',
  475. showCancel: false
  476. });
  477. } else {
  478. this.isAdd = false;
  479. }
  480. },
  481. getImgUrl(res) {
  482. this.imgUrls.push(res);
  483. },
  484. onRemove(index) {
  485. this.imgUrls.splice(index, 1);
  486. },
  487. commit1() {
  488. if (this.WarehouseInOutInfo.grossWeight > 100 || this.WarehouseInOutInfo.grossWeight < 1) {
  489. this.$api.msg('毛重输入错误')
  490. return
  491. }
  492. if (this.WarehouseInOutInfo.grossWeight.toString().indexOf('.') != -1) {
  493. if (this.WarehouseInOutInfo.grossWeight.toString().split('.')[1].length > 2) {
  494. this.$api.msg('毛重输入错误')
  495. return
  496. }
  497. }
  498. if (this.WarehouseInOutInfo.tare > 50 || this.WarehouseInOutInfo.tare < 1) {
  499. this.$api.msg('皮重输入错误')
  500. return
  501. }
  502. if (this.WarehouseInOutInfo.tare.toString().indexOf('.') != -1) {
  503. if (this.WarehouseInOutInfo.tare.toString().split('.')[1].length > 2) {
  504. this.$api.msg('皮重输入错误')
  505. return
  506. }
  507. }
  508. if (this.WarehouseInOutInfo.deductionAmount && this.WarehouseInOutInfo.deductionAmount > 10000 || this
  509. .WarehouseInOutInfo.deductionAmount && this.WarehouseInOutInfo.deductionAmount < 0) {
  510. this.$api.msg('扣款金额输入错误')
  511. return
  512. }
  513. if (this.WarehouseInOutInfo.deductionAmount && this.WarehouseInOutInfo.deductionAmount.toString().indexOf(
  514. '.') != -1) {
  515. if (this.WarehouseInOutInfo.deductionAmount.toString().split('.')[1].length > 2) {
  516. this.$api.msg('扣款金额输入错误')
  517. return
  518. }
  519. }
  520. if (this.list.qualityInspector && this.list.qualityInspector < 2 || this.list.qualityInspector && this.list
  521. .qualityInspector > 10) {
  522. this.$api.msg('质检员姓名输入错误')
  523. return
  524. }
  525. if (this.list.protein && this.list.protein < 1 || this.list.protein && this.list.protein > 80) {
  526. this.$api.msg('蛋白占比输入错误')
  527. return
  528. }
  529. if (this.list.protein && this.list.protein.indexOf('.') != -1) {
  530. if (this.list.protein.split('.')[1].length > 2) {
  531. this.$api.msg('蛋白占比输入错误')
  532. return
  533. }
  534. }
  535. if (this.list.waterContent && this.list.waterContent < 1 || this.list.waterContent && this.list
  536. .waterContent > 40) {
  537. this.$api.msg('水分输入错误')
  538. return
  539. }
  540. if (this.list.waterContent && this.list.waterContent.indexOf('.') != -1) {
  541. if (this.list.waterContent.split('.')[1].length > 2) {
  542. this.$api.msg('水分输入错误')
  543. return
  544. }
  545. }
  546. if (this.list.bulkDensity && this.list.bulkDensity < 500 || this.list.bulkDensity && this.list
  547. .bulkDensity > 1000) {
  548. this.$api.msg('容重输入错误')
  549. return
  550. }
  551. if (this.list.bulkDensity && this.list.bulkDensity.indexOf('.') != -1) {
  552. if (this.list.bulkDensity.split('.')[1].length > 2) {
  553. this.$api.msg('容重输入错误')
  554. return
  555. }
  556. }
  557. if (this.list.jiaorenli && this.list.jiaorenli < 1 || this.list.jiaorenli && this.list.jiaorenli > 40) {
  558. this.$api.msg('热损伤输入错误')
  559. return
  560. }
  561. if (this.list.jiaorenli && this.list.jiaorenli.indexOf('.') != -1) {
  562. if (this.list.jiaorenli.split('.')[1].length > 2) {
  563. this.$api.msg('热损伤输入错误')
  564. return
  565. }
  566. }
  567. if (this.list.impurity && this.list.impurity < 1 || this.list.impurity && this.list.impurity > 40) {
  568. this.$api.msg('杂质输入错误')
  569. return
  570. }
  571. if (this.list.impurity && this.list.impurity.indexOf('.') != -1) {
  572. if (this.list.impurity.split('.')[1].length > 2) {
  573. this.$api.msg('杂质输入错误')
  574. return
  575. }
  576. }
  577. if (this.list.mildewGrain && this.list.mildewGrain < 1 || this.list.mildewGrain && this.list.mildewGrain >
  578. 40) {
  579. this.$api.msg('霉变粒输入错误')
  580. return
  581. }
  582. if (this.list.mildewGrain && this.list.mildewGrain.indexOf('.') != -1) {
  583. if (this.list.mildewGrain.split('.')[1].length > 2) {
  584. this.$api.msg('霉变粒输入错误')
  585. return
  586. }
  587. }
  588. if (this.list.imperfectGrain && this.list.imperfectGrain < 1 || this.list.imperfectGrain && this.list
  589. .imperfectGrain > 40) {
  590. this.$api.msg('不完整粒输入错误')
  591. return
  592. }
  593. if (this.list.imperfectGrain && this.list.imperfectGrain.indexOf('.') != -1) {
  594. if (this.list.imperfectGrain.split('.')[1].length > 2) {
  595. this.$api.msg('不完整粒输入错误')
  596. return
  597. }
  598. }
  599. uni.showLoading({
  600. title: "正在暂存"
  601. })
  602. this.WarehouseInOutInfo.deductionAmount = -this.WarehouseInOutInfo.deductionAmount
  603. this.WarehouseInOutInfo.warehouseInOutDetail = this.list
  604. this.WarehouseInOutInfo.statusFlag = 1
  605. if (this.imgUrls.length > 0) {
  606. this.WarehouseInOutInfo.addressUrl = this.imgUrls[0]
  607. }
  608. this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
  609. if (res.data.code == 200) {
  610. uni.showToast({
  611. title: '暂存成功',
  612. icon: 'none',
  613. duration: 2000
  614. })
  615. setTimeout(() => {
  616. uni.navigateBack()
  617. }, 1000)
  618. } else {
  619. uni.showToast({
  620. title: res.data.message,
  621. icon: 'none',
  622. duration: 2000
  623. })
  624. }
  625. uni.hideLoading()
  626. }).catch(res => {
  627. uni.showToast({
  628. title: res.data.message,
  629. icon: 'none',
  630. duration: 2000
  631. })
  632. uni.hideLoading()
  633. })
  634. },
  635. commit() {
  636. if (!this.WarehouseInOutInfo.grossWeight) {
  637. this.$api.msg('毛重不能为空')
  638. return
  639. }
  640. if (!this.WarehouseInOutInfo.tare) {
  641. this.$api.msg('皮重不能为空')
  642. return
  643. }
  644. if (!this.WarehouseInOutInfo.warehouseName) {
  645. this.$api.msg('仓库不能为空')
  646. return
  647. }
  648. if (!this.WarehouseInOutInfo.binNumber) {
  649. this.$api.msg('仓位号不能为空')
  650. return
  651. }
  652. if (this.WarehouseInOutInfo.grossWeight > 100 || this.WarehouseInOutInfo.grossWeight < 1) {
  653. this.$api.msg('毛重输入错误')
  654. return
  655. }
  656. if (this.WarehouseInOutInfo.grossWeight.toString().indexOf('.') != -1) {
  657. if (this.WarehouseInOutInfo.grossWeight.toString().split('.')[1].length > 2) {
  658. this.$api.msg('毛重输入错误')
  659. return
  660. }
  661. }
  662. if (this.WarehouseInOutInfo.tare > 50 || this.WarehouseInOutInfo.tare < 1) {
  663. this.$api.msg('皮重输入错误')
  664. return
  665. }
  666. if (this.WarehouseInOutInfo.tare.toString().indexOf('.') != -1) {
  667. if (this.WarehouseInOutInfo.toString().tare.split('.')[1].length > 2) {
  668. this.$api.msg('皮重输入错误')
  669. return
  670. }
  671. }
  672. if (this.WarehouseInOutInfo.deductionAmount && this.WarehouseInOutInfo.deductionAmount > 10000 || this
  673. .WarehouseInOutInfo.deductionAmount && this.WarehouseInOutInfo.deductionAmount < 0) {
  674. this.$api.msg('扣款金额输入错误')
  675. return
  676. }
  677. if (this.WarehouseInOutInfo.deductionAmount && this.WarehouseInOutInfo.deductionAmount.toString().indexOf(
  678. '.') != -1) {
  679. if (this.WarehouseInOutInfo.deductionAmount.toString().split('.')[1].length > 2) {
  680. this.$api.msg('扣款金额输入错误')
  681. return
  682. }
  683. }
  684. if (this.list.qualityInspector && this.list.qualityInspector < 2 || this.list.qualityInspector && this.list
  685. .qualityInspector > 10) {
  686. this.$api.msg('质检员姓名输入错误')
  687. return
  688. }
  689. if (this.list.protein && this.list.protein < 0 || this.list.protein && this.list.protein > 80) {
  690. this.$api.msg('蛋白占比输入错误')
  691. return
  692. }
  693. if (this.list.protein && this.list.protein.indexOf('.') != -1) {
  694. if (this.list.protein.split('.')[1].length > 2) {
  695. this.$api.msg('蛋白占比输入错误')
  696. return
  697. }
  698. }
  699. if (this.list.waterContent && this.list.waterContent < 0 || this.list.waterContent && this.list
  700. .waterContent > 40) {
  701. this.$api.msg('水分输入错误')
  702. return
  703. }
  704. if (this.list.waterContent && this.list.waterContent.indexOf('.') != -1) {
  705. if (this.list.waterContent.split('.')[1].length > 2) {
  706. this.$api.msg('水分输入错误')
  707. return
  708. }
  709. }
  710. if (this.list.bulkDensity && this.list.bulkDensity < 0 || this.list.bulkDensity && this.list.bulkDensity >
  711. 1000) {
  712. this.$api.msg('容重输入错误')
  713. return
  714. }
  715. if (this.list.bulkDensity && this.list.bulkDensity.indexOf('.') != -1) {
  716. if (this.list.bulkDensity.split('.')[1].length > 2) {
  717. this.$api.msg('容重输入错误')
  718. return
  719. }
  720. }
  721. if (this.list.jiaorenli && this.list.jiaorenli < 0 || this.list.jiaorenli && this.list.jiaorenli > 40) {
  722. this.$api.msg('热损伤输入错误')
  723. return
  724. }
  725. if (this.list.jiaorenli && this.list.jiaorenli.indexOf('.') != -1) {
  726. if (this.list.jiaorenli.split('.')[1].length > 2) {
  727. this.$api.msg('热损伤输入错误')
  728. return
  729. }
  730. }
  731. if (this.list.impurity && this.list.impurity < 0 || this.list.impurity && this.list.impurity > 40) {
  732. this.$api.msg('杂质输入错误')
  733. return
  734. }
  735. if (this.list.impurity && this.list.impurity.indexOf('.') != -1) {
  736. if (this.list.impurity.split('.')[1].length > 2) {
  737. this.$api.msg('杂质输入错误')
  738. return
  739. }
  740. }
  741. if (this.list.mildewGrain && this.list.mildewGrain < 0 || this.list.mildewGrain && this.list.mildewGrain >
  742. 40) {
  743. this.$api.msg('霉变粒输入错误')
  744. return
  745. }
  746. if (this.list.mildewGrain && this.list.mildewGrain.indexOf('.') != -1) {
  747. if (this.list.mildewGrain.split('.')[1].length > 2) {
  748. this.$api.msg('霉变粒输入错误')
  749. return
  750. }
  751. }
  752. if (this.list.imperfectGrain && this.list.imperfectGrain < 0 || this.list.imperfectGrain && this.list
  753. .imperfectGrain > 40) {
  754. this.$api.msg('不完整粒输入错误')
  755. return
  756. }
  757. if (this.list.imperfectGrain && this.list.imperfectGrain.indexOf('.') != -1) {
  758. if (this.list.imperfectGrain.split('.')[1].length > 2) {
  759. this.$api.msg('不完整粒输入错误')
  760. return
  761. }
  762. }
  763. this.WarehouseInOutInfo.deductionAmount = -this.WarehouseInOutInfo.deductionAmount
  764. if (this.imgUrls.length > 0) {
  765. this.WarehouseInOutInfo.addressUrl = this.imgUrls[0]
  766. }
  767. this.WarehouseInOutInfo.warehouseInOutDetail = this.list
  768. this.WarehouseInOutInfo.statusFlag = 3
  769. this.WarehouseInOutInfo.pcFlag = 0
  770. for (let i = 0; i < this.warehouselist.length; i++) {
  771. if (this.warehouselist[i].warehouseName == this.WarehouseInOutInfo.warehouseName) {
  772. this.WarehouseInOutInfo.baseId = this.warehouselist[i].id
  773. }
  774. }
  775. uni.showLoading({
  776. title: "正在提交"
  777. })
  778. this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
  779. if (res.data.code == 200) {
  780. setTimeout(() => {
  781. uni.navigateBack()
  782. }, 1000)
  783. uni.showToast({
  784. title: '提交成功',
  785. icon: 'none',
  786. duration: 2000
  787. })
  788. } else {
  789. uni.showToast({
  790. title: '系统异常,请联系管理员',
  791. icon: 'none',
  792. duration: 2000
  793. })
  794. }
  795. uni.hideLoading()
  796. }).catch(res => {
  797. uni.showToast({
  798. title: '系统异常,请联系管理员',
  799. icon: 'none',
  800. duration: 2000
  801. })
  802. uni.hideLoading()
  803. })
  804. },
  805. numFilter(value) {
  806. if (!value) {
  807. return 0
  808. }
  809. // 截取当前数据到小数点后两位
  810. let realVal = parseFloat(value).toFixed(2)
  811. return realVal
  812. },
  813. grossWeightInput(e) {
  814. this.WarehouseInOutInfo.grossWeight = e.detail.value
  815. if (this.WarehouseInOutInfo.grossWeight && this.WarehouseInOutInfo.tare) {
  816. this.WarehouseInOutInfo.netWeight = this.WarehouseInOutInfo.grossWeight - this.WarehouseInOutInfo.tare
  817. }
  818. },
  819. tareInput(e) {
  820. this.WarehouseInOutInfo.tare = e.detail.value
  821. if (this.WarehouseInOutInfo.grossWeight && this.WarehouseInOutInfo.tare) {
  822. this.WarehouseInOutInfo.netWeight = this.WarehouseInOutInfo.grossWeight - this.WarehouseInOutInfo.tare
  823. }
  824. },
  825. ruChange(e) {
  826. this.ruIndex = e.detail.value
  827. this.WarehouseInOutInfo.inOutTypeKey = e.detail.value
  828. this.WarehouseInOutInfo.inOutType = this.ruType[this.ruIndex];
  829. },
  830. chuChange(e) {
  831. this.chuIndex = e.detail.value
  832. this.WarehouseInOutInfo.inOutTypeKey = e.detail.value
  833. this.WarehouseInOutInfo.inOutType = this.chuType[this.chuIndex];
  834. },
  835. pinChange(e) {
  836. this.pinIndex = e.detail.value
  837. this.WarehouseInOutInfo.gradeKey = e.detail.value
  838. this.WarehouseInOutInfo.grade = this.pinType[this.pinIndex];
  839. },
  840. }
  841. }
  842. </script>
  843. <style scoped lang='scss'>
  844. .upload {
  845. /deep/.u-list-item,
  846. .u-add-wrap {
  847. background-color: #eceae8;
  848. }
  849. }
  850. .center {
  851. margin: 15rpx 15rpx 10rpx 15rpx;
  852. padding: 0rpx 10rpx 30rpx 10rpx;
  853. padding-top: 40px;
  854. background-color: #FFFFFF;
  855. border-radius: 15px;
  856. }
  857. .title_b {
  858. margin: 20rpx 20rpx 0rpx 20rpx;
  859. padding: 20rpx 10rpx 20rpx 10rpx;
  860. font-size: 18px;
  861. font-weight: 550;
  862. border-bottom: 1px solid #d6d6d6;
  863. }
  864. .title_c {
  865. margin: 20rpx 20rpx 0rpx 20rpx;
  866. padding: 20rpx 10rpx 20rpx 10rpx;
  867. font-size: 18px;
  868. font-weight: 550;
  869. }
  870. .c-row {
  871. display: -webkit-box;
  872. display: -webkit-flex;
  873. display: flex;
  874. -webkit-box-align: center;
  875. -webkit-align-items: center;
  876. align-items: center;
  877. padding: 20rpx 30rpx;
  878. position: relative;
  879. }
  880. .con-list {
  881. -webkit-box-flex: 1;
  882. -webkit-flex: 1;
  883. flex: 1;
  884. display: -webkit-box;
  885. display: -webkit-flex;
  886. display: flex;
  887. -webkit-box-orient: vertical;
  888. -webkit-box-direction: normal;
  889. -webkit-flex-direction: column;
  890. flex-direction: column;
  891. color: #303133;
  892. line-height: 40rpx;
  893. text-align: right;
  894. padding-right: 20rpx;
  895. }
  896. .d-header {
  897. display: flex;
  898. justify-content: center;
  899. align-items: center;
  900. height: 80upx;
  901. font-size: $font-base + 2upx;
  902. color: $font-color-dark;
  903. position: relative;
  904. text {
  905. padding: 0 20upx;
  906. background: #fff;
  907. position: relative;
  908. z-index: 1;
  909. }
  910. &:after {
  911. position: absolute;
  912. left: 50%;
  913. top: 50%;
  914. transform: translateX(-50%);
  915. width: 300upx;
  916. height: 0;
  917. content: '';
  918. border-bottom: 1px solid #ccc;
  919. }
  920. }
  921. /* 底部操作菜单 */
  922. .page-bottom1 {
  923. position: fixed;
  924. left: 0;
  925. bottom: 0;
  926. z-index: 95;
  927. width: 100%;
  928. height: 70px;
  929. background: rgba(255, 255, 255, .9);
  930. padding: 15px;
  931. border-radius: 0;
  932. text-align: right;
  933. button {
  934. display: inline-block;
  935. border-radius: 18px;
  936. margin: 0 10px;
  937. font-size: 14px;
  938. background: #fff;
  939. color: #333;
  940. border: 1px solid #333;
  941. padding-left: 50rpx;
  942. padding-right: 50rpx;
  943. }
  944. .action-btn {
  945. background: #22C572;
  946. color: #fff;
  947. border: 1px solid #22C572;
  948. }
  949. .p-b-btn {
  950. display: flex;
  951. flex-direction: column;
  952. align-items: center;
  953. justify-content: center;
  954. font-size: $font-sm;
  955. color: $font-color-base;
  956. width: 96upx;
  957. height: 80upx;
  958. .yticon {
  959. font-size: 40upx;
  960. line-height: 48upx;
  961. color: $font-color-light;
  962. }
  963. &.active,
  964. &.active .yticon {
  965. color: $uni-color-primary;
  966. }
  967. .icon-fenxiang2 {
  968. font-size: 42upx;
  969. transform: translateY(-2upx);
  970. }
  971. .icon-shoucang {
  972. font-size: 46upx;
  973. }
  974. }
  975. }
  976. .container {
  977. padding-bottom: 160upx;
  978. }
  979. .picture {
  980. width: 75px;
  981. height: 75px;
  982. border-radius: 10px;
  983. margin-left: 16px;
  984. }
  985. .header {
  986. position: absolute;
  987. left: 0;
  988. z-index: 9999;
  989. padding-top: var(--status-bar-height);
  990. top: 40upx;
  991. width: 100%;
  992. font-size: 40upx;
  993. color: $font-color-dark;
  994. }
  995. </style>