feat: rescue文件夹

This commit is contained in:
李沐阳 2024-03-25 11:35:54 +08:00
parent 6b73597479
commit 4964e97cf8

View File

@ -0,0 +1,394 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
<el-form-item label="覆盖件名称" prop="productName">
<el-input
v-model="queryParams.productName"
placeholder="请输入覆盖件名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="型号" prop="batchInfo">
<el-input
v-model="queryParams.batchInfo"
placeholder="请输入型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="长度" prop="lengthInfo">
<el-input
v-model="queryParams.lengthInfo"
placeholder="请输入长度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="宽度" prop="wideInfo">
<el-input
v-model="queryParams.wideInfo"
placeholder="请输入宽度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="高度" prop="heightInfo">
<el-input
v-model="queryParams.heightInfo"
placeholder="请输入高度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="角度" prop="angle">
<el-input
v-model="queryParams.angle"
placeholder="请输入角度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检测时间">
<el-date-picker
v-model="daterangeDetectTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="结果" prop="detectResult">
<el-input
v-model="queryParams.detectResult"
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="['qcfgjManage:dock: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="['qcfgjManage:dock: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="['qcfgjManage:dock: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="['qcfgjManage:dock:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dockList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="覆盖件名称" align="center" prop="productName" />
<el-table-column label="型号" align="center" prop="batchInfo" />
<el-table-column label="长度" align="center" prop="lengthInfo" />
<el-table-column label="宽度" align="center" prop="wideInfo" />
<el-table-column label="高度" align="center" prop="heightInfo" />
<!-- <el-table-column label="角度" align="center" prop="angle" />-->
<el-table-column label="要求" align="center" prop="standards" />
<!-- <el-table-column label="图片信息" align="center" prop="imageInfo" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- <image-preview :src="scope.row.imageInfo" :width="50" :height="50"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="检测时间" align="center" prop="detectTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.detectTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="结果" align="center" prop="detectResult" >
<template slot-scope="scope">
<el-tag type="warning" v-if="scope.row.detectResult === '处理中'">{{scope.row.detectResult}}</el-tag>
<el-tag type="success" v-else-if="scope.row.detectResult === '合格'">{{scope.row.detectResult}}</el-tag>
<el-tag type="danger" v-else-if="scope.row.detectResult === '未识别'">{{scope.row.detectResult}}</el-tag>
<el-tag type="info" v-else>{{scope.row.detectResult}}</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<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="['qcfgjManage:dock:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['qcfgjManage:dock: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="88px">
<el-form-item label="覆盖件名称" prop="productName">
<el-input v-model="form.productName" placeholder="请输入覆盖件名称" />
</el-form-item>
<el-form-item label="型号" prop="batchInfo">
<el-input v-model="form.batchInfo" placeholder="请输入型号" />
</el-form-item>
<el-form-item label="长度" prop="lengthInfo">
<el-input v-model="form.lengthInfo" placeholder="请输入长度" />
</el-form-item>
<el-form-item label="宽度" prop="wideInfo">
<el-input v-model="form.wideInfo" placeholder="请输入宽度" />
</el-form-item>
<el-form-item label="高度" prop="heightInfo">
<el-input v-model="form.heightInfo" placeholder="请输入高度" />
</el-form-item>
<el-form-item label="角度" prop="angle">
<el-input v-model="form.angle" placeholder="请输入角度" />
</el-form-item>
<el-form-item label="标准要求" prop="standards">
<el-input v-model="form.standards" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="图片信息" prop="imageInfo">
<image-upload v-model="form.imageInfo"/>
</el-form-item>
<el-form-item label="检测时间" prop="detectTime">
<el-date-picker clearable
v-model="form.detectTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择检测时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结果" prop="detectResult">
<el-input v-model="form.detectResult" placeholder="请输入结果" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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 { listDock, getDock, delDock, addDock, updateDock } from "@/api/qcfgjManage/dock";
export default {
//
name: "Dock",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dockList: [],
//
title: "",
//
open: false,
//
daterangeDetectTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
productName: null,
batchInfo: null,
lengthInfo: null,
wideInfo: null,
heightInfo: null,
angle: null,
standards: null,
imageInfo: null,
detectTime: null,
detectResult: null,
dataType: "外观尺寸数据"
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询产品数据信息对接列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeDetectTime && '' != this.daterangeDetectTime) {
this.queryParams.params["beginDetectTime"] = this.daterangeDetectTime[0];
this.queryParams.params["endDetectTime"] = this.daterangeDetectTime[1];
}
listDock(this.queryParams).then(response => {
this.dockList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
productName: null,
batchInfo: null,
lengthInfo: null,
wideInfo: null,
heightInfo: null,
angle: null,
standards: null,
imageInfo: null,
detectTime: null,
detectResult: null,
remark: null,
dataType: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeDetectTime = [];
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 = "添加产品外观尺寸数据对接";
this.form.dataType="外观尺寸数据";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDock(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) {
updateDock(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDock(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除产品外观尺寸数据对接编号为"' + ids + '"的数据项?').then(function() {
return delDock(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('qcfgjManage/dock/export', {
...this.queryParams
}, `dock_${new Date().getTime()}.xlsx`)
}
}
};
</script>