qushaowei
2024-01-11 240c74ffb2b98faddf76648116ca9eeb61ee2cde
src/views/eam/EquipmentMaintenancePlanList.vue
@@ -2,22 +2,59 @@
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
          <a-col
            :xl="6"
            :lg="7"
            :md="8"
            :sm="24"
          >
            <a-form-item label="单据号">
              <j-input placeholder="请输入单据号" v-model="queryParam.num"></j-input>
              <j-input
                placeholder="请输入单据号"
                v-model="queryParam.num"
              ></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
          <a-col
            :xl="6"
            :lg="7"
            :md="8"
            :sm="24"
          >
            <a-form-item label="保养类型">
              <j-dict-select-tag placeholder="请选择保养类型" v-model="queryParam.type" dictCode="maintenance_type" />
              <j-dict-select-tag
                placeholder="请选择保养类型"
                v-model="queryParam.type"
                dictCode="maintenance_type"
              />
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
          <a-col
            :xl="6"
            :lg="7"
            :md="8"
            :sm="24"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
@@ -27,14 +64,25 @@
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus" v-has="'MaintenancePlan:add&edit&submit'">新增</a-button>
      <a-button
        @click="handleAdd"
        type="primary"
        icon="plus"
        v-has="'MaintenancePlan:add&edit&submit'"
      >新增</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
      <div
        class="ant-alert ant-alert-info"
        style="margin-bottom: 16px;"
      >
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
        <a
          style="margin-left: 24px"
          @click="onClearSelected"
        >清空</a>
      </div>
      <a-table
@@ -43,70 +91,157 @@
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
        :customRow="clickThenSelect"
        @change="handleTableChange">
        @change="handleTableChange"
      >
        <!-- :scroll="{x:true}" -->
        <template slot="htmlSlot" slot-scope="text">
        <template
          slot="htmlSlot"
          slot-scope="text"
        >
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        <template
          slot="imgSlot"
          slot-scope="text,record"
        >
          <span
            v-if="!text"
            style="font-size: 12px;font-style: italic;"
          >无图片</span>
          <img
            v-else
            :src="getImgView(text)"
            :preview="record.id"
            height="25px"
            alt=""
            style="max-width:80px;font-size: 12px;font-style: italic;"
          />
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
        <template
          slot="fileSlot"
          slot-scope="text"
        >
          <span
            v-if="!text"
            style="font-size: 12px;font-style: italic;"
          >无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            @click="downloadFile(text)"
          >
            下载
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'">编辑</a>
          <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'"/>
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'">
        <span
          slot="action"
          slot-scope="text, record"
        >
          <a
            @click="handleEdit(record)"
            v-if="record.status==='created'||record.status==='rejected'"
            v-has="'MaintenancePlan:add&edit&submit'"
          >编辑</a>
          <a-divider
            type="vertical"
            v-if="record.status==='created'||record.status==='rejected'"
          />
          <a-popconfirm
            title="确定删除吗?"
            @confirm="() => handleDelete(record.id)"
            v-if="record.status==='created'||record.status==='rejected'"
            v-has="'MaintenancePlan:add&edit&submit'"
          >
              <a>删除</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'"/>
          <a-popconfirm title="提交后不可撤回,确定提交吗?" @confirm="() => handleSubmit(record)" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'">
          <a-divider
            type="vertical"
            v-if="record.status==='created'||record.status==='rejected'"
            v-has="'MaintenancePlan:add&edit&submit'"
          />
          <a-popconfirm
            title="提交后不可撤回,确定提交吗?"
            @confirm="() => handleSubmit(record)"
            v-if="record.status==='created'||record.status==='rejected'"
            v-has="'MaintenancePlan:add&edit&submit'"
          >
              <a>提交</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'" v-has="'MaintenancePlan:add&edit&submit'"/>
          <a-popconfirm title="通过后不可撤销,确定通过吗?" @confirm="() => handleAudit(record)" v-if="record.status==='submitted'" v-has="'MaintenancePlan:audit&reject'">
          <a-divider
            type="vertical"
            v-if="record.status==='created'||record.status==='rejected'"
            v-has="'MaintenancePlan:add&edit&submit'"
          />
          <a-popconfirm
            title="通过后不可撤销,确定通过吗?"
            @confirm="() => handleAudit(record)"
            v-if="record.status==='submitted'"
            v-has="'MaintenancePlan:audit&reject'"
          >
              <a>通过</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="record.status==='submitted'" v-has="'MaintenancePlan:audit&reject'"/>
          <a-popconfirm title="确定驳回吗?" @confirm="() => handleReject(record)" v-if="record.status==='submitted'" v-has="'MaintenancePlan:audit&reject'">
          <a-divider
            type="vertical"
            v-if="record.status==='submitted'"
            v-has="'MaintenancePlan:audit&reject'"
          />
          <a-popconfirm
            title="确定驳回吗?"
            @confirm="() => handleReject(record)"
            v-if="record.status==='submitted'"
            v-has="'MaintenancePlan:audit&reject'"
          >
              <a>驳回</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="record.status==='submitted'" v-has="'MaintenancePlan:audit&reject'"/>
          <a-popconfirm title="下发后不可撤销,确定下发吗?" @confirm="() => handleDistrbute(record)" v-if="record.status==='passed'" v-has="'MaintenancePlan:distribute'">
          <a-divider
            type="vertical"
            v-if="record.status==='submitted'"
            v-has="'MaintenancePlan:audit&reject'"
          />
          <a-popconfirm
            title="下发后不可撤销,确定下发吗?"
            @confirm="() => handleDistrbute(record)"
            v-if="record.status==='passed'"
            v-has="'MaintenancePlan:distribute'"
          >
              <a>下发</a>
          </a-popconfirm>
          <span v-if="record.status==='distributed'" style="font-size: 12px;font-style: italic;">已生成工单</span>
          <span
            v-if="record.status==='distributed'"
            style="font-size: 12px;font-style: italic;"
          >已生成工单</span>
        </span>
      </a-table>
    </div>
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="保养计划明细" key="1" >
        <EquipmentMaintenancePlanDetailList :mainId="equipmentMaintenancePlanDetailMainId" :mainStatus="mainStatus" />
      <a-tab-pane
        tab="保养计划明细"
        key="1"
      >
        <EquipmentMaintenancePlanDetailList
          :mainId="equipmentMaintenancePlanDetailMainId"
          :mainStatus="mainStatus"
        />
      </a-tab-pane>
    </a-tabs>
    <equipmentMaintenancePlan-modal ref="modalForm" @ok="modalFormOk"></equipmentMaintenancePlan-modal>
    <equipmentMaintenancePlan-modal
      ref="modalForm"
      @ok="modalFormOk"
    ></equipmentMaintenancePlan-modal>
  </a-card>
