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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<template>
  <el-dialog
    width="75%"
    title="工单产出批次"
    top="15vh"
    :visible.sync="innerVisible"
    append-to-body
    @close="$emit('update:currshowlist', false)"
    :show="currshowlist"
    class="part-dialog"
  >
    <div>
      <el-table
        class="out-put-batch-table"
        :data="outPutBatchList"
        style="width: 100%;"
        height="500px"
        border
        highlight-current-row
        @row-click="outPutBatchRowClick"
        stripe
        ref="outPutBatchTable"
      >
        <el-table-column align="center" width="55" label="单选">
          <template slot-scope="scope">
            <el-checkbox
              class="out-put-batch-single-checkbox"
              v-model="scope.row.commonChecked"
              disabled
            ></el-checkbox>
          </template>
        </el-table-column>
        <el-table-column
          prop="otcCustomerOrderNo"
          align="center"
          label="OTC订单号"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <span>{{ scope.row.otcCustomerOrderNo }}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="otcLineNo"
          align="center"
          label="OTC行项号"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="snNo"
          align="center"
          label="SN号"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column prop="qty" align="center" label="段长">
        </el-table-column>
        <el-table-column prop="selfNo" align="center" label="自编号">
        </el-table-column>
        <el-table-column prop="print" align="center" label="印字">
        </el-table-column>
        <el-table-column prop="direction" align="center" label="去向">
        </el-table-column>
        <el-table-column prop="section" align="center" label="区间">
        </el-table-column>
        <el-table-column prop="begining" align="center" label="始端">
        </el-table-column>
        <el-table-column prop="ending" align="center" label="终端">
        </el-table-column>
        <el-table-column prop="purpose" align="center" label="用途">
        </el-table-column>
        <el-table-column prop="endClassification" align="center" label="端别">
        </el-table-column>
        <el-table-column prop="company" align="center" label="公司名称">
        </el-table-column>
        <el-table-column prop="crccNumber" align="center" label="CRCC号">
        </el-table-column>
        <el-table-column
          prop="finishedProductSpecification"
          align="center"
          label="成品规格型号"
        >
        </el-table-column>
        <el-table-column prop="ymd" align="center" label="年月日">
        </el-table-column>
      </el-table>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="innerVisible = false">取 消</el-button>
      <el-button type="primary" @click="confirmData">确定</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { getByOperationTaskIds } from '@/api/plan/operationtaskproduce'
export default {
  props: {
    currshowlist: {
      type: Boolean,
      default: false
    },
    optaskId: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      innerVisible: false,
      outPutBatchList: [],
      currOutPutBatch: null
    }
  },
  watch: {
    currshowlist() {
      this.innerVisible = this.currshowlist
      this.outPutBatchList = []
      if (this.currshowlist) {
        this.$nextTick(() => {
          // 根据工单,查询工单对应的产出批次
          getByOperationTaskIds([this.optaskId]).then((response) => {
            const resData = response.data.data
            const resCode = response.data.code
            if (resCode === 0) {
              this.outPutBatchList = resData[this.optaskId]
            }
          })
        })
      }
    }
  },
  methods: {
    confirmData() {
      if (this.currOutPutBatch != null) {
        this.$emit('selectOutPutBatch', this.currOutPutBatch)
      }
      this.innerVisible = false
    },
    outPutBatchRowClick(row, column) {
      this.outPutBatchList.forEach((item) => {
        if (row.id !== item.id) {
          item.commonChecked = false
        }
      })
      if (row.commonChecked) {
        row.commonChecked = false
        this.currOutPutBatch = null
        this.$refs.outPutBatchTable.setCurrentRow()
      } else {
        row.commonChecked = true
        this.currOutPutBatch = row
        this.$refs.outPutBatchTable.setCurrentRow(row)
      }
    }
  }
}
</script>
<style scoped>
.out-put-batch-table >>> .el-table__header th {
  color: #666666;
}
 
.out-put-batch-table >>> th {
  padding: 3px 0px;
  height: 31px;
}
.out-put-batch-table >>> td {
  padding: 1px 0 0 0;
}
.out-put-batch-single-checkbox
  >>> .el-checkbox__input.is-disabled.is-checked
  .el-checkbox__inner {
  background-color: #006eff;
  border-color: #006eff;
}
.out-put-batch-single-checkbox
  >>> .el-checkbox__input.is-disabled
  .el-checkbox__inner {
  background-color: #ffffff;
  cursor: pointer;
}
.out-put-batch-single-checkbox >>> .el-checkbox__inner::after {
  border: 1px solid #fff !important;
  border-left: 0 !important;
  border-top: 0 !important;
  cursor: pointer !important;
}
</style>