Browse Source

20241030

java8
qiezi 1 year ago
parent
commit
e54797af5c
  1. 2
      src/api/property/templateDetail.js
  2. 2
      src/views/modules/property/propertyTemplate.vue
  3. 9
      src/views/modules/quote/detail/breakdownCost.vue
  4. 239
      src/views/modules/quote/quoteDetailReport.vue

2
src/api/property/templateDetail.js

@ -11,3 +11,5 @@ export const removePropertyTemplateDetail = (data) => createAPI('/property/templ
export const removeBatchPropertyTemplateDetail = (data) => createAPI('/property/template/detail/batch/remove','post',data)
export const batchUpdatePropertyTemplateDetail = (data) => createAPI('/property/template/detail/batch/update','post',data)
export const queryPropertyTemplateDetailAvailableList = (data) => createAPI('/property/template/detail/available','post',data)

2
src/views/modules/property/propertyTemplate.vue

@ -6,7 +6,6 @@ import {
} from "../../../api/property/template";
import {getSiteAndBuByUserName} from "../../../api/eam/eam";
import BuSelect from "../../../components/selector/select/BuSelect.vue";
import {queryPropertyItemByPage} from "../../../api/property/propertyItem";
import {
batchSavePropertyTemplateDetail, batchUpdatePropertyTemplateDetail,
queryPropertyTemplateDetail,
@ -401,6 +400,7 @@ export default {
}
}else {
this.saveForm = {
buId: '',
codeNo:'',
codeDesc:'',
functionType:'',

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

@ -340,6 +340,14 @@ export default {
},
methods:{
handleQueryQuoteDetailReportOverall(){
if (!this.quoteDetail.id){
this.dataList = []
this.dataListRm = []
this.subtotalCostStd = 0
this.subtotalCostQuote = 0
this.queryLoading = false;
return
}
let params = {
id:this.quoteDetail.id
}
@ -423,7 +431,6 @@ export default {
return;
}
const values = data.map(item => Number(item[column.property]));
console.log(values)
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);

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

@ -4,10 +4,13 @@ import {getSiteAndBuByUserName} from "../../../api/qc/qc";
import {queryQuoteDetailReport} from "../../../api/quote/quoteDetail";
import {getItemListByInquiryPartAndCodeNo} from "../../../api/inquiry/inquiryDetail";
import BreakdownCost from "./detail/breakdownCost.vue";
import BuSelect from "../../../components/selector/select/BuSelect.vue";
import {queryPropertyTemplate} from "../../../api/property/template";
import {queryPropertyTemplateDetailAvailableList} from "../../../api/property/templateDetail";
export default {
name: "quoteDetailReport",
components: {BreakdownCost},
components: {BuSelect, BreakdownCost},
props: {
height: {
type: [String, Number],
@ -17,9 +20,11 @@ export default {
data() {
return {
queryForm: {
buId:undefined,
buId: '',
customerNo: '',
customerDesc:''
customerDesc: '',
partNo: '',
partDesc: ''
},
no: 1,
size: 20,
@ -225,42 +230,6 @@ export default {
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 5013,
serialNumber: '5011Table1UpdateDate',
tableId: '5013Table1',
tableName: '报价信息表',
columnProp: 'updateDate',
headerAlign: 'center',
align: 'center',
columnLabel: '最近更新日期',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
},
{
userId: this.$store.state.user.name,
functionId: 5013,
serialNumber: '5011Table1UpdateBy',
tableId: '5013Table1',
tableName: '报价信息表',
columnProp: 'updateBy',
headerAlign: 'center',
align: 'left',
columnLabel: '最近更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 5013,
@ -283,7 +252,16 @@ export default {
currentRow: {},
activeName: 'detail',
inquiryDataList: [],
queryPropertyLoading:false
queryPropertyLoading: false,
propertyVisible: false,
propertyList: [],
currentProperty: {
id: undefined,
codeNo: '',
codeDesc: '',
},
propertyItemList: [],
}
},
methods: {
@ -298,10 +276,16 @@ export default {
})
},
handleQuery() {
let list = [];
if (this.propertyItemList.length > 0){
list = this.propertyItemList.filter(item=>item.textValue || item.numValue);
}
let params = {
...this.queryForm,
no: this.no,
size: this.size
size: this.size,
codeNo:this.currentProperty.codeNo,
list,
}
this.queryLoading = true
queryQuoteDetailReport(params).then(({data}) => {
@ -344,6 +328,7 @@ export default {
},
handleQueryInquiryProperties() {
if (this.currentRow.id === undefined) {
this.inquiryDataList = []
return
}
let params = {
@ -364,7 +349,50 @@ export default {
this.$message.error(error)
this.queryPropertyLoading = false
})
},
handleClickProperty() {
if (!this.queryForm.buId) {
this.$message.warning('请先选择BU')
return
}
// this.handleQueryProperty();
this.propertyVisible = true;
},
handleQueryProperty() {
let params = {
buId: this.queryForm.buId,
createBy: this.$store.state.user.name,
functionType: 'IP'
}
queryPropertyTemplate(params).then(({data}) => {
if (data && data.code === 0) {
this.propertyList = data.rows
if (this.propertyList.length > 0) {
this.currentProperty.id = this.propertyList[0].id
this.currentProperty.codeNo = this.propertyList[0].codeNo
}
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
handleQueryPropertyTemplateDetailAvailableList() {
let params = {
headerId: this.currentProperty.id,
}
this.propertyItemList = []
queryPropertyTemplateDetailAvailableList(params).then(({data}) => {
if (data && data.code === 0) {
this.propertyItemList = data.rows
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
},
created() {
this.getSiteAndBuByUserName();
@ -375,6 +403,19 @@ export default {
if (newVal) {
this.handleQueryInquiryProperties()
}
},
'queryForm.buId'(newVal, oldVal) {
this.currentProperty.id = undefined
this.currentProperty.codeNo = ''
this.propertyItemList = []
if (newVal) {
this.handleQueryProperty();
}
},
'currentProperty.id'(newVal, oldVal) {
if (newVal) {
this.handleQueryPropertyTemplateDetailAvailableList();
}
}
}
}
@ -382,45 +423,52 @@ export default {
<template>
<div>
<div style="width: 1000px">
<div style="width: 1200px">
<el-form :model="queryForm" label-position="top">
<el-row :gutter="20">
<el-col :span="4">
<el-row :gutter="10">
<el-col :span="3">
<el-form-item label="BU">
<el-select v-model="queryForm.buId" placeholder="请选择" clearable style="width: 100%">
<el-option
v-for = "i in userBuList"
:key = "i.id"
:label = "i.buDesc"
:value = "i.id">
</el-option>
</el-select>
<bu-select v-model="queryForm.buId">
<el-option label="全部" value=""></el-option>
</bu-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="3">
<el-form-item label="客户编码">
<el-input v-model="queryForm.customerNo"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="3">
<el-form-item label="客户名称">
<el-input v-model="queryForm.customerDesc"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="3">
<el-form-item label="产品编码">
<el-input v-model="queryForm.partNo"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="产品描述">
<el-input v-model="queryForm.partDesc"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="报价单号">
<el-input v-model="queryForm.quoteVersionNo"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="3">
<el-form-item label=" ">
<el-button type="primary" @click="handleClickProperty">属性</el-button>
<el-button type="primary" @click="handleQuery">查询</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table v-loading="queryLoading" :data="dataList" border :height="height" :row-style="rowStyle" @row-click="handleRowClick">
<el-table v-loading="queryLoading" :data="dataList" border :height="height" :row-style="rowStyle"
@row-click="handleRowClick">
<el-table-column
v-for="(item,index) in columns" :key="index"
:sortable="item.columnSortable"
@ -433,18 +481,20 @@ export default {
:label="item.columnLabel">
<template slot-scope="scope">
<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>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column v-if="false"
fixed="right"
header-align="center"
align="center"
width="100"
label="操作">
<template slot-scope="{row,$index}">
<a>重新报价</a>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- fixed="right"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- width="100"-->
<!-- label="操作">-->
<!-- <template slot-scope="{row,$index}">-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-pagination @size-change="handleSizeChange"
@current-change="handlePageChange"
@ -572,7 +622,8 @@ 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-table :data="inquiryDataList" v-loading="queryPropertyLoading" height="19vh"
style="margin-top: 10px;width: 1000px" 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>
@ -588,6 +639,58 @@ export default {
<breakdown-cost :quote-detail="currentRow" height="36vh"></breakdown-cost>
</el-tab-pane>
</el-tabs>
<el-dialog title="属性详情" v-drag :visible.sync="propertyVisible" :close-on-click-modal="false" append-to-body
width="800px">
<el-form :model="currentProperty" label-position="top">
<el-row :gutter="10">
<el-col :span="4">
<el-form-item label="BU">
<bu-select v-model="queryForm.buId" disabled></bu-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="属性模板">
<el-select v-model="currentProperty.codeNo" style="width: 100%;">
<el-option v-for="item in propertyList" :key="item.id" :label="item.codeDesc" :value="item.codeNo">
<div style="float:left;">{{ item.codeDesc }}</div>
<div style="float:right;">{{ item.codeNo }}</div>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table :data="propertyItemList" border height="300px">
<el-table-column label="属性编码" header-align="center" min-width="120" prop="itemNo"></el-table-column>
<el-table-column label="属性名称" header-align="center" min-width="180" prop="itemDesc"></el-table-column>
<el-table-column label="属性类型" header-align="center" align="center" min-width="80" prop="valueType"></el-table-column>
<el-table-column label="属性值" header-align="center" min-width="140" prop="value">
<template slot-scope="scope">
<template v-if="scope.row.valueTypeDb==='T' && scope.row.valueChooseFlag==='Y'">
<el-select v-model="scope.row['textValue']" placeholder="请选择" style="width: 100%">
<el-option :label="available.availableValue" :value="available.availableValue" :key="available.id" v-for="(available) in scope.row.availableList"></el-option>
</el-select>
</template>
<template v-else-if="scope.row.valueTypeDb==='N' && scope.row.valueChooseFlag==='Y'">
<el-select v-model="scope.row['numValue']" placeholder="请选择" style="width: 100%">
<el-option :label="available.availableValue" :value="available.availableValue" :key="available.id" v-for="(available) in scope.row.availableList"></el-option>
</el-select>
</template>
<template v-else-if="scope.row.valueTypeDb==='T'">
<el-input v-model="scope.row['textValue']"></el-input>
</template>
<template v-else-if="scope.row.valueTypeDb==='N'">
<el-input-number style="width: 100%" :controls="false" :step="0" v-model="scope.row['numValue']"></el-input-number>
</template>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="propertyVisible = false"> </el-button>
<el-button @click="propertyVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>

Loading…
Cancel
Save