</template>
@@ -140,52 +275,47 @@
            title:'计划单类型',
            align:"center",
            dataIndex: 'type_dictText',
            width:200,
          },
          {
            title:'计划单状态',
            align:"center",
            dataIndex: 'status_dictText',
            width:200,
          },
          {
            title:'设备数量',
            align:"center",
            dataIndex: 'equipNo',
            width:200,
          },
          {
            title:'创建人',
            align:"center",
            dataIndex: 'createBy',
            width:200,
          },
          {
            title:'创建时间',
            align:"center",
            dataIndex: 'createTime',
            width:200,
          },
          {
            title:'修改人',
            align:"center",
            dataIndex: 'updateBy',
             width:200,
          },
          {
            title:'修改时间',
            align:"center",
            dataIndex: 'updateTime',
            width:200,
          },
        // {
        //   title: '修改人',
        //   align: "center",
        //   dataIndex: 'updateBy',
        //   width: 200,
        // },
        // {
        //   title: '修改时间',
        //   align: "center",
        //   dataIndex: 'updateTime',
        //   width: 200,
        // },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:200,
            scopedSlots: { customRender: 'action' },
          }
        // fixed: "right",
        // width: 200,
        ],
        url: {
          list: "/eam/equipmentMaintenancePlan/list",
@@ -203,8 +333,8 @@
        /* 分页参数 */
        ipagination:{
          current: 1,
          pageSize: 5,
          pageSizeOptions: ['5', '10', '50'],
        pageSize: 20,
        pageSizeOptions: ['5', '10', '20', '50'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " 共" + total + "条"
          },
@@ -338,5 +468,5 @@
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
@import '~@assets/less/common.less';
</style>