Merge remote-tracking branch 'origin/master'
commit
90ba20aa3f
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询委外工单列表
|
||||
export function listOutsourceWorkOrder(query) {
|
||||
return request({
|
||||
url: '/device/outsourceWorkOrder/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询委外工单详细
|
||||
export function getOutsourceWorkOrder(workId) {
|
||||
return request({
|
||||
url: '/device/outsourceWorkOrder/' + workId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 新增委外工单
|
||||
export function addOutsourceWorkOrder(data) {
|
||||
return request({
|
||||
url: '/device/outsourceWorkOrder',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 修改委外工单
|
||||
export function updateOutsourceWorkOrder(data) {
|
||||
return request({
|
||||
url: '/device/outsourceWorkOrder',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除委外工单
|
||||
export function delOutsourceWorkOrder(workId) {
|
||||
return request({
|
||||
url: '/device/outsourceWorkOrder/' + workId,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
@ -0,0 +1,183 @@
|
||||
<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>
|
||||
|
||||
<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 { getPersonList} from "@/api/device/faultReport";
|
||||
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 },
|
||||
]
|
||||
};
|
||||
},
|
||||
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;
|
||||
getPersonList(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(data.length >1){
|
||||
Message.warning("只能选择一个报修人,请勿选择多个!");
|
||||
}else{
|
||||
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>
|
@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
|
||||
<el-form-item label="委外工单编码" prop="workCode">
|
||||
<el-input
|
||||
v-model="queryParams.workCode"
|
||||
placeholder="请输入委外工单编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="维修人员" prop="workPerson">
|
||||
<el-input
|
||||
v-model="queryParams.workPerson"
|
||||
placeholder="请输入维修人员"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="委外单位" prop="workOutsourcingUnit">
|
||||
<el-input
|
||||
v-model="queryParams.workOutsourcingUnit"
|
||||
placeholder="请输入委外单位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式" prop="workConnection">
|
||||
<el-input
|
||||
v-model="queryParams.workConnection"
|
||||
placeholder="请输入联系方式"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="委外费用" prop="workCost">
|
||||
<el-input
|
||||
v-model="queryParams.workCost"
|
||||
placeholder="请输入委外费用"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="委外用时" prop="workCostTime">
|
||||
<el-input
|
||||
v-model="queryParams.workCostTime"
|
||||
placeholder="请输入委外用时"
|
||||
clearable
|
||||
@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-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:outsourceWorkOrder: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:outsourceWorkOrder: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:outsourceWorkOrder: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:outsourceWorkOrder:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="outsourceWorkOrderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="委外工单编码" align="center" prop="workCode" width="180"/>
|
||||
<el-table-column label="维修人员" align="center" prop="workPerson" width="150"/>
|
||||
<el-table-column label="委外单位" align="center" prop="workOutsourcingUnit" width="200"/>
|
||||
<el-table-column label="联系方式" align="center" prop="workConnection" width="150"/>
|
||||
<el-table-column label="原因" align="center" prop="workReason" width="150"/>
|
||||
<el-table-column label="委外类型" align="center" prop="workType" />
|
||||
<el-table-column label="管理单号" align="center" prop="managementCode" />
|
||||
<el-table-column label="委外费用" align="center" prop="workCost" />
|
||||
<el-table-column label="委外用时" align="center" prop="workCostTime" />
|
||||
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['device:outsourceWorkOrder:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['device:outsourceWorkOrder: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="workCode">
|
||||
<el-input v-model="form.workCode" placeholder="请输入委外工单编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="维修人员" prop="workPerson">
|
||||
<el-input v-model="form.workPerson" placeholder="请输入维修人员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="委外单位" prop="workOutsourcingUnit">
|
||||
<el-input v-model="form.workOutsourcingUnit" placeholder="请输入委外单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式" prop="workConnection">
|
||||
<el-input v-model="form.workConnection" placeholder="请输入联系方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原因" prop="workReason">
|
||||
<el-input v-model="form.workReason" placeholder="请输入原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="管理单号" prop="managementCode">
|
||||
<el-input v-model="form.managementCode" placeholder="请输入管理单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="委外费用" prop="workCost">
|
||||
<el-input v-model="form.workCost" placeholder="请输入委外费用" />
|
||||
</el-form-item>
|
||||
<el-form-item label="委外用时" prop="workCostTime">
|
||||
<el-input v-model="form.workCostTime" placeholder="请输入委外用时" />
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标识" prop="delFlag">
|
||||
<el-input v-model="form.delFlag" 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 { listOutsourceWorkOrder, getOutsourceWorkOrder, delOutsourceWorkOrder, addOutsourceWorkOrder, updateOutsourceWorkOrder } from "@/api/device/outsourceWorkOrder";
|
||||
|
||||
export default {
|
||||
name: "OutsourceWorkOrder",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 委外工单表格数据
|
||||
outsourceWorkOrderList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
workCode: null,
|
||||
workPerson: null,
|
||||
workOutsourcingUnit: null,
|
||||
workConnection: null,
|
||||
workReason: null,
|
||||
workType: null,
|
||||
managementCode: null,
|
||||
workCost: null,
|
||||
workCostTime: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
factoryCode: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询委外工单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOutsourceWorkOrder(this.queryParams).then(response => {
|
||||
this.outsourceWorkOrderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
workId: null,
|
||||
workCode: null,
|
||||
workPerson: null,
|
||||
workOutsourcingUnit: null,
|
||||
workConnection: null,
|
||||
workReason: null,
|
||||
workType: null,
|
||||
managementCode: null,
|
||||
workCost: null,
|
||||
workCostTime: 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.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.workId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加委外工单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const workId = row.workId || this.ids
|
||||
getOutsourceWorkOrder(workId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改委外工单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.workId != null) {
|
||||
updateOutsourceWorkOrder(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOutsourceWorkOrder(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const workIds = row.workId || this.ids;
|
||||
this.$modal.confirm('是否确认删除委外工单编号为"' + workIds + '"的数据项?').then(function() {
|
||||
return delOutsourceWorkOrder(workIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/outsourceWorkOrder/export', {
|
||||
...this.queryParams
|
||||
}, `outsourceWorkOrder_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue