exWarehousing.vue 36 KB

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