exWarehousing.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  1. <template>
  2. <view class="warp">
  3. <view class="top">
  4. <view class="top-left">{{warehouseName}}</view>
  5. <view>{{binNumber}}仓位</view>
  6. </view>
  7. <view class="content">
  8. <view class="row">
  9. <view class="left">任务编号</view>
  10. <view @click='inOutShow=true'>{{detailData.inOutTaskNo ? detailData.inOutTaskNo : "暂未获取到任务编号"}}</view>
  11. <u-picker :range="inOutNoList" range-key="inOutTaskNo" @confirm='inOutChange' v-model="inOutShow"
  12. mode="selector">
  13. </u-picker>
  14. </view>
  15. <view class="row row-bottom">
  16. <view class="left">合同编号</view>
  17. <!-- <view @click='slectcontractNo'>{{detailData.contractNo}}</view> -->
  18. <input v-model='detailData.contractNo' class="right-bottom" placeholder="暂未获取到合同编号" disabled=""></input>
  19. </view>
  20. <view class="row">
  21. <view class="left">提示</view>
  22. <view class="right">{{detailData.tips}}</view>
  23. </view>
  24. <view class="row">
  25. <view class="left">货名</view>
  26. <view class="right">{{detailData.goodsName ? detailData.goodsName : "选择合同,自动获取"}}
  27. </view>
  28. </view>
  29. <view class="row">
  30. <view class="left">类型</view>
  31. <view @click='show1=true'>{{detailData.type}}</view>
  32. <u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
  33. mode="selector">
  34. <view class="">{{detailData.type}}</view>
  35. </u-picker>
  36. </view>
  37. <view class="row row-bottom">
  38. <view class="left">毛重(吨)</view>
  39. <input type="digit" @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  40. placeholder="输入毛重"></input>
  41. </view>
  42. <view class="row row-bottom">
  43. <view class="left">皮重(吨)</view>
  44. <input type="digit" @input='calculate' v-model='detailData.tare' class="right-bottom" placeholder="输入皮重"></input>
  45. </view>
  46. <view class="row row-bottom">
  47. <view class="left">净重(吨)</view>
  48. <input v-model='netWeight' disabled class="right-bottom" placeholder="不可编辑,自动计算"></input>
  49. </view>
  50. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  51. <view class="left">扣重比</view>
  52. <input type="digit" v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"
  53. @input="pureWeightCount"></input>
  54. </view>
  55. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  56. <view class="left">干粮水分(%)</view>
  57. <input type="digit" v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"
  58. @input="pureWeightCount"></input>
  59. </view>
  60. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  61. <view class="left">潮粮水分(%)</view>
  62. <input type="digit" v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"
  63. @input="pureWeightCount"></input>
  64. </view>
  65. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  66. <view class="left">纯重(吨)</view>
  67. <input v-model='detailData.pureWeight' class="right-bottom" placeholder="不可编辑,自动计算"></input>
  68. </view>
  69. <view class="row">
  70. <view class="left">品级</view>
  71. <view @click='show3=true'>{{detailData.grade}}</view>
  72. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show3" mode="selector">
  73. </u-picker>
  74. </view>
  75. <view class="row">
  76. <view class="left">经办人</view>
  77. <view @click='show6=true'>{{detailData.agent}}</view>
  78. <u-picker :range="handlerList" range-key="staffName" @confirm='handlerPicker($event)' v-model="show6"
  79. mode="selector">
  80. </u-picker>
  81. </view>
  82. <view class="row">
  83. <view class="left">出库日期</view>
  84. <view @click='show7=true'>{{detailData.inOutDate}}</view>
  85. <u-picker v-model="show7" mode="time" @confirm='dateChange($event)' :params="params">
  86. </u-picker>
  87. </view>
  88. <view class="row row-bottom">
  89. <view class="left">出库类型</view>
  90. <input v-model='detailData.inOutType' class="right-bottom" :disabled="isSelectType"
  91. placeholder="自动获取"></input>
  92. <!-- <u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)'
  93. v-model="show5" mode="selector">
  94. </u-picker> -->
  95. </view>
  96. <view class="row">
  97. <view class="left">出库方式</view>
  98. <view @click='show8=true'>{{detailData.outType?detailData.outType:'汽运'}}</view>
  99. <u-picker v-model="show8" mode="selector" range-key="name" :range="multiSelector"
  100. @confirm='outtypeChange($event)'>
  101. </u-picker>
  102. </view>
  103. <view class="row row-bottom" v-if="detailData.outType!='火运' && detailData.outType!='散船'">
  104. <!-- <view class="left">车牌号</view>
  105. <input v-if="!isPC" v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input>
  106. <view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view> -->
  107. <view class="left">车牌号</view>
  108. <!-- 他运合同车牌号输入 -->
  109. <input v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号" v-if="!showCar"></input>
  110. <!-- <view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view> -->
  111. <!-- 自运合同车牌号需下拉 -->
  112. <view v-if="!carno" v-show="showCar" @click="carno = true">{{detailData.carNo?detailData.carNo :"请选择车牌号"}}</view>
  113. <u-picker :range="carList" range-key="carNo" @confirm='carPicker($event)' v-model="carno" mode="selector">
  114. </u-picker>
  115. </view>
  116. <view class="row row-bottom" v-if="detailData.outType=='火运'">
  117. <view class="left">车号</view>
  118. <input v-model='detailData.carNo' class="right-bottom" placeholder="请输入车号"></input>
  119. </view>
  120. <view v-if='detailData.outType=="集装箱船"||!detailData.outType||detailData.outType=="汽运"'
  121. class="row row-bottom">
  122. <view class="left">箱号</view>
  123. <input v-model='detailData.boxNo' class="right-bottom" placeholder="请输入箱号"></input>
  124. <input v-model='detailData.boxNoOther' class="right-bottom"
  125. placeholder="请输入箱号"></input>
  126. </view>
  127. <view v-if='!detailData.outType||detailData.outType=="汽运" || detailData.outType=="集装箱船"' class="row row-bottom">
  128. <view class="left">封号</view>
  129. <input v-model='detailData.titleNo' class="right-bottom"
  130. placeholder="请输入封号"></input>
  131. <input v-model='detailData.titleNoOther' class="right-bottom"
  132. placeholder="请输入封号"></input>
  133. </view>
  134. <view v-if='detailData.outType=="火运"' class="row row-bottom">
  135. <view class="left">车厢号</view>
  136. <input v-model='detailData.wingNumber' @input="toUpperCase2" class="right-bottom"
  137. placeholder="请输入车厢号"></input>
  138. <input v-model='detailData.wingNumberOther' @input="toUpperCase3" class="right-bottom"
  139. placeholder="请输入车厢号"></input>
  140. </view>
  141. <view v-if='detailData.outType=="散船"' class="row row-bottom">
  142. <view class="left">航次</view>
  143. <input v-model='detailData.shipNumber' class="right-bottom" placeholder="请输入航次"></input>
  144. </view>
  145. <view v-if='detailData.outType=="散船"' class="row row-bottom">
  146. <view class="left">船名</view>
  147. <input v-model='detailData.shipName' class="right-bottom" placeholder="请输入船名"></input>
  148. </view>
  149. </view>
  150. <view class="content2">
  151. <view class="left">上传磅单</view>
  152. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  153. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  154. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  155. </view>
  156. <view class="content1">
  157. <view class="title">
  158. 质检数据(选填)
  159. </view>
  160. <view class="row row-bottom">
  161. <view class="left">质检员</view>
  162. <input v-model='detailData.warehouseInOutDetail.qualityInspector' class="right-bottom"
  163. placeholder="输入质检员姓名"></input>
  164. </view>
  165. <view class="row row-bottom">
  166. <view class="left">水分(%)</view>
  167. <input type="digit" v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom"
  168. placeholder="输入水分占比"></input>
  169. </view>
  170. <view class="row row-bottom">
  171. <view class="left">容重(克/升)</view>
  172. <input type="digit" v-model='detailData.warehouseInOutDetail.bulkDensity' class="right-bottom"
  173. placeholder="输入容重"></input>
  174. </view>
  175. <view class="row row-bottom">
  176. <view class="left">热损伤(%)</view>
  177. <input type="digit" v-model='detailData.warehouseInOutDetail.jiaorenli' class="right-bottom"
  178. placeholder="输入热损伤占比"></input>
  179. </view>
  180. <view class="row row-bottom">
  181. <view class="left">杂质(%)</view>
  182. <input type="digit" v-model='detailData.warehouseInOutDetail.impurity' class="right-bottom"
  183. placeholder="输入杂质占比"></input>
  184. </view>
  185. <view class="row row-bottom">
  186. <view class="left">霉变粒(%)</view>
  187. <input type="digit" v-model='detailData.warehouseInOutDetail.mildewGrain' class="right-bottom"
  188. placeholder="输入霉变粒占比"></input>
  189. </view>
  190. <view class="row row-bottom">
  191. <view class="left">不完善粒(%)</view>
  192. <input type="digit" v-model='detailData.warehouseInOutDetail.imperfectGrain' class="right-bottom"
  193. placeholder="输入不完善粒占比"></input>
  194. </view>
  195. </view>
  196. <u-toast ref="uToast" />
  197. <view class="bottom-btn">
  198. <u-button type="primary" class="submit" hover-class="none" @click="submit(1)">暂存</u-button>
  199. <u-button type="primary" class="submit" hover-class="none" @click="submit(2)">提交</u-button>
  200. </view>
  201. </view>
  202. </template>
  203. <script>
  204. import upload from '@/components/upload.vue';
  205. import helper from '@/common/helper.js';
  206. import {
  207. mapState
  208. } from 'vuex';
  209. export default {
  210. components: {
  211. upload
  212. },
  213. data() {
  214. return {
  215. show: false,
  216. show1: false,
  217. show2: false,
  218. show3: false,
  219. show4: false,
  220. show5: false,
  221. show6: false,
  222. show7: false,
  223. isPC: true,
  224. show8: false,
  225. carno:false,
  226. usestart: '',
  227. multiSelector: [{
  228. name: '汽运',
  229. value: '0'
  230. },
  231. {
  232. name: '火运',
  233. value: '1'
  234. },
  235. {
  236. name: '集装箱船',
  237. value: '2'
  238. },
  239. {
  240. name: '散船',
  241. value: '3'
  242. },
  243. ],
  244. show9: false,
  245. multiSelector1: [{
  246. name: '汽运',
  247. value: '0'
  248. },
  249. {
  250. name: '火运',
  251. value: '1'
  252. },
  253. {
  254. name: '集装箱船',
  255. value: '2'
  256. },
  257. {
  258. name: '散船',
  259. value: '3'
  260. },
  261. ],
  262. isSelectType: true,
  263. // contractNoList: [{
  264. // contractNo: ""
  265. // }],
  266. typeList: [{
  267. type: "干粮"
  268. },
  269. {
  270. type: "潮粮"
  271. }
  272. ],
  273. pjList: [{
  274. type: "一等品"
  275. },
  276. {
  277. type: "二等品"
  278. },
  279. {
  280. type: "三等品"
  281. },
  282. {
  283. type: "等外"
  284. }
  285. ],
  286. handlerList: [],
  287. warehousingTypeList: [],
  288. action: this.$uploadUrl,
  289. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  290. btnLoading: false, //防止重复点击
  291. isAdd: true,
  292. warehouseName: '',
  293. binNumber: '',
  294. detailData: {
  295. outType: '汽运',
  296. contractNo: "",
  297. type: "干粮",
  298. grade: "请输入品级",
  299. agent: "请选择经办人",
  300. inOutDate: "请选择出库日期",
  301. inOutType: "请选择出库类型",
  302. warehouseInOutDetail: {},
  303. gradeKey: "",
  304. grossWeight: "",
  305. tare: "",
  306. },
  307. params: {
  308. year: true,
  309. month: true,
  310. day: true,
  311. },
  312. netWeight: "",
  313. inOutShow: false,
  314. inOutNoList: [],
  315. carList:[],//车牌号下拉
  316. showCar:false,
  317. }
  318. },
  319. computed: {
  320. ...mapState(['hasLogin', 'userInfo'])
  321. },
  322. watch: {
  323. netWeight: function(v) {
  324. this.pureWeightCount()
  325. },
  326. },
  327. onLoad(options) {
  328. this.id = options.id
  329. this.cangId = options.cangId
  330. },
  331. onShow() {
  332. let _data = uni.getStorageSync('erpContractNoCK') == '' ? {} : uni.getStorageSync('erpContractNoCK')
  333. this.binNumber = helper.erpWarehouse.binNumber
  334. this.warehouseName = helper.erpWarehouse.warehouseName
  335. this.detailData.goodsName = _data.goodsName;
  336. this.detailData.inOutType = _data.inOutType;
  337. if (this.detailData.inOutType == '销售出库') {
  338. this.detailData.inOutTypeKey = 1
  339. } else if (this.detailData.inOutType == '移库出库') {
  340. this.detailData.inOutTypeKey = 3
  341. } else if (this.detailData.inOutType == '暂存出库') {
  342. this.detailData.inOutTypeKey = 4
  343. } else if (this.detailData.inOutType == '贸易服务出库') {
  344. this.detailData.inOutTypeKey = 5
  345. } else if (this.detailData.inOutType == '采购出库') {
  346. this.detailData.inOutTypeKey = 6
  347. }
  348. // if (_data.contractNo) {
  349. // this.detailData.contractNo = _data.contractNo;
  350. // }
  351. this.detailData.goodsNameKey = _data.goodsNameKey;
  352. if (!_data.tranCarInfoList) {
  353. this.isPC = false
  354. _data.tranCarInfoList = []
  355. } else {
  356. this.isPC = true
  357. if (uni.getStorageSync('ContractNoCarCK')) {
  358. this.detailData.carNo = uni.getStorageSync('ContractNoCarCK')
  359. } else {
  360. this.detailData.carNo = _data.tranCarInfoList[0].carNo
  361. }
  362. }
  363. if (this.detailData.carNo) {
  364. for (let i = 0; i < uni.getStorageSync('erpContractNoCK').tranCarInfoList.length; i++) {
  365. if (uni.getStorageSync('erpContractNoCK').tranCarInfoList[i].carNo == this.detailData.carNo)
  366. this.detailData.tranCarNo = uni.getStorageSync('erpContractNoCK').tranCarInfoList[i].tranCarNo
  367. }
  368. }
  369. if (!this.detailData.contractNo) {
  370. this.detailData.contractNo = '请选择合同编号'
  371. } else {
  372. if (_data.tranCarInfoList.length == 0) {
  373. this.isPC = false
  374. }
  375. }
  376. if (!this.detailData.goodsName) {
  377. this.detailData.goodsName = '货名'
  378. }
  379. let _day = new Date();
  380. _day.setTime(_day.getTime());
  381. this.detailData.inOutDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
  382. //出库类型
  383. this.outWarehouse()
  384. if (helper.erpWarehouse.personCharge) {
  385. this.detailData.agent = helper.erpWarehouse.personCharge
  386. }
  387. //查看任务编号
  388. this.inOutNo()
  389. //经办人
  390. this.handler()
  391. },
  392. methods: {
  393. inOutNo() {
  394. this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
  395. flag: 1,
  396. warehouseName:this.warehouseName,
  397. agentKey : this.userInfo.id
  398. }).then(res => {
  399. this.inOutNoList = res.data.data
  400. this.detailData.inOutTaskNo = this.inOutNoList[0].inOutTaskNo
  401. this.detailData.agent = this.inOutNoList[0].agent
  402. if (this.inOutNoList[0].contractNo) {
  403. this.detailData.contractNo = this.inOutNoList[0].contractNo
  404. } else {
  405. this.detailData.contractNo = this.inOutNoList[0].moveTaskNo
  406. }
  407. this.detailData.goodsName = this.inOutNoList[0].goodsName
  408. this.detailData.grade = this.inOutNoList[0].grade
  409. this.detailData.inOutType = this.inOutNoList[0].inOutType
  410. //查询所有的合同 进行获取车牌号
  411. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  412. flag: 5,
  413. compId: helper.erpWarehouse.compId,
  414. }).then(res => {
  415. if (res.data.code == 200) {
  416. for(let i = 0 ; i < res.data.data.length ; i++){
  417. // "MYCGYMHLJ2021102401"
  418. if(res.data.data[i].contractNo == this.detailData.contractNo){//如果查到该合同
  419. if(res.data.data[i].deliverType == '1'){//判断自运1,他运2合同
  420. this.showCar = true
  421. }else{
  422. this.showCar = false
  423. }
  424. if(res.data.data[i].tranCarInfoList){
  425. this.carList = res.data.data[i].tranCarInfoList //车牌号下拉列表
  426. }
  427. }
  428. }
  429. }
  430. })
  431. })
  432. // this.$api.doRequest('get', 'warehouseBaseInfo/selectContractNoList', ).then(res => {
  433. // this.contractNoList = res.data.data
  434. // for (var i = 0; i < this.contractNoList.length; i++) {
  435. // if (this.contractNoList[i].contractNo == this.detailData.contractNo) {
  436. // if (this.detailData.inOutType == '销售出库') {
  437. // this.detailData.tips = '买方' + this.contractNoList[i].buyer
  438. // } else if (this.detailData.inOutType == '移库出库') {
  439. // this.detailData.tips = '入货库' + this.inOutNoList[0].warehouseName
  440. // }
  441. // }
  442. // }
  443. // })
  444. },
  445. inOutChange(e) {
  446. this.detailData.inOutTaskNo = this.inOutNoList[e[0]].inOutTaskNo
  447. this.detailData.agent = this.inOutNoList[e[0]].agent
  448. if (this.inOutNoList[e[0]].contractNo) {
  449. this.detailData.contractNo = this.inOutNoList[e[0]].contractNo
  450. } else {
  451. this.detailData.contractNo = this.inOutNoList[e[0]].moveTaskNo
  452. }
  453. this.detailData.goodsName = this.inOutNoList[e[0]].goodsName
  454. this.detailData.grade = this.inOutNoList[e[0]].grade
  455. this.detailData.inOutType = this.inOutNoList[e[0]].inOutType
  456. if (this.detailData.inOutType == '销售出库') {
  457. this.detailData.tips = '买方' + this.contractNoList[i].buyer
  458. } else if (this.detailData.inOutType == '移库出库') {
  459. this.detailData.tips = '入货库' + this.inOutNoList[e[0]].warehouseName
  460. }
  461. },
  462. toUpperCase(val) {
  463. this.detailData.boxNo = val.detail.value.toUpperCase()
  464. },
  465. toUpperCase1(val) {
  466. this.detailData.boxNoOther = val.detail.value.toUpperCase()
  467. },
  468. usestartChange(e) {
  469. this.usestart = this.multiSelector1[e].name
  470. },
  471. //计算纯重
  472. pureWeightCount() {
  473. if (this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this
  474. .detailData.tidalGrainWater) {
  475. // 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
  476. this.detailData.pureWeight = 100 - (this.detailData.tidalGrainWater - this.detailData
  477. .solidGrainWater) * this.netWeight * this.detailData.buckleWeightRatio / 100
  478. this.detailData.pureWeight = this.detailData.pureWeight.toFixed(3)
  479. }
  480. },
  481. outtypeChange(e) {
  482. this.detailData.outType = this.multiSelector[e].name
  483. console.log(e)
  484. },
  485. toUpperCase2(val) {
  486. this.detailData.wingNumber = val.detail.value.toUpperCase()
  487. },
  488. toUpperCase3(val) {
  489. this.detailData.wingNumberOther = val.detail.value.toUpperCase()
  490. },
  491. outWarehouse() {
  492. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  493. constId: 'CON6'
  494. }).then(res => {
  495. this.warehousingTypeList = res.data.data
  496. })
  497. },
  498. handler() {
  499. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  500. compId: helper.erpWarehouse.compId,
  501. warehouseId: helper.erpWarehouse.warehouseId
  502. }).then(res => {
  503. this.handlerList = res.data.data
  504. })
  505. },
  506. contractNopicker(e) {
  507. },
  508. typePicker(e) {
  509. this.detailData.type = this.typeList[e].type
  510. },
  511. pjPicker(e) {
  512. this.detailData.gradeKey = e[0] + 1
  513. this.detailData.grade = this.pjList[e].type
  514. },
  515. handlerPicker(e) {
  516. this.detailData.agentKey = e[0]
  517. this.detailData.agent = this.handlerList[e].staffName
  518. },
  519. dateChange(e) {
  520. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  521. },
  522. warehousingTypePicker(e) {
  523. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  524. if (this.detailData.inOutType == '销售出库') {
  525. this.detailData.inOutTypeKey = 1
  526. } else if (this.detailData.inOutType == '移库出库') {
  527. this.detailData.inOutTypeKey = 3
  528. } else if (this.detailData.inOutType == '暂存出库') {
  529. this.detailData.inOutTypeKey = 4
  530. } else if (this.detailData.inOutType == '贸易服务出库') {
  531. this.detailData.inOutTypeKey = 5
  532. } else if (this.detailData.inOutType == '采购出库') {
  533. this.detailData.inOutTypeKey = 6
  534. }
  535. },
  536. filterFileType(index, lists) {
  537. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  538. lists.splice(index, 1);
  539. // 当前文件不支持
  540. uni.showModal({
  541. title: '暂不支持当前图片类型',
  542. showCancel: false
  543. });
  544. } else {
  545. this.isAdd = false;
  546. }
  547. },
  548. calculate() {
  549. if (this.detailData.grossWeight && this.detailData.tare) {
  550. this.netWeight = this.detailData.grossWeight - this.detailData.tare
  551. }
  552. },
  553. getImgUrl(res) {
  554. this.detailData.addressUrl = res
  555. },
  556. onError(error) {
  557. console.log('------------error-----------')
  558. console.log(error)
  559. },
  560. binNumberpicker(e) {
  561. this.detailData.binNumber = this.positionList[e[0]].binNumber
  562. },
  563. carPicker(e) {
  564. // this.detailData.gradeKey = e[0] + 1
  565. this.detailData.carNo = this.carList[e].carNo
  566. },
  567. onProgress(e) {},
  568. onRemove() {
  569. this.detailData.addressUrl = ""
  570. },
  571. submit(num) {
  572. if (!this.detailData.contractNo) {
  573. this.$api.msg('合同编号不能为空')
  574. return
  575. }
  576. if (!this.detailData.goodsName) {
  577. this.$api.msg('货名不能为空')
  578. return
  579. }
  580. if (!this.detailData.grossWeight && num == 2) {
  581. this.$api.msg('毛重不能为空')
  582. return
  583. }
  584. if (isNaN(this.detailData.grossWeight) ||
  585. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  586. String(this.detailData.grossWeight).length -
  587. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  588. 3) ||
  589. this.detailData.grossWeight < 0 ||
  590. this.detailData.grossWeight > 10000
  591. ) {
  592. this.$api.msg('毛重输入错误!')
  593. return
  594. }
  595. if (!this.detailData.tare && num == 2) {
  596. this.$api.msg('皮重不能为空')
  597. return
  598. }
  599. if (isNaN(this.detailData.tare) ||
  600. (String(this.detailData.tare).indexOf('.') != -1 &&
  601. String(this.detailData.tare).length -
  602. (String(this.detailData.tare).indexOf('.') + 1) >
  603. 3) ||
  604. this.detailData.tare < 0 ||
  605. this.detailData.tare > 10000
  606. ) {
  607. this.$api.msg('皮重输入错误!')
  608. return
  609. }
  610. if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
  611. this.$api.msg('皮重不能大于毛重')
  612. return
  613. }
  614. if (this.netWeight <= 0 && num == 2) {
  615. this.$api.msg('净重不能小于等于0')
  616. return
  617. }
  618. if (this.detailData.type == "潮粮") {
  619. if (!this.detailData.buckleWeightRatio && num == 2) {
  620. this.$api.msg('扣重比不能为空')
  621. return
  622. }
  623. if (isNaN(this.detailData.buckleWeightRatio) ||
  624. (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
  625. String(this.detailData.buckleWeightRatio).length -
  626. (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
  627. 2) ||
  628. this.detailData.buckleWeightRatio < 0 ||
  629. this.detailData.buckleWeightRatio > 3
  630. ) {
  631. this.$api.msg('扣重比输入错误!')
  632. return
  633. }
  634. if (!this.detailData.solidGrainWater && num == 2) {
  635. this.$api.msg('干粮水分不能为空')
  636. return
  637. }
  638. if (isNaN(this.detailData.solidGrainWater) ||
  639. (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
  640. String(this.detailData.solidGrainWater).length -
  641. (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
  642. 1) ||
  643. this.detailData.solidGrainWater < 1 ||
  644. this.detailData.solidGrainWater > 40
  645. ) {
  646. this.$api.msg('干粮水分输入错误!')
  647. return
  648. }
  649. if (!this.detailData.tidalGrainWater && num == 2) {
  650. this.$api.msg('潮粮水分不能为空')
  651. return
  652. }
  653. if (isNaN(this.detailData.tidalGrainWater) ||
  654. (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
  655. String(this.detailData.tidalGrainWater).length -
  656. (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
  657. 1) ||
  658. this.detailData.tidalGrainWater < 1 ||
  659. this.detailData.tidalGrainWater > 40
  660. ) {
  661. this.$api.msg('潮粮水分输入错误!')
  662. return
  663. }
  664. if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
  665. this.$api.msg('潮粮水分输入错误!')
  666. return
  667. }
  668. if (!this.detailData.pureWeight && num == 2) {
  669. this.$api.msg('纯重不能为空')
  670. return
  671. }
  672. }
  673. if (this.detailData.grade == "请输入品级" && num == 2) {
  674. this.$api.msg('品级不能为空')
  675. return
  676. }
  677. if (this.detailData.agent == "请选择经办人") {
  678. this.$api.msg('经办人不能为空')
  679. return
  680. }
  681. if (this.detailData.inOutDate == "请选择出库日期") {
  682. this.$api.msg('出库日期不能为空')
  683. return
  684. }
  685. if (this.detailData.inOutType == "请选择出库类型") {
  686. this.$api.msg('出库类型不能为空')
  687. return
  688. }
  689. if (!this.detailData.carNo && num == 2) {
  690. this.$api.msg('车牌号不能为空')
  691. return
  692. }
  693. if (this.detailData.carNo.length != 7) {
  694. this.$api.msg('车牌号输入有误!')
  695. return
  696. }
  697. if (!this.detailData.addressUrl && num == 2) {
  698. this.$api.msg('请上传磅单')
  699. return
  700. }
  701. if (this.detailData.warehouseInOutDetail.qualityInspector) {
  702. if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
  703. .qualityInspector > 10) {
  704. this.$api.msg('质检员姓名需要2-10个字')
  705. return
  706. }
  707. }
  708. if (this.detailData.warehouseInOutDetail.waterContent) {
  709. if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
  710. .detailData.tidalGrainWater) {
  711. this.$api.msg('水分占比与潮粮水分不一致')
  712. return
  713. }
  714. if (this.detailData.type == "干粮") {
  715. if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
  716. .waterContent > 40) {
  717. this.$api.msg('水分占比输入错误')
  718. return
  719. }
  720. }
  721. if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
  722. .detailData.warehouseInOutDetail.waterContent).length - (String(
  723. this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
  724. this.$api.msg('水分占比输入错误')
  725. return
  726. }
  727. }
  728. if (this.detailData.warehouseInOutDetail.bulkDensity) {
  729. if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
  730. .bulkDensity > 1000) {
  731. this.$api.msg('容重输入错误')
  732. return
  733. }
  734. if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
  735. .detailData.warehouseInOutDetail.bulkDensity).length - (
  736. String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
  737. this.$api.msg('容重输入错误')
  738. return
  739. }
  740. }
  741. if (this.detailData.warehouseInOutDetail.jiaorenli) {
  742. if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
  743. .jiaorenli > 40) {
  744. this.$api.msg('热损伤占比输入错误')
  745. return
  746. }
  747. if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
  748. .warehouseInOutDetail.jiaorenli).length - (String(
  749. this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
  750. this.$api.msg('热损伤占比输入错误')
  751. return
  752. }
  753. }
  754. if (this.detailData.warehouseInOutDetail.impurity) {
  755. if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
  756. .impurity > 40) {
  757. this.$api.msg('杂质占比输入错误')
  758. return
  759. }
  760. if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
  761. .warehouseInOutDetail.impurity).length - (String(
  762. this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
  763. this.$api.msg('杂质占比输入错误')
  764. return
  765. }
  766. }
  767. if (this.detailData.warehouseInOutDetail.mildewGrain) {
  768. if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
  769. .mildewGrain > 40) {
  770. this.$api.msg('霉变粒占比输入错误')
  771. return
  772. }
  773. if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
  774. .detailData
  775. .warehouseInOutDetail.mildewGrain).length - (String(
  776. this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
  777. this.$api.msg('霉变粒占比输入错误')
  778. return
  779. }
  780. }
  781. if (this.detailData.warehouseInOutDetail.imperfectGrain) {
  782. if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
  783. .imperfectGrain > 40) {
  784. this.$api.msg('不完善粒占比输入错误')
  785. return
  786. }
  787. if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
  788. .detailData
  789. .warehouseInOutDetail.imperfectGrain).length - (String(
  790. this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
  791. this.$api.msg('不完善粒占比输入错误')
  792. return
  793. }
  794. }
  795. if (this.detailData.boxNo) {
  796. this.detailData.boxNo = this.detailData.boxNo.toUpperCase()
  797. }
  798. if (this.detailData.boxNoOther) {
  799. this.detailData.boxNoOther = this.detailData.boxNoOther.toUpperCase()
  800. }
  801. this.detailData.baseId = helper.erpWarehouse.warehouseId
  802. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  803. this.detailData.positionId = helper.erpWarehouse.positionId
  804. this.detailData.binNumber = this.binNumber
  805. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNoCK').goodsNameKey;
  806. this.detailData.compId = helper.erpWarehouse.compId
  807. this.detailData.netWeight = this.netWeight
  808. this.detailData.inOutFlag = 1
  809. this.detailData.taskType = "出库任务"
  810. this.detailData.pcFlag = 0
  811. let title = ""
  812. if (num == 1) {
  813. this.detailData.statusFlag = 1
  814. this.detailData.backOffice = this.userInfo.userName
  815. this.detailData.backOfficeId = this.userInfo.id
  816. title = "暂存成功"
  817. } else if (num == 2) {
  818. this.detailData.statusFlag = 3
  819. this.detailData.backOffice = this.userInfo.userName
  820. this.detailData.backOfficeId = this.userInfo.id
  821. title = "提交成功"
  822. }
  823. let that = this
  824. uni.showModal({
  825. content: "确定提交出库信息?",
  826. success(res) {
  827. if (res.confirm) {
  828. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  829. that.detailData).then(res => {
  830. console.log(res, "报异常")
  831. if (res.data.code == 200) {
  832. that.$api.msg(title)
  833. setTimeout(() => {
  834. uni.navigateBack()
  835. }, 1000)
  836. } else {
  837. that.$api.msg(res.data.message)
  838. }
  839. })
  840. }
  841. }
  842. })
  843. },
  844. slectcontractNo() {
  845. uni.navigateTo({
  846. url: '/pages/erp/exWarehousing/selectContractNo?flag=' + 5
  847. })
  848. },
  849. slectCarNo() {
  850. uni.navigateTo({
  851. url: '/pages/erp/exWarehousing/selectCarNo'
  852. })
  853. },
  854. }
  855. }
  856. </script>
  857. <style scoped lang="scss">
  858. uni-page-body {
  859. overflow: hidden;
  860. }
  861. .warp {
  862. margin: 10rpx;
  863. padding: 20rpx 20rpx 300rpx 20rpx;
  864. .top {
  865. display: flex;
  866. margin-bottom: 20rpx;
  867. .top-left {
  868. margin-right: 20rpx;
  869. }
  870. }
  871. }
  872. .content,
  873. .content1,
  874. .content2 {
  875. border-radius: 20rpx;
  876. background: white;
  877. padding: 20rpx;
  878. .title {
  879. font-size: 28rpx;
  880. font-weight: 600;
  881. color: #333333;
  882. }
  883. .row {
  884. display: flex;
  885. justify-content: space-between;
  886. border-bottom: 1px solid #EEEEEE;
  887. padding: 21rpx 0;
  888. .right,
  889. input {
  890. font-size: 28rpx;
  891. color: #333333;
  892. }
  893. }
  894. .row-bottom {
  895. // border: 0;
  896. .right-bottom {
  897. width: 280rpx;
  898. text-align: right;
  899. }
  900. }
  901. }
  902. .content1 {
  903. margin-top: 20rpx;
  904. }
  905. .content2 {
  906. margin-top: 10px;
  907. // display: flex;
  908. align-items: center;
  909. .left {
  910. margin-right: 20px;
  911. }
  912. }
  913. .submit {
  914. width: 40%;
  915. background: #22C572;
  916. border-radius: 10rpx;
  917. }
  918. .edit-btn {
  919. background: #22C572;
  920. width: 100rpx;
  921. height: 50rpx;
  922. margin: 0;
  923. color: white;
  924. }
  925. .has-btn {
  926. align-items: center;
  927. }
  928. .bottom-btn {
  929. padding: 30rpx;
  930. background: #FFFFFF;
  931. width: 92%;
  932. position: fixed;
  933. bottom: 0rpx;
  934. display: flex;
  935. z-index: 9999;
  936. }
  937. </style>