设备 报修 维修 设备班组

master
A0010407 1 year ago
parent 9ecdb64952
commit 7fbaca46bf

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询设备班组维护列表
export function listEquTeam(query) {
return request({
url: '/device/equTeam/list',
method: 'get',
params: query
});
}
// 查询设备班组维护详细
export function getEquTeam(id) {
return request({
url: '/device/equTeam/' + id,
method: 'get'
});
}
// 新增设备班组维护
export function addEquTeam(data) {
return request({
url: '/device/equTeam',
method: 'post',
data: data
});
}
// 修改设备班组维护
export function updateEquTeam(data) {
return request({
url: '/device/equTeam',
method: 'put',
data: data
});
}
// 删除设备班组维护
export function delEquTeam(id) {
return request({
url: '/device/equTeam/' + id,
method: 'delete'
});
}

@ -70,9 +70,9 @@ export function checkFaultReport(data) {
}
// 查询报修人员列表
export function getPersonList(query) {
export function getRepairPersonList(query) {
return request({
url: '/device/faultReport/getPersonList',
url: '/device/faultReport/getRepairPersonList',
method: 'get',
params: query
});

@ -52,4 +52,22 @@ export function applyOutsource(data) {
});
}
//填写维修记录
export function writeRepairOrder(data) {
return request({
url: '/device/repairOrder/write',
method: 'post',
data: data
});
}
// 查询维修人员列表
export function getMaintenancePersonList(query) {
return request({
url: '/device/repairOrder/getMaintenancePersonList',
method: 'get',
params: query
});
}

