田源
2023-08-03 6b13f9c3f40f6a1b46531005627041c2fe53b7c1
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -174,6 +174,9 @@
    tableHeadBtnData: {
      type: Array,
    },
    Treedata:{
      type:Array
    }
  },
  data() {
    return {
@@ -338,7 +341,7 @@
        }
      },
      deep: true
    }
    },
  },
  methods: {
    //状态搜索
@@ -422,6 +425,7 @@
    },
    // 发布
    setHandler() {
      console.log('Treedata',this.Treedata)
      if (this.selectRow.length > 0) {
        let hasEditing = this.selectRow.some(item => item.lcstatus !== 'Editing');
        let showMessage = true;
@@ -436,7 +440,7 @@
            processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => {
              if (res.data.data.records && res.data.data.records.length != 0) {
                this.userName = localStorage.getItem("username");
                this.parameter.template = this.userName + '-申请[' + this.result + '-' + this.selectRow[0].name + ']';
                this.parameter.template = this.userName + '-申请[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']';
                this.parameter.type = 'PUBLIC';
                this.parameter.code = this.templateOid
                this.title = '流程审批'
@@ -448,7 +452,7 @@
                  type: 'warning'
                }).then(() => {
                  const oid = this.selectRow.map(obj => obj.oid).join(",");
                  changeStatus({oid: oid, btmname: this.result, lcStatus: 'Released'}).then(res => {
                  changeStatus({oid: oid, btmname: this.selectRow[0].btmname, lcStatus: 'Released'}).then(res => {
                    if (res.data.code == 200) {
                      this.$message.success('发布成功')
                      this.onLoad()
@@ -479,14 +483,14 @@
          if (this.selectRow.length === 1 && item.lcstatus === "Disabled" && showMessage) {
            this.$message.warning('选择的数据中状态无需再执行当前操作');
            showMessage = false;
          } else if (this.selectRow.length >= 1 && !hasEditing && showMessage) {
          } else if (this.selectRow.length > 1 && !hasEditing && showMessage) {
            this.$message.warning('您选择的数据全部为【发布状态】才可以发起流程');
            showMessage = false;
          } else if (this.selectRow.length > 1 && hasEditing && showMessage) {
          } else if (this.selectRow.length >= 1 && hasEditing && showMessage) {
            processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => {
              if (res.data.records != [] && res.data.data.records.length != 0) {
                this.userName = localStorage.getItem("username");
                this.parameter.template = this.userName + '-停用[' + this.result + '-' + this.selectRow[0].name + ']';
                this.parameter.template = this.userName + '-停用[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']';
                this.parameter.type = 'DISABLE';
                this.parameter.code = this.templateOid
                this.title = '停用(冻结)编码数据'
@@ -500,7 +504,7 @@
                    type: 'warning'
                  }).then(() => {
                    const oid = this.selectRow.map(obj => obj.oid).join(",");
                    changeStatus({oid: oid, btmname: this.result, lcStatus: 'Disabled'}).then(res => {
                    changeStatus({oid: oid, btmname: this.selectRow[0].btmname, lcStatus: 'Disabled'}).then(res => {
                      if (res.data.code == 200) {
                        this.$message.success('停用成功')
                        this.onLoad()
@@ -515,7 +519,7 @@
                }
              }
            });
          } else {
          } else if(this.selectRow.length == 1 && !hasEditing && showMessage ) {
            this.$message.warning('您选择的数据为【发布状态】才可以发起流程')
          }
        });
@@ -537,7 +541,7 @@
              if (res.data.data.records && res.data.data.records.length != 0) {
                this.parameter = res.data.data.records[0]
                this.userName = localStorage.getItem("username");
                this.parameter.template = this.userName + '-启用[' + this.result + '-' + this.selectRow[0].name + ']';
                this.parameter.template = this.userName + '-启用[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']';
                this.parameter.type = 'Released';
                this.parameter.code = this.templateOid
                this.title = '启用编码数据'
@@ -551,7 +555,7 @@
                    type: 'warning'
                  }).then(() => {
                    const oid = this.selectRow.map(obj => obj.oid).join(",");
                    changeStatus({oid: oid, btmname: this.result, lcStatus: 'Released'}).then(res => {
                    changeStatus({oid: oid, btmname: this.selectRow[0].btmname, lcStatus: 'Released'}).then(res => {
                      if (res.data.code == 200) {
                        this.$message.success('启用成功')
                        this.onLoad()
@@ -594,7 +598,7 @@
            processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => {
              if (res.data.records != [] && res.data.data.records.length != 0) {
                this.userName = localStorage.getItem("username");
                this.parameter.template = this.userName + '-回收[' + this.result + '-' + this.selectRow[0].name + ']';
                this.parameter.template = this.userName + '-回收[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']';
                this.parameter.type = 'TakeBack';
                this.parameter.code = this.templateOid
                this.title = '回收编码数据'
@@ -608,7 +612,7 @@
                    type: 'warning'
                  }).then(() => {
                    const oid = this.selectRow.map(obj => obj.oid).join(",");
                    changeStatus({oid: oid, btmname: this.result, lcStatus: 'TakeBack'}).then(res => {
                    changeStatus({oid: oid, btmname: this.selectRow[0].btmname, lcStatus: 'TakeBack'}).then(res => {
                      if (res.data.code == 200) {
                        this.$message.success('回收成功')
                        this.onLoad()
@@ -774,6 +778,7 @@
    //多选
    handleSelectionChange(list) {
      this.selectRow = list;
      console.log(this.selectRow)
      this.parameter.ids = [];
      list.forEach((item) => {
        this.parameter.ids.push(item.oid);