优化登录页样式,插槽使用规范等问题

This commit is contained in:
BianLzhaoMin 2024-06-11 11:37:26 +08:00
parent eaa21c323e
commit fb19d684bc
24 changed files with 3809 additions and 3083 deletions

View File

@ -23,7 +23,7 @@ module.exports = {
}
}],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline":"off",
"vue/multiline-html-element-content-newline": "off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
'accessor-pairs': 2,
@ -48,7 +48,7 @@ module.exports = {
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': ["error", "always", {"null": "ignore"}],
'eqeqeq': ["error", "always", { "null": "ignore" }],
'generator-star-spacing': [2, {
'before': true,
'after': true
@ -191,6 +191,7 @@ module.exports = {
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],

View File

@ -143,3 +143,12 @@ export function getUserByRoleList(data) {
params: data
})
}
// 库管员
export function getMaUserList(params) {
return request({
url: '/base/maWarehouseKeeper/getMaUserList',
method: 'get',
params
})
}

File diff suppressed because it is too large Load Diff

View File

@ -105,7 +105,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
@ -400,7 +400,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(outQuery.pageNum - 1) * 10 + scope.$index + 1
}}</span>

View File

@ -446,7 +446,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(dialogQueryParams.pageNum - 1) * 10 +
scope.$index +

View File

@ -449,7 +449,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(dialogQueryParams.pageNum - 1) * 10 +
scope.$index +

View File

@ -438,7 +438,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(dialogQueryParams.pageNum - 1) * 10 +
scope.$index +

View File

