|
@@ -163,8 +163,8 @@ import {
|
|
|
warehouse,
|
|
|
listDelete,
|
|
|
tableDeleteQuery,
|
|
|
- confirmDeletion, pleaseCheck, revoke
|
|
|
-} from '@/api/purchaseRequest/index'
|
|
|
+ confirmDeletion, pleaseCheck, revoke, queryUserVal, getName
|
|
|
+} from '@/api/purchaseIssue/index'
|
|
|
import Cookies from 'js-cookie'
|
|
|
|
|
|
export default {
|
|
@@ -660,6 +660,10 @@ export default {
|
|
|
this.homePage()
|
|
|
},
|
|
|
created() {
|
|
|
+ //获取登陆人
|
|
|
+ queryUserVal().then((response) => {
|
|
|
+ this.lander = response.user.userName;
|
|
|
+ })
|
|
|
let data = {
|
|
|
tableName: this.queryList.tableName,
|
|
|
userId: Cookies.get('userName')
|
|
@@ -724,11 +728,18 @@ export default {
|
|
|
this.fCompany(2)
|
|
|
},
|
|
|
methods: {
|
|
|
+ change(){
|
|
|
+ // if(){
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ },
|
|
|
homePage(){
|
|
|
let date = this.$route.query
|
|
|
if (this.$route.query.list){
|
|
|
+ console.log(this.$route.query.list)
|
|
|
this.contentButton = this.$options.data().contentButton
|
|
|
this.contentButton.push(JSON.parse(this.$route.query.list))
|
|
|
+ console.log(this.contentButton)
|
|
|
let scope = {
|
|
|
row:{
|
|
|
fId:JSON.parse(this.$route.query.data).billId
|
|
@@ -856,15 +867,18 @@ export default {
|
|
|
if (list){
|
|
|
this.$refs.avatar.form = list.warehouseBills
|
|
|
this.contentList = list.tWarehousebillsfees
|
|
|
+ this.contentButton = this.$options.data().contentButton
|
|
|
if(this.$refs.avatar.form.fBillstatus == 4){
|
|
|
this.contentButton.push({
|
|
|
type: 'danger',
|
|
|
size: 'mini',
|
|
|
- icon: 'el-icon-arrow-left',
|
|
|
+ icon: 'el-icon-refresh-left',
|
|
|
name: '撤销审批',
|
|
|
disabled: false
|
|
|
})
|
|
|
- }else if(this.$refs.avatar.form.fBillstatus > 3){
|
|
|
+ }
|
|
|
+ if(this.$refs.avatar.form.fBillstatus > 3){
|
|
|
+ console.log(this.contentButton)
|
|
|
this.contentButton.push({
|
|
|
type: 'primary',
|
|
|
size: 'mini',
|
|
@@ -873,6 +887,47 @@ export default {
|
|
|
disabled: false
|
|
|
})
|
|
|
}
|
|
|
+ if(this.$refs.avatar.form.fBillstatus == 6){
|
|
|
+ console.log(this.contentButton)
|
|
|
+ this.contentButton.push({
|
|
|
+ type: 'warning',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-refresh-left',
|
|
|
+ name: '撤销出库',
|
|
|
+ disabled: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let operator = this.$refs.avatar.form.createBy
|
|
|
+ for(let li in this.contentButton){
|
|
|
+ if(this.$refs.avatar.form.fBillstatus < 4){
|
|
|
+ if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '修改'){
|
|
|
+ this.contentButton[li].disabled = false
|
|
|
+ }else {
|
|
|
+ this.contentButton[li].disabled = true
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '申请发票' || this.contentButton[li].name == '查看审批' || this.contentButton[li].name == '撤销出库'){
|
|
|
+ this.contentButton[li].disabled = false
|
|
|
+ }else {
|
|
|
+ this.contentButton[li].disabled = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let data = {
|
|
|
+ actId: 550,
|
|
|
+ id: this.$refs.avatar.form.fId
|
|
|
+ }
|
|
|
+ getName(data).then(response => {
|
|
|
+ if (response.data.length != 0) {
|
|
|
+ this.before = response.data[0].userName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(this.$refs.avatar.form.fBillstatus == 6 && this.before == this.lander){
|
|
|
+ this.contentButton[li].disabled = false
|
|
|
+ }
|
|
|
+ if(this.contentButton[li].name == '撤销审批' && this.lander === operator){
|
|
|
+ this.contentButton[li].disabled = false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -894,13 +949,13 @@ export default {
|
|
|
}
|
|
|
this.$refs.avatar.form = {}
|
|
|
this.getRow(data,list)
|
|
|
- for(let li in this.contentButton){
|
|
|
- if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '修改' || this.contentButton[li].name == '查看审批'){
|
|
|
- this.contentButton[li].disabled = false
|
|
|
- }else {
|
|
|
- this.contentButton[li].disabled = true
|
|
|
- }
|
|
|
- }
|
|
|
+ // for(let li in this.contentButton){
|
|
|
+ // if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '修改' ||this.contentButton[li].name == '申请发票' || this.contentButton[li].name == '查看审批'){
|
|
|
+ // this.contentButton[li].disabled = false
|
|
|
+ // }else {
|
|
|
+ // this.contentButton[li].disabled = true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -913,17 +968,36 @@ export default {
|
|
|
pleaseCheck(formData).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('请核成功')
|
|
|
- this.$refs.avatar.form = res.data.warehouseBills
|
|
|
- this.contentList = res.data.tWarehousebillsCntrs
|
|
|
+ // this.$refs.avatar.form = res.data.warehouseBills
|
|
|
+ // this.contentList = res.data.tWarehousebillsCntrs
|
|
|
this.contentOption.forEach(item => item.disabled = true)
|
|
|
this.contentStyle.forEach(item => item.disabled = true)
|
|
|
- this.contentButton.forEach(item =>{
|
|
|
- if (item.name == '返回列表' || item.name == '查看审批'){
|
|
|
- item.disabled = false
|
|
|
+ this.contentButton = this.$options.data().contentButton
|
|
|
+ this.contentButton.push({
|
|
|
+ type: 'danger',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-refresh-left',
|
|
|
+ name: '撤销审批',
|
|
|
+ disabled: false
|
|
|
+ })
|
|
|
+ this.contentButton.push({
|
|
|
+ type: 'primary',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit-outline',
|
|
|
+ name: '查看审批',
|
|
|
+ disabled: false
|
|
|
+ })
|
|
|
+ let operator = this.$refs.avatar.form.createBy
|
|
|
+ for(let li in this.contentButton){
|
|
|
+ if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '申请发票' || this.contentButton[li].name == '查看审批'){
|
|
|
+ this.contentButton[li].disabled = false
|
|
|
}else {
|
|
|
- item.disabled = true
|
|
|
+ this.contentButton[li].disabled = true
|
|
|
}
|
|
|
- })
|
|
|
+ if(this.contentButton[li].name == '撤销审批' && this.lander === operator){
|
|
|
+ this.contentButton[li].disabled = false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -1120,6 +1194,11 @@ export default {
|
|
|
this.addOrUpdateHand()
|
|
|
break
|
|
|
case '撤销审批':
|
|
|
+ this.revocationOfApproval()
|
|
|
+ break
|
|
|
+ case '撤销出库':
|
|
|
+
|
|
|
+ break
|
|
|
default:
|
|
|
this.$message.error('该按钮暂无功能')
|
|
|
}
|
|
@@ -1134,7 +1213,7 @@ export default {
|
|
|
revoke(data).then(res=>{
|
|
|
if(res.code == 200){
|
|
|
this.$message.success("撤销成功");
|
|
|
-
|
|
|
+ this.pageDisplay = true
|
|
|
}
|
|
|
})
|
|
|
},
|