二维码管理对接

This commit is contained in:
zzyuan 2024-12-31 15:39:18 +08:00
parent f289beb34b
commit 8c32e58b43
2 changed files with 25 additions and 49 deletions

View File

@ -22,9 +22,9 @@
style="width: 240px"
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-form-item label="状态" prop="bindStatus">
<el-select
v-model="queryParams.status"
v-model="queryParams.bindStatus"
placeholder="请选择状态"
clearable
filterable
@ -52,7 +52,7 @@
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table border :data="tableList" v-loading="loading" ref="multipleTable" @selection-change="handleSelectionChange" row-key="id">
<el-table border :data="tableList" v-loading="loading" ref="multipleTable" @selection-change="handleSelectionChange" row-key="qrId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"/>
<el-table-column label="序号" align="center" type="index">
<template slot-scope="scope">
@ -68,12 +68,12 @@
<dict-tag :options="dict.type.qr_box_type" :value="scope.row.boxType"/>
</template>
</el-table-column> -->
<el-table-column label="生产厂家" align="center" prop="" show-overflow-tooltip/>
<el-table-column label="生产厂家" align="center" prop="supplierName" show-overflow-tooltip/>
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
<el-table-column label="状态" align="center" prop="status" show-overflow-tooltip>
<el-table-column label="状态" align="center" prop="bindStatus" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.status==0">未绑定</span>
<span v-if="scope.row.status==1">已绑定</span>
<span v-if="scope.row.bindStatus==0">未绑定</span>
<span v-if="scope.row.bindStatus==1">已绑定</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
@ -96,8 +96,8 @@
/>
<!-- 二维码设备新增 -->
<el-dialog title="二维码新增" :visible.sync="open" width="600px" append-to-body>
<el-form :model="dialogForm" ref="dialogForm" size="small" :rules="rules" label-width="120px">
<el-dialog title="二维码新增" :visible.sync="open" width="650px" append-to-body>
<el-form :model="dialogForm" ref="dialogForm" size="small" :rules="rules" label-width="120px" style="min-height: 350px;">
<el-form-item label="物资类型" prop="maTypeId">
<el-input
v-model="dialogForm.maTypeName"
@ -197,7 +197,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
status: '',
bindStatus: '',
endTime: '',
keyWord: '',
startTime: '',
@ -273,32 +273,9 @@ export default {
async getList() {
this.loading = true
const res = await getQrCodeListApi(this.queryParams)
this.tableList = res.data.rows
this.total = res.data.total
this.loading = false
// if(this.queryParams.pageNum==1){
// this.tableList = [
// {id:"1",qrCode:"20211220-00001",maCode:"w241111-1001",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"0"},
// {id:"2",qrCode:"20211220-00002",maCode:"w241111-1002",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"1"},
// {id:"3",qrCode:"20211220-00003",maCode:"w241111-1003",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"0"},
// {id:"4",qrCode:"20211220-00004",maCode:"w241111-1004",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"1"},
// {id:"5",qrCode:"20211220-00005",maCode:"w241111-1001",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"0"},
// {id:"6",qrCode:"20211220-00006",maCode:"w241111-1002",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"1"},
// {id:"7",qrCode:"20211220-00007",maCode:"w241111-1003",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"0"},
// {id:"8",qrCode:"20211220-00008",maCode:"w241111-1004",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"1"},
// {id:"9",qrCode:"20211220-00000",maCode:"w241111-1001",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"0"},
// {id:"10",qrCode:"20211220-000010",maCode:"w241111-1002",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"1"},
// ]
// this.total = 14
// }else{
// this.tableList = [
// {id:"11",qrCode:"20211220-000011",maCode:"w241111-1001",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"0"},
// {id:"12",qrCode:"20211220-000012",maCode:"w241111-1002",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"1"},
// {id:"13",qrCode:"20211220-000013",maCode:"w241111-1003",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"0"},
// {id:"14",qrCode:"20211220-000014",maCode:"w241111-1004",typeName:"",typeModelName:"CMJ-5",remark:'ceshi',status:"1"},
// ]
// this.total = 14
// }
this.tableList = res.rows
this.total = res.total
this.loading = false
},
//
handleQuery() {
@ -372,20 +349,17 @@ export default {
},
/** 机具类型 */
equipmentType() {
equipmentTypeTree().then((response) => {
equipmentTypeTree({manageType:"0"}).then((response) => {//
this.equipmentTypeList = response.data;
this.equipmentTypeList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2, index2) => {
if (item2.children && item2.children.length > 0) {
item2.children.forEach((item3) => {
if (
item3.children &&
item3.children.length > 0
) {
item3.children.forEach((item4) => {
item4.maTypeName = item3.typeName
item4.maTypeId = item3.typeId
if (item3.children && item3.children.length > 0) {
item3.children.forEach((item4,index4) => {
item4.maTypeName = item3.typeName
item4.maTypeId = item3.typeId
})
}
})
@ -455,7 +429,8 @@ export default {
console.log(this.dialogForm)
const res = await addQrCodeApi(this.dialogForm)
if (res.code == 200) {
this.$message({ type: 'success', message: res.msg })
this.$message({ type: 'success', message: "新增成功" })
this.open=true;
this.resetQuery()
}
}
@ -465,13 +440,14 @@ export default {
handleExport() {
console.log('数据导出')
console.log(this.selectList)
downloadQrCodesApi({qrIds:this.selectList}).then(res => {
downloadFile({ fileName: `二维码_${new Date().getTime()}.zip`, fileData: res, fileType: 'application/zip;charset=utf-8' })
downloadQrCodesApi({qrIds:this.selectList}).then(res => {
downloadFile({ fileName: `二维码_${new Date().getTime()}.zip`, fileData: res, fileType: 'application/zip;charset=utf-8' })
this.$refs.multipleTable.clearSelection();
})
},
//
handleSelectionChange(validSelection) {
this.selectList = validSelection.map(item=>item.id);
this.selectList = validSelection.map(item=>item.qrId);
this.single = validSelection.length !== 1;
this.multiple = !validSelection.length;
},

View File

@ -646,7 +646,7 @@
</el-col>
<el-col :span="4">
<div style="font-weight: 600;">
物资名称 {{ typeTemp }}
规格型号 {{ typeTemp }}
</div>
</el-col>
<el-col :span="4">