exWarehousing.vue 38 KB

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