zhuzhuanzhuan
2023-08-16 2d517aae6a1d6e0491f6931f827253a2e38861e0
src/views/mdc/base/modules/mdcPassRate/mdcPassRateModalList.vue
@@ -1,13 +1,14 @@
<template>
  <a-modal :title="title" :width="1000" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel"
  <a-modal :title="title" width="70%" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel"
           cancelText="关闭">
    <a-card :bordered="false">
      <!-- 查询区域 -->
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :md="6" :sm="6">
              <a-form-item label="部门" >
            <a-col :md="6" :sm="6"  v-if="isDepartType == 0">
              <a-form-item label="部门" v-if="isDepartType == 0">
                <!--<a-select v-model="queryParam.sectionPid" placeholder="请选择部门" :options="sectionPData" @change="initGroupOptions" />-->
                <a-tree-select
                  v-model="value"
@@ -17,16 +18,16 @@
                  placeholder="请选择部门"
                  tree-default-expand-all
                >
                <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">-->
                               <!--Child Node1 {{ value }}-->
                          <!--</span>-->
                  <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">-->
                  <!--Child Node1 {{ value }}-->
                  <!--</span>-->
                </a-tree-select>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="6">
              <a-form-item label="车间" >
                <!--<a-select v-model="queryParam.sectionId" placeholder="请选择车间" :options="sectionData"/>-->
                <!--<a-select v-model="queryParam.sectionId" placeholder="请选择团队" :options="sectionData"/>-->
                <a-tree-select
                  v-model="valueProduct"
                  style="width: 100%"
@@ -63,7 +64,7 @@
      </div>
      <!-- table区域-begin -->
      <div>
        <a-table ref="table" size="middle" bordered rowKey="id" :scroll="{  y: 300 }" :columns="columns"
        <a-table ref="table" size="middle" bordered rowKey="id" :scroll="{  y: 400 }" :columns="columns"
                 :dataSource="dataSource" :pagination="ipagination" :loading="loading"
                 :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
                 @change="handleTableChange">
@@ -75,6 +76,7 @@
</template>
<script>
  import {mapActions} from 'vuex'
  import {
    ajaxGetSelectItems
  } from '@/api/api'
@@ -95,7 +97,7 @@
  import moment from 'moment'
  export default {
    name: 'DeviceRepairListModel',
    name: 'DeviceCalendarListModel',
    mixins: [JeecgListMixin],
    components: {
      JDictSelectTag,
@@ -112,17 +114,30 @@
    },
    data() {
      return {
        treeData:[],
        readOnly:true,
        isDepartType:'',
        /*readOnly:true,*/
        title:'',
        visible: false,
        disableMixinCreated: true,
        queryParam: {},
        columns: [{
          title: '设备编码',
          align: 'center',
          dataIndex: 'equipmentId',
        },
        SelectedList:[],
        treeData:[],
        /*disableMixinCreated: true,
        queryParam: {},*/
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: "center",
            customRender: function (t, r, index) {
              return parseInt(index) + 1;
            }
          },{
            title: '设备编码',
            align: 'center',
            dataIndex: 'equipmentId',
          },
          {
            title: '设备名称',
            align: 'center',
@@ -131,13 +146,13 @@
          {
            title: '驱动类型',
            align: 'center',
            dataIndex: 'driveType',
            dataIndex: 'driveType'
          },
          {
            title: '数控系统',
            align: 'center',
            dataIndex: 'controlSystem',
          }
            dataIndex: 'controlSystem'
          },
        ],
        sectionPData: [],
        sectionData: [],
@@ -151,7 +166,7 @@
      }
    },
    created() {
      this.queryTreeData()
    },
    watch: {
      value(value) {
@@ -162,18 +177,21 @@
        this.queryParam.productionId = value
      }
    },
    methods: {
      openPage() {
        this.visible = true
        this.onClearSelected()
        this.dataSource = [];
        this.queryParam = {
          status: this.status
        };
        this.loadData();
        this.initOptions();
        this.initGroupOptions()
      ...mapActions(['QueryDepartTree']),
      queryTreeData() {
        this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() =>{
        })
      },
      onSelectChange(selectedRowKeys, selectionRows) {
        // this.SelectedList.push(selectedRowKeys);
@@ -181,6 +199,29 @@
        this.selectionRows = selectionRows
        // this.SelectedList =[...this.SelectedList,...selectionRows];
        // console.log(this.SelectedList);
      },
      handleTableChange(pagination, filters, sorter) {
        // this.onClearSelected()
        //分页、排序、筛选变化时触发
        //TODO 筛选
        if (Object.keys(sorter).length > 0) {
          this.isorter.column = sorter.field;
          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
        }
        this.ipagination = pagination;
        this.loadData();
      },
      openPage() {
        this.visible = true
        this.onClearSelected()
        this.dataSource = [];
        this.queryParam = {
          status: this.status
        };
        this.loadData();
        this.initOptions();
        this.initGroupOptions()
      },
      loadData(arg) {
        if(!this.url.list){
@@ -224,6 +265,7 @@
      modalFormOk(val) {
        // 新增/修改 成功时,重载列表
        this.loadData();
        this.selectedRowKeys = [val.id];
      },
      searchQuery() {
@@ -245,6 +287,8 @@
        this.close()
      },
      handleOk() {
        // this.selectionRows =  this.SelectedList;
        // console.log(this.selectionRows);
        this.$emit('sendSelectionRows', this.selectionRows)
        this.close()
      },