更新
This commit is contained in:
parent
05477cc06f
commit
b1aa6c6324
@ -777,7 +777,7 @@ export default {
|
|||||||
/** 下载模板操作 */
|
/** 下载模板操作 */
|
||||||
importTemplate() {
|
importTemplate() {
|
||||||
importTemplate().then(response => {
|
importTemplate().then(response => {
|
||||||
this.$download.excel(response, '员工导入模板.xls');
|
this.$download.excel(response, '设备导入模板.xls');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 文件上传中处理
|
// 文件上传中处理
|
||||||
|
@ -34,6 +34,14 @@ export function updateEquInfo(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 修改equInfo
|
||||||
|
export function importTemplate() {
|
||||||
|
return request({
|
||||||
|
url: '/system/equInfo/importTemplate',
|
||||||
|
method: 'post',
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 删除equInfo
|
// 删除equInfo
|
||||||
export function delEquInfo(id) {
|
export function delEquInfo(id) {
|
||||||
|
@ -27,7 +27,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备类型" prop="type">
|
<el-form-item label="设备类型" prop="type">
|
||||||
<el-select v-model="queryParams.type">
|
<el-select v-model="queryParams.type">
|
||||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.INS_EQU_TYPE)" :key="item.value" :value="item.value" :label="item.label"/>
|
<el-option v-for="item in this.getDictDatas(DICT_TYPE.INS_EQU_TYPE)" :key="item.value" :value="item.value"
|
||||||
|
:label="item.label"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="检定时间">
|
<el-form-item label="检定时间">
|
||||||
@ -56,30 +57,14 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
|
|
||||||
>新增</el-button>
|
>新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport"
|
||||||
|
v-hasPermi="['system:user:import']">导入
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="success"-->
|
|
||||||
<!-- plain-->
|
|
||||||
<!-- icon="el-icon-edit"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- :disabled="single"-->
|
|
||||||
<!-- @click="handleUpdate"-->
|
|
||||||
<!-- v-hasPermi="['system:equInfo: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="['system:equInfo:remove']"-->
|
|
||||||
<!-- >删除</el-button>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
@ -87,7 +72,8 @@
|
|||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
>导出</el-button>
|
>导出
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -103,14 +89,20 @@
|
|||||||
<DictTag :type="DICT_TYPE.INS_EQU_TYPE" :value="scope.row.type"/>
|
<DictTag :type="DICT_TYPE.INS_EQU_TYPE" :value="scope.row.type"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="设备检定周期" align="center" prop="equZq" />
|
<el-table-column label="校准日期" align="center" prop="equZq"/>
|
||||||
<el-table-column label="有效期" align="center" prop="validTime" width="180">
|
<el-table-column label="有效期" align="center" prop="validTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.validTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.validTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="上次检定单位" align="center" prop="lastUnit" />
|
<el-table-column label="校准单位" align="center" prop="lastUnit"/>
|
||||||
<el-table-column label="下次检定时间" align="center" prop="nextCheckTime" width="180">
|
<el-table-column label="证书编号" align="center" prop="certificateNumber"/>
|
||||||
|
<el-table-column label="制造商" align="center" prop="manufacturer"/>
|
||||||
|
<el-table-column label="电话" align="center" prop="mobile"/>
|
||||||
|
<el-table-column label="邮编" align="center" prop="postcode"/>
|
||||||
|
<el-table-column label="地址" align="center" prop="address"/>
|
||||||
|
<el-table-column label="邮箱" align="center" prop="email"/>
|
||||||
|
<el-table-column label="复校日期" align="center" prop="nextCheckTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.nextCheckTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.nextCheckTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
@ -128,14 +120,16 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
|
|
||||||
>修改</el-button>
|
>修改
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
|
|
||||||
>删除</el-button>
|
>删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -162,7 +156,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备类型" prop="type">
|
<el-form-item label="设备类型" prop="type">
|
||||||
<el-select v-model="form.type" placeholder="请选择类别">
|
<el-select v-model="form.type" placeholder="请选择类别">
|
||||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.INS_EQU_TYPE)" :key="item.value" :value="item.value" :label="item.label" />
|
<el-option v-for="item in this.getDictDatas(DICT_TYPE.INS_EQU_TYPE)" :key="item.value" :value="item.value"
|
||||||
|
:label="item.label"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备检定周期" prop="equZq">
|
<el-form-item label="设备检定周期" prop="equZq">
|
||||||
@ -193,12 +188,100 @@
|
|||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 设备导入对话框 -->
|
||||||
|
<el-dialog :title="upload.title" :visible.sync="upload.open" append-to-body>
|
||||||
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||||
|
:action="upload.url" :disabled="upload.isUploading"
|
||||||
|
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||||
|
<i class="el-icon-upload"></i>
|
||||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
|
<div class="el-upload__tip" slot="tip">
|
||||||
|
<el-checkbox v-model="upload.updateSupport"/>
|
||||||
|
是否更新已经存在的设备数据
|
||||||
|
</div>
|
||||||
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||||
|
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
||||||
|
@click="importTemplate">下载模板
|
||||||
|
</el-link>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<el-table
|
||||||
|
v-if="isFail"
|
||||||
|
:data="failList"
|
||||||
|
stripe
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column
|
||||||
|
prop="equName"
|
||||||
|
label="设备名称"
|
||||||
|
width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="reason"
|
||||||
|
label="失败原因">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="type"
|
||||||
|
label="设备类型">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="equModel"
|
||||||
|
label="型号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="equNumber"
|
||||||
|
label="出厂编号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="validTime"
|
||||||
|
label="校准日期">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="nextCheckTime"
|
||||||
|
label="复校日期">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="certificateNumber"
|
||||||
|
label="证书编号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="manufacturer"
|
||||||
|
label="制造商">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="lastUnit"
|
||||||
|
label="校准单位">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="mobile"
|
||||||
|
label="电话">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="address"
|
||||||
|
label="地址">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="postcode"
|
||||||
|
label="邮编">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="email"
|
||||||
|
label="邮箱">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
|
<el-button @click="upload.open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listEquInfo, getEquInfo, delEquInfo, addEquInfo, updateEquInfo } from "./api/device";
|
import {listEquInfo, getEquInfo, delEquInfo, addEquInfo, updateEquInfo, importTemplate} from "./api/device";
|
||||||
import {DICT_TYPE} from "@/utils/dict";
|
import {DICT_TYPE} from "@/utils/dict";
|
||||||
|
import {getBaseHeader} from "@/utils/request";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EquInfo",
|
name: "EquInfo",
|
||||||
@ -209,6 +292,8 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isFail:false,
|
||||||
|
failList: [],
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -239,11 +324,25 @@
|
|||||||
nextCheckTime: null,
|
nextCheckTime: null,
|
||||||
type: null
|
type: null
|
||||||
},
|
},
|
||||||
|
// 设备导入参数
|
||||||
|
upload: {
|
||||||
|
// 是否显示弹出层(设备导入)
|
||||||
|
open: false,
|
||||||
|
// 弹出层标题(设备导入)
|
||||||
|
title: "",
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
// 是否更新已经存在的设备数据
|
||||||
|
updateSupport: 0,
|
||||||
|
// 设置上传的请求头部
|
||||||
|
headers: getBaseHeader(),
|
||||||
|
// 上传的地址
|
||||||
|
url: process.env.VUE_APP_BASE_API + '/admin-api/system/equInfo/importEquipment'
|
||||||
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -260,10 +359,41 @@
|
|||||||
}
|
}
|
||||||
listEquInfo(this.queryParams).then(response => {
|
listEquInfo(this.queryParams).then(response => {
|
||||||
this.equInfoList = response.data.records;
|
this.equInfoList = response.data.records;
|
||||||
this.total = response.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/** 导入按钮操作 */
|
||||||
|
handleImport() {
|
||||||
|
this.upload.title = "设备导入";
|
||||||
|
this.upload.open = true;
|
||||||
|
},
|
||||||
|
// 文件上传中处理
|
||||||
|
handleFileUploadProgress(event, file, fileList) {
|
||||||
|
this.upload.isUploading = true;
|
||||||
|
},
|
||||||
|
// 文件上传成功处理
|
||||||
|
handleFileSuccess(response, file, fileList) {
|
||||||
|
if (response.code !== 0) {
|
||||||
|
this.$modal.msgError(response.msg)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// this.upload.open = false;
|
||||||
|
this.upload.isUploading = false;
|
||||||
|
this.$refs.upload.clearFiles();
|
||||||
|
if (response.data.failList.length > 0) {
|
||||||
|
this.isFail = true
|
||||||
|
this.$set(this, 'failList', response.data.failList); // 确保响应式
|
||||||
|
console.log(this.failList)
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 下载模板操作 */
|
||||||
|
importTemplate() {
|
||||||
|
importTemplate().then(response => {
|
||||||
|
this.$download.excel(response, '设备导入模板.xls');
|
||||||
|
});
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -342,6 +472,13 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 提交上传文件
|
||||||
|
submitFileForm() {
|
||||||
|
this.$refs.upload.submit();
|
||||||
|
this.failList = []
|
||||||
|
this.isFail = false
|
||||||
|
console.log('执行')
|
||||||
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
@ -350,7 +487,8 @@
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
@ -65,41 +65,38 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!-- <el-row :gutter="10" class="mb8">-->
|
<el-row :gutter="10" class="mb8">
|
||||||
<!-- <el-col :span="1.5">-->
|
<el-col :span="1.5">
|
||||||
<!-- <el-button-->
|
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
||||||
<!-- type="primary"-->
|
v-hasPermi="['system:user:export']">导出
|
||||||
<!-- plain-->
|
</el-button>
|
||||||
<!-- icon="el-icon-plus"-->
|
</el-col>
|
||||||
<!-- size="mini"-->
|
<el-col :span="1.5">
|
||||||
<!-- @click="handleAdd"-->
|
<el-button
|
||||||
<!-- v-hasPermi="['system:info:add']"-->
|
type="success"
|
||||||
<!-- >新增</el-button>-->
|
plain
|
||||||
<!-- </el-col>-->
|
icon="el-icon-edit"
|
||||||
<!-- <el-col :span="1.5">-->
|
size="mini"
|
||||||
<!-- <el-button-->
|
:disabled="single"
|
||||||
<!-- type="success"-->
|
@click="handleUpdate"
|
||||||
<!-- plain-->
|
v-hasPermi="['system:info:edit']"
|
||||||
<!-- icon="el-icon-edit"-->
|
>修改
|
||||||
<!-- size="mini"-->
|
</el-button>
|
||||||
<!-- :disabled="single"-->
|
</el-col>
|
||||||
<!-- @click="handleUpdate"-->
|
<el-col :span="1.5">
|
||||||
<!-- v-hasPermi="['system:info:edit']"-->
|
<el-button
|
||||||
<!-- >修改</el-button>-->
|
type="danger"
|
||||||
<!-- </el-col>-->
|
plain
|
||||||
<!-- <el-col :span="1.5">-->
|
icon="el-icon-delete"
|
||||||
<!-- <el-button-->
|
size="mini"
|
||||||
<!-- type="danger"-->
|
:disabled="multiple"
|
||||||
<!-- plain-->
|
@click="handleDelete"
|
||||||
<!-- icon="el-icon-delete"-->
|
v-hasPermi="['system:info:remove']"
|
||||||
<!-- size="mini"-->
|
>删除
|
||||||
<!-- :disabled="multiple"-->
|
</el-button>
|
||||||
<!-- @click="handleDelete"-->
|
</el-col>
|
||||||
<!-- v-hasPermi="['system:info:remove']"-->
|
|
||||||
<!-- >删除</el-button>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
<!-- </el-row>-->
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
@ -193,6 +190,7 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import DictTag from "@/components/DictTagOld/index.vue";
|
import DictTag from "@/components/DictTagOld/index.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Info",
|
name: "Info",
|
||||||
components: {DictTag},
|
components: {DictTag},
|
||||||
@ -236,8 +234,7 @@
|
|||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -368,13 +365,14 @@
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('system/info/export', {
|
this.download('system/inspectionGoods/exportPartnerOrderListSystem', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `info_${new Date().getTime()}.xlsx`)
|
}, `订单_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user