作者 小范

转关运抵申报权限判定

import http from './http.js'
let baseUrl = 'wlpt-nmms-manage/trans'
let baseUrl1 = 'cloud-user-center/perm'
... ... @@ -12,6 +13,8 @@ export const batchSend = params => { return http.post(`${baseUrl}/batchSend`, p
export const addTrans = params => { return http.post(`${baseUrl}/addTrans`, params); };
export const ediTrans = params => { return http.post(`${baseUrl}/ediTrans`, params); };
export const send = params => { return http.post(`${baseUrl}/send`, params); };
export const role = params => { return http.get(`${baseUrl1}/getPermission`, params); };
... ...
... ... @@ -132,10 +132,10 @@
<el-button type="primary" icon="el-icon-search" @click="trnList">查&nbsp;&nbsp;询</el-button>
</el-form-item>
<el-form-item>
<el-button type="success" icon="el-icon-edit" @click="addTrn">新&nbsp;&nbsp;增</el-button>
<el-button type="success" :disabled="isButtonDisabled1" icon="el-icon-edit" @click="addTrn">新&nbsp;&nbsp;增</el-button>
</el-form-item>
<el-form-item>
<el-button type="warning" icon="el-icon-edit" :loading="batchSendLoading" @click="batchTrn">批量申报</el-button>
<el-button type="warning" icon="el-icon-edit" :disabled="isButtonDisabled" :loading="batchSendLoading" @click="batchTrn">批量申报</el-button>
</el-form-item>
</el-col>
<!-- <el-col :span="6">-->
... ... @@ -282,16 +282,18 @@
<el-table-column label="操作" align="center" width="200" fixed="right">
<template slot-scope="scope">
<el-row>
<el-button type="success" @click="editTrn(scope.$index,scope.row)">编&emsp;&emsp;辑</el-button>
<el-button type="danger" :disabled="scope.row.customResponseText && scope.row.customResponseText !== undefined && scope.row.customResponseText.length>0" @click="delTrn(scope.row)">
<el-button type="success" :disabled="isButtonDisabled3(scope.row)" @click="editTrn(scope.$index,scope.row)">编&emsp;&emsp;辑</el-button>
<el-button type="danger" :disabled="isButtonDisabled5(scope.row)" @click="delTrn(scope.row)">
删&emsp;&emsp;除
</el-button>
</el-row>
<el-row>
<el-button type="warning" :disabled="scope.row.customResponseText && scope.row.customResponseText !== undefined && scope.row.customResponseText.length>0" @click="declareTrn(scope.row)">
<el-button type="warning" :disabled="isButtonDisabled2(scope.row)" @click="declareTrn(scope.row)">
申&emsp;&emsp;报
</el-button>
<el-button type="info" @click="statusTrn(scope.row)">
<!-- :disabled="scope.row.customResponseText && scope.row.customResponseText !== undefined-->
<!-- && scope.row.customResponseText.length>0 && scope.row.dstatus ==='001'"-->
<el-button type="info" :disabled="isButtonDisabled4(scope.row)" @click="statusTrn(scope.row)">
修改状态
</el-button>
</el-row>
... ... @@ -547,12 +549,13 @@
</template>
<script>
import {selectTrans,delTrans,batchSend,ediTrans,send,addTrans} from "../../api/trn";
import {selectTrans,delTrans,batchSend,ediTrans,send,addTrans,role} from "../../api/trn";
import DetailedLog from '@/components/detailedDialog'
import uti from '@/utils'
import loginedUserInfo from "@/api/user";
import unloadingCode from "@/common/customs/trans_arrive_unloadingCode";
import {mapActions, mapGetters} from 'vuex'
import {list} from "../../api/consigner/sort";
export default {
... ... @@ -670,14 +673,20 @@
trnmode: [
{ required: true, message: '请输入', trigger: 'change' }
],
}
},
queryInfo:{
name:'转关运抵申报',
url:''
},
names:'',
isButtonDisabled: false,
isButtonDisabled1: false,
}
},
mounted() {
//获取列表
this.trnList();
this.hasRole();
},
computed:{
...mapGetters(['getUserInfoStore','getUserMenuStore']),
... ... @@ -737,6 +746,75 @@
},
methods:{
hasRole(){
const _this = this
role({name:this.queryInfo.name}).then((response) => {
console.log(this.queryInfo)
const res = response.data
console.log(response.data)
if (res.code !== '200') {
return _this.$message.error('获取权限判定失败!')
}
//返回true(关务)
else if(res.data == true){
//关务可批量申报
this.isButtonDisabled = true;
//关务不可新增
this.isButtonDisabled1 = false;
_this.names = res.data;
_this.$message.success('获取权限判定成功!')
}
//返回false(货代)
//货代不可批量申报
this.isButtonDisabled = false;
//货代可新增
this.isButtonDisabled1 = true;
_this.names = res.data;
_this.$message.success('获取权限判定成功!')
}).catch(error => {
// 关闭加载
_this.$message.error(error.toString())
})
},
//申报按钮使用权限
isButtonDisabled2(row) {
// 已申报或货代不能申报
if (row.customResponseText && row.customResponseText !== undefined
&& row.customResponseText.length>0 || row.dstatus ==='001' || this.names == false) {
return true; // 禁用按钮
} else {
return false; // 不禁用按钮
}
},
//编辑按钮使用权限
isButtonDisabled3(row) {
// 已申报或关务不能编辑
if (row.dstatus ==='001' || this.names == true) {
return true; // 禁用按钮
} else {
return false; // 不禁用按钮
}
},
//修改状态按钮使用权限
isButtonDisabled4(row) {
// 已申报或货代或关务都不能修改状态
if (row.dstatus ==='001' || this.names == false|| this.names == true) {
return true; // 禁用按钮
} else {
return false; // 不禁用按钮
}
},
//删除按钮使用权限
isButtonDisabled5(row) {
// 已申报或关务不能删除
if (row.dstatus ==='001' || this.names == true) {
return true; // 禁用按钮
} else {
return false; // 不禁用按钮
}
},
//查看回执按钮
check(row) {
this.dialogDetailedLogVisible = true
... ... @@ -929,15 +1007,15 @@
if (this.selectedWaybillList && this.selectedWaybillList.length > 0) {
batchSend(this.selectedWaybillList).then(res => {
if (res.code === '200') {
Message.success('批量申报成功')
this.$message.success('批量申报成功')
} else {
Message.error('批量申报成功,请稍后重试')
this.$message.error('批量申报失败,请稍后重试')
}
}).catch(action => {
this.$message({
type: 'info',
message: action === 'cancel'
? '取消修改'
? '取消批量申报'
: '停留在当前页面'
})
})
... ... @@ -945,9 +1023,9 @@
setTimeout(() => {
this.trnList()
}, 1000)
Message.success('批量申报执行完毕')
this.$message.success('批量申报执行完毕')
} else {
Message.error('请选择需要批量发送的运单')
this.$message.error('请选择需要批量发送的运单')
}
},
unloadcodeSearchAsync(queryString, cb) {
... ...