warehousing.vue 37 KB

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