exWarehousing.vue 37 KB

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