|
|
|
@ -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) |
|
|
|
}) |
|
|
|
}, |
|
|
|
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(){ |
|
|
|
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,17 +282,30 @@ 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> |
|
|
|
|
|
|
|
<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" |
|
|
|
@ -251,13 +322,18 @@ export default { |
|
|
|
: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> |
|
|
|
<el-dialog title="询价单属性" :visible.sync="attributeDialog" @open="openPriceCheckProperties" append-to-body v-drag> |
|
|
|
<div class="rq "> |
|
|
|
</div> |
|
|
|
<div class="rq" v-else> |
|
|
|
<el-table |
|
|
|
:height="height" |
|
|
|
:data="copyAttributeList" |
|
|
|
@ -280,19 +356,14 @@ export default { |
|
|
|
</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> |
|
|
|
<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> |
|
|
|
<el-select style="width: 100%;" :disabled="scope.row.valueType !== '文本'" v-if="item.columnProp === 'textValue'" v-model="scope.row.textValue"> |
|
|
|
<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%;" :disabled="scope.row.valueType === '文本'" v-else v-model="scope.row.numValue"> |
|
|
|
<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> |
|
|
|
@ -301,9 +372,15 @@ export default { |
|
|
|
</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> |
|
|
|
<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> |