zouyu
2023-11-17 d8ac6057eaad648687699e25a575f3b7b8c1b102
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
<template>
  <el-dialog
    title="投入查看"
    :close-on-click-modal="false"
    :visible.sync="visible"
  >
    <div class="split-task-in-header">
      <div></div>
      <div></div>
    </div>
    <el-table
      ref="splitTaskInTable"
      :data="splitTaskInputList"
      height="320px"
      :header-cell-style="splitTaskInTableHeaderCellStyle"
      :row-class-name="splitTaskInTableRowClassName"
    >
      <el-table-column type="index" label="序号" width="50"> </el-table-column>
      <el-table-column
        label="零件号"
        prop="partNo"
        align="center"
        :show-overflow-tooltip="true"
      >
      </el-table-column>
      <el-table-column
        label="零件名称"
        prop="partName"
        align="center"
        :show-overflow-tooltip="true"
      >
      </el-table-column>
      <el-table-column
        label="SN号"
        prop="partBatchNo"
        align="center"
        :show-overflow-tooltip="true"
      >
      </el-table-column>
      <el-table-column
        label="IFS批次号"
        prop="ifsBatchNo"
        align="center"
        :show-overflow-tooltip="true"
      >
      </el-table-column>
      <el-table-column label="调整数量" prop="adjustQty" align="center">
      </el-table-column>
      <el-table-column label="报废数量" prop="scrapQty" align="center">
      </el-table-column>
      <el-table-column label="单位" prop="unit" align="center">
      </el-table-column>
    </el-table>
 
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
    </span>
  </el-dialog>
</template>
 
<script>
import { getListByTaskId } from '@/api/product/segmentationtaskrecord'
export default {
  components: {},
  data() {
    return {
      visible: false,
      splitTaskInputList: []
    }
  },
  methods: {
    init(id) {
      this.getListByTaskId(id)
      this.visible = true
    },
    splitTaskInTableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
      let headerStyle = 'background:#599ef4;color:#fff;'
      if (columnIndex === 0) {
        headerStyle += 'border-radius: 6px 0px 0px 0px;'
      } else if (columnIndex === 7) {
        headerStyle += 'border-radius: 0px 6px 0px 0px;'
      }
      return headerStyle
    },
    splitTaskInTableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 === 1) {
        return 'stripe-row'
      } else {
        return ''
      }
    },
    // 根据报工主表id获取投入、产出明细
    getListByTaskId(id) {
      this.splitTaskInputList = []
      getListByTaskId(id)
        .then((response) => {
          const code = response.data.code
          if (code == 0) {
            const splitTaskInputs = response.data.data
            this.splitTaskInputList = splitTaskInputs
          }
        })
        .catch((error) => {
          this.$message.error('获取投入产出明细失败')
        })
    }
  }
}
</script>
 
<style lang="scss" scoped>
.split-task-in-header {
  margin-top: 10px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.red-but.is-disabled {
  color: #fab6b6;
}
 
.red-but {
  color: red;
}
</style>