更新
This commit is contained in:
parent
05477cc06f
commit
b1aa6c6324
@ -777,7 +777,7 @@ export default {
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
importTemplate().then(response => {
|
||||
this.$download.excel(response, '员工导入模板.xls');
|
||||
this.$download.excel(response, '设备导入模板.xls');
|
||||
});
|
||||
},
|
||||
// 文件上传中处理
|
||||
|
@ -34,6 +34,14 @@ export function updateEquInfo(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改equInfo
|
||||
export function importTemplate() {
|
||||
return request({
|
||||
url: '/system/equInfo/importTemplate',
|
||||
method: 'post',
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除equInfo
|
||||
export function delEquInfo(id) {
|
||||
|
@ -27,7 +27,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="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-form-item>
|
||||
<el-form-item label="检定时间">
|
||||
@ -56,30 +57,14 @@
|
||||
size="mini"
|
||||
@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 :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-button
|
||||
type="warning"
|
||||
@ -87,7 +72,8 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -103,14 +89,20 @@
|
||||
<DictTag :type="DICT_TYPE.INS_EQU_TYPE" :value="scope.row.type"/>
|
||||
</template>
|
||||
</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">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.validTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="lastUnit"/>
|
||||
<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">
|
||||
<span>{{ parseTime(scope.row.nextCheckTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
@ -128,14 +120,16 @@
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -162,7 +156,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="type">
|
||||
<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-form-item>
|
||||
<el-form-item label="设备检定周期" prop="equZq">
|
||||
@ -193,12 +188,100 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<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 {getBaseHeader} from "@/utils/request";
|
||||
|
||||
export default {
|
||||
name: "EquInfo",
|
||||
@ -209,6 +292,8 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isFail:false,
|
||||
failList: [],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@ -239,11 +324,25 @@
|
||||
nextCheckTime: 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: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -260,10 +359,41 @@
|
||||
}
|
||||
listEquInfo(this.queryParams).then(response => {
|
||||
this.equInfoList = response.data.records;
|
||||
this.total = response.total;
|
||||
this.total = response.data.total;
|
||||
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() {
|
||||
this.open = false;
|
||||
@ -342,6 +472,13 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
this.failList = []
|
||||
this.isFail = false
|
||||
console.log('执行')
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
@ -350,7 +487,8 @@
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
@ -65,41 +65,38 @@
|
||||
</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="['system:info: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="['system:info: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:info:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
||||
v-hasPermi="['system:user:export']">导出
|
||||
</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="['system:info: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:info:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<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-column type="selection" width="55" align="center"/>
|
||||
@ -193,6 +190,7 @@
|
||||
import moment from 'moment';
|
||||
import request from "@/utils/request";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
components: {DictTag},
|
||||
@ -236,8 +234,7 @@
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -368,13 +365,14 @@
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/info/export', {
|
||||
this.download('system/inspectionGoods/exportPartnerOrderListSystem', {
|
||||
...this.queryParams
|
||||
}, `info_${new Date().getTime()}.xlsx`)
|
||||
}, `订单_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user