exWarehousing.vue 35 KB

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