warehousing.vue 38 KB

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