exWarehousing.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  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='slectcontractNo'>{{detailData.contractNo}}</view>
  11. </view>
  12. <view class="row">
  13. <view class="left">货名</view>
  14. <view class="right">{{detailData.goodsName ? detailData.goodsName : "选择合同,自动获取"}}
  15. </view>
  16. </view>
  17. <view class="row">
  18. <view class="left">类型</view>
  19. <view @click='show1=true'>{{detailData.type}}</view>
  20. <u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
  21. mode="selector">
  22. <view class="">{{detailData.type}}</view>
  23. </u-picker>
  24. </view>
  25. <view class="row row-bottom">
  26. <view class="left">毛重(吨)</view>
  27. <input @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
  28. placeholder="输入毛重"></input>
  29. </view>
  30. <view class="row row-bottom">
  31. <view class="left">皮重(吨)</view>
  32. <input @input='calculate' v-model='detailData.tare' class="right-bottom" placeholder="输入皮重"></input>
  33. </view>
  34. <view class="row row-bottom">
  35. <view class="left">净重(吨)</view>
  36. <input @input='calculate' v-model='detailData.netWeight' class="right-bottom"
  37. placeholder="不可编辑,自动计算"></input>
  38. </view>
  39. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  40. <view class="left">扣重比</view>
  41. <input v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"></input>
  42. </view>
  43. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  44. <view class="left">干粮水分(%)</view>
  45. <input v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"></input>
  46. </view>
  47. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  48. <view class="left">潮粮水分(%)</view>
  49. <input v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"></input>
  50. </view>
  51. <view class="row row-bottom" v-if="detailData.type == '潮粮'">
  52. <view class="left">纯重(吨)</view>
  53. <input v-model='detailData.pureWeight' class="right-bottom" placeholder="不可编辑,自动计算"></input>
  54. </view>
  55. <view class="row">
  56. <view class="left">品级</view>
  57. <view @click='show3=true'>{{detailData.grade}}</view>
  58. <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show3" mode="selector">
  59. </u-picker>
  60. </view>
  61. <view class="row">
  62. <view class="left">经办人</view>
  63. <view @click='show6=true'>{{detailData.agent}}</view>
  64. <u-picker :range="handlerList" range-key="staffName" @confirm='handlerPicker($event)' v-model="show6"
  65. mode="selector">
  66. </u-picker>
  67. </view>
  68. <view class="row">
  69. <view class="left">出库日期</view>
  70. <view @click='show7=true'>{{detailData.inOutDate}}</view>
  71. <u-picker v-model="show7" mode="time" @confirm='dateChange($event)' :params="params">
  72. </u-picker>
  73. </view>
  74. <view class="row">
  75. <view class="left">出库类型</view>
  76. <view @click='show5=true'>{{detailData.inOutType}}</view>
  77. <u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)'
  78. v-model="show5" mode="selector">
  79. </u-picker>
  80. </view>
  81. <view class="row row-bottom">
  82. <view class="left">车牌号</view>
  83. <input v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input>
  84. </view>
  85. </view>
  86. <view class="content2">
  87. <view class="left">上传磅单</view>
  88. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  89. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  90. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  91. </view>
  92. <view class="content1">
  93. <view class="title">
  94. 质检数据(选填)
  95. </view>
  96. <view class="row row-bottom">
  97. <view class="left">质检员</view>
  98. <input v-model='detailData.warehouseInOutDetail.qualityInspector' class="right-bottom" placeholder="输入质检员姓名"></input>
  99. </view>
  100. <view class="row row-bottom">
  101. <view class="left">水分(%)</view>
  102. <input v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom" placeholder="输入水分占比"></input>
  103. </view>
  104. <view class="row row-bottom">
  105. <view class="left">容重(克/升)</view>
  106. <input v-model='detailData.warehouseInOutDetail.bulkDensity' class="right-bottom" placeholder="输入容重"></input>
  107. </view>
  108. <view class="row row-bottom">
  109. <view class="left">热损伤(%)</view>
  110. <input v-model='detailData.warehouseInOutDetail.jiaorenli' class="right-bottom" placeholder="输入热损伤占比"></input>
  111. </view>
  112. <view class="row row-bottom">
  113. <view class="left">杂质(%)</view>
  114. <input v-model='detailData.warehouseInOutDetail.impurity' class="right-bottom" placeholder="输入杂质占比"></input>
  115. </view>
  116. <view class="row row-bottom">
  117. <view class="left">霉变粒(%)</view>
  118. <input v-model='detailData.warehouseInOutDetail.mildewGrain' class="right-bottom" placeholder="输入霉变粒占比"></input>
  119. </view>
  120. <view class="row row-bottom">
  121. <view class="left">不完善粒(%)</view>
  122. <input v-model='detailData.warehouseInOutDetail.imperfectGrain' class="right-bottom" placeholder="输入不完善粒占比"></input>
  123. </view>
  124. </view>
  125. <u-toast ref="uToast" />
  126. <view class="bottom-btn">
  127. <u-button type="primary" class="submit" hover-class="none" @click="submit(1)">暂存</u-button>
  128. <u-button type="primary" class="submit" hover-class="none" @click="submit(2)">提交</u-button>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. import upload from '@/components/upload.vue';
  134. import helper from '@/common/helper.js';
  135. export default {
  136. components: {
  137. upload
  138. },
  139. data() {
  140. return {
  141. show: false,
  142. show1: false,
  143. show2: false,
  144. show3: false,
  145. show4: false,
  146. show5: false,
  147. show6: false,
  148. show7: false,
  149. contractNoList: [{
  150. contractNo: "123"
  151. }],
  152. typeList: [{
  153. type: "干粮"
  154. },
  155. {
  156. type: "潮粮"
  157. }
  158. ],
  159. pjList: [{
  160. type: "一等品"
  161. },
  162. {
  163. type: "二等品"
  164. },
  165. {
  166. type: "三等品"
  167. },
  168. {
  169. type: "等外"
  170. }
  171. ],
  172. handlerList: [{
  173. name: "张三"
  174. },
  175. {
  176. name: "二等"
  177. },
  178. {
  179. name: "三等"
  180. },
  181. {
  182. name: "等外"
  183. }
  184. ],
  185. warehousingTypeList: [],
  186. action: this.$uploadUrl,
  187. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  188. btnLoading: false, //防止重复点击
  189. isAdd: true,
  190. warehouseName:'',
  191. binNumber:'',
  192. detailData: {
  193. contractNo: "请选择合同编号或移库任务编号",
  194. carNo: '辽H12345',
  195. name: "",
  196. type: "请选择类型",
  197. grade: "请输入品级",
  198. agent: "请选择经办人",
  199. inOutDate: "请选择出库日期",
  200. inOutType: "请选择出库类型",
  201. warehouseInOutDetail:{},
  202. gradeKey:"",
  203. },
  204. params: {
  205. year: true,
  206. month: true,
  207. day: true,
  208. hour: true,
  209. minute: true,
  210. second: true
  211. },
  212. inOutDate1: "",
  213. }
  214. },
  215. onLoad(options) {
  216. this.id = options.id
  217. this.cangId = options.cangId
  218. },
  219. onShow() {
  220. console.log(helper.erpWarehouse.baseId,"仓位id")
  221. this.binNumber = helper.erpWarehouse.binNumber
  222. this.warehouseName = helper.erpWarehouse.warehouseName
  223. this.detailData.goodsName = uni.getStorageSync('erpContractNo').goodsName;
  224. this.detailData.contractNo = uni.getStorageSync('erpContractNo').contractNo;
  225. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
  226. console.log(this.detailData.goodsNameKey,"keyzhi")
  227. console.log(uni.getStorageSync('erpContractNoList'))
  228. if(!this.detailData.contractNo){
  229. this.detailData.contractNo = '请选择合同编号'
  230. }
  231. if(!this.detailData.goodsName){
  232. this.detailData.goodsName = '货名'
  233. }
  234. //出库类型
  235. this.outWarehouse()
  236. //经办人
  237. this.handler()
  238. },
  239. methods: {
  240. outWarehouse(){
  241. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  242. constId: 'CON6'
  243. }).then(res => {
  244. this.warehousingTypeList = res.data.data
  245. })
  246. },
  247. handler(){
  248. this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
  249. compId:helper.erpWarehouse.compId,
  250. warehouseId:helper.erpWarehouse.warehouseId
  251. }).then(res => {
  252. this.handlerList = res.data.data
  253. })
  254. },
  255. contractNopicker(e) {
  256. },
  257. typePicker(e) {
  258. this.detailData.type = this.typeList[e].type
  259. },
  260. pjPicker(e) {
  261. console.log(e[0],"dd")
  262. this.detailData.gradeKey = e[0]
  263. this.detailData.grade = this.pjList[e].type
  264. },
  265. handlerPicker(e) {
  266. this.detailData.agent = this.handlerList[e].staffName
  267. },
  268. dateChange(e) {
  269. this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
  270. this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
  271. },
  272. warehousingTypePicker(e) {
  273. this.detailData.inOutType = this.warehousingTypeList[e].constValue
  274. },
  275. filterFileType(index, lists) {
  276. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  277. lists.splice(index, 1);
  278. // 当前文件不支持
  279. uni.showModal({
  280. title: '暂不支持当前图片类型',
  281. showCancel: false
  282. });
  283. } else {
  284. this.isAdd = false;
  285. }
  286. },
  287. calculate() {
  288. if (this.detailData.grossWeight && this.detailData.tare) {
  289. this.detailData.netWeight = this.detailData.grossWeight - this.detailData.tare
  290. }
  291. },
  292. getImgUrl(res) {
  293. this.detailData.addressUrl = res
  294. console.log(res)
  295. console.log('------------res-----------')
  296. },
  297. onError(error) {
  298. alert(error)
  299. console.log('------------error-----------')
  300. console.log(error)
  301. },
  302. binNumberpicker(e) {
  303. this.detailData.binNumber = this.positionList[e[0]].binNumber
  304. },
  305. getWeighingManagement() {
  306. this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
  307. id: this.id
  308. }).then(res => {
  309. if (res.data.code == 200) {
  310. this.detailData = res.data.data
  311. }
  312. })
  313. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  314. id: this.cangId
  315. }).then(res => {
  316. if (res.data.code == 200) {
  317. this.positionList = res.data.data.warehousePositionInfoList
  318. }
  319. })
  320. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  321. compId: '',
  322. flag: 5
  323. }).then(res => {
  324. if (res.data.code == 200) {
  325. this.contractNoList = res.data.data
  326. }
  327. })
  328. },
  329. onProgress(e) {
  330. console.log(e)
  331. },
  332. onRemove(index) {},
  333. submit(num) {
  334. if (!this.detailData.grossWeight) {
  335. this.$api.msg('毛重不能为空')
  336. return
  337. }
  338. if (isNaN(this.detailData.grossWeight) ||
  339. (String(this.detailData.grossWeight).indexOf('.') != -1 &&
  340. String(this.detailData.grossWeight).length -
  341. (String(this.detailData.grossWeight).indexOf('.') + 1) >
  342. 1) ||
  343. this.detailData.grossWeight < 1 ||
  344. this.detailData.grossWeight > 100000
  345. ) {
  346. this.$api.msg('毛重输入错误!')
  347. return
  348. }
  349. this.detailData.baseId = helper.erpWarehouse.warehouseId
  350. this.detailData.warehouseName = helper.erpWarehouse.warehouseName
  351. this.detailData.positionId = helper.erpWarehouse.baseId
  352. this.detailData.binNumber = this.binNumber
  353. this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
  354. console.log(this.detailData.goodsNameKey,"|key值")
  355. this.detailData.compId = helper.erpWarehouse.compId
  356. this.detailData.inOutFlag = 1
  357. this.detailData.taskType = "出库任务"
  358. let title = ""
  359. if(num == 1 ){
  360. this.detailData.statusFlag = 1
  361. this.detailData.inOutDate = this.inOutDate1
  362. title = "暂存成功"
  363. }else if(num == 2){
  364. this.detailData.statusFlag = 3
  365. title = "提交成功"
  366. }
  367. let that = this
  368. console.log(this.detailData,"提交对象")
  369. return
  370. uni.showModal({
  371. content: "确定提交出库信息?",
  372. success(res) {
  373. if (res.confirm) {
  374. that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
  375. that.detailData).then(res => {
  376. if (res.data.code == 200) {
  377. that.$api.msg(title)
  378. uni.navigateBack()
  379. }
  380. })
  381. }
  382. }
  383. })
  384. },
  385. slectcontractNo() {
  386. uni.navigateTo({
  387. url: '/pages/erp/warehousing/selectContractNo?compId=' + this.compId
  388. })
  389. },
  390. slectCarNo() {
  391. uni.navigateTo({
  392. url: '/pages/erp/exWarehousing/selectCarNo'
  393. })
  394. },
  395. }
  396. }
  397. </script>
  398. <style scoped lang="scss">
  399. uni-page-body {
  400. overflow: hidden;
  401. }
  402. .warp {
  403. margin: 10rpx;
  404. padding: 20rpx 20rpx 140rpx 20rpx;
  405. .top {
  406. display: flex;
  407. margin-bottom: 20rpx;
  408. .top-left {
  409. margin-right: 20rpx;
  410. }
  411. }
  412. }
  413. .content,
  414. .content1,
  415. .content2 {
  416. border-radius: 20rpx;
  417. background: white;
  418. padding: 20rpx;
  419. .title {
  420. font-size: 28rpx;
  421. font-weight: 600;
  422. color: #333333;
  423. }
  424. .row {
  425. display: flex;
  426. justify-content: space-between;
  427. border-bottom: 1px solid #EEEEEE;
  428. padding: 21rpx 0;
  429. .right,
  430. input {
  431. font-size: 28rpx;
  432. color: #333333;
  433. }
  434. }
  435. .row-bottom {
  436. // border: 0;
  437. .right-bottom {
  438. width: 300rpx;
  439. text-align: right;
  440. }
  441. }
  442. }
  443. .content1 {
  444. margin-top: 20rpx;
  445. }
  446. .content2 {
  447. margin-top: 10px;
  448. // display: flex;
  449. align-items: center;
  450. .left {
  451. margin-right: 20px;
  452. }
  453. }
  454. .submit {
  455. width: 40%;
  456. background: #22C572;
  457. border-radius: 10rpx;
  458. }
  459. .edit-btn {
  460. background: #22C572;
  461. width: 100rpx;
  462. height: 50rpx;
  463. margin: 0;
  464. color: white;
  465. }
  466. .has-btn {
  467. align-items: center;
  468. }
  469. .bottom-btn {
  470. width: 92%;
  471. position: fixed;
  472. bottom: 40rpx;
  473. display: flex;
  474. z-index: 2;
  475. }
  476. </style>