zhaowei
8 天以前 86f0166e2a759e6ec2c34b0dd0b388bafa80cedd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
  <a-modal :width="1000" :visible="visible" @cancel="handleCancel" centered>
 
    <div id="table2">
      <div class="table-header">
        <h3>刀具清单</h3>
        <div>
          <div>单位:<span>{{detail.unit}}</span></div>
          <div>编号:<span>{{detail.serialNumber}}</span></div>
        </div>
      </div>
 
      <table border="1">
        <tr>
          <th colspan="2">程序外部文件名</th>
          <td colspan="9">{{detail.docName}}</td>
        </tr>
 
        <tr>
          <th colspan="2">零件图号</th>
          <td colspan="5">{{detail.partsCode}}</td>
          <th>零件名称</th>
          <td colspan="3">{{detail.partsName}}</td>
        </tr>
 
        <tr>
          <th colspan="2">零件材料</th>
          <td colspan="3">{{detail.materielDesp}}</td>
          <th colspan="2">夹具</th>
          <td colspan="4">{{detail.fixtureInformation}}</td>
        </tr>
 
        <tr>
          <th colspan="2">工序(工步号)</th>
          <td>{{detail.processWorkCode}}</td>
          <th colspan="2">加工批次</th>
          <td colspan="2">{{detail.processingBatch}}</td>
          <th>加工数量</th>
          <td>{{detail.processingQuantity}}</td>
          <th>加工设备</th>
          <td>{{detail.processingEquipment}}</td>
        </tr>
 
        <tr>
          <th colspan="2">刀具编号</th>
          <th>刀具名称</th>
          <th colspan="2">刀具简称</th>
          <th colspan="2">刀具规格</th>
          <th>刀位</th>
          <th>刀具数量</th>
          <th colspan="2">描述</th>
        </tr>
 
        <tr v-for="item in knifeList" :key="item.knifeId">
          <td colspan="2">{{item.cutterCode}}</td>
          <td>{{item.cutterName}}</td>
          <td colspan="2">{{item.cutterType}}</td>
          <td colspan="2">{{item.cutterSpec}}</td>
          <td>{{item.cutterSpacing}}</td>
          <td>{{item.quantity}}</td>
          <td colspan="2">{{item.description}}</td>
        </tr>
      </table>
    </div>
 
    <template slot="footer">
      <a-button type="primary" v-print="'#table2'">打印</a-button>
    </template>
  </a-modal>
</template>
 
<script>
  import { getAction } from '@api/manage'
 
  export default {
    name: 'KnifeListPrintModal',
    data() {
      return {
        visible: false,
        detail: {},
        knifeList: [],
        url:{
          getByBusinessId: '/nc/cutter/getList'
        }
      }
    },
    methods: {
      handleCancel() {
        this.visible = false
      },
      handleCutter(docId){
        getAction(this.url.getByBusinessId,{docId:docId}).then((res)=>{
          if(res.success){
            this.knifeList = res.result
            this.visible = true
          }
        })
      },
    }
  }
</script>
 
<style scoped lang="less">
  .table-header {
    display: flex;
    flex-direction: column;
    align-items: center;
 
    > div {
      width: 100%;
      display: flex;
      justify-content: space-between;
      padding: 10px 5px;
    }
  }
 
  table {
    width: 100%;
    table-layout: fixed;
    text-align: center;
    font-size: 12px;
 
    th, td {
      padding: 10px 5px;
    }
  }
</style>