improvedExWaehousingDetail.vue 32 KB

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