improvedExWaehousingDetail.vue 31 KB

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