improvedExWaehousingDetail.vue 32 KB

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