设备属性新增
This commit is contained in:
parent
c8c0dce147
commit
733314dc4b
|
|
@ -72,6 +72,15 @@ export function addBox(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 手环管理页面新增设备属性
|
||||
export function addAttribute(data) {
|
||||
return request({
|
||||
url: '/bracelet/bracelet/addAttribute',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 手环绑定选择页面绑定手环
|
||||
export function addShBind(data) {
|
||||
return request({
|
||||
|
|
@ -164,12 +173,3 @@ export function exportSh(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询班组成员列表
|
||||
export function getWorkPersonList(query) {
|
||||
return request({
|
||||
url: '/bracelet/team/getWorkPersonList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询列表
|
||||
export function DeviceLyRecord(query) {
|
||||
return request({
|
||||
url: '/bracelet/deviceLyRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function exportDeviceLyRecord(query) {
|
||||
return request({
|
||||
url: '/bracelet/export/exportDeviceLyRecord',
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询列表
|
||||
export function DeviceLyRecord(query) {
|
||||
return request({
|
||||
url: '/bracelet/deviceLyRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function exportDeviceLyRecord(query) {
|
||||
return request({
|
||||
url: '/bracelet/export/exportDeviceLyRecord',
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -124,6 +124,12 @@
|
|||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['basic:bracelet:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleAddAttribute(scope.row)"
|
||||
v-hasPermi="['basic:bracelet:edit']"
|
||||
>新增设备属性</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
|
@ -166,8 +172,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="选择" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<input type="radio" name="radio" value="1" v-model="radio" @click="getShboxName($event,scope.row)"/>
|
||||
</template>
|
||||
<input type="radio" name="radioOne" value="1" v-model="radioOne" @click="getShboxBindName($event,scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
|
@ -212,7 +218,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="选择" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<input type="radio" name="radio" value="1" v-model="radio" @click="getShboxBindName($event,scope.row)"/>
|
||||
<input type="radio" name="radioTwo" value="1" v-model="radioTwo" @click="getShboxBindName($event,scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -259,7 +265,7 @@
|
|||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFormEdit">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button @click="cancelEdit">取 消</el-button>
|
||||
</div>
|
||||
<pagination
|
||||
v-show="totalTwo>0"
|
||||
|
|
@ -271,6 +277,47 @@
|
|||
|
||||
</el-dialog>
|
||||
|
||||
<!-- 新增设备属性弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="showAttribute" width="600px" append-to-body>
|
||||
<el-form ref="formThree" :model="formThree" :rules="rulesShAttribute" label-width="120px" >
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="设备属性名称" prop="dataName">
|
||||
<el-input v-model="formThree.dataName" placeholder="请输入设备属性名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="设备采集值" prop="dataVal">
|
||||
<el-input v-model="formThree.dataVal" placeholder="请输入设备采集值" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="设备值单位" prop="dataUnit">
|
||||
<el-input v-model.number="formThree.dataUnit" placeholder="请输入手环箱容量" >
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="级联编码" prop="dataCode">
|
||||
<el-input v-model.number="formThree.dataCode" placeholder="请输入级联编码" >
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFormAttribute">确 定</el-button>
|
||||
<el-button @click="cancelAttribute">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
|
|
@ -346,11 +393,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- <template slot-scope="scope">
|
||||
<div>
|
||||
<span style="color: green;">{{ scope.row.shboxBindNum }}/</span><span>{{ scope.row.shboxCapacity }}</span>
|
||||
</div>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="二维码" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
|
|
@ -509,46 +551,6 @@
|
|||
|
||||
</el-dialog>
|
||||
|
||||
<!-- 修改手环弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="showShEdit" width="600px" height="600px" append-to-body>
|
||||
<el-form :model="queryshEdit" ref="queryshEdit" :rules="rules" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="手环编码" prop="shCode">
|
||||
<el-input
|
||||
v-model="queryshEdit.shCode"
|
||||
placeholder="请输入手环编码"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loadingFour" :data="shboxList" width="600px" height = "400px" >
|
||||
<el-table-column label="手环箱id" align="center" prop="shboxId" v-if="false" />
|
||||
<el-table-column label="手环箱名称" align="center" prop="shboxName" />
|
||||
<el-table-column label="手环箱编码" align="center" prop="shboxCode" />
|
||||
<el-table-column label="已绑手环" align="center" prop="shboxBindNum" >
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<span style="color: green;">{{ scope.row.shboxBindNum }}/</span><span>{{ scope.row.shboxCapacity }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="选择" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<input type="radio" name="radio" :checked="shboxId==scope.row.shboxId" @click="getShboxNameEdit($event,scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFormEdit">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
<pagination
|
||||
v-show="totalTwo>0"
|
||||
:total="totalTwo"
|
||||
:page.sync="queryshEdit.pageNum"
|
||||
:limit.sync="queryshEdit.pageSize"
|
||||
@pagination="getListShEdit"
|
||||
/>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<!-- 添加或修改手环箱对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="openbox" width="600px" append-to-body>
|
||||
|
|
@ -609,7 +611,7 @@
|
|||
|
||||
<script>
|
||||
import { listBracelet, listShboxall,delShById, exportSh,listShbox,addSh,listShboxBind,addShBind,delSh,editSh,
|
||||
getBoxInfo,editBox,addBox,delShboxById,listShBind,listShNoBind,bindSh,getBoxNewInfo} from "@/api/base/bracelet";
|
||||
getBoxInfo,editBox,addBox,delShboxById,listShBind,listShNoBind,bindSh,getBoxNewInfo,addAttribute} from "@/api/base/bracelet";
|
||||
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
|
@ -628,6 +630,9 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
radioOne:null,
|
||||
radioTwo:null,
|
||||
activeName: 'first',
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
|
|
@ -777,6 +782,8 @@
|
|||
|
||||
openSh:false,
|
||||
|
||||
showAttribute:false,
|
||||
|
||||
stateList:['在用','未用'],
|
||||
accept:'.png, .jpg, .jpeg, .pdf, .doc, .docx',
|
||||
highImgList: [],
|
||||
|
|
@ -785,6 +792,7 @@
|
|||
// 表单参数
|
||||
form: {},
|
||||
formTwo: {},
|
||||
formThree: {},
|
||||
//图片上传
|
||||
fileList: [],
|
||||
//图片查看弹窗
|
||||
|
|
@ -836,7 +844,22 @@
|
|||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
rulesShAttribute: {
|
||||
dataName: [
|
||||
{ required: true, message: "设备属性名称不能为空", trigger: "blur" }
|
||||
],
|
||||
dataVal: [
|
||||
{ required: true, message: "设备采集值不能为空", trigger: "blur" }
|
||||
],
|
||||
dataUnit: [
|
||||
{ required: true, message: "设备值单位不能为空", trigger: "blur" }
|
||||
],
|
||||
dataCode: [
|
||||
{ required: true, message: "级联编码不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -851,7 +874,7 @@
|
|||
},
|
||||
methods: {
|
||||
|
||||
/** 查询设备列表 */
|
||||
/** 查询手环列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listBracelet(this.queryParams).then(response => {
|
||||
|
|
@ -882,6 +905,11 @@
|
|||
this.showsh = false;
|
||||
this.reset();
|
||||
},
|
||||
// 修改手环页面取消按钮
|
||||
cancelEdit() {
|
||||
this.showShEdit = false;
|
||||
// this.resetEdit();
|
||||
},
|
||||
// 手环绑定选择页面取消按钮
|
||||
cancelBind() {
|
||||
this.showshBind = false;
|
||||
|
|
@ -907,6 +935,15 @@
|
|||
this.formTwo = {};
|
||||
this.resetForm("formTwo");
|
||||
},
|
||||
resetAttribute() {
|
||||
this.formThree = {};
|
||||
this.resetForm("formThree");
|
||||
},
|
||||
// 手环修改按钮页面表单重置
|
||||
resetEdit() {
|
||||
this.queryshEdit = {};
|
||||
this.resetForm("queryshEdit");
|
||||
},
|
||||
// 手环绑定选择页面表单重置
|
||||
resetBind() {
|
||||
this.queryshCodeBind = {};
|
||||
|
|
@ -1068,7 +1105,7 @@
|
|||
return delSh(param);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.getBoxInfo();
|
||||
// this.getBoxInfo();
|
||||
this.$modal.msgSuccess("解除绑定成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
|
@ -1108,11 +1145,35 @@
|
|||
handleAddSh() {
|
||||
this.openSh = true;
|
||||
this.title = "绑定手环";
|
||||
|
||||
this.getListNoBind();
|
||||
},
|
||||
/** 新增设备属性按钮操作 */
|
||||
handleAddAttribute(row) {
|
||||
this.resetAttribute();
|
||||
this.formThree.shId = row.shId;
|
||||
this.title = "新增设备属性"
|
||||
this.showAttribute = true;
|
||||
},
|
||||
|
||||
|
||||
/** 手环管理页面新增设备属性提交按钮 */
|
||||
submitFormAttribute() {
|
||||
this.$refs["formThree"].validate(valid => {
|
||||
if (valid) {
|
||||
addAttribute(this.formThree).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.showAttribute = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 手环管理页面新增设备属性取消按钮
|
||||
cancelAttribute() {
|
||||
this.showAttribute = false;
|
||||
this.resetAttribute();
|
||||
},
|
||||
/** 绑定操作 */
|
||||
handleBindSh(row) {
|
||||
const shIds = row.shId || this.ids;
|
||||
|
|
@ -1137,7 +1198,7 @@
|
|||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
// this.reset();
|
||||
const shPersonName = row.shPersonName;
|
||||
const shId = row.shId;
|
||||
if(shPersonName!=null){
|
||||
|
|
@ -1157,6 +1218,7 @@
|
|||
this.queryshEdit.shCode = row.shCode;
|
||||
},
|
||||
|
||||
|
||||
handleUpdatebox(row) {
|
||||
this.resetbox();
|
||||
const lyName = row.lyName;
|
||||
|
|
@ -1219,14 +1281,24 @@
|
|||
this.queryshCodeBind.shboxName = row.shboxName;
|
||||
this.queryshCodeBind.shboxCapacity = row.shboxCapacity;
|
||||
this.queryshCodeBind.shboxBindNum = row.shboxBindNum;
|
||||
if(e.target.value == this[e.target.name]){
|
||||
e.target.checked = false
|
||||
// if(e.target.value == this[e.target.name]){
|
||||
// e.target.checked = false
|
||||
// this.queryshCodeBind.shboxId = null;
|
||||
// this.queryshCodeBind.shboxName =null;
|
||||
// this.queryshCodeBind.shboxCapacity = null;
|
||||
// this.queryshCodeBind.shboxBindNum = null;
|
||||
// this[e.target.name] = ''
|
||||
// }
|
||||
if(this.shboxId == row.shboxId){
|
||||
this.shboxId = 0
|
||||
e.target.checked = false;
|
||||
this.queryshCodeBind.shboxId = null;
|
||||
this.queryshCodeBind.shboxName =null;
|
||||
this.queryshCodeBind.shboxCapacity = null;
|
||||
this.queryshCodeBind.shboxBindNum = null;
|
||||
this[e.target.name] = ''
|
||||
}
|
||||
this.queryshCodeBind.shboxName =null;
|
||||
this.queryshCodeBind.shboxCapacity = null;
|
||||
this.queryshCodeBind.shboxBindNum = null;
|
||||
}else{
|
||||
this.shboxId = row.shboxId;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
|
@ -1270,6 +1342,7 @@
|
|||
submitFormEdit() {
|
||||
console.log(this.queryshEdit);
|
||||
this.queryshEdit.shCode = this.queryshEdit.shCode;
|
||||
this.queryshEdit.shboxId = this.shboxId;
|
||||
this.$refs["queryshEdit"].validate(valid => {
|
||||
if (valid) {
|
||||
editSh(this.queryshEdit).then(response => {
|
||||
|
|
@ -1306,6 +1379,7 @@
|
|||
|
||||
},
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row)
|
||||
|
|
@ -1451,6 +1525,7 @@
|
|||
this.title = "新增手环"
|
||||
this.showsh = true;
|
||||
this.getListTemp();
|
||||
this.radioOne=null;
|
||||
this.queryshCode.pageNum = 1;
|
||||
this.queryshCode.shCode = undefined;
|
||||
},
|
||||
|
|
@ -1461,6 +1536,7 @@
|
|||
this.title = "选择"
|
||||
this.showshBind = true;
|
||||
this.getListBind();
|
||||
this.radioTwo=null;
|
||||
this.queryshCodeBind.pageNum = 1;
|
||||
this.queryshCodeBind.shId = row.shId;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
<el-select v-model="queryParams.deviceType" placeholder="设备类型" clearable style="width: 100%;">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_device_type"
|
||||
v-if = "dict.value != 'shx'"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -77,11 +78,11 @@
|
|||
<el-table v-loading="loading" :data="tableData" ref="multipleTable" row-key="deviceCode" @selection-change="handleSelectionChange" @select="handlerSelect" @select-all="handlerSelectAll">
|
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
|
||||
<el-table-column label="设备id" align="center" prop="deviceId" v-if="false" />
|
||||
<el-table-column label="设备类型" align="center" prop="deviceType">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ dict.type.sys_device_type[Number(scope.row.deviceType)].label }}</div>
|
||||
<el-table-column label="设备类型" align="center" prop="deviceTypeName"/>
|
||||
<!-- <template slot-scope="scope">
|
||||
<div>{{ dict.type.sys_device_type[(scope.row.deviceType)].label }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
<el-table-column label="设备编号" align="center" prop="deviceCode" />
|
||||
<el-table-column label="二维码" align="center" class-name="small-padding fixed-width">
|
||||
|
|
@ -137,6 +138,7 @@
|
|||
<el-select v-model="form.deviceType" placeholder="请选择设备类型" clearable style="width: 100%;">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_device_type"
|
||||
v-if = "dict.value != 'shx'"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
|
|||
|
|
@ -328,13 +328,8 @@ export default {
|
|||
},100)
|
||||
|
||||
});
|
||||
fileId: item.filePath,
|
||||
url: item.bast64Image
|
||||
})
|
||||
});
|
||||
this.open = true;
|
||||
this.title = "修改项目";
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
// 图片上传
|
||||
handleChange(file, fileList) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,260 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item prop="proName">
|
||||
<el-input
|
||||
v-model="queryParams.proName"
|
||||
placeholder="工程名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="departName">
|
||||
<el-input
|
||||
v-model="queryParams.departName"
|
||||
placeholder="项目部"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="teamName">
|
||||
<el-input
|
||||
v-model="queryParams.teamName"
|
||||
placeholder="领用班组"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="devName">
|
||||
<el-input
|
||||
v-model="queryParams.devName"
|
||||
placeholder="设备名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="devCode">
|
||||
<el-input
|
||||
v-model="queryParams.devCode"
|
||||
placeholder="设备编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="devType">
|
||||
<el-select v-model="queryParams.devType" placeholder="设备类型" clearable style="width: 100%;">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_device_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-form-item prop="lyTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.lyTime"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="领用时间"
|
||||
type="date"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="ghTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.ghTime"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="归还时间"
|
||||
type="date"
|
||||
></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-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['basic:deviceLyRecord:export']"
|
||||
>导出数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="tableData">
|
||||
<el-table-column label="工程名称" align="center" prop="proName" />
|
||||
<el-table-column label="项目部名称" align="center" prop="departName" />
|
||||
<el-table-column label="领用班组" align="center" prop="teamName" />
|
||||
<el-table-column label="领用设备类型" align="center" prop="deviceTypeName">
|
||||
</el-table-column>
|
||||
<el-table-column label="设备名称" align="center" prop="devName" />
|
||||
<el-table-column label="领用设备编码" align="center" prop="devCode" />
|
||||
<el-table-column label="班组负责人" align="center" prop="teamLeader">
|
||||
<template slot-scope="scope">
|
||||
<div @click="openShall(scope.row)">
|
||||
<div>
|
||||
<span >{{ scope.row.teamLeader }}\</span><span>{{ scope.row.leaderPhone }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="领用时间" align="center" prop="lyTime" />
|
||||
<el-table-column label="归还时间" align="center" prop="ghTime">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.ghTime" style="font-weight: bold;color: green;">在用</span>
|
||||
<span v-else>{{ scope.row.ghTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remarks" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DeviceLyRecord, exportDeviceLyRecord} from "@/api/comprehensive/constructionRecord";
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import uploadFile from '../../components/uploadFile.vue'
|
||||
export default {
|
||||
name: "Post",
|
||||
dicts: ['sys_normal_disable','sys_device_type','sys_device_status'],
|
||||
components: {
|
||||
uploadFile
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备表格数据
|
||||
tableData: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
shxName:"shx",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
proName:undefined,
|
||||
departName:undefined,
|
||||
teamName: undefined,
|
||||
devType: undefined,
|
||||
devName: undefined,
|
||||
devCode: undefined,
|
||||
// lyTime: undefined,
|
||||
// ghTime: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
||||
},
|
||||
mounted(){
|
||||
console.log(this.dict.type.sys_device_type)
|
||||
},
|
||||
methods: {
|
||||
|
||||
/** 查询设备领用记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
DeviceLyRecord(this.queryParams).then(response => {
|
||||
this.tableData = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.deviceCode)
|
||||
this.single = selection.length!=1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
exportDeviceLyRecord(this.queryParams).then(res => {
|
||||
downloadFile({ fileName: `设备领用记录_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
//隐藏图片上传框的css
|
||||
::v-deep.disabled {
|
||||
.el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,260 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item prop="proName">
|
||||
<el-input
|
||||
v-model="queryParams.proName"
|
||||
placeholder="工程名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="departName">
|
||||
<el-input
|
||||
v-model="queryParams.departName"
|
||||
placeholder="项目部"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="teamName">
|
||||
<el-input
|
||||
v-model="queryParams.teamName"
|
||||
placeholder="领用班组"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="devName">
|
||||
<el-input
|
||||
v-model="queryParams.devName"
|
||||
placeholder="设备名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="devCode">
|
||||
<el-input
|
||||
v-model="queryParams.devCode"
|
||||
placeholder="设备编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="devType">
|
||||
<el-select v-model="queryParams.devType" placeholder="设备类型" clearable style="width: 100%;">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_device_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-form-item prop="lyTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.lyTime"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="领用时间"
|
||||
type="date"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="ghTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.ghTime"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="归还时间"
|
||||
type="date"
|
||||
></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-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['basic:deviceLyRecord:export']"
|
||||
>导出数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="tableData">
|
||||
<el-table-column label="工程名称" align="center" prop="proName" />
|
||||
<el-table-column label="项目部名称" align="center" prop="departName" />
|
||||
<el-table-column label="领用班组" align="center" prop="teamName" />
|
||||
<el-table-column label="领用设备类型" align="center" prop="deviceTypeName">
|
||||
</el-table-column>
|
||||
<el-table-column label="设备名称" align="center" prop="devName" />
|
||||
<el-table-column label="领用设备编码" align="center" prop="devCode" />
|
||||
<el-table-column label="班组负责人" align="center" prop="teamLeader">
|
||||
<template slot-scope="scope">
|
||||
<div @click="openShall(scope.row)">
|
||||
<div>
|
||||
<span >{{ scope.row.teamLeader }}\</span><span>{{ scope.row.leaderPhone }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="领用时间" align="center" prop="lyTime" />
|
||||
<el-table-column label="归还时间" align="center" prop="ghTime">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.ghTime" style="font-weight: bold;color: green;">在用</span>
|
||||
<span v-else>{{ scope.row.ghTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remarks" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DeviceLyRecord, exportDeviceLyRecord} from "@/api/comprehensive/warnHistory";
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import uploadFile from '../../components/uploadFile.vue'
|
||||
export default {
|
||||
name: "Post",
|
||||
dicts: ['sys_normal_disable','sys_device_type','sys_device_status'],
|
||||
components: {
|
||||
uploadFile
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备表格数据
|
||||
tableData: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
shxName:"shx",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
proName:undefined,
|
||||
departName:undefined,
|
||||
teamName: undefined,
|
||||
devType: undefined,
|
||||
devName: undefined,
|
||||
devCode: undefined,
|
||||
// lyTime: undefined,
|
||||
// ghTime: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
||||
},
|
||||
mounted(){
|
||||
console.log(this.dict.type.sys_device_type)
|
||||
},
|
||||
methods: {
|
||||
|
||||
/** 查询设备领用记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
DeviceLyRecord(this.queryParams).then(response => {
|
||||
this.tableData = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.deviceCode)
|
||||
this.single = selection.length!=1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
exportDeviceLyRecord(this.queryParams).then(res => {
|
||||
downloadFile({ fileName: `设备领用记录_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
//隐藏图片上传框的css
|
||||
::v-deep.disabled {
|
||||
.el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -68,8 +68,7 @@
|
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table v-loading="loading" :data="postList" >
|
||||
<el-table-column label="边带id" align="center" prop="sidebandId" v-if="false" />
|
||||
<el-table-column label="边带名称" align="center" prop="sidebandName" />
|
||||
<el-table-column label="边带编码" align="center" prop="sidebandCode" />
|
||||
|
|
@ -140,12 +139,13 @@
|
|||
>绑定设备</el-button>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getListTemp"></right-toolbar>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getListTemp"></right-toolbar> -->
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loadingTwo" :data="bindList" width="600px" height = "600px" >
|
||||
<el-table-column label="设备id" align="center" prop="deviceId" v-if="false" />
|
||||
<el-table-column label="设备类型" align="center" prop="deviceType" />
|
||||
<el-table-column label="设备类型" align="center" prop="deviceTypeName" >
|
||||
</el-table-column>
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
<el-table-column label="设备编号" align="center" prop="deviceCode" />
|
||||
<el-table-column label="设备状态" align="center" prop="deviceStatus" >
|
||||
|
|
@ -169,8 +169,8 @@
|
|||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="totalTwo>0"
|
||||
:total="totalTwo"
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryKeyword.pageNum"
|
||||
:limit.sync="queryKeyword.pageSize"
|
||||
@pagination="getListTemp"
|
||||
|
|
@ -179,7 +179,7 @@
|
|||
</el-dialog>
|
||||
|
||||
<!-- 选择设备弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="showDevice" width="800px" height="800px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="showDevice" width="1000px" height="1000px" append-to-body>
|
||||
<el-form :model="queryKeywordTemp" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item prop="keyword">
|
||||
<el-input
|
||||
|
|
@ -209,7 +209,8 @@
|
|||
<el-table v-loading="loadingThree" :data="bindNoList" width="600px" height = "600px" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="设备id" align="center" prop="deviceId" v-if="false" />
|
||||
<el-table-column label="设备类型" align="center" prop="deviceType" />
|
||||
<el-table-column label="设备类型" align="center" prop="deviceTypeName" >
|
||||
</el-table-column>
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
<el-table-column label="设备编号" align="center" prop="deviceCode" />
|
||||
</el-table>
|
||||
|
|
@ -290,7 +291,7 @@
|
|||
import uploadFile from '../../components/uploadFile.vue'
|
||||
export default {
|
||||
name: "Post",
|
||||
dicts: ['sys_normal_disable','sys_user_sex'],
|
||||
dicts: ['sys_normal_disable','sys_device_type','sys_user_sex'],
|
||||
components: {
|
||||
uploadFile
|
||||
},
|
||||
|
|
@ -303,7 +304,8 @@
|
|||
// 遮罩层3
|
||||
loadingThree:true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
|
||||
idLists:[],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
|
|
@ -445,7 +447,8 @@
|
|||
this.queryKeyword.sidebandId = this.sidebandId;
|
||||
listDevice(this.queryKeyword).then(response => {
|
||||
this.bindList = response.rows;
|
||||
this.totalTwo = response.total;
|
||||
this.total = response.total;
|
||||
console.log(this.total)
|
||||
this.loadingTwo = false;
|
||||
});
|
||||
},
|
||||
|
|
@ -494,7 +497,18 @@
|
|||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.deviceId)
|
||||
// forEach.(selection, function(item){
|
||||
// this.idLists.push({id: item.deviceId, type: item.deviceTypeName})
|
||||
// })
|
||||
console.log(selection)
|
||||
selection.map(item => {
|
||||
this.idLists.push({id: item.deviceId, type: item.deviceTypeName})
|
||||
})
|
||||
// forEach(selection, function(item){
|
||||
// this.idLists.push({id: item.deviceId, type: item.deviceTypeName})
|
||||
// })
|
||||
// this.idLists.push({id: selection.map(item => item.deviceId), type: selection.map(item => item.deviceTypeName)})
|
||||
|
||||
this.single = selection.length!=1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
|
@ -555,6 +569,7 @@
|
|||
const param = {
|
||||
sidebandId:row.sidebandId,
|
||||
deviceId:row.deviceId,
|
||||
deviceTypeName:row.deviceTypeName,
|
||||
}
|
||||
this.$modal.confirm('确定当前设备与该边带设备解除绑定吗?').then(function() {
|
||||
return delDevice(param);
|
||||
|
|
@ -568,13 +583,18 @@
|
|||
/** 绑定操作 */
|
||||
handleBindDevice(row) {
|
||||
console.log(row)
|
||||
const deviceIds = row.devideId || this.ids;
|
||||
console.log(this.idLists)
|
||||
const deviceIds = this.idLists;
|
||||
console.log(deviceIds)
|
||||
const param = {
|
||||
sidebandId:this.queryKeywordTemp.sidebandId,
|
||||
deviceIds:deviceIds,
|
||||
}
|
||||
console.log(param)
|
||||
if(deviceIds.length==0){
|
||||
this.$modal.msgWarning("请选择设备");
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm('确定与该边带绑定吗?').then(function() {
|
||||
return bindDevice(param);
|
||||
}).then(() => {
|
||||
|
|
@ -616,6 +636,10 @@
|
|||
sidebandId:row.sidebandId,
|
||||
bindNum:row.bindNum,
|
||||
}
|
||||
if(row.bindNum>0){
|
||||
this.$modal.msgWarning("该边带已绑定设备,无法删除");
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm('是否确认删除边带名称为"' + row.sidebandId + '"的数据项?').then(function() {
|
||||
return delSideband(param);
|
||||
}).then(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue