设备管理-检查项维护(新增修改初始化)

master
wws 1 year ago
parent 0c3b2ba35d
commit d275564d22

@ -50,9 +50,9 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="false" label="工厂" prop="factory"> <el-form-item v-if="false" label="工厂" prop="factoryCode">
<el-input <el-input
v-model="queryParams.factory" v-model="queryParams.factoryCode"
placeholder="请输入工厂" placeholder="请输入工厂"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -196,7 +196,7 @@
<el-table-column label="维护类型编码" align="center" prop="itemType" /> <el-table-column label="维护类型编码" align="center" prop="itemType" />
<el-table-column label="维护类型名称" align="center" prop="itemTypeName" /> <el-table-column label="维护类型名称" align="center" prop="itemTypeName" />
<el-table-column label="检查项备注" align="center" prop="itemRemark" /> <el-table-column label="检查项备注" align="center" prop="itemRemark" />
<el-table-column v-if="false" label="工厂" align="center" prop="factory" /> <el-table-column v-if="false" label="工厂" align="center" prop="factoryCode" />
<el-table-column v-if="false" label="备用字段1" align="center" prop="attr1" /> <el-table-column v-if="false" label="备用字段1" align="center" prop="attr1" />
<el-table-column v-if="false" label="备用字段2" align="center" prop="attr2" /> <el-table-column v-if="false" label="备用字段2" align="center" prop="attr2" />
<el-table-column v-if="false" label="备用字段3" align="center" prop="attr3" /> <el-table-column v-if="false" label="备用字段3" align="center" prop="attr3" />
@ -242,59 +242,88 @@
/> />
<!-- 添加或修改检查项维护对话框 --> <!-- 添加或修改检查项维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="addrules" label-width="80px">
<el-form-item label="检查项编码" prop="itemCode"> <!-- 第一行 -->
<el-input v-model="form.itemCode" placeholder="请输入检查项编码" /> <el-row>
<!-- 第一列 -->
<el-col :span="6">
<el-form-item label="检查项" prop="prodCode">
<el-input v-model="input" placeholder="请输入检查项"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检查项名称" prop="itemName"> </el-col>
<el-input v-model="form.itemName" placeholder="请输入检查项名称" /> <!-- 第二列 -->
</el-form-item> <el-col :span="6">
<el-form-item label="检查项方法/工具" prop="itemMethod"> <el-form-item label="维护类型" prop="prodCode">
<el-input v-model="form.itemMethod" placeholder="请输入检查项方法/工具" /> <el-input v-model="input" placeholder="请输入输入维护类型"></el-input>
</el-form-item>
<el-form-item label="维护类型名称" prop="itemTypeName">
<el-input v-model="form.itemTypeName" placeholder="请输入维护类型名称" />
</el-form-item>
<el-form-item label="检查项备注" prop="itemRemark">
<el-input v-model="form.itemRemark" placeholder="请输入检查项备注" />
</el-form-item>
<el-form-item label="工厂" prop="factory">
<el-input v-model="form.factory" placeholder="请输入工厂" />
</el-form-item> </el-form-item>
<el-form-item label="备用字段1" prop="attr1"> </el-col>
<el-input v-model="form.attr1" placeholder="请输入备用字段1" /> <!-- 第三列 -->
<el-col :span="7">
<el-form-item label-width="100px" label="检查方法/工具" prop="prodCode">
<el-input v-model="input" placeholder="请输入检查方法/工具"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备用字段2" prop="attr2"> </el-col>
<el-input v-model="form.attr2" placeholder="请输入备用字段2" /> </el-row>
<!-- 动态表单 -->
<div v-for="(item, index) in formStandard" :key="index">
<!-- 标准类型 -->
<el-row>
<el-col :span="7">
<el-form-item label="标准类型" prop="prodCode">
<el-radio v-model="item.standardType" label="1"></el-radio>
<el-radio v-model="item.standardType" label="2"></el-radio>
</el-form-item> </el-form-item>
<el-form-item label="备用字段3" prop="attr3"> </el-col>
<el-input v-model="form.attr3" placeholder="请输入备用字段3" /> </el-row>
<!-- 单选-动态表单 -->
<el-row v-if="item.standardType === '1'">
<el-col :span="6">
<el-form-item label-width="100px" label="标准名称" prop="prodCode">
<el-input v-model="input" placeholder="请输入标准名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标识" prop="delFlag"> </el-col>
<el-input v-model="form.delFlag" placeholder="请输入删除标识" /> <!-- 操作 -->
<el-col :span="4">
<el-button size="small" v-if="formStandard.length > 1" @click="removeStandard(index)" type="danger">
</el-button>
<el-button size="small" v-if="index === formStandard.length - 1" @click="addStandard" type="primary">
</el-button>
</el-col>
</el-row>
<el-row v-else>
<el-col :span="6">
<el-form-item label-width="100px" label="标准名称" prop="prodCode">
<el-input v-model="input" placeholder="请输入标准名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createdTime"> </el-col>
<el-date-picker clearable <el-col :span="4">
v-model="form.createdTime" <el-form-item label="上限" prop="prodCode">
type="date" <el-input v-model="input" placeholder="请输入上限"></el-input>
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="createdBy"> </el-col>
<el-input v-model="form.createdBy" placeholder="请输入创建人" /> <el-col :span="4">
<el-form-item label="下限" prop="prodCode">
<el-input v-model="input" placeholder="请输入下限"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updatedTime"> </el-col>
<el-date-picker clearable <el-col :span="4">
v-model="form.updatedTime" <el-form-item label="单位" prop="prodCode">
type="date" <el-input v-model="input" placeholder="请输入单位"></el-input>
value-format="yyyy-MM-dd"
placeholder="请选择更新时间">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updatedBy"> </el-col>
<el-input v-model="form.updatedBy" placeholder="请输入更新人" /> <!-- 操作 -->
<el-col :span="4">
<el-button size="small" v-if="formStandard.length > 1" @click="removeStandard(index)" type="danger">
</el-button>
<el-button size="small" v-if="index === formStandard.length - 1" @click="addStandard" type="primary">
</el-button>
</el-col>
</el-row>
</div>
<!-- 备注 -->
<el-form-item label="备注" prop="prodCode">
<el-input v-model="input" placeholder="请输入备注"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -312,6 +341,11 @@ export default {
name: "Item", name: "Item",
data() { data() {
return { return {
//
formStandard: [{
standardType: '1',
value1: null,
}],
// //
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [{
@ -368,7 +402,7 @@ export default {
itemType: null, itemType: null,
itemTypeName: null, itemTypeName: null,
itemRemark: null, itemRemark: null,
factory: null, factoryCode: null,
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,
@ -384,39 +418,12 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
itemCode: [
{ required: true, message: "检查项编码不能为空", trigger: "blur" }
],
itemName: [ itemName: [
{ required: true, message: "检查项名称不能为空", trigger: "blur" } { required: true, message: "检查项名称不能为空", trigger: "blur" }
], ],
itemMethod: [ itemMethod: [
{ required: true, message: "检查项方法/工具不能为空", trigger: "blur" } { required: true, message: "检查项方法/工具不能为空", trigger: "blur" }
], ],
itemType: [
{ required: true, message: "维护类型编码不能为空", trigger: "change" }
],
itemTypeName: [
{ required: true, message: "维护类型名称不能为空", trigger: "blur" }
],
itemRemark: [
{ required: true, message: "检查项备注不能为空", trigger: "blur" }
],
delFlag: [
{ required: true, message: "删除标识不能为空", trigger: "blur" }
],
createdTime: [
{ required: true, message: "创建时间不能为空", trigger: "blur" }
],
createdBy: [
{ required: true, message: "创建人不能为空", trigger: "blur" }
],
updatedTime: [
{ required: true, message: "更新时间不能为空", trigger: "blur" }
],
updatedBy: [
{ required: true, message: "更新人不能为空", trigger: "blur" }
]
} }
}; };
}, },
@ -424,6 +431,14 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
//
addStandard() {
this.formStandard.push({standardType: '2', value1: ''})
},
//
removeStandard(index) {
this.formStandard.splice(index, 1)
},
/** 查询检查项维护列表 */ /** 查询检查项维护列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -448,7 +463,7 @@ export default {
itemType: null, itemType: null,
itemTypeName: null, itemTypeName: null,
itemRemark: null, itemRemark: null,
factory: null, factoryCode: null,
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,

Loading…
Cancel
Save