ProjectChargeSubTable.vue 7.42 KB
<template>
  <a-card>
  <a-table
    rowKey="id"
    size="middle"
    bordered
    :loading="loading"
    :columns="columns"
    :dataSource="dataSource"
    :pagination="false"
  >

    <template slot="htmlSlot" slot-scope="text">
      <div v-html="text"></div>
    </template>

    <template slot="imgSlot" slot-scope="text">
      <div style="font-size: 12px;font-style: italic;">
        <span v-if="!text">无图片</span>
        <img v-else :src="getImgView(text)" alt="" style="max-width:80px;height:25px;"/>
      </div>
    </template>

    <template slot="fileSlot" slot-scope="text">
      <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
      <a-button
              v-else
              ghost
              type="primary"
              icon="download"
              size="small"
              @click="downloadFile(text)"
      >
        <span>下载</span>
      </a-button>
    </template>

      <span slot="machinery" slot-scope="record">
          <a>{{record.machineryDesignPlan}} <a-divider  type="vertical"/> {{record.machineryDesignActual}}</a>
      </span>
      <span slot="openProcess" slot-scope="text, record">
            <a @click="openProcess(record)">{{record.workOrder}}</a>
      </span>

      <span slot="openProcess2" slot-scope="text, record">
            <a @click="openProcess2(record)">{{record.partName}}</a>
      </span>

  </a-table>
  <project-charge-rate ref="proChargeFrom"></project-charge-rate>
  <progress-charge-rate ref="progressForm"></progress-charge-rate>
  </a-card>
</template>

<script>
  import { getAction } from '@api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import projectChargeRate from "../../scheduler/projectChargeRate";
  import progressChargeRate from "../../scheduler/progressChargeRate";

  export default {
    name: 'ProjectChargeSubTable',
    mixins: [JeecgListMixin],
    components: {projectChargeRate,progressChargeRate},
    props: {
      record: {
        type: Object,
        default: null,
      }
    },
    data() {
      return {
        description: '项目管控表内嵌列表',
        disableMixinCreated: true,
        loading: false,
        dataSource: [],
        columns: [
          {
            title: '系统号',
            align: 'center',
            dataIndex: 'sysNo',
          },
          {
            title: '制作数量',
            align: 'center',
            dataIndex: 'partName',
            scopedSlots: { customRender: 'openProcess2' }
          },
          {
            title: '工作令',
            align: 'center',
            dataIndex: 'workOrder',
            scopedSlots: { customRender: 'openProcess' }
          },
          {
            title: '交期要求',
            align: 'center',
            dataIndex: 'deliveryDate',
          },
          {
            title: '机械设计实际',
            align: 'center',
            dataIndex: 'machineryDesignPlan'
          },
          {
            title: '机械设计实际',
            align: 'center',
            dataIndex: 'machineryDesignActual',
          },
          {
            title: '电气设计计划',
            align: 'center',
            dataIndex: 'electricalDesignPlan',
          },
          {
            title: '电气设计实际',
            align: 'center',
            dataIndex: 'electricalDesignActual',
          },
          {
            title: '软件设计计划',
            align: 'center',
            dataIndex: 'softwareDesignPlan',
          },
          {
            title: '软件设计实际',
            align: 'center',
            dataIndex: 'softwareDesignActual',
          },
          {
            title: '采购外协计划',
            align: 'center',
            dataIndex: 'purchasePlan',
          },
          {
            title: '采购外协实际',
            align: 'center',
            dataIndex: 'purchaseActual',
          },
          {
            title: '零件加工计划',
            align: 'center',
            dataIndex: 'partsPlanparts',
          },
          {
            title: '零件加工实际',
            align: 'center',
            dataIndex: 'partsActual',
          },
          {
            title: '机械装配计划',
            align: 'center',
            dataIndex: 'machineryFitPlan',
          },
          {
            title: '机械装配实际',
            align: 'center',
            dataIndex: 'machineryFitActual',
          },
          {
            title: '电气装配计划',
            align: 'center',
            dataIndex: 'electricalFitPlan',
          },
          {
            title: '电气装配实际',
            align: 'center',
            dataIndex: 'electricalFitActual',
          },
          {
            title: '发货计划日期',
            align: 'center',
            dataIndex: 'field0185',
          },
          {
            title: '发货完成日期',
            align: 'center',
            dataIndex: 'field0189',
          },
          {
            title: '现场安装计划日期',
            align: 'center',
            dataIndex: 'field0117',
          },
          {
            title: '现场安装完成日期',
            align: 'center',
            dataIndex: 'field0151',
          },
          {
            title: '现场调试计划日期',
            align: 'center',
            dataIndex: 'field0118',
          },
          {
            title: '现场调试完成日期',
            align: 'center',
            dataIndex: 'field0152',
          },
          {
            title: '场内装配计划日期',
            align: 'center',
            dataIndex: 'field0115',
          },
          {
            title: '场内装配完成日期',
            align: 'center',
            dataIndex: 'field0149',
          },
          {
            title: '生产外协计划日期',
            align: 'center',
            dataIndex: 'field0021',
          },
          {
            title: '生产外协完成日期',
            align: 'center',
            dataIndex: 'field0147',
          },
          {
            title: '生产自制计划日期',
            align: 'center',
            dataIndex: 'field0114',
          },
          {
            title: '生产自制完成日期',
            align: 'center',
            dataIndex: 'field0148',
          },
          {
            title: '预验收计划日期',
            align: 'center',
            dataIndex: 'field0177',
          },
          {
            title: '预验收实际日期',
            align: 'center',
            dataIndex: 'field0178',
          },
        ],
        url: {
          listByMainId: '/project_charge_header/projectChargeHeader/queryProjectChargeByMainId',
        },
      }
    },
    watch: {
      record: {
        immediate: true,
        handler() {
          if (this.record != null) {
            this.loadData(this.record)
          }
        }
      }
    },
    methods: {
      openProcess(record){
        this.$refs.proChargeFrom.show(record);
      },
      openProcess2(record){
        this.$refs.progressForm.show(record);
      },
      loadData(record) {
        this.loading = true
        this.dataSource = []
        getAction(this.url.listByMainId, {
          id: record.id
        }).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
          }
        }).finally(() => {
          this.loading = false
        })
      },



    },
  }
</script>

<style scoped>

</style>