@ -123,9 +123,16 @@
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (queryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span>
<el-table-column
label="序号"
align="center"
width="80"
type="index"
>
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column
@ -422,249 +429,249 @@
</template>
<script>
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
import dialogForm from './dialogForm.vue'
export default {
components: { dialogForm },
name: 'ReturnFinshed',
dicts: ['sys_normal_disable'],
data() {
return {
fullscreenLoading: false,
openOne: false,
openTwo: false,
openTextOne: '',
openTextTwo: '',
openTextThree: '',
isShowOneFlag: false,
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: '',
//
open: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
keyWord: '',
unitName: '',
proName: '',
maType: '',
agreementId: '',
status: '',
sTime: '',
},
//
form: {},
//
rules: {
dictName: [
{
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
import dialogForm from './dialogForm.vue'
export default {
components: { dialogForm },
name: 'ReturnFinshed',
dicts: ['sys_normal_disable'],
data() {
return {
fullscreenLoading: false,
openOne: false,
openTwo: false,
openTextOne: '',
openTextTwo: '',
openTextThree: '',
isShowOneFlag: false,
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: '',
//
open: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
keyWord: '',
unitName: '',
proName: '',
maType: '',
agreementId: '',
status: '',
sTime: '',
},
//
form: {},
//
rules: {
dictName: [
{
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
}
},
created() {
// this.getList();
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true
// listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
// this.typeList = response.rows;
// this.total = response.total;
this.loading = false
// }
// );
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
created() {
// this.getList();
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true
// listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
// this.typeList = response.rows;
// this.total = response.total;
this.loading = false
// }
// );
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '计划借调'
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const dictId = row.dictId || this.ids
getType(dictId).then((response) => {
this.form = response.data
this.open = true
this.title = '计划借调'
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const dictId = row.dictId || this.ids
getType(dictId).then((response) => {
this.form = response.data
this.open = true
this.title = '修改'
})
},
// 退
handleUpdateOrder() {
this.title = '查看'
this.isShowOneFlag = true
},
// 退
handleFinish() {
// this.title = "";
// this.openTextOne = "退?";
// this.openTextTwo = "退?";
// this.openOne = true
},
submitOpenOneForm() {
this.openTextThree = '完成退料成功!'
this.openTwo = true
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addType(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return delType(dictIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
this.title = '修改'
})
},
}
// 退
handleUpdateOrder() {
this.title = '查看'
this.isShowOneFlag = true
},
// 退
handleFinish() {
// this.title = "";
// this.openTextOne = "退?";
// this.openTextTwo = "退?";
// this.openOne = true
},
submitOpenOneForm() {
this.openTextThree = '完成退料成功!'
this.openTwo = true
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addType(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return delType(dictIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
},
}
</script>
<style lang="scss" scoped>
.submit_box {
.submit_box {
display: flex;
justify-content: flex-start;
align-items: center;
.submit_box_title {
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column;
margin-left: 15px;
.submit_box_title {
display: flex;
flex-direction: column;
margin-left: 15px;
:first-child {
font-size: 14px;
font-weight: 600;
}
:last-child {
margin-top: 6px;
font-size: 12px;
}
}
}
.submit_box_two {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
margin-left: 30%;
.submit_box_title {
display: flex;
flex-direction: column;
margin-left: 10px;
font-size: 18px;
:first-child {
font-size: 14px;
font-weight: 600;
}
:last-child {
margin-top: 6px;
font-size: 12px;
}
}
}
.submit_box_two {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
margin-left: 30%;
.submit_box_title {
display: flex;
flex-direction: column;
margin-left: 10px;
font-size: 18px;
font-weight: 600;
}
}
</style>

View File

@ -88,7 +88,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
@ -317,7 +317,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(codeQuery.pageNum - 1) * 10 + scope.$index + 1
}}</span>

View File

@ -461,7 +461,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(dialogQuery.pageNum - 1) * 10 + scope.$index + 1
}}</span>

View File

@ -451,7 +451,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(dialogQueryParams.pageNum - 1) * 10 +
scope.$index +

View File

@ -135,7 +135,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
@ -263,187 +263,187 @@
</template>
<script>
import {
getToDoList,
getTaskTypeList,
getToPersonInfoAp,
sendUrgingMessageApi,
} from '@/api/index'
export default {
name: 'myIndex',
data() {
return {
//
loading: false,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
dateRange: [],
taskTypeList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '',
taskCode: '',
taskTypeId: '',
},
import {
getToDoList,
getTaskTypeList,
getToPersonInfoAp,
sendUrgingMessageApi,
} from '@/api/index'
export default {
name: 'myIndex',
data() {
return {
//
loading: false,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
dateRange: [],
taskTypeList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '',
taskCode: '',
taskTypeId: '',
},
/* 列表查看跳转的路由地址 */
previewRouterList: [
/* 新购任务 */
{
taskTypeId: 23,
routerPath: 'store/newBuy/newDevicesList',
},
/* 领料任务 */
{
taskTypeId: 29,
routerPath: 'claimAndRefund/receive/receiveManage',
},
/* 退料任务 */
{
taskTypeId: 36,
routerPath: 'claimAndRefund/return/returnApply',
},
/* 维修任务 */
{
taskTypeId: 41,
routerPath: 'repairTest/repair/repair',
},
],
/* 催办弹框 */
urgingDialogVisible: false,
/* 待办人信息 */
toPersonInfo: [],
/* 发送参数 */
sendMessageParams: {
taskId: '',
message: '',
//
bmNoticeInfoList: [],
/* 列表查看跳转的路由地址 */
previewRouterList: [
/* 新购任务 */
{
taskTypeId: 23,
routerPath: 'store/newBuy/newDevicesList',
},
/* 领料任务 */
{
taskTypeId: 29,
routerPath: 'claimAndRefund/receive/receiveManage',
},
/* 退料任务 */
{
taskTypeId: 36,
routerPath: 'claimAndRefund/return/returnApply',
},
/* 维修任务 */
{
taskTypeId: 41,
routerPath: 'repairTest/repair/repair',
},
],
/* 催办弹框 */
urgingDialogVisible: false,
/* 待办人信息 */
toPersonInfo: [],
/* 发送参数 */
sendMessageParams: {
taskId: '',
message: '',
//
bmNoticeInfoList: [],
},
}
},
created() {
this.getList()
this.getTaskTypeList()
},
methods: {
getTaskTypeList() {
getTaskTypeList().then((response) => {
this.taskTypeList = response.data
})
},
/** 查询字典类型列表 */
getList() {
this.loading = true
console.log(this.dateRange)
if (this.dateRange && this.dateRange.length > 0) {
this.queryParams.startTime = this.dateRange[0]
this.queryParams.endTime = this.dateRange[1]
} else {
this.queryParams.startTime = ''
this.queryParams.endTime = ''
}
getToDoList(this.queryParams).then((response) => {
this.typeList = response.rows
this.total = response.total
this.loading = false
})
},
created() {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
this.getTaskTypeList()
},
methods: {
getTaskTypeList() {
getTaskTypeList().then((response) => {
this.taskTypeList = response.data
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
/**
* 列表查看操作===========================================================
*/
handlePreview(id, key) {
const [routerInfo] = this.previewRouterList.filter(
(e) => e.taskTypeId == id,
)
this.$router.push({
path: routerInfo.routerPath,
query: {
keyWord: key,
},
})
},
/* 催办按钮 */
async handleUrging(id, taskCode, taskStatus, taskId) {
/* 先获取催办人信息 */
const { data: res } = await getToPersonInfoAp({
taskStatus,
})
res.map((e) => {
this.toPersonInfo.push({
noticeUser: e.userId,
phone: e.phonenumber,
modelName: '领料催办',
companyId: e.companyId,
v_name: e.nickName,
})
},
/** 查询字典类型列表 */
getList() {
this.loading = true
console.log(this.dateRange)
if (this.dateRange && this.dateRange.length > 0) {
this.queryParams.startTime = this.dateRange[0]
this.queryParams.endTime = this.dateRange[1]
} else {
this.queryParams.startTime = ''
this.queryParams.endTime = ''
}
getToDoList(this.queryParams).then((response) => {
this.typeList = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
})
/**
* 列表查看操作===========================================================
*/
handlePreview(id, key) {
const [routerInfo] = this.previewRouterList.filter(
(e) => e.taskTypeId == id,
)
this.$router.push({
path: routerInfo.routerPath,
query: {
keyWord: key,
},
})
},
this.sendMessageParams.message = `宁夏送变电工程有限公司提示:您有一条任务单号为 <span style="color:#529b2e">${taskCode}</span> 的待办任务未处理,请及时处理。`
this.sendMessageParams.taskId = taskId
/* 催办按钮 */
async handleUrging(id, taskCode, taskStatus, taskId) {
/* 先获取催办人信息 */
const { data: res } = await getToPersonInfoAp({
taskStatus,
})
res.map((e) => {
this.toPersonInfo.push({
noticeUser: e.userId,
phone: e.phonenumber,
modelName: '领料催办',
companyId: e.companyId,
v_name: e.nickName,
})
})
this.urgingDialogVisible = true
},
this.sendMessageParams.message = `宁夏送变电工程有限公司提示:您有一条任务单号为 <span style="color:#529b2e">${taskCode}</span> 的待办任务未处理,请及时处理。`
this.sendMessageParams.taskId = taskId
/* 取消其中某一个待办人 */
handleDeleteToPerson(v) {
this.toPersonInfo.splice(v, 1)
},
this.urgingDialogVisible = true
},
/* 取消其中某一个待办人 */
handleDeleteToPerson(v) {
this.toPersonInfo.splice(v, 1)
},
/* 催办发送 */
async submitForm() {
this.sendMessageParams.bmNoticeInfoList = this.toPersonInfo
const res = await sendUrgingMessageApi(this.sendMessageParams)
if (res.code == 200) {
this.$message.success('发送成功!')
this.toPersonInfo = []
this.urgingDialogVisible = false
} else {
this.$message.error(res.msg)
}
},
/* 弹框右上角关闭按钮 */
handleCloseUrgingDialog() {
/* 催办发送 */
async submitForm() {
this.sendMessageParams.bmNoticeInfoList = this.toPersonInfo
const res = await sendUrgingMessageApi(this.sendMessageParams)
if (res.code == 200) {
this.$message.success('发送成功!')
this.toPersonInfo = []
this.urgingDialogVisible = false
},
} else {
this.$message.error(res.msg)
}
},
}
/* 弹框右上角关闭按钮 */
handleCloseUrgingDialog() {
this.toPersonInfo = []
this.urgingDialogVisible = false
},
},
}
</script>
<style scoped>
.message-info {
height: 100px;
padding: 0 10px;
border: 1px solid #ccc;
letter-spacing: 1px;
border-radius: 3px;
font-size: 16px;
font-weight: bold;
}
.message-info {
height: 100px;
padding: 0 10px;
border: 1px solid #ccc;
letter-spacing: 1px;
border-radius: 3px;
font-size: 16px;
font-weight: bold;
}
.addressee {
margin-left: 3px;
}
.addressee {
margin-left: 3px;
}
</style>

View File

@ -1,124 +1,194 @@
<template>
<div class="login">
<div class="login-bar">
<div class="form-bar">
<h3 class="title">智慧仓储管理平台</h3>
<el-tabs v-model="activeName" style="width: 82%; margin: 0 auto">
<el-tab-pane label="账号登录" name="account"></el-tab-pane>
<el-tab-pane label="手机登录" name="phone"></el-tab-pane>
</el-tabs>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<el-form-item prop="username" v-if="activeName == 'account'">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="password" v-if="activeName == 'account'">
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
show-password
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled && activeName == 'account'">
<el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="验证码"
style="width: 63%"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img" />
</div>
</el-form-item>
<el-form-item style="width: 100%" v-if="activeName == 'account'">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width: 100%"
@click.native.prevent="handleLogin"
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
<div style="float: right" v-if="register">
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>-->
<router-link class="link-type" :to="'/register'">立即注册</router-link>
</div>
</el-form-item>
<div class="login">
<div class="login-bar">
<div class="form-bar">
<h3 class="title">智慧仓储管理平台</h3>
<el-tabs
v-model="activeName"
style="width: 82%; margin: 0 auto"
>
<el-tab-pane label="账号登录" name="account"></el-tab-pane>
<el-tab-pane label="手机登录" name="phone"></el-tab-pane>
</el-tabs>
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<el-form-item
prop="username"
v-if="activeName == 'account'"
>
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
<svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item
prop="password"
v-if="activeName == 'account'"
>
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
show-password
@keyup.enter.native="handleLogin"
>
<svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item
prop="code"
v-if="captchaEnabled && activeName == 'account'"
class="code-box"
>
<el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="图形验证码"
style="width: 65%"
@keyup.enter.native="handleLogin"
>
<svg-icon
slot="prefix"
icon-class="validCode"
class="el-input__icon input-icon"
/>
</el-input>
<div class="login-code">
<img
:src="codeUrl"
@click="getCode"
class="login-code-img"
/>
</div>
</el-form-item>
<el-form-item
style="width: 100%"
v-if="activeName == 'account'"
>
<el-button
:loading="loading"
size="medium"
type="primary"
style="width: 100%"
@click.native.prevent="handleLogin"
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
<div style="float: right" v-if="register">
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>-->
<router-link class="link-type" :to="'/register'"
>立即注册</router-link
>
</div>
</el-form-item>
<el-form-item prop="phone" v-if="activeName == 'phone'">
<el-input
v-model="loginForm.phone"
type="text"
:readonly="readonlyFlag"
@focus="handleInputClick"
auto-complete="off"
placeholder="手机号"
>
<svg-icon slot="prefix" icon-class="phone" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="textCode" v-if="activeName == 'phone'">
<el-input v-model="loginForm.textCode" auto-complete="off" placeholder="验证码" style="width: 63%">
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<!-- <div class="login-code-img" style="border: 1px solid rgb(220, 223, 230);" @click="getTextCode">获取验证码</div> -->
<div
class="login-code-img"
style="border: 1px solid rgb(220, 223, 230)"
v-show="show === 1"
@click="getTextCode"
>
获取验证码
</div>
<div class="login-code-img" style="border: 1px solid rgb(220, 223, 230)" v-show="show === 2">
{{ count }} s
</div>
<div
class="login-code-img"
style="border: 1px solid rgb(220, 223, 230)"
v-show="show === 3"
@click="getTextCode"
>
重发
</div>
<el-form-item prop="phone" v-if="activeName == 'phone'">
<el-input
v-model="loginForm.phone"
type="text"
:readonly="readonlyFlag"
@focus="handleInputClick"
auto-complete="off"
placeholder="手机号"
>
<svg-icon
slot="prefix"
icon-class="phone"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item
prop="textCode"
v-if="activeName == 'phone'"
class="code-box"
>
<el-input
v-model="loginForm.textCode"
auto-complete="off"
placeholder="短信验证码"
style="width: 65%"
>
<svg-icon
slot="prefix"
icon-class="validCode"
class="el-input__icon input-icon"
/>
</el-input>
<div class="login-code">
<!-- <div class="login-code-img" style="border: 1px solid rgb(220, 223, 230);" @click="getTextCode">获取验证码</div> -->
<div
class="login-code-img"
style="border: 1px solid rgb(220, 223, 230)"
v-show="show === 1"
@click="getTextCode"
>
获取验证码
</div>
<div
class="login-code-img"
style="border: 1px solid rgb(220, 223, 230)"
v-show="show === 2"
>
{{ count }} s
</div>
<div
class="login-code-img"
style="border: 1px solid rgb(220, 223, 230)"
v-show="show === 3"
@click="getTextCode"
>
重发
</div>
</div>
</el-form-item>
<el-form-item
style="width: 100%"
v-if="activeName == 'phone'"
>
<el-button
:loading="loading"
size="medium"
type="primary"
style="width: 100%"
@click.native.prevent="textLogin"
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
<div style="float: right" v-if="register">
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>-->
<router-link class="link-type" :to="'/register'"
>立即注册</router-link
>
</div>
</el-form-item>
</el-form>
</div>
</el-form-item>
<el-form-item style="width: 100%" v-if="activeName == 'phone'">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width: 100%"
@click.native.prevent="textLogin"
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
<div style="float: right" v-if="register">
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>-->
<router-link class="link-type" :to="'/register'">立即注册</router-link>
</div>
</el-form-item>
</el-form>
</div>
</div>
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>
</div>
</div>
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>
</div>
</div>
</template>
<script>
@ -127,297 +197,366 @@ import Cookies from 'js-cookie'
import { encrypt, decrypt } from '@/utils/jsencrypt'
export default {
name: 'Login',
data() {
return {
codeUrl: '',
loginForm: {
username: '',
password: '',
phone: '',
rememberMe: false,
code: '',
uuid: '',
},
loginRules: {
username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],
phone: [{ required: true, trigger: 'blur', message: '请输入您的手机号' }],
textCode: [{ required: true, trigger: 'blur', message: '请输入短信验证码' }],
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }],
code: [{ required: true, trigger: 'change', message: '请输入验证码' }],
},
loading: false,
//
captchaEnabled: true,
//
register: false,
redirect: undefined,
activeName: 'account',
readonlyFlag: true,
show: 1,
count: '',
timer: null,
loginParams: {}, //
}
},
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect
// console.log(this.$route.query.redirect.split("?"))
// console.log(this.$route.query.redirect.split("?")[1].split("&"))
if (this.$route.query.redirect.split('?').length > 1) {
let arr = this.$route.query.redirect.split('?')[1].split('&') || []
arr.forEach((item, index) => {
this.$set(this.loginParams, item.split('=')[0] + '', item.split('=')[1])
})
name: 'Login',
data() {
return {
codeUrl: '',
loginForm: {
username: '',
password: '',
phone: '',
rememberMe: false,
code: '',
uuid: '',
},
loginRules: {
username: [
{
required: true,
trigger: 'blur',
message: '请输入您的账号',
},
],
phone: [
{
required: true,
trigger: 'blur',
message: '请输入您的手机号',
},
],
textCode: [
{
required: true,
trigger: 'blur',
message: '请输入短信验证码',
},
],
password: [
{
required: true,
trigger: 'blur',
message: '请输入您的密码',
},
],
code: [
{
required: true,
trigger: 'change',
message: '请输入验证码',
},
],
},
loading: false,
//
captchaEnabled: true,
//
register: false,
redirect: undefined,
activeName: 'account',
readonlyFlag: true,
show: 1,
count: '',
timer: null,
loginParams: {}, //
}
},
immediate: true,
},
},
created() {
// console.log(this.$route.query.redirect.split("?")[1])
if (JSON.stringify(this.loginParams) != '{}') {
this.jumpLogin()
}
this.getCode()
this.getCookie()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) {
this.codeUrl = 'data:image/gif;base64,' + res.img
this.loginForm.uuid = res.uuid
}
})
},
//
handleInputClick() {
this.readonlyFlag = false
},
//
getTextCode() {
const regExp = /^1[3456789]\d{9}$/
if (regExp.test(this.loginForm.phone)) {
console.log('手机号格式正确')
sendCode({ phone: this.loginForm.phone }).then(res => {
if (res.code == 200) {
this.$modal.msgSuccess('发送成功')
const TIME_COUNT = 60
if (!this.timer) {
this.count = TIME_COUNT
this.show = 2
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= TIME_COUNT) {
this.count--
} else {
this.show = 3
clearInterval(this.timer)
this.timer = null
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect
// console.log(this.$route.query.redirect.split("?"))
// console.log(this.$route.query.redirect.split("?")[1].split("&"))
if (this.$route.query.redirect.split('?').length > 1) {
let arr =
this.$route.query.redirect.split('?')[1].split('&') ||
[]
arr.forEach((item, index) => {
this.$set(
this.loginParams,
item.split('=')[0] + '',
item.split('=')[1],
)
})
}
}, 1000)
},
immediate: true,
},
},
created() {
// console.log(this.$route.query.redirect.split("?")[1])
if (JSON.stringify(this.loginParams) != '{}') {
this.jumpLogin()
}
this.getCode()
this.getCookie()
},
methods: {
getCode() {
getCodeImg().then((res) => {
this.captchaEnabled =
res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) {
this.codeUrl = 'data:image/gif;base64,' + res.img
this.loginForm.uuid = res.uuid
}
})
},
//
handleInputClick() {
this.readonlyFlag = false
},
//
getTextCode() {
const regExp = /^1[3456789]\d{9}$/
if (regExp.test(this.loginForm.phone)) {
console.log('手机号格式正确')
sendCode({ phone: this.loginForm.phone }).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess('发送成功')
const TIME_COUNT = 60
if (!this.timer) {
this.count = TIME_COUNT
this.show = 2
this.timer = setInterval(() => {
if (
this.count > 0 &&
this.count <= TIME_COUNT
) {
this.count--
} else {
this.show = 3
clearInterval(this.timer)
this.timer = null
}
}, 1000)
}
}
})
} else {
this.$modal.msgError('请输入正确手机号')
}
}
})
} else {
this.$modal.msgError('请输入正确手机号')
}
},
//
textLogin() {
// checkCode
console.log(this.loginForm)
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set('username', this.loginForm.username, { expires: 30 })
Cookies.set('password', encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else {
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
}
console.log(this.loginForm)
this.$store
.dispatch('textLogin', this.loginForm)
.then(() => {
this.$router.push({ path: '/' }).catch(() => {})
},
//
textLogin() {
// checkCode
console.log(this.loginForm)
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set('username', this.loginForm.username, {
expires: 30,
})
Cookies.set(
'password',
encrypt(this.loginForm.password),
{ expires: 30 },
)
Cookies.set('rememberMe', this.loginForm.rememberMe, {
expires: 30,
})
} else {
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
}
console.log(this.loginForm)
this.$store
.dispatch('textLogin', this.loginForm)
.then(() => {
this.$router.push({ path: '/' }).catch(() => {})
})
.catch(() => {
this.loading = false
})
}
})
.catch(() => {
this.loading = false
},
//
jumpLogin() {
this.loading = true
let param = {
token: this.loginParams.token,
username: this.loginParams.userName,
}
// console.log(param)
this.$store
.dispatch('ssoLogin', param)
.then(() => {
//
this.$router.push({ path: '/' }).catch(() => {})
})
.catch(() => {
this.loading = false
//
// window.location.replace('https://test-sso.csgmall.com.cn/?client_id=549OWptc&theme=zhgc_storage&response_type=code&redirect_uri=https%3A%2F%2Ftest-cc.zhgkxt.com')
})
},
getCookie() {
const username = Cookies.get('username')
const password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username:
username === undefined ? this.loginForm.username : username,
password:
password === undefined
? this.loginForm.password
: decrypt(password),
rememberMe:
rememberMe === undefined ? false : Boolean(rememberMe),
}
},
handleLogin() {
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set('username', this.loginForm.username, {
expires: 30,
})
Cookies.set(
'password',
encrypt(this.loginForm.password),
{ expires: 30 },
)
Cookies.set('rememberMe', this.loginForm.rememberMe, {
expires: 30,
})
} else {
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
}
this.$store
.dispatch('Login', this.loginForm)
.then(() => {
if (localStorage.getItem('isCode') == 1) {
this.$router
.push({ path: '/resetPassword' })
.catch(() => {})
} else {
this.$router.push({ path: '/' }).catch(() => {})
}
})
.catch(() => {
this.loading = false
if (this.captchaEnabled) {
this.getCode()
}
})
}
})
}
})
},
},
//
jumpLogin() {
this.loading = true
let param = {
token: this.loginParams.token,
username: this.loginParams.userName,
}
// console.log(param)
this.$store
.dispatch('ssoLogin', param)
.then(() => {
//
this.$router.push({ path: '/' }).catch(() => {})
})
.catch(() => {
this.loading = false
//
// window.location.replace('https://test-sso.csgmall.com.cn/?client_id=549OWptc&theme=zhgc_storage&response_type=code&redirect_uri=https%3A%2F%2Ftest-cc.zhgkxt.com')
})
watch: {
activeName: {
handler(newVal) {
this.$refs['loginForm'].clearValidate()
},
},
},
getCookie() {
const username = Cookies.get('username')
const password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set('username', this.loginForm.username, { expires: 30 })
Cookies.set('password', encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else {
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
}
this.$store
.dispatch('Login', this.loginForm)
.then(() => {
if (localStorage.getItem('isCode') == 1) {
this.$router
.push({ path: '/resetPassword' })
.catch(() => {})
} else {
this.$router.push({ path: '/' }).catch(() => {})
}
})
.catch(() => {
this.loading = false
if (this.captchaEnabled) {
this.getCode()
}
})
}
})
},
},
watch: {
activeName: {
handler(newVal) {
this.$refs['loginForm'].clearValidate()
},
},
},
}
</script>
<style rel="stylesheet/scss" lang="scss">
.login {
//display: flex;
//justify-content: center;
//align-items: center;
position: relative;
height: 100%;
background-image: url('../assets/images/login.png');
background-size: 100% 100%;
//background: #1891FF;
//display: flex;
//justify-content: center;
//align-items: center;
position: relative;
height: 100%;
background-image: url('../assets/images/login.png');
background-size: 100% 100%;
//background: #1891FF;
}
.title {
margin: 0px auto 30px auto;
//text-align: center;
color: #707070;
margin: 0px auto 30px auto;
//text-align: center;
color: #707070;
}
.login-bar {
position: absolute;
height: auto;
top: 20%;
left: 14%;
width: auto;
height: 500px;
border-radius: 6px;
display: flex;
background: #fff;
text-align: center;
padding-top: 40px;
position: absolute;
height: auto;
top: 20%;
left: 14%;
width: auto;
height: 500px;
border-radius: 6px;
display: flex;
background: #fff;
text-align: center;
padding-top: 40px;
}
.form-bar {
//height: 500px;
background: #fff;
//height: 500px;
background: #fff;
}
.login-form {
//border-radius: 6px;
//height: 100%;
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
//border-radius: 6px;
//height: 100%;
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
.el-input {
height: 45px;
.el-input {
height: 45px;
input {
height: 38px;
input {
height: 38px;
}
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 38px;
float: right;
// width: 30%;
flex: 1;
height: 38px;
// float: right;
margin-left: 12px;
img {
cursor: pointer;
vertical-align: middle;
}
img {
width: 100%;
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
height: 38px;
width: 100%;
}
.code-box .el-form-item__content {
display: flex;
}
</style>

View File

@ -1,118 +1,173 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="登录地址" prop="ipaddr">
<el-input
v-model="queryParams.ipaddr"
placeholder="请输入登录地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
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>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
>
<el-form-item label="登录地址" prop="ipaddr">
<el-input
v-model="queryParams.ipaddr"
placeholder="请输入登录地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
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-table
v-loading="loading"
:data="list.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
style="width: 100%"
>
<el-table-column
label="序号"
align="center"
width="80"
type="index"
>
<template slot-scope="scope">
<span>{{ (pageNum - 1) * 10 + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column
label="会话编号"
align="center"
prop="tokenId"
:show-overflow-tooltip="true"
/>
<el-table-column
label="登录名称"
align="center"
prop="userName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="主机"
align="center"
prop="ipaddr"
:show-overflow-tooltip="true"
/>
<el-table-column
label="登录时间"
align="center"
prop="loginTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
</el-table-column>
<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-delete"
@click="handleForceLogout(scope.row)"
v-hasPermi="['monitor:online:forceLogout']"
>强退</el-button
>
</template>
</el-table-column>
</el-table>
</el-form>
<el-table
v-loading="loading"
:data="list.slice((pageNum-1)*pageSize,pageNum*pageSize)"
style="width: 100%;"
>
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (pageNum - 1) * 10 + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="会话编号" align="center" prop="tokenId" :show-overflow-tooltip="true" />
<el-table-column label="登录名称" align="center" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="主机" align="center" prop="ipaddr" :show-overflow-tooltip="true" />
<el-table-column label="登录时间" align="center" prop="loginTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
</el-table-column>
<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-delete"
@click="handleForceLogout(scope.row)"
v-hasPermi="['monitor:online:forceLogout']"
>强退</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
</div>
<pagination
v-show="total > 0"
:total="total"
:page.sync="pageNum"
:limit.sync="pageSize"
/>
</div>
</template>
<script>
import { list, forceLogout } from "@/api/monitor/online";
import { list, forceLogout } from '@/api/monitor/online'
export default {
name: "Online",
data() {
return {
//
loading: true,
//
total: 0,
//
list: [],
pageNum: 1,
pageSize: 10,
//
queryParams: {
ipaddr: undefined,
userName: undefined
}
};
},
created() {
this.getList();
},
methods: {
/** 查询登录日志列表 */
getList() {
this.loading = true;
list(this.queryParams).then(response => {
this.list = response.rows;
this.total = response.total;
this.loading = false;
});
name: 'Online',
data() {
return {
//
loading: true,
//
total: 0,
//
list: [],
pageNum: 1,
pageSize: 10,
//
queryParams: {
ipaddr: undefined,
userName: undefined,
},
}
},
/** 搜索按钮操作 */
handleQuery() {
this.pageNum = 1;
this.getList();
created() {
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
methods: {
/** 查询登录日志列表 */
getList() {
this.loading = true
list(this.queryParams).then((response) => {
this.list = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
/** 强退按钮操作 */
handleForceLogout(row) {
this.$modal
.confirm('是否确认强退名称为"' + row.userName + '"的用户?')
.then(function () {
return forceLogout(row.tokenId)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('强退成功')
})
.catch(() => {})
},
},
/** 强退按钮操作 */
handleForceLogout(row) {
this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?').then(function() {
return forceLogout(row.tokenId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("强退成功");
}).catch(() => {});
}
}
};
}
</script>

View File

@ -6,7 +6,7 @@
size="small"
:inline="true"
v-show="showSearch"
label-width="120px"
label-width="100px"
>
<el-form-item label="关键字" prop="keyword">
<el-input
@ -127,7 +127,7 @@
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8" style="margin-left: 3%">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
@ -159,6 +159,7 @@
v-loading="loading"
:data="typeList"
@selection-change="handleSelectionChange"
border
>
<el-table-column
type="selection"
@ -182,77 +183,63 @@
<el-table-column
label="报废审核单号"
align="center"
sortable
prop="scrapNum"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="单位名称"
align="center"
prop="unitName"
sortable
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="工程名称"
sortable
align="center"
prop="projectName"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="机具类型"
align="center"
prop="itemType"
sortable
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="任务创建人"
sortable
align="center"
prop="createBy"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="任务创建时间"
sortable
align="center"
prop="createTime"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="维修单号"
align="center"
sortable
prop="repairNum"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="审核状态"
align="center"
sortable
prop="taskStatusName"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="不通过原因"
align="center"
sortable
prop="remark"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="200px"
>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
type="text"
icon="el-icon-zoom-in"
@click="handleSee(scope.row, 'see')"
>查看</el-button
@ -260,7 +247,7 @@
<!-- -->
<el-button
size="mini"
type="warning"
type="text"
icon="el-icon-circle-check"
:disabled="scope.row.taskStatus !== 58"
@click="handleUpdate(scope.row, 'update')"
@ -381,7 +368,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(dialogQueryParams.pageNum - 1) * 10 +
scope.$index +

View File

@ -6,7 +6,7 @@
size="small"
:inline="true"
v-show="showSearch"
label-width="120px"
label-width="100px"
>
<el-form-item label="关键字" prop="keyword">
<el-input
@ -264,9 +264,11 @@
<!-- 维修对话框 -->
<el-dialog
:visible.sync="open"
width="1650px"
v-if="open"
width="80%"
append-to-body
:before-close="onClose"
:title="repairTitle"
>
<el-form
:model="dialogQueryParams"
@ -359,15 +361,21 @@
v-loading="loading"
:data="repairList"
@selection-change="selectionChange"
border
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
type="selection"
width="55"
align="center"
v-if="repairTitle == '维修'"
/>
<el-table-column
label="序号"
align="center"
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(dialogQueryParams.pageNum - 1) * 10 +
scope.$index +
@ -379,19 +387,16 @@
label="类型名称"
align="center"
prop="typeName"
sortable
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="type"
sortable
:show-overflow-tooltip="true"
/>
<el-table-column
label="编码"
sortable
align="center"
prop="code"
width="200"
@ -400,7 +405,6 @@
<el-table-column
label="维修总量"
align="center"
sortable
prop="repairNum"
:show-overflow-tooltip="true"
/>
@ -408,14 +412,12 @@
<el-table-column
label="维修合格数量"
align="center"
sortable
prop="repairedNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="报废数量"
align="center"
sortable
prop="scrapNum"
:show-overflow-tooltip="true"
/>
@ -654,6 +656,7 @@ export default {
//
rules: {},
defaultData: {},
repairTitle: '查看',
}
},
created() {
@ -798,6 +801,7 @@ export default {
this.taskId = row.taskId
this.getDialogList()
this.$eventBus.$emit('taskId', row.taskId)
this.repairTitle = '维修'
this.open = true
this.type = type
this.selectionList = []
@ -809,6 +813,7 @@ export default {
handleSee(row, type) {
this.taskId = row.taskId
this.getDialogList()
this.repairTitle = '查看'
this.open = true
this.type = type
this.selectionList = []

View File

@ -6,7 +6,7 @@
size="small"
:inline="true"
v-show="showSearch"
label-width="120px"
label-width="100px"
>
<el-form-item label="关键字" prop="keyword">
<el-input
@ -127,7 +127,7 @@
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8" style="margin-left: 3%">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
@ -159,6 +159,7 @@
v-loading="loading"
:data="typeList"
@selection-change="handleSelectionChange"
border
>
<el-table-column
type="selection"
@ -172,7 +173,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
@ -181,77 +182,63 @@
<el-table-column
label="修试审核单号"
align="center"
sortable
prop="scrapNum"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="单位名称"
align="center"
prop="unitName"
sortable
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="工程名称"
sortable
align="center"
prop="projectName"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="机具类型"
align="center"
prop="itemType"
sortable
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="任务创建人"
sortable
align="center"
prop="createBy"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="任务创建时间"
sortable
align="center"
prop="createTime"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="维修单号"
align="center"
sortable
prop="repairNum"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="审核状态"
align="center"
sortable
prop="taskStatusName"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="不通过原因"
align="center"
sortable
prop="remark"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="200px"
>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
type="text"
icon="el-icon-zoom-in"
@click="handleSee(scope.row, 'see')"
>查看</el-button
@ -259,7 +246,7 @@
<!-- -->
<el-button
size="mini"
type="warning"
type="text"
icon="el-icon-circle-check"
:disabled="scope.row.taskStatus !== 46"
@click="handleUpdate(scope.row, 'update')"
@ -513,7 +500,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(repairRecordParams.pageNum - 1) * 10 +
scope.$index +
@ -634,7 +621,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(partRecordParams.pageNum - 1) * 10 +
scope.$index +

View File

@ -1,308 +1,399 @@
<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="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入关键字"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
<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="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入关键字"
clearable
style="width: 240px"
@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"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-refresh"
size="mini"
@click="handleRefreshCache"
>刷新缓存</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="typeList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="序号"
align="center"
width="80"
type="index"
>
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column
label="标签种类名称"
align="center"
prop="dictName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="是否启用"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-text="开"
inactive-text="关"
>
</el-switch>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button
>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</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-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"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-refresh"
size="mini"
@click="handleRefreshCache"
>刷新缓存</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (queryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="标签种类名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="是否启用" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-text="开"
inactive-text="关">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</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="600px" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="标签种类名称" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入标签种类名称" />
</el-form-item>
<!-- <el-form-item label="字典类型" prop="dictType">-->
<!-- <el-input v-model="form.dictType" placeholder="请输入字典类型" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="状态" prop="status">-->
<!-- <el-radio-group v-model="form.status">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.sys_normal_disable"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="备注" prop="remark">-->
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>-->
<!-- </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>
<!-- 添加或修改参数配置对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="600px"
append-to-body
:close-on-click-modal="false"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="120px"
>
<el-form-item label="标签种类名称" prop="dictName">
<el-input
v-model="form.dictName"
placeholder="请输入标签种类名称"
/>
</el-form-item>
<!-- <el-form-item label="字典类型" prop="dictType">-->
<!-- <el-input v-model="form.dictType" placeholder="请输入字典类型" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="状态" prop="status">-->
<!-- <el-radio-group v-model="form.status">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.sys_normal_disable"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="备注" prop="remark">-->
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>-->
<!-- </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 { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
export default {
name: "Dict",
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: "",
//
open: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
},
//
form: {},
//
rules: {
dictName: [
{ required: true, message: "字典名称不能为空", trigger: "blur" }
],
dictType: [
{ required: true, message: "字典类型不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.typeList = response.rows;
this.total = response.total;
this.loading = false;
name: 'Dict',
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: '',
//
open: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
},
//
form: {},
//
rules: {
dictName: [
{
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
}
);
},
//
cancel() {
this.open = false;
this.reset();
created() {
this.getList()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined
};
this.resetForm("form");
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true
listType(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.typeList = response.rows
this.total = response.total
this.loading = false
},
)
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加字典类型'
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const dictId = row.dictId || this.ids
getType(dictId).then((response) => {
this.form = response.data
this.open = true
this.title = '修改字典类型'
})
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addType(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return delType(dictIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'system/dict/type/export',
{
...this.queryParams,
},
`type_${new Date().getTime()}.xlsx`,
)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加字典类型";
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictId)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const dictId = row.dictId || this.ids
getType(dictId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改字典类型";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除所选择的数据项?').then(function() {
return delType(dictIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/dict/type/export', {
...this.queryParams
}, `type_${new Date().getTime()}.xlsx`)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
this.$store.dispatch('dict/cleanDict');
});
}
}
};
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
width: 60px !important;
margin-bottom: 10px;
}
</style>

View File

@ -315,7 +315,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 +
scope.$index +

View File

@ -292,7 +292,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(query.pageNum - 1) * 10 + scope.$index + 1
}}</span>

View File

@ -302,7 +302,7 @@
width="80"
type="index"
>
<template scope="scope">
<template slot-scope="scope">
<span>{{
(query.pageNum - 1) * 10 + scope.$index + 1
}}</span>

File diff suppressed because it is too large Load Diff

View File

@ -1,72 +1,132 @@
<template>
<div class="app-container" id="plan">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<div class="app-container" id="plan">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
maxlength="50"
style="width: 240px"
@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-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">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="planList">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (queryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column
label="基层单位"
align="center"
prop="lenderCompany"
:show-overflow-tooltip="true"
/>
<el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column
label="规格型号"
align="center"
prop="typeModelName"
:show-overflow-tooltip="true"
/>
<el-table-column label="单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column
label="计划数"
align="center"
prop="lenderOrigPlanNum"
:show-overflow-tooltip="true"
/>
<el-table-column label="计划单价" align="center" prop="planPrice" :show-overflow-tooltip="true" />
<el-table-column label="计划总价" align="center" prop="planCost" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<!-- <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
<el-table v-loading="loading" :data="planList">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column
label="序号"
align="center"
width="80"
type="index"
>
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column
label="基层单位"
align="center"
prop="lenderCompany"
:show-overflow-tooltip="true"
/>
<el-table-column
label="物资名称"
align="center"
prop="typeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="typeModelName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="单位"
align="center"
prop="unitName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计划数"
align="center"
prop="lenderOrigPlanNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计划单价"
align="center"
prop="planPrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计划总价"
align="center"
prop="planCost"
:show-overflow-tooltip="true"
/>
<el-table-column
label="备注"
align="center"
prop="remark"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="primary" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['store:labelType:edit']">编辑</el-button>
@ -74,118 +134,118 @@
v-hasPermi="['store:labelType:remove']">删除</el-button>
</template>
</el-table-column>-->
</el-table>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listType } from "@/api/system/dict/type";
import { getPlanList, planExport } from "@/api/store/newBuy";
import { listType } from '@/api/system/dict/type'
import { getPlanList, planExport } from '@/api/store/newBuy'
export default {
name: "Plan",
dicts: ["sys_normal_disable"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
planList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictType: undefined,
status: undefined
}
};
},
created() {
this.getList();
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true;
getPlanList(this.queryParams).then(response => {
this.planList = response.rows;
this.total = response.total;
this.loading = false;
});
name: 'Plan',
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
planList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictType: undefined,
status: undefined,
},
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
created() {
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.$tab.closeOpenPage({
path: "/store/plan/planAdd"
});
// console.log(this.$router);
},
//
// handleSelectionChange(selection) {
// this.ids = selection.map(item => item);
// this.single = selection.length != 1;
// this.multiple = !selection.length;
// },
/** 修改按钮操作 */
handleUpdate(row) {
let query = { taskId: row.taskId };
this.$tab.closeOpenPage({ path: "/store/plan/planAdd", query });
},
/** 删除按钮操作 */
handleDelete(row) {
// const dictIds = row.dictId || this.ids;
// this.$modal.confirm('').then(function() {
// return delType(dictIds);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/material/planManagement/export",
{
...this.queryParams
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true
getPlanList(this.queryParams).then((response) => {
this.planList = response.rows
this.total = response.total
this.loading = false
})
},
`type_${new Date().getTime()}.xlsx`
);
}
}
};
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.$tab.closeOpenPage({
path: '/store/plan/planAdd',
})
// console.log(this.$router);
},
//
// handleSelectionChange(selection) {
// this.ids = selection.map(item => item);
// this.single = selection.length != 1;
// this.multiple = !selection.length;
// },
/** 修改按钮操作 */
handleUpdate(row) {
let query = { taskId: row.taskId }
this.$tab.closeOpenPage({ path: '/store/plan/planAdd', query })
},
/** 删除按钮操作 */
handleDelete(row) {
// const dictIds = row.dictId || this.ids;
// this.$modal.confirm('').then(function() {
// return delType(dictIds);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
'/material/planManagement/export',
{
...this.queryParams,
},
`type_${new Date().getTime()}.xlsx`,
)
},
},
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
width: 60px !important;
margin-bottom: 10px;
}
</style>

File diff suppressed because it is too large Load Diff