<template>
|
<el-dialog
|
:visible.sync="visible"
|
title="主生产计划来源:"
|
:close-on-click-modal="false"
|
>
|
<el-table
|
:data="masterPlanSourceDataList"
|
class="source-table-calss"
|
style="width: 100%"
|
>
|
<el-table-column
|
show-overflow-tooltip
|
label="客户订单号"
|
prop="customerOrderNo"
|
>
|
</el-table-column>
|
<el-table-column show-overflow-tooltip label="零件号" prop="partNo">
|
</el-table-column>
|
<el-table-column show-overflow-tooltip label="零件名称" prop="partName">
|
</el-table-column>
|
<el-table-column label="本次计划数量" prop="qtyPlaned">
|
<template slot-scope="scope">
|
<div v-if="!scope.row.visible">{{ scope.row.qtyPlaned }}</div>
|
<el-input
|
v-if="scope.row.visible"
|
v-model="scope.row.qtyPlaned"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="期望交货时间" prop="wantedDeliveryDate">
|
</el-table-column>
|
<el-table-column label="备注" show-overflow-tooltip prop="remark">
|
</el-table-column>
|
<el-table-column
|
header-align="center"
|
align="center"
|
label="操作"
|
fixed="right"
|
width="100"
|
v-if="stateVisible"
|
>
|
<template slot-scope="scope">
|
<el-button
|
v-if="!scope.row.visible"
|
type="text"
|
size="small"
|
icon="el-icon-edit"
|
@click="showUpdate(scope.row)"
|
>修改数量
|
</el-button>
|
<el-button
|
v-if="scope.row.visible"
|
type="text"
|
size="small"
|
@click="updateQtyPlaned(scope.row)"
|
>保存
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="info" @click="visible = false">关闭</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
|
<script>
|
import { updateQtyPlaned } from '@/api/plan/masterproductionschedule'
|
import { loadMasterPlanSourceByCustomer } from '../../../api/plan/masterproductionschedule'
|
|
export default {
|
data() {
|
return {
|
visible: false,
|
state: '',
|
masterPlanSourceDataList: []
|
}
|
},
|
methods: {
|
init(id, state) {
|
this.visible = true
|
this.state = state
|
this.$nextTick(() => {
|
loadMasterPlanSourceByCustomer(id).then((res) => {
|
this.masterPlanSourceDataList = res.data.data
|
})
|
})
|
},
|
showUpdate(row) {
|
this.$set(row, 'visible', true)
|
},
|
updateQtyPlaned(row) {
|
updateQtyPlaned(row).then((res) => {
|
this.$message.success('修改成功')
|
this.$set(row, 'visible', false)
|
this.$emit('refreshDataList')
|
})
|
}
|
},
|
computed: {
|
stateVisible() {
|
if (this.state && this.state === '01pending') {
|
return true
|
}
|
return false
|
}
|
}
|
}
|
</script>
|
<style>
|
.source-table-calss .el-table__body-wrapper {
|
height: auto;
|
}
|
</style>
|