exWarehousing.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  1. <template>
  2. <view class="warp">
  3. <view class="top">
  4. <view class="top-left">{{warehouseName}}</view>
  5. <view>{{binNumber}}仓位</view>
  6. </view>
  7. <view class="content">
  8. <view class="row">
  9. <view class="left">任务编号</view>
  10. <view @click='inOutShow=true'>{{detailData.inOutTaskNo ? detailData.inOutTaskNo : "暂未获取到任务编号"}}</view>
  11. <u-picker :range="inOutNoList" range-key="inOutTaskNo" @confirm='inOutChange' v-model="inOutShow"
  12. mode="selector">
  13. </u-picker>
  14. </view>
  15. <view class="row row-bottom">
  16. <view class="left">合同编号</view>
  17. <!-- <view @click='slectcontractNo'>{{detailData.contractNo}}</view> -->
  18. <input v-model='detailData.contractNo' class="right-bottom" placeholder="暂未获取到合同编号" disabled=""></input>
  19. </view>
  20. <view class="row">
  21. <view class="left">提示</view>
  22. <view class="right">{{detailData.tips}}</view>
  23. </view>
  24. <view class="row">
  25. <view class="left">货名</view>
  26. <view class="right">{{detailData.goodsName ? detailData.goodsName : "选择合同,自动获取"}}
  27. </view>
  28. </view>
  29. <view class="row">
  30. <view class="left">类型</view>
  31. <view @click='show1=true'>{{detailData.type}}</view>
  32. <u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
  33. mode="selector">
  34. <view class="">{{detailData.type}}</view>
  35. </u-picker>
  36. </view>
  37. <view class="row row-bottom">
  38. <view class="left">毛重(吨)</view>
  39. <input type="digit" @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  40. placeholder="输入毛重"></input>
  41. </view>
  42. <view class="row row-bottom">
  43. <view class="left">皮重(吨)</view>
  44. <input type="digit" @input='calculate' v-model='detailData.tare' class="right-bottom"
  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 :"请选择车牌号"}}
  116. </view>
  117. <u-picker :range="carList" range-key="carNo" @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. this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
  436. flag: 1,
  437. warehouseName: this.warehouseName,
  438. agentKey: this.userInfo.id
  439. }).then(res => {
  440. this.inOutNoList = res.data.data
  441. this.detailData.goodsNameKey = res.data.data[0].goodsNameKey
  442. this.detailData.inOutTaskNo = this.inOutNoList[0].inOutTaskNo ? this.inOutNoList[0]
  443. .inOutTaskNo : ''
  444. this.detailData.agent = this.inOutNoList[0].agent
  445. if (this.inOutNoList[0].contractNo) {
  446. this.detailData.contractNo = this.inOutNoList[0].contractNo
  447. } else {
  448. this.detailData.contractNo = this.inOutNoList[0].moveTaskNo
  449. }
  450. this.detailData.goodsName = this.inOutNoList[0].goodsName
  451. this.detailData.goodsNameKey = this.inOutNoList[0].goodsNameKey
  452. this.detailData.grade = this.inOutNoList[0].grade
  453. this.detailData.inOutType = this.inOutNoList[0].inOutType
  454. if (this.detailData.inOutType == '销售出库') {
  455. this.detailData.inOutTypeKey = 1
  456. } else if (this.detailData.inOutType == '移库出库') {
  457. this.detailData.inOutTypeKey = 3
  458. } else if (this.detailData.inOutType == '暂存出库') {
  459. this.detailData.inOutTypeKey = 4
  460. } else if (this.detailData.inOutType == '贸易服务出库') {
  461. this.detailData.inOutTypeKey = 5
  462. } else if (this.detailData.inOutType == '采购出库') {
  463. this.detailData.inOutTypeKey = 6
  464. }
  465. console.log(this.detailData.inOutType)
  466. //查询所有的合同 进行获取车牌号
  467. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  468. flag: 5,
  469. compId: helper.erpWarehouse.compId,
  470. }).then(res => {
  471. if (res.data.code == 200) {
  472. for (let i = 0; i < res.data.data.length; i++) {
  473. // "MYCGYMHLJ2021102401"
  474. if (res.data.data[i].contractNo == this.detailData.contractNo) {
  475. if (this.detailData.inOutType == '销售出库') {
  476. this.detailData.tips = '买方' + res.data.data[i].buyer
  477. } else if (this.detailData.inOutType == '移库出库') {
  478. this.detailData.tips = '入货库' + this.inOutNoList[0].warehouseName
  479. }
  480. //如果查到该合同
  481. res.data.data[i].deliverType = !res.data.data[i].deliverType?'1':res.data.data[i].deliverType
  482. if (res.data.data[i].deliverType == '1') { //判断自运1,他运2合同
  483. this.showCar = true
  484. } else {
  485. this.showCar = false
  486. }
  487. if (res.data.data[i].tranCarInfoList) {
  488. this.carList = res.data.data[i].tranCarInfoList //车牌号下拉列表
  489. }
  490. }
  491. }
  492. uni.hideLoading()
  493. }
  494. })
  495. })
  496. // this.$api.doRequest('get', 'warehouseBaseInfo/selectContractNoList', ).then(res => {
  497. // this.contractNoList = res.data.data
  498. // for (var i = 0; i < this.contractNoList.length; i++) {
  499. // if (this.contractNoList[i].contractNo == this.detailData.contractNo) {
  500. // if (this.detailData.inOutType == '销售出库') {
  501. // this.detailData.tips = '买方' + this.contractNoList[i].buyer
  502. // } else if (this.detailData.inOutType == '移库出库') {
  503. // this.detailData.tips = '入货库' + this.inOutNoList[0].warehouseName
  504. // }
  505. // }
  506. // }
  507. // })
  508. },
  509. inOutChange(e) {
  510. this.detailData.inOutTaskNo = this.inOutNoList[e[0]].inOutTaskNo
  511. this.detailData.agent = this.inOutNoList[e[0]].agent
  512. if (this.inOutNoList[e[0]].contractNo) {
  513. this.detailData.contractNo = this.inOutNoList[e[0]].contractNo
  514. } else {
  515. this.detailData.contractNo = this.inOutNoList[e[0]].moveTaskNo
  516. }
  517. this.detailData.goodsName = this.inOutNoList[e[0]].goodsName
  518. this.detailData.goodsNameKey = this.inOutNoList[e[0]].goodsNameKey
  519. this.detailData.grade = this.inOutNoList[e[0]].grade
  520. this.detailData.inOutType = this.inOutNoList[e[0]].inOutType
  521. this.weightbills.goodsName = this.inOutNoList[e[0]].goodsName
  522. if (this.detailData.inOutType == '销售出库') {
  523. this.weightbills.buyer = this.inOutNoList[e[0]].buyer
  524. this.weightbills.seller = uni.getStorageSync('compName')
  525. if (this.detailData.tips = '买方' + this.contractNoList[e[0]].buyer) {
  526. this.detailData.tips = '买方' + this.contractNoList[e[0]].buyer +
  527. '( ' +
  528. this.contractNoList[e[0]].unitContractPrice +
  529. '元/吨)'
  530. } else {
  531. this.detailData.tips = '买方' + this.contractNoList[e[0]].buyer
  532. }
  533. } else if (this.detailData.inOutType == '移库出库') {
  534. this.weightbills.buyer = this.inOutNoList[e[0]].receiveWarehouse
  535. this.weightbills.seller = uni.getStorageSync('compName')
  536. this.detailData.tips = '入货库' + this.inOutNoList[e[0]].warehouseName
  537. }
  538. },
  539. toUpperCase(val) {
  540. this.detailData.boxNo = val.detail.value.toUpperCase()
  541. },
  542. toUpperCase1(val) {
  543. this.detailData.boxNoOther = val.detail.value.toUpperCase()
  544. },
  545. usestartChange(e) {
  546. this.usestart = this.multiSelector1[e].name
  547. },
  548. //计算纯重
  549. pureWeightCount() {
  550. if (this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this
  551. .detailData.tidalGrainWater) {
  552. // 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
  553. this.detailData.pureWeight = 100 - (this.detailData.tidalGrainWater - this.detailData
  554. .solidGrainWater) * this.netWeight * this.detailData.buckleWeightRatio / 100
  555. this.detailData.pureWeight = this.detailData.pureWeight.toFixed(3)
  556. }
  557. },
  558. outtypeChange(e) {
  559. this.detailData.outType = this.multiSelector[e].name
  560. console.log(e)
  561. },
  562. toUpperCase2(val) {
  563. this.detailData.wingNumber = val.detail.value.toUpperCase()
  564. },
  565. toUpperCase3(val) {
  566. this.detailData.wingNumberOther = val.detail.value.toUpperCase()
  567. },
  568. outWarehouse() {
  569. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  570. constId: 'CON6'
  571. }).then(res => {
  572. this.warehousingTypeList = res.data.data
  573. })
  574. },
  575. handler() {
  576. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  577. compId: helper.erpWarehouse.compId,
  578. warehouseId: helper.erpWarehouse.warehouseId
  579. }).then(res => {
  580. this.handlerList = res.data.data
  581. })
  582. },
  583. contractNopicker(e) {
  584. },
  585. typePicker(e) {
  586. this.detailData.type = this.typeList[e].type
  587. },
  588. pjPicker(e) {
  589. this.detailData.gradeKey = e[0] + 1
  590. this.detailData.grade = this.pjList[e].type
  591. },
  592. handlerPicker(e) {
  593. this.detailData.agentKey = e[0]
  594. this.detailData.agent = this.handlerList[e].staffName
  595. },
  596. dateChange(e) {
  597. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  598. },
  599. warehousingTypePicker(e) {
  600. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  601. if (this.detailData.inOutType == '销售出库') {
  602. this.detailData.inOutTypeKey = 1
  603. } else if (this.detailData.inOutType == '移库出库') {
  604. this.detailData.inOutTypeKey = 3
  605. } else if (this.detailData.inOutType == '暂存出库') {
  606. this.detailData.inOutTypeKey = 4
  607. } else if (this.detailData.inOutType == '贸易服务出库') {
  608. this.detailData.inOutTypeKey = 5
  609. } else if (this.detailData.inOutType == '采购出库') {
  610. this.detailData.inOutTypeKey = 6
  611. }
  612. },
  613. filterFileType(index, lists) {
  614. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  615. lists.splice(index, 1);
  616. // 当前文件不支持
  617. uni.showModal({
  618. title: '暂不支持当前图片类型',
  619. showCancel: false
  620. });
  621. } else {
  622. this.isAdd = false;
  623. }
  624. },
  625. calculate() {
  626. if (this.detailData.grossWeight && this.detailData.tare) {
  627. this.netWeight =(this.detailData.grossWeight - this.detailData.tare).toFixed(3)
  628. }
  629. },
  630. getImgUrl(res) {
  631. this.detailData.addressUrl = res
  632. },
  633. onError(error) {
  634. console.log('------------error-----------')
  635. console.log(error)
  636. },
  637. binNumberpicker(e) {
  638. this.detailData.binNumber = this.positionList[e[0]].binNumber
  639. },
  640. carPicker(e) {
  641. // this.detailData.gradeKey = e[0] + 1
  642. this.detailData.carNo = this.carList[e].carNo
  643. this.detailData.tranCarNo = this.carList[e].tranCarNo
  644. this.detailData.carId = this.carList[e].id
  645. },
  646. onProgress(e) {},
  647. onRemove() {
  648. this.detailData.addressUrl = ""
  649. },
  650. submit(num) {
  651. if (!this.detailData.contractNo) {
  652. this.$api.msg('合同编号不能为空')
  653. return
  654. }
  655. if (!this.detailData.goodsName) {
  656. this.$api.msg('货名不能为空')
  657. return
  658. }
  659. if (!this.detailData.grossWeight && num == 2) {
  660. this.$api.msg('毛重不能为空')
  661. return
  662. }
  663. if (isNaN(this.detailData.grossWeight) ||
  664. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  665. String(this.detailData.grossWeight).length -
  666. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  667. 3) ||
  668. this.detailData.grossWeight < 0 ||
  669. this.detailData.grossWeight > 10000
  670. ) {
  671. this.$api.msg('毛重输入错误!')
  672. return
  673. }
  674. if (!this.detailData.tare && num == 2) {
  675. this.$api.msg('皮重不能为空')
  676. return
  677. }
  678. if (isNaN(this.detailData.tare) ||
  679. (String(this.detailData.tare).indexOf('.') != -1 &&
  680. String(this.detailData.tare).length -
  681. (String(this.detailData.tare).indexOf('.') + 1) >
  682. 3) ||
  683. this.detailData.tare < 0 ||
  684. this.detailData.tare > 10000
  685. ) {
  686. this.$api.msg('皮重输入错误!')
  687. return
  688. }
  689. if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
  690. this.$api.msg('皮重不能大于毛重')
  691. return
  692. }
  693. if (this.netWeight <= 0 && num == 2) {
  694. this.$api.msg('净重不能小于等于0')
  695. return
  696. }
  697. if (this.detailData.type == "潮粮") {
  698. if (!this.detailData.buckleWeightRatio && num == 2) {
  699. this.$api.msg('扣重比不能为空')
  700. return
  701. }
  702. if (isNaN(this.detailData.buckleWeightRatio) ||
  703. (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
  704. String(this.detailData.buckleWeightRatio).length -
  705. (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
  706. 2) ||
  707. this.detailData.buckleWeightRatio < 0 ||
  708. this.detailData.buckleWeightRatio > 3
  709. ) {
  710. this.$api.msg('扣重比输入错误!')
  711. return
  712. }
  713. if (!this.detailData.solidGrainWater && num == 2) {
  714. this.$api.msg('干粮水分不能为空')
  715. return
  716. }
  717. if (isNaN(this.detailData.solidGrainWater) ||
  718. (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
  719. String(this.detailData.solidGrainWater).length -
  720. (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
  721. 1) ||
  722. this.detailData.solidGrainWater < 1 ||
  723. this.detailData.solidGrainWater > 40
  724. ) {
  725. this.$api.msg('干粮水分输入错误!')
  726. return
  727. }
  728. if (!this.detailData.tidalGrainWater && num == 2) {
  729. this.$api.msg('潮粮水分不能为空')
  730. return
  731. }
  732. if (isNaN(this.detailData.tidalGrainWater) ||
  733. (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
  734. String(this.detailData.tidalGrainWater).length -
  735. (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
  736. 1) ||
  737. this.detailData.tidalGrainWater < 1 ||
  738. this.detailData.tidalGrainWater > 40
  739. ) {
  740. this.$api.msg('潮粮水分输入错误!')
  741. return
  742. }
  743. if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
  744. this.$api.msg('潮粮水分输入错误!')
  745. return
  746. }
  747. if (!this.detailData.pureWeight && num == 2) {
  748. this.$api.msg('纯重不能为空')
  749. return
  750. }
  751. }
  752. if (this.detailData.grade == "请输入品级" && num == 2) {
  753. this.$api.msg('品级不能为空')
  754. return
  755. }
  756. if (this.detailData.agent == "请选择经办人") {
  757. this.$api.msg('经办人不能为空')
  758. return
  759. }
  760. if (this.detailData.inOutDate == "请选择出库日期") {
  761. this.$api.msg('出库日期不能为空')
  762. return
  763. }
  764. if (this.detailData.inOutType == "请选择出库类型") {
  765. this.$api.msg('出库类型不能为空')
  766. return
  767. }
  768. if (this.detailData.outType == "集装箱船" || this.detailData.outType == "汽运") {
  769. if (!this.detailData.carNo && num == 2) {
  770. this.$api.msg('车牌号不能为空')
  771. return
  772. }
  773. if (this.detailData.carNo.length != 7) {
  774. this.$api.msg('车牌号输入有误!')
  775. return
  776. }
  777. }
  778. if (!this.detailData.addressUrl && num == 2) {
  779. this.$api.msg('请上传磅单')
  780. return
  781. }
  782. if (this.detailData.warehouseInOutDetail.qualityInspector) {
  783. if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
  784. .qualityInspector > 10) {
  785. this.$api.msg('质检员姓名需要2-10个字')
  786. return
  787. }
  788. }
  789. if (this.detailData.warehouseInOutDetail.waterContent) {
  790. if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
  791. .detailData.tidalGrainWater) {
  792. this.$api.msg('水分占比与潮粮水分不一致')
  793. return
  794. }
  795. if (this.detailData.type == "干粮") {
  796. if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
  797. .waterContent > 40) {
  798. this.$api.msg('水分占比输入错误')
  799. return
  800. }
  801. }
  802. if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
  803. .detailData.warehouseInOutDetail.waterContent).length - (String(
  804. this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
  805. this.$api.msg('水分占比输入错误')
  806. return
  807. }
  808. }
  809. if (this.detailData.warehouseInOutDetail.bulkDensity) {
  810. if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
  811. .bulkDensity > 1000) {
  812. this.$api.msg('容重输入错误')
  813. return
  814. }
  815. if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
  816. .detailData.warehouseInOutDetail.bulkDensity).length - (
  817. String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
  818. this.$api.msg('容重输入错误')
  819. return
  820. }
  821. }
  822. if (this.detailData.warehouseInOutDetail.jiaorenli) {
  823. if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
  824. .jiaorenli > 40) {
  825. this.$api.msg('热损伤占比输入错误')
  826. return
  827. }
  828. if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
  829. .warehouseInOutDetail.jiaorenli).length - (String(
  830. this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
  831. this.$api.msg('热损伤占比输入错误')
  832. return
  833. }
  834. }
  835. if (this.detailData.warehouseInOutDetail.impurity) {
  836. if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
  837. .impurity > 40) {
  838. this.$api.msg('杂质占比输入错误')
  839. return
  840. }
  841. if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
  842. .warehouseInOutDetail.impurity).length - (String(
  843. this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
  844. this.$api.msg('杂质占比输入错误')
  845. return
  846. }
  847. }
  848. if (this.detailData.warehouseInOutDetail.mildewGrain) {
  849. if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
  850. .mildewGrain > 40) {
  851. this.$api.msg('霉变粒占比输入错误')
  852. return
  853. }
  854. if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
  855. .detailData
  856. .warehouseInOutDetail.mildewGrain).length - (String(
  857. this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
  858. this.$api.msg('霉变粒占比输入错误')
  859. return
  860. }
  861. }
  862. if (this.detailData.warehouseInOutDetail.imperfectGrain) {
  863. if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
  864. .imperfectGrain > 40) {
  865. this.$api.msg('不完善粒占比输入错误')
  866. return
  867. }
  868. if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
  869. .detailData
  870. .warehouseInOutDetail.imperfectGrain).length - (String(
  871. this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
  872. this.$api.msg('不完善粒占比输入错误')
  873. return
  874. }
  875. }
  876. if (this.detailData.boxNo) {
  877. this.detailData.boxNo = this.detailData.boxNo.toUpperCase()
  878. }
  879. if (this.detailData.boxNoOther) {
  880. this.detailData.boxNoOther = this.detailData.boxNoOther.toUpperCase()
  881. }
  882. this.detailData.baseId = helper.erpWarehouse.warehouseId
  883. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  884. this.detailData.positionId = helper.erpWarehouse.positionId
  885. this.detailData.binNumber = this.binNumber
  886. this.detailData.compId = helper.erpWarehouse.compId
  887. this.detailData.netWeight = this.netWeight
  888. this.detailData.inOutFlag = 1
  889. this.detailData.taskType = "出库任务"
  890. this.detailData.pcFlag = 0
  891. let title = ""
  892. if (num == 1) {
  893. this.detailData.statusFlag = 1
  894. this.detailData.backOffice = this.userInfo.userName
  895. this.detailData.backOfficeId = this.userInfo.id
  896. title = "暂存成功"
  897. } else if (num == 2) {
  898. this.detailData.statusFlag = 3
  899. this.detailData.backOffice = this.userInfo.userName
  900. this.detailData.backOfficeId = this.userInfo.id
  901. title = "提交成功"
  902. }
  903. let that = this
  904. uni.showModal({
  905. content: "确定提交出库信息?",
  906. success(res) {
  907. if (res.confirm) {
  908. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  909. that.detailData).then(res => {
  910. console.log(res, "报异常")
  911. if (res.data.code == 200) {
  912. that.weightbills.carNo = that.detailData.carNo
  913. that.weightbills.boxNo = that.detailData.boxNo
  914. that.weightbills.boxNoOther = that.detailData.boxNoOther
  915. that.weightbills.wingNumber = that.detailData.wingNumber
  916. that.weightbills.wingNumberOther = that.detailData.wingNumberOther
  917. that.weightbills.shipName = that.detailData.shipName
  918. that.weightbills.shipNumber = that.detailData.shipNumber
  919. that.weightbills.type = that.detailData.type
  920. that.weightbills.grossWeight = that.detailData.grossWeight
  921. that.weightbills.tare = that.detailData.tare
  922. that.weightbills.netWeight = that.detailData.netWeight
  923. that.weightbills.outType = that.detailData.outType
  924. that.weightbills.backOffice = that.detailData.outType
  925. var date = new Date()
  926. that.weightbills.updateDate = date.getFullYear() + '-' + (date
  927. .getMonth() + 1) + '-' + date.getDate() + ' ' + date
  928. .getHours() + ':' + date.getMinutes() + ':' + date.getSeconds()
  929. that.$api.msg(title)
  930. that.isShowPrint = true
  931. uni.setStorageSync("exWarehousing_print", that.weightbills)
  932. // setTimeout(() => {
  933. // uni.navigateBack()
  934. // }, 1000)
  935. } else {
  936. that.$api.msg(res.data.message)
  937. }
  938. })
  939. }
  940. }
  941. })
  942. },
  943. slectcontractNo() {
  944. uni.navigateTo({
  945. url: '/pages/erp/exWarehousing/selectContractNo?flag=' + 5
  946. })
  947. },
  948. slectCarNo() {
  949. uni.navigateTo({
  950. url: '/pages/erp/exWarehousing/selectCarNo'
  951. })
  952. },
  953. }
  954. }
  955. </script>
  956. <style scoped lang="scss">
  957. uni-page-body {
  958. overflow: hidden;
  959. }
  960. .warp {
  961. margin: 10rpx;
  962. padding: 20rpx 20rpx 300rpx 20rpx;
  963. .top {
  964. display: flex;
  965. margin-bottom: 20rpx;
  966. .top-left {
  967. margin-right: 20rpx;
  968. }
  969. }
  970. }
  971. .content,
  972. .content1,
  973. .content2 {
  974. border-radius: 20rpx;
  975. background: white;
  976. padding: 20rpx;
  977. .title {
  978. font-size: 28rpx;
  979. font-weight: 600;
  980. color: #333333;
  981. }
  982. .row {
  983. display: flex;
  984. justify-content: space-between;
  985. border-bottom: 1px solid #EEEEEE;
  986. padding: 21rpx 0;
  987. .right,
  988. input {
  989. font-size: 28rpx;
  990. color: #333333;
  991. }
  992. }
  993. .row-bottom {
  994. // border: 0;
  995. .right-bottom {
  996. width: 280rpx;
  997. text-align: right;
  998. }
  999. }
  1000. }
  1001. .content1 {
  1002. margin-top: 20rpx;
  1003. }
  1004. .content2 {
  1005. margin-top: 10px;
  1006. // display: flex;
  1007. align-items: center;
  1008. .left {
  1009. margin-right: 20px;
  1010. }
  1011. }
  1012. .submit {
  1013. width: 40%;
  1014. background: #22C572;
  1015. border-radius: 10rpx;
  1016. }
  1017. .edit-btn {
  1018. background: #22C572;
  1019. width: 100rpx;
  1020. height: 50rpx;
  1021. margin: 0;
  1022. color: white;
  1023. }
  1024. .has-btn {
  1025. align-items: center;
  1026. }
  1027. .bottom-btn {
  1028. padding: 30rpx;
  1029. background: #FFFFFF;
  1030. width: 92%;
  1031. position: fixed;
  1032. bottom: 0rpx;
  1033. display: flex;
  1034. z-index: 9999;
  1035. }
  1036. .buns_item {
  1037. display: flex;
  1038. padding: 80rpx 0 50rpx 0;
  1039. justify-content: space-around;
  1040. }
  1041. .but_css {
  1042. background: #22C572;
  1043. width: 40%;
  1044. padding: 20rpx;
  1045. color: #fff;
  1046. text-align: center;
  1047. border-radius: 20rpx;
  1048. }
  1049. </style>