7 changed files with 673 additions and 165 deletions
-
2src/api/base/properties.js
-
1src/api/part/umInformation.js
-
2src/views/modules/quotation/sellForQuotation/quotationDetail.vue
-
49src/views/modules/test/requestForTest.vue
-
354src/views/modules/test/testSoAttribute/testAttribute.vue
-
150src/views/modules/test/testSoBom/testTable.vue
-
276src/views/modules/test/testSoRouting/testRoutingTable.vue
@ -0,0 +1,354 @@ |
|||||
|
<script> |
||||
|
import {propertiesList,searchModalDetails,partPropertiesList} from "../../../../api/base/properties"; |
||||
|
|
||||
|
export default { |
||||
|
name: "testAttribute", |
||||
|
props:{ |
||||
|
testNo:{ |
||||
|
type:String, |
||||
|
}, |
||||
|
height:{ |
||||
|
type: Number, |
||||
|
default:300 |
||||
|
}, |
||||
|
attributeList:{ |
||||
|
type:Array |
||||
|
} |
||||
|
}, |
||||
|
data(){ |
||||
|
return{ |
||||
|
propertiesDialog:false,//模板属性弹框 |
||||
|
attributeDialog:false,// 选择模板弹框 |
||||
|
templateSearchData:{ |
||||
|
site:this.$store.state.user.site, |
||||
|
codeNo:undefined, |
||||
|
codeDesc:undefined, |
||||
|
functionType:'IP', |
||||
|
},//模板搜索条件 |
||||
|
currentRow:{}, |
||||
|
templateList:[],//模板集合 |
||||
|
propertiesList:[], // 模板属性集合 |
||||
|
attributeColumnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableValueType', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "模板表", |
||||
|
columnProp: 'codeNo', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '模板编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableValueType', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "模板表", |
||||
|
columnProp: 'codeDesc', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '模板名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableValueType', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "模板表", |
||||
|
columnProp: 'functionType', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '模板类型', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
], |
||||
|
productColumnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableValueType', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "属性表", |
||||
|
columnProp: 'itemNo', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '属性编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableValueType', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "属性表", |
||||
|
columnProp: 'itemDesc', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '属性名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableValueType', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "属性表", |
||||
|
columnProp: 'valueType', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '值类型', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableDefaultValue', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "属性表", |
||||
|
columnProp: 'defaultValue', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '参照值', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableMaxValue', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "属性表", |
||||
|
columnProp: 'maxValue', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '最大值', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableMinValue', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "属性表", |
||||
|
columnProp: 'minValue', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '最小值', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 100002001, |
||||
|
serialNumber: '100002001TableValueChooseFlag', |
||||
|
tableId: "100002001Table", |
||||
|
tableName: "属性表", |
||||
|
columnProp: 'valueChooseFlag', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '是否值可选', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
], |
||||
|
} |
||||
|
}, |
||||
|
methods:{ |
||||
|
attributeSearch(){ |
||||
|
this.templateList = []; |
||||
|
this.currentRow = {}; |
||||
|
propertiesList(this.templateSearchData).then(({data})=>{ |
||||
|
if (data && data.code === 0){ |
||||
|
this.templateList = data.data; |
||||
|
}else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}).catch((error)=>{ |
||||
|
this.$message.error(error) |
||||
|
}) |
||||
|
}, |
||||
|
openAttribute(row){ |
||||
|
this.propertiesList = []; |
||||
|
this.propertiesDialog = true; |
||||
|
searchModalDetails(row).then(({data})=>{ |
||||
|
if (data && data.code === 0){ |
||||
|
this.propertiesList = data.rows |
||||
|
}else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}).catch((error)=>{ |
||||
|
this.$message.error(error) |
||||
|
}) |
||||
|
}, |
||||
|
openAttributeDialog(){ |
||||
|
this.attributeSearch() |
||||
|
}, |
||||
|
rowStyle({row}){ |
||||
|
if (this.currentRow.codeNo === row.codeNo) { |
||||
|
return { 'background-color': '#84f5e9', cursor: 'pointer' }; |
||||
|
} |
||||
|
return { 'background-color': '#ffffff', cursor: 'pointer' }; |
||||
|
}, |
||||
|
clickRow(row){ |
||||
|
this.currentRow = {...row} |
||||
|
this.attributeDialog = false |
||||
|
}, |
||||
|
closeAttributeDialog(){ |
||||
|
this.currentRow = {} |
||||
|
this.propertiesList = []; |
||||
|
this.templateList = []; |
||||
|
this.propertiesDialog = false; |
||||
|
this.templateSearchData={ |
||||
|
site:this.$store.state.user.site, |
||||
|
codeNo:undefined, |
||||
|
codeDesc:undefined, |
||||
|
functionType:'IP', |
||||
|
}; |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<div> |
||||
|
<el-button type="primary" @click="attributeDialog = true" v-if="false">选择模板</el-button> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="attributeList" |
||||
|
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="模板列表" append-to-body v-drag :visible.sync="attributeDialog" @open="openAttributeDialog" @close="closeAttributeDialog" width="40%"> |
||||
|
<el-form :inline="true" label-position="top" ref="searchTemplateForm" :model="templateSearchData"> |
||||
|
<el-form-item label="模板编码"> |
||||
|
<el-input v-model="templateSearchData.codeNo" clearable></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="模板名称"> |
||||
|
<el-input v-model="templateSearchData.codeDesc" clearable></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="attributeSearch">查 询</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-table |
||||
|
height="400" |
||||
|
:data="templateList" |
||||
|
border :row-style="{cursor:'pointer'}" |
||||
|
@row-dblclick="clickRow" |
||||
|
style="width: 100%;margin-top: 10px"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in attributeColumnList" :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-column label="操作" align="center"> |
||||
|
<template slot-scope="{row,$index}"> |
||||
|
<el-link style="cursor:pointer;" @click="openAttribute(row)">详情</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-dialog> |
||||
|
<el-dialog title="属性列表" append-to-body top="17vh" v-drag :visible.sync="propertiesDialog" width="40%"> |
||||
|
<el-table |
||||
|
height="400" |
||||
|
:data="propertiesList" |
||||
|
border |
||||
|
style="width: 100%;margin-top: 10px"> |
||||
|
<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> |
||||
|
<div style="width: 100%;height: 20px"></div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue