exWarehousing.vue 38 KB

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