Browse Source

2024-04-09

master
zelian_wu 2 years ago
parent
commit
331d8268ab
  1. 3
      src/api/quotation/priceCheckProperties.js
  2. 270
      src/views/modules/quotation/priceCheckProperties.vue
  3. 13
      src/views/modules/quotation/requestForQuote.vue
  4. 6
      src/views/modules/test/testAttribute/testProperties.vue

3
src/api/quotation/priceCheckProperties.js

@ -3,3 +3,6 @@ import {createAPI} from "../../utils/httpRequest";
export const getPriceCheckPropertiesList = (data)=>createAPI(`/quotation/properties/list`,'post',data)
export const updatePriceCheckPropertiesList = (data)=>createAPI(`/quotation/properties/update`,'post',data)
export const searchPriceCheckPropertiesList = (data)=>createAPI(`/quotation/properties/search`,'post',data)
export const searchPriceCheckPropertiesItemList = (data)=>createAPI(`/quotation/properties/item/list`,'post',data)
export const savePriceCheckPropertiesItem = (data)=>createAPI(`/quotation/properties/item/save`,'post',data)
export const removePriceCheckPropertiesItem = (data)=>createAPI(`/quotation/properties/item/remove`,'post',data)

270
src/views/modules/quotation/priceCheckProperties.vue

