|
@@ -280,6 +280,8 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ // 角色id
|
|
|
|
+ roleId:'',
|
|
// 表单数据
|
|
// 表单数据
|
|
formData: {
|
|
formData: {
|
|
startTime: "",
|
|
startTime: "",
|
|
@@ -352,9 +354,10 @@ export default {
|
|
// this.currentPage = 1;
|
|
// this.currentPage = 1;
|
|
// this.searchForm = { ...this.formData };
|
|
// this.searchForm = { ...this.formData };
|
|
// this.getData(this.searchForm);
|
|
// this.getData(this.searchForm);
|
|
-
|
|
|
|
|
|
+ this.roleId = this.$store.state.user.userInfo.roleId;
|
|
|
|
+ console.log(this.roleId,"id")
|
|
// 获取所有数据
|
|
// 获取所有数据
|
|
- this.getData()
|
|
|
|
|
|
+ this.getData()
|
|
|
|
|
|
//是否显示供应商查询
|
|
//是否显示供应商查询
|
|
this.getSupplierName();
|
|
this.getSupplierName();
|
|
@@ -397,7 +400,7 @@ export default {
|
|
},
|
|
},
|
|
successed() {
|
|
successed() {
|
|
const ids = Array.from(this.multipleSelection, ({ id }) => id);
|
|
const ids = Array.from(this.multipleSelection, ({ id }) => id);
|
|
- let status=Array.from(this.multipleSelection,({status})=>status)
|
|
|
|
|
|
+ let status=Array.from(this.multipleSelection,({status})=>status)
|
|
if(status.includes(1)){
|
|
if(status.includes(1)){
|
|
this.$message({
|
|
this.$message({
|
|
type:'error',
|
|
type:'error',
|
|
@@ -569,48 +572,87 @@ export default {
|
|
const ids = Array.from(this.multipleSelection, ({ id }) => id);
|
|
const ids = Array.from(this.multipleSelection, ({ id }) => id);
|
|
let status=Array.from(this.multipleSelection,({contractStatus})=>contractStatus)
|
|
let status=Array.from(this.multipleSelection,({contractStatus})=>contractStatus)
|
|
let Auditstatus=Array.from(this.multipleSelection,({status})=>status)
|
|
let Auditstatus=Array.from(this.multipleSelection,({status})=>status)
|
|
- console.log(Auditstatus)
|
|
|
|
- if(status.includes(1)){
|
|
|
|
- this.$message({
|
|
|
|
- type: 'error',
|
|
|
|
- message: '不能删除合同状态已是删除状态的数据'
|
|
|
|
- })
|
|
|
|
- }else if(Auditstatus.includes(1)){
|
|
|
|
- this.$message({
|
|
|
|
- type: 'error',
|
|
|
|
- message: '不能删除合同审核状态为成功的数据'
|
|
|
|
- })
|
|
|
|
- }else if(ids==""){
|
|
|
|
- this.$message({
|
|
|
|
- type: 'error',
|
|
|
|
- message: '请选择数据'
|
|
|
|
- })
|
|
|
|
- }else{
|
|
|
|
- this.$request({
|
|
|
|
- url: "/api/Contract/manage",
|
|
|
|
- method: "post",
|
|
|
|
- data: {
|
|
|
|
- ids: ids,
|
|
|
|
- operateType: 1,
|
|
|
|
- },
|
|
|
|
- }).then((res) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- this.$message({
|
|
|
|
- type: "success",
|
|
|
|
- message: res.msg,
|
|
|
|
- });
|
|
|
|
- this.$refs.multipleTable.clearSelection();
|
|
|
|
- this.multipleSelection="";
|
|
|
|
- this.getData();
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- type: "danger",
|
|
|
|
- message: res.msg,
|
|
|
|
- });
|
|
|
|
- this.getData();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ if(this.roleId===999){ //供应商删除
|
|
|
|
+ if(status.includes(1)){
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: '不能删除合同状态已是删除状态的数据'
|
|
|
|
+ })
|
|
|
|
+ }else if(Auditstatus.includes(1)){
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: '不能删除合同审核状态为成功的数据'
|
|
|
|
+ })
|
|
|
|
+ }else if(ids==""){
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: '请选择数据'
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ this.$request({
|
|
|
|
+ url: "/api/Contract/manage",
|
|
|
|
+ method: "post",
|
|
|
|
+ data: {
|
|
|
|
+ ids: ids,
|
|
|
|
+ operateType: 1,
|
|
|
|
+ },
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: res.msg,
|
|
|
|
+ });
|
|
|
|
+ this.$refs.multipleTable.clearSelection();
|
|
|
|
+ this.multipleSelection="";
|
|
|
|
+ this.getData();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "danger",
|
|
|
|
+ message: res.msg,
|
|
|
|
+ });
|
|
|
|
+ this.getData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }else{ //管理员删除
|
|
|
|
+ if(status.includes(1)){
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: '不能删除合同状态已是删除状态的数据'
|
|
|
|
+ })
|
|
|
|
+ }else if(ids==""){
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: '请选择数据'
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ this.$request({
|
|
|
|
+ url: "/api/Contract/manage",
|
|
|
|
+ method: "post",
|
|
|
|
+ data: {
|
|
|
|
+ ids: ids,
|
|
|
|
+ operateType: 1,
|
|
|
|
+ },
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: res.msg,
|
|
|
|
+ });
|
|
|
|
+ this.$refs.multipleTable.clearSelection();
|
|
|
|
+ this.multipleSelection="";
|
|
|
|
+ this.getData();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "danger",
|
|
|
|
+ message: res.msg,
|
|
|
|
+ });
|
|
|
|
+ this.getData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
// 合同状态查询
|
|
// 合同状态查询
|
|
handleCommand(command) {
|
|
handleCommand(command) {
|