This commit is contained in:
@QQNZX 2024-03-25 09:08:32 +08:00
parent 443e3888f7
commit a0f10f34ae
8 changed files with 327 additions and 102 deletions

View File

@ -67,3 +67,27 @@ export function createStaffQrCode(id) {
method: 'get'
})
}
// 查询油站已绑定码牌列表
export function tagCodeRecord() {
return request({
url: '/business/tag/tagCodeRecord?storeId=',
method: 'get'
})
}
export function tagCodeRecordStaff(data) {
return request({
url: '/business/tag/tagCodeRecord/staff',
method: 'post',
data:data
})
}
export function puttagCodeRecord(data) {
return request({
url: '/business/tag/tagCodeRecord',
method: 'put',
data:data
})
}

View File

@ -110,6 +110,20 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="binding(scope.row)"
>一键绑定</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="nobinding(scope.row)"
>解绑</el-button>
<el-button
size="mini"
type="text"
@ -170,23 +184,6 @@
<el-row>
</el-row>
<!-- <el-row :span="24">-->
<!-- <el-col :span="2" style="display: flex;margin-bottom: 10px">-->
<!-- <span style="margin-right: 10px;width: 70px">审核权限</span>-->
<!-- </el-col>-->
<!-- <el-col :span="22" style="display: flex;margin-bottom: 10px">-->
<!-- <el-checkbox-group v-model="auditPrem" @change="getCheckbox">-->
<!-- <el-checkbox-->
<!-- v-for="dict in dict.type.shqx"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- ></el-checkbox>-->
<!-- </el-checkbox-group>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="8">
@ -316,13 +313,44 @@
<el-button type="primary" @click="handleDownloadqrCode('qrCodeImg')">保存图片到电脑</el-button>
</span>
</el-dialog>
<el-dialog title="码牌列表" :visible.sync="openShow" width="800px" append-to-body>
<div class="wrap-box">
<div class="gang-box" :class="{'oilid' :oilid == item.id }" v-for="(item,index) in arrList" :key="index">
<div>
{{item.companyName}}
</div>
<div style="color: #00afff;cursor: pointer;margin-right: 15px" v-if="oilid != item.id" @click="getoil(item.id)">
选择
</div>
<div style="color: #adadad;cursor: pointer;margin-right: 15px" v-if="oilid == item.id">
已选择
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="yesyesyes">确定绑定</el-button>
<el-button @click="openShow=false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import QRCode from 'qrcode'
import {getName} from "../../utils/fuint";
import {addStaff, createStaffQrCode, delStaff, getStaff, listStaff, queryStaff, updateStaff} from "@/api/staff/staff";
import {
addStaff,
createStaffQrCode,
delStaff,
getStaff,
listStaff, puttagCodeRecord,
queryStaff,
tagCodeRecord, tagCodeRecordStaff,
updateStaff
} from "@/api/staff/staff";
import {getDuty, listDuty} from "@/api/staff/duty";
import html2canvas from "html2canvas";
import {getDicts} from "@/api/order/data";
@ -337,6 +365,10 @@ export default {
//
type:"",
checked:false,
openShow:false,
arrList:[],
oilid:null,
staffId:null,
// url
imgUrl:"",
//
@ -482,10 +514,49 @@ export default {
},
created() {
this.getList();
this.gettagCodeRecord()
// this.getDuty();
// this.getStoreList();
},
methods: {
binding(row){
this.staffId = row.id
this.openShow = true
},
nobinding(row){
let data = {
staffId:row.id
}
puttagCodeRecord(data).then(res=>{
this.$modal.msgSuccess(res.data);
})
},
yesyesyes() {
let data = {
oilTagId: this.oilid,
staffId:this.staffId
}
tagCodeRecordStaff(data).then(res=>{
if(res.code == 200){
this.oilid = null
this.staffId = null
this.openShow = false
this.$modal.msgSuccess("绑定成功");
}
console.log(res)
})
},
getoil(id){
this.oilid = id
},
gettagCodeRecord(){
tagCodeRecord().then(res=>{
this.arrList = res.data.records
})
},
selectAll(val){
this.auditPrem = []
if (val) {
@ -803,4 +874,23 @@ export default {
margin: 0 auto;
margin-top: 15px;
}
.wrap-box{
width: 100%;
height: 300px;
overflow: auto;
margin: 10px auto;
}
.gang-box{
box-sizing: border-box;
padding: 10px 0px;
border-bottom: 1px solid #dcdfe6;
display: flex;
align-items: center;
justify-content: space-between;
}
.oilid{
background: #f6f8f9 !important;
}
</style>

View File

@ -50,7 +50,7 @@ Vue.prototype.handleTree = handleTree
// Vue.prototype.pcUrl = 'http://192.168.0.121:82/'
// Vue.prototype.pcUrl = 'http://192.168.31.96:82/'
// Vue.prototype.pcUrl = 'http://47.95.206.185:85/'
Vue.prototype.pcUrl = 'https://www.youkerr.com/'
Vue.prototype.pcUrl = 'http://192.168.31.55:8081'
// 全局组件挂载
Vue.component('DictTag', DictTag)

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询码牌配置列表
export function listTag(query) {
return request({
url: '/system/tag/list',
url: '/business/tag/oilTag',
method: 'get',
params: query
})
@ -12,7 +12,7 @@ export function listTag(query) {
// 查询码牌配置详细
export function getTag(id) {
return request({
url: '/system/tag/' + id,
url: '/business/tag/oilTag/' + id,
method: 'get'
})
}
@ -20,7 +20,7 @@ export function getTag(id) {
// 新增码牌配置
export function addTag(data) {
return request({
url: '/system/tag',
url: '/business/tag/oilTag',
method: 'post',
data: data
})
@ -29,7 +29,7 @@ export function addTag(data) {
// 修改码牌配置
export function updateTag(data) {
return request({
url: '/system/tag',
url: '/business/tag/oilTag',
method: 'put',
data: data
})
@ -38,7 +38,22 @@ export function updateTag(data) {
// 删除码牌配置
export function delTag(id) {
return request({
url: '/system/tag/' + id,
url: '/business/tag/oilTag/' + id,
method: 'delete'
})
}
export function storeName(text) {
return request({
url: '/backendApi/store/getByStroeName?name='+text,
method: 'get'
})
}
export function tagCodeRecord(data) {
return request({
url: '/business/tag/tagCodeRecord',
method: 'post',
data:data
})
}

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="厂家名字" prop="companyName">
<el-input
v-model="queryParams.companyName"
@ -47,7 +47,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:tag:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
@ -86,14 +86,26 @@
</el-row>
<el-table v-loading="loading" :data="tagList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" />
<el-table-column label="序号" type="index" width="55" align="center" />
<el-table-column label="厂家名字" align="center" prop="companyName" />
<el-table-column label="二维码id" align="center" prop="tagCodeId" />
<el-table-column label="二维码SN号" align="center" prop="tagCodeSn" />
<el-table-column label="码牌SN号" align="center" prop="snCode" />
<el-table-column label="是否已绑定油站 0未绑定 1已绑定" align="center" prop="status" />
<el-table-column label="是否已绑定员工 0未绑定 1已绑定" align="center" prop="mtStatus" />
<el-table-column label="是否已绑定油站" align="center" prop="status" >
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.status == 1">已绑</el-tag>
<el-tag v-if="scope.row.status == 0">未绑</el-tag>
</template>
</el-table-column>
<el-table-column label="是否已绑定员工" align="center" prop="mtStatus" >
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.mtStatus == 1">已绑</el-tag>
<el-tag v-if="scope.row.mtStatus == 0">未绑</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -101,19 +113,26 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:tag:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="oilUpdate(scope.row)"
>一键绑定</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:tag:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -124,13 +143,11 @@
<!-- 添加或修改码牌配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="厂家名字" prop="companyName">
<el-input v-model="form.companyName" placeholder="请输入厂家名字" />
</el-form-item>
<el-form-item label="二维码id" prop="tagCodeId">
<el-input v-model="form.tagCodeId" placeholder="请输入二维码id" />
</el-form-item>
<el-form-item label="二维码SN号" prop="tagCodeSn">
<el-input v-model="form.tagCodeSn" placeholder="请输入二维码SN号" />
</el-form-item>
@ -143,16 +160,55 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="一键绑定" :visible.sync="openShow" width="800px" append-to-body>
<!-- <div style="margin-bottom: 10px;font-weight: bold"> 油站名称 </div>-->
<div style="display: flex;">
<el-input v-model="filterText" placeholder="请输入油站名称" @input="getfilterText()"></el-input>
<div style="width: 10px ; height: 10px;"></div>
<el-button type="primary" @click="getfilterText()">查询</el-button>
</div>
<div class="wrap-box">
<div class="gang-box" :class="{'oilid' :oilid == item.id }" v-for="(item,index) in arrList" :key="index">
<div>
{{item.name}}
</div>
<div style="color: #00afff;cursor: pointer;margin-right: 15px" v-if="oilid != item.id" @click="getoil(item.id)">
选择
</div>
<div style="color: #adadad;cursor: pointer;margin-right: 15px" v-if="oilid == item.id">
已选择
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="yesyesyes">确定绑定</el-button>
<el-button @click="openShow=false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listTag, getTag, delTag, addTag, updateTag } from "@/api/system/tag";
import {listTag, getTag, delTag, addTag, updateTag, storeName, tagCodeRecord} from "./api/tag";
import {deptTreeSelect} from "@/api/system/Site/site";
export default {
name: "Tag",
dicts: ['node_type'],
data() {
return {
oilTagList:[],
oilid:null,
arrList:[],
filterText:"",
defaultProps: {
checkStrictly : 'true',
children: "childrens",
label: "label",
value:"id"
},
//
loading: true,
//
@ -171,6 +227,7 @@ export default {
title: "",
//
open: false,
openShow:false,
//
queryParams: {
pageNum: 1,
@ -191,14 +248,55 @@ export default {
},
created() {
this.getList();
},
methods: {
yesyesyes(){
let data = {
oilTagList :this.oilTagList,
storeId:this.oilid,
status:1
}
tagCodeRecord(data).then(res=>{
if(res.code == 200){
this.$modal.msgSuccess("绑定成功");
this.openShow = false
this.oilTagList = []
this.storeId = null
this.filterText = ""
this.arrList = []
this.getList()
}
})
},
getoil(id){
this.oilid = id
},
getfilterText(){
storeName(this.filterText).then(res=>{
console.log(res)
this.arrList = res.data
})
},
activecilck(data){
console.log(data)
},
handleSelect(item) {
console.log('进')
console.log(item);
},
//
handleChange(value) {
console.log(value);
},
/** 查询码牌配置列表 */
getList() {
this.loading = true;
listTag(this.queryParams).then(response => {
this.tagList = response.rows;
this.total = response.total;
this.tagList = response.data.records;
this.total = response.data.total;
this.loading = false;
});
},
@ -256,6 +354,11 @@ export default {
this.title = "修改码牌配置";
});
},
oilUpdate(row){
console.log(row)
this.oilTagList.push(row.id)
this.openShow = true
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
@ -295,3 +398,23 @@ export default {
}
};
</script>
<style >
.wrap-box{
width: 100%;
height: 300px;
overflow: auto;
margin: 10px auto;
}
.gang-box{
box-sizing: border-box;
padding: 10px 0px;
border-bottom: 1px solid #dcdfe6;
display: flex;
align-items: center;
justify-content: space-between;
}
.oilid{
background: #f6f8f9 !important;
}
</style>

View File

@ -3,8 +3,8 @@ import request from '@/utils/request'
// 查询码牌二维码列表
export function listCode(query) {
return request({
url: '/system/code/list',
method: 'get',
url: '/business/tag/tagCode',
method: 'GET',
params: query
})
}
@ -20,7 +20,7 @@ export function getCode(id) {
// 新增码牌二维码
export function addCode(data) {
return request({
url: '/system/code',
url: '/business/tag/tagCode',
method: 'post',
data: data
})

View File

@ -1,26 +1,10 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="码牌二维码:域名+字符串" prop="collection">
<el-input
v-model="queryParams.collection"
placeholder="请输入码牌二维码:域名+字符串"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="二维码SN号" prop="tagCodeSn">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="二维码SN号" prop="tagCodeSn">
<el-input
v-model="queryParams.tagCodeSn"
placeholder="请输入二维码SN号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="图片地址" prop="imageUrl">
<el-input
v-model="queryParams.imageUrl"
placeholder="请输入图片地址"
placeholder="二维码SN号"
clearable
@keyup.enter.native="handleQuery"
/>
@ -30,7 +14,6 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -39,7 +22,6 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:code:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
@ -76,33 +58,18 @@
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="codeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" />
<el-table-column label="码牌二维码:域名+字符串" align="center" prop="collection" />
<el-table-column label="二维码SN号" align="center" prop="tagCodeSn" />
<el-table-column label="图片地址" align="center" prop="imageUrl" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:code:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:code:remove']"
>删除</el-button>
</template>
<el-table-column type="index" >
</el-table-column>
<el-table-column label="码牌二维码:域名+字符串" align="center" prop="tagCodeSn" />
<el-table-column label="二维码SN号" align="center" prop="tagCodeSn" />
<el-table-column label="图片地址" align="center" prop="imageUrl" >
<template slot-scope="scope">
<img :src="imgUrl + scope.row.imageUrl" alt="">
<div>{{scope.row.imageUrl}}</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -113,15 +80,9 @@
<!-- 添加或修改码牌二维码对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="码牌二维码:域名+字符串" prop="collection">
<el-input v-model="form.collection" placeholder="请输入码牌二维码:域名+字符串" />
</el-form-item>
<el-form-item label="二维码SN号" prop="tagCodeSn">
<el-input v-model="form.tagCodeSn" placeholder="请输入二维码SN号" />
</el-form-item>
<el-form-item label="图片地址" prop="imageUrl">
<el-input v-model="form.imageUrl" placeholder="请输入图片地址" />
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="请输入生产数量" prop="collection">
<el-input v-model="form.total" placeholder="请输入生产数量" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -133,12 +94,13 @@
</template>
<script>
import { listCode, getCode, delCode, addCode, updateCode } from "@/api/system/code";
import { listCode, getCode, delCode, addCode, updateCode } from "./api/code";
export default {
name: "Code",
data() {
return {
imgUrl:this.pcUrl,
//
loading: true,
//
@ -180,8 +142,8 @@ export default {
getList() {
this.loading = true;
listCode(this.queryParams).then(response => {
this.codeList = response.rows;
this.total = response.total;
this.codeList = response.data.records;
this.total = response.data.total;
this.loading = false;
});
},
@ -244,10 +206,21 @@ export default {
updateCode(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
const blob = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
//
link.setAttribute('download', 'exportedFile.xlsx');
//
link.click();
this.getList();
});
} else {
addCode(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();

View File

@ -129,7 +129,7 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -169,7 +169,7 @@
</template>
<script>
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/system/record";
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "./api/record";
export default {
name: "Record",