1
This commit is contained in:
44
ruoyi-ui/src/api/agvPoint/point.js
Normal file
44
ruoyi-ui/src/api/agvPoint/point.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询agv站点管理列表
|
||||
export function listPoint(query) {
|
||||
return request({
|
||||
url: '/bas/agvPoint/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询agv站点管理详细
|
||||
export function getPoint(id) {
|
||||
return request({
|
||||
url: '/bas/agvPoint' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增agv站点管理
|
||||
export function addPoint(data) {
|
||||
return request({
|
||||
url: '/bas/agvPoint',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改agv站点管理
|
||||
export function updatePoint(data) {
|
||||
return request({
|
||||
url: '/bas/agvPoint',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除agv站点管理
|
||||
export function delPoint(id) {
|
||||
return request({
|
||||
url: '/bas/agvPoint' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
40
ruoyi-ui/src/api/license.js
Normal file
40
ruoyi-ui/src/api/license.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listLicense(query) {
|
||||
return request({
|
||||
url: '/system/license/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function delLicense(ids) {
|
||||
return request({
|
||||
url: '/system/license/remove',
|
||||
method: 'post',
|
||||
params: { ids }
|
||||
})
|
||||
}
|
||||
|
||||
export function activeLicense(licenseCode) {
|
||||
return request({
|
||||
url: '/system/license/active',
|
||||
method: 'post',
|
||||
params: { licenseCode }
|
||||
})
|
||||
}
|
||||
|
||||
export function getLicenseInfo() {
|
||||
return request({
|
||||
url: '/system/license/info',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function generateLicense(type, projectNo) {
|
||||
return request({
|
||||
url: '/system/license/generate',
|
||||
method: 'get',
|
||||
params: { type, projectNo }
|
||||
})
|
||||
}
|
||||
314
ruoyi-ui/src/views/agvPoint/point/index.vue
Normal file
314
ruoyi-ui/src/views/agvPoint/point/index.vue
Normal file
@@ -0,0 +1,314 @@
|
||||
<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="station">
|
||||
<el-input
|
||||
v-model="queryParams.station"
|
||||
placeholder="请输入站点"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="站点类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择单据来源" clearable>
|
||||
<el-option
|
||||
v-for="item in typeOption"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="1" prop="spare2">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare2"-->
|
||||
<!-- placeholder="请输入1"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="1" prop="spare3">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.spare3"-->
|
||||
<!-- placeholder="请输入1"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </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-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="['agvPoint:point: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="['agvPoint:point: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="['agvPoint:point:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- v-hasPermi="['agvPoint:point:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pointList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="id" />
|
||||
<el-table-column label="站点" align="center" prop="station" />
|
||||
<!-- <el-table-column label="站点类型" align="center" prop="type" />-->
|
||||
<el-table-column label="站点类型" align="center" prop="type" >
|
||||
<template slot-scope="scope">
|
||||
<!-- if 判断:type=1 显示入库,type=2 显示出库 -->
|
||||
<span v-if="scope.row.type === '1'">源站</span>
|
||||
<span v-else-if="scope.row.type === '2'">目标站</span>
|
||||
<!-- 兜底:其他值显示未知类型,避免空白 -->
|
||||
<span v-else>未知类型</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="1" align="center" prop="remark" />-->
|
||||
<!-- <el-table-column label="1" align="center" prop="spare1" />-->
|
||||
<!-- <el-table-column label="1" align="center" prop="spare2" />-->
|
||||
<!-- <el-table-column label="1" align="center" prop="spare3" />-->
|
||||
<!-- <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="['agvPoint:point:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['agvPoint:point:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改agv站点管理对话框 -->
|
||||
<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="station">
|
||||
<el-input v-model="form.station" placeholder="请输入站点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="站点类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择站点类型" clearable>
|
||||
<el-option
|
||||
v-for="item in typeOption"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="1" prop="spare1">-->
|
||||
<!-- <el-input v-model="form.spare1" placeholder="请输入1" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="1" prop="spare2">-->
|
||||
<!-- <el-input v-model="form.spare2" placeholder="请输入1" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="1" prop="spare3">-->
|
||||
<!-- <el-input v-model="form.spare3" placeholder="请输入1" />-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPoint, getPoint, delPoint, addPoint, updatePoint } from "@/api/agvPoint/point"
|
||||
|
||||
export default {
|
||||
name: "Point",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// agv站点管理表格数据
|
||||
pointList: [],
|
||||
typeOption:[{label:'源站',value:'1'},{label:'目标站',value:'2'}],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
station: null,
|
||||
type: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询agv站点管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listPoint(this.queryParams).then(response => {
|
||||
this.pointList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
station: null,
|
||||
type: null,
|
||||
remark: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加agv站点管理"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getPoint(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改agv站点管理"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updatePoint(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addPoint(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除agv站点管理编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delPoint(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('agvPoint/point/export', {
|
||||
...this.queryParams
|
||||
}, `point_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
474
ruoyi-ui/src/views/bas/traycode/index1.vue
Normal file
474
ruoyi-ui/src/views/bas/traycode/index1.vue
Normal file
@@ -0,0 +1,474 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" >
|
||||
<!-- <el-form-item label="格式ID" prop="formatId">-->
|
||||
<!--<!– <el-input-->
|
||||
<!-- v-model="queryParams.formatId"-->
|
||||
<!-- placeholder="请输入格式ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />–>-->
|
||||
<!-- <el-select v-model="queryParams.formatId" placeholder="请选择格式ID">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in traycodeFormatList"-->
|
||||
<!-- :key="item.id"-->
|
||||
<!-- :label="item.remarks"-->
|
||||
<!-- :value="item.id"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="条码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="queryParams.trayCode"
|
||||
placeholder="请输入条码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="spare2">
|
||||
<el-select v-model="queryParams.spare2" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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-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="['bas:traycode: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="['bas:traycode: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="['bas:traycode:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['bas:traycode:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleBatchPrint"
|
||||
v-hasPermi="['bas:traycode:print']"
|
||||
>批量打印</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table ref="table" v-loading="loading" :data="traycodeList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="序号" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="格式ID" align="left" prop="formatName" />-->
|
||||
<el-table-column label="条码" align="center" prop="trayCode" />
|
||||
<!-- <el-table-column label="Spare Field 1" align="center" prop="spare1" />-->
|
||||
<el-table-column label="是否可用" align="center" prop="spare2" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.spare2"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="Spare Field 3" align="center" prop="spare3" />-->
|
||||
<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="['bas:traycode:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:traycode:remove']"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-printer"
|
||||
@click="printBarcode(scope.row)"
|
||||
v-hasPermi="['bas:traycode:print']"
|
||||
>打印</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
<!-- 添加或修改条码信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="格式ID" prop="formatId">
|
||||
<el-select v-model="form.formatId" placeholder="请选择格式ID">
|
||||
<el-option
|
||||
v-for="item in traycodeFormatList"
|
||||
:key="item.id"
|
||||
:label="item.remarks"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="数量" prop="spare1" v-if="form.id == null">
|
||||
<el-input v-model="form.spare1" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘编码" prop="trayCode" v-if="form.id != null" >
|
||||
|
||||
<el-input v-model="form.trayCode" placeholder="请输入托盘编码" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="spare2" v-if="form.id != null">
|
||||
<el-select v-model="form.spare2" placeholder="请选择" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 打印模板 -->
|
||||
<vue-easy-print v-show="true" ref="easyPrint2">
|
||||
<div v-for="item in printData" :key="item.id" style="page-break-after:always" class="vue-easy-print">
|
||||
<vue-barcode
|
||||
:value=item.trayCode
|
||||
format="CODE39"
|
||||
width="2"
|
||||
height="100"
|
||||
display-value
|
||||
/>
|
||||
</div>
|
||||
</vue-easy-print>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listTraycode, getTraycode, delTraycode, addTraycode, updateTraycode } from "@/api/bas/traycode"
|
||||
import { listTraycodeFormat } from "@/api/bas/traycodeFormat"
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import VueBarcode from 'vue-barcode'
|
||||
|
||||
export default {
|
||||
name: "Traycode",
|
||||
dicts:['sys_yes_no'],
|
||||
components: {
|
||||
vueEasyPrint,
|
||||
VueQr,
|
||||
VueBarcode
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 设置标题
|
||||
title: this.$t('traycode.title'),
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 条码信息表格数据
|
||||
traycodeList: [],
|
||||
traycodeFormatList: [],
|
||||
printData:[],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
formatId: null,
|
||||
trayCode: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null
|
||||
},
|
||||
queryTrayCodeFormatParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 99,
|
||||
},
|
||||
// Form parameters
|
||||
form: {},
|
||||
// Form validation
|
||||
rules: {
|
||||
formatId: [
|
||||
{ required: true, message: "请输入格式ID", trigger: "blur" }
|
||||
],
|
||||
trayCode: [
|
||||
{ required: true, message: "请输入托盘编码", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTrayCodeFormatList()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询条码信息列表 */
|
||||
getTrayCodeFormatList() {
|
||||
this.loading = true
|
||||
listTraycodeFormat(this.queryTrayCodeFormatParams).then(response => {
|
||||
this.traycodeFormatList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/** 查询条码信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listTraycode(this.queryParams).then(response => {
|
||||
this.traycodeList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
formatId: null,
|
||||
trayCode: null,
|
||||
createTime: null,
|
||||
updateTime: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "新增托盘编码"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getTraycode(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改托盘编码"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateTraycode(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addTraycode(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除选中的数据项?').then(function() {
|
||||
return delTraycode(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/traycode/export', {
|
||||
...this.queryParams
|
||||
}, `traycode_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 打印条码 */
|
||||
printBarcode: function (row) {
|
||||
const yesValItem = (this.dict && this.dict.type && this.dict.type.sys_yes_no) ? (this.dict.type.sys_yes_no.find(i => i.label === '是') || this.dict.type.sys_yes_no.find(i => i.value === 'Y' || i.value === '1')) : null
|
||||
const yesVal = yesValItem ? yesValItem.value : 'Y'
|
||||
if (row.spare2 !== yesVal) {
|
||||
this.$modal.msgError("该托盘不可打印:仅“是”可用")
|
||||
return;
|
||||
}
|
||||
this.printData = [row]
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$refs.easyPrint2.print()
|
||||
const noValItem = (this.dict && this.dict.type && this.dict.type.sys_yes_no) ? (this.dict.type.sys_yes_no.find(i => i.label === '否') || this.dict.type.sys_yes_no.find(i => i.value === 'N' || i.value === '0')) : null
|
||||
const noVal = noValItem ? noValItem.value : 'N'
|
||||
const data = Object.assign({}, row, { spare2: noVal })
|
||||
updateTraycode(data).then(() => {
|
||||
this.$modal.msgSuccess("打印完成,已标记为不可用")
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
/** 批量打印按钮操作 */
|
||||
handleBatchPrint() {
|
||||
const selection = this.$refs.table.selection;
|
||||
if (selection.length === 0) {
|
||||
this.$modal.msgError("请选择要打印的数据项");
|
||||
return;
|
||||
}
|
||||
const yesValItem = (this.dict && this.dict.type && this.dict.type.sys_yes_no) ? (this.dict.type.sys_yes_no.find(i => i.label === '是') || this.dict.type.sys_yes_no.find(i => i.value === 'Y' || i.value === '1')) : null
|
||||
const yesVal = yesValItem ? yesValItem.value : 'Y'
|
||||
const invalid = selection.filter(item => item.spare2 !== yesVal)
|
||||
if (invalid.length > 0) {
|
||||
this.$modal.msgError("存在不可打印项(非“是”),请重新选择")
|
||||
return;
|
||||
}
|
||||
this.printData = selection;
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$refs.easyPrint2.print()
|
||||
const noValItem = (this.dict && this.dict.type && this.dict.type.sys_yes_no) ? (this.dict.type.sys_yes_no.find(i => i.label === '否') || this.dict.type.sys_yes_no.find(i => i.value === 'N' || i.value === '0')) : null
|
||||
const noVal = noValItem ? noValItem.value : 'N'
|
||||
const updates = selection.map(item => {
|
||||
const data = Object.assign({}, item, { spare2: noVal })
|
||||
return updateTraycode(data)
|
||||
})
|
||||
Promise.all(updates).then(() => {
|
||||
this.$modal.msgSuccess("批量打印完成,已标记为不可用")
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}, 100)
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 打印样式 */
|
||||
.vue-easy-print {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.num {
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
margin-top: 15px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
@media print {
|
||||
@page {
|
||||
size: 80mm 50mm;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.vue-easy-print {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 14px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
205
ruoyi-ui/src/views/system/license/index.vue
Normal file
205
ruoyi-ui/src/views/system/license/index.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="queryForm" :model="queryParams" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="授权码" prop="licenseCode">
|
||||
<el-input v-model="queryParams.licenseCode" placeholder="请输入授权码" clearable style="width: 260px" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 160px">
|
||||
<el-option label="未激活" value="0" />
|
||||
<el-option label="已激活" value="1" />
|
||||
<el-option label="已过期" value="2" />
|
||||
</el-select>
|
||||
</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-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-key" size="mini" @click="handleActive" v-hasPermi="['system:license:add']">激活授权码</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-plus" size="mini" @click="handleGenerate" v-hasPermi="['system:license:add']">生成授权码</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:license:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="licenseList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="授权ID" align="center" prop="licenseId" width="90" />
|
||||
<el-table-column label="授权码" align="center" prop="licenseCode" min-width="360" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusTagType(scope.row.status)">{{ statusText(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
||||
<template slot-scope="scope"><span>{{ parseTime(scope.row.startTime) }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="过期时间" align="center" prop="expireTime" width="180">
|
||||
<template slot-scope="scope"><span>{{ parseTime(scope.row.expireTime) }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="激活时间" align="center" prop="activeTime" width="180">
|
||||
<template slot-scope="scope"><span>{{ parseTime(scope.row.activeTime) }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:license:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog title="激活授权码" :visible.sync="activeOpen" width="520px" append-to-body>
|
||||
<el-input v-model="activeForm.licenseCode" type="textarea" :rows="5" placeholder="请输入授权码" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="activeOpen = false">取消</el-button>
|
||||
<el-button type="primary" :loading="activeLoading" @click="submitActive">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="生成授权码" :visible.sync="generateOpen" width="560px" append-to-body>
|
||||
<el-form ref="generateForm" :model="generateForm" :rules="generateRules" label-width="100px">
|
||||
<el-form-item label="授权类型" prop="type">
|
||||
<el-select v-model="generateForm.type" placeholder="请选择授权类型" style="width: 100%">
|
||||
<el-option label="5分钟测试" value="TEST" />
|
||||
<el-option label="1个月授权" value="MONTH" />
|
||||
<el-option label="3个月授权" value="THREE" />
|
||||
<el-option label="1年授权" value="YEAR" />
|
||||
<el-option label="5年授权" value="FIVE" />
|
||||
<el-option label="长期授权" value="FOREVER" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目编号" prop="projectNo">
|
||||
<el-input v-model="generateForm.projectNo" placeholder="请输入项目编号,如 FT546" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="generatedCode" label="授权码">
|
||||
<el-input v-model="generatedCode" type="textarea" :rows="5" readonly />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="generateOpen = false">关闭</el-button>
|
||||
<el-button type="primary" :loading="generateLoading" @click="submitGenerate">生成</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listLicense, delLicense, activeLicense, generateLicense } from '@/api/license'
|
||||
|
||||
export default {
|
||||
name: 'License',
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
activeLoading: false,
|
||||
generateLoading: false,
|
||||
ids: [],
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
licenseList: [],
|
||||
activeOpen: false,
|
||||
generateOpen: false,
|
||||
generatedCode: '',
|
||||
queryParams: { pageNum: 1, pageSize: 10, licenseCode: undefined, status: undefined },
|
||||
activeForm: { licenseCode: '' },
|
||||
generateForm: { type: 'YEAR', projectNo: 'FT546' },
|
||||
generateRules: {
|
||||
type: [{ required: true, message: '请选择授权类型', trigger: 'change' }],
|
||||
projectNo: [{ required: true, message: '请输入项目编号', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listLicense(this.queryParams).then(response => {
|
||||
this.licenseList = response.rows
|
||||
this.total = response.total
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.licenseId)
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleActive() {
|
||||
this.activeForm.licenseCode = ''
|
||||
this.activeOpen = true
|
||||
},
|
||||
submitActive() {
|
||||
const licenseCode = this.activeForm.licenseCode.trim()
|
||||
if (!licenseCode) {
|
||||
this.$modal.msgWarning('请输入授权码')
|
||||
return
|
||||
}
|
||||
this.activeLoading = true
|
||||
activeLicense(licenseCode).then(response => {
|
||||
if (response.code !== 200) {
|
||||
this.$modal.msgError(response.msg || '授权码激活失败')
|
||||
return
|
||||
}
|
||||
this.$modal.msgSuccess(response.msg || '授权码激活成功')
|
||||
this.activeOpen = false
|
||||
this.getList()
|
||||
}).finally(() => {
|
||||
this.activeLoading = false
|
||||
})
|
||||
},
|
||||
handleGenerate() {
|
||||
this.generatedCode = ''
|
||||
this.generateForm = { type: 'YEAR', projectNo: 'FT546' }
|
||||
this.generateOpen = true
|
||||
this.$nextTick(() => this.resetForm('generateForm'))
|
||||
},
|
||||
submitGenerate() {
|
||||
this.$refs.generateForm.validate(valid => {
|
||||
if (!valid) return
|
||||
this.generateLoading = true
|
||||
generateLicense(this.generateForm.type, this.generateForm.projectNo.trim()).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.generatedCode = response.data
|
||||
this.$modal.msgSuccess(response.msg || '授权码生成成功')
|
||||
}
|
||||
}).finally(() => {
|
||||
this.generateLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
const licenseIds = row.licenseId || this.ids
|
||||
this.$modal.confirm(`确认删除授权编号为【${licenseIds}】的数据项?`).then(() => delLicense(licenseIds)).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => {})
|
||||
},
|
||||
statusText(status) {
|
||||
return { '0': '未激活', '1': '已激活', '2': '已过期' }[status] || '未知'
|
||||
},
|
||||
statusTagType(status) {
|
||||
return { '0': 'info', '1': 'success', '2': 'danger' }[status] || 'warning'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user