|
@@ -1352,8 +1352,8 @@ export default {
|
|
|
var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
|
|
|
this.sdata = list;
|
|
|
this.soption = [
|
|
|
- {value: 1 , label : this.$t('lable.department') , children : this.changeArr(list1), type: 'dep'},
|
|
|
- {value: 2 , label : this.$t('designatedpersonnel'),children : this.susers, type: 'user'}
|
|
|
+ {value: 1 , label : this.$t('lable.department') , children : this.changeArr(list1), type: 'dep', id: 0},
|
|
|
+ {value: 2 , label : this.$t('designatedpersonnel'),children : this.susers, type: 'user', id: 0}
|
|
|
]
|
|
|
console.log(this.soption, '选人的数据')
|
|
|
this.Nsdata = list1
|
|
@@ -1396,6 +1396,7 @@ export default {
|
|
|
this.curDeptId = null;
|
|
|
this.curUserId = null;
|
|
|
this.dialogVisible = true;
|
|
|
+ this.selectedAuuid = ''
|
|
|
},
|
|
|
editNodeDialog(index, item) {
|
|
|
//检查是否可编辑
|
|
@@ -1428,9 +1429,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
addNode() {
|
|
|
- // console.log(this.curDeptId, 'zhilail')
|
|
|
- // return
|
|
|
- this.dialogVisible = false;
|
|
|
+
|
|
|
if (this.curDeptId == null) return;
|
|
|
// if(this.user.userNameNeedTranslate != '1') {
|
|
|
// var node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
|
|
@@ -1444,7 +1443,35 @@ export default {
|
|
|
}
|
|
|
console.log(this.vueCasaderItem)
|
|
|
console.log("node",node);
|
|
|
-
|
|
|
+ let flgUserRadio = true
|
|
|
+ if(this.user.userNameNeedTranslate == 1) {
|
|
|
+ for(let s in this.dataArray) {
|
|
|
+ if(node.type == 'dep') {
|
|
|
+ if(this.dataArray[s].auditDeptName == node.label) {
|
|
|
+ flgUserRadio = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(this.dataArray[s].userName == node.label) {
|
|
|
+ flgUserRadio = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!flgUserRadio) {
|
|
|
+ if(node.type == 'dep') {
|
|
|
+ this.$message({
|
|
|
+ message: '已存在重复部门',
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '已存在重复人员',
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.dialogVisible = false;
|
|
|
if (this.isAdd) {
|
|
|
if(this.user.userNameNeedTranslate != 1) {
|
|
|
var nodes
|
|
@@ -1486,30 +1513,36 @@ export default {
|
|
|
this.dataArray.splice(this.sindex, 1);
|
|
|
},
|
|
|
submitInsert() {
|
|
|
- this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id, type:1},
|
|
|
- res => {
|
|
|
- this.listLoading = false;
|
|
|
- if (res.code == "ok") {
|
|
|
- this.$message({
|
|
|
- message: this.$t('savesuccess'),
|
|
|
- type: "success"
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: res.msg,
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- error => {
|
|
|
- this.listLoading = false;
|
|
|
- this.$message({
|
|
|
- message: error,
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- }
|
|
|
- );
|
|
|
- },
|
|
|
+ if(this.dataArray.length > 0) {
|
|
|
+ this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id, type:1},
|
|
|
+ res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('savesuccess'),
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '至少选择一个部门或者人员做为审核人',
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
//
|
|
|
approve(item) {
|