|
|
|
@ -2,9 +2,9 @@ |
|
|
|
<div class="mod-config"> |
|
|
|
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;" > |
|
|
|
<el-form-item > |
|
|
|
<el-button type="primary" @click="refreshModal()" >更新模板</el-button> |
|
|
|
<el-button type="primary" @click="refreshBMPageModal()" v-if="!ifDisableFlag">更新模板</el-button> |
|
|
|
<el-button type="primary" @click="searchTable()" >刷新数据</el-button> |
|
|
|
<el-button type="primary" @click="newData()" v-if="!ifDisableFlag">新增</el-button> |
|
|
|
<el-button type="primary" @click="saveTable()" v-if="!ifDisableFlag">保存数据</el-button> |
|
|
|
</el-form-item> |
|
|
|
<div class="rq "> |
|
|
|
<el-table |
|
|
|
@ -13,17 +13,17 @@ |
|
|
|
border |
|
|
|
style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
prop="itemNo" |
|
|
|
prop="propertiesItemNo" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
width="60" |
|
|
|
width="100" |
|
|
|
label="属性编码"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="itemDesc" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
width="100" |
|
|
|
width="120" |
|
|
|
label="属性名称"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
@ -33,18 +33,18 @@ |
|
|
|
label="值"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-if="scope.row.valueTypeDb === 'T'&&scope.row.valueChooseFlag === 'N'" v-model="scope.row.textValue" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input> |
|
|
|
<el-input v-if="scope.row.valueTypeDb === 'N'&&scope.row.valueChooseFlag === 'N'" v-model="scope.row.numberValue" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input> |
|
|
|
<el-input v-if="scope.row.valueTypeDb === 'N'&&scope.row.valueChooseFlag === 'N'" v-model="scope.row.numValue" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input> |
|
|
|
<el-select v-if="scope.row.valueTypeDb === 'T'&&scope.row.valueChooseFlag === 'Y'" v-model="scope.row.textValue" placeholder="请选择" style="height: 11px;padding: 0px " allow-create> |
|
|
|
<el-option |
|
|
|
v-for="item in scope.row.availableList" |
|
|
|
v-for="item in scope.row.availableValueList" |
|
|
|
:key="index" |
|
|
|
:label="item.availableValue" |
|
|
|
:value="item.availableValue"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-select v-if="scope.row.valueTypeDb === 'N'&&scope.row.valueChooseFlag === 'Y'" v-model="scope.row.numberValue" placeholder="请选择" style="height: 11px;padding: 0px " allow-create> |
|
|
|
<el-select v-if="scope.row.valueTypeDb === 'N'&&scope.row.valueChooseFlag === 'Y'" v-model="scope.row.numValue" placeholder="请选择" style="height: 11px;padding: 0px " allow-create> |
|
|
|
<el-option |
|
|
|
v-for="item in scope.row.availableList" |
|
|
|
v-for="item in scope.row.availableValueList" |
|
|
|
:key="index" |
|
|
|
:label="item.availableValue" |
|
|
|
:value="item.availableValue"> |
|
|
|
@ -61,7 +61,9 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
searchBMPropertiesValue |
|
|
|
searchBMPropertiesValue, |
|
|
|
saveBMPropertiesValue, |
|
|
|
refreshBMPageModal, |
|
|
|
} from "@/api/sampleManagement/technicalSpecificationList.js" |
|
|
|
|
|
|
|
export default { |
|
|
|
@ -92,12 +94,12 @@ |
|
|
|
methods: { |
|
|
|
//初始化组件的参数 |
|
|
|
init(inData) { |
|
|
|
if(this.dataForm.codeNo!=null&&this.dataForm.codeNo!=''){ |
|
|
|
if(this.searchData.codeNo!=null&&this.searchData.codeNo!=''){ |
|
|
|
return false; |
|
|
|
} |
|
|
|
//初始化参数 |
|
|
|
this.searchData = JSON.parse(JSON.stringify(inData)); |
|
|
|
this.searchData.type= JSON.parse(JSON.stringify(this.type)); |
|
|
|
//this.searchData.type= JSON.parse(JSON.stringify(this.type)); |
|
|
|
//刷新表格 |
|
|
|
this.searchTable(); |
|
|
|
|
|
|
|
@ -105,10 +107,50 @@ |
|
|
|
searchTable(){ |
|
|
|
searchBMPropertiesValue(this.searchData).then(({data}) => { |
|
|
|
this.tableData = data.rows; |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
refreshBMPageModal(){ |
|
|
|
this.$confirm(`是否刷新至最新模板界面,已填数据会更新到新模板中,若旧属性在新模板中被删除,该条数据会消失。`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
refreshBMPageModal(this.searchData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.searchTable(); |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveTable(){ |
|
|
|
saveBMPropertiesValue(this.tableData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |