设备管理-检查项维护(新增)

yangwl
wws 1 year ago
parent d275564d22
commit 3ad5c53ca4

@ -1,95 +1,97 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label-width="90px" label="检查项编码" prop="itemCode"> <el-form-item label-width="90px" label="检查项编码" prop="itemCode">
<el-input <el-input
v-model="queryParams.itemCode" v-model="queryParams.itemCode"
placeholder="请输入检查项编码" placeholder="请输入检查项编码"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label-width="60px" label="检查项" prop="itemName"> <el-form-item label-width="60px" label="检查项" prop="itemName">
<el-input <el-input
v-model="queryParams.itemName" v-model="queryParams.itemName"
placeholder="请输入检查项名称" placeholder="请输入检查项名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label-width="120px" label="检查项方法/工具" prop="itemMethod"> <el-form-item label-width="120px" label="检查项方法/工具" prop="itemMethod">
<el-input
v-model="queryParams.itemMethod"
placeholder="请输入检查项方法/工具"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维护类型" prop="itemType">
<el-input <el-input
v-model="queryParams.itemType" v-model="queryParams.itemMethod"
placeholder="请输入维护类型" placeholder="请输入检查项方法/工具"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="false" label="维护类型名称" prop="itemTypeName"> <el-form-item label="维护类型" prop="itemType">
<el-input <el-select v-model="queryParams.itemType" placeholder="请选择维护类型" clearable>
<el-option
v-for="dict in dict.type.device_item_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="false" label="维护类型名称" prop="itemTypeName">
<el-input
class="my-select-input" class="my-select-input"
v-model="queryParams.itemTypeName" v-model="queryParams.itemTypeName"
placeholder="请输入维护类型名称" placeholder="请输入维护类型名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="false" label="检查项备注" prop="itemRemark"> <el-form-item v-if="false" label="检查项备注" prop="itemRemark">
<el-input <el-input
v-model="queryParams.itemRemark" v-model="queryParams.itemRemark"
placeholder="请输入检查项备注" placeholder="请输入检查项备注"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="false" label="工厂" prop="factoryCode"> <el-form-item v-if="false" label="工厂" prop="factoryCode">
<el-input <el-input
v-model="queryParams.factoryCode" v-model="queryParams.factoryCode"
placeholder="请输入工厂" placeholder="请输入工厂"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="false" label="备用字段1" prop="attr1"> <el-form-item v-if="false" label="备用字段1" prop="attr1">
<el-input <el-input
v-model="queryParams.attr1" v-model="queryParams.attr1"
placeholder="请输入备用字段1" placeholder="请输入备用字段1"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="false" label="备用字段2" prop="attr2"> <el-form-item v-if="false" label="备用字段2" prop="attr2">
<el-input <el-input
v-model="queryParams.attr2" v-model="queryParams.attr2"
placeholder="请输入备用字段2" placeholder="请输入备用字段2"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="false" label="备用字段3" prop="attr3"> <el-form-item v-if="false" label="备用字段3" prop="attr3">
<el-input <el-input
v-model="queryParams.attr3" v-model="queryParams.attr3"
placeholder="请输入备用字段3" placeholder="请输入备用字段3"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="false" label="删除标识" prop="delFlag"> <el-form-item v-if="false" label="删除标识" prop="delFlag">
<el-input <el-input
v-model="queryParams.delFlag" v-model="queryParams.delFlag"
placeholder="请输入删除标识" placeholder="请输入删除标识"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="createdBy"> <el-form-item label="创建人" prop="createdBy">
<el-input <el-input
class="my-select-input" class="my-select-input"
@ -99,7 +101,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createdTime"> <el-form-item label="创建时间" prop="createdTime">
<el-date-picker <el-date-picker
v-model="queryParams.createdTimeArray" v-model="queryParams.createdTimeArray"
type="daterange" type="daterange"
@ -111,7 +113,7 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:picker-options="pickerOptions"> :picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updatedBy"> <el-form-item label="更新人" prop="updatedBy">
<el-input <el-input
class="my-select-input" class="my-select-input"
@ -121,7 +123,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updatedTime"> <el-form-item label="更新时间" prop="updatedTime">
<el-date-picker <el-date-picker
v-model="queryParams.updateTimeArray" v-model="queryParams.updateTimeArray"
type="daterange" type="daterange"
@ -133,135 +135,148 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:picker-options="pickerOptions"> :picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain plain
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['device:item:add']" v-hasPermi="['device:item:add']"
>新增</el-button> >新增
</el-col> </el-button>
<el-col :span="1.5"> </el-col>
<el-button <el-col :span="1.5">
type="success" <el-button
plain type="success"
icon="el-icon-edit" plain
size="mini" icon="el-icon-edit"
:disabled="single" size="mini"
@click="handleUpdate" :disabled="single"
v-hasPermi="['device:item:edit']" @click="handleUpdate"
>修改</el-button> v-hasPermi="['device:item:edit']"
</el-col> >修改
<el-col :span="1.5"> </el-button>
<el-button </el-col>
type="danger" <el-col :span="1.5">
plain <el-button
icon="el-icon-delete" type="danger"
size="mini" plain
:disabled="multiple" icon="el-icon-delete"
@click="handleDelete" size="mini"
v-hasPermi="['device:item:remove']" :disabled="multiple"
>删除</el-button> @click="handleDelete"
</el-col> v-hasPermi="['device:item:remove']"
<el-col :span="1.5"> >删除
<el-button </el-button>
type="warning" </el-col>
plain <el-col :span="1.5">
icon="el-icon-download" <el-button
size="mini" type="warning"
@click="handleExport" plain
v-hasPermi="['device:item:export']" icon="el-icon-download"
>导出</el-button> size="mini"
</el-col> @click="handleExport"
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> v-hasPermi="['device:item:export']"
</el-row> >导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="itemList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="itemList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<el-table-column v-if="false" label="主键" align="center" prop="itemId" /> <el-table-column v-if="false" label="主键" align="center" prop="itemId"/>
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column> <el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column label="检查项编码" align="center" prop="itemCode" /> <el-table-column label="检查项编码" align="center" prop="itemCode"/>
<el-table-column label="检查项" align="center" prop="itemName" /> <el-table-column label="检查项" align="center" prop="itemName"/>
<el-table-column label="方法/工具" align="center" prop="itemMethod" /> <el-table-column label="方法/工具" align="center" prop="itemMethod"/>
<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="factoryCode" /> <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"/>
<el-table-column v-if="false" label="删除标识" align="center" prop="delFlag" /> <el-table-column v-if="false" label="删除标识" align="center" prop="delFlag"/>
<el-table-column label="创建时间" align="center" prop="createdTime" width="180"> <el-table-column label="创建时间" align="center" prop="createdTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建人" align="center" prop="createdBy" /> <el-table-column label="创建人" align="center" prop="createdBy"/>
<el-table-column label="更新时间" align="center" prop="updatedTime" width="180"> <el-table-column label="更新时间" align="center" prop="updatedTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.updatedTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.updatedTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="更新人" align="center" prop="updatedBy" /> <el-table-column label="更新人" align="center" prop="updatedBy"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['device:item:edit']" v-hasPermi="['device:item:edit']"
>修改</el-button> >修改
<el-button </el-button>
size="mini" <el-button
type="text" size="mini"
icon="el-icon-delete" type="text"
@click="handleDelete(scope.row)" icon="el-icon-delete"
v-hasPermi="['device:item:remove']" @click="handleDelete(scope.row)"
>删除</el-button> v-hasPermi="['device:item:remove']"
</template> >删除
</el-table-column> </el-button>
</el-table> </template>
</el-table-column>
</el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改检查项维护对话框 --> <!-- 添加或修改检查项维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="addrules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<!-- 第一行 --> <!-- 第一行 -->
<el-row> <el-row>
<!-- 第一列 --> <!-- 第一列 -->
<el-col :span="6"> <el-col :span="6">
<el-form-item label="检查项" prop="prodCode"> <el-form-item label="检查项">
<el-input v-model="input" placeholder="请输入检查项"></el-input> <el-input v-model="form.itemName" placeholder="请输入检查项"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 第二列 --> <!-- 第二列 -->
<el-col :span="6"> <el-col :span="6">
<el-form-item label="维护类型" prop="prodCode"> <el-form-item label="维护类型">
<el-input v-model="input" placeholder="请输入输入维护类型"></el-input> <el-select v-model="form.itemType" placeholder="请选择维护类型" clearable>
<el-option
v-for="dict in dict.type.device_item_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 第三列 --> <!-- 第三列 -->
<el-col :span="7"> <el-col :span="7">
<el-form-item label-width="100px" label="检查方法/工具" prop="prodCode"> <el-form-item label-width="100px" label="检查方法/工具">
<el-input v-model="input" placeholder="请输入检查方法/工具"></el-input> <el-input v-model="form.itemMethod" placeholder="请输入检查方法/工具"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -270,17 +285,17 @@
<!-- 标准类型 --> <!-- 标准类型 -->
<el-row> <el-row>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="标准类型" prop="prodCode"> <el-form-item label="标准类型">
<el-radio v-model="item.standardType" label="1"></el-radio> <el-radio v-model="item.standardType" label="qualitative"></el-radio>
<el-radio v-model="item.standardType" label="2"></el-radio> <el-radio v-model="item.standardType" label="quantify"></el-radio>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 单选-动态表单 --> <!-- 单选-动态表单 -->
<el-row v-if="item.standardType === '1'"> <el-row v-if="item.standardType === 'qualitative'">
<el-col :span="6"> <el-col :span="6">
<el-form-item label-width="100px" label="标准名称" prop="prodCode"> <el-form-item label-width="100px" label="标准名称">
<el-input v-model="input" placeholder="请输入标准名称"></el-input> <el-input v-model="item.standardName" placeholder="请输入标准名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 操作 --> <!-- 操作 -->
@ -293,23 +308,23 @@
</el-row> </el-row>
<el-row v-else> <el-row v-else>
<el-col :span="6"> <el-col :span="6">
<el-form-item label-width="100px" label="标准名称" prop="prodCode"> <el-form-item label-width="100px" label="标准名称">
<el-input v-model="input" placeholder="请输入标准名称"></el-input> <el-input v-model="item.standardName" placeholder="请输入标准名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="上限" prop="prodCode"> <el-form-item label="上限">
<el-input v-model="input" placeholder="请输入上限"></el-input> <el-input v-model="item.detailUpLimit" placeholder="请输入上限"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="下限" prop="prodCode"> <el-form-item label="下限">
<el-input v-model="input" placeholder="请输入下限"></el-input> <el-input v-model="item.detailDownLimit" placeholder="请输入下限"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="单位" prop="prodCode"> <el-form-item label="单位">
<el-input v-model="input" placeholder="请输入单位"></el-input> <el-input v-model="item.detailUnit" placeholder="请输入单位"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 操作 --> <!-- 操作 -->
@ -322,29 +337,33 @@
</el-row> </el-row>
</div> </div>
<!-- 备注 --> <!-- 备注 -->
<el-form-item label="备注" prop="prodCode"> <el-form-item label="备注">
<el-input v-model="input" placeholder="请输入备注"></el-input> <el-input v-model="form.itemRemark" 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">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listItem, getItem, delItem, addItem, updateItem } from "@/api/device/item"; import {listItem, getItem, delItem, addItem, updateItem} from "@/api/device/item";
export default { export default {
name: "Item", name: "Item",
data() { dicts: ['device_item_type'],
return { data() {
return {
// //
formStandard: [{ formStandard: [{
standardType: '1', standardType: 'qualitative',
value1: null, standardName: null,
detailUpLimit: null,
detailDownLimit: null,
detailUnit: null,
}], }],
// //
pickerOptions: { pickerOptions: {
@ -374,183 +393,203 @@ export default {
} }
}] }]
}, },
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
itemList: [], itemList: [],
// //
title: "", title: "",
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
itemCode: null, itemCode: null,
itemName: null, itemName: null,
itemMethod: null, itemMethod: null,
itemType: null, itemType: null,
itemTypeName: null, itemTypeName: null,
itemRemark: null, itemRemark: null,
factoryCode: null, factoryCode: null,
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,
delFlag: null, delFlag: null,
createdTime: null, createdTime: null,
createdBy: null, createdBy: null,
updatedTime: null, updatedTime: null,
updatedBy: null, updatedBy: null,
createdTimeArray: [], createdTimeArray: [],
updateTimeArray: [], updateTimeArray: [],
}, },
// //
form: {}, form: {
// itemName: null,
rules: { itemType: null,
itemName: [ itemMethod: null,
{ required: true, message: "检查项名称不能为空", trigger: "blur" } itemRemark: null,
], formStandard: [],
itemMethod: [ },
{ required: true, message: "检查项方法/工具不能为空", trigger: "blur" } //
], rules: {
} itemName: [
}; {required: true, message: "检查项名称不能为空", trigger: "blur"}
}, ],
created() { itemMethod: [
this.getList(); {required: true, message: "检查项方法/工具不能为空", trigger: "blur"}
}, ],
methods: { }
};
},
created() {
this.getList();
},
methods: {
// //
addStandard() { addStandard() {
this.formStandard.push({standardType: '2', value1: ''}) this.formStandard.push({standardType: 'qualitative', standardName: null, detailUpLimit: null, detailDownLimit: null, detailUnit: null,})
}, },
// //
removeStandard(index) { removeStandard(index) {
this.formStandard.splice(index, 1) this.formStandard.splice(index, 1)
}, },
/** 查询检查项维护列表 */ /** 查询检查项维护列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listItem(this.queryParams).then(response => { listItem(this.queryParams).then(response => {
this.itemList = response.rows; this.itemList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
// //
reset() { reset() {
this.form = { this.form = {
itemId: null, itemId: null,
itemCode: null, itemCode: null,
itemName: null, itemName: null,
itemMethod: null, itemMethod: null,
itemType: null, itemType: null,
itemTypeName: null, itemTypeName: null,
itemRemark: null, itemRemark: null,
factoryCode: null, factoryCode: null,
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,
delFlag: null, delFlag: null,
createdTime: null, createdTime: null,
createdBy: null, createdBy: null,
updatedTime: null, updatedTime: null,
updatedBy: null, updatedBy: null,
}; formStandard: [],
this.resetForm("form"); };
}, this.formStandard = [{
/** 搜索按钮操作 */ standardType: 'qualitative',
handleQuery() { standardName: null,
this.queryParams.pageNum = 1; detailUpLimit: null,
this.getList(); detailDownLimit: null,
}, detailUnit: null,
/** 重置按钮操作 */ }];
resetQuery() { this.resetForm("form");
this.resetForm("queryForm"); },
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
// //
this.queryParams.createdTimeArray = []; this.queryParams.createdTimeArray = [];
this.queryParams.updateTimeArray = []; this.queryParams.updateTimeArray = [];
this.handleQuery(); this.handleQuery();
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.itemId) this.ids = selection.map(item => item.itemId)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加检查项维护"; this.title = "新增检查项";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); console.log("这里这里")
const itemId = row.itemId || this.ids this.reset();
getItem(itemId).then(response => { const itemId = row.itemId || this.ids
this.form = response.data; getItem(itemId).then(response => {
this.open = true; this.form = response.data;
this.title = "修改检查项维护"; console.log(response.data)
}); this.open = true;
}, this.title = "修改检查项";
/** 提交按钮 */ });
submitForm() { },
this.$refs["form"].validate(valid => { /** 提交按钮 */
if (valid) { submitForm() {
if (this.form.itemId != null) { this.$refs["form"].validate(valid => {
updateItem(this.form).then(response => { if (valid) {
this.$modal.msgSuccess("修改成功"); if (this.form.itemId != null) {
this.open = false; updateItem(this.form).then(response => {
this.getList(); this.$modal.msgSuccess("修改成功");
}); this.open = false;
} else { this.getList();
addItem(this.form).then(response => { });
this.$modal.msgSuccess("新增成功"); } else {
this.open = false; console.log("这里是新增数据")
this.getList(); this.form.formStandard = this.formStandard;
}); console.log(this.form)
} addItem(this.form).then(response => {
} this.$modal.msgSuccess("新增成功");
}); this.open = false;
}, this.getList();
/** 删除按钮操作 */ });
handleDelete(row) { }
const itemIds = row.itemId || this.ids; }
this.$modal.confirm('是否确认删除检查项维护编号为"' + itemIds + '"的数据项?').then(function() { });
return delItem(itemIds); },
}).then(() => { /** 删除按钮操作 */
this.getList(); handleDelete(row) {
this.$modal.msgSuccess("删除成功"); const itemIds = row.itemId || this.ids;
}).catch(() => {}); this.$modal.confirm('是否确认删除检查项维护编号为"' + itemIds + '"的数据项?').then(function () {
}, return delItem(itemIds);
/** 导出按钮操作 */ }).then(() => {
handleExport() { this.getList();
this.download('device/item/export', { this.$modal.msgSuccess("删除成功");
...this.queryParams }).catch(() => {
}, `item_${new Date().getTime()}.xlsx`) });
} },
} /** 导出按钮操作 */
handleExport() {
this.download('device/item/export', {
...this.queryParams
}, `item_${new Date().getTime()}.xlsx`)
}
}
}; };
</script> </script>
<style> <style>
.my-select-input{ .my-select-input {
width: 130px; width: 130px;
} }
</style> </style>

Loading…
Cancel
Save