|
|
|
@ -6,6 +6,7 @@ import { |
|
|
|
} from "@/api/quote/quoteDetailBomTree"; |
|
|
|
import {queryQuoteDetailBom} from "@/api/quote/quoteDetailBom"; |
|
|
|
import {changeQuoteDetailBomTree} from "../../../../../api/quote/quoteDetailBomTree"; |
|
|
|
import {updateQuoteDetailBom} from "../../../../../api/quote/quoteDetailBom"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "quoteDetailBom", |
|
|
|
@ -164,6 +165,24 @@ export default { |
|
|
|
fixed: '', |
|
|
|
columnWidth: 90, |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5011, |
|
|
|
serialNumber: '5011Table4AttritionRate', |
|
|
|
tableId: "5011Table4", |
|
|
|
tableName: "报价材料信息", |
|
|
|
columnProp: 'attritionRate', |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: '报价成本损耗', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 90, |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 5011, |
|
|
|
@ -272,7 +291,10 @@ export default { |
|
|
|
buNo: '', |
|
|
|
site: '', |
|
|
|
engChgLevel: null, |
|
|
|
} |
|
|
|
}, |
|
|
|
quoteDetailBom:{}, |
|
|
|
quoteDetailBomVisible:false, |
|
|
|
preValue:undefined, |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -438,6 +460,42 @@ export default { |
|
|
|
} |
|
|
|
this.$router.push(params) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleUpdateQuoteDetailBom(row){ |
|
|
|
if (row.attritionRate === undefined || row.attritionRate === null || row.attritionRate <= 0) { |
|
|
|
this.$message.warning('报价成本损耗不能为空或小于等于0'); |
|
|
|
return; |
|
|
|
} |
|
|
|
let params = { |
|
|
|
id:row.id, |
|
|
|
attritionRate:row.attritionRate, |
|
|
|
} |
|
|
|
updateQuoteDetailBom(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.quoteDetailBomVisible = false; |
|
|
|
this.handleQueryQuoteDetailBom(); |
|
|
|
}else{ |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error); |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleClickUpdate(row,column,cell,event){ |
|
|
|
if (column.label === '报价成本损耗'){ |
|
|
|
this.quoteDetailBom = { |
|
|
|
...row, |
|
|
|
} |
|
|
|
this.preValue = row.attritionRate; |
|
|
|
this.quoteDetailBomVisible = true; |
|
|
|
} |
|
|
|
}, |
|
|
|
handleBlur(row){ |
|
|
|
if (row.attritionRate === this.preValue) { |
|
|
|
this.quoteDetailBomVisible = false; |
|
|
|
this.preValue = undefined |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
@ -475,8 +533,15 @@ export default { |
|
|
|
|
|
|
|
</el-tree> |
|
|
|
</el-aside> |
|
|
|
<el-main style="padding: 0"> |
|
|
|
<el-table :data="dataList" v-loading="queryLoading" border style="width: 100%" :height="420"> |
|
|
|
<el-main style="padding: 0" class="rq"> |
|
|
|
<el-table :data="dataList" v-loading="queryLoading" border |
|
|
|
@cell-dblclick="handleClickUpdate" |
|
|
|
style="width: 100%" :height="420"> |
|
|
|
<!-- <el-table-column label="操作" align="center">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <a @click="handleClickUpdate(scope.row)">编辑</a>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columns" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
@ -491,6 +556,9 @@ export default { |
|
|
|
<template v-if="item.columnProp === 'partNo'"> |
|
|
|
<el-link @click="handleJumpToBom(scope.row)">{{ scope.row[item.columnProp] }}</el-link> |
|
|
|
</template> |
|
|
|
<template v-else-if="item.columnProp === 'attritionRate' && quoteDetailBomVisible && scope.row.id === quoteDetailBom.id"> |
|
|
|
<el-input-number v-model="scope.row.attritionRate" @blur="handleBlur(scope.row)" @change="handleUpdateQuoteDetailBom(scope.row)" style="width: 100%" :controls="false" :min="0"></el-input-number> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|
|
|
@ -533,6 +601,11 @@ export default { |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-dialog title="BOM信息" :visible.sync="quoteDetailBomVisible" append-to-body :close-on-click-modal="false" width="450px" v-drag>--> |
|
|
|
|
|
|
|
<!-- </el-dialog>--> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
|