<template>
|
<el-dialog
|
width="75%"
|
title="绑定产出批次"
|
top="5vh"
|
:visible.sync="innerVisible"
|
append-to-body
|
@close="$emit('update:currshowlist', false)"
|
:show="currshowlist"
|
class="part-dialog"
|
>
|
<el-table
|
ref="outPutBatchTable"
|
:data="outPutBatchList"
|
style="width: 100%"
|
@row-click="rowClick"
|
height="500px"
|
>
|
<el-table-column align="center" width="55">
|
<template slot="header" slot-scope="scope">
|
<el-button type="text" @click="selectAll()">全选</el-button>
|
</template>
|
<template slot-scope="scope">
|
<el-checkbox
|
class="outbatch-table-single-checkbox"
|
v-model="scope.row.commonChecked"
|
disabled
|
></el-checkbox>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="mpsId"
|
align="center"
|
label="状态"
|
show-overflow-tooltip
|
>
|
<template slot-scope="scope">
|
<span :style="[scope.row.mpsId != null ? redStyles : greenStyles]">{{
|
scope.row.mpsId != null ? '不可绑' : '可绑'
|
}}</span>
|
</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 slot="footer" class="dialog-footer">
|
<el-button @click="innerVisible = false">关 闭</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
<style>
|
/*自定义disabled状态下checkbox的样式*/
|
.outbatch-table-single-checkbox
|
.el-checkbox__input.is-disabled.is-checked
|
.el-checkbox__inner {
|
background-color: #006eff;
|
border-color: #006eff;
|
}
|
.outbatch-table-single-checkbox
|
.el-checkbox__input.is-disabled
|
.el-checkbox__inner {
|
background-color: #ffffff;
|
cursor: pointer;
|
}
|
.outbatch-table-single-checkbox .el-checkbox__inner::after {
|
border: 1px solid #fff !important;
|
border-left: 0 !important;
|
border-top: 0 !important;
|
cursor: pointer !important;
|
}
|
</style>
|
<script>
|
export default {
|
props: {
|
currshowlist: {
|
type: Boolean,
|
default: false
|
},
|
outPutBatchList: {
|
type: Array,
|
default: () => {
|
return []
|
}
|
},
|
customerOrder: {
|
type: Object,
|
default: () => {
|
return {}
|
}
|
}
|
},
|
data() {
|
return {
|
innerVisible: false,
|
redStyles: { color: 'red' },
|
greenStyles: { color: 'green' }
|
}
|
},
|
watch: {
|
currshowlist() {
|
this.innerVisible = this.currshowlist
|
if (this.currshowlist) {
|
this.$nextTick(() => {})
|
}
|
}
|
},
|
methods: {
|
selectAll() {
|
let qtyPlaned = 0
|
this.outPutBatchList.forEach((item) => {
|
if (item.mpsId == null) {
|
item.commonChecked = true
|
qtyPlaned = qtyPlaned + Number(item.qty)
|
}
|
})
|
this.customerOrder.qtyPlaned = Number(qtyPlaned.toFixed(6))
|
},
|
rowClick(row) {
|
if (row.mpsId == null) {
|
row.commonChecked = !row.commonChecked
|
if (row.commonChecked) {
|
this.customerOrder.qtyPlaned =
|
this.customerOrder.qtyPlaned + Number(row.qty)
|
} else {
|
this.customerOrder.qtyPlaned =
|
this.customerOrder.qtyPlaned - Number(row.qty)
|
}
|
this.customerOrder.qtyPlaned = Number(
|
this.customerOrder.qtyPlaned.toFixed(6)
|
)
|
}
|
}
|
}
|
}
|
</script>
|