Merge remote-tracking branch 'origin/master'

master
wws 1 year ago
commit 55ffe9f104

@ -0,0 +1,27 @@
@echo off
echo --------------------------------自定义参数,启动前先修改--------------------------------------
set imageURI=192.168.202.36:30002/op-lanju/op-ui
::echo 获取当前日期字符串
for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c
::echo 获取当前时间字符串
for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b
::echo 如当前小时小于10将空格替换为0
set T=%T: =0%
::echo 显示输出日期时间字符串
set imageVersion=%D%%T%
::输出发版信息
echo 镜像库地址:%imageURI%
echo 镜像版本:%imageVersion%
echo --------------------------------执行打包--------------------------------
call npm run build:prod
dir
echo --------------------------------docker login...-------------------------------
docker login 192.168.202.36:30002 -u deploy -p Deploy@2023
echo --------------------------------docker build...-------------------------------
docker build -t %imageURI%:%imageVersion% .
echo --------------------------------docker push...--------------------------------
docker push %imageURI%:%imageVersion%
@pause
::docker pull 192.168.3.157:8001/library/nginx:1.20-alpine

@ -0,0 +1,28 @@
@echo off
echo --------------------------------自定义参数,启动前先修改--------------------------------------
set imageURI=140.249.53.142:30002/op-lanju/ld-op-front
::echo 获取当前日期字符串
for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c
::echo 获取当前时间字符串
for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b
::echo 如当前小时小于10将空格替换为0
set T=%T: =0%
::echo 显示输出日期时间字符串
set imageVersion=%D%%T%
::输出发版信息
echo 镜像库地址:%imageURI%
echo 镜像版本:%imageVersion%
echo --------------------------------执行打包--------------------------------
call npm run build:prod
dir
echo --------------------------------docker login...-------------------------------
docker logout 140.249.53.142:30002
docker login 140.249.53.142:30002 -u deploy -p Deploy@2022
echo --------------------------------docker build...-------------------------------
docker build -t %imageURI%:%imageVersion% .
echo --------------------------------docker push...--------------------------------
docker push %imageURI%:%imageVersion%
@pause
::docker pull 192.168.3.157:8001/library/nginx:1.20-alpine

