warehousing.vue 37 KB

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