improvedWrehousingDetail.vue 34 KB

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