|
|
|
|
@@ -6,155 +6,95 @@
|
|
|
|
|
* @Description:
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<el-drawer
|
|
|
|
|
:visible.sync="visible"
|
|
|
|
|
:show-close="false"
|
|
|
|
|
:wrapper-closable="true"
|
|
|
|
|
:before-close="beforeClose"
|
|
|
|
|
class="drawer"
|
|
|
|
|
size="60%">
|
|
|
|
|
<small-title slot="title" :no-padding="true">
|
|
|
|
|
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
|
|
|
|
</small-title>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="visual-part">
|
|
|
|
|
<el-form
|
|
|
|
|
:model="dataForm"
|
|
|
|
|
:rules="dataRule"
|
|
|
|
|
ref="dataForm"
|
|
|
|
|
@keyup.enter.native="dataFormSubmit()"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
label-position="top">
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="巡检单名称" prop="name">
|
|
|
|
|
<el-input v-model="dataForm.name" :disabled="isdetail" placeholder="请输入巡检单名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="部门" prop="departmentId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="dataForm.departmentId"
|
|
|
|
|
:disabled="isdetail"
|
|
|
|
|
:placeholder="`请选择部门`"
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="opt in departmentOptions"
|
|
|
|
|
:key="opt.id"
|
|
|
|
|
:label="opt.name"
|
|
|
|
|
:value="opt.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="班次" prop="groupClass">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="dataForm.groupClass"
|
|
|
|
|
filterable
|
|
|
|
|
clearable
|
|
|
|
|
multiple
|
|
|
|
|
:disabled="isdetail"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
placeholder="请选择班次">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="d in groupOptions"
|
|
|
|
|
:key="d.id"
|
|
|
|
|
:label="d.label"
|
|
|
|
|
:value="d.label" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="巡检人" prop="checkPerson">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="dataForm.checkPerson"
|
|
|
|
|
:placeholder="`请选择巡检人`"
|
|
|
|
|
multiple
|
|
|
|
|
clearable
|
|
|
|
|
:disabled="isdetail"
|
|
|
|
|
filterable
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="opt in inspectorOptions"
|
|
|
|
|
:key="opt.value"
|
|
|
|
|
:label="opt.label"
|
|
|
|
|
:value="opt.label" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="实际巡检时间" prop="actualCheckTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="dataForm.actualCheckTime"
|
|
|
|
|
type="datetime"
|
|
|
|
|
:disabled="isdetail"
|
|
|
|
|
placeholder="请选择实际巡检时间"
|
|
|
|
|
value-format="timestamp"
|
|
|
|
|
style="width: 100%" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" :before-close="beforeClose"
|
|
|
|
|
class="drawer" size="60%">
|
|
|
|
|
<small-title slot="title" :no-padding="true">
|
|
|
|
|
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
|
|
|
|
</small-title>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="visual-part">
|
|
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
|
|
|
|
label-width="100px" label-position="top">
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="巡检单名称" prop="name">
|
|
|
|
|
<el-input v-model="dataForm.name" :disabled="isdetail" placeholder="请输入巡检单名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="部门" prop="departmentId">
|
|
|
|
|
<el-select v-model="dataForm.departmentId" :disabled="isdetail" :placeholder="`请选择部门`"
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-option v-for="opt in departmentOptions" :key="opt.id" :label="opt.name" :value="opt.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="班次" prop="groupClass">
|
|
|
|
|
<el-select v-model="dataForm.groupClass" filterable clearable multiple :disabled="isdetail"
|
|
|
|
|
style="width: 100%" placeholder="请选择班次">
|
|
|
|
|
<el-option v-for="d in groupOptions" :key="d.id" :label="d.label" :value="d.label" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="巡检人" prop="checkPerson">
|
|
|
|
|
<!-- <el-input v-model="dataForm.checkPerson" :disabled="isdetail" placeholder="请输入巡检人" /> -->
|
|
|
|
|
|
|
|
|
|
<div v-if="idAttrShow">
|
|
|
|
|
<small-title>
|
|
|
|
|
巡检内容
|
|
|
|
|
</small-title>
|
|
|
|
|
<el-select v-model="dataForm.checkPerson" :placeholder="`请选择巡检人`" multiple clearable
|
|
|
|
|
:disabled="isdetail" filterable style="width: 100%">
|
|
|
|
|
<el-option v-for="opt in inspectorOptions" :key="opt.value" :label="opt.label" :value="opt.label" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="实际巡检时间" prop="actualCheckTime">
|
|
|
|
|
<el-date-picker v-model="dataForm.actualCheckTime" type="datetime" :disabled="isdetail"
|
|
|
|
|
placeholder="请选择实际巡检时间" value-format="timestamp" style="width: 100%" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-if="!isdetail" style="display: flex">
|
|
|
|
|
<SearchBar
|
|
|
|
|
:formConfigs="searchBarFormConfig"
|
|
|
|
|
ref="attr-search-bar"
|
|
|
|
|
@headBtnClick="handleSearchBarBtnClick" />
|
|
|
|
|
<!-- <div class="action_btn"> -->
|
|
|
|
|
<el-button type="text" class="action_btn" @click="addNew()">
|
|
|
|
|
<span style="display: inline-block;">
|
|
|
|
|
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
|
|
|
|
|
<span class="add">添加内容</span>
|
|
|
|
|
</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
<!-- </div> -->
|
|
|
|
|
</div>
|
|
|
|
|
<base-table
|
|
|
|
|
:table-props="tableProps"
|
|
|
|
|
:page="listQuery.pageNo"
|
|
|
|
|
:limit="listQuery.pageSize"
|
|
|
|
|
:table-data="detList">
|
|
|
|
|
<method-btn
|
|
|
|
|
v-if="!isdetail"
|
|
|
|
|
slot="handleBtn"
|
|
|
|
|
:width="120"
|
|
|
|
|
label="操作"
|
|
|
|
|
:method-list="tableBtn"
|
|
|
|
|
@clickBtn="handleClick" />
|
|
|
|
|
</base-table>
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="listQuery.total > 0"
|
|
|
|
|
:total="listQuery.total"
|
|
|
|
|
:page.sync="listQuery.pageNo"
|
|
|
|
|
:limit.sync="listQuery.pageSize"
|
|
|
|
|
:page-sizes="[5, 10, 15]"
|
|
|
|
|
@pagination="getList" />
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="idAttrShow">
|
|
|
|
|
<small-title>
|
|
|
|
|
巡检内容
|
|
|
|
|
</small-title>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="!isdetail" style="display: flex">
|
|
|
|
|
<SearchBar :formConfigs="searchBarFormConfig" ref="attr-search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
|
|
|
|
<!-- <div class="action_btn"> -->
|
|
|
|
|
<el-button type="text" class="action_btn" @click="addNew()">
|
|
|
|
|
<span style="display: inline-block;">
|
|
|
|
|
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
|
|
|
|
|
<span class="add">添加内容</span>
|
|
|
|
|
</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
<!-- </div> -->
|
|
|
|
|
</div>
|
|
|
|
|
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
|
|
|
|
:table-data="detList">
|
|
|
|
|
<method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
|
|
|
|
@clickBtn="handleClick" />
|
|
|
|
|
</base-table>
|
|
|
|
|
<pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
|
|
|
|
|
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-if="!isdetail" class="drawer-body__footer">
|
|
|
|
|
<el-button @click="goback()">取消</el-button>
|
|
|
|
|
<!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> -->
|
|
|
|
|
<el-button v-if="isshowConfirm" type="primary" @click="confirmIns()">保存</el-button>
|
|
|
|
|
<el-button v-else type="primary" @click="dataFormSubmit()">保存</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<attr-add
|
|
|
|
|
v-if="addOrUpdateVisible"
|
|
|
|
|
ref="addOrUpdate"
|
|
|
|
|
:order-id="dataForm.id"
|
|
|
|
|
@refreshDataList="getList" />
|
|
|
|
|
</el-drawer>
|
|
|
|
|
<div v-if="!isdetail" class="drawer-body__footer">
|
|
|
|
|
<el-button @click="goback()">取消</el-button>
|
|
|
|
|
<!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> -->
|
|
|
|
|
<el-button v-if="isshowConfirm" type="primary" @click="confirmIns()">保存</el-button>
|
|
|
|
|
<el-button v-else type="primary" @click="dataFormSubmit()">保存</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :order-id="dataForm.id" @refreshDataList="getList" />
|
|
|
|
|
</el-drawer>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
@@ -305,15 +245,15 @@ export default {
|
|
|
|
|
}))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
const workerlist = await this.$axios('/base/core-worker/listAll');
|
|
|
|
|
if (workerlist.code == 0) {
|
|
|
|
|
inspectorList = inspectorList.concat(
|
|
|
|
|
workerlist.data.map((item) => ({
|
|
|
|
|
label: item.name,
|
|
|
|
|
value: item.id,
|
|
|
|
|
}))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
// const workerlist = await this.$axios('/base/core-worker/listAll');
|
|
|
|
|
// if (workerlist.code == 0) {
|
|
|
|
|
// inspectorList = inspectorList.concat(
|
|
|
|
|
// workerlist.data.map((item) => ({
|
|
|
|
|
// label: item.name,
|
|
|
|
|
// value: item.id,
|
|
|
|
|
// }))
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
this.inspectorOptions = inspectorList;
|
|
|
|
|
// const res1 = await groupClassesListAll();
|
|
|
|
|
// this.groupOptions = res1.data || [];
|
|
|
|
|
|