ElcPrintItemList.vue 5.22 KB
<template>
  <a-card :bordered="false">
    <!-- 抽屉 -->
    <a-drawer
      title="打印列表"
      :width="screenWidth"
      @close="onClose"
      :visible="visible"
    >
      <!-- 抽屉内容的border -->
      <div
        :style="{
          padding:'10px',
          border: '1px solid #e9e9e9',
          background: '#fff',
        }">

        <div class="table-page-search-wrapper">
          <a-form layout="inline" :form="form">
            <a-form-item label="基础信息:" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
              <a-input  v-model="queryParam.materialname" disabled></a-input>
            </a-form-item>
          </a-form>
        </div>

        <a-form-item label="打印机选择:" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-radio-group
            v-model="identity"
            @change="identityChange">
            <a-radio value="打印机1">打印机1</a-radio>
            <a-radio value="打印机2">打印机2</a-radio>
            <a-radio value="打印机3">打印机3</a-radio>
          </a-radio-group>
        </a-form-item>
        <div>
          <a-table
            ref="table"
            rowKey="id"
            size="middle"
            :columns="columns"
            :dataSource="dataSource"
            :loading="loading"
          >
            <span  slot="action" slot-scope="text, record">
              <a-popconfirm title="确定打印吗?" @confirm="() => elcPrint(record)">
                <a >打印</a>
              </a-popconfirm>
            </span>
           <span slot="tradeNum" slot-scope="qty">
              {{ numFormat(qty) }}
           </span>
          </a-table>
        </div>
      </div>
    </a-drawer>

  </a-card>

</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { elePrint,queryPrintList} from '@/api/api'
export default {
  name: 'ElcPrintItemList',
  mixins: [JeecgListMixin],
  data() {
    return {
      columns: [
       {
          title: '唯一标识',
          align: 'center',
          dataIndex: 'onlyCode'
        },
        , {
          title: '电气图号',
          align: 'center',
          dataIndex: 'lockqty'
        },

        {
          title: '终端客户',
          align: 'center',
          dataIndex: 'terminalCustomer'
        },
        {
          title: '项目名称',
          align: 'center',
          dataIndex: 'projectName'
        },
        {
          title: '区域(工位)名称',
          align: 'center',
          dataIndex: 'areaName'
        },
        {
          title:'柜体名称',
          align:"center",
          dataIndex: 'arkName'
        },
        {
          title: '设备功率',
          align: 'center',
          dataIndex: 'equipmentPower'
        },
        {
          title: '输入电压',
          align: 'center',
          dataIndex: 'inputVoltage'
        }, {
          title: '频率',
          align: 'center',
          dataIndex: 'frequency'
        },

        {
          title: '操作',
          dataIndex: 'action',
          align:"center",
          fixed:"right",
          width:147,
          scopedSlots: { customRender: 'action' },
        }

      ],
      queryParam: {
        name:'',
      },
      identity:"打印机1",
      departIdShow:false,
      title: '操作',
      visible: false,
      params:{
        workOrder:'',
        bomCode:'',
        bnum:'',
        inventoryId:''
      },
      screenWidth: 1000,
      model: {
      },
      view:false,
      labelCol: {
        xs: { span: 5 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 12 },
        sm: { span: 12 }
      },
      form: this.$form.createForm(this),
      validatorRules: {
        itemText: { rules: [{ required: true, message: '请输入名称!' }] },
        itemValue: { rules: [{ required: true, message: '请输入数据值!' }] }
      },
    }
  },
  created() {
    // 当页面初始化时,根据屏幕大小来给抽屉设置宽度
    this.resetScreenSize()
  },
  methods: {
    edit(code,workno,uuid) {
      let params = {
        'code':code,
        'workno':workno,
        'uuid':uuid
      }
      queryPrintList(params).then(res => {
        if (res.success) {
          this.queryParam.materialname="物料名称:"+res.result[0].name+",上级码:"+res.result[0].pnos+",电气成套码:"+res.result[0].electricalNo
           this.dataSource=res.result
        }
      })
      this.visible = true
    },
    elcPrint(data){
      let params2 = {
        'id':data.id,
        'name':this.identity
      }
      elePrint(params2).then(res => {
        if (res.success) {
          this.$message.success(res.message);
        }
      })
    },
    identityChange(e){

    },
    onClose() {
      this.visible = false
      this.form.resetFields()
      this.dataSource = []
    },

  }
}
</script>
<style lang="less" scoped>
//update--begin--autor:wangshuai-----date:20191204------for:系统管理 数据字典禁用和正常区别开,添加背景颜色 teambition JT-22------
/deep/ .data-rule-invalid {
  background: #f4f4f4;
  color: #bababa;
}

//update--begin--autor:wangshuai-----date:20191204------for:系统管理 数据字典禁用和正常区别开,添加背景颜色 teambition JT-22------
</style>