|
|
|
@ -1,14 +1,109 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div style="margin-top: 5px"> |
|
|
|
<el-button type="primary" @click="clickSaveBtn" v-if="orderNo">新增</el-button> |
|
|
|
<el-button type="primary" :loading="loading" v-if="orderNo" @click="clickSave">{{ attributeDialog?'编辑':'保存' }}</el-button> |
|
|
|
<!-- <el-button type="primary" @click="refreshPropertiesModal" v-if="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.valueTypeDb==='T'?scope.row.textValue:scope.row.numValue}} |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<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.textValue" v-else></el-input> |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
|
<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.availableValueList" :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.availableValueList" :key="key"></el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</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="dataList2" |
|
|
|
:data-list="searchDataList" |
|
|
|
@add="saveTestPropertiesItem" |
|
|
|
@delete="removeTestPropertiesItem" |
|
|
|
@search="searchAttributeList"></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> |
|
|
|
</template>dataList2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
import {propertiesList,refreshPropertiesModal,updatePropertiesList,getPropertiesListByPartAndCodeNo} from "@/api/base/properties.js"; |
|
|
|
import {propertiesList,refreshPropertiesModal,updatePropertiesList,getPropertiesListByPartAndCodeNo |
|
|
|
,searchPropertiesItemList |
|
|
|
|
|
|
|
} from "@/api/base/properties.js"; |
|
|
|
import { |
|
|
|
removeTestPropertiesItem, |
|
|
|
saveTestPropertiesItem, searchTestPropertiesItemList, |
|
|
|
updateTestPropertiesList |
|
|
|
} from "@/api/test/testProperties.js"; |
|
|
|
import TransferTable from "../common/transferTable.vue"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
name: "orderAttribute", |
|
|
|
components: {TransferTable}, |
|
|
|
props:{ |
|
|
|
orderNo:{ |
|
|
|
type:String, |
|
|
|
@ -171,6 +266,7 @@ export default { |
|
|
|
], |
|
|
|
searchDataList:[], |
|
|
|
dataList:[], |
|
|
|
dataList2:[], |
|
|
|
} |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
@ -219,6 +315,10 @@ export default { |
|
|
|
getPropertiesListByPartAndCodeNo(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.dataList = data.rows; |
|
|
|
this.dataList2 = JSON.parse(JSON.stringify(data.rows)); |
|
|
|
for (let i = 0; i <this.dataList2.length ; i++) { |
|
|
|
this.dataList2[i].itemNo= this.dataList2[i].propertiesItemNo |
|
|
|
} |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
@ -271,7 +371,7 @@ export default { |
|
|
|
saveTestPropertiesItem(arr).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.getTestProperties(params) |
|
|
|
this.getProperties(params) |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
@ -283,7 +383,7 @@ export default { |
|
|
|
removeTestPropertiesItem(params.dataTableList).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.getTestProperties(params) |
|
|
|
this.getProperties(params) |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
@ -298,7 +398,12 @@ export default { |
|
|
|
if (!this.attributeSaveDialog){ |
|
|
|
this.searchDataList = []; |
|
|
|
} |
|
|
|
searchTestPropertiesItemList(params).then(({data}) => { |
|
|
|
let inData={ |
|
|
|
site:this.$store.state.user.site, |
|
|
|
functionType: this.functionType, |
|
|
|
list :this.dataList, |
|
|
|
} |
|
|
|
searchPropertiesItemList(inData).then(({data}) => { |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.searchDataList = data.rows; |
|
|
|
this.attributeSaveDialog = true; |
|
|
|
@ -308,7 +413,25 @@ export default { |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// getPartProperties(){ |
|
|
|
// let params = { |
|
|
|
// site:this.$store.state.user.site, |
|
|
|
// partNo: this.orderNo, |
|
|
|
// codeNo: this.codeNo, |
|
|
|
// functionType: this.functionType, |
|
|
|
// } |
|
|
|
// getItemListsForPartAndCode(params).then(({data})=>{ |
|
|
|
// if (data && data.code === 0){ |
|
|
|
// this.dataList2 = data.rows; |
|
|
|
// }else { |
|
|
|
// this.$message.warning(data.msg) |
|
|
|
// } |
|
|
|
// }).catch((error)=>{ |
|
|
|
// this.$message.error(error) |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
}, |
|
|
|
|
|
|
|
created() { |
|
|
|
@ -317,93 +440,6 @@ export default { |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div style="margin-top: 5px"> |
|
|
|
<!-- <el-button type="primary" @click="clickSaveBtn" v-if="orderNo">新增</el-button>--> |
|
|
|
<el-button type="primary" :loading="loading" v-if="orderNo" @click="clickSave">{{ attributeDialog?'编辑':'保存' }}</el-button> |
|
|
|
<el-button type="primary" @click="refreshPropertiesModal" v-if="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.valueTypeDb==='T'?scope.row.textValue:scope.row.numValue}} |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<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.textValue" v-else></el-input> |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
|
<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.availableValueList" :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.availableValueList" :key="key"></el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</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="saveTestPropertiesItem" |
|
|
|
@delete="removeTestPropertiesItem" |
|
|
|
@search="searchAttributeList"></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> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
.el-input-number /deep/ .el-input__inner { |
|
|
|
|