exWarehousing.vue 36 KB

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