田源
2023-08-04 48bfd046c9e4e5b35a857c6e9417252323d8007c
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -66,8 +66,8 @@
          <FormTemplateDialog :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid"
                              :disabledProp="disabledProp" :rowOid="rowOid" :templateOid="templateOid"
                              :title="'已发布数据更改'"
                              :type="edit"
                              :visible.sync="DataVisible"></FormTemplateDialog>
                              type="edit"
                              :visible.sync="DataVisible" @submit="updataSumbit"></FormTemplateDialog>
          <!--          发布-->
          <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleFlow"
                         @onLoad="onLoad"></set-personnel>
@@ -116,7 +116,7 @@
  </basic-container>
</template>
<script>
import {MasterTable, TableData, FindData, addSaveCode, editSaveCode, deleteCode} from "@/api/GetItem";
import {MasterTable, TableData, FindData, addSaveCode, editSaveCode, deleteCode, upSaveCode} from "@/api/GetItem";
import {processTS, changeStatus} from "@/api/template/setPersonnel"
import {listCodeAttributeByClassId} from "@/api/integration/integration.js";
import integrationTransfer from "@/views/integration/integrationTransfer";
@@ -125,6 +125,7 @@
import BatchImport from '@/components/BatchImport'
import {validatenull} from "@/util/validate";
import fileInHtml from "@/components/file/inHtml.vue";
import {getUserInfo} from "@/api/system/user";
export default {
  components: {
@@ -174,6 +175,9 @@
    tableHeadBtnData: {
      type: Array,
    },
    Treedata:{
      type:Array
    }
  },
  data() {
    return {
@@ -189,6 +193,7 @@
      //发布
      parameter: {
        ids: [],
        btmtype:'',
        code: "",
        type: '',
        // this.visibleDeactivate ?'ENABLE':this.visibleEnable ? 'DISABLE' :this.visibleRecovery ? 'ROLLBACK' :'PUBLIC'
@@ -265,8 +270,12 @@
  },
  computed: {},
  created() {
    const index = this.$route.query.id.indexOf('@name=') + '@name='.length;
    this.result = this.$route.query.id.substring(index);
    // const index = this.$route.query.id.indexOf('@name=') + '@name='.length;
    // this.result = this.$route.query.id.substring(index);
    getUserInfo().then(res=>{
      console.log(res.data.data)
      this.result=res.data.data.realName
    })
  },
  mounted() {
  },
@@ -291,8 +300,6 @@
    },
    tableDataArray: {
      handler(newval, oldval) {
        this.keyWordFind='';
        this.WupinFindValue=''
        this.tableData = newval;
        this.searchResults = newval
        this.doLayout()
@@ -314,8 +321,13 @@
              }
            }
          }
          if(_index==0){
            this.keyWordFind=record.field
          }
        })
        this.tableHeadFindDatas = newval;
        this.WupinFindValue=''
      },
    },
    total: {
@@ -338,7 +350,7 @@
        }
      },
      deep: true
    }
    },
  },
  methods: {
    //状态搜索
@@ -422,6 +434,7 @@
    },
    // 发布
    setHandler() {
      console.log('Treedata',this.Treedata)
      if (this.selectRow.length > 0) {
        let hasEditing = this.selectRow.some(item => item.lcstatus !== 'Editing');
        let showMessage = true;
@@ -435,10 +448,10 @@
          } else if (showMessage) {
            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.processName = this.result + '-申请[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']';
                this.parameter.type = 'PUBLIC';
                this.parameter.code = this.templateOid
                this.parameter.code = this.templateOid;
                this.parameter.btmtype=this.selectRow[0].btmname || this.selectRow[0].btmtype;
                this.title = '流程审批'
                this.visibleFlow = true;
              } else {
@@ -483,12 +496,12 @@
            this.$message.warning('您选择的数据全部为【发布状态】才可以发起流程');
            showMessage = false;
          } else if (this.selectRow.length >= 1 && hasEditing && showMessage) {
            processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => {
            processTS({templateId: this.templateOid, buttonTypeKey: 'DISABLE'}).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.processName = this.result + '-停用[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']';
                this.parameter.type = 'DISABLE';
                this.parameter.code = this.templateOid
                this.parameter.btmtype=this.selectRow[0].btmname || this.selectRow[0].btmtype;
                this.title = '停用(冻结)编码数据'
                this.visibleDeactivate = true;
              } else {
@@ -533,13 +546,13 @@
            this.$message.warning('选择的数据中状态无需再执行当前操作');
            showMessage = false;
          } else if (this.selectRow.length >= 1 && hasEditing && showMessage) {
            processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => {
            processTS({templateId: this.templateOid, buttonTypeKey: 'ENABLE'}).then(res => {
              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.processName = this.result + '-启用[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']';
                this.parameter.type = 'Released';
                this.parameter.code = this.templateOid
                this.parameter.btmtype=this.selectRow[0].btmname || this.selectRow[0].btmtype;
                this.title = '启用编码数据'
                this.visibleDeactivate = true;
              } else {
@@ -591,12 +604,12 @@
            showMessage = false;
          } else if (this.selectRow.length >= 1 && (disabledCount === this.selectRow.length || releasedCount === this.selectRow.length) || (disabledCount > 0 && releasedCount > 0) && showMessage) {
            //disabledCount 和 releasedCount 中任意一个等于 this.selectRow 数组的长度则表示全部是同一种状态,返回 true 如果disabledCount 和 releasedCount 都大于0,则表示既有Disabled也有Released返回 true
            processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => {
            processTS({templateId: this.templateOid, buttonTypeKey: 'ROLLBACK'}).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.processName = this.result + '-回收[' + this.selectRow[0].btmname + '-' + this.selectRow[0].name + ']';
                this.parameter.type = 'TakeBack';
                this.parameter.code = this.templateOid
                this.parameter.btmtype=this.selectRow[0].btmname || this.selectRow[0].btmtype;
                this.title = '回收编码数据'
                this.visibleDeactivate = true;
              } else {
@@ -839,6 +852,7 @@
        this.$message.warning("只有状态为已发布的数据才能进行数据更改");
      } else {
        this.DataVisible = true;
        this.rowOid = this.selectRow[0]['oid']
      }
    },
    //增加保存
@@ -850,9 +864,23 @@
        })
      })
    },
    //修改回调
    EditSumbit(val) {
      this.editvisible = false;
      editSaveCode(val).then(res => {
        this.$nextTick(() => {
          this.onLoad()
        })
      })
    },
    //数据更改回调
    updataSumbit(val){
      this.DataVisible = false;
      val.copyfromversion = this.rowOid;
      val.oid=''
      console.log(val)
      upSaveCode(val).then(res=>{
        console.log(res)
        this.$nextTick(() => {
          this.onLoad()
        })
@@ -865,10 +893,10 @@
    },
    //输入回车搜索
    tableFindInp() {
      if (this.WupinFindValue.trim() === '') {
      /*if (this.WupinFindValue.trim() === '') {
        this.$message.warning('输入值不能为空')
        return;
      }
      }*/
      TableData({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
@@ -876,7 +904,6 @@
        limit: this.page.pageSize,
        [ 'conditionMap[' + this.keyWordFind + ']']: '*' + this.WupinFindValue + '*'
      }).then(res => {
        console.log(res)
        this.tableData = res.data.data
      })
    }