zhuzhuanzhuan
2023-08-25 487754376a1eb675d430a64b7a4aa9e7ffeb405b
src/views/mdc/base/EquipmentList.vue
@@ -138,6 +138,7 @@
  import UserRecycleBinModal from './modules/EquipmentList/UserRecycleBinModal'
  import JSuperQuery from '@/components/jeecg/JSuperQuery'
  import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton'
  import {mapActions} from 'vuex'
  export default {
    name: "EquipmentList",
@@ -248,6 +249,7 @@
          // exportXlsUrl: "/sys/user/exportXls",
          // importExcelUrl: "sys/user/importExcel",
        },
        isDepartType:''
      }
    },
    computed: {
@@ -255,7 +257,187 @@
      //   return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      // }
    },
    created() {
      this.queryTreeData()
    },
    methods: {
      ...mapActions(['QueryDepartTree']),
      queryTreeData() {
        this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
            if(this.isDepartType == -1){
              this.columns=[
                {
                  title: '#',
                  dataIndex: '',
                  key:'rowIndex',
                  width:60,
                  align:"center",
                  customRender:function (t,r,index) {
                    return parseInt(index)+1;
                  }
                },
                {
                  title: '设备编号',
                  align: "center",
                  dataIndex: 'equipmentId',
                  width: 120,
                  // sorter: true
                },
                {
                  title: '设备名称',
                  align: "center",
                  width: 150,
                  dataIndex: 'equipmentName',
                },
                {
                  title: '车间',
                  align: "center",
                  width: 180,
                  dataIndex: 'productionName'
                },
                {
                  title: '设备类型',
                  align: "center",
                  width: 120,
                  dataIndex: 'equipmentType',
                  // scopedSlots: {customRender: "avatarslot"}
                },
                {
                  title: '驱动类型',
                  align: "center",
                  width: 80,
                  dataIndex: 'driveType',
                  // sorter: true
                },
                {
                  title: '机床IP',
                  align: "center",
                  width: 100,
                  dataIndex: 'equipmentIp'
                },
                {
                  title: '设备功率',
                  align: "center",
                  width: 100,
                  dataIndex: 'devicePower'
                },
                // {
                //   title: '部门',
                //   align: "center",
                //   width: 180,
                //   dataIndex: 'orgCodeTxt'
                // },
                {
                  title: '系统版本',
                  align: "center",
                  width: 80,
                  dataIndex: 'systemVersion'
                },
                {
                  title: '操作',
                  dataIndex: 'action',
                  scopedSlots: {customRender: 'action'},
                  align: "center",
                  width: 120
                }
              ]
            }else{
              this.columns=[
                {
                  title: '#',
                  dataIndex: '',
                  key:'rowIndex',
                  width:60,
                  align:"center",
                  customRender:function (t,r,index) {
                    return parseInt(index)+1;
                  }
                },
                {
                  title: '设备编号',
                  align: "center",
                  dataIndex: 'equipmentId',
                  width: 120,
                  // sorter: true
                },
                {
                  title: '设备名称',
                  align: "center",
                  width: 150,
                  dataIndex: 'equipmentName',
                },
                {
                  title: '车间',
                  align: "center",
                  width: 180,
                  dataIndex: 'productionName'
                },
                {
                  title: '设备类型',
                  align: "center",
                  width: 120,
                  dataIndex: 'equipmentType',
                  // scopedSlots: {customRender: "avatarslot"}
                },
                {
                  title: '驱动类型',
                  align: "center",
                  width: 80,
                  dataIndex: 'driveType',
                  // sorter: true
                },
                {
                  title: '机床IP',
                  align: "center",
                  width: 100,
                  dataIndex: 'equipmentIp'
                },
                {
                  title: '设备功率',
                  align: "center",
                  width: 100,
                  dataIndex: 'devicePower'
                },
                {
                  title: '部门',
                  align: "center",
                  width: 180,
                  dataIndex: 'orgCodeTxt'
                },
                {
                  title: '系统版本',
                  align: "center",
                  width: 80,
                  dataIndex: 'systemVersion'
                },
                {
                  title: '操作',
                  dataIndex: 'action',
                  scopedSlots: {customRender: 'action'},
                  align: "center",
                  width: 120
                }
              ]
            }
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() =>{
        })
      },
      handleEdit: function (record) {
        this.$refs.modalForm.edit(record);
        this.$refs.modalForm.title = "编辑";
@@ -303,7 +485,7 @@
              frozenBatch({ids: ids, status: status}).then((res) => {
                if (res.success) {
                  // that.$message.success(res.message);
                  that.$notification.warning({
                  that.$notification.success({
                    message:'消息',
                    description:res.message
                  });