exWarehousing.vue 34 KB

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