wangting
2023-07-13 c655822a56b9d9b08b44aafa6c795832bd2fbfc7
Source/UBCS-WEB/src/components/work/BusinessWork.vue
@@ -40,11 +40,11 @@
<script>
import {businese} from '@/api/work/businese'
import {MasterTable} from "@/api/GetItem";
import {FlowTable} from "@/api/GetItem";
import {validatenull} from "@/util/validate";
export default {
  name: "BusinessWork",
  props:['ids','templateId'],
  props:['ids','templateId',"taskId","modelKey","codeClassifyOid"],
  data() {
    return {
      BuinessOids:[],
@@ -53,16 +53,22 @@
      tableData:[],
      editingRow: null,
      editShow: "",
      editAttr: ""
      editAttr: "",
      columnType: {
        text: "input",
        combox: "select",
        truefalse: "switch",
        number: "number",
        datetime: "datetime",
      }
    }
  },
  watch:{
    ids:{
      handler(newval,oldval){
        this.BuinessOids=newval;
        this.CrudHeaderRend()
        this.BuinseseRend()
        console.log(newval)
        console.log(this.BuinessOids)
      },
      deep:true
    }
@@ -78,9 +84,16 @@
    //表格头渲染
    CrudHeaderRend() {
      if (this.codeClassifyOid != "") {
        MasterTable({
          codeClassifyOid: this.codeClassifyOid,
          functionId: 5,
        var data=new FormData()
        data.append('templateId', this.templateId)
        data.append('taskId', this.taskId)
        data.append('modelKey', this.modelKey)
        data.append('codeClassifyOid', this.codeClassifyOid)
        FlowTable({
          'templateId': this.templateId,
          'taskId': this.taskId,
          'modelKey': this.modelKey,
          'codeClassifyOid': this.codeClassifyOid
        }).then((res) => {
          this.options = res.data.tableDefineVO.seniorQueryColumns;
          this.List = res.data.tableDefineVO.cols[0];
@@ -97,9 +110,12 @@
              //企业编码的默认添加超链接,暂未实现
              columnItem.formatter = '';
            }else {
              if (item.templet && typeof (item.templet) == 'string' && !validatenull(item.templet) && item.templet.indexOf("function(row,column)")>-1) {
              if (item.templet && typeof (item.templet) == 'string' && !validatenull(item.templet) && item.templet.indexOf("function(row,column)") > -1) {
                columnItem.formatter = eval("(" + item.templet + ")");
                //function(row,column){return row[column.property]=='true'?'是':'否'}
              } else if (item.fieldType == "truefalse") {
                columnItem.formatter = function (row, column) {
                  return row[column.property] == 'true' || row[column.property] == '1' ? '是' : '否'
                }
              }
            }
            this.tableHeadData.push(columnItem)