|
|
@ -134,7 +134,8 @@ export default { |
|
|
|
orgSid: '' // 部门sid |
|
|
|
} |
|
|
|
}, |
|
|
|
multipleSelection: [] |
|
|
|
multipleSelection: [], |
|
|
|
row:{} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -173,22 +174,24 @@ export default { |
|
|
|
this.$refs['divadd'].showAdd() |
|
|
|
}, |
|
|
|
toEdit() { |
|
|
|
if (this.multipleSelection.length === 0) { |
|
|
|
if (this.sids.length === 0) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.multipleSelection.length > 1) { |
|
|
|
if (this.sids.length > 1) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '只能选择一条记录进行编辑' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.multipleSelection.forEach(row => { |
|
|
|
if(row.nodeState == '待提交' || (row.nodeState!='待提交'&&row.nodeState=='外采申请')){ |
|
|
|
this.dataList.forEach(row => { |
|
|
|
if(row.sid === this.sids[0] && (row.nodeState == '待提交' || (row.nodeState!='待提交'&&row.nodeState=='外采申请'))){ |
|
|
|
this.viewState = 3 |
|
|
|
const row = this.multipleSelection[0] |
|
|
|
const row = this.sids[0] |
|
|
|
this.$refs['divadd'].showEdit(row) |
|
|
|
}else{ |
|
|
|
}else if(row.sid === this.sids[0]){ |
|
|
|
alert('已经发起的审批业务数据不能进行编辑。'); |
|
|
|
return false; |
|
|
|
}else{ |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
@ -225,38 +228,31 @@ export default { |
|
|
|
});*/ |
|
|
|
}, |
|
|
|
doDel(row) { |
|
|
|
|
|
|
|
if (this.multipleSelection.length === 0) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) |
|
|
|
return |
|
|
|
} |
|
|
|
const _this = this |
|
|
|
const sids = [] |
|
|
|
if (this.sids.length === 0) { |
|
|
|
this.$message({showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作'}) |
|
|
|
return |
|
|
|
} |
|
|
|
var b=false; |
|
|
|
this.multipleSelection.forEach(row => { |
|
|
|
if(row.nodeState=='待提交'||(row.nodeState!='待提交'&&row.nodeState=='外采申请')){ |
|
|
|
sids.push(row.sid) |
|
|
|
}else{ |
|
|
|
alert('已经发起的审批业务数据不能进行删除。'); |
|
|
|
sids = []; |
|
|
|
if(!(row.nodeState == '待提交' || (row.nodeState!='待提交'&&row.nodeState=='外采申请'))){ |
|
|
|
b=true |
|
|
|
} |
|
|
|
}) |
|
|
|
const tip = '请确认是否删除所选 ' + this.multipleSelection.length + ' 条记录?' |
|
|
|
this.$confirm(tip, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
if(b){ |
|
|
|
this.$message({showClose: true, type: 'error', message: '提交流程审批的记录不能进行删除!'}) |
|
|
|
return |
|
|
|
} |
|
|
|
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' |
|
|
|
this.$confirm(tip, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
const loading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: 'Loading', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
}) |
|
|
|
const _this = this |
|
|
|
req |
|
|
|
.delBySids(sids) |
|
|
|
.delBySids(this.sids) |
|
|
|
.then(resp => { |
|
|
|
loading.close() |
|
|
|
if (resp.success) { |
|
|
|
_this.$message({ type: 'success', message: resp.msg, showClose: true }) |
|
|
|
this.queryParams.current = 1 |
|
|
@ -338,8 +334,13 @@ export default { |
|
|
|
_this.tableLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleSelectionChange(val) { |
|
|
|
this.multipleSelection = val |
|
|
|
handleSelectionChange(row) { |
|
|
|
this.multipleSelection = row |
|
|
|
const aa = [] |
|
|
|
row.forEach((element) => { |
|
|
|
aa.push(element.sid) |
|
|
|
}) |
|
|
|
this.sids = aa |
|
|
|
}, |
|
|
|
// 序号 |
|
|
|
indexMethod(index) { |
|
|
|