exWarehousing.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967
  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="请输入箱号" type="digit"></input>
  124. <input v-model='detailData.boxNoOther' class="right-bottom" type="digit"
  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="请输入封号" type="digit"></input>
  131. <input v-model='detailData.titleNoOther' class="right-bottom"
  132. placeholder="请输入封号" type="digit"></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="请输入车厢号" type="digit"></input>
  138. <input v-model='detailData.wingNumberOther' @input="toUpperCase3" class="right-bottom"
  139. placeholder="请输入车厢号" type="digit"></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. if(this.detailData.tips = '买方' + this.contractNoList[i].buyer){
  458. this.detailData.tips = '买方' + this.contractNoList[i].buyer+
  459. '( ' +
  460. this.contractNoList[i].unitContractPrice +
  461. '元/吨)'
  462. }else{
  463. this.detailData.tips = '买方' + this.contractNoList[i].buyer
  464. }
  465. } else if (this.detailData.inOutType == '移库出库') {
  466. this.detailData.tips = '入货库' + this.inOutNoList[e[0]].warehouseName
  467. }
  468. },
  469. toUpperCase(val) {
  470. this.detailData.boxNo = val.detail.value.toUpperCase()
  471. },
  472. toUpperCase1(val) {
  473. this.detailData.boxNoOther = val.detail.value.toUpperCase()
  474. },
  475. usestartChange(e) {
  476. this.usestart = this.multiSelector1[e].name
  477. },
  478. //计算纯重
  479. pureWeightCount() {
  480. if (this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this
  481. .detailData.tidalGrainWater) {
  482. // 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
  483. this.detailData.pureWeight = 100 - (this.detailData.tidalGrainWater - this.detailData
  484. .solidGrainWater) * this.netWeight * this.detailData.buckleWeightRatio / 100
  485. this.detailData.pureWeight = this.detailData.pureWeight.toFixed(3)
  486. }
  487. },
  488. outtypeChange(e) {
  489. this.detailData.outType = this.multiSelector[e].name
  490. console.log(e)
  491. },
  492. toUpperCase2(val) {
  493. this.detailData.wingNumber = val.detail.value.toUpperCase()
  494. },
  495. toUpperCase3(val) {
  496. this.detailData.wingNumberOther = val.detail.value.toUpperCase()
  497. },
  498. outWarehouse() {
  499. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  500. constId: 'CON6'
  501. }).then(res => {
  502. this.warehousingTypeList = res.data.data
  503. })
  504. },
  505. handler() {
  506. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  507. compId: helper.erpWarehouse.compId,
  508. warehouseId: helper.erpWarehouse.warehouseId
  509. }).then(res => {
  510. this.handlerList = res.data.data
  511. })
  512. },
  513. contractNopicker(e) {
  514. },
  515. typePicker(e) {
  516. this.detailData.type = this.typeList[e].type
  517. },
  518. pjPicker(e) {
  519. this.detailData.gradeKey = e[0] + 1
  520. this.detailData.grade = this.pjList[e].type
  521. },
  522. handlerPicker(e) {
  523. this.detailData.agentKey = e[0]
  524. this.detailData.agent = this.handlerList[e].staffName
  525. },
  526. dateChange(e) {
  527. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  528. },
  529. warehousingTypePicker(e) {
  530. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  531. if (this.detailData.inOutType == '销售出库') {
  532. this.detailData.inOutTypeKey = 1
  533. } else if (this.detailData.inOutType == '移库出库') {
  534. this.detailData.inOutTypeKey = 3
  535. } else if (this.detailData.inOutType == '暂存出库') {
  536. this.detailData.inOutTypeKey = 4
  537. } else if (this.detailData.inOutType == '贸易服务出库') {
  538. this.detailData.inOutTypeKey = 5
  539. } else if (this.detailData.inOutType == '采购出库') {
  540. this.detailData.inOutTypeKey = 6
  541. }
  542. },
  543. filterFileType(index, lists) {
  544. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  545. lists.splice(index, 1);
  546. // 当前文件不支持
  547. uni.showModal({
  548. title: '暂不支持当前图片类型',
  549. showCancel: false
  550. });
  551. } else {
  552. this.isAdd = false;
  553. }
  554. },
  555. calculate() {
  556. if (this.detailData.grossWeight && this.detailData.tare) {
  557. this.netWeight = this.detailData.grossWeight - this.detailData.tare
  558. }
  559. },
  560. getImgUrl(res) {
  561. this.detailData.addressUrl = res
  562. },
  563. onError(error) {
  564. console.log('------------error-----------')
  565. console.log(error)
  566. },
  567. binNumberpicker(e) {
  568. this.detailData.binNumber = this.positionList[e[0]].binNumber
  569. },
  570. carPicker(e) {
  571. // this.detailData.gradeKey = e[0] + 1
  572. this.detailData.carNo = this.carList[e].carNo
  573. this.detailData.carId=this.carList[e].id
  574. },
  575. onProgress(e) {},
  576. onRemove() {
  577. this.detailData.addressUrl = ""
  578. },
  579. submit(num) {
  580. if (!this.detailData.contractNo) {
  581. this.$api.msg('合同编号不能为空')
  582. return
  583. }
  584. if (!this.detailData.goodsName) {
  585. this.$api.msg('货名不能为空')
  586. return
  587. }
  588. if (!this.detailData.grossWeight && num == 2) {
  589. this.$api.msg('毛重不能为空')
  590. return
  591. }
  592. if (isNaN(this.detailData.grossWeight) ||
  593. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  594. String(this.detailData.grossWeight).length -
  595. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  596. 3) ||
  597. this.detailData.grossWeight < 0 ||
  598. this.detailData.grossWeight > 10000
  599. ) {
  600. this.$api.msg('毛重输入错误!')
  601. return
  602. }
  603. if (!this.detailData.tare && num == 2) {
  604. this.$api.msg('皮重不能为空')
  605. return
  606. }
  607. if (isNaN(this.detailData.tare) ||
  608. (String(this.detailData.tare).indexOf('.') != -1 &&
  609. String(this.detailData.tare).length -
  610. (String(this.detailData.tare).indexOf('.') + 1) >
  611. 3) ||
  612. this.detailData.tare < 0 ||
  613. this.detailData.tare > 10000
  614. ) {
  615. this.$api.msg('皮重输入错误!')
  616. return
  617. }
  618. if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
  619. this.$api.msg('皮重不能大于毛重')
  620. return
  621. }
  622. if (this.netWeight <= 0 && num == 2) {
  623. this.$api.msg('净重不能小于等于0')
  624. return
  625. }
  626. if (this.detailData.type == "潮粮") {
  627. if (!this.detailData.buckleWeightRatio && num == 2) {
  628. this.$api.msg('扣重比不能为空')
  629. return
  630. }
  631. if (isNaN(this.detailData.buckleWeightRatio) ||
  632. (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
  633. String(this.detailData.buckleWeightRatio).length -
  634. (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
  635. 2) ||
  636. this.detailData.buckleWeightRatio < 0 ||
  637. this.detailData.buckleWeightRatio > 3
  638. ) {
  639. this.$api.msg('扣重比输入错误!')
  640. return
  641. }
  642. if (!this.detailData.solidGrainWater && num == 2) {
  643. this.$api.msg('干粮水分不能为空')
  644. return
  645. }
  646. if (isNaN(this.detailData.solidGrainWater) ||
  647. (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
  648. String(this.detailData.solidGrainWater).length -
  649. (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
  650. 1) ||
  651. this.detailData.solidGrainWater < 1 ||
  652. this.detailData.solidGrainWater > 40
  653. ) {
  654. this.$api.msg('干粮水分输入错误!')
  655. return
  656. }
  657. if (!this.detailData.tidalGrainWater && num == 2) {
  658. this.$api.msg('潮粮水分不能为空')
  659. return
  660. }
  661. if (isNaN(this.detailData.tidalGrainWater) ||
  662. (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
  663. String(this.detailData.tidalGrainWater).length -
  664. (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
  665. 1) ||
  666. this.detailData.tidalGrainWater < 1 ||
  667. this.detailData.tidalGrainWater > 40
  668. ) {
  669. this.$api.msg('潮粮水分输入错误!')
  670. return
  671. }
  672. if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
  673. this.$api.msg('潮粮水分输入错误!')
  674. return
  675. }
  676. if (!this.detailData.pureWeight && num == 2) {
  677. this.$api.msg('纯重不能为空')
  678. return
  679. }
  680. }
  681. if (this.detailData.grade == "请输入品级" && num == 2) {
  682. this.$api.msg('品级不能为空')
  683. return
  684. }
  685. if (this.detailData.agent == "请选择经办人") {
  686. this.$api.msg('经办人不能为空')
  687. return
  688. }
  689. if (this.detailData.inOutDate == "请选择出库日期") {
  690. this.$api.msg('出库日期不能为空')
  691. return
  692. }
  693. if (this.detailData.inOutType == "请选择出库类型") {
  694. this.$api.msg('出库类型不能为空')
  695. return
  696. }
  697. if (!this.detailData.carNo && num == 2) {
  698. this.$api.msg('车牌号不能为空')
  699. return
  700. }
  701. if (this.detailData.carNo.length != 7) {
  702. this.$api.msg('车牌号输入有误!')
  703. return
  704. }
  705. if (!this.detailData.addressUrl && num == 2) {
  706. this.$api.msg('请上传磅单')
  707. return
  708. }
  709. if (this.detailData.warehouseInOutDetail.qualityInspector) {
  710. if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
  711. .qualityInspector > 10) {
  712. this.$api.msg('质检员姓名需要2-10个字')
  713. return
  714. }
  715. }
  716. if (this.detailData.warehouseInOutDetail.waterContent) {
  717. if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
  718. .detailData.tidalGrainWater) {
  719. this.$api.msg('水分占比与潮粮水分不一致')
  720. return
  721. }
  722. if (this.detailData.type == "干粮") {
  723. if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
  724. .waterContent > 40) {
  725. this.$api.msg('水分占比输入错误')
  726. return
  727. }
  728. }
  729. if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
  730. .detailData.warehouseInOutDetail.waterContent).length - (String(
  731. this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
  732. this.$api.msg('水分占比输入错误')
  733. return
  734. }
  735. }
  736. if (this.detailData.warehouseInOutDetail.bulkDensity) {
  737. if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
  738. .bulkDensity > 1000) {
  739. this.$api.msg('容重输入错误')
  740. return
  741. }
  742. if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
  743. .detailData.warehouseInOutDetail.bulkDensity).length - (
  744. String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
  745. this.$api.msg('容重输入错误')
  746. return
  747. }
  748. }
  749. if (this.detailData.warehouseInOutDetail.jiaorenli) {
  750. if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
  751. .jiaorenli > 40) {
  752. this.$api.msg('热损伤占比输入错误')
  753. return
  754. }
  755. if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
  756. .warehouseInOutDetail.jiaorenli).length - (String(
  757. this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
  758. this.$api.msg('热损伤占比输入错误')
  759. return
  760. }
  761. }
  762. if (this.detailData.warehouseInOutDetail.impurity) {
  763. if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
  764. .impurity > 40) {
  765. this.$api.msg('杂质占比输入错误')
  766. return
  767. }
  768. if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
  769. .warehouseInOutDetail.impurity).length - (String(
  770. this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
  771. this.$api.msg('杂质占比输入错误')
  772. return
  773. }
  774. }
  775. if (this.detailData.warehouseInOutDetail.mildewGrain) {
  776. if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
  777. .mildewGrain > 40) {
  778. this.$api.msg('霉变粒占比输入错误')
  779. return
  780. }
  781. if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
  782. .detailData
  783. .warehouseInOutDetail.mildewGrain).length - (String(
  784. this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
  785. this.$api.msg('霉变粒占比输入错误')
  786. return
  787. }
  788. }
  789. if (this.detailData.warehouseInOutDetail.imperfectGrain) {
  790. if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
  791. .imperfectGrain > 40) {
  792. this.$api.msg('不完善粒占比输入错误')
  793. return
  794. }
  795. if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
  796. .detailData
  797. .warehouseInOutDetail.imperfectGrain).length - (String(
  798. this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
  799. this.$api.msg('不完善粒占比输入错误')
  800. return
  801. }
  802. }
  803. if (this.detailData.boxNo) {
  804. this.detailData.boxNo = this.detailData.boxNo.toUpperCase()
  805. }
  806. if (this.detailData.boxNoOther) {
  807. this.detailData.boxNoOther = this.detailData.boxNoOther.toUpperCase()
  808. }
  809. this.detailData.baseId = helper.erpWarehouse.warehouseId
  810. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  811. this.detailData.positionId = helper.erpWarehouse.positionId
  812. this.detailData.binNumber = this.binNumber
  813. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNoCK').goodsNameKey;
  814. this.detailData.compId = helper.erpWarehouse.compId
  815. this.detailData.netWeight = this.netWeight
  816. this.detailData.inOutFlag = 1
  817. this.detailData.taskType = "出库任务"
  818. this.detailData.pcFlag = 0
  819. let title = ""
  820. if (num == 1) {
  821. this.detailData.statusFlag = 1
  822. this.detailData.backOffice = this.userInfo.userName
  823. this.detailData.backOfficeId = this.userInfo.id
  824. title = "暂存成功"
  825. } else if (num == 2) {
  826. this.detailData.statusFlag = 3
  827. this.detailData.backOffice = this.userInfo.userName
  828. this.detailData.backOfficeId = this.userInfo.id
  829. title = "提交成功"
  830. }
  831. let that = this
  832. uni.showModal({
  833. content: "确定提交出库信息?",
  834. success(res) {
  835. if (res.confirm) {
  836. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  837. that.detailData).then(res => {
  838. console.log(res, "报异常")
  839. if (res.data.code == 200) {
  840. that.$api.msg(title)
  841. setTimeout(() => {
  842. uni.navigateBack()
  843. }, 1000)
  844. } else {
  845. that.$api.msg(res.data.message)
  846. }
  847. })
  848. }
  849. }
  850. })
  851. },
  852. slectcontractNo() {
  853. uni.navigateTo({
  854. url: '/pages/erp/exWarehousing/selectContractNo?flag=' + 5
  855. })
  856. },
  857. slectCarNo() {
  858. uni.navigateTo({
  859. url: '/pages/erp/exWarehousing/selectCarNo'
  860. })
  861. },
  862. }
  863. }
  864. </script>
  865. <style scoped lang="scss">
  866. uni-page-body {
  867. overflow: hidden;
  868. }
  869. .warp {
  870. margin: 10rpx;
  871. padding: 20rpx 20rpx 300rpx 20rpx;
  872. .top {
  873. display: flex;
  874. margin-bottom: 20rpx;
  875. .top-left {
  876. margin-right: 20rpx;
  877. }
  878. }
  879. }
  880. .content,
  881. .content1,
  882. .content2 {
  883. border-radius: 20rpx;
  884. background: white;
  885. padding: 20rpx;
  886. .title {
  887. font-size: 28rpx;
  888. font-weight: 600;
  889. color: #333333;
  890. }
  891. .row {
  892. display: flex;
  893. justify-content: space-between;
  894. border-bottom: 1px solid #EEEEEE;
  895. padding: 21rpx 0;
  896. .right,
  897. input {
  898. font-size: 28rpx;
  899. color: #333333;
  900. }
  901. }
  902. .row-bottom {
  903. // border: 0;
  904. .right-bottom {
  905. width: 280rpx;
  906. text-align: right;
  907. }
  908. }
  909. }
  910. .content1 {
  911. margin-top: 20rpx;
  912. }
  913. .content2 {
  914. margin-top: 10px;
  915. // display: flex;
  916. align-items: center;
  917. .left {
  918. margin-right: 20px;
  919. }
  920. }
  921. .submit {
  922. width: 40%;
  923. background: #22C572;
  924. border-radius: 10rpx;
  925. }
  926. .edit-btn {
  927. background: #22C572;
  928. width: 100rpx;
  929. height: 50rpx;
  930. margin: 0;
  931. color: white;
  932. }
  933. .has-btn {
  934. align-items: center;
  935. }
  936. .bottom-btn {
  937. padding: 30rpx;
  938. background: #FFFFFF;
  939. width: 92%;
  940. position: fixed;
  941. bottom: 0rpx;
  942. display: flex;
  943. z-index: 9999;
  944. }
  945. </style>