exWarehousing.vue 35 KB

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