exWarehousing.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960
  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. this.detailData.carId=this.carList[e].id
  567. },
  568. onProgress(e) {},
  569. onRemove() {
  570. this.detailData.addressUrl = ""
  571. },
  572. submit(num) {
  573. if (!this.detailData.contractNo) {
  574. this.$api.msg('合同编号不能为空')
  575. return
  576. }
  577. if (!this.detailData.goodsName) {
  578. this.$api.msg('货名不能为空')
  579. return
  580. }
  581. if (!this.detailData.grossWeight && num == 2) {
  582. this.$api.msg('毛重不能为空')
  583. return
  584. }
  585. if (isNaN(this.detailData.grossWeight) ||
  586. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  587. String(this.detailData.grossWeight).length -
  588. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  589. 3) ||
  590. this.detailData.grossWeight < 0 ||
  591. this.detailData.grossWeight > 10000
  592. ) {
  593. this.$api.msg('毛重输入错误!')
  594. return
  595. }
  596. if (!this.detailData.tare && num == 2) {
  597. this.$api.msg('皮重不能为空')
  598. return
  599. }
  600. if (isNaN(this.detailData.tare) ||
  601. (String(this.detailData.tare).indexOf('.') != -1 &&
  602. String(this.detailData.tare).length -
  603. (String(this.detailData.tare).indexOf('.') + 1) >
  604. 3) ||
  605. this.detailData.tare < 0 ||
  606. this.detailData.tare > 10000
  607. ) {
  608. this.$api.msg('皮重输入错误!')
  609. return
  610. }
  611. if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
  612. this.$api.msg('皮重不能大于毛重')
  613. return
  614. }
  615. if (this.netWeight <= 0 && num == 2) {
  616. this.$api.msg('净重不能小于等于0')
  617. return
  618. }
  619. if (this.detailData.type == "潮粮") {
  620. if (!this.detailData.buckleWeightRatio && num == 2) {
  621. this.$api.msg('扣重比不能为空')
  622. return
  623. }
  624. if (isNaN(this.detailData.buckleWeightRatio) ||
  625. (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
  626. String(this.detailData.buckleWeightRatio).length -
  627. (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
  628. 2) ||
  629. this.detailData.buckleWeightRatio < 0 ||
  630. this.detailData.buckleWeightRatio > 3
  631. ) {
  632. this.$api.msg('扣重比输入错误!')
  633. return
  634. }
  635. if (!this.detailData.solidGrainWater && num == 2) {
  636. this.$api.msg('干粮水分不能为空')
  637. return
  638. }
  639. if (isNaN(this.detailData.solidGrainWater) ||
  640. (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
  641. String(this.detailData.solidGrainWater).length -
  642. (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
  643. 1) ||
  644. this.detailData.solidGrainWater < 1 ||
  645. this.detailData.solidGrainWater > 40
  646. ) {
  647. this.$api.msg('干粮水分输入错误!')
  648. return
  649. }
  650. if (!this.detailData.tidalGrainWater && num == 2) {
  651. this.$api.msg('潮粮水分不能为空')
  652. return
  653. }
  654. if (isNaN(this.detailData.tidalGrainWater) ||
  655. (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
  656. String(this.detailData.tidalGrainWater).length -
  657. (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
  658. 1) ||
  659. this.detailData.tidalGrainWater < 1 ||
  660. this.detailData.tidalGrainWater > 40
  661. ) {
  662. this.$api.msg('潮粮水分输入错误!')
  663. return
  664. }
  665. if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
  666. this.$api.msg('潮粮水分输入错误!')
  667. return
  668. }
  669. if (!this.detailData.pureWeight && num == 2) {
  670. this.$api.msg('纯重不能为空')
  671. return
  672. }
  673. }
  674. if (this.detailData.grade == "请输入品级" && num == 2) {
  675. this.$api.msg('品级不能为空')
  676. return
  677. }
  678. if (this.detailData.agent == "请选择经办人") {
  679. this.$api.msg('经办人不能为空')
  680. return
  681. }
  682. if (this.detailData.inOutDate == "请选择出库日期") {
  683. this.$api.msg('出库日期不能为空')
  684. return
  685. }
  686. if (this.detailData.inOutType == "请选择出库类型") {
  687. this.$api.msg('出库类型不能为空')
  688. return
  689. }
  690. if (!this.detailData.carNo && num == 2) {
  691. this.$api.msg('车牌号不能为空')
  692. return
  693. }
  694. if (this.detailData.carNo.length != 7) {
  695. this.$api.msg('车牌号输入有误!')
  696. return
  697. }
  698. if (!this.detailData.addressUrl && num == 2) {
  699. this.$api.msg('请上传磅单')
  700. return
  701. }
  702. if (this.detailData.warehouseInOutDetail.qualityInspector) {
  703. if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
  704. .qualityInspector > 10) {
  705. this.$api.msg('质检员姓名需要2-10个字')
  706. return
  707. }
  708. }
  709. if (this.detailData.warehouseInOutDetail.waterContent) {
  710. if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
  711. .detailData.tidalGrainWater) {
  712. this.$api.msg('水分占比与潮粮水分不一致')
  713. return
  714. }
  715. if (this.detailData.type == "干粮") {
  716. if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
  717. .waterContent > 40) {
  718. this.$api.msg('水分占比输入错误')
  719. return
  720. }
  721. }
  722. if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
  723. .detailData.warehouseInOutDetail.waterContent).length - (String(
  724. this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
  725. this.$api.msg('水分占比输入错误')
  726. return
  727. }
  728. }
  729. if (this.detailData.warehouseInOutDetail.bulkDensity) {
  730. if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
  731. .bulkDensity > 1000) {
  732. this.$api.msg('容重输入错误')
  733. return
  734. }
  735. if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
  736. .detailData.warehouseInOutDetail.bulkDensity).length - (
  737. String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
  738. this.$api.msg('容重输入错误')
  739. return
  740. }
  741. }
  742. if (this.detailData.warehouseInOutDetail.jiaorenli) {
  743. if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
  744. .jiaorenli > 40) {
  745. this.$api.msg('热损伤占比输入错误')
  746. return
  747. }
  748. if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
  749. .warehouseInOutDetail.jiaorenli).length - (String(
  750. this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
  751. this.$api.msg('热损伤占比输入错误')
  752. return
  753. }
  754. }
  755. if (this.detailData.warehouseInOutDetail.impurity) {
  756. if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
  757. .impurity > 40) {
  758. this.$api.msg('杂质占比输入错误')
  759. return
  760. }
  761. if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
  762. .warehouseInOutDetail.impurity).length - (String(
  763. this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
  764. this.$api.msg('杂质占比输入错误')
  765. return
  766. }
  767. }
  768. if (this.detailData.warehouseInOutDetail.mildewGrain) {
  769. if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
  770. .mildewGrain > 40) {
  771. this.$api.msg('霉变粒占比输入错误')
  772. return
  773. }
  774. if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
  775. .detailData
  776. .warehouseInOutDetail.mildewGrain).length - (String(
  777. this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
  778. this.$api.msg('霉变粒占比输入错误')
  779. return
  780. }
  781. }
  782. if (this.detailData.warehouseInOutDetail.imperfectGrain) {
  783. if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
  784. .imperfectGrain > 40) {
  785. this.$api.msg('不完善粒占比输入错误')
  786. return
  787. }
  788. if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
  789. .detailData
  790. .warehouseInOutDetail.imperfectGrain).length - (String(
  791. this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
  792. this.$api.msg('不完善粒占比输入错误')
  793. return
  794. }
  795. }
  796. if (this.detailData.boxNo) {
  797. this.detailData.boxNo = this.detailData.boxNo.toUpperCase()
  798. }
  799. if (this.detailData.boxNoOther) {
  800. this.detailData.boxNoOther = this.detailData.boxNoOther.toUpperCase()
  801. }
  802. this.detailData.baseId = helper.erpWarehouse.warehouseId
  803. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  804. this.detailData.positionId = helper.erpWarehouse.positionId
  805. this.detailData.binNumber = this.binNumber
  806. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNoCK').goodsNameKey;
  807. this.detailData.compId = helper.erpWarehouse.compId
  808. this.detailData.netWeight = this.netWeight
  809. this.detailData.inOutFlag = 1
  810. this.detailData.taskType = "出库任务"
  811. this.detailData.pcFlag = 0
  812. let title = ""
  813. if (num == 1) {
  814. this.detailData.statusFlag = 1
  815. this.detailData.backOffice = this.userInfo.userName
  816. this.detailData.backOfficeId = this.userInfo.id
  817. title = "暂存成功"
  818. } else if (num == 2) {
  819. this.detailData.statusFlag = 3
  820. this.detailData.backOffice = this.userInfo.userName
  821. this.detailData.backOfficeId = this.userInfo.id
  822. title = "提交成功"
  823. }
  824. let that = this
  825. uni.showModal({
  826. content: "确定提交出库信息?",
  827. success(res) {
  828. if (res.confirm) {
  829. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  830. that.detailData).then(res => {
  831. console.log(res, "报异常")
  832. if (res.data.code == 200) {
  833. that.$api.msg(title)
  834. setTimeout(() => {
  835. uni.navigateBack()
  836. }, 1000)
  837. } else {
  838. that.$api.msg(res.data.message)
  839. }
  840. })
  841. }
  842. }
  843. })
  844. },
  845. slectcontractNo() {
  846. uni.navigateTo({
  847. url: '/pages/erp/exWarehousing/selectContractNo?flag=' + 5
  848. })
  849. },
  850. slectCarNo() {
  851. uni.navigateTo({
  852. url: '/pages/erp/exWarehousing/selectCarNo'
  853. })
  854. },
  855. }
  856. }
  857. </script>
  858. <style scoped lang="scss">
  859. uni-page-body {
  860. overflow: hidden;
  861. }
  862. .warp {
  863. margin: 10rpx;
  864. padding: 20rpx 20rpx 300rpx 20rpx;
  865. .top {
  866. display: flex;
  867. margin-bottom: 20rpx;
  868. .top-left {
  869. margin-right: 20rpx;
  870. }
  871. }
  872. }
  873. .content,
  874. .content1,
  875. .content2 {
  876. border-radius: 20rpx;
  877. background: white;
  878. padding: 20rpx;
  879. .title {
  880. font-size: 28rpx;
  881. font-weight: 600;
  882. color: #333333;
  883. }
  884. .row {
  885. display: flex;
  886. justify-content: space-between;
  887. border-bottom: 1px solid #EEEEEE;
  888. padding: 21rpx 0;
  889. .right,
  890. input {
  891. font-size: 28rpx;
  892. color: #333333;
  893. }
  894. }
  895. .row-bottom {
  896. // border: 0;
  897. .right-bottom {
  898. width: 280rpx;
  899. text-align: right;
  900. }
  901. }
  902. }
  903. .content1 {
  904. margin-top: 20rpx;
  905. }
  906. .content2 {
  907. margin-top: 10px;
  908. // display: flex;
  909. align-items: center;
  910. .left {
  911. margin-right: 20px;
  912. }
  913. }
  914. .submit {
  915. width: 40%;
  916. background: #22C572;
  917. border-radius: 10rpx;
  918. }
  919. .edit-btn {
  920. background: #22C572;
  921. width: 100rpx;
  922. height: 50rpx;
  923. margin: 0;
  924. color: white;
  925. }
  926. .has-btn {
  927. align-items: center;
  928. }
  929. .bottom-btn {
  930. padding: 30rpx;
  931. background: #FFFFFF;
  932. width: 92%;
  933. position: fixed;
  934. bottom: 0rpx;
  935. display: flex;
  936. z-index: 9999;
  937. }
  938. </style>