warehousing.vue 38 KB

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