Merge remote-tracking branch 'origin/master'

master
夜笙歌 11 months ago
commit 8b4c92b690

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询自定义数据维护列表
export function listCustomData(query) {
return request({
url: '/base/customData/list',
method: 'get',
params: query
})
}
// 查询自定义数据维护详细
export function getCustomData(objId) {
return request({
url: '/base/customData/' + objId,
method: 'get'
})
}
// 新增自定义数据维护
export function addCustomData(data) {
return request({
url: '/base/customData',
method: 'post',
data: data
})
}
// 修改自定义数据维护
export function updateCustomData(data) {
return request({
url: '/base/customData',
method: 'put',
data: data
})
}
// 删除自定义数据维护
export function delCustomData(objId) {
return request({
url: '/base/customData/' + objId,
method: 'delete'
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询电检数据记录列表
export function listElectricalInspection(query) {
return request({
url: '/report/electricalInspection/list',
method: 'get',
params: query
})
}
// 查询电检数据记录详细
export function getElectricalInspection(uuid) {
return request({
url: '/report/electricalInspection/' + uuid,
method: 'get'
})
}
// 新增电检数据记录
export function addElectricalInspection(data) {
return request({
url: '/report/electricalInspection',
method: 'post',
data: data
})
}
// 修改电检数据记录
export function updateElectricalInspection(data) {
return request({
url: '/report/electricalInspection',
method: 'put',
data: data
})
}
// 删除电检数据记录
export function delElectricalInspection(uuid) {
return request({
url: '/report/electricalInspection/' + uuid,
method: 'delete'
})
}

@ -0,0 +1,347 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="自定义功能" prop="customFunction">
<el-input
v-model="queryParams.customFunction"
placeholder="请输入自定义功能"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="自定义编号" prop="customCode">
<el-input
v-model="queryParams.customCode"
placeholder="请输入自定义编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['base:customData:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['base:customData:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['base:customData:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['base:customData:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="customDataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="主键标识" align="center" prop="objId" v-if="columns[0].visible"/>
<el-table-column label="自定义数据类型" align="center" prop="customType" v-if="columns[1].visible"/>
<el-table-column label="自定义功能" align="center" prop="customFunction" v-if="columns[2].visible"/>
<el-table-column label="自定义编号" align="center" prop="customCode" v-if="columns[3].visible"/>
<el-table-column label="自定义数据" align="center" prop="customData" v-if="columns[4].visible"
:show-overflow-tooltip="true"
/>
<el-table-column label="排序" align="center" prop="customSort" v-if="columns[5].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[6].visible"/>
<el-table-column label="是否启用" align="center" prop="isFlag" v-if="columns[7].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_flag" :value="scope.row.isFlag"/>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createdBy" v-if="columns[8].visible"/>
<el-table-column label="创建时间" align="center" prop="createdTime" width="180" v-if="columns[9].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新人" align="center" prop="updatedBy" v-if="columns[10].visible"/>
<el-table-column label="更新时间" align="center" prop="updatedTime" width="180" v-if="columns[11].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updatedTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['base:customData:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['base:customData:remove']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改自定义数据维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="自定义功能" prop="customFunction">
<el-input v-model="form.customFunction" placeholder="请输入自定义功能" :disabled="editDisabled"/>
</el-form-item>
<el-form-item label="自定义编号" prop="customCode">
<el-input v-model="form.customCode" placeholder="请输入自定义编号" :disabled="editDisabled"/>
</el-form-item>
<el-form-item label="自定义数据" prop="customData">
<el-input v-model="form.customData" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="排序" prop="customSort">
<el-input v-model="form.customSort" placeholder="请输入排序"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
<el-form-item label="是否启用" prop="isFlag">
<el-radio-group v-model="form.isFlag">
<el-radio
v-for="dict in dict.type.is_flag"
:key="dict.value"
:label="parseInt(dict.value)"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCustomData, getCustomData, delCustomData, addCustomData, updateCustomData } from '@/api/base/customData'
export default {
name: 'CustomData',
dicts: ['is_flag'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
editDisabled: false,
//
total: 0,
//
customDataList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
customType: 1,
customFunction: null,
customCode: null,
customData: null,
customSort: null,
isFlag: null,
createdBy: null,
createdTime: null,
updatedBy: null,
updatedTime: null
},
//
form: {},
//
rules: {},
columns: [
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `自定义数据类型`, visible: false },
{ key: 2, label: `自定义功能`, visible: true },
{ key: 3, label: `自定义编号`, visible: true },
{ key: 4, label: `自定义数据`, visible: true },
{ key: 5, label: `排序`, visible: true },
{ key: 6, label: `备注`, visible: true },
{ key: 7, label: `是否启用`, visible: true },
{ key: 8, label: `创建人`, visible: false },
{ key: 9, label: `创建时间`, visible: false },
{ key: 10, label: `更新人`, visible: false },
{ key: 11, label: `更新时间`, visible: true }
]
}
},
created() {
this.getList()
},
methods: {
/** 查询自定义数据维护列表 */
getList() {
this.loading = true
this.editDisabled = false
listCustomData(this.queryParams).then(response => {
this.customDataList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.editDisabled = false
this.reset()
},
//
reset() {
this.form = {
objId: null,
customType: 1,
customFunction: null,
customCode: null,
customData: null,
customSort: null,
remark: null,
isFlag: 0,
createdBy: null,
createdTime: null,
updatedBy: null,
updatedTime: null
}
this.editDisabled = false
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.objId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加自定义数据维护'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const objId = row.objId || this.ids
getCustomData(objId).then(response => {
this.form = response.data
this.editDisabled = true
this.open = true
this.title = '修改自定义数据维护'
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
//0-MES1-2-
this.form.customType = 1
if (this.form.objId != null) {
updateCustomData(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addCustomData(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const objIds = row.objId || this.ids
this.$modal.confirm('是否确认删除自定义数据维护编号为"' + objIds + '"的数据项?').then(function() {
return delCustomData(objIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 导出按钮操作 */
handleExport() {
this.download('base/customData/export', {
...this.queryParams
}, `customData_${new Date().getTime()}.xlsx`)
}
}
}
</script>

@ -0,0 +1,347 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="自定义功能" prop="customFunction">
<el-input
v-model="queryParams.customFunction"
placeholder="请输入自定义功能"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="自定义编号" prop="customCode">
<el-input
v-model="queryParams.customCode"
placeholder="请输入自定义编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['base:customData:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['base:customData:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['base:customData:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['base:customData:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="customDataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="主键标识" align="center" prop="objId" v-if="columns[0].visible"/>
<el-table-column label="自定义数据类型" align="center" prop="customType" v-if="columns[1].visible"/>
<el-table-column label="自定义功能" align="center" prop="customFunction" v-if="columns[2].visible"/>
<el-table-column label="自定义编号" align="center" prop="customCode" v-if="columns[3].visible"/>
<el-table-column label="自定义数据" align="center" prop="customData" v-if="columns[4].visible"
:show-overflow-tooltip="true"
/>
<el-table-column label="排序" align="center" prop="customSort" v-if="columns[5].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[6].visible"/>
<el-table-column label="是否启用" align="center" prop="isFlag" v-if="columns[7].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_flag" :value="scope.row.isFlag"/>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createdBy" v-if="columns[8].visible"/>
<el-table-column label="创建时间" align="center" prop="createdTime" width="180" v-if="columns[9].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新人" align="center" prop="updatedBy" v-if="columns[10].visible"/>
<el-table-column label="更新时间" align="center" prop="updatedTime" width="180" v-if="columns[11].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updatedTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['base:customData:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['base:customData:remove']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改自定义数据维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="自定义功能" prop="customFunction">
<el-input v-model="form.customFunction" placeholder="请输入自定义功能" :disabled="editDisabled"/>
</el-form-item>
<el-form-item label="自定义编号" prop="customCode">
<el-input v-model="form.customCode" placeholder="请输入自定义编号" :disabled="editDisabled"/>
</el-form-item>
<el-form-item label="自定义数据" prop="customData">
<el-input v-model="form.customData" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="排序" prop="customSort">
<el-input v-model="form.customSort" placeholder="请输入排序"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
<el-form-item label="是否启用" prop="isFlag">
<el-radio-group v-model="form.isFlag">
<el-radio
v-for="dict in dict.type.is_flag"
:key="dict.value"
:label="parseInt(dict.value)"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCustomData, getCustomData, delCustomData, addCustomData, updateCustomData } from '@/api/base/customData'
export default {
name: 'CustomData',
dicts: ['is_flag'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
editDisabled: false,
//
total: 0,
//
customDataList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
customType: 0,
customFunction: null,
customCode: null,
customData: null,
customSort: null,
isFlag: null,
createdBy: null,
createdTime: null,
updatedBy: null,
updatedTime: null
},
//
form: {},
//
rules: {},
columns: [
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `自定义数据类型`, visible: false },
{ key: 2, label: `自定义功能`, visible: true },
{ key: 3, label: `自定义编号`, visible: true },
{ key: 4, label: `自定义数据`, visible: true },
{ key: 5, label: `排序`, visible: true },
{ key: 6, label: `备注`, visible: true },
{ key: 7, label: `是否启用`, visible: true },
{ key: 8, label: `创建人`, visible: false },
{ key: 9, label: `创建时间`, visible: false },
{ key: 10, label: `更新人`, visible: false },
{ key: 11, label: `更新时间`, visible: true }
]
}
},
created() {
this.getList()
},
methods: {
/** 查询自定义数据维护列表 */
getList() {
this.loading = true
this.editDisabled = false
listCustomData(this.queryParams).then(response => {
this.customDataList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.editDisabled = false
this.reset()
},
//
reset() {
this.form = {
objId: null,
customType: 0,
customFunction: null,
customCode: null,
customData: null,
customSort: null,
remark: null,
isFlag: 0,
createdBy: null,
createdTime: null,
updatedBy: null,
updatedTime: null
}
this.editDisabled = false
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.objId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加自定义数据维护'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const objId = row.objId || this.ids
getCustomData(objId).then(response => {
this.form = response.data
this.editDisabled = true
this.open = true
this.title = '修改自定义数据维护'
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
//0-MES1-2-
this.form.customType = 0
if (this.form.objId != null) {
updateCustomData(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addCustomData(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const objIds = row.objId || this.ids
this.$modal.confirm('是否确认删除自定义数据维护编号为"' + objIds + '"的数据项?').then(function() {
return delCustomData(objIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 导出按钮操作 */
handleExport() {
this.download('base/customData/export', {
...this.queryParams
}, `customData_${new Date().getTime()}.xlsx`)
}
}
}
</script>

@ -0,0 +1,347 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="自定义功能" prop="customFunction">
<el-input
v-model="queryParams.customFunction"
placeholder="请输入自定义功能"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="自定义编号" prop="customCode">
<el-input
v-model="queryParams.customCode"
placeholder="请输入自定义编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['base:customData:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['base:customData:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['base:customData:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['base:customData:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="customDataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="主键标识" align="center" prop="objId" v-if="columns[0].visible"/>
<el-table-column label="自定义数据类型" align="center" prop="customType" v-if="columns[1].visible"/>
<el-table-column label="自定义功能" align="center" prop="customFunction" v-if="columns[2].visible"/>
<el-table-column label="自定义编号" align="center" prop="customCode" v-if="columns[3].visible"/>
<el-table-column label="自定义数据" align="center" prop="customData" v-if="columns[4].visible"
:show-overflow-tooltip="true"
/>
<el-table-column label="排序" align="center" prop="customSort" v-if="columns[5].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[6].visible"/>
<el-table-column label="是否启用" align="center" prop="isFlag" v-if="columns[7].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_flag" :value="scope.row.isFlag"/>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createdBy" v-if="columns[8].visible"/>
<el-table-column label="创建时间" align="center" prop="createdTime" width="180" v-if="columns[9].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新人" align="center" prop="updatedBy" v-if="columns[10].visible"/>
<el-table-column label="更新时间" align="center" prop="updatedTime" width="180" v-if="columns[11].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updatedTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['base:customData:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['base:customData:remove']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改自定义数据维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="自定义功能" prop="customFunction">
<el-input v-model="form.customFunction" placeholder="请输入自定义功能" :disabled="editDisabled"/>
</el-form-item>
<el-form-item label="自定义编号" prop="customCode">
<el-input v-model="form.customCode" placeholder="请输入自定义编号" :disabled="editDisabled"/>
</el-form-item>
<el-form-item label="自定义数据" prop="customData">
<el-input v-model="form.customData" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="排序" prop="customSort">
<el-input v-model="form.customSort" placeholder="请输入排序"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
<el-form-item label="是否启用" prop="isFlag">
<el-radio-group v-model="form.isFlag">
<el-radio
v-for="dict in dict.type.is_flag"
:key="dict.value"
:label="parseInt(dict.value)"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCustomData, getCustomData, delCustomData, addCustomData, updateCustomData } from '@/api/base/customData'
export default {
name: 'CustomData',
dicts: ['is_flag'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
editDisabled: false,
//
total: 0,
//
customDataList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
customType: 2,
customFunction: null,
customCode: null,
customData: null,
customSort: null,
isFlag: null,
createdBy: null,
createdTime: null,
updatedBy: null,
updatedTime: null
},
//
form: {},
//
rules: {},
columns: [
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `自定义数据类型`, visible: false },
{ key: 2, label: `自定义功能`, visible: true },
{ key: 3, label: `自定义编号`, visible: true },
{ key: 4, label: `自定义数据`, visible: true },
{ key: 5, label: `排序`, visible: true },
{ key: 6, label: `备注`, visible: true },
{ key: 7, label: `是否启用`, visible: true },
{ key: 8, label: `创建人`, visible: false },
{ key: 9, label: `创建时间`, visible: false },
{ key: 10, label: `更新人`, visible: false },
{ key: 11, label: `更新时间`, visible: true }
]
}
},
created() {
this.getList()
},
methods: {
/** 查询自定义数据维护列表 */
getList() {
this.loading = true
this.editDisabled = false
listCustomData(this.queryParams).then(response => {
this.customDataList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.editDisabled = false
this.reset()
},
//
reset() {
this.form = {
objId: null,
customType: 2,
customFunction: null,
customCode: null,
customData: null,
customSort: null,
remark: null,
isFlag: 0,
createdBy: null,
createdTime: null,
updatedBy: null,
updatedTime: null
}
this.editDisabled = false
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.objId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加自定义数据维护'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const objId = row.objId || this.ids
getCustomData(objId).then(response => {
this.form = response.data
this.editDisabled = true
this.open = true
this.title = '修改自定义数据维护'
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
//0-MES1-2-
this.form.customType = 2
if (this.form.objId != null) {
updateCustomData(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addCustomData(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const objIds = row.objId || this.ids
this.$modal.confirm('是否确认删除自定义数据维护编号为"' + objIds + '"的数据项?').then(function() {
return delCustomData(objIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 导出按钮操作 */
handleExport() {
this.download('base/customData/export', {
...this.queryParams
}, `customData_${new Date().getTime()}.xlsx`)
}
}
}
</script>

@ -0,0 +1,418 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!-- <el-form-item label="测试总结果" prop="result">-->
<!-- <el-input-->
<!-- v-model="queryParams.result"-->
<!-- placeholder="请输入测试总结果"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="产品条码" prop="barcode">
<el-input
v-model="queryParams.barcode"
placeholder="请输入产品条码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="记录时间">
<el-date-picker
v-model="daterangeRecordTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['report:electricalInspection:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['report:electricalInspection:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['report:electricalInspection:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['report:electricalInspection:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="electricalInspectionList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="唯一标识" align="center" prop="uuid" v-if="columns[0].visible"/>
<el-table-column label="测试总结果" align="center" prop="result" v-if="columns[1].visible"/>
<el-table-column label="产品条码" align="center" prop="barcode" v-if="columns[2].visible"/>
<el-table-column label="测试时间" align="center" prop="testTime" v-if="columns[3].visible"/>
<el-table-column label="测试数据" align="center" prop="testData" v-if="columns[4].visible"/>
<el-table-column label="记录时间" align="center" prop="recordTime" width="180" v-if="columns[5].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.recordTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-s-order"
@click="handleUpdate(scope.row)"
v-hasPermi="['report:electricalInspection:edit']"
>查看明细
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['report:electricalInspection:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改电检数据记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<!-- <el-form-item label="唯一标识" prop="uuid">-->
<!-- <el-input v-model="form.uuid" placeholder="请输入唯一标识" />-->
<!-- </el-form-item>-->
<el-row gutter="15">
<el-col :span="11">
<el-form-item label="测试总结果" prop="result">
<el-input v-model="form.result" placeholder="请输入测试总结果" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="产品条码" prop="barcode">
<el-input v-model="form.barcode" placeholder="请输入产品条码" :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="测试时间" prop="testTime">-->
<!-- <el-input v-model="form.testTime" placeholder="请输入测试时间"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="测试数据" prop="testData">-->
<!-- <el-input v-model="form.testData" placeholder="请输入测试数据"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="记录时间" prop="recordTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.recordTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择记录时间"-->
<!-- >-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-divider content-position="center">电检数据明细信息</el-divider>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddDetailElectricalinspection"></el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteDetailElectricalinspection"></el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-table :data="detailElectricalinspectionList" :row-class-name="rowDetailElectricalinspectionIndex"
@selection-change="handleDetailElectricalinspectionSelectionChange" ref="detailElectricalinspection"
>
<el-table-column type="selection" width="50" align="center"/>
<!-- <el-table-column label="序号" align="center" prop="index" width="50"/>-->
<el-table-column label="序号" prop="serialnumber" width="150">
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.serialnumber" placeholder="请输入序号" />-->
<!-- </template>-->
</el-table-column>
<el-table-column label="项目名称" prop="projectname" width="150">
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.projectname" placeholder="请输入项目名称" />-->
<!-- </template>-->
</el-table-column>
<el-table-column label="测试条件" prop="testcondition" width="150">
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.testcondition" placeholder="请输入测试条件" />-->
<!-- </template>-->
</el-table-column>
<el-table-column label="测试值" prop="testvalue" width="150">
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.testvalue" placeholder="请输入测试值" />-->
<!-- </template>-->
</el-table-column>
<el-table-column label="测试结果" prop="testresult" width="150">
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.testresult" placeholder="请输入测试结果" />-->
<!-- </template>-->
</el-table-column>
<el-table-column label="记录时间" prop="recordtime" width="240">
<!-- <template slot-scope="scope">-->
<!-- <el-date-picker clearable v-model="scope.row.recordtime" type="date" value-format="yyyy-MM-dd" placeholder="请选择记录时间" />-->
<!-- </template>-->
</el-table-column>
</el-table>
</el-form>
<div slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="submitForm"> </el-button>-->
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listElectricalInspection,
getElectricalInspection,
delElectricalInspection,
addElectricalInspection,
updateElectricalInspection
} from '@/api/report/electricalInspection'
export default {
name: 'ElectricalInspection',
data() {
return {
//
loading: true,
//
ids: [],
//
checkedDetailElectricalinspection: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
electricalInspectionList: [],
//
detailElectricalinspectionList: [],
//
title: '',
//
open: false,
//
daterangeRecordTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
uuid: null,
result: null,
barcode: null,
testTime: null,
testData: null,
recordTime: null
},
//
form: {},
//
rules: {},
columns: [
{ key: 0, label: `唯一标识`, visible: true },
{ key: 1, label: `测试总结果`, visible: true },
{ key: 2, label: `产品条码`, visible: true },
{ key: 3, label: `测试时间`, visible: true },
{ key: 4, label: `测试数据`, visible: true },
{ key: 5, label: `记录时间`, visible: true }
]
}
},
created() {
this.getList()
},
methods: {
/** 查询电检数据记录列表 */
getList() {
this.loading = true
this.queryParams.params = {}
if (null != this.daterangeRecordTime && '' != this.daterangeRecordTime) {
this.queryParams.params['beginRecordTime'] = this.daterangeRecordTime[0]
this.queryParams.params['endRecordTime'] = this.daterangeRecordTime[1]
}
listElectricalInspection(this.queryParams).then(response => {
this.electricalInspectionList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
uuid: null,
result: null,
barcode: null,
testTime: null,
testData: null,
recordTime: null
}
this.detailElectricalinspectionList = []
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeRecordTime = []
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.uuid)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加电检数据记录'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const uuid = row.uuid || this.ids
getElectricalInspection(uuid).then(response => {
this.form = response.data
this.detailElectricalinspectionList = response.data.detailElectricalinspectionList
this.open = true
this.title = '查看电检数据记录明细'
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.form.detailElectricalinspectionList = this.detailElectricalinspectionList
if (this.form.uuid != null) {
updateElectricalInspection(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addElectricalInspection(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const uuids = row.uuid || this.ids
this.$modal.confirm('是否确认删除电检数据记录编号为"' + uuids + '"的数据项?').then(function() {
return delElectricalInspection(uuids)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 电检数据明细序号 */
rowDetailElectricalinspectionIndex({ row, rowIndex }) {
row.index = rowIndex + 1
},
/** 电检数据明细添加按钮操作 */
handleAddDetailElectricalinspection() {
let obj = {}
obj.serialnumber = ''
obj.projectname = ''
obj.testcondition = ''
obj.testvalue = ''
obj.testresult = ''
obj.recordtime = ''
this.detailElectricalinspectionList.push(obj)
},
/** 电检数据明细删除按钮操作 */
handleDeleteDetailElectricalinspection() {
if (this.checkedDetailElectricalinspection.length == 0) {
this.$modal.msgError('请先选择要删除的电检数据明细数据')
} else {
const detailElectricalinspectionList = this.detailElectricalinspectionList
const checkedDetailElectricalinspection = this.checkedDetailElectricalinspection
this.detailElectricalinspectionList = detailElectricalinspectionList.filter(function(item) {
return checkedDetailElectricalinspection.indexOf(item.index) == -1
})
}
},
/** 复选框选中数据 */
handleDetailElectricalinspectionSelectionChange(selection) {
this.checkedDetailElectricalinspection = selection.map(item => item.index)
},
/** 导出按钮操作 */
handleExport() {
this.download('report/electricalInspection/export', {
...this.queryParams
}, `electricalInspection_${new Date().getTime()}.xlsx`)
}
}
}
</script>
Loading…
Cancel
Save