improvedExWaehousingDetail.vue 30 KB

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