1.调整巡检计划页面

prod
x_z 2 years ago
parent bac26f846c
commit 1c899faeae

@ -4,7 +4,7 @@ export function getDeviceInspectPlanList(params) {
return axios({
url: "/udiwms/inv/device/inspect/plan/filter",
method: "get",
prams: params
params: params
});
}

@ -1,67 +1,80 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="filterQuery" class="query-form" size="mini" :inline="true">
<el-form-item class="query-form-item" label="领用记录号:">
<el-input v-model="filterQuery.orderId" placeholder="请输入领用记录号"
clearable="true"></el-input>
</el-form-item>
<el-form-item class="query-form-item" label="领用部门:">
<el-select v-model="filterQuery.deptCode" placeholder="请选择部门" clearable="true"
@change="deptChange"
>
<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-form-item class="query-form-item" label="领用仓库:">
<el-select v-model="filterQuery.fromInvCode" placeholder="请选择仓库" clearable="true"
>
<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-form-item class="query-form-item" label="领用货位:">
<el-select v-model="filterQuery.fromInvSpaceCode" placeholder="请选择货位" clearable="true"
>
<el-option
v-for="item in spaceList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>-->
<el-form-item>
<el-button-group style="margin-left: 10px;display:flex;">
<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>
</el-form-item>
<el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" 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-input v-model="filterQuery.code" placeholder="请输入资产编码" style="width: 90%"
clearable></el-input>
</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%" highlight-current-row
@current-change="handleChange"
border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="设备领用记录号" prop="orderId"></el-table-column>
<el-table-column label="领用部门" prop="fromDeptName"></el-table-column>
<el-table-column label="领用仓库" prop="fromInvName"></el-table-column>
<!-- <el-table-column label="领用货位" prop="fromInvSpaceName"></el-table-column>-->
<el-table-column label="领用日期" prop="createTime"></el-table-column>
<el-table-column label="领用人" prop="receiveUserName"></el-table-column>
<el-table-column label="创建人" prop="createUser"></el-table-column>
<el-table-column label="计划单号" prop="orderId"></el-table-column>
<el-table-column label="部门" prop="deptName"></el-table-column>
<el-table-column label="仓库" prop="invName"></el-table-column>
<el-table-column label="设备名称" prop="deviceName"></el-table-column>
<el-table-column label="规格型号" prop="ggxh"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="单据日期" prop="createTime"></el-table-column>
<el-table-column label="创建人" prop="createUserName"></el-table-column>
<el-table-column label="状态" prop="status" show-overflow-tooltip width="120">
<template slot-scope="scope">
<el-tag>{{ statusMap[scope.row.status] }}</el-tag>
@ -94,56 +107,24 @@
@pagination="getList"
></pagination>
</el-card>
<el-card>
<el-table v-loading="detailLoading" :data="detailList" style="width: 100%; margin-top: 10px;">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="条码" width="200" prop="code" show-overflow-tooltip></el-table-column>
<el-table-column label="产品通用名" prop="productName" width="200"></el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="批次号" prop="batchNo" width="200"></el-table-column>
<el-table-column label="序列号" prop="serialNo" width="150"></el-table-column>
<el-table-column label="领用日期" prop="createTime" width="150"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="150"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="150"></el-table-column>
<el-table-column label="注册/备案凭证号" prop="zczbhhzbapzbh" show-overflow-tooltip></el-table-column>
<el-table-column label="生产企业" prop="ylqxzcrbarmc" show-overflow-tooltip></el-table-column>
<el-table-column label="供应商" prop="supName" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="detailTotal>0"
:total="detailTotal"
:limit.sync="detailQuery.limit"
:page.sync="detailQuery.page"
@pagination="getDetailList"
></pagination>
</el-card>
</div>
</template>
<script>
import {getDeptListByUser} from "@/api/auth/authDept";
import {findInvByUser} from "@/api/system/invSubWarehouse";
import {getInvSpaceList} from "@/api/inventory/invSpace";
import {
getDeviceReceiveOrderDetailList,
updateDeviceReceiveOrderStatus,
deleteDeviceReceiveOrder,
getDeviceReceiveOrderList
} from "@/api/inventory/deviceReceiveOrder";
import {filterList} from "@/api/inventory/InspectionPlan";
import {getDeviceInspectPlanList, deleteInspectPlan, updateStatus} from "@/api/inventory/deviceInspectPlan";
export default {
name: "DeviceReceiveOrderAudit",
name: "DeviceInspectPlanNew",
data() {
return {
filterQuery: {
orderId: null,
deptCode: this.$store.getters.locDeptCode,
fromInvCode: null,
fromInvSpaceCode: null,
invCode: null,
code: null,
status: 1,
page: 1,
limit: 20,
@ -152,24 +133,32 @@ export default {
total: 0,
deptList: [],
invList: [],
spaceList: [],
loading: false,
formVisible: false,
statusMap: {
0: "草稿",
1: "未审核",
2: "已审核"
},
detailQuery: {
orderIdFk: null,
page: 1,
limit: 20,
formName: null,
formMap: {
add: "新增设备巡检计划",
edit: "编辑设备巡检计划"
},
deviceInspectPlan: {
id: null,
code: null,
deptCode: null,
invCode: null,
deviceName: null
},
detailList: [],
detailLoading: false,
detailTotal: 0
showSearch: true
};
},
methods: {
hideSearch() {
this.showSearch = !this.showSearch;
},
onReset() {
this.$router.push({
path: "",
@ -177,8 +166,8 @@ export default {
this.filterQuery = {
orderId: null,
deptCode: this.$store.getters.locDeptCode,
fromInvCode: null,
fromInvSpaceCode: null,
invCode: null,
code: null,
status: 1,
page: 1,
limit: 20,
@ -192,7 +181,7 @@ export default {
},
getList() {
this.loading = true;
filterList(this.filterQuery).then((res) => {
getDeviceInspectPlanList(this.filterQuery).then((res) => {
this.loading = false;
if (res.code === 20000) {
this.list = res.data.list || [];
@ -211,9 +200,7 @@ export default {
},
deptChange() {
this.invList = [];
this.spaceList = [];
this.filterQuery.fromInvCode = null;
this.filterQuery.fromInvSpaceCode = null;
this.filterQuery.invCode = null;
this.getInvList();
},
getDeptList() {
@ -238,13 +225,6 @@ export default {
.catch(() => {
});
},
getSpaceList() {
let params = {invWarehouseCode: this.filterQuery.fromInvCode,invStorageCode:this.filterQuery.fromInvCode.deptCode, status: 1};
getInvSpaceList(params).then((res) => {
this.spaceList = res.data.list || [];
this.getList();
})
},
auditOrder(row) {
this.$confirm('请选择审核意见', '提示', {
confirmButtonText: '通过',
@ -259,7 +239,7 @@ export default {
id: row.id,
status: 2
};
updateDeviceReceiveOrderStatus(params).then((res) => {
updateStatus(params).then((res) => {
if (res.code === 20000) {
this.$message.success("审核通过!");
this.getList();
@ -275,7 +255,7 @@ export default {
id: row.id,
status: 0
};
updateDeviceReceiveOrderStatus(params).then((res) => {
updateStatus(params).then((res) => {
if (res.code === 20000) {
this.$message.success("已驳回!")
this.getList();
@ -290,34 +270,15 @@ export default {
}
});
},
handleChange(row) {
this.detailQuery.orderIdFk = row.orderId;
this.detailQuery.page = 1;
this.getDetailList();
},
getDetailList() {
getDeviceReceiveOrderDetailList(this.detailQuery).then((res) => {
if (res.code === 20000) {
this.detailList = res.data.list || [];
this.detailTotal = res.data.total || 0;
} else {
this.detailList = [];
this.detailTotal = 0;
}
}).catch(() => {
this.detailList = [];
this.detailTotal = 0;
});
},
deleteDialog(rowId) {
this.$confirm('此操作将永久删除该领用记录, 是否继续?', '提示', {
this.$confirm('此操作将永久删除该巡检计划, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {id: rowId};
this.loading = true;
deleteDeviceReceiveOrder(params).then((res) => {
deleteInspectPlan(params).then((res) => {
this.loading = false;
if (res.code === 20000) {
this.$message.success("删除成功!");
@ -335,6 +296,7 @@ export default {
this.getList();
},
},
components: {},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();

@ -1,55 +1,80 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="filterQuery" class="query-form" size="mini" :inline="true">
<el-form-item class="query-form-item" label="领用记录号:">
<el-input v-model="filterQuery.orderId" placeholder="请输入领用记录号"
clearable="true"></el-input>
</el-form-item>
<el-form-item class="query-form-item" label="领用部门:">
<el-select v-model="filterQuery.deptCode" placeholder="请选择部门" clearable="true"
@change="deptChange"
>
<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-form-item class="query-form-item" label="领用仓库:">
<el-select v-model="filterQuery.fromInvCode" placeholder="请选择仓库" clearable="true"
>
<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-form-item>
<el-button-group style="margin-left: 10px;display:flex;">
<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>
</el-form-item>
<el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" 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-input v-model="filterQuery.code" placeholder="请输入资产编码" style="width: 90%"
clearable></el-input>
</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%" highlight-current-row
@current-change="handleChange"
border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="设备领用记录号" prop="orderId"></el-table-column>
<el-table-column label="领用部门" prop="fromDeptName"></el-table-column>
<el-table-column label="领用仓库" prop="fromInvName"></el-table-column>
<!-- <el-table-column label="领用货位" prop="fromInvSpaceName"></el-table-column>-->
<el-table-column label="领用日期" prop="createTime"></el-table-column>
<el-table-column label="领用人" prop="receiveUserName"></el-table-column>
<el-table-column label="创建人" prop="createUser"></el-table-column>
<el-table-column label="计划单号" prop="orderId"></el-table-column>
<el-table-column label="部门" prop="deptName"></el-table-column>
<el-table-column label="仓库" prop="invName"></el-table-column>
<el-table-column label="设备名称" prop="deviceName"></el-table-column>
<el-table-column label="规格型号" prop="ggxh"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="单据日期" prop="createTime"></el-table-column>
<el-table-column label="创建人" prop="createUserName"></el-table-column>
<el-table-column label="状态" prop="status" show-overflow-tooltip width="120">
<template slot-scope="scope">
<el-tag>{{ statusMap[scope.row.status] }}</el-tag>
@ -64,54 +89,24 @@
@pagination="getList"
></pagination>
</el-card>
<el-card>
<el-table v-loading="detailLoading" :data="detailList" style="width: 100%; margin-top: 10px;">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="条码" width="200" prop="code" show-overflow-tooltip></el-table-column>
<el-table-column label="产品通用名" prop="productName" width="200"></el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="批次号" prop="batchNo" width="200"></el-table-column>
<el-table-column label="序列号" prop="serialNo" width="150"></el-table-column>
<el-table-column label="领用日期" prop="createTime" width="150"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="150"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="150"></el-table-column>
<el-table-column label="注册/备案凭证号" prop="zczbhhzbapzbh" show-overflow-tooltip></el-table-column>
<el-table-column label="生产企业" prop="ylqxzcrbarmc" show-overflow-tooltip></el-table-column>
<el-table-column label="供应商" prop="supName" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="detailTotal>0"
:total="detailTotal"
:limit.sync="detailQuery.limit"
:page.sync="detailQuery.page"
@pagination="getDetailList"
></pagination>
</el-card>
</div>
</template>
<script>
import {getDeptListByUser} from "@/api/auth/authDept";
import {findInvByUser} from "@/api/system/invSubWarehouse";
import {getInvSpaceList} from "@/api/inventory/invSpace";
import {
getDeviceReceiveOrderDetailList,
getDeviceReceiveOrderList
} from "@/api/inventory/deviceReceiveOrder";
import {filterList} from "@/api/inventory/InspectionPlan";
import {getDeviceInspectPlanList, deleteInspectPlan, updateStatus} from "@/api/inventory/deviceInspectPlan";
export default {
name: "DeviceReceiveOrderCompleted",
name: "DeviceInspectPlanNew",
data() {
return {
filterQuery: {
orderId: null,
deptCode: this.$store.getters.locDeptCode,
fromInvCode: null,
fromInvSpaceCode: null,
invCode: null,
code: null,
status: 2,
page: 1,
limit: 20,
@ -120,24 +115,32 @@ export default {
total: 0,
deptList: [],
invList: [],
spaceList: [],
loading: false,
formVisible: false,
statusMap: {
0: "草稿",
1: "未审核",
2: "已审核"
},
detailQuery: {
orderIdFk: null,
page: 1,
limit: 20,
formName: null,
formMap: {
add: "新增设备巡检计划",
edit: "编辑设备巡检计划"
},
deviceInspectPlan: {
id: null,
code: null,
deptCode: null,
invCode: null,
deviceName: null
},
detailList: [],
detailLoading: false,
detailTotal: 0
showSearch: true
};
},
methods: {
hideSearch() {
this.showSearch = !this.showSearch;
},
onReset() {
this.$router.push({
path: "",
@ -145,8 +148,8 @@ export default {
this.filterQuery = {
orderId: null,
deptCode: this.$store.getters.locDeptCode,
fromInvCode: null,
fromInvSpaceCode: null,
invCode: null,
code: null,
status: 2,
page: 1,
limit: 20,
@ -160,9 +163,7 @@ export default {
},
getList() {
this.loading = true;
this.detailList = [];
this.detailTotal = 0;
filterList(this.filterQuery).then((res) => {
getDeviceInspectPlanList(this.filterQuery).then((res) => {
this.loading = false;
if (res.code === 20000) {
this.list = res.data.list || [];
@ -181,9 +182,7 @@ export default {
},
deptChange() {
this.invList = [];
this.spaceList = [];
this.filterQuery.fromInvCode = null;
this.filterQuery.fromInvSpaceCode = null;
this.filterQuery.invCode = null;
this.getInvList();
},
getDeptList() {
@ -208,34 +207,25 @@ export default {
.catch(() => {
});
},
getSpaceList() {
let params = {
invWarehouseCode: this.filterQuery.fromInvCode,
invStorageCode: this.filterQuery.fromInvCode.deptCode,
status: 1
};
getInvSpaceList(params).then((res) => {
this.spaceList = res.data.list || [];
this.getList();
})
},
handleChange(row) {
this.detailQuery.orderIdFk = row.orderId;
this.detailQuery.page = 1;
this.getDetailList();
},
getDetailList() {
getDeviceReceiveOrderDetailList(this.detailQuery).then((res) => {
if (res.code === 20000) {
this.detailList = res.data.list || [];
this.detailTotal = res.data.total || 0;
} else {
this.detailList = [];
this.detailTotal = 0;
}
}).catch(() => {
this.detailList = [];
this.detailTotal = 0;
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;
});
});
},
closeDialog() {
@ -243,6 +233,7 @@ export default {
this.getList();
},
},
components: {},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();

@ -0,0 +1,288 @@
<template>
<div>
<el-card style="margin: 5px;margin-top: -20px">
<el-form :model="inspectPlan" ref="dataForm" label-width="100px" style="margin-bottom: -15px">
<el-button-group style="display: flex;margin: 0px 0 10px 80%; height: 35px">
<el-button
type="primary"
@click.native="selectDevice()"
>选择设备
</el-button>
<el-button
type="primary"
@click.native="submit()"
>保存
</el-button>
</el-button-group>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="部门:">
<el-select v-model="inspectPlan.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="10">
<el-form-item class="query-form-item" label="仓库:">
<el-select v-model="inspectPlan.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-row>
<el-row>
<el-col :span="10">
<el-form-item label="设备名称:">
<el-input v-model="inspectPlan.deviceName" placeholder="请输入设备名称" style="width: 90%"
disabled
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="物资编码:">
<el-input v-model="inspectPlan.code" placeholder="请输入编码" style="width: 90%" clearable
disabled></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<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-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-table v-loading="deviceLoading" :data="deviceList" style="width: 100%"
highlight-current-row
@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-dialog>
</div>
</template>
<script>
import {isBlank} from "@/utils/strUtil";
import {getDeptListByUser} from "@/api/auth/authDept";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {saveDeviceInspectPlan} from "@/api/inventory/deviceInspectPlan";
import {getDeptDeviceList} from "@/api/inventory/deptDevice";
export default {
props: {
inspectPlan: {
type: Object,
required: true
},
closeDialog: {
type: Function,
required: true
}
},
name: "DeviceInspectPlanModify",
data() {
return {
deptList: [],
invList: [],
deviceDialogVisible: false,
deviceLoading: false,
filterQuery: {
code: null,
deptCode: null,
invCode: null,
page: 1,
limit: 10
},
deviceList: [],
deviceTotal: 0,
deptName: null,
invName: null,
selectRow: null
};
},
methods: {
deptChange() {
this.inspectPlan.invCode = null;
this.invList = [];
this.getInvList();
},
getDeptList() {
getDeptListByUser().then((res) => {
this.deptList = res.data || [];
this.getInvList();
});
},
getInvList() {
let params = {deptCode: this.inspectPlan.deptCode};
getInvListByUser(params)
.then((response) => {
this.invList = response.data || [];
this.getList();
})
.catch(() => {
});
},
submit() {
if (isBlank(this.inspectPlan.deptCode) || isBlank(this.inspectPlan.invCode) || isBlank(this.inspectPlan.code)) {
this.$message.error("请设备相关信息")
return;
}
let formName = isBlank(this.inspectPlan.id) ? "add" : "edit";
saveDeviceInspectPlan(this.inspectPlan, formName).then((res) => {
if (res.code === 20000) {
this.$message.success("添加成功");
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
});
},
selectDevice() {
if (isBlank(this.inspectPlan.deptCode) || isBlank(this.inspectPlan.invCode)) {
this.$message.warning("请先选择巡检设备所属部门和仓库");
return;
}
this.setDeptAnInvName();
this.deviceDialogVisible = true;
this.filterQuery = {
code: null,
deptCode: this.inspectPlan.deptCode,
invCode: this.inspectPlan.invCode,
page: 1,
limit: 10
}
this.getDeviceList();
},
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;
});
},
setDeptAnInvName() {
this.deptList.forEach((item) => {
if (item.code === this.inspectPlan.deptCode) {
this.deptName = item.name;
}
});
this.invList.forEach((item) => {
if (item.code === this.inspectPlan.invCode) {
this.invName = item.name;
}
})
},
onReset() {
this.filterQuery.code = null;
this.filterQuery.page = 1;
this.getDeviceList();
},
queryDevice() {
this.filterQuery.page = 1;
this.getDeviceList();
},
handleCurrentChange(row) {
this.selectRow = row;
},
combine() {
this.deviceDialogVisible = false;
this.inspectPlan.code = this.selectRow.code;
this.inspectPlan.deviceName = this.selectRow.deviceName;
},
},
created() {
this.getDeptList();
},
}
</script>
<style scoped>
</style>

@ -121,9 +121,14 @@
:visible.sync="formVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
width="65%"
v-if="formVisible"
>
<deviceInspectPlanModify
:inspectPlan="deviceInspectPlan"
:closeDialog="closeDialog"
>
</deviceInspectPlanModify>
</el-dialog>
</div>
@ -132,7 +137,7 @@
<script>
import {getDeptListByUser} from "@/api/auth/authDept";
import {findInvByUser} from "@/api/system/invSubWarehouse";
import deviceReceiveOrderModify from "@/views/inventory/DeviceReceiveOrderModify.vue";
import deviceInspectPlanModify from "@/views/inventory/DeviceInspectPlanModify.vue";
import {getDeviceInspectPlanList, submitAudit, deleteInspectPlan} from "@/api/inventory/deviceInspectPlan";
@ -145,7 +150,7 @@ export default {
deptCode: this.$store.getters.locDeptCode,
invCode: null,
code: null,
status: 1,
status: 0,
page: 1,
limit: 20,
},
@ -165,7 +170,13 @@ export default {
add: "新增设备巡检计划",
edit: "编辑设备巡检计划"
},
deviceInspectPlan: {},
deviceInspectPlan: {
id: null,
code: null,
deptCode: null,
invCode: null,
deviceName: null
},
showSearch: true
};
},
@ -182,7 +193,7 @@ export default {
deptCode: this.$store.getters.locDeptCode,
invCode: null,
code: null,
status: 1,
status: 0,
page: 1,
limit: 20,
};
@ -285,11 +296,17 @@ export default {
addInspectPlan() {
this.formVisible = true;
this.formName = 'add';
this.deviceInspectPlan = {};
this.deviceInspectPlan = {
id: null,
code: null,
deptCode: this.$store.getters.locDeptCode,
invCode: null,
deviceName: null
};
},
},
components: {
deviceReceiveOrderModify
deviceInspectPlanModify
},
mounted() {
document.body.ondrop = function (event) {

Loading…
Cancel
Save