@ -0,0 +1,62 @@
import request from '@/utils/request'
// 查询故障报修列表
export function listFaultReport(query) {
return request({
url: '/device/faultReport/list',
method: 'get',
params: query
});
}
// 查询故障报修详细
export function getFaultReport(orderId) {
return request({
url: '/device/faultReport/' + orderId,
method: 'get'
});
}
// 新增故障报修
export function addFaultReport(data) {
return request({
url: '/device/faultReport',
method: 'post',
data: data
});
}
// 修改故障报修
export function updateFaultReport(data) {
return request({
url: '/device/faultReport',
method: 'put',
data: data
});
}
// 删除故障报修
export function delFaultReport(orderId) {
return request({
url: '/device/faultReport/' + orderId,
method: 'delete'
});
}
// 查询故障报修列表
export function getEquipmentList(query) {
return request({
url: '/device/faultReport/getEquipmentList',
method: 'get',
params: query
});
}
// 查询设备类型
export function getEquipmentTypeList() {
return request({
url: '/device/faultReport/getEquipmentTypeList',
method: 'get'
});
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询申领记录列表
export function listSparePartsApplicationRecord(query) {
return request({
url: '/device/sparePartsApplicationRecord/list',
method: 'get',
params: query
});
}
// 查询申领记录详细
export function getSparePartsApplicationRecord(applyId) {
return request({
url: '/device/sparePartsApplicationRecord/' + applyId,
method: 'get'
});
}
// 新增申领记录
export function addSparePartsApplicationRecord(data) {
return request({
url: '/device/sparePartsApplicationRecord',
method: 'post',
data: data
});
}
// 修改申领记录
export function updateSparePartsApplicationRecord(data) {
return request({
url: '/device/sparePartsApplicationRecord',
method: 'put',
data: data
});
}
// 删除申领记录
export function delSparePartsApplicationRecord(applyId) {
return request({
url: '/device/sparePartsApplicationRecord/' + applyId,
method: 'delete'
});
}

@ -0,0 +1,477 @@
<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="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入报修单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
v-model="queryParams.equipmentCode"
placeholder="请输入设备编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="故障时间" prop="orderBreakdownTime">
<el-date-picker
v-model="queryParams.orderBreakdownTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions1">
</el-date-picker>
</el-form-item>
<el-form-item label="报修来源" prop="orderSource">
<el-select v-model="form.orderSource" style="width:195px">
<el-option
v-for="dict in dict.type.device_order_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="报修时间" prop="orderTime">
<el-date-picker
v-model="queryParams.orderTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions2">
</el-date-picker>
</el-form-item>
<el-form-item label="报修人" prop="orderRepairman">
<el-input
v-model="queryParams.orderRepairman"
placeholder="请输入报修人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系方式" prop="orderConnection">
<el-input
v-model="queryParams.orderConnection"
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:faultReport: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:faultReport: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:faultReport: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:faultReport:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="faultReportList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="报修单号" align="center" prop="orderCode" width="120"/>
<el-table-column label="设备编码" align="center" prop="equipmentCode" width="100"/>
<el-table-column label="故障描述" align="center" prop="orderDesc" width="200"/>
<el-table-column label="故障时间" align="center" prop="orderBreakdownTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.orderBreakdownTime) }}</span>
</template>
</el-table-column>
<el-table-column label="报修来源" align="center" prop="orderSource" />
<el-table-column label="报修时间" align="center" prop="orderTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.orderTime) }}</span>
</template>
</el-table-column>
<el-table-column label="报修人" align="center" prop="orderRepairman" />
<el-table-column label="联系方式" align="center" prop="orderConnection" width="120"/>
<el-table-column label="处理状态" align="center" prop="orderStatus" />
<el-table-column label="关联计划" align="center" prop="orderRelevance" />
<el-table-column label="故障图片" align="center" prop="orderPicture" />
<el-table-column label="创建人" align="center" prop="craeteBy" />
<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:faultReport:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:faultReport: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="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="form.equipmentCode" placeholder="请选择辅助设备" >
<el-button slot="append" @click="handleSelectEquipment" icon="el-icon-search"></el-button>
</el-input>
<ItemSelect ref="itemSelect" @onSelected="onItemSelectedEquipment" > </ItemSelect>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="故障时间" prop="orderBreakdownTime">
<el-date-picker
clearable
v-model="form.orderBreakdownTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报修来源" prop="orderSource">
<el-input v-model="form.orderSource" placeholder="请输入报修来源" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="报修时间" prop="orderTime">
<el-date-picker clearable
v-model="form.orderTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择报修时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报修人" prop="orderRepairman">
<el-input v-model="form.orderRepairman" placeholder="请输入报修人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系方式" prop="orderConnection">
<el-input v-model="form.orderConnection" placeholder="请输入联系方式" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="故障描述" prop="orderDesc">
<el-input v-model="form.orderDesc" placeholder="请输入故障描述" />
</el-form-item>
</el-row>
<el-form-item label="故障图片" prop="orderPicture">
<el-input v-model="form.orderPicture" 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 { listFaultReport, getFaultReport, delFaultReport, addFaultReport, updateFaultReport,getEquipmentList } from "@/api/device/faultReport";
import ItemSelect from "./single.vue";
export default {
name: "FaultReport",
components: {ItemSelect},
dicts: ['device_order_source'],
data() {
return {
equipmentCodeOption:[],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
faultReportList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
orderCode: null,
equipmentCode: null,
orderDesc: null,
orderBreakdownTime: null,
orderSource: null,
orderTime: null,
orderHandle: null,
orderRepairman: null,
orderConnection: null,
orderStatus: null,
orderRelevance: null,
orderPicture: null,
attr1: null,
attr2: null,
attr3: null,
craeteBy: null,
orderBreakdownTimeArray: [],
orderTimeArray: []
},
//
pickerOptions1: {
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]);
}
}]
},
pickerOptions2: {
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: {
//
handleSelectEquipment(){
this.$refs.itemSelect.showFlag = true;
},
//
onItemSelectedEquipment(obj){
this.form.equipmentCode = obj;
},
/** 查询故障报修列表 */
getList() {
this.loading = true;
listFaultReport(this.queryParams).then(response => {
this.faultReportList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
orderId: null,
orderCode: null,
equipmentCode: null,
orderDesc: null,
orderBreakdownTime: null,
orderSource: null,
orderTime: null,
orderHandle: null,
orderRepairman: null,
orderConnection: null,
orderStatus: null,
orderRelevance: null,
orderPicture: null,
attr1: null,
attr2: null,
attr3: null,
delFlag: null,
craeteBy: null,
createTime: null,
updateBy: null,
updateTime: 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.orderId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加故障报修";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const orderId = row.orderId || this.ids
getFaultReport(orderId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改故障报修";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.orderId != null) {
updateFaultReport(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addFaultReport(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const orderIds = row.orderId || this.ids;
this.$modal.confirm('是否确认删除故障报修编号为"' + orderIds + '"的数据项?').then(function() {
return delFaultReport(orderIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('device/faultReport/export', {
...this.queryParams
}, `faultReport_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,279 @@
<template>
<el-dialog title="设备选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1100px"
center
:before-close="cancelEquipmentForm"
>
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="5" :xs="24">
<el-card >
<span>请选择设备类型</span>
<div class="head-container" style="text-align: center">
<el-tree
:data="treeData1"
:props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-card>
</el-col>
<!--设备数据-->
<el-col :span="19" :xs="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: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入设备名称"
clearable
style="width: 240px"
@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">
<!-- <template v-slot="scope">
<el-radio v-model="selectedItemId" :label="scope.row.itemId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
</template> -->
</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="equipmentCode" v-if="columns[0].visible" >
</el-table-column>
<el-table-column label="设备类型编码" align="center" key="itemTypeCode" prop="equipmentTypeCode" v-if="columns[2].visible" >
</el-table-column>
<el-table-column label="设备名称" align="left" key="itemName" prop="equipmentName" 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="submitEquipmentForm"> </el-button>
<el-button @click="cancelEquipmentForm"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getEquipmentList,getEquipmentTypeList} from "@/api/device/faultReport";
import { treeselect } from "@/api/wms/equipment";
import { Message } from 'element-ui'
export default {
name: "MdItemSingle",
// components: { Treeselect },
data() {
return {
treeData1:[],
showFlag:false,
//
selectedItemId: undefined,
selectedRows: undefined,
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total:0,
//
itemList: null,
//
itemTypeOptions: undefined,
//
equipmentTypeCode: undefined,
//
queryParams: {
pageNum: 1,
pageSize: 10,
itemName: undefined,
equipmentTypeCode: undefined,
itemTypeId: 0,
itemCodeGet: '',
itemCode : undefined,
},
//
columns: [
{ key: 0, label: `设备编码`, visible: true },
{ key: 1, label: `设备名称`, visible: true },
{ key: 2, label: `设备类型`, visible: true },
]
};
},
created() {
this.getList();
this.getEquipmentType();
},
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;
getEquipmentList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询分类下拉树结构 */
getEquipmentType() {
getEquipmentTypeList().then(response => {
console.log(response.rows);
this.treeData1 = response.rows;
console.log(this.treeData1);
});
},
//
filterNode(value, data) {
console.log(value, data);
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
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();
},
// handleCurrent(row){
// if(row){
// this.selectedRows = row;
// }
// },
// handleRowDbClick(row){
// if(row){
// this.selectedRows = row;
// this.$emit('onSelected',this.selectedRows);
// this.showFlag = false;
// }
// },
//
handleEquipmentSelectionChange(selection) {
this.ids = selection.map(item => item.equipmentCode);
this.single = selection.length!==1;
this.multiple = !selection.length;
console.log("多选框",this.ids);
},
//
// handleRowChange(row) {
// debugger;
// if(row){
// this.selectedRows = row;
// }
// },
//
// confirmSelect(){
// if(this.selectedItemId ==null || this.selectedItemId==0){
// this.$notify({
// title:'',
// type:'warning',
// message: '!'
// });
// return;
// }
// this.$emit('onSelected',this.selectedRows);
// this.showFlag = false;
// }
//
submitEquipmentForm() {
const data = this.ids;
console.log("数据",data);
const equipmentCode = data.toString();
console.log("拆分数据",equipmentCode);
console.log("原来的数据",this.queryParams.itemCodeGet);
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = equipmentCode;
}else{
this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ equipmentCode;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);
this.queryParams.equipmentTypeCode = null;
this.getList();
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
},
cancelEquipmentForm(){
this.queryParams.equipmentTypeCode = null;
this.getList();
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
}
}
};
</script>

@ -0,0 +1,437 @@
<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="applyCode">
<el-input
v-model="queryParams.applyCode"
placeholder="请输入出库单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备品备件编码" prop="spareCode">
<el-input
v-model="queryParams.spareCode"
placeholder="请输入备品备件编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备品备件名称" prop="spareName">
<el-input
v-model="queryParams.spareName"
placeholder="请输入备品备件名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格型号" prop="spareModel">
<el-input
v-model="queryParams.spareModel"
placeholder="请输入规格型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数量" prop="spareQuantity">
<el-input
v-model="queryParams.spareQuantity"
placeholder="请输入数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="使用组线" prop="spareGroupLine">
<el-input
v-model="queryParams.spareGroupLine"
placeholder="请输入使用组线"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="使用设备" prop="spareUseEquipment">
<el-input
v-model="queryParams.spareUseEquipment"
placeholder="请输入使用设备"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="申领人" prop="applyPeople">
<el-input
v-model="queryParams.applyPeople"
placeholder="请输入申领人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批准人" prop="applyApprovePeople">
<el-input
v-model="queryParams.applyApprovePeople"
placeholder="请输入批准人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="领用时间" prop="applyTime">
<el-date-picker
v-model="queryParams.applyTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker>
</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: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>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['device:sparePartsApplicationRecord:export']"
>导出</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: "SparePartsApplicationRecord",
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>

@ -72,8 +72,8 @@ export default {
return {
codeUrl: "",
loginForm: {
username: "admin",
password: "admin123",
username: "",//admin
password: "",//admin123
rememberMe: false,
code: "",
uuid: ""

@ -9,7 +9,7 @@
>
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="4" :xs="24">
<el-col :span="5" :xs="24">
<el-card >
<span>请选择设备类型</span>
<div class="head-container" style="text-align: center">
@ -28,7 +28,7 @@
</el-col>
<!--设备数据-->
<el-col :span="20" :xs="24">
<el-col :span="19" :xs="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

@ -9,7 +9,7 @@
>
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="4" :xs="24">
<el-col :span="5" :xs="24">
<el-card >
<span>请选择设备类型</span>
<div class="head-container" style="text-align: center">
@ -28,7 +28,7 @@
</el-col>
<!--设备数据-->
<el-col :span="20" :xs="24">
<el-col :span="19" :xs="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

Loading…
Cancel
Save