退货口入库\异常口入库\导航
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar title="退货入库"></nav-bar>
|
||||
<nav-bar title="退货口入库"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">单据类型</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label_wraper">
|
||||
<span class="filter_label">木箱号</span>
|
||||
@@ -23,7 +29,7 @@
|
||||
</view>
|
||||
<view class="zd-row submitbar">
|
||||
<button class="zd-col-6 btn-submit btn-default letter-30" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-15 btn-submit btn-success letter-30" :class="{'btn-info': !val1 || !val2}" :disabled="disabled" @tap="_twoPdaReturnIn">入库</button>
|
||||
<button class="zd-col-15 btn-submit btn-success letter-30" :class="{'btn-info': !index || !val1 || !val2}" :disabled="disabled" @tap="_twoPdaReturnIn">入库</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -39,20 +45,25 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [{value: '1', text: '返检入库'}, {value: '2', text: '改切入库'}, {value: '0001', text: '生产入库'}, {value: '0009', text: '手工入库'}],
|
||||
index: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
async _twoPdaReturnIn () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.val2) {
|
||||
if (!this.index || !this.val1 || !this.val2) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await twoPdaReturnIn(this.val1, this.val2)
|
||||
let res = await twoPdaReturnIn(this.index, this.val1, this.val2)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
@@ -65,6 +76,7 @@
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.index = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [{value: '1', text: '返检入库'}, {value: '2', text: '改切入库'}],
|
||||
options: [{value: '1', text: '返检入库'}, {value: '2', text: '改切入库'}, {value: '0001', text: '生产入库'}, {value: '0009', text: '手工入库'}],
|
||||
index: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
|
||||
@@ -43,12 +43,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {allAuthority} from '@/utils/mork2.js'
|
||||
import {authority} from '@/utils/getData2.js'
|
||||
// import {authority} from '@/utils/mork2.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userName: '',
|
||||
rf_menu0: [],
|
||||
rf_menu1: [],
|
||||
menuList: [],
|
||||
menuList1: [],
|
||||
menuList2: [],
|
||||
@@ -63,19 +65,82 @@
|
||||
if (this.$store.getters.userInfo) {
|
||||
this.userName = JSON.parse(this.$store.getters.userInfo).username
|
||||
}
|
||||
this._authority()
|
||||
this._allAuthority()
|
||||
},
|
||||
methods: {
|
||||
// async _authority () {
|
||||
// let res = await authority()
|
||||
// if (res.code === '1') {
|
||||
// if (res.result.hasOwnProperty('rf_menu0')) {
|
||||
// this.menuList1 = [...res.result.rf_menu0.sonTree]
|
||||
// } else {
|
||||
// this.tab = 2
|
||||
// }
|
||||
// if (res.result.hasOwnProperty('rf_menu1')) {
|
||||
// this.menuList2 = [...res.result.rf_menu1.sonTree]
|
||||
// } else {
|
||||
// this.tab = 1
|
||||
// }
|
||||
// if (this.tab === 2) {
|
||||
// this.menuList = [...this.menuList2]
|
||||
// } else {
|
||||
// this.menuList = [...this.menuList1]
|
||||
// }
|
||||
// } else {
|
||||
// uni.showToast({
|
||||
// title: res.desc,
|
||||
// icon: 'none'
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
async _allAuthority () {
|
||||
let res = await allAuthority()
|
||||
this.rf_menu0 = res.result.rf_menu0.sonTree
|
||||
this.rf_menu1 = res.result.rf_menu1.sonTree
|
||||
this._authority()
|
||||
},
|
||||
async _authority () {
|
||||
let res = await authority()
|
||||
if (res.code === '1') {
|
||||
if (res.result.hasOwnProperty('rf_menu0')) {
|
||||
this.menuList1 = [...res.result.rf_menu0.sonTree]
|
||||
let arr = [...res.result.rf_menu0.sonTree]
|
||||
let arr1 = this.rf_menu0.filter(item1 =>
|
||||
arr.some(item2 => item2.title === item1.title)
|
||||
)
|
||||
arr1.map(e => {
|
||||
let carr = []
|
||||
arr.map(ele => {
|
||||
if (ele.title === e.title) {
|
||||
carr = ele.sonTree
|
||||
}
|
||||
})
|
||||
let carr1 = e.sonTree.filter(item1 =>
|
||||
carr.some(item2 => item2.title === item1.title)
|
||||
)
|
||||
e.sonTree = carr1
|
||||
})
|
||||
this.menuList1 = arr1
|
||||
} else {
|
||||
this.tab = 2
|
||||
}
|
||||
if (res.result.hasOwnProperty('rf_menu1')) {
|
||||
this.menuList2 = [...res.result.rf_menu1.sonTree]
|
||||
let arr = [...res.result.rf_menu1.sonTree]
|
||||
let arr1 = this.rf_menu1.filter(item1 =>
|
||||
arr.some(item2 => item2.title === item1.title)
|
||||
)
|
||||
arr1.map(e => {
|
||||
let carr = []
|
||||
arr.map(ele => {
|
||||
if (ele.title === e.title) {
|
||||
carr = ele.sonTree
|
||||
}
|
||||
})
|
||||
let carr1 = e.sonTree.filter(item1 =>
|
||||
carr.some(item2 => item2.title === item1.title)
|
||||
)
|
||||
e.sonTree = carr1
|
||||
})
|
||||
this.menuList2 = arr1
|
||||
} else {
|
||||
this.tab = 1
|
||||
}
|
||||
@@ -90,7 +155,6 @@
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
changeTab (type) {
|
||||
if (type === 1) {
|
||||
|
||||
Reference in New Issue
Block a user