@ -1,12 +1,17 @@
<script>
import {
getPriceCheckPropertiesList,
removePriceCheckPropertiesItem,
savePriceCheckPropertiesItem,
searchPriceCheckPropertiesItemList,
searchPriceCheckPropertiesList,
updatePriceCheckPropertiesList,
} from "../../../api/quotation/priceCheckProperties";
import TransferTable from "../common/transferTable.vue";
export default {
name: "priceCheckProperties",
components: {TransferTable},
props:{
dataList:{
type: Array,
@ -30,8 +35,9 @@ export default {
},
data(){
return{
attributeSaveDialog:false,
loading:false,
attributeDialog:false,
attributeDialog:true,
copyAttributeList:[],
productColumnList: [
{
@ -128,25 +134,7 @@ export default {
columnProp: 'textValue',
headerAlign: "center",
align: "left",
columnLabel: '文本值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth:120,
},
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableMinValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'numValue',
headerAlign: "center",
align: "right",
columnLabel: '数字值',
columnLabel: '实测值',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -155,6 +143,24 @@ export default {
fixed: '',
columnWidth:120,
},
// {
// userId: this.$store.state.user.name,
// functionId: 100002001,
// serialNumber: '100002001TableMinValue',
// tableId: "100002001Table",
// tableName: "",
// columnProp: 'numValue',
// headerAlign: "center",
// align: "right",
// columnLabel: '',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth:120,
// },
{
userId: this.$store.state.user.name,
functionId: 100002001,
@ -173,13 +179,59 @@ export default {
fixed: '',
},
],
searchDataList:[],
}
},
methods:{
openPriceCheckProperties(){
this.copyAttributeList = JSON.parse(JSON.stringify(this.dataList))
savePriceCheckPropertiesItem(params){
let i = 0;
let arr = params.searchTableList.map(item=>{
item.quotationNo = this.quotationNo;
item.seqNo = i++;
return item
})
savePriceCheckPropertiesItem(arr).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.getPriceCheckProperties(params);
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error)
})
},
getPriceCheckProperties(){
removePriceCheckPropertiesItem(params){
removePriceCheckPropertiesItem(params.dataTableList).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.getPriceCheckProperties(params);
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error)
})
},
searchPriceCheckPropertiesItemList(value){
let params= JSON.parse(JSON.stringify(value))
params.site=this.$store.state.user.site;
params.list = this.dataList;
if (!this.attributeSaveDialog){
this.searchDataList = [];
}
searchPriceCheckPropertiesItemList(params).then(({data})=>{
if (data && data.code === 0){
this.searchDataList = data.rows;
this.attributeSaveDialog = true;
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
getPriceCheckProperties(searchData){
let params = {
site:this.$store.state.user.site,
quotationNo: this.quotationNo
@ -187,6 +239,11 @@ export default {
getPriceCheckPropertiesList(params).then(({data})=>{
if (data && data.code === 0){
this.$emit("change",data.rows)
if (searchData){
this.$nextTick(()=>{
this.searchPriceCheckPropertiesItemList(searchData);
})
}
}else {
this.$message.warning(data.msg)
}
@ -198,8 +255,9 @@ export default {
updatePriceCheckPropertiesList(this.copyAttributeList).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.$emit("change",this.copyAttributeList)
this.getPriceCheckProperties();
this.attributeDialog = false;
this.attributeDialog = true;
}else {
this.$message.warning(data.msg);
}
@ -224,7 +282,18 @@ export default {
this.loading = false
this.$message.error(error)
})
}
},
saveClick(){
if (this.attributeDialog){
this.copyAttributeList = JSON.parse(JSON.stringify(this.dataList))
this.attributeDialog = false;
}else {
this.updatePriceCheckPropertiesList();
}
},
saveBtnClick(){
this.searchPriceCheckPropertiesItemList({})
},
},
}
</script>
@ -232,78 +301,86 @@ export default {
<template>
<div>
<div style="margin-top: 5px">
<el-button type="primary" :loading="loading" @click="searchPriceCheckPropertiesList">刷新属性</el-button>
<el-button type="primary" @click="attributeDialog = true">编辑</el-button>
<!-- <el-button type="primary" :loading="loading" v-if="quotationNo" @click="searchPriceCheckPropertiesList">刷新属性</el-button>-->
<el-button type="primary" :loading="loading" v-if="quotationNo" @click="saveBtnClick">新增</el-button>
<el-button type="primary" @click="saveClick" v-if="quotationNo">{{ attributeDialog?'编辑':'保存' }}</el-button>
</div>
<div class="rq" v-if="attributeDialog">
<el-table
:height="height"
:data="dataList"
border
style="width: 100%;margin-top: 5px">
<el-table-column
v-for="(item,index) in productColumnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<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>
</div>
<div v-else>
{{scope.row.textValue?scope.row.textValue:scope.row.numValue}}
</div>
</template>
</el-table-column>
</el-table>
</div>
<el-table
:height="height"
:data="dataList"
border
style="width: 100%;margin-top: 5px">
<el-table-column
v-for="(item,index) in productColumnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
: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>
</template>
</el-table-column>
</el-table>
<el-dialog title="询价单属性" :visible.sync="attributeDialog" @open="openPriceCheckProperties" append-to-body v-drag>
<div class="rq ">
<el-table
:height="height"
:data="copyAttributeList"
border
style="width: 100%;margin-top: 5px">
<el-table-column
v-for="(item,index) in productColumnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<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>
<div class="rq" v-else>
<el-table
:height="height"
:data="copyAttributeList"
border
style="width: 100%;margin-top: 5px">
<el-table-column
v-for="(item,index) in productColumnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<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>
</div>
<div v-else>
<div v-if="scope.row.valueChooseFlag !== 'Y'">
<el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueType === '数字'" :controls="false"></el-input-number>
<el-input v-model="scope.row.numValue" v-else></el-input>
</div>
<div v-else>
<div v-if="scope.row.valueChooseFlag !== 'Y'">
<div v-if="item.columnProp !== 'textValue'">
<el-input-number v-model="scope.row.numValue" style="margin-top: -6px;padding: 0;width: 100%" v-if="scope.row.valueType === '数字'" :controls="false"></el-input-number>
<el-input v-model="scope.row.numValue" :disabled="scope.row.valueType !== '数字'" v-else></el-input>
</div>
<div>
<el-input v-model="scope.row.textValue" :disabled="scope.row.valueType === '数字'" v-if="item.columnProp !== 'numValue'"></el-input>
</div>
</div>
<div v-else>
<el-select style="width: 100%;" :disabled="scope.row.valueType !== '文本'" v-if="item.columnProp === 'textValue'" v-model="scope.row.textValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option>
</el-select>
<el-select style="width: 100%;" :disabled="scope.row.valueType === '文本'" v-else v-model="scope.row.numValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option>
</el-select>
</div>
<el-select style="width: 100%;" v-if="scope.row.valueType === '文本'" v-model="scope.row.textValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option>
</el-select>
<el-select style="width: 100%;" v-else v-model="scope.row.numValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option>
</el-select>
</div>
</template>
</el-table-column>
</el-table>
</div>
<el-footer style="height:30px;text-align:center;margin-top: 8px">
<el-button type="primary" @click="updatePriceCheckPropertiesList">保存</el-button>
<el-button type="primary" @click="attributeDialog = false">关闭</el-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog title="属性项目" v-drag :visible.sync="attributeSaveDialog" append-to-body>
<transfer-table v-if="attributeSaveDialog"
v-model="dataList"
:data-list="searchDataList"
@add="savePriceCheckPropertiesItem"
@delete="removePriceCheckPropertiesItem"
@search="searchPriceCheckPropertiesItemList"></transfer-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="attributeSaveDialog = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
@ -314,4 +391,11 @@ export default {
text-align: right;
padding-right: 5px !important;
}
/deep/ .el-input .el-input--medium{
line-height: 20px;
}
/deep/ .el-input-number .el-input--medium{
line-height: 20px;
}
</style>

13
src/views/modules/quotation/requestForQuote.vue

@ -334,7 +334,7 @@
</el-tab-pane>
<el-tab-pane label="采购详细信息" name="materialSourcing">
<div style="height: 260px;overflow-y: auto;overflow-x: hidden">
<el-form ref="editDetailForm" :model="priceCheckDetail" v-if="modalData.flag !== '1'">
<el-form ref="editDetailForm" :model="copyPriceCheckDetail" v-if="modalData.flag !== '1'">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="关联零件号:" prop="associatedPartNo">
@ -756,7 +756,7 @@
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="询价属性" name="priceCheck">
<el-tab-pane label="基本信息" name="priceCheck">
<price-check-properties ref="tabProperties" v-model:data-list="priceCheckPropertiesList"
:quotation-no="quotationCurrentRow.quotationNo" :height="500"></price-check-properties>
</el-tab-pane>
@ -766,6 +766,7 @@
<el-col :span="12">
<el-form-item label="关联零件号:" prop="associatedPartNo">
<el-input
readonly
type="textarea"
v-model="priceCheckDetail.associatedPartNo"
:autosize="{minRows: 3, maxRows: 3}"
@ -776,6 +777,7 @@
<el-col :span="12">
<el-form-item label="所需材料:" prop="materialRequired">
<el-input
readonly
type="textarea"
v-model="priceCheckDetail.materialRequired"
:autosize="{minRows: 3, maxRows: 3}"
@ -786,6 +788,7 @@
<el-col :span="12">
<el-form-item label="年度/月度需求:" prop="yearlyOrMonthlyRequirement">
<el-input
readonly
type="textarea"
v-model="priceCheckDetail.yearlyOrMonthlyRequirement"
:autosize="{minRows: 3, maxRows: 3}"
@ -796,6 +799,7 @@
<el-col :span="12">
<el-form-item label="运行宽度:" prop="runningWidth">
<el-input
readonly
type="textarea"
v-model="priceCheckDetail.runningWidth"
:autosize="{minRows: 3, maxRows: 3}"
@ -1178,6 +1182,7 @@ export default {
},
data() {
return {
copyPriceCheckDetail:{},
priceCheckRule: {
associatedPartNo:[{required: true, message: ' ', trigger: 'change'},],
materialRequired:[{required: true, message: ' ', trigger: 'change'},],
@ -2579,7 +2584,8 @@ export default {
// this.$refs.quotationTable.toggleRowSelection(row)
this.quotationCurrentRow = JSON.parse(JSON.stringify(row))
this.quotationDetailData = row;
this.priceCheckDetail = row.priceCheckDetail
this.priceCheckDetail = JSON.parse(JSON.stringify(row.priceCheckDetail));
this.copyPriceCheckDetail = JSON.parse(JSON.stringify(this.priceCheckDetail));
this.getPriceCheckProperties(row)
},
getPriceCheckProperties(row) {
@ -3210,6 +3216,7 @@ export default {
partName: '',
projectId: '',
}
this.priceCheckDetail = JSON.parse(JSON.stringify(this.copyPriceCheckDetail))
if (this.modalData.flag === '1'){
this.$refs.saveDetailForm.resetFields();
}

6
src/views/modules/test/testAttribute/testProperties.vue

@ -191,7 +191,9 @@ export default {
let params= JSON.parse(JSON.stringify(data))
params.site=this.$store.state.user.site;
params.list = this.dataList;
this.searchDataList = [];
if (!this.attributeSaveDialog){
this.searchDataList = [];
}
searchTestPropertiesItemList(params).then(({data}) => {
if (data && data.code === 0){
this.searchDataList = data.rows;
@ -263,8 +265,8 @@ export default {
this.updateTestPropertiesList();
}else {
this.copyAttributeList = JSON.parse(JSON.stringify(this.dataList))
this.attributeDialog = false;
}
this.attributeDialog = false;
},
clickSaveBtn(){
//

Loading…
Cancel
Save