@ -0,0 +1,442 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="班组编号" prop="teamCode">
<el-input
v-model="queryParams.teamCode"
placeholder="请输入班组编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="班组名称" prop="teamName">
<el-input
v-model="queryParams.teamName"
placeholder="请输入班组名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="班组类型" prop="teamType">
<el-select
v-model="queryParams.teamType"
placeholder="请选择班组类型"
@change="$forceUpdate()"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in teamTypeOption"
:key="item.teamType"
:label="item.label"
:value="item.teamType"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['device:equTeam:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:equTeam:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:equTeam:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['device:equTeam:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="equTeamList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="班组编号" align="center" prop="teamCode" />
<el-table-column label="班组名称" align="center" prop="teamName" />
<el-table-column label="班组类型" align="center" prop="teamType" />
<el-table-column label="班组人员" align="center" prop="teamPerson" width="250"/>
<el-table-column label="工厂号" align="center" prop="factoryCode" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['device:equTeam:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:equTeam:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备班组维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="12">
<el-form-item label="班组编号" prop="teamCode">
<el-input
v-model="form.teamCode"
placeholder="请输入班组编号"
style="width: 300px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="班组名称" prop="teamName">
<el-input
v-model="form.teamName"
placeholder="请输入班组名称"
style="width: 300px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="班组类型" prop="teamType">
<el-select
v-model="form.teamType"
placeholder="请选择班组类型"
@change="$forceUpdate()"
clearable
style="width: 300px"
>
<el-option
v-for="item in teamTypeOption"
:key="item.teamType"
:label="item.label"
:value="item.teamType"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工厂号" prop="factoryCode">
<el-input
v-model="form.factoryCode"
placeholder="请输入工厂号"
style="width: 300px"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="班组人员" prop="teamPerson">
<el-input
v-model="form.teamPerson"
placeholder="请选择班组人员"
style="width: 680px"
>
<el-button
slot="append"
@click="handleSelectPerson"
icon="el-icon-search"
></el-button>
</el-input>
<ItemSelectPerson
ref="itemSelectPerson"
@onSelected="onItemSelectedPerson"
>
</ItemSelectPerson>
</el-form-item>
</el-col>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listEquTeam,
getEquTeam,
delEquTeam,
addEquTeam,
updateEquTeam,
} from "@/api/device/equTeam";
import ItemSelectPerson from "./selectSinglePerson.vue";
export default {
name: "EquTeam",
components: { ItemSelectPerson },
data() {
return {
//
checkTeamPerson: null,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
equTeamList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
teamCode: null,
teamName: null,
teamType: null,
teamPerson: null,
factoryCode: null,
},
teamTypeOption: [
{
teamType: "维修班组",
label: "维修班组",
},
{
teamType: "点检班组",
label: "点检班组",
},
{
teamType: "巡检班组",
label: "巡检班组",
},
{
teamType: "保养班组",
label: "保养班组",
},
],
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
},
methods: {
//
handleSelectPerson() {
this.$refs.itemSelectPerson.showFlag = true;
},
//
onItemSelectedPerson(obj) {
this.form.workPerson = obj;
},
/** 查询设备班组维护列表 */
getList() {
this.loading = true;
listEquTeam(this.queryParams).then((response) => {
this.equTeamList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
teamCode: null,
teamName: null,
teamType: null,
teamPerson: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
factoryCode: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备班组维护";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getEquTeam(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改设备班组维护";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateEquTeam(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addEquTeam(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
//
onItemSelectedPerson(obj) {
if (this.form.teamPerson == null || this.form.teamPerson == "") {
this.form.teamPerson = obj;
} else {
if (obj != undefined && obj != null && obj != "") {
const a = obj.split(",");
const len = obj.split(",").length;
a.forEach((item) => {
this.checkTeamPerson = this.form.teamPerson.search(item) != -1;
if (this.checkTeamPerson == true) {
Message.warning("您已经添加过该人员,请勿重复添加!!!");
} else if (this.checkTeamPerson == false) {
this.form.teamPerson = this.form.teamPerson + "," + item;
}
});
}
}
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除设备班组维护编号为"' + ids + '"的数据项?')
.then(function () {
return delEquTeam(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"device/equTeam/export",
{
...this.queryParams,
},
`equTeam_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

@ -0,0 +1,182 @@
<template>
<el-dialog title="人员选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="800px"
center
:before-close="cancelEquipmentForm"
>
<el-row :gutter="20">
<!--人员数据-->
<el-col :span="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="人员编码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入人员编码"
clearable
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="人员名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入人员名称"
clearable
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="itemList" @selection-change="handleEquipmentSelectionChange" ref="myTable">
<el-table-column width="50" align="center" type="selection"></el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
<el-table-column label="人员编码" align="center" key="itemCode" prop="userName" v-if="columns[0].visible" ></el-table-column>
<el-table-column label="人员名称" align="left" key="itemName" prop="nickName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门编码" align="center" prop="postCode" v-if="columns[2].visible" ></el-table-column>
<el-table-column label="部门名称" align="center" prop="postName" v-if="columns[3].visible" ></el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitPersonForm"> </el-button>
<el-button @click="cancelEquipmentForm"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getMaintenancePersonList} from "@/api/device/repairOrder";
import { Message } from 'element-ui'
export default {
name: "MdItemSingle",
data() {
return {
treeData1:[],
showFlag:false,
//
selectedItemId: undefined,
selectedRows: undefined,
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total:0,
//
itemList: null,
//
queryParams: {
pageNum: 1,
pageSize: 10,
itemName: undefined,
itemCodeGet: '',
itemCode : undefined,
},
//
columns: [
{ key: 0, label: `人员编码`, visible: true },
{ key: 1, label: `人员名称`, visible: true },
{ key: 2, label: `部门编码`, visible: true },
{ key: 3, label: `部门名称`, visible: true },
]
};
},
created() {
this.getList();
},
methods: {
//
reset() {
this.form = {
itemId: null,
itemCode: this.processId,
itemType: null,
};
this.resetForm("form");
},
handleEquipmentSelectionChange (val) {
this.itemList = val;
},
//
indexMethod(index){
return index+1 ;
},
//
/** 查询设备编码列表*/
getList() {
this.loading = true;
getMaintenancePersonList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
//
handleNodeClick(data) {
console.log('id',data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode);
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.equipmentTypeCode = null;
this.resetForm("queryForm");
this.handleQuery();
},
//
handleEquipmentSelectionChange(selection) {
this.ids = selection.map(item => item.nickName);
this.single = selection.length!==1;
this.multiple = !selection.length;
console.log("多选框",this.ids);
},
submitPersonForm() {
const data = this.ids;
const nickName = data.toString();
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = nickName;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);
this.getList();
this.showFlag = false;
this.queryParams.itemCodeGet = "";
}
}
};
</script>

@ -60,7 +60,7 @@
</template>
<script>
import { getPersonList} from "@/api/device/faultReport";
import { getRepairPersonList} from "@/api/device/faultReport";
import { Message } from 'element-ui'
export default {
@ -125,7 +125,7 @@ export default {
/** 查询设备编码列表*/
getList() {
this.loading = true;
getPersonList(this.queryParams).then(response => {
getRepairPersonList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;

File diff suppressed because it is too large Load Diff

@ -38,9 +38,10 @@
<el-table-column width="50" align="center" type="selection"></el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
<el-table-column label="人员编码" align="center" key="itemCode" prop="userName" v-if="columns[0].visible" >
</el-table-column>
<el-table-column label="人员编码" align="center" key="itemCode" prop="userName" v-if="columns[0].visible" ></el-table-column>
<el-table-column label="人员名称" align="left" key="itemName" prop="nickName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门编码" align="center" prop="postCode" v-if="columns[2].visible" ></el-table-column>
<el-table-column label="部门名称" align="center" prop="postName" v-if="columns[3].visible" ></el-table-column>
</el-table>
<pagination
@ -60,7 +61,7 @@
</template>
<script>
import { getPersonList} from "@/api/device/faultReport";
import { getMaintenancePersonList} from "@/api/device/repairOrder";
import { Message } from 'element-ui'
export default {
@ -94,6 +95,8 @@ export default {
columns: [
{ key: 0, label: `人员编码`, visible: true },
{ key: 1, label: `人员名称`, visible: true },
{ key: 2, label: `部门编码`, visible: true },
{ key: 3, label: `部门名称`, visible: true },
]
};
},
@ -125,7 +128,7 @@ export default {
/** 查询设备编码列表*/
getList() {
this.loading = true;
getPersonList(this.queryParams).then(response => {
getMaintenancePersonList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;

@ -0,0 +1,335 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['device:sparePartsApplicationRecord:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:sparePartsApplicationRecord:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:sparePartsApplicationRecord:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="sparePartsApplicationRecordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"/>
<el-table-column label="出库单号" align="center" prop="applyCode" />
<el-table-column label="备品备件编码" align="center" prop="spareCode" width="120"/>
<el-table-column label="备品备件名称" align="center" prop="spareName" width="120"/>
<el-table-column label="规格型号" align="center" prop="spareModel" width="150"/>
<el-table-column label="数量" align="center" prop="spareQuantity" />
<el-table-column label="使用组线" align="center" prop="spareGroupLine" />
<el-table-column label="使用设备" align="center" prop="spareUseEquipment" />
<el-table-column label="领用时间" align="center" prop="applyTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.applyTime) }}</span>
</template>
</el-table-column>
<el-table-column label="申领人" align="center" prop="applyPeople" width="80"/>
<el-table-column label="批准人" align="center" prop="applyApprovePeople" width="80"/>
<el-table-column label="工厂号" align="center" prop="factoryCode" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['device:sparePartsApplicationRecord:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:sparePartsApplicationRecord:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改申领记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="出库单号" prop="applyCode">
<el-input v-model="form.applyCode" placeholder="请输入出库单号" />
</el-form-item>
<el-form-item label="备品备件编码" prop="spareCode">
<el-input v-model="form.spareCode" placeholder="请输入备品备件编码" />
</el-form-item>
<el-form-item label="备品备件名称" prop="spareName">
<el-input v-model="form.spareName" placeholder="请输入备品备件名称" />
</el-form-item>
<el-form-item label="规格型号" prop="spareModel">
<el-input v-model="form.spareModel" placeholder="请输入规格型号" />
</el-form-item>
<el-form-item label="数量" prop="spareQuantity">
<el-input v-model="form.spareQuantity" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="使用组线" prop="spareGroupLine">
<el-input v-model="form.spareGroupLine" placeholder="请输入使用组线" />
</el-form-item>
<el-form-item label="使用设备" prop="spareUseEquipment">
<el-input v-model="form.spareUseEquipment" placeholder="请输入使用设备" />
</el-form-item>
<el-form-item label="领用时间" prop="applyTime">
<el-date-picker clearable
v-model="form.applyTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择领用时间">
</el-date-picker>
</el-form-item>
<el-form-item label="申领人" prop="applyPeople">
<el-input v-model="form.applyPeople" placeholder="请输入申领人" />
</el-form-item>
<el-form-item label="批准人" prop="applyApprovePeople">
<el-input v-model="form.applyApprovePeople" placeholder="请输入批准人" />
</el-form-item>
<el-form-item label="工厂号" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入工厂号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSparePartsApplicationRecord, getSparePartsApplicationRecord, delSparePartsApplicationRecord, addSparePartsApplicationRecord, updateSparePartsApplicationRecord } from "@/api/device/sparePartsApplicationRecord";
export default {
name: "SelectSpareParts",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
sparePartsApplicationRecordList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
applyCode: null,
spareCode: null,
spareName: null,
spareModel: null,
spareQuantity: null,
spareGroupLine: null,
spareUseEquipment: null,
applyTime: null,
applyPeople: null,
applyApprovePeople: null,
attr1: null,
attr2: null,
attr3: null,
factoryCode: null,
applyTimeArray: []
},
//
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]);
}
}]
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
//
indexMethod(index) {
return index + 1;
},
/** 查询申领记录列表 */
getList() {
this.loading = true;
listSparePartsApplicationRecord(this.queryParams).then(response => {
this.sparePartsApplicationRecordList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
applyId: null,
applyCode: null,
spareCode: null,
spareName: null,
spareModel: null,
spareQuantity: null,
spareGroupLine: null,
spareUseEquipment: null,
applyTime: null,
applyPeople: null,
applyApprovePeople: null,
attr1: null,
attr2: null,
attr3: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.applyTimeArray = [];
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.applyId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加申领记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const applyId = row.applyId || this.ids
getSparePartsApplicationRecord(applyId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改申领记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.applyId != null) {
updateSparePartsApplicationRecord(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSparePartsApplicationRecord(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const applyIds = row.applyId || this.ids;
this.$modal.confirm('是否确认删除申领记录编号为"' + applyIds + '"的数据项?').then(function() {
return delSparePartsApplicationRecord(applyIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('device/sparePartsApplicationRecord/export', {
...this.queryParams
}, `sparePartsApplicationRecord_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save