|
|
@ -73,7 +73,7 @@ |
|
|
<!-- 子表:物料明细列表 - 始终显示表头 --> |
|
|
<!-- 子表:物料明细列表 - 始终显示表头 --> |
|
|
<div class="sub-title"> |
|
|
<div class="sub-title"> |
|
|
物料明细列表 |
|
|
物料明细列表 |
|
|
<el-button type="primary" class="customer-bun-min" @click="openMaterialDialog()" style="margin-left: 10px;">新增物料</el-button> |
|
|
|
|
|
|
|
|
<el-button v-if="canAddMaterial()" type="primary" class="customer-bun-min" @click="openMaterialDialog()" style="margin-left: 10px;">新增物料</el-button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<el-table |
|
|
<el-table |
|
|
@ -84,8 +84,8 @@ |
|
|
style="width:100%"> |
|
|
style="width:100%"> |
|
|
<el-table-column fixed="right" label="操作" header-align="center" align="center" width="160"> |
|
|
<el-table-column fixed="right" label="操作" header-align="center" align="center" width="160"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-link style="cursor: pointer" @click="openMaterialDialog(scope.row)">编辑 |</el-link> |
|
|
|
|
|
<el-link style="cursor: pointer" @click="deleteMaterial(scope.row)">删除 |</el-link> |
|
|
|
|
|
|
|
|
<el-link v-if="isMaterialEditable(scope.row)" style="cursor: pointer" @click="openMaterialDialog(scope.row)">编辑 |</el-link> |
|
|
|
|
|
<el-link v-if="isMaterialEditable(scope.row)" style="cursor: pointer" @click="deleteMaterial(scope.row)">删除 |</el-link> |
|
|
<el-link style="cursor: pointer" @click="openUploadDialog(scope.row)">附件</el-link> |
|
|
<el-link style="cursor: pointer" @click="openUploadDialog(scope.row)">附件</el-link> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
@ -944,15 +944,29 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 物料操作 |
|
|
// 物料操作 |
|
|
|
|
|
isMaterialEditable(row) { |
|
|
|
|
|
return row && (row.status === '待提交' || row.status === '待报价') |
|
|
|
|
|
}, |
|
|
|
|
|
canAddMaterial() { |
|
|
|
|
|
return this.currentInquiry && (this.currentInquiry.status === '待提交' || this.currentInquiry.status === '待报价') |
|
|
|
|
|
}, |
|
|
openMaterialDialog(row) { |
|
|
openMaterialDialog(row) { |
|
|
if (!this.currentInquiry) { |
|
|
if (!this.currentInquiry) { |
|
|
this.$message.warning('请先选择一个询价单') |
|
|
this.$message.warning('请先选择一个询价单') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (row) { |
|
|
if (row) { |
|
|
|
|
|
if (!this.isMaterialEditable(row)) { |
|
|
|
|
|
this.$message.warning('只有待提交或待报价状态的明细可以编辑') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.materialDialogTitle = '编辑物料' |
|
|
this.materialDialogTitle = '编辑物料' |
|
|
this.materialForm = { ...row } |
|
|
this.materialForm = { ...row } |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
if (!this.canAddMaterial()) { |
|
|
|
|
|
this.$message.warning('当前询价单状态不允许新增物料') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.materialDialogTitle = '新增物料' |
|
|
this.materialDialogTitle = '新增物料' |
|
|
this.materialForm = { |
|
|
this.materialForm = { |
|
|
id: null, |
|
|
id: null, |
|
|
@ -963,7 +977,7 @@ export default { |
|
|
spec: '', |
|
|
spec: '', |
|
|
qty: 0, |
|
|
qty: 0, |
|
|
remark2: '', |
|
|
remark2: '', |
|
|
status: '待提交' |
|
|
|
|
|
|
|
|
status: this.currentInquiry.status === '待报价' ? '待报价' : '待提交' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.materialDialogVisible = true |
|
|
this.materialDialogVisible = true |
|
|
@ -1043,6 +1057,10 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
deleteMaterial(row) { |
|
|
deleteMaterial(row) { |
|
|
|
|
|
if (!this.isMaterialEditable(row)) { |
|
|
|
|
|
this.$message.warning('只有待提交或待报价状态的明细可以删除') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.$confirm('确定删除物料: ' + row.partNo + ' ?', '提示', { type: 'warning' }).then(() => { |
|
|
this.$confirm('确定删除物料: ' + row.partNo + ' ?', '提示', { type: 'warning' }).then(() => { |
|
|
deleteMaterial({ id: row.id }).then(({data}) => { |
|
|
deleteMaterial({ id: row.id }).then(({data}) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
|