Browse Source

Merge remote-tracking branch 'origin/master'

java8
yuejiayang 1 year ago
parent
commit
f67a8250eb
  1. 2
      src/api/quote/quoteDetailBom.js
  2. 79
      src/views/modules/quote/detail/primary/quoteDetailBom.vue
  3. 9
      src/views/modules/quote/detail/quoteDetail.vue
  4. 11
      src/views/modules/quote/detail/tpCost.vue
  5. 9
      src/views/modules/quote/quoteDetailReport.vue

2
src/api/quote/quoteDetailBom.js

@ -1,3 +1,5 @@
import {createAPI} from "../../utils/httpRequest";
export const queryQuoteDetailBom = (data) => createAPI("/quote/detail/bom", "post", data);
export const updateQuoteDetailBom = (data) => createAPI("/quote/detail/bom/update", "post", data);

79
src/views/modules/quote/detail/primary/quoteDetailBom.vue

@ -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>

9
src/views/modules/quote/detail/quoteDetail.vue

@ -571,9 +571,10 @@ export default {
</script>
<template>
<div>
<div class="rq">
<el-button type="primary" v-if="!authFlag" :disabled="quote.status === '下达' || !quote.status" @click="handleSaveQuoteDetail(null)">新增</el-button>
<el-table v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height">
<el-table v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height">
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
<el-table-column
v-for="(item,index) in columns" :key="index"
@ -693,10 +694,6 @@ export default {
</template>
<style scoped>
.el-table /deep/ .cell{
height: auto;
line-height: 1.5;
}
.auto /deep/ .el-form-item__content{
height: auto;

11
src/views/modules/quote/detail/tpCost.vue

@ -37,6 +37,15 @@ export default {
this.$message.error(error);
})
},
alignIsNan(key,arr){
for (let i = 0; i < arr.length; i++) {
let item = arr[i];
if (isNaN(item[key])){
return 'left';
}
}
return 'right';
},
flexColumnWidth (str, arr1, flag = 'max') {
str = str + ''
let columnContent = ''
@ -124,7 +133,7 @@ export default {
<template>
<div>
<el-table :data="dataList" border :height="height" v-loading="queryLoading">
<el-table-column v-for="key in objectKeys" header-align="center" :width="flexColumnWidth(key,dataList)" :key="key" :prop="key" :label="key"></el-table-column>
<el-table-column v-for="key in objectKeys" :align="alignIsNan(key,dataList)" header-align="center" :width="flexColumnWidth(key,dataList)" :key="key" :prop="key" :label="key"></el-table-column>
</el-table>
</div>
</template>

9
src/views/modules/quote/quoteDetailReport.vue

@ -640,8 +640,9 @@ export default {
</el-col>
</el-row>
</el-form>
<el-table :data="inquiryDataList" v-loading="queryPropertyLoading" height="19vh"
style="margin-top: 10px;width: 1000px" border>
</el-tab-pane>
<el-tab-pane name="property" label="询价单属性">
<el-table :data="inquiryDataList" v-loading="queryPropertyLoading" height="36vh" border>
<el-table-column label="属性编码" header-align="center" min-width="100" prop="itemNo"></el-table-column>
<el-table-column label="属性名称" header-align="center" min-width="160" prop="itemDesc"></el-table-column>
<el-table-column label="属性类型" header-align="center" min-width="80" prop="valueType"></el-table-column>
@ -720,10 +721,6 @@ export default {
</template>
<style scoped>
.el-table /deep/ .cell {
height: auto;
line-height: 1.5;
}
.auto /deep/ .el-form-item__content {
height: auto;

Loading…
Cancel
Save