环境变量配置 代码合并

This commit is contained in:
BianLzhaoMin 2024-08-29 13:18:53 +08:00
parent b398e14bff
commit e747b80b95
14 changed files with 2025 additions and 229 deletions

11
.env.development-nw Normal file
View File

@ -0,0 +1,11 @@
# 页面标题
VUE_APP_TITLE = 施工装备管理系统
# 开发环境配置
VUE_APP_ENV = 'development-nw'
# 若依管理系统/开发环境
VUE_APP_BASE_API = '/dev-api'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -9,4 +9,4 @@ NODE_ENV = production
VUE_APP_ENV = 'production-nw'
# 若依管理系统/生产环境
VUE_APP_BASE_API = '/gl/dev-api'
VUE_APP_BASE_API = '/sgzbgl/dev-api'

View File

@ -6,6 +6,7 @@
"license": "MIT",
"scripts": {
"dev": "vue-cli-service serve",
"dev:nw": "vue-cli-service serve --mode development-nw",
"build": "vue-cli-service build",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",

19
src/api/dataPush/index.js Normal file
View File

@ -0,0 +1,19 @@
import request from '@/utils/request'
// 推送设备
export const pushNotificationsApi = (data) => {
return request.post('/material/base/machine/pushNotifications', data)
}
// 接收设备
export const receiveNotificationsApi = (params) => {
return request.get('/material/base/receive/getDataReceive', {
params
})
}
// 接收设备详情
export const receiveNotificationsDetailsApi = (params) => {
return request.get('/material/base/receive/getDataReceiveDetails', {
params
})
}

View File

@ -1,7 +1,7 @@
import request from '@/utils/request'
// 登录方法
export function login(username, password, code, uuid) {
export function login(username, password, code, uuid, textCode) {
return request({
url: '/auth/login',
headers: {
@ -10,7 +10,7 @@ export function login(username, password, code, uuid) {
},
method: 'post',
timeout: 20000,
data: { username, password, code, uuid }
data: { username, password, code, uuid, textCode }
})
}

View File

@ -29,7 +29,7 @@ import Layout from '@/layout'
*/
import Login from '@/views/login.vue'
import nwLogin from '@/views/nw-login.vue'
const comLogin = process.env.VUE_APP_ENV === 'production-nw' ? nwLogin : Login
const comLogin = process.env.VUE_APP_ENV === 'production-nw' || process.env.VUE_APP_ENV === 'development-nw' ? nwLogin : Login
// 公共路由
export const constantRoutes = [

View File

@ -45,8 +45,9 @@ const user = {
// const password = userInfo.password
const code = userInfo.code
const uuid = userInfo.uuid
const textCode = userInfo.textCode
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
login(username, password, code, uuid, textCode).then(res => {
let data = res.data
localStorage.setItem('isCode', data.code || '')
setToken(data.access_token)

View File

@ -151,6 +151,12 @@
prop="typeCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="退料人员"
align="center"
prop="backPerson"
show-overflow-tooltip
/>
<el-table-column
label="申请数量"
align="center"
@ -158,13 +164,13 @@
:show-overflow-tooltip="true"
/>
<el-table-column
label="已完成退料数量"
align="center"
prop="finishedBackNum"
:show-overflow-tooltip="true"
label="已完成退料数量"
align="center"
prop="finishedBackNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="退料数量"
label="最大退料数量"
align="center"
:show-overflow-tooltip="true"
>
@ -174,7 +180,7 @@
(scope.row.partNum =
scope.row.manageType == 0 ||
scope.row.manageType == 1
? scope.row.num
? scope.row.maxBackNum
: scope.row.partNum)
}}
</span>
@ -210,7 +216,7 @@
v-if="
!isView &&
scope.row.manageType == '0' &&
scope.row.num > 0 &&
scope.row.maxBackNum > 0 &&
(userId == scope.row.userId || userId == 1)
"
>
@ -224,7 +230,7 @@
!isView &&
(scope.row.manageType == '1' ||
scope.row.manageType == '2') &&
scope.row.num > 0 &&
scope.row.maxBackNum > 0 &&
(userId == scope.row.userId || userId == 1)
"
>
@ -236,7 +242,7 @@
@click="handleBackup(scope.row)"
v-if="
!isView &&
scope.row.num < scope.row.preNum - scope.row.finishedBackNum &&
scope.row.inCompletedBackNum > 0 &&
(userId == scope.row.userId || userId == 1)
"
>
@ -542,7 +548,7 @@
:show-overflow-tooltip="true"
/>
<el-table-column
label="退料数量"
label="最大退料数量"
align="center"
prop="backNum"
:show-overflow-tooltip="true"
@ -870,7 +876,7 @@ export default {
this.codeQuery.parentId = row.id
this.codeQuery.typeId = row.modelId
this.dialogIsView = true
this.returnNum = Number(row.num)
this.returnNum = Number(row.maxBackNum)
this.handleCodeQuery()
} else if (row.manageType == '2') {
this.handleNumReturn(row)
@ -920,7 +926,7 @@ export default {
this.codeQuery.typeId = row.modelId
this.codeQuery.agreementId = row.agreementId
this.dialogIsView = false
this.returnNum = Number(row.num)
this.returnNum = Number(row.maxBackNum)
this.handleCodeQuery()
},
//退
@ -928,8 +934,8 @@ export default {
this.title = '数量退料'
this.openNum = true
this.dialogIsView = false
this.$set(row, 'backNum', row.num) //退
this.returnNum = Number(row.num)
this.$set(row, 'backNum', row.maxBackNum) //退
this.returnNum = Number(row.maxBackNum)
this.dialogData.typeMange = row.manageType
this.dialogData.typeName = row.typeName
this.dialogData.typeCode = row.typeCode

View File

@ -841,8 +841,10 @@ export default {
.login-form {
//border-radius: 6px;
//height: 100%;
width: 100%;
background: #ffffff;
margin-top: 25px;
// margin-top: 25px;
padding: 15px 0 0 0;
.el-input {
// height: 45px;
@ -888,15 +890,24 @@ export default {
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
cursor: pointer;
border-radius: 3px;
}
// .code-container {
// width: 100%;
// }
/* 解决验证码输入框与密码输入框对齐问题 */
::v-deep .code-container .el-form-item__content {
display: flex;
.el-input {
width: 67%;
}
.login-code-img {
flex: 1;
height: 38px;
cursor: pointer;
border-radius: 3px;
}
}
.el-dialog__body {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,251 @@
<template>
<div class="app-container">
<!-- 表单 -->
<el-form
:inline="true"
:model="queryForm"
ref="queryForm"
label-width="68px"
size="small"
v-show="showSearch"
>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryForm.keyWord"
clearable
placeholder="请输入关键字"
/>
</el-form-item>
<el-form-item label="状态" prop="receiveStatus">
<el-select
v-model="queryForm.receiveStatus"
placeholder="请选择状态"
filterable
clearable
>
<el-option label="未接收" value="0"></el-option>
<el-option label="已接收" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="推送日期" prop="pushDate">
<el-date-picker
v-model="pushDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-search"
type="primary"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" plain @click="resetQueryForm"
>重置</el-button
>
<el-button
icon="el-icon-download"
type="warning"
plain
@click="handleExport"
:loading="loading"
>导出</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
/>
</el-row>
<!-- 列表 -->
<el-table
:data="tableData"
style="width: 100%"
@selection-change="selection"
>
<el-table-column
type="selection"
width="55"
align="center"
></el-table-column>
<el-table-column
type="index"
label="序号"
width="50"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
/>
<el-table-column
prop="receiveDate"
label="推送日期"
align="center"
></el-table-column>
<el-table-column
prop="pushNum"
label="推送机具数量"
align="center"
></el-table-column>
<el-table-column
prop="receiveNum"
label="已接收数量"
align="center"
></el-table-column>
<el-table-column
prop="status"
label="接收状态"
align="center"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag
v-if="scope.row.receiveStatus == 0"
type="warning"
size="mini"
>未接收</el-tag
>
<el-tag
v-else-if="scope.row.receiveStatus == 1"
type="success"
size="mini"
>已接收</el-tag
>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center">
<template slot-scope="{ row }">
<el-button type="text" size="mini" @click="accept(row.id)"
>接收</el-button
>
<el-button type="text" size="mini" @click="pushDetail(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"
/>
</div>
</template>
<script>
import { receiveNotificationsApi } from '@/api/dataPush/index.js'
export default {
name: 'PushAndAccept',
data() {
return {
loading: false,
showSearch: true,
queryForm: {
keyWord: '',
receiveStatus: '',
// pushDate: '',
},
tableData: [],
queryParams: {
pageNum: 1,
pageSize: 10,
},
total: 0,
ids: [],
pushDate: '',
}
},
mounted() {
console.log('🚀 ~ mounted ~ mounted')
this.getList()
},
methods: {
//
handleQuery() {
console.log('🚀 ~ handleQuery ~ 搜索:', this.queryForm.pushDate)
this.getList()
},
//
resetQueryForm() {
console.log('🚀 ~ resetQueryForm ~ 重置:')
this.$refs.queryForm.resetFields()
this.pushDate = ''
this.getList()
},
//
handleExport() {
this.loading = true
console.log('🚀 ~ handleExport ~ 导出:')
this
.download
// '',
// {
// ...this.queryParams,
// dataCondition: this.ids,
// },
// `_${new Date().getTime()}.xlsx`
()
.then(() => {
this.loading = false
})
},
//
async getList() {
console.log(this.pushDate, '时间')
const params = {
...this.queryForm,
startTime: this.pushDate[0],
endTime: this.pushDate[1],
}
// console.log('🚀 ~ getList ~ :', params)
// (params).then(res => {
// this.tableData = res.data
// this.total = res.total
// }).catch(err => {
// console.log('🚀 ~ getList ~ err:', err
// })
const res = await receiveNotificationsApi(params)
this.tableData = res.rows
this.total = res.total
console.log(res, '接收数据')
},
//
accept(id) {
console.log('🚀 ~ accept ~ 接收:')
const params = {
id,
isDetail: false,
}
this.$router.push({ path: 'pushAndAcceptDetail', query: params })
},
//
pushDetail(row) {
console.log('🚀 ~ pushDetail ~ 明细:')
const params = {
id: row.id,
isDetail: true,
}
this.$router.push({ path: 'pushAndAcceptDetail', query: params })
},
//
selection(val) {
console.log('🚀 ~ selection ~ 选择:', val)
this.ids = val.map((item) => item.id)
},
},
}
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,576 @@
<template>
<div class="app-container">
<!-- 表单 -->
<el-form
:inline="true"
:model="queryForm"
ref="queryForm"
label-width="68px"
size="small"
v-show="showSearch"
>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model.trim="queryForm.keyWord"
clearable
placeholder="请输入关键字"
maxlength="20"
/>
</el-form-item>
<!-- 物品种类下拉 -->
<el-form-item label="物品种类" prop="machineName">
<!-- <el-select
v-model="queryForm.machineName"
placeholder="请选择物品种类"
filterable
clearable
>
<el-option label="物品种类1" value="1"></el-option>
<el-option label="物品种类2" value="2"></el-option>
</el-select> -->
<el-input
v-model.trim="queryForm.machineName"
clearable
placeholder="请输入物品种类"
/>
</el-form-item>
<!-- 设备类型下拉 -->
<el-form-item label="设备类型" prop="typeName">
<!-- <el-select
v-model="queryForm.typeName"
placeholder="请选择设备类型"
filterable
clearable
>
<el-option label="设备类型1" value="1"></el-option>
<el-option label="设备类型2" value="2"></el-option>
</el-select> -->
<el-input
v-model.trim="queryForm.typeName"
clearable
placeholder="请输入设备类型"
maxlength="20"
/>
</el-form-item>
<!-- 规格型号下拉 -->
<el-form-item label="规格型号" prop="modelName">
<!-- <el-select
v-model="queryForm.modelName"
placeholder="请选择规格型号"
filterable
clearable
>
<el-option label="规格型号1" value="1"></el-option>
<el-option label="规格型号2" value="2"></el-option>
</el-select> -->
<el-input
v-model.trim="queryForm.modelName"
clearable
placeholder="请输入设备类型"
maxlength="20"
/>
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-search"
type="primary"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" plain @click="resetQueryForm"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-button
class="el-icon-back"
type="success"
@click="goBackPushAndAccept"
size="mini"
>&nbsp;推送接收</el-button
>
<el-button
type="primary"
@click="accept"
size="mini"
:loading="loading"
v-if="!isDetail"
>接收</el-button
>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
/>
</el-row>
<!-- 列表 -->
<el-table
:data="tableData"
style="width: 100%"
@selection-change="selection"
>
<el-table-column
v-if="!isDetail"
type="selection"
width="55"
align="center"
:selectable="(row) => row.status == 0"
/>
<el-table-column
type="index"
label="序号"
align="center"
width="50"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
/>
<el-table-column
prop="maCode"
label="机具编号"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="machineName"
label="机具名称"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="typeName"
label="机具类型"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="modelName"
label="规格型号"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="rentTime"
label="租赁日期"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="rentPrice"
label="租赁价格"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="unitId"
label="所属单位"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="supplier"
label="生产厂家"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="checkDate"
label="出厂日期"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="isNew"
label="是否是新装备"
align="center"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag
v-if="scope.row.isNew == 0"
type="success"
size="mini"
></el-tag
>
<el-tag
v-else-if="scope.row.status == 1"
type="danger"
size="mini"
></el-tag
>
</template>
</el-table-column>
<el-table-column
prop="checkCode"
label="检验证编号"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="checkUnit"
label="检验单位"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="checkDate"
label="检验日期"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="nextCheckDate"
label="下次检验日期"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="maUserName"
label="机手姓名"
align="center"
show-overflow-tooltip
v-if="!isDetail"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.maUserName"
type="text"
size="mini"
@click="getMachinistDetail(scope.row)"
>
{{ scope.row.maUserName }}
</el-button>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
<el-tag
v-if="scope.row.status == 0"
type="danger"
size="mini"
>未接收</el-tag
>
<el-tag
v-else-if="scope.row.status == 1"
type="success"
size="mini"
>已接收</el-tag
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 机手详情Dialog -->
<el-dialog title="机手详情" :visible.sync="dialogVisible" width="50%">
<el-card>
<div class="wrapper">
<div class="idCardContainer">
<el-image
class="idCard"
:src="src.IDCardFront"
:preview-src-list="src.IDCardFrontList"
></el-image>
<el-image
class="idCard"
:src="src.IDCardBack"
:preview-src-list="src.IDCardBackList"
></el-image>
</div>
<div class="information">
<el-row>
<el-col :span="10" class="item"
>姓名: {{ information.name }}</el-col
>
<el-col :span="14" class="item"
>身份证号: {{ information.IDCard }}</el-col
>
</el-row>
<el-row>
<el-col :span="12" class="item"
>性别: {{ information.gender }}</el-col
>
</el-row>
<el-row>
<el-col :span="10" class="item"
>年龄: {{ information.age }}</el-col
>
<el-col :span="14" class="item"
>电话: {{ information.phone }}</el-col
>
</el-row>
</div>
</div>
</el-card>
<!-- 持证信息 -->
<el-card header="持证信息">
<div class="certificate">
<div
class="certificateItem"
v-for="(item, index) in certificateList"
:key="index"
>
<el-image
class="itemImg"
:src="item.src"
:preview-src-list="item.previewList"
></el-image>
<span class="itemName">{{ item.name }}</span>
</div>
</div>
</el-card>
<!-- 关闭按钮 -->
<el-button
type="primary"
slot="footer"
@click="dialogVisible = false"
>关闭</el-button
>
</el-dialog>
</div>
</template>
<script>
import { receiveNotificationsDetailsApi } from '@/api/dataPush/index.js'
export default {
name: 'pushAndAcceptDetail',
data() {
return {
loading: false,
showSearch: true,
queryForm: {
keyWord: '',
machineName: '',
typeName: '',
modelName: '',
},
tableData: [
{
machineryNum: '001',
machineryName: '机具名称1',
machineryType: '机具类型1',
specificationModel: '规格型号1',
rentalDate: '2021-01-01',
rentalPrice: '1000',
unit: '所属单位1',
manufacturer: '生产厂家1',
productionDate: '2021-01-01',
isNewEquipment: '是',
verificationNum: '检验证编号1',
inspectionUnit: '检验单位1',
inspectionDate: '2021-01-01',
nextInspectionDate: '2021-01-01',
machinistName: '机手姓名1',
status: 0,
},
{
machineryNum: '002',
machineryName: '机具名称2',
machineryType: '机具类型2',
specificationModel: '规格型号2',
rentalDate: '2021-01-02',
rentalPrice: '2000',
unit: '所属单位2',
manufacturer: '生产厂家2',
productionDate: '2021-01-02',
isNewEquipment: '否',
verificationNum: '检验证编号2',
inspectionUnit: '检验单位2',
inspectionDate: '2021-01-02',
nextInspectionDate: '2021-01-02',
machinistName: '',
status: 1,
},
],
queryParams: {
pageNum: 1,
pageSize: 10,
},
total: 0,
isDetail: false, //
dialogVisible: false,
//
src: {
IDCardFront:
'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
IDCardBack:
'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
IDCardFrontList: [
'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
],
IDCardBackList: [
'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
],
},
//
information: {
name: '张三',
IDCard: '123456789012345678',
gender: '男',
age: '18',
phone: '12345678901',
},
//
certificateList: [
{
name: 'xx范德萨范德萨范德萨范德萨发大水范德萨发大水x证',
src: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
previewList: [
'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
],
},
{
name: 'xx范德萨范范德萨范德萨发大水范德萨德萨发大水x证',
src: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
previewList: [
'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
],
},
{
name: 'xx范德萨范德萨发大水x证',
src: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
previewList: [
'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
],
},
{
name: 'xx范德萨范德萨发大水x证',
src: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
previewList: [
'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
],
},
],
}
},
created() {
this.isDetail = this.$route.query.isDetail == 'true' ? true : false
this.getList()
this.getGoodsTypeList()
this.getDeviceTypeList()
this.getSpecificationModelList()
},
methods: {
//
handleQuery() {
console.log('🚀 ~ handleQuery ~ 搜索:')
this.getList()
},
//
resetQueryForm() {
console.log('🚀 ~ resetQueryForm ~ 重置:')
this.$refs.queryForm.resetFields()
this.getList()
},
//
async getList() {
const params = {
receiveId: this.$route.query.id,
...this.queryForm,
}
const res = await receiveNotificationsDetailsApi(params)
console.log(res, '接收的数据')
this.tableData = res.rows
this.total = res.total
// console.log('🚀 ~ getList ~ :', params)
},
//
getGoodsTypeList() {
console.log('🚀 ~ getGoodsTypeList ~ 获取物品种类下拉:')
},
//
getDeviceTypeList() {
console.log('🚀 ~ getDeviceTypeList ~ 获取设备类型下拉:')
},
//
getSpecificationModelList() {
console.log('🚀 ~ getSpecificationModelList ~ 获取规格型号下拉:')
},
//
goBackPushAndAccept() {
this.$router.push({ path: 'pushAndAccept' })
},
//
accept() {
console.log('🚀 ~ accept ~ 接收:')
// this.loading = true
// ().then(res => {
// this.getList()
// }).catch(err => {
// console.log('🚀 ~ accept ~ err:', err)
// }).finally(() => {
// this.loading = false
// })
},
//
selection(val) {
console.log('🚀 ~ selection ~ 选择:', val)
},
// -
getMachinistDetail(row) {
console.log('🚀 ~ getMachinistDetail ~ 机手详情:', row)
this.dialogVisible = true
},
},
}
</script>
<style lang="scss" scoped>
.el-row {
margin-left: 0px !important;
}
.wrapper {
display: flex;
.idCardContainer {
display: flex;
flex-direction: column;
.idCard {
margin-bottom: 10px;
width: 172px;
height: 115px;
}
}
.information {
padding: 0 20px 0 80px;
width: 100%;
.item {
margin-top: 10px;
margin-bottom: 30px;
}
}
}
.certificate {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.certificateItem {
width: 25%;
display: flex;
flex-direction: column;
margin: 15px 0;
.itemImg {
//
margin: 5px auto;
width: 100px;
height: 120px;
}
.itemName {
margin: 0 5px;
display: block;
text-align: center;
}
}
}
</style>

View File

@ -0,0 +1,190 @@
<template>
<div class="app-container">
<!-- 表单 -->
<el-form :inline="true" :model="queryForm" ref="queryForm" label-width="68px" size="small" v-show="showSearch">
<el-form-item label="关键字" prop="keyWord">
<el-input v-model="queryForm.keyWord" clearable placeholder="请输入关键字" />
</el-form-item>
<!-- 物品种类下拉 -->
<el-form-item label="物品种类" prop="goodsType">
<el-select v-model="queryForm.goodsType" placeholder="请选择物品种类" filterable clearable>
<el-option label="物品种类1" value="1"></el-option>
<el-option label="物品种类2" value="2"></el-option>
</el-select>
</el-form-item>
<!-- 设备类型下拉 -->
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryForm.deviceType" placeholder="请选择设备类型" filterable clearable>
<el-option label="设备类型1" value="1"></el-option>
<el-option label="设备类型2" value="2"></el-option>
</el-select>
</el-form-item>
<!-- 规格型号下拉 -->
<el-form-item label="规格型号" prop="specificationModel">
<el-select v-model="queryForm.specificationModel" placeholder="请选择规格型号" filterable clearable>
<el-option label="规格型号1" value="1"></el-option>
<el-option label="规格型号2" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" plain @click="resetQueryForm">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
</el-row>
<!-- 列表 -->
<el-table :data="tableData" style="width: 100%">
<el-table-column
type="index"
label="序号"
align="center"
width="50"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column prop="machineryNum" label="机具编号" align="center" show-overflow-tooltip />
<el-table-column prop="machineryName" label="机具名称" align="center" show-overflow-tooltip />
<el-table-column prop="machineryType" label="机具类型" align="center" show-overflow-tooltip />
<el-table-column prop="specificationModel" label="规格型号" align="center" show-overflow-tooltip />
<el-table-column prop="rentalDate" label="租赁日期" align="center" show-overflow-tooltip>
<template slot-scope="{ row }">
<span :class="{ isWarning: row.activeLease }">{{ row.rentalDate }}</span>
</template>
</el-table-column>
<el-table-column prop="inspectionDate" label="检验日期" align="center" show-overflow-tooltip />
<el-table-column prop="nextInspectionDate" label="下次检验日期" align="center" show-overflow-tooltip>
<template slot-scope="{ row }">
<span :class="{ isWarning: row.activeCheck }">{{ row.nextInspectionDate }}</span>
</template>
</el-table-column>
<el-table-column prop="source" label="来源" align="center" show-overflow-tooltip />
<el-table-column prop="status" label="状态" align="center" show-overflow-tooltip />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
export default {
name: 'RentalEquipmentManagement',
data() {
return {
loading: false,
showSearch: true,
queryForm: {
keyWord: '',
goodsType: '',
deviceType: '',
specificationModel: '',
},
tableData: [
{
machineryNum: '001',
machineryName: '机具1',
machineryType: '机具类型1',
specificationModel: '规格型号1',
rentalDate: '2024-07-01',
inspectionDate: '2024-08-01',
nextInspectionDate: '2024-08-15',
source: '来源1',
status: '状态1',
},
{
machineryNum: '002',
machineryName: '机具2',
machineryType: '机具类型2',
specificationModel: '规格型号2',
rentalDate: '2024-09-02',
inspectionDate: '2024-08-02',
nextInspectionDate: '2024-08-02',
source: '来源2',
status: '状态2',
},
],
queryParams: {
pageNum: 1,
pageSize: 10,
},
total: 0,
}
},
created() {
this.getList()
this.getGoodsTypeList()
this.getDeviceTypeList()
this.getSpecificationModelList()
},
methods: {
//
handleQuery() {
console.log('🚀 ~ handleQuery ~ 搜索:',)
this.getList()
},
//
resetQueryForm() {
console.log('🚀 ~ resetQueryForm ~ 重置:')
this.$refs.queryForm.resetFields()
this.getList()
},
//
getList() {
const params = {
...this.queryParams,
...this.queryForm,
}
console.log('🚀 ~ getList ~ 获取列表:', params)
this.warning()
},
//
getGoodsTypeList() {
console.log('🚀 ~ getGoodsTypeList ~ 获取物品种类下拉:')
},
//
getDeviceTypeList() {
console.log('🚀 ~ getDeviceTypeList ~ 获取设备类型下拉:')
},
//
getSpecificationModelList() {
console.log('🚀 ~ getSpecificationModelList ~ 获取规格型号下拉:')
},
// 10 30,
warning() {
//
const nowDate = new Date()
//
this.tableData.forEach((item) => {
//
const rentalDate = new Date(item.rentalDate)
//
const nextInspectionDate = new Date(item.nextInspectionDate)
// : - <= 10
const leaseTime = (rentalDate - nowDate) / (1000 * 60 * 60 * 24)
if (leaseTime <= 10) {
item.activeLease = true
}
// : - <= 30
const checkTime = (nextInspectionDate - nowDate) / (1000 * 60 * 60 * 24)
if (checkTime <= 30) {
item.activeCheck = true
}
})
},
},
}
</script>
<style lang="scss" scoped>
.isWarning {
color: red;
}
</style>

View File

@ -42,9 +42,9 @@ module.exports = {
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`,
target: `http://192.168.2.152:39080`, //超
// target: `http://192.168.2.152:39080`, //超
// target: `http://10.40.92.81:8080`, //韩/
// target: `http://192.168.2.81:39080`,//旭/
target: `http://192.168.2.81:49080`,//旭/
// target: `http://10.40.92.138:28080`, //帅
// target: `http://192.168.2.218:39080`, //福
// target: `http://192.168.2.120:39080`, //跃
@ -79,19 +79,18 @@ module.exports = {
name: name,
resolve: {
alias: {
'@': resolve('src')
}
'@': resolve('src'),
},
},
plugins: [
// http://doc.bonus.vip/bonus-vue/other/faq.html#使用gzip解压缩静态文件
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({
cache: false, // 不启用文件缓存
test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
filename: '[path][base].gz[query]', // 压缩后的文件名
algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
deleteOriginalAssets: false // 压缩后删除原文件
})
cache: false, // 不启用文件缓存
test: /\.(js|css|html)?$/i, // 压缩文件格式
filename: '[path].gz[query]', // 压缩后的文件名
algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8, // 压缩率小于1才会压缩
}),
],
},
chainWebpack(config) {
@ -99,10 +98,7 @@ module.exports = {
config.plugins.delete('prefetch') // TODO: need test
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('src/assets/icons'))
.end()
config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end()
config.module
.rule('icons')
.test(/\.svg$/)
@ -111,7 +107,7 @@ module.exports = {
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
symbolId: 'icon-[name]',
})
.end()
@ -119,10 +115,12 @@ module.exports = {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.use('script-ext-html-webpack-plugin', [
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/,
},
])
.end()
config.optimization.splitChunks({
@ -132,23 +130,28 @@ module.exports = {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
chunks: 'initial', // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
reuseExistingChunk: true,
},
},
})
config.optimization.runtimeChunk('single')
})
}
config.optimization.runtimeChunk("single"),
{
from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
to: "./", //到根目录下
};
});
},
}