|
|
|
|
@ -150,7 +150,7 @@
|
|
|
|
|
<span v-show="scope.row.validStatus == 1">有效</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="来源" align="center" prop="remark" />
|
|
|
|
|
<el-table-column label="来源" align="center" prop="source" />
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
|
|
|
|
@ -197,7 +197,7 @@
|
|
|
|
|
<!-- <el-form-item label="仪器id" prop="instrumentId">-->
|
|
|
|
|
<!-- <el-input v-model="form.instrumentId" placeholder="请输入仪器id" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="仪器型号" prop="instrumentName">
|
|
|
|
|
<el-form-item label="仪器型号" prop="instrumentId">
|
|
|
|
|
<el-select :disabled="isDisabled(form)"
|
|
|
|
|
v-model="form.instrumentId"
|
|
|
|
|
placeholder="请选择型号"
|
|
|
|
|
@ -224,6 +224,42 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!-- 导入对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="importVisible" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" label-width="80px">
|
|
|
|
|
<el-form-item label="模板下载" prop="serial" >
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
@click="importTemplate"
|
|
|
|
|
>点击下载
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="模板上传" prop="serial" >
|
|
|
|
|
<el-upload
|
|
|
|
|
ref="upload"
|
|
|
|
|
:limit="1"
|
|
|
|
|
accept=".xls, .xlsx"
|
|
|
|
|
:headers="upload.headers"
|
|
|
|
|
:action="upload.url+ '?updateSupport=' + upload.updateSupport"
|
|
|
|
|
: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" slot="tip">只能上传.xls,.xlsx 文件</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitFileForm">导 入</el-button>
|
|
|
|
|
<el-button @click="importCancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 详情记录对话框 -->
|
|
|
|
|
<el-dialog :title="detailTitle" :visible.sync="detailOpen" width="880px" append-to-body>
|
|
|
|
|
<el-table v-loading="loading" :data="userInstrumentLogList">
|
|
|
|
|
@ -256,7 +292,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 二维码-->
|
|
|
|
|
<!-- 二维码-->
|
|
|
|
|
<el-dialog :title="codeTitle" :visible.sync="codeOpen" width="780px" append-to-body>
|
|
|
|
|
<div class="demo-image__lazy">
|
|
|
|
|
<el-image :key="codeUrl" :src="codeUrl" :preview-src-list="[codeUrl]" lazy></el-image>
|
|
|
|
|
@ -312,6 +348,7 @@
|
|
|
|
|
<script>
|
|
|
|
|
import { listSerial, getSerial, delSerial, addSerial, updateSerial,delSerialAll,updateStatus } from "@/api/system/instrumentSerial";
|
|
|
|
|
import {listInstrument} from "@/api/system/instrument";
|
|
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
|
|
import {listLog} from "@/api/system/userInstrumentLog"
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
@ -333,6 +370,8 @@ export default {
|
|
|
|
|
instrumentList: [],
|
|
|
|
|
// 有效无效展示框
|
|
|
|
|
validStatusVisible: false,
|
|
|
|
|
// 导入展示框
|
|
|
|
|
importVisible: false,
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
@ -391,12 +430,27 @@ export default {
|
|
|
|
|
status: null,
|
|
|
|
|
instrumentIdArray: null,
|
|
|
|
|
},
|
|
|
|
|
// 导入参数
|
|
|
|
|
upload: {
|
|
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
|
|
open: false,
|
|
|
|
|
// 弹出层标题(用户导入)
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否禁用上传
|
|
|
|
|
isUploading: false,
|
|
|
|
|
// 是否更新已经存在的用户数据
|
|
|
|
|
updateSupport: 0,
|
|
|
|
|
// 设置上传的请求头部
|
|
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
|
// 上传的地址
|
|
|
|
|
url: process.env.VUE_APP_BASE_API + "/system/instrumentSerial/importData"
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
instrumentId: [
|
|
|
|
|
{ required: true, message: "仪器id不能为空", trigger: "blur" }
|
|
|
|
|
{ required: true, message: "仪器名称不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
instrumentName: [
|
|
|
|
|
{ required: true, message: "仪器名称不能为空", trigger: "blur" }
|
|
|
|
|
@ -443,6 +497,11 @@ export default {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
importCancel(){
|
|
|
|
|
this.importVisible = false;
|
|
|
|
|
this.upload.isUploading = false;
|
|
|
|
|
this.$refs.upload.clearFiles();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
@ -557,11 +616,15 @@ export default {
|
|
|
|
|
if (this.batchOperateValue == 2) {
|
|
|
|
|
this.exportFieldsVisible = true;
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperateValue == 3) {
|
|
|
|
|
this.importVisible = true;
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperateValue == 4) {
|
|
|
|
|
if (this.ids.length == 0) {
|
|
|
|
|
this.$message.error("请选择数据");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const ids = this.ids;
|
|
|
|
|
this.$modal.confirm('确定将选择的数据删除?【请谨慎操作,一旦成功将无法撤销】').then(function() {
|
|
|
|
|
return delSerial(ids);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
@ -665,9 +728,31 @@ export default {
|
|
|
|
|
this.exportFieldList.createTime = null;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 关闭弹窗
|
|
|
|
|
cancelUpdateStatusDialog (){
|
|
|
|
|
this.validStatusVisible = false;
|
|
|
|
|
},
|
|
|
|
|
// 文件上传中处理
|
|
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
|
|
this.upload.isUploading = true;
|
|
|
|
|
},
|
|
|
|
|
// 文件上传成功处理
|
|
|
|
|
handleFileSuccess(response, file, fileList, item) {
|
|
|
|
|
this.importVisible = false;
|
|
|
|
|
this.upload.isUploading = false;
|
|
|
|
|
this.$refs.upload.clearFiles();
|
|
|
|
|
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
/** 下载模板操作 */
|
|
|
|
|
importTemplate() {
|
|
|
|
|
this.download('system/instrumentSerial/importTemplate', {
|
|
|
|
|
}, `仪器序列号模板_${new Date().getTime()}.xlsx`)
|
|
|
|
|
},
|
|
|
|
|
// 提交上传文件
|
|
|
|
|
submitFileForm() {
|
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|