<template>
|
<el-dialog
|
title="退盘"
|
:close-on-click-modal="false"
|
:visible.sync="visible"
|
append-to-body
|
>
|
<div class="split-task-edit-back-header">
|
<div></div>
|
<div></div>
|
</div>
|
<el-table
|
class="splitTaskEdit-back-table"
|
:data="splitTaskBackEditData"
|
style="width: 100%;"
|
border
|
highlight-current-row
|
@row-click="editBackRowClick"
|
stripe
|
ref="splitTaskBackEditTable"
|
>
|
<el-table-column align="center" width="55" label="单选">
|
<template slot-scope="scope">
|
<el-checkbox
|
class="edit-back-table-single-checkbox"
|
v-model="scope.row.commonChecked"
|
disabled
|
></el-checkbox>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="partBatchNo"
|
label="SN号"
|
align="center"
|
show-overflow-tooltip
|
>
|
</el-table-column>
|
</el-table>
|
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="visible = false">取消</el-button>
|
<el-button type="primary" v-thinclick="`selectEditBackStock`"
|
>确 定</el-button
|
>
|
</span>
|
</el-dialog>
|
</template>
|
|
<script>
|
export default {
|
props: {
|
splitTaskBackEditList: {
|
type: Array,
|
default: () => {
|
return []
|
}
|
}
|
},
|
components: {},
|
data() {
|
return {
|
visible: false,
|
currBackStock: null,
|
splitTaskBackEditData: []
|
}
|
},
|
methods: {
|
init() {
|
this.visible = true
|
this.splitTaskBackEditData = []
|
this.$nextTick(() => {
|
this.splitTaskBackEditList.forEach((item) => {
|
this.$set(item, 'commonChecked', false)
|
this.splitTaskBackEditData.push(item)
|
})
|
})
|
},
|
selectEditBackStock() {
|
if (this.currBackStock != null) {
|
this.$emit('selectEditBackStock', this.currBackStock)
|
this.visible = false
|
} else {
|
this.$message.error('请先选择库存零件!')
|
}
|
},
|
editBackRowClick(row, column) {
|
this.splitTaskBackEditData.forEach((item) => {
|
if (row.id !== item.id) {
|
item.commonChecked = false
|
}
|
})
|
if (row.commonChecked) {
|
row.commonChecked = false
|
this.currBackStock = null
|
this.$refs.splitTaskBackEditTable.setCurrentRow()
|
} else {
|
row.commonChecked = true
|
this.currBackStock = row
|
this.$refs.splitTaskBackEditTable.setCurrentRow(row)
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.split-task-edit-back-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;
|
}
|
.splitTaskEdit-back-table >>> .el-table__header th {
|
color: #666666;
|
}
|
|
.splitTaskEdit-back-table >>> th {
|
padding: 3px 0px;
|
height: 31px;
|
}
|
.splitTaskEdit-back-table >>> td {
|
padding: 1px 0 0 0;
|
}
|
.edit-back-table-single-checkbox
|
>>> .el-checkbox__input.is-disabled.is-checked
|
.el-checkbox__inner {
|
background-color: #006eff;
|
border-color: #006eff;
|
}
|
.edit-back-table-single-checkbox
|
>>> .el-checkbox__input.is-disabled
|
.el-checkbox__inner {
|
background-color: #ffffff;
|
cursor: pointer;
|
}
|
.edit-back-table-single-checkbox >>> .el-checkbox__inner::after {
|
border: 1px solid #fff !important;
|
border-left: 0 !important;
|
border-top: 0 !important;
|
cursor: pointer !important;
|
}
|
</style>
|