warehousing.vue 38 KB

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