设备任务代码提交
parent
b8fa9616f7
commit
70437588c0
@ -0,0 +1,25 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
export function getDeptDeviceList(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/deptDevice/filter",
|
||||
method: "get",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
export function saveDeptDevice(data, formName) {
|
||||
return axios({
|
||||
url: formName === "add" ? "/udiwms/inv/deptDevice/add" : "/udiwms/inv/deptDevice/update",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteDeptDevice(data) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/deptDevice/delete",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
export function getDeviceInspectTakeList(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/inspect/take/filter",
|
||||
method: "get",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadDeviceInspecTake(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/inspect/take/uploadDeviceInspecTake",
|
||||
method: "post",
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadDeviceTake(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/inspect/take/uploadDeviceTake",
|
||||
method: "post",
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
export function saveDeviceInspectTake(data, formName) {
|
||||
return axios({
|
||||
url: formName === "add" ? "/udiwms/inv/device/inspect/take/addDeviceInspecTake" : "/udiwms/inv/device/inspect/take/uploadDeviceInspecTake",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
export function selectDeviceInspecTakeDetail(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/inspect/take/detail/selectDeviceInspecTakeDetail",
|
||||
method: "get",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadDeviceInspecTakeDetail(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/inspect/take/detail/uploadDeviceInspecTakeDetail",
|
||||
method: "post",
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
export function addDeviceInspecTakeDetail(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/inspect/take/detail/addDeviceInspecTakeDetail",
|
||||
method: "post",
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
export function delectDeviceInspecTake(data) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/inspect/take/delectDeviceInspecTake",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
export function delectDeviceInspecTakeDetail(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/inspect/take/detail/delectDeviceInspecTakeDetail",
|
||||
method: "get",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,40 @@
|
||||
import axios from "../../utils/request";
|
||||
|
||||
|
||||
export function getprojectSetList(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/project/set/filter",
|
||||
method: "get",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
export function insertDevprojectSet(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/project/set/insertDevprojectSet",
|
||||
method: "post",
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
export function updateDevprojectSet(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/project/set/updateDevprojectSet",
|
||||
method: "post",
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function deleteDevprojectSet(params) {
|
||||
return axios({
|
||||
url: "/udiwms/inv/device/project/set/deleteDevprojectSet",
|
||||
method: "get",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,626 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="el-card">
|
||||
<el-form :model="filterQuery" class="query-form" size="mini" label-width="140px" v-show="showSearch">
|
||||
<el-row>
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <el-form-item class="query-form-item" label="部门:">-->
|
||||
<!-- <el-select v-model="filterQuery.deptCode" placeholder="请选择部门" clearable="true"-->
|
||||
<!-- @change="deptChange"-->
|
||||
<!-- style="width: 90%"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in deptList"-->
|
||||
<!-- :key="item.name"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.code">-->
|
||||
<!-- <span style="float: left">{{ item.name }}</span>-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <el-form-item class="query-form-item" label="仓库:">-->
|
||||
<!-- <el-select v-model="filterQuery.invCode" placeholder="请选择仓库" clearable="true"-->
|
||||
<!-- style="width: 90%"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in invList"-->
|
||||
<!-- :key="item.name"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.code">-->
|
||||
<!-- <span style="float: left">{{ item.name }}</span>-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="任务单号:">
|
||||
<el-input v-model="filterQuery.orderId" placeholder="请输入任务单号" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="资产编码:">
|
||||
<el-input v-model="filterQuery.code" placeholder="请输入资产编码" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="任务状态:" class="query-form-item">
|
||||
<el-select v-model="filterQuery.status" style="width: 90%" placeholder="请选择任务状态" clearable>
|
||||
<el-option label="未处理" :value=2></el-option>
|
||||
<el-option label="处理中" :value=3></el-option>
|
||||
<el-option label="已处理" :value=4></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="预计结束时间:">
|
||||
<el-date-picker
|
||||
:picker-options="pickerEdOptions"
|
||||
v-model="edDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 90%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="开始时间:">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
v-model="actDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 90%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="结束时间:">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
v-model="endDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 90%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="任务类型:" class="query-form-item">
|
||||
<el-select v-model="filterQuery.type" style="width: 90%" placeholder="请选择任务类型" clearable>
|
||||
<el-option label="巡检" :value=1></el-option>
|
||||
<el-option label="养护" :value=2></el-option>
|
||||
<el-option label="报修" :value=3></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div class="top-right-btn">
|
||||
<el-button-group>
|
||||
<el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
|
||||
<el-table v-loading="loading" :data="list" style="width: 100%" @current-change="handleDetail" highlight-current-row border>
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column label="任务编号" prop="orderId"></el-table-column>
|
||||
<el-table-column label="资产编码" prop="code"></el-table-column>
|
||||
<el-table-column label="设备名称" prop="deviceName"></el-table-column>
|
||||
<el-table-column label="任务类型" prop="repairType">
|
||||
<template slot-scope="scope">
|
||||
<el-tag>{{ repairTypeMap[scope.row.type] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务状态" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag>{{ statusMap[scope.row.status] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="strartTime"></el-table-column>
|
||||
<el-table-column label="结束时间" prop="endTime"></el-table-column>
|
||||
<el-table-column label="提醒时间" prop="remindTime"></el-table-column>
|
||||
<el-table-column label="负责人" prop="inspectName"></el-table-column>
|
||||
<el-table-column label="预计结束时间" prop="expectedTime"></el-table-column>
|
||||
<el-table-column label="操作" width="170">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="scope.row.status != 2"
|
||||
@click.native.stop="startOrder(scope.row,3)"
|
||||
>开始任务
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="scope.row.status != 3"
|
||||
@click.native.stop="startOrder(scope.row,4)"
|
||||
>结束任务
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.stop="startOrder(scope.row,5)"
|
||||
>详情
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:limit.sync="filterQuery.limit"
|
||||
:page.sync="filterQuery.page"
|
||||
@pagination="getList"
|
||||
></pagination>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
:title="formMap[formName]"
|
||||
:visible.sync="formVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="65%"
|
||||
v-if="formVisible"
|
||||
>
|
||||
<deviceInspectTakeAuditModify
|
||||
:inspectTake="deviceInspectTake"
|
||||
:type="type"
|
||||
:closeDialog="closeDialog"
|
||||
>
|
||||
</deviceInspectTakeAuditModify>
|
||||
</el-dialog>
|
||||
|
||||
<el-card class="el-card">
|
||||
<el-table v-loading="loading" :data="delectList" style="width: 100%" border highlight-current-row>
|
||||
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||
<el-table-column label="项目编码" prop="projectCode" width="300"></el-table-column>
|
||||
<el-table-column label="项目内容" prop="projectContent" width="500"></el-table-column>
|
||||
<el-table-column label="状态" prop="status" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag>{{ statusdetailMap[scope.row.status] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现场照片" prop="inspectImage" width="300">
|
||||
<template slot-scope="scope">
|
||||
<div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.inspectImage }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.stop="datailSelect(scope.row)"
|
||||
>详情
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
title="巡检配置详情"
|
||||
:visible.sync="deviceProjectSelectVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="40%"
|
||||
v-if="deviceProjectSelectVisible"
|
||||
>
|
||||
<DeviceInspectTakeDetail
|
||||
:detailQuery="detailQuery"
|
||||
:closeDialog="closeDialog"
|
||||
>
|
||||
</DeviceInspectTakeDetail>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getDeptListByUser} from "@/api/auth/authDept";
|
||||
import {findInvByUser} from "@/api/system/invSubWarehouse";
|
||||
import deviceInspectTakeAuditModify from "@/views/inventory/DeviceInspectTakeAuditModify"
|
||||
import {getDeviceInspectTakeList,selectDeviceInspecTakeDetail} from "@/api/inventory/deviceInspectTake";
|
||||
import {previewImage, previewFile} from "@/api/purchase/supCompany";
|
||||
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
|
||||
import DeviceInspectTakeDetail from "@/views/inventory/DeviceInspectTakeDetail"
|
||||
|
||||
export default {
|
||||
name: "deviceInspectTake",
|
||||
data() {
|
||||
return {
|
||||
filterQuery: {
|
||||
orderId: null,
|
||||
deptCode: this.$store.getters.locDeptCode,
|
||||
invCode: null,
|
||||
code: null,
|
||||
statusList: [2,3,4],
|
||||
page: 1,
|
||||
limit: 20,
|
||||
},
|
||||
imgViewerVisible:false,
|
||||
imgList: [],
|
||||
BASE_URL: process.env.VUE_APP_BASE_API,
|
||||
type:null,
|
||||
delectList:[],
|
||||
list: [],
|
||||
total: 0,
|
||||
deptList: [],
|
||||
invList: [],
|
||||
loading: false,
|
||||
formVisible: false,
|
||||
statusMap: {
|
||||
2: "未处理",
|
||||
3: "处理中",
|
||||
4: "已处理",
|
||||
},
|
||||
repairTypeMap: {
|
||||
1: "巡检",
|
||||
2: "养护",
|
||||
3: "报修",
|
||||
},
|
||||
statusdetailMap: {
|
||||
1: "未开始",
|
||||
2: "已检查",
|
||||
3: "异常",
|
||||
4: "不巡检",
|
||||
},
|
||||
formName: null,
|
||||
formMap: {
|
||||
add: "我的任务-开始任务",
|
||||
edit: "我的任务-结束任务",
|
||||
detail: "我的任务-任务详情"
|
||||
},
|
||||
deviceInspectTake: {
|
||||
id: null,
|
||||
code: null,
|
||||
deptCode: null,
|
||||
invCode: null,
|
||||
deviceName: null,
|
||||
orderId: null,
|
||||
endTime: '',
|
||||
startTime: '',
|
||||
},
|
||||
deviceProjectSelectVisible: false,
|
||||
detailQuery: null,
|
||||
showSearch: true,
|
||||
actDateRange: [],
|
||||
endDateRange: [],
|
||||
edDateRange: [],
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
pickerAuditOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
pickerEdOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
hideSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
orderId: null,
|
||||
deptCode: this.$store.getters.locDeptCode,
|
||||
invCode: null,
|
||||
code: null,
|
||||
statusList: [2,3,4],
|
||||
page: 1,
|
||||
limit: 20,
|
||||
};
|
||||
this.endDateRange = [];
|
||||
this.actDateRange = [];
|
||||
this.edDateRange = [];
|
||||
this.spaceList = [];
|
||||
this.getList();
|
||||
},
|
||||
onSubmit() {
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
if (this.actDateRange != null) {
|
||||
this.filterQuery.ksStartDate = this.actDateRange[0];
|
||||
this.filterQuery.ksEndDate = this.actDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.ksStartDate = null;
|
||||
this.filterQuery.ksEndDate = null;
|
||||
}
|
||||
if (this.endDateRange != null) {
|
||||
this.filterQuery.jsStartDate = this.endDateRange[0];
|
||||
this.filterQuery.jsEndDate = this.endDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.jsStartDate = null;
|
||||
this.filterQuery.jsEndDate = null;
|
||||
}
|
||||
if (this.edDateRange != null) {
|
||||
this.filterQuery.yjjsStartDate = this.edDateRange[0];
|
||||
this.filterQuery.yjjsEndDate = this.edDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.yjjsStartDate = null;
|
||||
this.filterQuery.yjjsEndDate = null;
|
||||
}
|
||||
getDeviceInspectTakeList(this.filterQuery).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code === 20000) {
|
||||
this.list = res.data.list || [];
|
||||
this.total = res.data.total || 0;
|
||||
this.delectList = []
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$message.error(error.message);
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
})
|
||||
},
|
||||
deptChange() {
|
||||
this.invList = [];
|
||||
this.filterQuery.invCode = null;
|
||||
this.getInvList();
|
||||
},
|
||||
getDeptList() {
|
||||
getDeptListByUser().then((res) => {
|
||||
this.deptList = res.data || [];
|
||||
this.getInvList();
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
invChange() {
|
||||
this.spaceList = [];
|
||||
this.filterQuery.fromInvSpaceCode = null;
|
||||
this.getSpaceList();
|
||||
},
|
||||
getInvList() {
|
||||
let params = {deptCode: this.filterQuery.deptCode};
|
||||
findInvByUser(params)
|
||||
.then((response) => {
|
||||
this.invList = response.data || [];
|
||||
this.getList();
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
startOrder(row,type) {
|
||||
this.formVisible = true;
|
||||
//3是开始 4是结束 5是详情
|
||||
this.type = type
|
||||
this.deviceInspectTake = row;
|
||||
if(type == 3){
|
||||
this.formName='add'
|
||||
}else if(type == 4){
|
||||
this.formName='edit'
|
||||
}else if(type == 5){
|
||||
this.formName='detail'
|
||||
}
|
||||
},
|
||||
deleteDialog(rowId) {
|
||||
this.$confirm('此操作将永久删除该巡检任务, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let params = {id: rowId};
|
||||
this.loading = true;
|
||||
deleteInspectPlan(params).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code === 20000) {
|
||||
this.$message.success("删除成功!");
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
handleDetail(row){
|
||||
this.selectDeviceInspecTakeDetail({taskOrderIdFk:row.orderId})
|
||||
},
|
||||
selectDeviceInspecTakeDetail(obj) {
|
||||
selectDeviceInspecTakeDetail(obj).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code === 20000) {
|
||||
this.delectList = res.data || [];
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
this.delectList = [];
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$message.error(error.message);
|
||||
this.delectList = [];
|
||||
})
|
||||
},
|
||||
closeDialog() {
|
||||
this.formVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
datailSelect(row){
|
||||
this.detailQuery = row
|
||||
this.deviceProjectSelectVisible = true
|
||||
},
|
||||
|
||||
showImgViewer(row) {
|
||||
if (row.inspectImage.substr(-1) == ',') {
|
||||
row.inspectImage = row.inspectImage.slice(0, row.inspectImage.length - 1);
|
||||
}
|
||||
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
|
||||
this.imgList = [];
|
||||
previewImage({imageUrl: row.inspectImage, certFileUrl: this.certFileUrl}).then(response => {
|
||||
if (response.code === 20000) {
|
||||
this.imgList = response.data;
|
||||
}
|
||||
console.log(this.imgList)
|
||||
this.imgViewerVisible = true;
|
||||
});
|
||||
const m = (e) => {
|
||||
e.preventDefault()
|
||||
};
|
||||
document.body.style.overflow = 'hidden';
|
||||
document.addEventListener("touchmove", m, false); // 禁止页面滑动
|
||||
|
||||
},
|
||||
closeImgViewer() {
|
||||
this.imgViewerVisible = false;
|
||||
const m = (e) => {
|
||||
e.preventDefault()
|
||||
};
|
||||
document.body.style.overflow = 'auto';
|
||||
document.removeEventListener("touchmove", m, true);
|
||||
},
|
||||
|
||||
},
|
||||
components: {deviceInspectTakeAuditModify,ElImageViewer,DeviceInspectTakeDetail},
|
||||
mounted() {
|
||||
document.body.ondrop = function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getDeptList();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style type="text/scss" lang="scss">
|
||||
</style>
|
||||
|
@ -0,0 +1,743 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card style="margin: 5px;margin-top: -20px">
|
||||
<el-form :model="inspectTake" ref="formRef" label-width="120px" style="margin-bottom: -15px" :rules="rules">
|
||||
<el-button-group style="display: flex;margin: 0px 0 10px 75%; height: 35px" v-if="type != 3">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click.native="selectDevice()"
|
||||
>选择设备
|
||||
</el-button>
|
||||
<el-button type="primary" v-if="inspectTake.status == 0" @click.native="submit(0)">草稿保存</el-button>
|
||||
<el-button type="primary" @click.native="submit(2)">提交</el-button>
|
||||
</el-button-group>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item class="query-form-item" label="部门:" prop="deptCode">
|
||||
<el-select v-model="inspectTake.deptCode" placeholder="请选择部门" clearable="true"
|
||||
:disabled="inspectTake.code != null"
|
||||
@change="deptChange" style="width: 90%">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="10">
|
||||
<el-form-item class="query-form-item" label="仓库:" prop="invCode">
|
||||
<el-select v-model="inspectTake.invCode" placeholder="请选择仓库"
|
||||
:disabled="inspectTake.code != null"
|
||||
clearable="true" style="width: 90%">
|
||||
<el-option
|
||||
v-for="item in invList"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="设备名称:" prop="deviceName">
|
||||
<el-input v-model="inspectTake.deviceName" disabled placeholder="请输入设备名称" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="物资编码:" prop="code">
|
||||
<el-input v-model="inspectTake.code" disabled placeholder="请输入编码" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="ischeck">
|
||||
<el-col :span="10">
|
||||
<el-form-item class="query-form-item" label="维修类型:" prop="repairType">
|
||||
<el-select v-model="inspectTake.repairType"
|
||||
:disabled="formName == 'edit' || type == 3"
|
||||
placeholder="请选择维修类型" style="width: 90%" clearable>
|
||||
<el-option label="自行维修" :value=1></el-option>
|
||||
<el-option label="外部维修" :value=2></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="10">
|
||||
<el-form-item class="query-form-item" label="紧急程度:" prop="level">
|
||||
<el-select v-model="inspectTake.level"
|
||||
:disabled="formName == 'edit' || type == 3"
|
||||
placeholder="请选择紧急程度" style="width: 90%" clearable>
|
||||
<el-option label="正常" :value=1></el-option>
|
||||
<el-option label="较急" :value=2></el-option>
|
||||
<el-option label="特急" :value=3></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="负责人:" prop="inspectUser">
|
||||
<el-select v-model="inspectTake.inspectUser"
|
||||
:disabled="type == 3"
|
||||
placeholder="请选择负责人" clearable
|
||||
style="width: 90%">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.userid"
|
||||
:label="item.employeeName"
|
||||
:value="item.userid">
|
||||
<span style="float: left">{{ item.employeeName }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="任务类型:" prop="type">
|
||||
<el-select v-model="inspectTake.type" style="width: 90%"
|
||||
:disabled="formName == 'edit' || type == 3 || delectList.length > 0"
|
||||
@change="repairType"
|
||||
placeholder="请选择任务类型"
|
||||
>
|
||||
<el-option label="巡检" :value="1"></el-option>
|
||||
<el-option label="养护" :value="2"></el-option>
|
||||
<el-option label="报修" :value="3"></el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-col :span="10">
|
||||
<el-form-item label="预期结束时间:" prop="expectedTime">
|
||||
<el-date-picker
|
||||
v-model="inspectTake.expectedTime"
|
||||
type="datetime"
|
||||
placeholder="选择任务预期结束时间"
|
||||
style="width: 90%"
|
||||
:disabled="type == 3"
|
||||
:picker-options="pickerOptionsExpected"
|
||||
:clearable="false"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="提醒时间:" prop="remindTime">
|
||||
<el-date-picker
|
||||
v-model="inspectTake.remindTime"
|
||||
type="datetime"
|
||||
placeholder="选择提醒时间"
|
||||
style="width: 90%"
|
||||
:disabled="type == 3"
|
||||
:picker-options="pickerOptionsExpected"
|
||||
:clearable="false"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input type="textarea" :rows="3"
|
||||
:disabled="type == 3"
|
||||
v-model="inspectTake.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 10px">
|
||||
<el-button type="primary" @click.native.stop="selectPlanFunction(null)" v-if="type != 3" :loading="loading">
|
||||
选入
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
|
||||
<el-button type="primary" @click.native.stop="setPlanFunction(null)" v-if="type != 3" :loading="loading">
|
||||
新增
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="delectList" style="width: 100%;" border highlight-current-row max-height="300" height="500"
|
||||
ref="multipleTable">
|
||||
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||
<el-table-column label="项目内容" prop="projectContent" width="400"></el-table-column>
|
||||
<el-table-column label="状态" prop="status" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag>{{ statusMap[scope.row.status] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现场照片" prop="inspectImage" width="250">
|
||||
<template slot-scope="scope">
|
||||
<div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.inspectImage }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" v-if="type != 3" @click.native.stop="editDialog(scope.row,'edit')">编辑</el-button>
|
||||
<el-button type="text" size="small" @click.native.stop="editDialog(scope.row,'detail')">详情</el-button>
|
||||
<el-button type="text" size="small" @click.native.stop="delectPlanFunction(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog
|
||||
:title="name"
|
||||
:visible.sync="inspectTakeSetVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="45%"
|
||||
append-to-body
|
||||
v-if="inspectTakeSetVisible"
|
||||
>
|
||||
<DeviceInspectTakeProjectSet
|
||||
:inputQuery="inputQuery"
|
||||
:editType="editType"
|
||||
:type="type"
|
||||
check="ckeck"
|
||||
:closeDialog="inspectTakeSetCloseDialog"
|
||||
></DeviceInspectTakeProjectSet>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="项目选入"
|
||||
:visible.sync="inspectSelectPlanSetVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="80%"
|
||||
append-to-body
|
||||
v-if="inspectSelectPlanSetVisible"
|
||||
>
|
||||
<DeviceProjectSelectTake
|
||||
:inputQuery="inputQuery"
|
||||
:type="inspectTake.type"
|
||||
:closeDialog="inspectPlanSetCloseDialog"
|
||||
></DeviceProjectSelectTake>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="选择巡检设备"
|
||||
:visible.sync="deviceDialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="65%"
|
||||
v-if="deviceDialogVisible"
|
||||
append-to-body
|
||||
>
|
||||
<el-card>
|
||||
<el-form class="query-form" :model="filterQuery" :inline="true" label-width="100px">
|
||||
<el-form-item class="query-form-item" label="部门:">
|
||||
<el-input v-model="deptName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="query-form-item" label="仓库:">
|
||||
<el-input v-model="invName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="query-form-item" label="资产编码:">
|
||||
<el-input v-model="filterQuery.code" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
|
||||
<el-button type="primary" icon="search" @click="queryDevice"
|
||||
>查询
|
||||
</el-button
|
||||
>
|
||||
<el-button type="primary" icon="search" @click="combine">确定</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
|
||||
<el-table v-loading="deviceLoading" :data="deviceList" style="width: 100%" highlight-current-row border
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column label="设备名称" prop="deviceName" width="200"></el-table-column>
|
||||
<el-table-column label="资产编码" prop="code" width="200"></el-table-column>
|
||||
<el-table-column label="规格型号" prop="ggxh" width="120"></el-table-column>
|
||||
<el-table-column label="批次号" prop="batchNo" width="120"></el-table-column>
|
||||
<el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column>
|
||||
<el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>
|
||||
<el-table-column label="生产厂家" prop="manufactory" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="供应商" prop="supName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="注册证号" prop="zczbhhzbapzbh" width="150" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="deviceTotal>0"
|
||||
:total="deviceTotal"
|
||||
:limit.sync="filterQuery.limit"
|
||||
:page.sync="filterQuery.page"
|
||||
@pagination="getDeviceList"
|
||||
></pagination>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {isBlank} from "@/utils/strUtil";
|
||||
import {getDeptListByUser} from "@/api/auth/authDept";
|
||||
import {getInvListByUser, warehouseUserList} from "@/api/system/invWarehouse";
|
||||
import DeviceInspectTakeProjectSet from "@/views/inventory/DeviceInspectTakeProjectSet"
|
||||
import {
|
||||
delectDeviceInspecTakeDetail,
|
||||
saveDeviceInspectTake,
|
||||
selectDeviceInspecTakeDetail,
|
||||
uploadDeviceTake
|
||||
} from "@/api/inventory/deviceInspectTake";
|
||||
import {previewImage, previewFile} from "@/api/purchase/supCompany";
|
||||
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
|
||||
import {getDeptDeviceList} from "@/api/inventory/deptDevice";
|
||||
import DeviceProjectSelectTake from "@/views/inventory/DeviceProjectSelectTake"
|
||||
|
||||
|
||||
export default {
|
||||
props: {
|
||||
inspectTake: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true
|
||||
},
|
||||
formName: {
|
||||
type: Function,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
name: "DeviceInspectTakeAdd",
|
||||
data() {
|
||||
return {
|
||||
deptList: [],
|
||||
invList: [],
|
||||
userList: [],
|
||||
imgList: [],
|
||||
name: '',
|
||||
BASE_URL: process.env.VUE_APP_BASE_API,
|
||||
editType: null,
|
||||
deviceDialogVisible: false,
|
||||
deviceLoading: false,
|
||||
filterQuery: {
|
||||
code: null,
|
||||
deptCode: null,
|
||||
invCode: null,
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
loading: false,
|
||||
inputQuery: {
|
||||
id: null,
|
||||
projectCode: null,
|
||||
projectContent: null,
|
||||
status: null,
|
||||
result: null,
|
||||
inspectImage: null,
|
||||
inspectUser: null,
|
||||
updateTime: null,
|
||||
taskOrderIdFk: null
|
||||
},
|
||||
ischeck: false,
|
||||
deviceList: [],
|
||||
delectList: [],
|
||||
deviceTotal: 0,
|
||||
deptName: null,
|
||||
invName: null,
|
||||
selectRow: null,
|
||||
imgViewerVisible: false,
|
||||
inspectTakeSetVisible: false,
|
||||
inspectSelectPlanSetVisible: false,
|
||||
rules: {
|
||||
deptCode: [{required: true, message: "请选择部门!", trigger: 'blur'}],
|
||||
invCode: [{required: true, message: "请选择仓库!", trigger: 'blur'}],
|
||||
deviceName: [{required: true, message: "请输入设备名称!", trigger: 'blur'}],
|
||||
code: [{required: true, message: "请输入物资编码!", trigger: 'blur'}],
|
||||
type: [{required: true, message: "请选择类型!", trigger: 'blur'}],
|
||||
repairType: [{required: true, message: "请选择维修类型!", trigger: 'blur'}],
|
||||
level: [{required: true, message: "请选择紧急程度!", trigger: 'blur'}],
|
||||
},
|
||||
statusMap: {
|
||||
1: "未开始",
|
||||
2: "已检查",
|
||||
3: "异常",
|
||||
4: "不巡检",
|
||||
},
|
||||
pickerOptionsExpected: {
|
||||
disabledDate: (time) => {
|
||||
return time.getTime() <= new Date(this.inspectTake.createDate).getTime() - 86400000;
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
deptChange() {
|
||||
this.inspectTake.invCode = null;
|
||||
this.invList = [];
|
||||
this.getInvList();
|
||||
},
|
||||
getDeptList() {
|
||||
getDeptListByUser().then((res) => {
|
||||
this.deptList = res.data || [];
|
||||
this.getInvList();
|
||||
});
|
||||
},
|
||||
repairType(val) {
|
||||
if (val == 3) {
|
||||
//报修
|
||||
this.ischeck = true;
|
||||
} else
|
||||
this.ischeck = false;
|
||||
|
||||
},
|
||||
getInvList() {
|
||||
let params = {deptCode: this.inspectTake.deptCode};
|
||||
getInvListByUser(params)
|
||||
.then((response) => {
|
||||
this.invList = response.data || [];
|
||||
this.getList();
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
submit(status) {
|
||||
this.$refs["formRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if(status == 2){
|
||||
if(isBlank(this.inspectTake.inspectUser)){
|
||||
return this.$message.error("负责人不能为空");
|
||||
}
|
||||
if(isBlank(this.inspectTake.expectedTime)){
|
||||
return this.$message.error("预期结束时间不能为空");
|
||||
}
|
||||
}
|
||||
//当类型是报修的话
|
||||
if(this.inspectTake.type == 3){
|
||||
if(isBlank(this.inspectTake.repairType)){
|
||||
return this.$message.error("维修类型不能为空");
|
||||
}
|
||||
if(isBlank(this.inspectTake.level)){
|
||||
return this.$message.error("紧急程度不能为空");
|
||||
}
|
||||
}
|
||||
if (this.formName == "add" && isBlank(this.inspectTake.id)) {
|
||||
this.inspectTake.status = status
|
||||
saveDeviceInspectTake(this.inspectTake,'add').then((res) => {
|
||||
if (res.code === 20000) {
|
||||
this.$message.success("提交成功");
|
||||
this.closeDialog();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
} else {
|
||||
this.inspectTake.status = status
|
||||
uploadDeviceTake(this.inspectTake).then((res) => {
|
||||
if (res.code === 20000) {
|
||||
this.$message.success("提交成功");
|
||||
this.closeDialog();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onReset() {
|
||||
this.filterQuery.code = null;
|
||||
this.filterQuery.page = 1;
|
||||
this.getDeviceList();
|
||||
},
|
||||
queryDevice() {
|
||||
this.filterQuery.page = 1;
|
||||
this.getDeviceList();
|
||||
},
|
||||
|
||||
combine() {
|
||||
if( this.selectRow == null){
|
||||
return this.$message.error("请选择设备!");
|
||||
}
|
||||
this.deviceDialogVisible = false;
|
||||
this.inspectTake.code = this.selectRow.code;
|
||||
this.inspectTake.deviceName = this.selectRow.deviceName;
|
||||
},
|
||||
|
||||
//!-------------------------------------------------------------- 新加方法 --------------------------------------------------------- //
|
||||
selectDeviceInspecTakeDetail(obj) {
|
||||
selectDeviceInspecTakeDetail(obj).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code === 20000) {
|
||||
this.delectList = res.data || [];
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
this.delectList = [];
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$message.error(error.message);
|
||||
this.delectList = [];
|
||||
})
|
||||
},
|
||||
getUserBus() {
|
||||
let query = {
|
||||
code: this.inspectTake.invCode,
|
||||
}
|
||||
//加载用户数据
|
||||
warehouseUserList(query).then((res) => {
|
||||
this.userList = [];
|
||||
this.userList = res.data.list;
|
||||
}).catch((error) => {
|
||||
this.$message.error("用户数据加载失败")
|
||||
});
|
||||
},
|
||||
setPlanFunction(row) {
|
||||
if (this.inspectTake.orderId != null) { //edit
|
||||
if (isBlank(row)) {
|
||||
this.inputQuery = {};
|
||||
this.inputQuery.status = 1;
|
||||
this.inputQuery.taskOrderIdFk = this.inspectTake.orderId
|
||||
} else {
|
||||
this.inputQuery = row
|
||||
}
|
||||
this.inspectTakeSetVisible = true;
|
||||
} else { // add
|
||||
this.$refs["formRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.inspectTake.type = this.inspectTake.type
|
||||
this.inspectTake.status = 0;
|
||||
let formName = isBlank(this.inspectTake.id) ? "add" : "edit";
|
||||
saveDeviceInspectTake(this.inspectTake, formName).then((res) => {
|
||||
if (res.code === 20000) {
|
||||
this.inspectTake.id = res.data.id;
|
||||
this.inspectTake.orderId = res.data.orderId;
|
||||
this.inputQuery.taskOrderIdFk = this.inspectTake.orderId
|
||||
this.inputQuery.projectCode = res.data.code;
|
||||
this.inspectTakeSetVisible = true;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
selectPlanFunction(row) {
|
||||
if (this.inspectTake.orderId != null) { //edit
|
||||
if (isBlank(row)) {
|
||||
this.inputQuery = {};
|
||||
this.inputQuery.taskOrderIdFk = this.inspectTake.orderId
|
||||
this.inputQuery.projectCode = this.inspectTake.code
|
||||
} else {
|
||||
this.inputQuery = row
|
||||
}
|
||||
this.inspectSelectPlanSetVisible = true;
|
||||
} else {
|
||||
this.$refs["formRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.inspectTake.type = this.inspectTake.type
|
||||
this.inspectTake.status = 0;
|
||||
let formName = isBlank(this.inspectTake.id) ? "add" : "edit";
|
||||
saveDeviceInspectTake(this.inspectTake, formName).then((res) => {
|
||||
if (res.code === 20000) {
|
||||
this.inspectTake.id = res.data.id;
|
||||
this.inspectTake.orderId = res.data.orderId;
|
||||
this.inspectTake.code = res.data.code;
|
||||
this.inputQuery = {};
|
||||
this.inputQuery.taskOrderIdFk = res.data.orderId
|
||||
this.inputQuery.projectCode = res.data.code;
|
||||
this.inspectSelectPlanSetVisible = true;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
inspectPlanSetCloseDialog() {
|
||||
this.inspectPlanSetVisible = false;
|
||||
this.inspectSelectPlanSetVisible = false;
|
||||
this.selectDeviceInspecTakeDetail({taskOrderIdFk: this.inspectTake.orderId});
|
||||
|
||||
},
|
||||
|
||||
selectDevice() {
|
||||
if (isBlank(this.inspectTake.deptCode) || isBlank(this.inspectTake.invCode)) {
|
||||
this.$message.warning("请先选择巡检设备所属部门和仓库");
|
||||
return;
|
||||
}
|
||||
this.setDeptAnInvName();
|
||||
this.deviceDialogVisible = true;
|
||||
this.filterQuery = {
|
||||
code: null,
|
||||
deptCode: this.inspectTake.deptCode,
|
||||
invCode: this.inspectTake.invCode,
|
||||
page: 1,
|
||||
limit: 10
|
||||
}
|
||||
this.getDeviceList();
|
||||
},
|
||||
|
||||
setDeptAnInvName() {
|
||||
this.deptList.forEach((item) => {
|
||||
if (item.code === this.inspectTake.deptCode) {
|
||||
this.deptName = item.name;
|
||||
}
|
||||
});
|
||||
|
||||
this.invList.forEach((item) => {
|
||||
if (item.code === this.inspectTake.invCode) {
|
||||
this.invName = item.name;
|
||||
}
|
||||
})
|
||||
},
|
||||
getDeviceList() {
|
||||
this.deviceLoading = true;
|
||||
this.deviceList = [];
|
||||
getDeptDeviceList(this.filterQuery).then((res) => {
|
||||
this.deviceLoading = false;
|
||||
if (res.code === 20000) {
|
||||
this.deviceList = res.data.list || [];
|
||||
this.deviceTotal = res.data.total || 0;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
this.deviceList = [];
|
||||
this.deviceTotal = 0;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.deviceLoading = false;
|
||||
this.deviceList = [];
|
||||
this.deviceTotal = 0;
|
||||
});
|
||||
},
|
||||
handleCurrentChange(row) {
|
||||
this.selectRow = row;
|
||||
},
|
||||
|
||||
editDialog(row, type) {
|
||||
this.inputQuery = row;
|
||||
this.inspectTakeSetVisible = true
|
||||
if (type == 'edit') {
|
||||
this.editType = 1;
|
||||
this.name = "巡检任务编辑"
|
||||
} else if (type == 'detail') {
|
||||
this.editType = 2;
|
||||
this.name = "巡检任务详情"
|
||||
} else {
|
||||
this.editType = 3;
|
||||
}
|
||||
},
|
||||
delectPlanFunction(row) {
|
||||
delectDeviceInspecTakeDetail({id: row.id}).then((res) => {
|
||||
if (res.code == 20000) {
|
||||
this.selectDeviceInspecTakeDetail({taskOrderIdFk: this.inspectTake.orderId});
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
showImgViewer(row) {
|
||||
if (row.inspectImage.substr(-1) == ',') {
|
||||
row.inspectImage = row.inspectImage.slice(0, row.inspectImage.length - 1);
|
||||
}
|
||||
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
|
||||
this.imgList = [];
|
||||
previewImage({imageUrl: row.inspectImage, certFileUrl: this.certFileUrl}).then(response => {
|
||||
if (response.code === 20000) {
|
||||
this.imgList = response.data;
|
||||
}
|
||||
console.log(this.imgList)
|
||||
this.imgViewerVisible = true;
|
||||
});
|
||||
const m = (e) => {
|
||||
e.preventDefault()
|
||||
};
|
||||
document.body.style.overflow = 'hidden';
|
||||
document.addEventListener("touchmove", m, false); // 禁止页面滑动
|
||||
|
||||
},
|
||||
closeImgViewer() {
|
||||
this.imgViewerVisible = false;
|
||||
const m = (e) => {
|
||||
e.preventDefault()
|
||||
};
|
||||
document.body.style.overflow = 'auto';
|
||||
document.removeEventListener("touchmove", m, true);
|
||||
},
|
||||
inspectTakeSetCloseDialog() {
|
||||
this.inspectTakeSetVisible = false
|
||||
this.selectDeviceInspecTakeDetail({taskOrderIdFk: this.inspectTake.orderId});
|
||||
}
|
||||
}
|
||||
,
|
||||
components: {
|
||||
DeviceInspectTakeProjectSet, ElImageViewer, DeviceProjectSelectTake
|
||||
}
|
||||
,
|
||||
created() {
|
||||
this.inspectTake.createDate = new Date().getTime();
|
||||
this.getDeptList();
|
||||
this.getUserBus();
|
||||
if (!isBlank(this.inspectTake.id)) {
|
||||
this.selectDeviceInspecTakeDetail({taskOrderIdFk: this.inspectTake.orderId});
|
||||
if (this.inspectTake.type == 3) {
|
||||
this.ischeck = true //报修字段显示
|
||||
}
|
||||
}
|
||||
}
|
||||
,
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,526 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card style="margin: 5px;margin-top: -20px">
|
||||
<el-form :model="inspectTake" ref="formRef" label-width="120px" style="margin-bottom: -15px">
|
||||
<el-button-group style="display: flex;margin: 0px 0 10px 90%; height: 35px">
|
||||
<el-button type="primary" v-if="type != 5" @click.native="submit(type)">提交</el-button>
|
||||
</el-button-group>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item class="query-form-item" label="部门:" prop="deptCode">
|
||||
<el-select v-model="inspectTake.deptCode" placeholder="请选择部门" clearable="true"
|
||||
:disabled="inspectTake.id !== null" @change="deptChange" style="width: 90%">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="10">
|
||||
<el-form-item class="query-form-item" label="仓库:" prop="invCode">
|
||||
<el-select v-model="inspectTake.invCode" :disabled="inspectTake.id !== null" placeholder="请选择仓库"
|
||||
clearable="true" style="width: 90%">
|
||||
<el-option
|
||||
v-for="item in invList"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="设备名称:" prop="deviceName">
|
||||
<el-input v-model="inspectTake.deviceName" disabled placeholder="请输入设备名称" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="物资编码:" prop="code">
|
||||
<el-input v-model="inspectTake.code" disabled placeholder="请输入编码" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="type == 5">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="开始时间:" prop="deviceName">
|
||||
<el-input v-model="inspectTake.strartTime" disabled placeholder="请输入开始时间" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="结束时间:" prop="code">
|
||||
<el-input v-model="inspectTake.endTime" disabled placeholder="请输入结束时间" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="任务类型:" prop="type">
|
||||
<el-select v-model="inspectTake.type" style="width: 90%"
|
||||
@change="repairType"
|
||||
disabled placeholder="请选择任务类型" clearable="true">
|
||||
<el-option label="巡检" :value="1"></el-option>
|
||||
<el-option label="养护" :value="2"></el-option>
|
||||
<el-option label="报修" :value="3"></el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="负责人:" prop="inspectUser">
|
||||
<el-select v-model="inspectTake.inspectUser" disabled placeholder="请选择负责人" clearable
|
||||
style="width: 90%">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.userid"
|
||||
:label="item.employeeName"
|
||||
:value="item.userid">
|
||||
<span style="float: left">{{ item.employeeName }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="ischeck">
|
||||
<el-col :span="10">
|
||||
<el-form-item class="query-form-item" label="维修类型:" prop="repairType">
|
||||
<el-select v-model="inspectTake.repairType"
|
||||
disabled
|
||||
placeholder="请选择维修类型" style="width: 90%" clearable>
|
||||
<el-option label="自行维修" :value=1></el-option>
|
||||
<el-option label="外部维修" :value=2></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="10">
|
||||
<el-form-item class="query-form-item" label="紧急程度:" prop="level">
|
||||
<el-select v-model="inspectTake.level"
|
||||
disabled
|
||||
placeholder="请选择紧急程度" style="width: 90%" clearable>
|
||||
<el-option label="正常" :value=1></el-option>
|
||||
<el-option label="较急" :value=2></el-option>
|
||||
<el-option label="特急" :value=3></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" :rows="3" :disabled="editType == 2 || type == 5"
|
||||
v-model="inspectTake.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 10px">
|
||||
<el-button type="primary" @click.native.stop="selectPlanFunction(null)" v-if="type != 5" :loading="loading">
|
||||
选入
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
|
||||
<el-button type="primary" @click.native.stop="setPlanFunction(null)" :loading="loading" v-if="type != 5">新增
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="delectList" style="width: 100%;" border highlight-current-row max-height="300" height="500"
|
||||
ref="multipleTable">
|
||||
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||
<el-table-column label="项目内容" prop="projectContent" width="400"></el-table-column>
|
||||
<el-table-column label="状态" prop="status" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag>{{ statusMap[scope.row.status] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现场照片" prop="inspectImage" width="250">
|
||||
<template slot-scope="scope">
|
||||
<div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.inspectImage }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" v-if="type != 5" @click.native.stop="editDialog(scope.row,'edit')">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button type="text" size="small" @click.native.stop="editDialog(scope.row,'detail')">详情</el-button>
|
||||
<el-button type="text" size="small" @click.native.stop="delectPlanFunction(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
:title="name"
|
||||
:visible.sync="inspectTakeSetVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="45%"
|
||||
append-to-body
|
||||
v-if="inspectTakeSetVisible"
|
||||
>
|
||||
<DeviceInspectTakeProjectSet
|
||||
:inputQuery="inputQuery"
|
||||
:editType="editType"
|
||||
:type="type"
|
||||
:closeDialog="inspectTakeSetCloseDialog"
|
||||
></DeviceInspectTakeProjectSet>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="项目选入"
|
||||
:visible.sync="inspectSelectPlanSetVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="80%"
|
||||
append-to-body
|
||||
v-if="inspectSelectPlanSetVisible"
|
||||
>
|
||||
<DeviceProjectSelectTake
|
||||
:inputQuery="inputQuery"
|
||||
:type="inspectTake.type"
|
||||
:closeDialog="inspectTakeSetCloseDialog"
|
||||
></DeviceProjectSelectTake>
|
||||
</el-dialog>
|
||||
|
||||
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {isBlank} from "@/utils/strUtil";
|
||||
import {getDeptListByUser} from "@/api/auth/authDept";
|
||||
import {getInvListByUser, warehouseUserList} from "@/api/system/invWarehouse";
|
||||
import DeviceInspectTakeProjectSet from "@/views/inventory/DeviceInspectTakeProjectSet"
|
||||
import {
|
||||
delectDeviceInspecTakeDetail,
|
||||
saveDeviceInspectTake,
|
||||
selectDeviceInspecTakeDetail,
|
||||
uploadDeviceInspecTake
|
||||
} from "@/api/inventory/deviceInspectTake";
|
||||
import {previewImage, previewFile} from "@/api/purchase/supCompany";
|
||||
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
|
||||
import DeviceProjectSelectTake from "@/views/inventory/DeviceProjectSelectTake"
|
||||
|
||||
export default {
|
||||
props: {
|
||||
inspectTake: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
name: "DeviceInspectPlanAuditModify",
|
||||
data() {
|
||||
return {
|
||||
deptList: [],
|
||||
invList: [],
|
||||
userList: [],
|
||||
imgList: [],
|
||||
name: '',
|
||||
isColse: false,
|
||||
BASE_URL: process.env.VUE_APP_BASE_API,
|
||||
editType: null,
|
||||
deviceDialogVisible: false,
|
||||
deviceLoading: false,
|
||||
filterQuery: {
|
||||
code: null,
|
||||
deptCode: null,
|
||||
invCode: null,
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
loading: false,
|
||||
inputQuery: {
|
||||
id: null,
|
||||
projectCode: null,
|
||||
projectContent: null,
|
||||
status: null,
|
||||
result: null,
|
||||
inspectImage: null,
|
||||
inspectUser: null,
|
||||
updateTime: null,
|
||||
taskOrderIdFk: null
|
||||
},
|
||||
ischeck: false,
|
||||
deviceList: [],
|
||||
delectList: [],
|
||||
deviceTotal: 0,
|
||||
deptName: null,
|
||||
invName: null,
|
||||
selectRow: null,
|
||||
imgViewerVisible: false,
|
||||
inspectTakeSetVisible: false,
|
||||
inspectSelectPlanSetVisible: false,
|
||||
statusMap: {
|
||||
1: "未开始",
|
||||
2: "已检查",
|
||||
3: "异常",
|
||||
4: "不巡检",
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
deptChange() {
|
||||
this.inspectTake.invCode = null;
|
||||
this.invList = [];
|
||||
this.getInvList();
|
||||
},
|
||||
getDeptList() {
|
||||
getDeptListByUser().then((res) => {
|
||||
this.deptList = res.data || [];
|
||||
this.getInvList();
|
||||
});
|
||||
},
|
||||
getInvList() {
|
||||
let params = {deptCode: this.inspectTake.deptCode};
|
||||
getInvListByUser(params)
|
||||
.then((response) => {
|
||||
this.invList = response.data || [];
|
||||
this.getList();
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
submit(status) {
|
||||
//判断状态
|
||||
if (this.type == 4) {
|
||||
for (var i = 0; i < this.delectList.length; i++) {
|
||||
if (this.delectList[i].status != 2) {
|
||||
return this.$message.error("还有任务未检查!");
|
||||
}
|
||||
}
|
||||
}
|
||||
this.inspectTake.status = status
|
||||
uploadDeviceInspecTake(this.inspectTake).then((res) => {
|
||||
if (res.code === 20000) {
|
||||
this.$message.success("提交成功");
|
||||
this.closeDialog();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
},
|
||||
combine() {
|
||||
this.deviceDialogVisible = false;
|
||||
this.inspectTake.code = this.selectRow.code;
|
||||
this.inspectTake.deviceName = this.selectRow.deviceName;
|
||||
},
|
||||
|
||||
//!-------------------------------------------------------------- 新加方法 --------------------------------------------------------- //
|
||||
repairType(val) {
|
||||
if (val == 3) {
|
||||
//报修
|
||||
this.ischeck = true;
|
||||
} else
|
||||
this.ischeck = false;
|
||||
},
|
||||
delectPlanFunction(row) {
|
||||
delectDeviceInspecTakeDetail({id: row.id}).then((res) => {
|
||||
if (res.code == 20000) {
|
||||
this.selectDeviceInspecTakeDetail({taskOrderIdFk: this.inspectTake.orderId});
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
|
||||
selectDeviceInspecTakeDetail(obj) {
|
||||
selectDeviceInspecTakeDetail(obj).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code === 20000) {
|
||||
this.delectList = res.data || [];
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
this.delectList = [];
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$message.error(error.message);
|
||||
this.delectList = [];
|
||||
})
|
||||
},
|
||||
getUserBus() {
|
||||
let query = {
|
||||
code: this.inspectTake.invCode,
|
||||
}
|
||||
//加载用户数据
|
||||
warehouseUserList(query).then((res) => {
|
||||
this.userList = [];
|
||||
this.userList = res.data.list;
|
||||
}).catch((error) => {
|
||||
this.$message.error("用户数据加载失败")
|
||||
});
|
||||
},
|
||||
setPlanFunction(row) {
|
||||
this.name = "巡检任务添加"
|
||||
if (this.inspectTake.id != null) {
|
||||
if (isBlank(row)) {
|
||||
this.inputQuery = {
|
||||
id: null,
|
||||
projectCode: null,
|
||||
projectContent: null,
|
||||
status: null,
|
||||
result: null,
|
||||
inspectImage: null,
|
||||
inspectUser: null,
|
||||
updateTime: null,
|
||||
taskOrderIdFk: null
|
||||
},
|
||||
this.inputQuery.status = 1
|
||||
this.inputQuery.inspectUser = this.inspectTake.inspectUser
|
||||
this.inputQuery.taskOrderIdFk = this.inspectTake.orderId
|
||||
} else {
|
||||
this.inputQuery = row
|
||||
}
|
||||
this.inspectTakeSetVisible = true;
|
||||
} else {
|
||||
this.inputQuery.taskOrderIdFk = this.inspectTake.orderId
|
||||
this.inspectTakeSetVisible = true;
|
||||
}
|
||||
},
|
||||
selectPlanFunction(row) {
|
||||
if (this.inspectTake.orderId != null) { //edit
|
||||
if (isBlank(row)) {
|
||||
this.inputQuery = {
|
||||
id: null,
|
||||
projectCode: null,
|
||||
projectContent: null,
|
||||
status: null,
|
||||
result: null,
|
||||
inspectImage: null,
|
||||
inspectUser: null,
|
||||
updateTime: null,
|
||||
taskOrderIdFk: null
|
||||
},
|
||||
this.inputQuery.inspectUser = this.inspectTake.inspectUser
|
||||
this.inputQuery.taskOrderIdFk = this.inspectTake.orderId
|
||||
} else {
|
||||
this.inputQuery = row
|
||||
}
|
||||
} else {
|
||||
this.inputQuery.taskOrderIdFk = this.inspectTake.orderId
|
||||
}
|
||||
this.inspectSelectPlanSetVisible = true;
|
||||
},
|
||||
editDialog(row, type) {
|
||||
this.inputQuery = row;
|
||||
this.inspectTakeSetVisible = true
|
||||
if (type == 'edit') {
|
||||
this.editType = 1;
|
||||
this.name = "巡检任务编辑"
|
||||
} else if (type == 'detail') {
|
||||
this.editType = 2;
|
||||
this.name = "巡检任务详情"
|
||||
} else {
|
||||
this.editType = 3;
|
||||
}
|
||||
},
|
||||
|
||||
showImgViewer(row) {
|
||||
if (row.inspectImage.substr(-1) == ',') {
|
||||
row.inspectImage = row.inspectImage.slice(0, row.inspectImage.length - 1);
|
||||
}
|
||||
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
|
||||
this.imgList = [];
|
||||
previewImage({imageUrl: row.inspectImage, certFileUrl: this.certFileUrl}).then(response => {
|
||||
if (response.code === 20000) {
|
||||
this.imgList = response.data;
|
||||
}
|
||||
console.log(this.imgList)
|
||||
this.imgViewerVisible = true;
|
||||
});
|
||||
const m = (e) => {
|
||||
e.preventDefault()
|
||||
};
|
||||
document.body.style.overflow = 'hidden';
|
||||
document.addEventListener("touchmove", m, false); // 禁止页面滑动
|
||||
|
||||
},
|
||||
closeImgViewer() {
|
||||
this.imgViewerVisible = false;
|
||||
const m = (e) => {
|
||||
e.preventDefault()
|
||||
};
|
||||
document.body.style.overflow = 'auto';
|
||||
document.removeEventListener("touchmove", m, true);
|
||||
},
|
||||
inspectTakeSetCloseDialog(obj) {
|
||||
this.selectDeviceInspecTakeDetail({taskOrderIdFk: this.inspectTake.orderId});
|
||||
this.inspectTakeSetVisible = false
|
||||
this.inspectSelectPlanSetVisible = false
|
||||
if (isBlank(obj)) {
|
||||
var count = 0;
|
||||
if (this.type == 4) {
|
||||
for (var i = 0; i < this.delectList.length; i++) {
|
||||
if (this.delectList[i].status != 2) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count == 0) {
|
||||
return this.$message.success("任务已全部完成")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
,
|
||||
components: {
|
||||
DeviceInspectTakeProjectSet, ElImageViewer, DeviceProjectSelectTake
|
||||
}
|
||||
,
|
||||
created() {
|
||||
this.getDeptList();
|
||||
this.getUserBus();
|
||||
if (!isBlank(this.inspectTake.id)) {
|
||||
this.selectDeviceInspecTakeDetail({taskOrderIdFk: this.inspectTake.orderId});
|
||||
if (this.inspectTake.type == 3) {
|
||||
this.ischeck = true
|
||||
}
|
||||
}
|
||||
}
|
||||
,
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card style="margin: 5px;margin-top: -20px">
|
||||
<el-form label-width="100px" :model="detailQuery" style="width: 100%; margin: auto;" ref="formRef">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-form-item class="query-form-item" label="项目编码:" prop="projectCode">
|
||||
<el-input v-model="detailQuery.projectCode" disabled placeholder="请输入项目编码" style="width: 100%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-form-item class="query-form-item" label="状态:" prop="status">
|
||||
<el-select v-model="detailQuery.status" disabled placeholder="请选择状态" clearable style="width: 100%">
|
||||
<el-option label="未开始" :value=1></el-option>
|
||||
<el-option label="已检查" :value=2></el-option>
|
||||
<el-option label="异常" :value=3></el-option>
|
||||
<el-option label="不巡检" :value=4></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-form-item class="query-form-item" label="项目内容:" prop="projectContent">
|
||||
<el-input type="textarea" :rows="4" v-model="detailQuery.projectContent" disabled placeholder="请输入项目内容"
|
||||
style="width: 100%"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-form-item class="query-form-item" label="备注:" prop="result">
|
||||
<el-input type="textarea" :rows="4" v-model="detailQuery.result" disabled placeholder="请输入备注"
|
||||
style="width: 100%"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
export default {
|
||||
props: {
|
||||
detailQuery: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
name: "DeviceInspectTakeDetail",
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,577 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="el-card">
|
||||
<el-form :model="filterQuery" class="query-form" size="mini" label-width="140px" v-show="showSearch">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="部门:">
|
||||
<el-select v-model="filterQuery.deptCode" placeholder="请选择部门" clearable="true"
|
||||
@change="deptChange"
|
||||
style="width: 90%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="仓库:">
|
||||
<el-select v-model="filterQuery.invCode" placeholder="请选择仓库" clearable="true"
|
||||
style="width: 90%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in invList"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="任务单号:">
|
||||
<el-input v-model="filterQuery.orderId" placeholder="请输入任务单号" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="预计结束时间:">
|
||||
<el-date-picker
|
||||
:picker-options="pickerEdOptions"
|
||||
v-model="edDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 90%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="开始时间:">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
v-model="actDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 90%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="结束时间:">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
v-model="endDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 90%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="资产编码:">
|
||||
<el-input v-model="filterQuery.code" placeholder="请输入资产编码" style="width: 90%"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="任务状态:" class="query-form-item">
|
||||
<el-select v-model="filterQuery.status" style="width: 90%" placeholder="请选择任务状态" clearable>
|
||||
<el-option label="草稿" :value=0></el-option>
|
||||
<el-option label="未分配" :value=1></el-option>
|
||||
<el-option label="未处理" :value=2></el-option>
|
||||
<el-option label="处理中" :value=3></el-option>
|
||||
<el-option label="已处理" :value=4></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div class="top-right-btn">
|
||||
<el-button-group>
|
||||
<el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
|
||||
<el-table v-loading="loading" :data="list" style="width: 100%" @current-change="handleDetail" highlight-current-row border>
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column label="部门" prop="deptName" width="150"></el-table-column>
|
||||
<el-table-column label="仓库" prop="invName" width="150"></el-table-column>
|
||||
<el-table-column label="任务编号" prop="orderId" width="150"></el-table-column>
|
||||
<el-table-column label="资产编码" prop="code" width="150"></el-table-column>
|
||||
<el-table-column label="设备名称" prop="deviceName" width="150"></el-table-column>
|
||||
<el-table-column label="任务状态" prop="status" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusFilterType(scope.row.status)">{{ statusMap[scope.row.status] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="strartTime" width="150"></el-table-column>
|
||||
<el-table-column label="结束时间" prop="endTime" width="150"> </el-table-column>
|
||||
<el-table-column label="提醒时间" prop="remindTime" width="150"></el-table-column>
|
||||
<el-table-column label="负责人" prop="inspectName" width="150"></el-table-column>
|
||||
<el-table-column label="预计结束时间" prop="expectedTime" width="150"></el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.stop="startOrder(scope.row,5)"
|
||||
>详情
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:limit.sync="filterQuery.limit"
|
||||
:page.sync="filterQuery.page"
|
||||
@pagination="getList"
|
||||
></pagination>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
title="巡检任务确认"
|
||||
:visible.sync="formVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="65%"
|
||||
v-if="formVisible"
|
||||
>
|
||||
<deviceInspectTakeAuditModify
|
||||
:inspectTake="deviceInspectTake"
|
||||
:type="type"
|
||||
:closeDialog="closeDialog"
|
||||
>
|
||||
</deviceInspectTakeAuditModify>
|
||||
</el-dialog>
|
||||
|
||||
<el-card class="el-card">
|
||||
<el-table v-loading="loading" :data="delectList" style="width: 100%" border highlight-current-row>
|
||||
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||
<el-table-column label="项目编码" prop="projectCode" width="300"></el-table-column>
|
||||
<el-table-column label="项目内容" prop="projectContent" width="500"></el-table-column>
|
||||
<el-table-column label="状态" prop="status" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag>{{ statusdetailMap[scope.row.status] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现场照片" prop="inspectImage" width="300">
|
||||
<template slot-scope="scope">
|
||||
<div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.inspectImage }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.stop="datailSelect(scope.row)"
|
||||
>详情
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
title="巡检配置详情"
|
||||
:visible.sync="deviceProjectSelectVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="40%"
|
||||
v-if="deviceProjectSelectVisible"
|
||||
>
|
||||
<DeviceInspectTakeDetail
|
||||
:detailQuery="detailQuery"
|
||||
:closeDialog="closeDialog"
|
||||
>
|
||||
</DeviceInspectTakeDetail>
|
||||
</el-dialog>
|
||||
|
||||
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getDeptListByUser} from "@/api/auth/authDept";
|
||||
import {findInvByUser} from "@/api/system/invSubWarehouse";
|
||||
import deviceInspectTakeAuditModify from "@/views/inventory/DeviceInspectTakeAuditModify"
|
||||
import {getDeviceInspectTakeList,selectDeviceInspecTakeDetail} from "@/api/inventory/deviceInspectTake";
|
||||
import {previewImage, previewFile} from "@/api/purchase/supCompany";
|
||||
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
|
||||
import DeviceInspectTakeDetail from "@/views/inventory/DeviceInspectTakeDetail"
|
||||
|
||||
|
||||
export default {
|
||||
name: "deviceInspectTake",
|
||||
data() {
|
||||
return {
|
||||
filterQuery: {
|
||||
orderId: null,
|
||||
deptCode: this.$store.getters.locDeptCode,
|
||||
invCode: null,
|
||||
code: null,
|
||||
page: 1,
|
||||
limit: 20,
|
||||
},
|
||||
imgViewerVisible:false,
|
||||
imgList: [],
|
||||
BASE_URL: process.env.VUE_APP_BASE_API,
|
||||
type:null,
|
||||
delectList:[],
|
||||
list: [],
|
||||
total: 0,
|
||||
deptList: [],
|
||||
invList: [],
|
||||
loading: false,
|
||||
formVisible: false,
|
||||
statusMap: {
|
||||
0: "草稿",
|
||||
1: "未分配",
|
||||
2: "未处理",
|
||||
3: "处理中",
|
||||
4: "已处理",
|
||||
},
|
||||
statusdetailMap: {
|
||||
1: "未开始",
|
||||
2: "已检查",
|
||||
3: "异常",
|
||||
4: "不巡检",
|
||||
},
|
||||
formName: null,
|
||||
formMap: {
|
||||
add: "任务分配-新增任务",
|
||||
edit: "任务分配-编辑任务"
|
||||
},
|
||||
deviceInspectTake: {
|
||||
id: null,
|
||||
code: null,
|
||||
deptCode: null,
|
||||
invCode: null,
|
||||
deviceName: null,
|
||||
orderId: null,
|
||||
endTime: '',
|
||||
startTime: '',
|
||||
},
|
||||
deviceProjectSelectVisible: false,
|
||||
detailQuery: null,
|
||||
showSearch: true,
|
||||
actDateRange: [],
|
||||
endDateRange: [],
|
||||
edDateRange: [],
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
pickerAuditOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
pickerEdOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
statusFilterType(status) {
|
||||
const statusMap = {
|
||||
0: "",
|
||||
1: "success",
|
||||
2: "warning",
|
||||
3: "danger",
|
||||
};
|
||||
return statusMap[status];
|
||||
},
|
||||
hideSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
orderId: null,
|
||||
deptCode: this.$store.getters.locDeptCode,
|
||||
invCode: null,
|
||||
code: null,
|
||||
page: 1,
|
||||
limit: 20,
|
||||
};
|
||||
this.endDateRange = [];
|
||||
this.actDateRange = [];
|
||||
this.edDateRange = [];
|
||||
this.spaceList = [];
|
||||
this.getDeptList();
|
||||
},
|
||||
onSubmit() {
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
if (this.actDateRange != null) {
|
||||
this.filterQuery.ksStartDate = this.actDateRange[0];
|
||||
this.filterQuery.ksEndDate = this.actDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.ksStartDate = null;
|
||||
this.filterQuery.ksEndDate = null;
|
||||
}
|
||||
if (this.endDateRange != null) {
|
||||
this.filterQuery.jsStartDate = this.endDateRange[0];
|
||||
this.filterQuery.jsEndDate = this.endDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.jsStartDate = null;
|
||||
this.filterQuery.jsEndDate = null;
|
||||
}
|
||||
if (this.edDateRange != null) {
|
||||
this.filterQuery.yjjsStartDate = this.edDateRange[0];
|
||||
this.filterQuery.yjjsEndDate = this.edDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.yjjsStartDate = null;
|
||||
this.filterQuery.yjjsEndDate = null;
|
||||
}
|
||||
getDeviceInspectTakeList(this.filterQuery).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code === 20000) {
|
||||
this.list = res.data.list || [];
|
||||
this.total = res.data.total || 0;
|
||||
this.delectList = []
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$message.error(error.message);
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
})
|
||||
},
|
||||
deptChange() {
|
||||
this.invList = [];
|
||||
this.filterQuery.invCode = null;
|
||||
this.getInvList();
|
||||
},
|
||||
getDeptList() {
|
||||
getDeptListByUser().then((res) => {
|
||||
this.deptList = res.data || [];
|
||||
this.getInvList();
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
invChange() {
|
||||
this.spaceList = [];
|
||||
this.filterQuery.fromInvSpaceCode = null;
|
||||
this.getSpaceList();
|
||||
},
|
||||
getInvList() {
|
||||
let params = {deptCode: this.filterQuery.deptCode};
|
||||
findInvByUser(params)
|
||||
.then((response) => {
|
||||
this.invList = response.data || [];
|
||||
this.getList();
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
startOrder(row,type) {
|
||||
this.formVisible = true;
|
||||
this.type = type
|
||||
this.deviceInspectTake = row;
|
||||
},
|
||||
handleDetail(row){
|
||||
this.selectDeviceInspecTakeDetail({taskOrderIdFk:row.orderId})
|
||||
},
|
||||
selectDeviceInspecTakeDetail(obj) {
|
||||
selectDeviceInspecTakeDetail(obj).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code === 20000) {
|
||||
this.delectList = res.data || [];
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
this.delectList = [];
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$message.error(error.message);
|
||||
this.delectList = [];
|
||||
})
|
||||
},
|
||||
closeDialog() {
|
||||
this.formVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
datailSelect(row){
|
||||
this.detailQuery = row
|
||||
this.deviceProjectSelectVisible = true
|
||||
},
|
||||
|
||||
showImgViewer(row) {
|
||||
if (row.inspectImage.substr(-1) == ',') {
|
||||
row.inspectImage = row.inspectImage.slice(0, row.inspectImage.length - 1);
|
||||
}
|
||||
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
|
||||
this.imgList = [];
|
||||
previewImage({imageUrl: row.inspectImage, certFileUrl: this.certFileUrl}).then(response => {
|
||||
if (response.code === 20000) {
|
||||
this.imgList = response.data;
|
||||
}
|
||||
console.log(this.imgList)
|
||||
this.imgViewerVisible = true;
|
||||
});
|
||||
const m = (e) => {
|
||||
e.preventDefault()
|
||||
};
|
||||
document.body.style.overflow = 'hidden';
|
||||
document.addEventListener("touchmove", m, false); // 禁止页面滑动
|
||||
|
||||
},
|
||||
closeImgViewer() {
|
||||
this.imgViewerVisible = false;
|
||||
const m = (e) => {
|
||||
e.preventDefault()
|
||||
};
|
||||
document.body.style.overflow = 'auto';
|
||||
document.removeEventListener("touchmove", m, true);
|
||||
},
|
||||
|
||||
},
|
||||
components: {deviceInspectTakeAuditModify,ElImageViewer,DeviceInspectTakeDetail},
|
||||
mounted() {
|
||||
document.body.ondrop = function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getDeptList();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style type="text/scss" lang="scss">
|
||||
</style>
|
||||
|
@ -0,0 +1,298 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="el-card">
|
||||
<el-form :model="filterQuery" class="query-form" label-width="100px" v-show="showSearch">
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="项目编码:">
|
||||
<el-input v-model="filterQuery.code" style="width: 90%" placeholder="请输入项目编码"
|
||||
clearable="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="项目内容:">
|
||||
<el-input v-model="filterQuery.content" style="width: 90%" placeholder="请输入项目内容"
|
||||
clearable="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <el-form-item class="query-form-item" label="项目类型:">-->
|
||||
<!-- <el-select v-model="filterQuery.type" style="width: 90%" placeholder="请选择项目类型" clearable="true"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option label="巡检" :value="1"></el-option>-->
|
||||
<!-- <el-option label="养护" :value="2"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="8">
|
||||
<el-form-item class="query-form-item" label="创建时间:">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
v-model="actDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 90%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-form>
|
||||
<div class="top-right-btn">
|
||||
<el-button-group style="margin-left: 10px;display:flex;">
|
||||
<el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="selectRepairOrder">选入</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
|
||||
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
|
||||
@current-change="selectDetail" border>
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column label="项目编码" prop="code" show-overflow-tooltip width="140"></el-table-column>
|
||||
<el-table-column label="项目内容" prop="content" show-overflow-tooltip width="180"></el-table-column>
|
||||
<el-table-column label="项目类型" prop="type" show-overflow-tooltip width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag>
|
||||
{{ projectSetType[scope.row.type] }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="createUserName" show-overflow-tooltip width="140"></el-table-column>
|
||||
<el-table-column label="更新人" prop="updateUserName" show-overflow-tooltip width="140"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" show-overflow-tooltip width="140"></el-table-column>
|
||||
<el-table-column label="更新时间" prop="udpateTime" show-overflow-tooltip width="140"></el-table-column>
|
||||
<el-table-column label="备注" prop="remak" show-overflow-tooltip width="140"></el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:limit.sync="filterQuery.limit"
|
||||
:page.sync="filterQuery.page"
|
||||
@pagination="getList"
|
||||
></pagination>
|
||||
</el-card>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {findInvByUser} from "@/api/system/invSubWarehouse";
|
||||
import {getprojectSetList, deleteDevprojectSet,} from "@/api/inventory/deviceProjectSet";
|
||||
import {isBlank} from "@/utils/strUtil";
|
||||
import {addDeviceInspecTakeDetail} from "@/api/inventory/deviceInspectTake"
|
||||
|
||||
|
||||
export default {
|
||||
name: "DeviceProjectSelectTake",
|
||||
props: {
|
||||
inputQuery: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filterQuery: {
|
||||
id: null,
|
||||
code: "",
|
||||
content: null,
|
||||
type: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
page: 1,
|
||||
limit: 20
|
||||
},
|
||||
Query:{
|
||||
id:null,
|
||||
projectCode:"",
|
||||
projectContent:"",
|
||||
result:"",
|
||||
taskOrderIdFk:""
|
||||
},
|
||||
selectQuery: {},
|
||||
list: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
formVisible: false,
|
||||
codeTableLoading: false,
|
||||
|
||||
projectSetType: {
|
||||
1: "巡检",
|
||||
2: "养护",
|
||||
3: "报修"
|
||||
},
|
||||
formName: null,
|
||||
deviceRepairOrder: {},
|
||||
showSearch: true,
|
||||
actDateRange: [],
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
hideSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
id: null,
|
||||
code: "",
|
||||
content: null,
|
||||
type: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
page: 1,
|
||||
limit: 20
|
||||
};
|
||||
this.actDateRange = [];
|
||||
this.getList();
|
||||
},
|
||||
onSubmit() {
|
||||
if (this.actDateRange !== null) {
|
||||
this.filterQuery.startTime = this.actDateRange[0];
|
||||
this.filterQuery.endTime = this.actDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.startTime = null;
|
||||
this.filterQuery.endTime = null;
|
||||
}
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.filterQuery.type = this.type
|
||||
getprojectSetList(this.filterQuery).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.code === 20000) {
|
||||
this.list = res.data.list || [];
|
||||
this.total = res.data.total || 0;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$message.error(error.message);
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
})
|
||||
},
|
||||
invChange() {
|
||||
this.getList();
|
||||
},
|
||||
getInvList() {
|
||||
let params = {deptCode: this.filterQuery.deptCode};
|
||||
findInvByUser(params)
|
||||
.then((response) => {
|
||||
this.invList = response.data || [];
|
||||
this.getList();
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
selectRepairOrder() {
|
||||
if (isBlank(this.selectQuery.id)) {
|
||||
return this.$message.error("请先选择巡检内容");
|
||||
}
|
||||
this.selectQuery.id = ""
|
||||
this.Query = this.inputQuery
|
||||
this.Query.result = this.selectQuery.remak
|
||||
this.Query.projectContent = this.selectQuery.content
|
||||
this.Query.projectCode = this.selectQuery.code
|
||||
this.Query.status = 1
|
||||
|
||||
addDeviceInspecTakeDetail(this.Query).then((res) => {
|
||||
if (res.code == 20000) {
|
||||
this.closeDialog();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
selectDetail(row) {
|
||||
this.selectQuery = row
|
||||
}
|
||||
},
|
||||
components: {
|
||||
},
|
||||
filters: {
|
||||
statusFilterType(status) {
|
||||
const statusMap = {
|
||||
2: "warning",
|
||||
3: "success",
|
||||
4: "danger",
|
||||
};
|
||||
return statusMap[status];
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
document.body.ondrop = function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style type="text/scss" lang="scss">
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue