zhuzhuanzhuan
2023-09-18 70b734a3a3641f7a10f59ee4669d1cd44200f59d
src/views/mdc/base/EquipmentList.vue
@@ -9,14 +9,14 @@
          <a-col :md="6" :sm="12">
            <a-form-item label="设备编号">
              <!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"></a-input>
              <j-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="设备名称">
              <!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
              <a-input placeholder="请输入设备名称" v-model="queryParam.equipmentName"></a-input>
              <j-input placeholder="请输入设备名称" v-model="queryParam.equipmentName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
@@ -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,12 +257,194 @@
      //   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 = "编辑";
        this.$refs.modalForm.disableSubmit = false;
        this.$refs.modalForm.disSeach = true;
        // 调用抽屉表单组件中的清除表单验证方法
        this.$refs.modalForm.removeValidate()
      },
      handleAdd: function () {
        this.$refs.modalForm.add();
@@ -271,7 +455,6 @@
      getAvatarView: function (avatar) {
        return getFileAccessHttpUrl(avatar)
      },
      batchFrozen: function (status) {
        if (this.selectedRowKeys.length <= 0) {
          // this.$message.warning('请选择一条记录!');
@@ -303,7 +486,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
                  });