Compare commits

...

3 Commits

2 changed files with 348 additions and 143 deletions

View File

@ -846,15 +846,15 @@ export default {
grid-template-rows: repeat(3, 32%); grid-template-rows: repeat(3, 32%);
grid-gap: 1%; grid-gap: 1%;
&.left-column { &.left-column {
grid-template-rows: 33% 29% 33%; grid-template-rows: 33% 34% 28%;
grid-gap: 1%; grid-gap: 1%;
} }
&.right-column { &.right-column {
grid-template-rows: 33% 29% 33%; grid-template-rows: 33% 34% 28%;
grid-gap: 1%; grid-gap: 1%;
} }
&:nth-child(2) { &:nth-child(2) {
grid-template-rows: 61% 29%; grid-template-rows: 67% 30%;
grid-gap: 2%; grid-gap: 2%;
> div { > div {
padding: 0; padding: 0;

View File

@ -1,18 +1,36 @@
<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
<el-form-item label="点检单号" prop="inspectionNo"> :model="queryParams"
<el-input v-model="queryParams.inspectionNo" placeholder="请输入点检单号" clearable ref="queryForm"
@keyup.enter.native="handleQuery"/> size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item
label="点检单号"
prop="inspectionNo"
>
<el-input
v-model="queryParams.inspectionNo"
placeholder="请输入点检单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="机床设备" prop="equipId"> <el-form-item
label="机床设备"
prop="equipId"
>
<el-cascader <el-cascader
v-model="cascaderValue" v-model="cascaderValue"
:options="equipCascader" :options="equipCascader"
:props="{ value: 'id',label: 'name',children: 'children'}" :props="{ value: 'id',label: 'name',children: 'children'}"
clearable clearable
@change="cascaderChange"></el-cascader> @change="cascaderChange"
></el-cascader>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="客户信息" label="客户信息"
@ -32,79 +50,190 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="点检方案" prop="inspectionPlanId">--> <!-- <el-form-item label="点检方案" prop="inspectionPlanId">-->
<!-- <el-input v-model="queryParams.inspectionPlanId" placeholder="请输入点检方案id" clearable--> <!-- <el-input v-model="queryParams.inspectionPlanId" placeholder="请输入点检方案id" clearable-->
<!-- @keyup.enter.native="handleQuery"/>--> <!-- @keyup.enter.native="handleQuery"/>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="状态" prop="status"> <el-form-item
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small"> label="状态"
<el-option v-for="dict in inspectionStatusList" prop="status"
:key="dict.value" :label="dict.label" :value="dict.value"/> >
<el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
size="small"
>
<el-option
v-for="dict in inspectionStatusList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> type="primary"
icon="el-icon-search"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8"> <el-row
<!-- <el-col :span="1.5">--> :gutter="10"
<!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"--> class="mb8"
<!-- v-hasPermi="['imt:inspection-info:create']">新增</el-button>--> >
<!-- </el-col>--> <!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"-->
<!-- v-hasPermi="['imt:inspection-info:create']">新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">--> <!-- <el-col :span="1.5">-->
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"--> <!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"-->
<!-- v-hasPermi="['imt:inspection-info:export']">导出</el-button>--> <!-- v-hasPermi="['imt:inspection-info:export']">导出</el-button>-->
<!-- </el-col>--> <!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <el-table
<el-table-column label="点检单号" align="center" prop="inspectionNo"/> v-loading="loading"
<el-table-column label="设备" align="center" prop="equipName"/> :data="list"
<el-table-column label="客户" align="center" prop="customerName"/> :stripe="true"
<el-table-column label="点检方案" align="center" prop="inspectionPlanName"/> :show-overflow-tooltip="true"
<el-table-column label="定制化点检方案" align="center" prop="exclusiveInspection"/> >
<el-table-column label="状态" align="center" prop="status"> <el-table-column
label="点检单号"
align="center"
prop="inspectionNo"
/>
<el-table-column
label="设备"
align="center"
prop="equipName"
/>
<el-table-column
label="客户"
align="center"
prop="customerName"
/>
<el-table-column
label="点检方案"
align="center"
prop="inspectionPlanName"
/>
<el-table-column
label="定制化点检方案"
align="center"
prop="exclusiveInspection"
/>
<el-table-column
label="状态"
align="center"
prop="status"
>
<template v-slot="scope"> <template v-slot="scope">
<dict-tag :type="DICT_TYPE.INSPECTION_STATUS" :value="scope.row.status"/> <dict-tag
:type="DICT_TYPE.INSPECTION_STATUS"
:value="scope.row.status"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark"/> <el-table-column
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> label="备注"
align="center"
prop="remark"
/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="180"
>
<template v-slot="scope"> <template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template v-slot="scope"> <template v-slot="scope">
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.inspectionId)"--> <!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.inspectionId)"-->
<!-- v-hasPermi="['imt:inspection-info:update']">修改--> <!-- v-hasPermi="['imt:inspection-info:update']">修改-->
<!-- </el-button>--> <!-- </el-button>-->
<el-button v-if="scope.row.status === 0" size="mini" type="text" icon="el-icon-tickets" @click="inspectionFeedback(scope.row)" <el-button
v-hasPermi="['imt:inspection-info:inspectionFeedback']">点检反馈 v-if="scope.row.status === 0"
size="mini"
type="text"
icon="el-icon-tickets"
@click="inspectionFeedback(scope.row)"
v-hasPermi="['imt:inspection-info:inspectionFeedback']"
>点检反馈
</el-button> </el-button>
<el-button v-if="scope.row.status === 2" size="mini" type="text" icon="el-icon-tickets" @click="exclusiveInspectionFeedback(scope.row)" <el-button
v-hasPermi="['imt:inspection-info:exclusiveInspectionFeedback']">定制化点检反馈 v-if="scope.row.status === 2"
size="mini"
type="text"
icon="el-icon-tickets"
@click="exclusiveInspectionFeedback(scope.row)"
v-hasPermi="['imt:inspection-info:exclusiveInspectionFeedback']"
>定制化点检反馈
</el-button> </el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button
v-hasPermi="['imt:inspection-info:delete']">删除 size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['imt:inspection-info:delete']"
>删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination
@pagination="getList"/> v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<InspectionInfoForm ref="formRef" @success="getList"/> <InspectionInfoForm
ref="formRef"
@success="getList"
/>
<!-- 点检树点检反馈 --> <!-- 点检树点检反馈 -->
<el-dialog :title="inspectionFeedbackTitle" :visible.sync="inspectionFeedbackVisible" width="45%" v-dialogDrag append-to-body> <el-dialog
<el-form ref="inspectionFeedbackRef" :model="inspectionFeedbackData" :rules="inspectionFeedbackRules" v-loading="inspectionFeedbackLoading" label-width="140px"> :title="inspectionFeedbackTitle"
<el-form-item label="点检方案:" prop="inspectionPlanId"> :visible.sync="inspectionFeedbackVisible"
width="45%"
v-dialogDrag
append-to-body
>
<el-form
ref="inspectionFeedbackRef"
:model="inspectionFeedbackData"
:rules="inspectionFeedbackRules"
v-loading="inspectionFeedbackLoading"
@submit.native.prevent
label-width="140px"
>
<el-form-item
label="点检方案:"
prop="inspectionPlanId"
>
<div <div
v-for="(tree,index) in treeData" v-for="(tree,index) in treeData"
:key="tree.inspectionPlanId" :key="tree.inspectionPlanId"
@ -127,45 +256,98 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="是否解决:" prop="inspectionFeedbackStatus"> <el-form-item
label="是否解决:"
prop="inspectionFeedbackStatus"
>
<el-radio-group v-model="inspectionFeedbackData.inspectionFeedbackStatus"> <el-radio-group v-model="inspectionFeedbackData.inspectionFeedbackStatus">
<el-radio :label="3"></el-radio> <el-radio :label="3"></el-radio>
<el-radio :label="1"></el-radio> <el-radio :label="1"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="点检方案补充:" prop="inspectionPlanSupplement"> <el-form-item
<el-input v-model="inspectionFeedbackData.inspectionPlanSupplement" :rows="4" type="textarea" placeholder="请输入内容"/> label="点检方案补充:"
prop="inspectionPlanSupplement"
>
<el-input
v-model="inspectionFeedbackData.inspectionPlanSupplement"
:rows="4"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-form-item>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="primary" @click="submitInspectionFeedback" > </el-button> <el-button
type="primary"
@click="submitInspectionFeedback"
> </el-button>
<el-button @click="inspectionFeedbackVisible = false"> </el-button> <el-button @click="inspectionFeedbackVisible = false"> </el-button>
</div> </div>
</el-form> </el-form>
</el-dialog> </el-dialog>
<!-- 定制化点检反馈 --> <!-- 定制化点检反馈 -->
<el-dialog :title="exclusiveInspectionFeedbackTitle" :visible.sync="exclusiveInspectionFeedbackVisible" width="45%" v-dialogDrag append-to-body> <el-dialog
<el-form ref="exclusiveInspectionFeedbackRef" :model="exclusiveInspectionFeedbackData" :rules="exclusiveInspectionFeedbackRules" v-loading="exclusiveInspectionFeedbackLoading" label-width="140px"> :title="exclusiveInspectionFeedbackTitle"
<el-form-item label="点检方案:" prop="inspectionPlanId"> :visible.sync="exclusiveInspectionFeedbackVisible"
<inspection-plan-feedback-tree ref="inspectionPlanFeedbackTree" :inspection-id="inspectionId" :inspection-plan-ids="inspectionPlanIds"/> width="45%"
v-dialogDrag
append-to-body
>
<el-form
ref="exclusiveInspectionFeedbackRef"
:model="exclusiveInspectionFeedbackData"
:rules="exclusiveInspectionFeedbackRules"
v-loading="exclusiveInspectionFeedbackLoading"
label-width="140px"
>
<el-form-item
label="点检方案:"
prop="inspectionPlanId"
>
<inspection-plan-feedback-tree
ref="inspectionPlanFeedbackTree"
:inspection-id="inspectionId"
:inspection-plan-ids="inspectionPlanIds"
/>
</el-form-item> </el-form-item>
<el-form-item label="点检方案补充:" prop="inspectionPlanSupplement"> <el-form-item
label="点检方案补充:"
prop="inspectionPlanSupplement"
>
{{ exclusiveInspectionFeedbackData.inspectionPlanSupplement }} {{ exclusiveInspectionFeedbackData.inspectionPlanSupplement }}
</el-form-item> </el-form-item>
<el-form-item label="定制化点检方案:" prop="exclusiveInspection"> <el-form-item
label="定制化点检方案:"
prop="exclusiveInspection"
>
{{ exclusiveInspectionFeedbackData.exclusiveInspection }} {{ exclusiveInspectionFeedbackData.exclusiveInspection }}
</el-form-item> </el-form-item>
<el-form-item label="是否解决:" prop="inspectionFeedbackStatus"> <el-form-item
label="是否解决:"
prop="inspectionFeedbackStatus"
>
<el-radio-group v-model="exclusiveInspectionFeedbackData.inspectionFeedbackStatus"> <el-radio-group v-model="exclusiveInspectionFeedbackData.inspectionFeedbackStatus">
<el-radio :label="3"></el-radio> <el-radio :label="3"></el-radio>
<el-radio :label="4"></el-radio> <el-radio :label="4"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="定制化点检反馈:" prop="exclusiveInspectionFeedback"> <el-form-item
<el-input v-model="exclusiveInspectionFeedbackData.exclusiveInspectionFeedback" :rows="4" type="textarea" placeholder="请输入内容"/> label="定制化点检反馈:"
prop="exclusiveInspectionFeedback"
>
<el-input
v-model="exclusiveInspectionFeedbackData.exclusiveInspectionFeedback"
:rows="4"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-form-item>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="primary" @click="submitExclusiveInspectionFeedback" > </el-button> <el-button
type="primary"
@click="submitExclusiveInspectionFeedback"
> </el-button>
<el-button @click="exclusiveInspectionFeedbackVisible = false"> </el-button> <el-button @click="exclusiveInspectionFeedbackVisible = false"> </el-button>
</div> </div>
</el-form> </el-form>
@ -174,57 +356,57 @@
</template> </template>
<script> <script>
import * as InspectionInfoApi from '@/api/system/inspection/inspectionInfo'; import * as InspectionInfoApi from "@/api/system/inspection/inspectionInfo";
import InspectionInfoForm from './InspectionInfoForm.vue'; import InspectionInfoForm from "./InspectionInfoForm.vue";
import {getEquipCascader} from "@/api/system/equip/equipInfo"; import { getEquipCascader } from "@/api/system/equip/equipInfo";
import {getCustomerSelection} from "@/api/system/baseData/customerInfo"; import { getCustomerSelection } from "@/api/system/baseData/customerInfo";
import {DICT_TYPE, getDictDatas} from "@/utils/dict"; import { DICT_TYPE, getDictDatas } from "@/utils/dict";
import * as InspectionPlanApi from "@/api/system/inspection/plan"; import * as InspectionPlanApi from "@/api/system/inspection/plan";
import {VueOkrTree} from "@/components/VueOkrTree"; import { VueOkrTree } from "@/components/VueOkrTree";
import Vue from "vue"; import Vue from "vue";
import inspectionPlanFeedbackTree from "@/views/system/inspectionPlan/inspectionPlanFeedbackTree.vue" import inspectionPlanFeedbackTree from "@/views/system/inspectionPlan/inspectionPlanFeedbackTree.vue";
export default { export default {
name: "InspectionInfo", name: "InspectionInfo",
components: { components: {
VueOkrTree, VueOkrTree,
InspectionInfoForm, InspectionInfoForm,
inspectionPlanFeedbackTree inspectionPlanFeedbackTree,
}, },
data() { data() {
return { return {
inspectionPlanIds:null, inspectionPlanIds: null,
inspectionId:null, inspectionId: null,
feedbackList:[], feedbackList: [],
eventBus: new Vue(), eventBus: new Vue(),
treeData:[], treeData: [],
props: { props: {
label: "inspectionName", label: "inspectionName",
}, },
inspectionStatusList:[], inspectionStatusList: [],
exclusiveInspectionFeedbackTitle:"定制化点检反馈", exclusiveInspectionFeedbackTitle: "定制化点检反馈",
exclusiveInspectionFeedbackVisible:false, exclusiveInspectionFeedbackVisible: false,
exclusiveInspectionFeedbackData:{}, exclusiveInspectionFeedbackData: {},
exclusiveInspectionFeedbackRules:{ exclusiveInspectionFeedbackRules: {
inspectionFeedbackStatus: [ inspectionFeedbackStatus: [
{ required: true, message: '请选择是否解决', trigger: 'change' } { required: true, message: "请选择是否解决", trigger: "change" },
], ],
exclusiveInspectionFeedback: [ exclusiveInspectionFeedback: [
{ required: true, message: '定制化点检反馈', trigger: 'blur' }, { required: true, message: "定制化点检反馈", trigger: "blur" },
], ],
}, },
exclusiveInspectionFeedbackLoading:false, exclusiveInspectionFeedbackLoading: false,
inspectionFeedbackData:{}, inspectionFeedbackData: {},
inspectionFeedbackRules:{ inspectionFeedbackRules: {
inspectionFeedbackStatus: [ inspectionFeedbackStatus: [
{ required: true, message: '请选择是否解决', trigger: 'change' } { required: true, message: "请选择是否解决", trigger: "change" },
], ],
}, },
inspectionFeedbackLoading:false, inspectionFeedbackLoading: false,
inspectionFeedbackTitle:"点检反馈", inspectionFeedbackTitle: "点检反馈",
inspectionFeedbackVisible:false, inspectionFeedbackVisible: false,
customerSelection: [], customerSelection: [],
cascaderValue:[], cascaderValue: [],
equipCascader: [], equipCascader: [],
// //
loading: true, loading: true,
@ -267,41 +449,52 @@ export default {
objToList(obj) { objToList(obj) {
return [obj]; return [obj];
}, },
async submitExclusiveInspectionFeedback(){ async submitExclusiveInspectionFeedback() {
await this.$refs.exclusiveInspectionFeedbackRef.validate(); await this.$refs.exclusiveInspectionFeedbackRef.validate();
this.exclusiveInspectionFeedbackData.status = this.exclusiveInspectionFeedbackData.inspectionFeedbackStatus; this.exclusiveInspectionFeedbackData.status =
this.exclusiveInspectionFeedbackData.closeAlarm = this.exclusiveInspectionFeedbackData.status === 3; this.exclusiveInspectionFeedbackData.inspectionFeedbackStatus;
await InspectionInfoApi.exclusiveInspectionFeedback(this.exclusiveInspectionFeedbackData).then(res=>{ this.exclusiveInspectionFeedbackData.closeAlarm =
this.exclusiveInspectionFeedbackData.status === 3;
await InspectionInfoApi.exclusiveInspectionFeedback(
this.exclusiveInspectionFeedbackData
).then((res) => {
this.$modal.msgSuccess("提交成功"); this.$modal.msgSuccess("提交成功");
this.exclusiveInspectionFeedbackVisible = false; this.exclusiveInspectionFeedbackVisible = false;
this.getList(); this.getList();
}) });
}, },
async submitInspectionFeedback(){ async submitInspectionFeedback() {
await this.$refs.inspectionFeedbackRef.validate(); await this.$refs.inspectionFeedbackRef.validate();
this.inspectionFeedbackData.status = this.inspectionFeedbackData.inspectionFeedbackStatus; this.inspectionFeedbackData.status =
this.inspectionFeedbackData.closeAlarm = this.inspectionFeedbackData.status === 3; this.inspectionFeedbackData.inspectionFeedbackStatus;
this.inspectionFeedbackData.closeAlarm =
this.inspectionFeedbackData.status === 3;
this.inspectionFeedbackData.feedbackList = this.feedbackList; this.inspectionFeedbackData.feedbackList = this.feedbackList;
await InspectionInfoApi.inspectionFeedback(this.inspectionFeedbackData).then(res=>{ await InspectionInfoApi.inspectionFeedback(
this.inspectionFeedbackData
).then((res) => {
this.$modal.msgSuccess("提交成功"); this.$modal.msgSuccess("提交成功");
this.inspectionFeedbackVisible = false; this.inspectionFeedbackVisible = false;
this.getList(); this.getList();
}) });
}, },
async inspectionFeedback(row){ async inspectionFeedback(row) {
this.feedbackList = []; this.feedbackList = [];
this.treeData = []; this.treeData = [];
this.inspectionFeedbackVisible = true; this.inspectionFeedbackVisible = true;
this.inspectionFeedbackData = {}; this.inspectionFeedbackData = {};
this.inspectionFeedbackLoading = true; this.inspectionFeedbackLoading = true;
await InspectionInfoApi.getInspectionInfo(row.inspectionId).then(res=>{ await InspectionInfoApi.getInspectionInfo(row.inspectionId).then(
this.inspectionFeedbackData = res.data; (res) => {
this.inspectionFeedbackLoading = false; this.inspectionFeedbackData = res.data;
}) this.inspectionFeedbackLoading = false;
}
);
const data = { const data = {
inspectionPlanIds: this.inspectionFeedbackData.inspectionPlanId.split(',') inspectionPlanIds:
} this.inspectionFeedbackData.inspectionPlanId.split(","),
await InspectionPlanApi.getInspectionPlanList(data).then(res=>{ };
await InspectionPlanApi.getInspectionPlanList(data).then((res) => {
this.treeData = this.handleTree( this.treeData = this.handleTree(
res.data, res.data,
"inspectionPlanId", "inspectionPlanId",
@ -316,58 +509,65 @@ export default {
console.log("全局输入值:", inputValue); console.log("全局输入值:", inputValue);
// //
if (this.feedbackList.length > 0) { if (this.feedbackList.length > 0) {
const obj = this.feedbackList.find(item => item.inspectionPlanId === node.data.inspectionPlanId); const obj = this.feedbackList.find(
if (obj != null){ (item) => item.inspectionPlanId === node.data.inspectionPlanId
this.feedbackList.map(item => { );
if (obj != null) {
this.feedbackList.map((item) => {
if (item.inspectionPlanId === node.data.inspectionPlanId) { if (item.inspectionPlanId === node.data.inspectionPlanId) {
item.inspectionFeedbackContent = inputValue; item.inspectionFeedbackContent = inputValue;
} }
}); });
}else { } else {
let data = { let data = {
inspectionFeedbackContent: inputValue, inspectionFeedbackContent: inputValue,
inspectionPlanId: node.data.inspectionPlanId inspectionPlanId: node.data.inspectionPlanId,
} };
this.feedbackList.push(data); this.feedbackList.push(data);
} }
} else { } else {
let data = { let data = {
inspectionFeedbackContent: inputValue, inspectionFeedbackContent: inputValue,
inspectionPlanId: node.data.inspectionPlanId inspectionPlanId: node.data.inspectionPlanId,
} };
this.feedbackList.push(data); this.feedbackList.push(data);
} }
}, },
async exclusiveInspectionFeedback(row){ async exclusiveInspectionFeedback(row) {
this.exclusiveInspectionFeedbackVisible = true; this.exclusiveInspectionFeedbackVisible = true;
this.exclusiveInspectionFeedbackData = {}; this.exclusiveInspectionFeedbackData = {};
this.exclusiveInspectionFeedbackLoading = true; this.exclusiveInspectionFeedbackLoading = true;
await InspectionInfoApi.getInspectionInfo(row.inspectionId).then(res=>{ await InspectionInfoApi.getInspectionInfo(row.inspectionId).then(
this.exclusiveInspectionFeedbackData = res.data; (res) => {
this.inspectionPlanIds = this.exclusiveInspectionFeedbackData.inspectionPlanId.split(',') this.exclusiveInspectionFeedbackData = res.data;
this.inspectionId = row.inspectionId; this.inspectionPlanIds =
this.exclusiveInspectionFeedbackLoading = false; this.exclusiveInspectionFeedbackData.inspectionPlanId.split(",");
}) this.inspectionId = row.inspectionId;
this.exclusiveInspectionFeedbackLoading = false;
}
);
await this.$refs.inspectionPlanFeedbackTree.initTree(); await this.$refs.inspectionPlanFeedbackTree.initTree();
}, },
initSelection(){ initSelection() {
getCustomerSelection().then((res) => { getCustomerSelection().then((res) => {
this.customerSelection = res; this.customerSelection = res;
}); });
getEquipCascader().then(res=>{ getEquipCascader().then((res) => {
res.forEach(item=>{ res.forEach((item) => {
if (item.children == null){ if (item.children == null) {
item.disabled = true; item.disabled = true;
} }
}) });
this.equipCascader = res; this.equipCascader = res;
}) });
this.inspectionStatusList = getDictDatas(DICT_TYPE.INSPECTION_STATUS).filter(item => item.value !== "3"); this.inspectionStatusList = getDictDatas(
DICT_TYPE.INSPECTION_STATUS
).filter((item) => item.value !== "3");
}, },
cascaderChange(value){ cascaderChange(value) {
if (value.length > 0){ if (value.length > 0) {
this.queryParams.equipId = value[1]; this.queryParams.equipId = value[1];
}else { } else {
this.queryParams.equipId = null; this.queryParams.equipId = null;
} }
}, },
@ -375,7 +575,9 @@ export default {
async getList() { async getList() {
try { try {
this.loading = true; this.loading = true;
const res = await InspectionInfoApi.getInspectionInfoPage(this.queryParams); const res = await InspectionInfoApi.getInspectionInfoPage(
this.queryParams
);
this.list = res.data.list; this.list = res.data.list;
this.total = res.data.total; this.total = res.data.total;
} finally { } finally {
@ -401,26 +603,29 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
async handleDelete(row) { async handleDelete(row) {
const inspectionId = row.inspectionId; const inspectionId = row.inspectionId;
await this.$modal.confirm('是否确认删除点检工单编号为"' + inspectionId + '"的数据项?') await this.$modal.confirm(
'是否确认删除点检工单编号为"' + inspectionId + '"的数据项?'
);
try { try {
await InspectionInfoApi.deleteInspectionInfo(inspectionId); await InspectionInfoApi.deleteInspectionInfo(inspectionId);
await this.getList(); await this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
} catch { } catch {}
}
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
async handleExport() { async handleExport() {
await this.$modal.confirm('是否确认导出所有点检工单数据项?'); await this.$modal.confirm("是否确认导出所有点检工单数据项?");
try { try {
this.exportLoading = true; this.exportLoading = true;
const data = await InspectionInfoApi.exportInspectionInfoExcel(this.queryParams); const data = await InspectionInfoApi.exportInspectionInfoExcel(
this.$download.excel(data, '点检工单.xls'); this.queryParams
);
this.$download.excel(data, "点检工单.xls");
} catch { } catch {
} finally { } finally {
this.exportLoading = false; this.exportLoading = false;
} }
}, },
} },
}; };
</script> </script>