9 changed files with 613 additions and 105 deletions
-
5src/api/test/testProperties.js
-
2src/views/modules/base/propertiesItem/propertiesItem.vue
-
71src/views/modules/base/propertiesItem/propertiesModel.vue
-
16src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue
-
39src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue
-
216src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue
-
9src/views/modules/quotation/sellForQuotation/quoteDetail.vue
-
39src/views/modules/test/requestForTest.vue
-
321src/views/modules/test/testAttribute/testProperties.vue
@ -0,0 +1,5 @@ |
|||
import {createAPI} from "../../utils/httpRequest"; |
|||
|
|||
export const getTestPropertiesList = (data)=>createAPI(`/test/properties/list`,'post',data) |
|||
export const updateTestPropertiesList = (data)=>createAPI(`/test/properties/update`,'post',data) |
|||
export const searchTestPropertiesList = (data)=>createAPI(`/test/properties/search`,'post',data) |
|||
@ -0,0 +1,321 @@ |
|||
<script> |
|||
import {searchItemAvailable, searchModalDetails} from "../../../../api/base/properties"; |
|||
import { |
|||
getTestPropertiesList, |
|||
searchTestPropertiesList, |
|||
updateTestPropertiesList |
|||
} from "../../../../api/test/testProperties"; |
|||
|
|||
export default { |
|||
name: "testProperties", |
|||
props:{ |
|||
dataList:{ |
|||
type: Array, |
|||
default: ()=>[], |
|||
}, |
|||
testNo:{ |
|||
type:String, |
|||
}, |
|||
testNumber:{ |
|||
type:[String,Number], |
|||
}, |
|||
columnList:{ |
|||
type: Array, |
|||
default: ()=>[], |
|||
}, |
|||
height:{ |
|||
type:Number, |
|||
default:300 |
|||
}, |
|||
}, |
|||
model:{ |
|||
prop:"dataList", |
|||
event:"change" |
|||
}, |
|||
data(){ |
|||
return{ |
|||
loading:false, |
|||
attributeDialog:false, |
|||
copyAttributeList:[], |
|||
productColumnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 100002001, |
|||
serialNumber: '100002001TableItemNo', |
|||
tableId: "100002001Table", |
|||
tableName: "属性表", |
|||
columnProp: 'itemNo', |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: '属性编码', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 100002001, |
|||
serialNumber: '100002001TableItemDesc', |
|||
tableId: "100002001Table", |
|||
tableName: "属性表", |
|||
columnProp: 'itemDesc', |
|||
headerAlign: "center", |
|||
align: "left", |
|||
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: '', |
|||
columnWidth:80, |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 100002001, |
|||
serialNumber: '100002001TableMinValue', |
|||
tableId: "100002001Table", |
|||
tableName: "属性表", |
|||
columnProp: 'minValue', |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: '最小值', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth:80, |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 100002001, |
|||
serialNumber: '100002001TableMaxValue', |
|||
tableId: "100002001Table", |
|||
tableName: "属性表", |
|||
columnProp: 'maxValue', |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: '最大值', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth:80, |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 100002001, |
|||
serialNumber: '100002001TableMaxValue', |
|||
tableId: "100002001Table", |
|||
tableName: "属性表", |
|||
columnProp: 'textValue', |
|||
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, |
|||
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, |
|||
serialNumber: '100002001TableDefaultValue', |
|||
tableId: "100002001Table", |
|||
tableName: "属性表", |
|||
columnProp: 'defaultValue', |
|||
headerAlign: "center", |
|||
align: "right", |
|||
columnLabel: '参照值', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
}, |
|||
], |
|||
} |
|||
}, |
|||
methods:{ |
|||
openTestProperties(){ |
|||
this.copyAttributeList = JSON.parse(JSON.stringify(this.dataList)) |
|||
}, |
|||
getTestProperties(){ |
|||
let params = { |
|||
site:this.$store.state.user.site, |
|||
testNo: this.testNo |
|||
} |
|||
getTestPropertiesList(params).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
this.$emit("change",data.rows) |
|||
}else { |
|||
this.$message.warning(data.msg) |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error) |
|||
}) |
|||
}, |
|||
updateTestPropertiesList(){ |
|||
updateTestPropertiesList(this.copyAttributeList).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
this.$message.success(data.msg); |
|||
this.getTestProperties(); |
|||
this.attributeDialog = false; |
|||
}else { |
|||
this.$message.warning(data.msg); |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error) |
|||
}) |
|||
}, |
|||
searchTestPropertiesList(){ |
|||
let params = { |
|||
site:this.$store.state.user.site, |
|||
testNo: this.testNo |
|||
} |
|||
this.loading = true |
|||
searchTestPropertiesList(params).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
this.getTestProperties(); |
|||
}else { |
|||
this.$message.warning(data.msg) |
|||
} |
|||
this.loading = false |
|||
}).catch((error)=>{ |
|||
this.loading = false |
|||
this.$message.error(error) |
|||
}) |
|||
} |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div> |
|||
<div style="margin-top: 5px"> |
|||
<el-button type="primary" :loading="loading" @click="searchTestPropertiesList">刷新属性</el-button> |
|||
<el-button type="primary" @click="attributeDialog = true">编辑</el-button> |
|||
</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="openTestProperties" 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> |
|||
<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 === '数字'" :min="scope.row.minValue !== null?scope.row.minValue:Number.MIN_VALUE" :max="scope.row.maxValue !== null?scope.row.maxValue:Number.MAX_VALUE" :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> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<el-footer style="height:30px;text-align:center;margin-top: 8px"> |
|||
<el-button type="primary" @click="updateTestPropertiesList">保存</el-button> |
|||
<el-button type="primary" @click="attributeDialog = false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped> |
|||
.el-input-number /deep/ .el-input__inner { |
|||
text-align: right; |
|||
padding-right: 5px !important; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue