Compare commits
5 Commits
63a67e58de
...
projects/s
| Author | SHA1 | Date | |
|---|---|---|---|
| bfd8e04780 | |||
| 471245d5b6 | |||
| 8226b45a03 | |||
| dde04cf93f | |||
| be86cbd9b3 |
4
.env.dev
4
.env.dev
@@ -12,7 +12,9 @@ ENV = 'development'
|
||||
VUE_APP_TITLE = 智能监控分析系统
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
VUE_APP_BASE_API = 'http://172.16.32.76:48080'
|
||||
|
||||
VUE_APP_BASE_API = 'http://192.168.0.31:48080'
|
||||
# VUE_APP_BASE_API = 'http://172.16.32.76:48080'
|
||||
# VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
|
||||
|
||||
# 路由懒加载
|
||||
|
||||
49
src/api/areavisual/lane.js
Normal file
49
src/api/areavisual/lane.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-17 09:25:12
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-14 13:53:22
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
// 获得巷道分页
|
||||
export function getLanePage(query) {
|
||||
return request({
|
||||
url: '/wms/lane/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得巷道
|
||||
export function getLane(id) {
|
||||
return request({
|
||||
url: '/wms/lane/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 删除巷道
|
||||
export function deleteLane(id) {
|
||||
return request({
|
||||
url: '/wms/lane/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 更新
|
||||
export function updateLane(data) {
|
||||
return request({
|
||||
url: '/wms/lane/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 创建
|
||||
export function createLane(data) {
|
||||
return request({
|
||||
url: '/wms/lane/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
66
src/api/areavisual/lineEdgeLibrary.js
Normal file
66
src/api/areavisual/lineEdgeLibrary.js
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-17 09:25:12
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-14 14:26:15
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
// 获得线边库分页
|
||||
export function getLineEdgeLibraryPage(query) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得线边库
|
||||
export function getLineEdgeLibrary(id) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 删除线边库
|
||||
export function deleteLineEdgeLibrary(id) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 更新
|
||||
export function updateLineEdgeLibrary(data) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新线边库实时pc --清空操作
|
||||
export function QKLineEdgeLibrary(data) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/update/pc',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 创建
|
||||
export function createLineEdgeLibrary(data) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备分页
|
||||
export function getEquipmentPage(query) {
|
||||
return request({
|
||||
url: '/wms/equipment/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
79
src/api/areavisual/overview.js
Normal file
79
src/api/areavisual/overview.js
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2026-01-06 15:18:38
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-15 15:02:04
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取区域列表
|
||||
export function getAreaList(params) {
|
||||
return request({
|
||||
url: '/wms/region/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取区域空满数量
|
||||
export function postAllAreaInfo(data) {
|
||||
return request({
|
||||
url: '/wms/region/lsit/count',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取指定库区库位信息
|
||||
export function postAreaInfo(params) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/list/region',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取区域总览
|
||||
export function postAllAreaOverview(data) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/line/count',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除能源实时数据库plc相关
|
||||
export function deleteEnergyPlc(id) {
|
||||
return request({
|
||||
url: '/base/energy-plc/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取关联表编码
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/energy-plc/getCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得能源实时数据库plc相关分页
|
||||
export function getEnergyPlcPage(data) {
|
||||
return request({
|
||||
url: '/base/energy-plc/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导出能源实时数据库plc相关 Excel
|
||||
export function exportEnergyPlcExcel(query) {
|
||||
return request({
|
||||
url: '/base/energy-plc/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
63
src/api/areavisual/record.js
Normal file
63
src/api/areavisual/record.js
Normal file
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取出入库历史任务分页
|
||||
export function getRecordPage(params) {
|
||||
return request({
|
||||
url: '/wms/job-main-task-history/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取巷道列表
|
||||
export function getLaneList(params) {
|
||||
return request({
|
||||
url: '/wms/lane/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 更新能源实时数据库plc相关
|
||||
export function updateEnergyPlc(data) {
|
||||
return request({
|
||||
url: '/base/energy-plc/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除能源实时数据库plc相关
|
||||
export function deleteEnergyPlc(id) {
|
||||
return request({
|
||||
url: '/base/energy-plc/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取关联表编码
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/energy-plc/getCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得能源实时数据库plc相关分页
|
||||
export function getEnergyPlcPage(data) {
|
||||
return request({
|
||||
url: '/base/energy-plc/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导出能源实时数据库plc相关 Excel
|
||||
export function exportEnergyPlcExcel(query) {
|
||||
return request({
|
||||
url: '/base/energy-plc/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
49
src/api/areavisual/region.js
Normal file
49
src/api/areavisual/region.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-17 09:25:12
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-14 13:35:11
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
// 获得区域分页
|
||||
export function getRegionPage(query) {
|
||||
return request({
|
||||
url: '/wms/region/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得区域
|
||||
export function getRegion(id) {
|
||||
return request({
|
||||
url: '/wms/region/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 删除区域
|
||||
export function deleteRegion(id) {
|
||||
return request({
|
||||
url: '/wms/region/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 更新
|
||||
export function updateRegion(data) {
|
||||
return request({
|
||||
url: '/wms/region/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 创建
|
||||
export function createRegion(data) {
|
||||
return request({
|
||||
url: '/wms/region/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-17 09:25:12
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-28 09:29:14
|
||||
* @LastEditTime: 2026-01-13 16:13:53
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
@@ -16,6 +16,14 @@ export function getProductPage(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得所有原料
|
||||
export function getAllProductPage(query) {
|
||||
return request({
|
||||
url: '/wms/material/list/all/code',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得原料
|
||||
export function getProduct(id) {
|
||||
return request({
|
||||
|
||||
@@ -14,7 +14,12 @@
|
||||
v-if="collapse"
|
||||
key="collapse"
|
||||
class="sidebar-logo-link"
|
||||
to="/">
|
||||
:to="{
|
||||
path: '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
}">
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||
<h1
|
||||
v-else
|
||||
@@ -28,7 +33,16 @@
|
||||
{{ title }}
|
||||
</h1>
|
||||
</router-link>
|
||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
||||
<router-link
|
||||
v-else
|
||||
key="expand"
|
||||
class="sidebar-logo-link"
|
||||
:to="{
|
||||
path: '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
}">
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||
<h1
|
||||
class="sidebar-title"
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2026-01-06 15:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-15 09:52:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div v-if="!item.hidden">
|
||||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2026-01-06 15:18:38
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-15 09:54:44
|
||||
* @Description:
|
||||
*/
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import { Message } from 'element-ui'
|
||||
@@ -9,7 +16,7 @@ import { isRelogin } from '@/utils/request'
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
// 增加三方登陆 update by 芋艿
|
||||
const whiteList = ['/login', '/social-login','screenbg', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||
const whiteList = ['/login', '/social-login', 'screenbg', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
@@ -17,7 +24,12 @@ router.beforeEach((to, from, next) => {
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
next({
|
||||
path: '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
})
|
||||
NProgress.done()
|
||||
} else {
|
||||
if (store.getters.roles.length === 0) {
|
||||
@@ -35,7 +47,12 @@ router.beforeEach((to, from, next) => {
|
||||
}).catch(err => {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
Message.error(err)
|
||||
next({ path: '/' })
|
||||
next({
|
||||
path: '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -77,12 +77,15 @@ export const constantRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: (resolve) => require(['@/views/home/index'], resolve),
|
||||
component: (resolve) => require(['@/views/productionVisualization/equipmentBoard'], resolve),
|
||||
name: '首页',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true },
|
||||
hidden: true,
|
||||
},
|
||||
],
|
||||
props: (route) => ({
|
||||
keyword: 'home',
|
||||
})
|
||||
},
|
||||
{
|
||||
path: '/screenbg',
|
||||
|
||||
81
src/views/areavisual/lane/add-or-updata.vue
Normal file
81
src/views/areavisual/lane/add-or-updata.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-28 14:38:31
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料编码" prop="materialCode">
|
||||
<el-input
|
||||
v-model="dataForm.materialCode"
|
||||
clearable
|
||||
placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料型号" prop="materialName">
|
||||
<el-input
|
||||
v-model="dataForm.materialName"
|
||||
clearable
|
||||
placeholder="请输入物料型号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料规格" prop="material">
|
||||
<el-input
|
||||
v-model="dataForm.material"
|
||||
clearable
|
||||
placeholder="请输入物料规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
import { createProduct, updateProduct,getProduct } from '@/api/ssdl/product&recipe';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: createProduct,
|
||||
updateURL: updateProduct,
|
||||
infoURL: getProduct,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
material: undefined,
|
||||
materialName: undefined,
|
||||
materialCode: undefined,
|
||||
},
|
||||
typeArr: [],
|
||||
dataRule: {
|
||||
materialCode: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
materialName: [
|
||||
{ required: true, message: '物料型号不能为空', trigger: 'blur' },
|
||||
],
|
||||
material: [
|
||||
{ required: true, message: '规格不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
62
src/views/areavisual/lane/changeStatus.vue
Normal file
62
src/views/areavisual/lane/changeStatus.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-11 14:41:12
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-14 14:15:47
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-switch
|
||||
@change="changeStatus"
|
||||
size="small"
|
||||
v-model="injectData.laneState"
|
||||
:active-value="1"
|
||||
:inactive-value="2"></el-switch>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateLane } from '@/api/areavisual/lane';
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
changeStatus(val) {
|
||||
const pdata = { ...this.injectData, laneState: val };
|
||||
this.$confirm(
|
||||
`是否确认修改${'巷道 [ ' + this.injectData.laneName + ' ] '}的状态?`,
|
||||
'更新状态',
|
||||
{
|
||||
confirmButtonText: '确认修改',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
updateLane(pdata).then((res) => {
|
||||
if (res.code === 0 || res.code === 200) {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.$emit('emitData');
|
||||
} else {
|
||||
this.$modal.msg(res.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((res) => {
|
||||
this.$emit('emitData');
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消',
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
191
src/views/areavisual/lane/index.vue
Normal file
191
src/views/areavisual/lane/index.vue
Normal file
@@ -0,0 +1,191 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData"
|
||||
@emitFun="getDataList">
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import { deleteLane, getLanePage } from '@/api/areavisual/lane';
|
||||
import changeStatus from './changeStatus.vue';
|
||||
|
||||
const lane = [
|
||||
{
|
||||
id: '1',
|
||||
name: 'A巷道',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: 'B巷道',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: 'C巷道',
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: 'D巷道',
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: 'E巷道',
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: 'F巷道',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'laneCode',
|
||||
label: '巷道编码',
|
||||
},
|
||||
{
|
||||
prop: 'laneName',
|
||||
label: '巷道名称',
|
||||
},
|
||||
{
|
||||
prop: 'lane',
|
||||
label: '巷道',
|
||||
filter: (val) => {
|
||||
return lane.find((i) => i.id == val)
|
||||
? lane.find((i) => i.id == val).name
|
||||
: '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'laneSort',
|
||||
label: '巷道排序',
|
||||
width:90,
|
||||
},
|
||||
{
|
||||
prop: 'laneState',
|
||||
label: '巷道状态',
|
||||
width:90,
|
||||
subcomponent: changeStatus,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getLanePage,
|
||||
deleteURL: deleteLane,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '名称',
|
||||
placeholder: '名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '编码',
|
||||
placeholder: '编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '巷道',
|
||||
selectOptions: lane,
|
||||
placeholder: '请选择巷道',
|
||||
param: 'lane',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.laneName = val.name;
|
||||
this.listQuery.laneCode = val.code;
|
||||
this.listQuery.lane = val.lane;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
324
src/views/areavisual/lineEdgeLibrary/add-or-updata.vue
Normal file
324
src/views/areavisual/lineEdgeLibrary/add-or-updata.vue
Normal file
@@ -0,0 +1,324 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-15 09:16:36
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon">
|
||||
<i class="el-icon-s-grid" style="color: #fff"></i>
|
||||
</div>
|
||||
<div class="stat-title">库位信息</div>
|
||||
<div class="stat-content">
|
||||
<div class="stat-value">{{ lineInfo.lineEdgeLibraryCode }}</div>
|
||||
<div class="stat-label">{{ lineInfo.lineEdgeLibraryName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="物料" prop="materialId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.materialId"
|
||||
filterable
|
||||
@change="setMaterial"
|
||||
placeholder="请选择物料">
|
||||
<el-option
|
||||
v-for="item in productArr"
|
||||
:key="item.id"
|
||||
:label="
|
||||
item.materialCode +
|
||||
'-' +
|
||||
item.materialName +
|
||||
'-' +
|
||||
item.material
|
||||
"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="本盘长度" prop="cableLength">
|
||||
<el-input-number
|
||||
v-model="dataForm.cableLength"
|
||||
:min="0"
|
||||
:precision="2"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备" prop="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
@change="setEquipment"
|
||||
placeholder="请选择绞体">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.id"
|
||||
:label="item.equipmentName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应用套号" prop="suite">
|
||||
<el-select v-model="dataForm.suite" placeholder="请选择应用套号">
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<span v-if="dataForm.suite == 2">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="选择套号" prop="time">
|
||||
<el-date-picker
|
||||
v-model="dataForm.time"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="" prop="productionLine">
|
||||
<el-select v-model="dataForm.productionLine">
|
||||
<el-option
|
||||
v-for="item in options3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="" prop="numb">
|
||||
<el-select v-model="dataForm.numb">
|
||||
<el-option
|
||||
v-for="item in options4"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</span>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
import { getAllProductPage } from '@/api/ssdl/product&recipe';
|
||||
import {
|
||||
QKLineEdgeLibrary,
|
||||
getEquipmentPage,
|
||||
} from '@/api/areavisual/lineEdgeLibrary';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: QKLineEdgeLibrary,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
materialId: undefined,
|
||||
materialName: undefined,
|
||||
materialCode: undefined,
|
||||
material: undefined,
|
||||
cableLength: undefined,
|
||||
equipmentId: undefined,
|
||||
equipmentName: undefined,
|
||||
suite: undefined, //是否成套
|
||||
suiteCode: undefined, //套号
|
||||
time: this.parseTime(new Date(), '{y}-{m}-{d}'),
|
||||
productionLine: undefined,
|
||||
numb: undefined,
|
||||
},
|
||||
lineInfo: {},
|
||||
productArr: [],
|
||||
options1: [],
|
||||
options2: [
|
||||
{
|
||||
value: 2,
|
||||
label: '是',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '否',
|
||||
},
|
||||
],
|
||||
options3: [
|
||||
{
|
||||
value: '6#',
|
||||
label: '6#',
|
||||
},
|
||||
{
|
||||
value: '7#',
|
||||
label: '7#',
|
||||
},
|
||||
{
|
||||
value: '8#',
|
||||
label: '8#',
|
||||
},
|
||||
],
|
||||
options4: [
|
||||
{
|
||||
value: 0,
|
||||
label: '0',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '1',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '2',
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '3',
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '4',
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: '5',
|
||||
},
|
||||
{
|
||||
value: 6,
|
||||
label: '6',
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
materialId: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'change' },
|
||||
],
|
||||
time: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||
productionLine: [
|
||||
{ required: true, message: '不能为空', trigger: 'change' },
|
||||
],
|
||||
numb: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
showLine(val) {
|
||||
getAllProductPage().then((res) => {
|
||||
this.productArr = res.data;
|
||||
});
|
||||
getEquipmentPage({ pageNo: 1, pageSize: 100, equipmentType: 2 }).then(
|
||||
(res) => {
|
||||
this.options1 = res.data.list;
|
||||
}
|
||||
);
|
||||
this.lineInfo = { ...val };
|
||||
},
|
||||
setMaterial() {
|
||||
const data = this.productArr.find(
|
||||
(i) => i.id === this.dataForm.materialId
|
||||
);
|
||||
this.dataForm.materialName = data.materialName;
|
||||
this.dataForm.material = data.material;
|
||||
this.dataForm.materialCode = data.materialCode;
|
||||
},
|
||||
setEquipment() {
|
||||
const data = this.options1.find(
|
||||
(i) => i.id === this.dataForm.equipmentId
|
||||
);
|
||||
this.dataForm.equipmentName = data.equipmentName;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
if (this.dataForm.suite == 2) {
|
||||
this.dataForm.suiteCode =
|
||||
this.dataForm.time +
|
||||
'-' +
|
||||
this.dataForm.productionLine +
|
||||
'-' +
|
||||
this.dataForm.numb;
|
||||
}
|
||||
QKLineEdgeLibrary({
|
||||
...this.lineInfo,
|
||||
...this.dataForm,
|
||||
lineEdgeLibraryState: 1,
|
||||
id: this.lineInfo.id,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.stat-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
border-left: 4px solid;
|
||||
border-color: #1a56db;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
/* .stat-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
||||
} */
|
||||
.stat-title {
|
||||
margin: 0 10px;
|
||||
color: #0051ff;
|
||||
font-size: 20px;
|
||||
}
|
||||
.stat-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 12px;
|
||||
margin-right: 15px;
|
||||
background: linear-gradient(to right, #1a56db, #0d47a1);
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
color: #1a56db;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: #64748b;
|
||||
}
|
||||
</style>
|
||||
318
src/views/areavisual/lineEdgeLibrary/index.vue
Normal file
318
src/views/areavisual/lineEdgeLibrary/index.vue
Normal file
@@ -0,0 +1,318 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData"
|
||||
@emitFun="getDataList">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="110"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
destroy-on-close
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import {
|
||||
deleteLineEdgeLibrary,
|
||||
getLineEdgeLibraryPage,
|
||||
QKLineEdgeLibrary,
|
||||
} from '@/api/areavisual/lineEdgeLibrary';
|
||||
|
||||
const laneRow = [
|
||||
{
|
||||
id: '1',
|
||||
name: '第一排',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '第二排',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '第三排',
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '第四排',
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: '第五排',
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: '第六排',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'lineEdgeLibraryCode',
|
||||
label: '线边库编码',
|
||||
},
|
||||
{
|
||||
prop: 'lineEdgeLibraryName',
|
||||
label: '线边库名称',
|
||||
},
|
||||
{
|
||||
prop: 'agvGroundCode',
|
||||
label: 'agv码',
|
||||
},
|
||||
{
|
||||
prop: 'lineEdgeLibraryState',
|
||||
label: '线边库状态',
|
||||
width: 90,
|
||||
filter: (val) => {
|
||||
return val ? '满位' : '空闲';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'usableState',
|
||||
label: '是否可用',
|
||||
width: 90,
|
||||
filter: (val) => {
|
||||
return ['', '可用', '不可用', '锁定'][val];
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'trayType',
|
||||
label: '托盘类型',
|
||||
width: 90,
|
||||
filter: (val) => {
|
||||
return val ? '笼式' : '盘式';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'productionLine',
|
||||
label: '产线',
|
||||
},
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备',
|
||||
},
|
||||
{
|
||||
prop: 'suiteCode',
|
||||
label: '套号',
|
||||
},
|
||||
{
|
||||
prop: 'laneRow',
|
||||
label: '巷道排',
|
||||
filter: (val) => {
|
||||
return laneRow.find((i) => i.id == val)
|
||||
? laneRow.find((i) => i.id == val).name
|
||||
: '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'materialCode',
|
||||
label: '物料',
|
||||
},
|
||||
{
|
||||
prop: 'batch',
|
||||
label: '批次',
|
||||
},
|
||||
{
|
||||
prop: 'cableLength',
|
||||
label: '线缆长度',
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getLineEdgeLibraryPage,
|
||||
deleteURL: deleteLineEdgeLibrary,
|
||||
},
|
||||
tableProps,
|
||||
tableData: [],
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'clear',
|
||||
btnName: '清空',
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
btnName: '添加',
|
||||
},
|
||||
].filter((v) => v),
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '线边库名称',
|
||||
placeholder: '线边库名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '线边库编码',
|
||||
placeholder: '线边库编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '巷道排',
|
||||
selectOptions: laneRow,
|
||||
placeholder: '请选择巷道排',
|
||||
param: 'laneRow',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '重置',
|
||||
// name: 'reset',
|
||||
// },
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '新增',
|
||||
// name: 'add',
|
||||
// color: 'success',
|
||||
// plain: true,
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.lineEdgeLibraryName = val.name;
|
||||
this.listQuery.lineEdgeLibraryCode = val.code;
|
||||
this.listQuery.laneRow = val.laneRow;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
otherMethods(val) {
|
||||
if (val.type == 'clear') {
|
||||
if (val.data.usableState == 3) {
|
||||
this.$confirm(
|
||||
`当前库位为锁定状态,代表该库位有未完成的任务关联,是否确认清空${
|
||||
'线边库名称为 ' + val.data.lineEdgeLibraryName + ' '
|
||||
}的数据项?`,
|
||||
'锁定库位清空提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
QKLineEdgeLibrary({...val.data,lineEdgeLibraryState:0,usableState:1 }).then(({ data }) => {
|
||||
this.$message({
|
||||
message: data,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
QKLineEdgeLibrary({...val.data,lineEdgeLibraryState:0,usableState:1 }).then(({ data }) => {
|
||||
this.$message({
|
||||
message: data,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
} else if (val.type === 'add') {
|
||||
this.addOrEditTitle = '添加货物';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init();
|
||||
this.$refs.addOrUpdate.showLine(val.data);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
324
src/views/areavisual/overview/components/add-or-updata.vue
Normal file
324
src/views/areavisual/overview/components/add-or-updata.vue
Normal file
@@ -0,0 +1,324 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-15 09:16:36
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon">
|
||||
<i class="el-icon-s-grid" style="color: #fff"></i>
|
||||
</div>
|
||||
<div class="stat-title">库位信息</div>
|
||||
<div class="stat-content">
|
||||
<div class="stat-value">{{ lineInfo.lineEdgeLibraryCode }}</div>
|
||||
<div class="stat-label">{{ lineInfo.lineEdgeLibraryName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="物料" prop="materialId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.materialId"
|
||||
filterable
|
||||
@change="setMaterial"
|
||||
placeholder="请选择物料">
|
||||
<el-option
|
||||
v-for="item in productArr"
|
||||
:key="item.id"
|
||||
:label="
|
||||
item.materialCode +
|
||||
'-' +
|
||||
item.materialName +
|
||||
'-' +
|
||||
item.material
|
||||
"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="本盘长度" prop="cableLength">
|
||||
<el-input-number
|
||||
v-model="dataForm.cableLength"
|
||||
:min="0"
|
||||
:precision="2"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备" prop="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
@change="setEquipment"
|
||||
placeholder="请选择绞体">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.id"
|
||||
:label="item.equipmentName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应用套号" prop="suite">
|
||||
<el-select v-model="dataForm.suite" placeholder="请选择应用套号">
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<span v-if="dataForm.suite == 2">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="选择套号" prop="time">
|
||||
<el-date-picker
|
||||
v-model="dataForm.time"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="" prop="productionLine">
|
||||
<el-select v-model="dataForm.productionLine">
|
||||
<el-option
|
||||
v-for="item in options3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="" prop="numb">
|
||||
<el-select v-model="dataForm.numb">
|
||||
<el-option
|
||||
v-for="item in options4"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</span>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
import { getAllProductPage } from '@/api/ssdl/product&recipe';
|
||||
import {
|
||||
QKLineEdgeLibrary,
|
||||
getEquipmentPage,
|
||||
} from '@/api/areavisual/lineEdgeLibrary';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: QKLineEdgeLibrary,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
materialId: undefined,
|
||||
materialName: undefined,
|
||||
materialCode: undefined,
|
||||
material: undefined,
|
||||
cableLength: undefined,
|
||||
equipmentId: undefined,
|
||||
equipmentName: undefined,
|
||||
suite: undefined, //是否成套
|
||||
suiteCode: undefined, //套号
|
||||
time: this.parseTime(new Date(), '{y}-{m}-{d}'),
|
||||
productionLine: undefined,
|
||||
numb: undefined,
|
||||
},
|
||||
lineInfo: {},
|
||||
productArr: [],
|
||||
options1: [],
|
||||
options2: [
|
||||
{
|
||||
value: 2,
|
||||
label: '是',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '否',
|
||||
},
|
||||
],
|
||||
options3: [
|
||||
{
|
||||
value: '6#',
|
||||
label: '6#',
|
||||
},
|
||||
{
|
||||
value: '7#',
|
||||
label: '7#',
|
||||
},
|
||||
{
|
||||
value: '8#',
|
||||
label: '8#',
|
||||
},
|
||||
],
|
||||
options4: [
|
||||
{
|
||||
value: 0,
|
||||
label: '0',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '1',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '2',
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '3',
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '4',
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: '5',
|
||||
},
|
||||
{
|
||||
value: 6,
|
||||
label: '6',
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
materialId: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'change' },
|
||||
],
|
||||
time: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||
productionLine: [
|
||||
{ required: true, message: '不能为空', trigger: 'change' },
|
||||
],
|
||||
numb: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
showLine(val) {
|
||||
getAllProductPage().then((res) => {
|
||||
this.productArr = res.data;
|
||||
});
|
||||
getEquipmentPage({ pageNo: 1, pageSize: 100, equipmentType: 2 }).then(
|
||||
(res) => {
|
||||
this.options1 = res.data.list;
|
||||
}
|
||||
);
|
||||
this.lineInfo = { ...val };
|
||||
},
|
||||
setMaterial() {
|
||||
const data = this.productArr.find(
|
||||
(i) => i.id === this.dataForm.materialId
|
||||
);
|
||||
this.dataForm.materialName = data.materialName;
|
||||
this.dataForm.material = data.material;
|
||||
this.dataForm.materialCode = data.materialCode;
|
||||
},
|
||||
setEquipment() {
|
||||
const data = this.options1.find(
|
||||
(i) => i.id === this.dataForm.equipmentId
|
||||
);
|
||||
this.dataForm.equipmentName = data.equipmentName;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
if (this.dataForm.suite == 2) {
|
||||
this.dataForm.suiteCode =
|
||||
this.dataForm.time +
|
||||
'-' +
|
||||
this.dataForm.productionLine +
|
||||
'-' +
|
||||
this.dataForm.numb;
|
||||
}
|
||||
QKLineEdgeLibrary({
|
||||
...this.lineInfo,
|
||||
...this.dataForm,
|
||||
lineEdgeLibraryState: 1,
|
||||
id: this.lineInfo.id,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.stat-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
border-left: 4px solid;
|
||||
border-color: #1a56db;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
/* .stat-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
||||
} */
|
||||
.stat-title {
|
||||
margin: 0 10px;
|
||||
color: #0051ff;
|
||||
font-size: 20px;
|
||||
}
|
||||
.stat-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 12px;
|
||||
margin-right: 15px;
|
||||
background: linear-gradient(to right, #1a56db, #0d47a1);
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
color: #1a56db;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: #64748b;
|
||||
}
|
||||
</style>
|
||||
125
src/views/areavisual/overview/components/ringChart.vue
Normal file
125
src/views/areavisual/overview/components/ringChart.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div
|
||||
:class="className"
|
||||
:style="{ height: height, width: width, marginLeft: '10px' }" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
require('echarts/theme/macarons'); // echarts theme
|
||||
import resize from '@/utils/chartMixins/resize';
|
||||
|
||||
const animationDuration = 1000;
|
||||
export default {
|
||||
mixins: [resize],
|
||||
props: {
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart',
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%',
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px',
|
||||
},
|
||||
ringData: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
targetId: '',
|
||||
};
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return;
|
||||
}
|
||||
this.chart.dispose();
|
||||
this.chart = null;
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(this.$el, 'macarons');
|
||||
const _this = this;
|
||||
this.chart.setOption({
|
||||
title: {
|
||||
text: this.title
|
||||
? '{space|}{tip|}{space|}{value|' + this.title + '}'
|
||||
: '',
|
||||
textStyle: {
|
||||
rich: {
|
||||
tip: {
|
||||
width: 6,
|
||||
height: 6,
|
||||
borderRadius: 50,
|
||||
backgroundColor: '#288AFF',
|
||||
},
|
||||
space: {
|
||||
width: 8,
|
||||
},
|
||||
value: {
|
||||
fontSize: 14,
|
||||
color: 'black',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
color: ['#33B36B', '#3A8DFF', '#F59A23'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
crossStyle: {
|
||||
color: '#999',
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
data: ['当前满位', '当前空位', '在途'],
|
||||
},
|
||||
grid: {
|
||||
containLabel: true,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
// name: '投入',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: [
|
||||
{
|
||||
name: '当前满位',
|
||||
value: this.ringData.occupiedQuantity
|
||||
},
|
||||
{
|
||||
name: '当前空位',
|
||||
value: this.ringData.idleQuantity
|
||||
},
|
||||
{
|
||||
name: '在途',
|
||||
value: this.ringData.transitQuantity
|
||||
},
|
||||
],
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
665
src/views/areavisual/overview/index.vue
Normal file
665
src/views/areavisual/overview/index.vue
Normal file
@@ -0,0 +1,665 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row class="overview-container">
|
||||
<el-col :span="4" class="overview-container-left">
|
||||
<el-row style="font-size: 18px; font-weight: bold; line-height: 36px">
|
||||
库区选择
|
||||
</el-row>
|
||||
<el-input
|
||||
v-model="areaSearchForm.regionName"
|
||||
placeholder="库区名称"
|
||||
@blur="getArea"
|
||||
clearable />
|
||||
<el-tree
|
||||
:data="areaList"
|
||||
:node-key="'id'"
|
||||
:props="{ label: 'regionName' }"
|
||||
@node-click="nodeClick" />
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="16"
|
||||
v-if="changeType === 0"
|
||||
class="overview-container-main">
|
||||
<el-row>
|
||||
<el-col
|
||||
:span="8"
|
||||
class="allarea-box"
|
||||
v-for="item in allAreaList"
|
||||
:key="item.id">
|
||||
<div class="areainfo-box">
|
||||
<div class="areainfo-box-header">
|
||||
{{ item.regionName }}
|
||||
</div>
|
||||
<div class="areainfo-box-line">
|
||||
<div
|
||||
class="areainfo-box-line-item"
|
||||
:style="{
|
||||
width: `${(
|
||||
(item.occupiedQuantity /
|
||||
(item.totalInventory + item.transitQuantity)) *
|
||||
100
|
||||
).toFixed(2)}%`,
|
||||
backgroundColor: '#33B36B',
|
||||
}"></div>
|
||||
<div
|
||||
class="areainfo-box-line-item"
|
||||
:style="{
|
||||
width: `${(
|
||||
(item.idleQuantity /
|
||||
(item.totalInventory + item.transitQuantity)) *
|
||||
100
|
||||
).toFixed(2)}%`,
|
||||
backgroundColor: '#3A8DFF',
|
||||
}"></div>
|
||||
<div
|
||||
class="areainfo-box-line-item"
|
||||
:style="{
|
||||
width: `${(
|
||||
(item.transitQuantity /
|
||||
(item.totalInventory + item.transitQuantity)) *
|
||||
100
|
||||
).toFixed(2)}%`,
|
||||
backgroundColor: '#F59A23',
|
||||
}"></div>
|
||||
</div>
|
||||
<el-row class="areainfo-box-info">
|
||||
<el-col class="areainfo-box-info-item" :span="6">
|
||||
<p class="areainfo-box-info-item-count">
|
||||
{{ item.totalInventory }}
|
||||
</p>
|
||||
<p class="areainfo-box-info-item-title">库位总数</p>
|
||||
</el-col>
|
||||
<el-col class="areainfo-box-info-item" :span="6">
|
||||
<p
|
||||
class="areainfo-box-info-item-count"
|
||||
style="color: #33b36b">
|
||||
{{ item.occupiedQuantity }}
|
||||
</p>
|
||||
<p class="areainfo-box-info-item-title">占</p>
|
||||
</el-col>
|
||||
<el-col class="areainfo-box-info-item" :span="6">
|
||||
<p
|
||||
class="areainfo-box-info-item-count"
|
||||
style="color: #3a8dff">
|
||||
{{ item.idleQuantity }}
|
||||
</p>
|
||||
<p class="areainfo-box-info-item-title">空</p>
|
||||
</el-col>
|
||||
<el-col class="areainfo-box-info-item" :span="6">
|
||||
<p
|
||||
class="areainfo-box-info-item-count"
|
||||
style="color: #f59a23">
|
||||
{{ item.transitQuantity }}
|
||||
</p>
|
||||
<p class="areainfo-box-info-item-title">在途</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="4"
|
||||
v-if="changeType === 0"
|
||||
class="overview-container-right">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClickRight">
|
||||
<el-tab-pane label="概览" name="first">
|
||||
<el-row class="overview-container-right-alloverview">
|
||||
<el-col
|
||||
class="overview-container-right-alloverview-item"
|
||||
:span="8">
|
||||
<p class="overview-container-right-alloverview-item-count">
|
||||
{{ allAreaInfo.totalInventory }}
|
||||
</p>
|
||||
<p class="overview-container-right-alloverview-item-title">
|
||||
库位总数
|
||||
</p>
|
||||
</el-col>
|
||||
<el-col
|
||||
class="overview-container-right-alloverview-item"
|
||||
:span="8">
|
||||
<p class="overview-container-right-alloverview-item-count">
|
||||
{{ allAreaInfo.occupiedQuantity }}
|
||||
</p>
|
||||
<p class="overview-container-right-alloverview-item-title">
|
||||
当前满位
|
||||
</p>
|
||||
</el-col>
|
||||
<el-col
|
||||
class="overview-container-right-alloverview-item"
|
||||
:span="8">
|
||||
<p class="overview-container-right-alloverview-item-count">
|
||||
{{ allAreaInfo.idleQuantity }}
|
||||
</p>
|
||||
<p class="overview-container-right-alloverview-item-title">
|
||||
当前空位
|
||||
</p>
|
||||
</el-col>
|
||||
<el-col
|
||||
class="overview-container-right-alloverview-item"
|
||||
:span="8">
|
||||
<p class="overview-container-right-alloverview-item-count">
|
||||
{{ allAreaInfo.transitQuantity }}
|
||||
</p>
|
||||
<p class="overview-container-right-alloverview-item-title">
|
||||
在途
|
||||
</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<ringChart :ring-data="allAreaInfo" ref="ringChart" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="在途任务" name="second">在途任务</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="20"
|
||||
v-if="changeType === 1"
|
||||
class="overview-container-main">
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon">
|
||||
<i class="el-icon-s-grid" style="color: #fff"></i>
|
||||
</div>
|
||||
<div class="stat-title">库区信息</div>
|
||||
<div class="stat-content">
|
||||
<div class="stat-value">{{ getAreaInfoInfo.regionName }}</div>
|
||||
<div class="stat-label">{{ getAreaInfoInfo.regionCode }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="area-body">
|
||||
<div v-for="item in Object.keys(areaInfo)" :key="item">
|
||||
<div class="potTitle">{{ item }}</div>
|
||||
<div class="potList">
|
||||
<div v-for="sitem in areaInfo[item]" :key="sitem.id">
|
||||
<div v-if="sitem.empty" class="area-div-empty" />
|
||||
<div v-else class="area-div" :title="sitem.lineEdgeLibraryName">
|
||||
<el-popover
|
||||
placement="top-start"
|
||||
:title="sitem.lineEdgeLibraryCode"
|
||||
width="200"
|
||||
trigger="hover">
|
||||
<div class="point" />
|
||||
<span style="font-weight: 600">名称:</span>
|
||||
{{ sitem.lineEdgeLibraryName }}
|
||||
<br />
|
||||
<div class="point" />
|
||||
<span style="font-weight: 600">状态:</span>
|
||||
{{
|
||||
sitem.usableState == 3
|
||||
? '锁定'
|
||||
: sitem.usableState == 2
|
||||
? '不可用'
|
||||
: sitem.lineEdgeLibraryState == 1
|
||||
? '满位'
|
||||
: '空闲'
|
||||
}}
|
||||
<br />
|
||||
<span
|
||||
v-if="
|
||||
sitem.usableState == 1 &&
|
||||
sitem.lineEdgeLibraryState == 1
|
||||
">
|
||||
<span style="font-weight: 600">物料:</span>
|
||||
{{ sitem.materialCode || '' }}
|
||||
<br />
|
||||
<span style="font-weight: 600">设备:</span>
|
||||
{{ sitem.equipmentName || '' }}
|
||||
<br />
|
||||
<span style="font-weight: 600">套号:</span>
|
||||
{{ sitem.suiteCode || '' }}
|
||||
<br />
|
||||
</span>
|
||||
<el-button type="text" @click="clearLine(sitem)">
|
||||
清空
|
||||
</el-button>
|
||||
<el-button type="text" @click="addLine(sitem)">
|
||||
添加
|
||||
</el-button>
|
||||
<div
|
||||
class="area-icon"
|
||||
:style="{
|
||||
backgroundColor:
|
||||
sitem.usableState == 3
|
||||
? '#E6A23C'
|
||||
: sitem.usableState == 2
|
||||
? 'gray'
|
||||
: sitem.lineEdgeLibraryState == 1
|
||||
? '#67C23A'
|
||||
: '',
|
||||
}"
|
||||
slot="reference">
|
||||
<i
|
||||
:class="
|
||||
sitem.usableState == 3
|
||||
? 'el-icon-lock'
|
||||
: 'el-icon-s-grid'
|
||||
"
|
||||
style="color: #fff"></i>
|
||||
</div>
|
||||
</el-popover>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
destroy-on-close
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import basicPage from '@/mixins/basic-page';
|
||||
import ringChart from './components/ringChart.vue';
|
||||
import AddOrUpdate from './components/add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import {
|
||||
getAreaList,
|
||||
postAllAreaInfo,
|
||||
postAllAreaOverview,
|
||||
postAreaInfo,
|
||||
} from '@/api/areavisual/overview';
|
||||
import { QKLineEdgeLibrary } from '@/api/areavisual/lineEdgeLibrary';
|
||||
|
||||
export default {
|
||||
name: 'overview',
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
areaList: [
|
||||
{
|
||||
id: 0,
|
||||
regionName: '全部库区',
|
||||
},
|
||||
],
|
||||
areaSearchForm: {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
regionName: '',
|
||||
},
|
||||
changeType: 0,
|
||||
allAreaList: [],
|
||||
allAreaInfo: {
|
||||
totalInventory: 0,
|
||||
occupiedQuantity: 0,
|
||||
idleQuantity: 0,
|
||||
transitQuantity: 0,
|
||||
},
|
||||
areaInfo: {},
|
||||
activeName: 'first',
|
||||
getAreaInfoInfo: {},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
ringChart,
|
||||
AddOrUpdate,
|
||||
},
|
||||
async created() {
|
||||
this.getArea();
|
||||
this.getAllAreaInfo();
|
||||
this.getAllAreaOverview();
|
||||
},
|
||||
watch: {
|
||||
activeName: (val) => {
|
||||
if (val === 'first') {
|
||||
this.getAllAreaOverview();
|
||||
} else if (val === 'second') {
|
||||
this.getNowTaskList();
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 获取库区列表
|
||||
async getArea() {
|
||||
const res = await getAreaList(this.areaSearchForm);
|
||||
if (res.code === 0 && res.data) {
|
||||
(this.areaList = [
|
||||
{
|
||||
id: 0,
|
||||
regionName: '全部库区',
|
||||
},
|
||||
]),
|
||||
this.areaList.push(...res.data.list);
|
||||
}
|
||||
},
|
||||
// 库区选择
|
||||
nodeClick(data, node, components) {
|
||||
if (data.id === 0) {
|
||||
this.changeType = 0;
|
||||
this.activeName = 'first';
|
||||
this.getAllAreaInfo();
|
||||
} else {
|
||||
this.getAreaInfoInfo = data; //把库区存下,方便刷新
|
||||
this.changeType = 1;
|
||||
this.getAreaInfo(data.id);
|
||||
}
|
||||
},
|
||||
// 获取全部库区概览信息
|
||||
async getAllAreaInfo() {
|
||||
const res = await postAllAreaInfo([]);
|
||||
console.log(res);
|
||||
if (res.code === 0 && res.data) {
|
||||
this.allAreaList = res.data;
|
||||
}
|
||||
},
|
||||
// 获取库区概览
|
||||
async getAllAreaOverview() {
|
||||
const res = await postAllAreaOverview([]);
|
||||
console.log(res);
|
||||
if (res.code === 0 && res.data) {
|
||||
this.allAreaInfo = res.data;
|
||||
this.$refs.ringChart.initChart();
|
||||
}
|
||||
},
|
||||
// 获取在途任务
|
||||
async getNowTaskList() {},
|
||||
// 获取单库区信息
|
||||
async getAreaInfo(id) {
|
||||
const res = await postAreaInfo({ id });
|
||||
if (res.code === 0 && res.data) {
|
||||
// 按巷道号分组
|
||||
this.areaInfo = res.data.reduce((result, item) => {
|
||||
// 提取巷道号
|
||||
const laneNumber = item.lineEdgeLibraryCode.substring(3, 5) + ' 巷道';
|
||||
|
||||
// 如果该巷道还没有分组,创建一个空数组
|
||||
if (!result[laneNumber]) {
|
||||
result[laneNumber] = [];
|
||||
}
|
||||
|
||||
// 将当前项添加到对应巷道的数组中
|
||||
result[laneNumber].push(item);
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
Object.keys(this.areaInfo).forEach((key) => {
|
||||
const arr = this.areaInfo[key];
|
||||
let emptyNum = 0;
|
||||
let insetEmpty = [];
|
||||
arr.forEach((item, index) => {
|
||||
if (
|
||||
!item.empty &&
|
||||
item.lineEdgeLibraryCode.substring(5, 7) !=
|
||||
Math.floor(index / 2) + 1 + emptyNum &&
|
||||
item.lineEdgeLibraryCode[item.lineEdgeLibraryCode.length - 1] ==
|
||||
'L'
|
||||
) {
|
||||
let num =
|
||||
Number(item.lineEdgeLibraryCode.substring(5, 7)) -
|
||||
(Math.floor(index / 2) + 1 + emptyNum);
|
||||
insetEmpty.push({
|
||||
index,
|
||||
num,
|
||||
});
|
||||
emptyNum += num;
|
||||
}
|
||||
});
|
||||
insetEmpty.forEach((item) => {
|
||||
const arrEmpty = Array.from({ length: item.num * 2 }, () => ({
|
||||
empty: true,
|
||||
}));
|
||||
arr.splice(item.index, 0, ...arrEmpty);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
getDataList() {},
|
||||
// 全部库区右侧分页点击
|
||||
handleClickRight(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
clearLine(val) {
|
||||
if (val.usableState == 3) {
|
||||
this.$confirm(
|
||||
`当前库位为锁定状态,代表该库位有未完成的任务关联,是否确认清空${
|
||||
'线边库名称为 ' + val.lineEdgeLibraryName + ' '
|
||||
}的数据项?`,
|
||||
'锁定库位清空提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
QKLineEdgeLibrary({
|
||||
...val,
|
||||
lineEdgeLibraryState: 0,
|
||||
usableState: 1,
|
||||
}).then(({ data }) => {
|
||||
this.$message({
|
||||
message: data,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAreaInfo(this.getAreaInfoInfo.id);
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
QKLineEdgeLibrary({
|
||||
...val,
|
||||
lineEdgeLibraryState: 0,
|
||||
usableState: 1,
|
||||
}).then(({ data }) => {
|
||||
this.$message({
|
||||
message: data,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAreaInfo(this.getAreaInfoInfo.id);
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
addLine(val) {
|
||||
this.addOrEditTitle = '添加货物';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init();
|
||||
this.$refs.addOrUpdate.showLine(val);
|
||||
});
|
||||
},
|
||||
// dialog的父组件方法this.$emit("refreshDataList");
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getAreaInfo(this.getAreaInfoInfo.id);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.overview-container {
|
||||
max-height: calc(100vh - 120px - 8px);
|
||||
overflow: scroll;
|
||||
.overview-container-left {
|
||||
padding-right: 12px;
|
||||
}
|
||||
.overview-container-main {
|
||||
.allarea-box {
|
||||
padding: 10px;
|
||||
.areainfo-box {
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
.areainfo-box-header {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
white-space: nowrap; /* 禁止换行 */
|
||||
overflow: hidden; /* 隐藏溢出内容 */
|
||||
text-overflow: ellipsis; /* 溢出部分显示省略号 */
|
||||
}
|
||||
.areainfo-box-line {
|
||||
width: 100%;
|
||||
.areainfo-box-line-item {
|
||||
height: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.areainfo-box-info {
|
||||
.areainfo-box-info-item {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
.areainfo-box-info-item-count {
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.overview-container-right {
|
||||
.overview-container-right-alloverview {
|
||||
.overview-container-right-alloverview-item {
|
||||
text-align: center;
|
||||
.overview-container-right-alloverview-item-count {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.el-tree-node__content {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
.el-tree-node__label {
|
||||
display: block;
|
||||
width: calc(100% - 24px);
|
||||
text-align: center;
|
||||
white-space: nowrap; /* 禁止换行 */
|
||||
overflow: hidden; /* 隐藏溢出内容 */
|
||||
text-overflow: ellipsis; /* 溢出部分显示省略号 */
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.area-body {
|
||||
margin-top: 10px;
|
||||
margin-left: 10px;
|
||||
overflow-x: auto;
|
||||
display: flex;
|
||||
}
|
||||
.potTitle {
|
||||
width: 190px;
|
||||
background-color: rgb(169, 235, 249);
|
||||
border-radius: 3px;
|
||||
margin-right: 5px;
|
||||
text-align: center;
|
||||
color: #000000;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.potList {
|
||||
width: 190px;
|
||||
display: grid;
|
||||
grid-template-columns: 90px 90px;
|
||||
gap: 8px;
|
||||
}
|
||||
.area-div {
|
||||
padding: 10px;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
border: 4px solid #1a56db;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.area-div-empty {
|
||||
background: white;
|
||||
width: 90px;
|
||||
height: 88px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.point {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50%;
|
||||
background-color: #409eff;
|
||||
float: left;
|
||||
margin-top: 7px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.area-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: auto;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.stat-card {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
border-left: 4px solid;
|
||||
border-color: #1a56db;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
/* .stat-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
||||
} */
|
||||
.stat-title {
|
||||
margin: 0 10px;
|
||||
color: #0051ff;
|
||||
font-size: 20px;
|
||||
}
|
||||
.stat-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 12px;
|
||||
margin-right: 15px;
|
||||
background: linear-gradient(to right, #1a56db, #0d47a1);
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
color: #1a56db;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: #64748b;
|
||||
}
|
||||
</style>
|
||||
519
src/views/areavisual/record/components/RecordDrawer.vue
Normal file
519
src/views/areavisual/record/components/RecordDrawer.vue
Normal file
@@ -0,0 +1,519 @@
|
||||
<!--
|
||||
filename: EquipmentDrawer.vue
|
||||
author: liubin
|
||||
date: 2023-08-22 14:38:56
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">
|
||||
{{
|
||||
mode.includes('detail')
|
||||
? '详情'
|
||||
: mode.includes('edit')
|
||||
? '编辑'
|
||||
: '新增'
|
||||
}}
|
||||
</SmallTitle>
|
||||
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<section v-for="(section, index) in sections" :key="section.key">
|
||||
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
||||
|
||||
<div
|
||||
class="form-part"
|
||||
v-if="section.key == 'base'"
|
||||
style="margin-bottom: 32px">
|
||||
<el-skeleton v-if="!showForm" animated />
|
||||
<!-- <EquipmentInfoForm
|
||||
key="drawer-dialog-form"
|
||||
v-if="showForm"
|
||||
:disabled="mode.includes('detail')"
|
||||
:sync-filelist="syncFileListFlag"
|
||||
v-model="form" /> -->
|
||||
</div>
|
||||
|
||||
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
||||
<base-table
|
||||
v-loading="attrListLoading"
|
||||
:table-props="section.props"
|
||||
:page="attrQuery?.params.pageNo || 1"
|
||||
:limit="attrQuery?.params.pageSize || 10"
|
||||
:table-data="list"
|
||||
:add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="section.tableBtn"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="attrQuery.params.pageNo"
|
||||
:limit.sync="attrQuery.params.pageSize"
|
||||
@pagination="getAttrList" />
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">确定</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
type="primary"
|
||||
@click="handleAddAttr">
|
||||
添加属性
|
||||
</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
props: ['size'],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
class: 'small-title',
|
||||
style: {
|
||||
fontSize: '18px',
|
||||
lineHeight:
|
||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||
fontWeight: 500,
|
||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||
},
|
||||
},
|
||||
this.$slots.default
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
components: { SmallTitle },
|
||||
props: ['sections', 'mode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
showForm: false,
|
||||
btnLoading: false,
|
||||
total: 0,
|
||||
form: {},
|
||||
list: [],
|
||||
attrTitle: '',
|
||||
attrForm: {
|
||||
id: null,
|
||||
equipmentId: null,
|
||||
name: '',
|
||||
value: '',
|
||||
},
|
||||
attrFormVisible: false,
|
||||
attrRows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '属性名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '属性值',
|
||||
prop: 'value',
|
||||
},
|
||||
],
|
||||
],
|
||||
attrQuery: {
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
}, // 属性列表的请求
|
||||
infoQuery: null, // 基本信息的请求
|
||||
attrFormSubmitting: false,
|
||||
attrListLoading: false,
|
||||
syncFileListFlag: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
formRows() {
|
||||
return this.sections[0].rows.map((row) => {
|
||||
return row.map((col) => {
|
||||
if (col.key == 'eq-pics') {
|
||||
// 重置图片的位置
|
||||
return {
|
||||
...col,
|
||||
bind: {
|
||||
...col.bind,
|
||||
},
|
||||
style: {
|
||||
left: 0,
|
||||
right: 'unset',
|
||||
},
|
||||
};
|
||||
}
|
||||
return {
|
||||
...col,
|
||||
bind: {
|
||||
...col.bind,
|
||||
// 详情 模式下,禁用各种输入
|
||||
disabled: this.mode == 'detail',
|
||||
},
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
tableBtn() {
|
||||
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
for (const section of this.sections) {
|
||||
// 请求具体信息
|
||||
if ('url' in section) {
|
||||
const query = {
|
||||
url: section.url,
|
||||
method: section.method || 'get',
|
||||
params: section.queryParams || null,
|
||||
data: section.data || null,
|
||||
};
|
||||
this.$axios(query).then(({ data }) => {
|
||||
if (section.key == 'base') {
|
||||
this.form = data;
|
||||
// this.form = {
|
||||
// code: 'gj',
|
||||
// name: '下片机',
|
||||
// enName: 'unload',
|
||||
// abbr: '',
|
||||
// equipmentTypeId: 21084,
|
||||
// remark: '备注',
|
||||
// id: '1712367395052384257',
|
||||
// createTime: 1697095176000,
|
||||
// enterTime: 0,
|
||||
// productionTime: 0,
|
||||
// files: [
|
||||
// {
|
||||
// fileName: '测试.xlsx',
|
||||
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0108%2F0f0c6f30j00r5cle9000sc000hs00gtc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
||||
// fileType: 1
|
||||
// },
|
||||
// {
|
||||
// fileName: '测试2.xlsx',
|
||||
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0415%2F2cd23619j00racb96000kc000hs00hsc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
||||
// fileType: 1
|
||||
// },
|
||||
// {
|
||||
// fileName: '测试3.xlsx',
|
||||
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1fea91a0-d088-409e-b145-e0e61254b28b%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=2e0fe7d1de7f54adff3007efe133d67c',
|
||||
// fileType: 1
|
||||
// },
|
||||
// {
|
||||
// fileName: '测试4.xlsx',
|
||||
// fileUrl: 'https://pics5.baidu.com/feed/b7003af33a87e950cdfb4b4546eed044faf2b40d.jpeg?token=1d7484cfe4b014dd201f8c8725cab945',
|
||||
// fileType: 2
|
||||
// },
|
||||
// {
|
||||
// fileName: '测试5.xlsx',
|
||||
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fe3500876-9c46-4b70-8d37-4799520cdd13%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=4abc1df930e62730e5361a7d3765e0f2',
|
||||
// fileType: 2
|
||||
// },
|
||||
// ],
|
||||
// tvalue: 0,
|
||||
// processingTime: 0,
|
||||
// manufacturer: '',
|
||||
// spec: '',
|
||||
// description: '描述',
|
||||
// };
|
||||
this.showForm = true;
|
||||
this.infoQuery = query;
|
||||
} else if (section.key == 'attrs') {
|
||||
this.attrQuery = query;
|
||||
this.list = data.list;
|
||||
this.total = data.total;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleEditAttr(data.id);
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDeleteAttr(data.id);
|
||||
break;
|
||||
}
|
||||
},
|
||||
async handleConfirm() {
|
||||
this.btnLoading = true;
|
||||
this.syncFileListFlag = Math.random();
|
||||
|
||||
this.$nextTick(async () => {
|
||||
const { code, data } = await this.$axios({
|
||||
url: this.sections[0].urlUpdate,
|
||||
method: 'put',
|
||||
data: this.form,
|
||||
});
|
||||
if (code == 0) {
|
||||
this.$modal.msgSuccess('更新成功');
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
|
||||
this.btnLoading = false;
|
||||
this.handleCancel();
|
||||
});
|
||||
},
|
||||
|
||||
handleEmitFun(val) {
|
||||
console.log('handleEmitFun', val);
|
||||
},
|
||||
|
||||
init() {
|
||||
this.visible = true;
|
||||
},
|
||||
|
||||
async getAttrList() {
|
||||
this.attrListLoading = true;
|
||||
const res = await this.$axios(this.attrQuery);
|
||||
if (res.code == 0) {
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.total;
|
||||
}
|
||||
this.attrListLoading = false;
|
||||
},
|
||||
|
||||
// 保存表单
|
||||
handleSave() {
|
||||
this.$refs['form'][0].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const isEdit = this.mode == 'edit';
|
||||
await this.$axios({
|
||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.form,
|
||||
});
|
||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleCancel() {
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
// 开启编辑
|
||||
toggleEdit() {
|
||||
this.$emit('update-mode', 'edit');
|
||||
},
|
||||
|
||||
// 新增属性
|
||||
handleAddAttr() {
|
||||
if (!this.dataId) return this.$message.warning('请先创建设备信息');
|
||||
this.attrForm = {
|
||||
id: null,
|
||||
equipmentId: this.dataId,
|
||||
name: '',
|
||||
value: '',
|
||||
};
|
||||
this.attrTitle = '添加设备属性';
|
||||
this.attrFormVisible = true;
|
||||
},
|
||||
|
||||
// 编辑属性
|
||||
async handleEditAttr(attrId) {
|
||||
const res = await this.$axios({
|
||||
url: this.sections[1].urlDetail,
|
||||
method: 'get',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrForm = res.data;
|
||||
this.attrTitle = '编辑设备属性';
|
||||
this.attrFormVisible = true;
|
||||
}
|
||||
},
|
||||
|
||||
// 删除属性
|
||||
handleDeleteAttr(attrId) {
|
||||
this.$confirm('确定删除该属性?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await this.$axios({
|
||||
url: this.sections[1].urlDelete,
|
||||
method: 'delete',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit
|
||||
? this.sections[1].urlUpdate
|
||||
: this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
} catch (err) {
|
||||
this.$message({
|
||||
message: err,
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
});
|
||||
this.attrFormSubmitting = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
this.attrFormVisible = false;
|
||||
},
|
||||
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.name
|
||||
? '[名称=' + raw.data.name + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
||||
277
src/views/areavisual/record/index.vue
Normal file
277
src/views/areavisual/record/index.vue
Normal file
@@ -0,0 +1,277 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
isFold
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 设备 详情 - 编辑 -->
|
||||
<RecordDrawer
|
||||
v-if="open"
|
||||
ref="drawer"
|
||||
:mode="editMode"
|
||||
@update-mode="editMode = $event"
|
||||
:data-id="form.id"
|
||||
@refreshDataList="getList"
|
||||
@cancel="cancelEdit"
|
||||
@destroy="cancelEdit" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import RecordDrawer from './components/RecordDrawer';
|
||||
import { getRecordPage, getLaneList } from '@/api/areavisual/record';
|
||||
|
||||
export default {
|
||||
name: 'Equipment',
|
||||
components: {
|
||||
RecordDrawer,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['name', 'code'],
|
||||
// this.$auth.hasPermi(`base:equipment:update`)
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '详情'
|
||||
}
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'recordCode',
|
||||
label: '出/入库单编号',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '业务类型',
|
||||
filter: (val) => val === 1 ? '出库' : '入库',
|
||||
},
|
||||
{
|
||||
width: 180,
|
||||
prop: 'recordTime',
|
||||
label: '出/入库时间',
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss')
|
||||
},
|
||||
{ prop: 'recordArea', label: '出/入库库区' },
|
||||
{ prop: 'recordLane', label: '出/入库巷道' },
|
||||
{ prop: 'recordRegion', label: '出/入库库位号' },
|
||||
{ prop: 'target', label: '搬运对象' },
|
||||
{ prop: 'productName', label: '产品名称' },
|
||||
{ prop: 'specification', label: '型号规格' },
|
||||
{ prop: 'recordMan', label: '出/入库人' },
|
||||
{ prop: 'remark', label: '备注' }
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '关键字',
|
||||
placeholder: '请输入出/入库编码、产品名称、规格型号、库位号',
|
||||
param: 'query',
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '业务类型',
|
||||
selectOptions: [
|
||||
{
|
||||
id: '1',
|
||||
name:'出库'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name:'入库'
|
||||
},
|
||||
],
|
||||
placeholder: '请选择业务类型',
|
||||
param: 'type',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '出/入库巷道',
|
||||
selectOptions: [],
|
||||
placeholder: '请选择出/入库巷道',
|
||||
param: 'recordLane',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '来源',
|
||||
selectOptions: [
|
||||
{
|
||||
id: '1',
|
||||
name:'WMS'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name:'MES'
|
||||
},
|
||||
],
|
||||
placeholder: '请选择来源',
|
||||
param: 'source',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '出/入库人',
|
||||
selectOptions: [],
|
||||
placeholder: '请选择出/入库人',
|
||||
param: 'recordMan',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '出/入库时间',
|
||||
placeholder: '请选择出/入库时间',
|
||||
param: 'recordTime',
|
||||
dateType: 'datetimerange',
|
||||
rangeSeparator: '至'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '载具类型',
|
||||
selectOptions: [
|
||||
{
|
||||
id: '1',
|
||||
name:'AGV'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name:'人工叉车'
|
||||
},
|
||||
],
|
||||
placeholder: '请选择载具类型',
|
||||
param: 'vehicleType',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '重置',
|
||||
name: 'reset',
|
||||
color: 'info',
|
||||
}
|
||||
],
|
||||
editVisible: false,
|
||||
editMode: 'detail', // 'edit', 'detail'
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
query: '',
|
||||
type: '',
|
||||
source: '',
|
||||
recordLane: '',
|
||||
recordMan: '',
|
||||
recordTime: '',
|
||||
vehicleType: ''
|
||||
},
|
||||
form: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getLane()
|
||||
this.getList();
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getRecordPage(this.queryParams).then((response) => {
|
||||
console.log(response)
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
async getLane() {
|
||||
const res = await getLaneList({
|
||||
pageNo: 1,
|
||||
pageSize: 100
|
||||
})
|
||||
if (res.code === 0 && res.data) {
|
||||
console.log(res.data)
|
||||
this.searchBarFormConfig[2].selectOptions = res.data.list.map(item => {
|
||||
return { id: item.id, name: item.lane }
|
||||
})
|
||||
console.log(this.searchBarFormConfig)
|
||||
}
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
},
|
||||
// /** 导出按钮操作 */
|
||||
// handleExport() {
|
||||
// // 处理查询参数
|
||||
// let params = { ...this.queryParams };
|
||||
// params.pageNo = undefined;
|
||||
// params.pageSize = undefined;
|
||||
// this.$modal
|
||||
// .confirm('是否确认导出所有设备数据项?')
|
||||
// .then(() => {
|
||||
// this.exportLoading = true;
|
||||
// return exportEquipmentExcel(params);
|
||||
// })
|
||||
// .then((response) => {
|
||||
// this.$download.excel(response, '设备.xls');
|
||||
// this.exportLoading = false;
|
||||
// })
|
||||
// .catch(() => {});
|
||||
// },
|
||||
handleTableBtnClick ({data, type}) {
|
||||
switch (type) {
|
||||
case 'detail':
|
||||
this.viewDetail(data.id)
|
||||
}
|
||||
},
|
||||
// 查看详情
|
||||
viewDetail(id) {
|
||||
this.editMode = 'detail';
|
||||
this.open = true;
|
||||
this.form.id = id;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['drawer'].init();
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
81
src/views/areavisual/region/add-or-updata.vue
Normal file
81
src/views/areavisual/region/add-or-updata.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-28 14:38:31
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料编码" prop="materialCode">
|
||||
<el-input
|
||||
v-model="dataForm.materialCode"
|
||||
clearable
|
||||
placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料型号" prop="materialName">
|
||||
<el-input
|
||||
v-model="dataForm.materialName"
|
||||
clearable
|
||||
placeholder="请输入物料型号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料规格" prop="material">
|
||||
<el-input
|
||||
v-model="dataForm.material"
|
||||
clearable
|
||||
placeholder="请输入物料规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
import { createProduct, updateProduct,getProduct } from '@/api/ssdl/product&recipe';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: createProduct,
|
||||
updateURL: updateProduct,
|
||||
infoURL: getProduct,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
material: undefined,
|
||||
materialName: undefined,
|
||||
materialCode: undefined,
|
||||
},
|
||||
typeArr: [],
|
||||
dataRule: {
|
||||
materialCode: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
materialName: [
|
||||
{ required: true, message: '物料型号不能为空', trigger: 'blur' },
|
||||
],
|
||||
material: [
|
||||
{ required: true, message: '规格不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
62
src/views/areavisual/region/changeStatus.vue
Normal file
62
src/views/areavisual/region/changeStatus.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-11 14:41:12
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-14 14:13:14
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-switch
|
||||
@change="changeStatus"
|
||||
size="small"
|
||||
v-model="injectData.regionState"
|
||||
:active-value="1"
|
||||
:inactive-value="2"></el-switch>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateRegion } from '@/api/areavisual/region';
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
changeStatus(val) {
|
||||
const pdata = { ...this.injectData, regionState: val };
|
||||
this.$confirm(
|
||||
`是否确认修改${'区域 [ ' + this.injectData.regionName + ' ] '}的状态?`,
|
||||
'更新状态',
|
||||
{
|
||||
confirmButtonText: '确认修改',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
updateRegion(pdata).then((res) => {
|
||||
if (res.code === 0 || res.code === 200) {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.$emit('emitData');
|
||||
} else {
|
||||
this.$modal.msg(res.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((res) => {
|
||||
this.$emit('emitData');
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消',
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
221
src/views/areavisual/region/index.vue
Normal file
221
src/views/areavisual/region/index.vue
Normal file
@@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData"
|
||||
@emitFun="getDataList">
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import { deleteRegion, getRegionPage } from '@/api/areavisual/region';
|
||||
import changeStatus from './changeStatus.vue';
|
||||
|
||||
const region = [
|
||||
{
|
||||
id: '1',
|
||||
name: 'A区域',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: 'B区域',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: 'C区域',
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: 'D区域',
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: 'E区域',
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: 'F区域',
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
name: 'G区域',
|
||||
},
|
||||
{
|
||||
id: '8',
|
||||
name: 'H区域',
|
||||
},
|
||||
];
|
||||
const regionType = [
|
||||
{
|
||||
id: '1',
|
||||
name: '拉丝缓存区',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '满盘存储区',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '空盘存储区',
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '复绕区',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'regionCode',
|
||||
label: '区域编码',
|
||||
},
|
||||
{
|
||||
prop: 'regionName',
|
||||
label: '区域名称',
|
||||
},
|
||||
{
|
||||
prop: 'region',
|
||||
label: '区域',
|
||||
filter: (val) => {
|
||||
return region.find((i) => i.id == val)
|
||||
? region.find((i) => i.id == val).name
|
||||
: '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'regionType',
|
||||
label: '区域类型',
|
||||
filter: (val) => {
|
||||
return regionType.find((i) => i.id == val)
|
||||
? regionType.find((i) => i.id == val).name
|
||||
: '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'rowNum',
|
||||
label: '行数',
|
||||
width:90,
|
||||
},
|
||||
{
|
||||
prop: 'columnNum',
|
||||
label: '列数',
|
||||
width:90,
|
||||
},
|
||||
{
|
||||
prop: 'regionState',
|
||||
label: '区域状态',
|
||||
width:90,
|
||||
subcomponent: changeStatus,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getRegionPage,
|
||||
deleteURL: deleteRegion,
|
||||
},
|
||||
tableProps,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '名称',
|
||||
placeholder: '名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '编码',
|
||||
placeholder: '编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '区域',
|
||||
selectOptions: region,
|
||||
placeholder: '请选择区域',
|
||||
param: 'region',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.regionName = val.name;
|
||||
this.listQuery.regionCode = val.code;
|
||||
this.listQuery.region = val.region;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
23
src/views/cost/components/typeRule.vue
Normal file
23
src/views/cost/components/typeRule.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-12-05 13:45:59
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-15 17:12:03
|
||||
* @Description
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<span>{{ parseTime(injectData.startTime,'{y}年{m}月{d}日') + '-' + (parseTime(injectData.endTime)?parseTime(injectData.endTime,'{y}年{m}月{d}日'):'永久') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: '',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,145 +1,5 @@
|
||||
<template>
|
||||
<div class="home-page">
|
||||
<div class="date-tabs">
|
||||
<!-- @tab-click="handleClick" -->
|
||||
<el-tabs v-model="activeName" @tab-click="timedayChange" :stretch="true">
|
||||
<el-tab-pane
|
||||
:label="'\u2002\u2002日\u2002\u2002'"
|
||||
name="日"></el-tab-pane>
|
||||
<el-tab-pane
|
||||
:label="'\u2002\u2002周\u2002\u2002'"
|
||||
name="周"></el-tab-pane>
|
||||
<el-tab-pane
|
||||
:label="'\u2002\u2002月\u2002\u2002'"
|
||||
name="月"></el-tab-pane>
|
||||
<el-tab-pane
|
||||
:label="'\u2002\u2002年\u2002\u2002'"
|
||||
name="年"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="detail">
|
||||
<el-date-picker
|
||||
v-model="timeday"
|
||||
align="right"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
valueFormat="yyyy-MM-dd"
|
||||
:clearable="false"
|
||||
@change="timedayChange"
|
||||
placeholder="选择日期"
|
||||
:picker-options="pickerOptions"></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="main-top" :gutter="16">
|
||||
<el-col :span="24" style="position: relative">
|
||||
<div class="title">
|
||||
<svg-icon icon-class="home-produce" />
|
||||
<span class="title-inner">生产总成本</span>
|
||||
</div>
|
||||
<el-row class="box">
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.priceS }}万元</div>
|
||||
<div class="unit-style">总计成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.matPriceS }}万元</div>
|
||||
<div class="unit-style">原料成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.energyPriceS }}万元</div>
|
||||
<div class="unit-style">能源成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.otherPriceS }}万元</div>
|
||||
<div class="unit-style">其他成本</div>
|
||||
</el-col>
|
||||
<!-- <el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.ratioS }}</div>
|
||||
<div class="unit-style">综合良品率/%</div>
|
||||
</el-col> -->
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.areaPriceS }}元</div>
|
||||
<div class="unit-style">综合每平米成本</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" style="position: relative">
|
||||
<div class="title">
|
||||
<svg-icon icon-class="home-produce" />
|
||||
<span class="title-inner">原片成本</span>
|
||||
</div>
|
||||
<el-row class="box">
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.priceO }}万元</div>
|
||||
<div class="unit-style">原片总成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.matPriceO }}万元</div>
|
||||
<div class="unit-style">原料成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.energyPriceO }}万元</div>
|
||||
<div class="unit-style">能源成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.otherPriceO }}万元</div>
|
||||
<div class="unit-style">其他成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.ratioO }}</div>
|
||||
<div class="unit-style">原片良品率/%</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.areaPriceO }}元</div>
|
||||
<div class="unit-style">原片每平米成本</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" style="position: relative">
|
||||
<div class="title">
|
||||
<svg-icon icon-class="home-produce" />
|
||||
<span class="title-inner">深加工成本</span>
|
||||
</div>
|
||||
<el-row class="box">
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.priceD }}万元</div>
|
||||
<div class="unit-style">深加工总成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.energyPriceD }}万元</div>
|
||||
<div class="unit-style">能源成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.otherPriceD }}万元</div>
|
||||
<div class="unit-style">其他成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.ratioD }}</div>
|
||||
<div class="unit-style">深加工良品率/%</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.areaPriceD }}元</div>
|
||||
<div class="unit-style">深加工每平米成本</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="main-bottom" :gutter="16" v-if="false">
|
||||
<el-col :span="9">
|
||||
<div class="chart-wrapper">
|
||||
<line-chart :chart-data="lineChartData" />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<div class="chart-wrapper">
|
||||
<pie-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="chart-wrapper">
|
||||
<bar-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div
|
||||
class="main-footer"
|
||||
style="
|
||||
@@ -157,267 +17,29 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import LineChart from '../dashboard/LineChart';
|
||||
import PieChart from '../dashboard/PieChart';
|
||||
import BarChart from '../dashboard/BarChart';
|
||||
import PanelGroup from '../dashboard/PanelGroup';
|
||||
import { getData } from '@/api/cost/allCost';
|
||||
import { getUserProfile } from '@/api/system/user';
|
||||
|
||||
const lineChartData = {
|
||||
newVisitis: {
|
||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 145],
|
||||
},
|
||||
messages: {
|
||||
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||
actualData: [180, 160, 151, 106, 145, 150, 130],
|
||||
},
|
||||
purchases: {
|
||||
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||
actualData: [120, 90, 100, 138, 142, 130, 130],
|
||||
},
|
||||
shoppings: {
|
||||
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 130],
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'Home',
|
||||
mixins: [tableHeightMixin],
|
||||
components: {
|
||||
LineChart,
|
||||
PieChart,
|
||||
PanelGroup,
|
||||
BarChart,
|
||||
},
|
||||
computed: {
|
||||
gradientBackground() {
|
||||
return {
|
||||
'background-image':
|
||||
'linear-gradient(90deg, #f0f0f0 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, #f0f0f0 50%, #f0f0f0 75%, rgba(255, 255, 255, 0) 75%, rgba(255, 255, 255, 0))',
|
||||
'background-size': '100px 100px', // 调整条纹的大小
|
||||
};
|
||||
},
|
||||
},
|
||||
mixins: [],
|
||||
components: {},
|
||||
computed: {},
|
||||
data() {
|
||||
return {
|
||||
activeName: '日',
|
||||
user: '',
|
||||
lineChartData: lineChartData.newVisitis,
|
||||
homeData: {},
|
||||
timeday: moment(new Date()).subtract(1, 'days').format('YYYY-MM-DD'),
|
||||
startTime:
|
||||
moment(new Date()).subtract(0, 'days').format('YYYY-MM-DD') +
|
||||
' 00:00:00',
|
||||
endTime:
|
||||
moment(new Date()).subtract(-1, 'days').format('YYYY-MM-DD') +
|
||||
' 00:00:00',
|
||||
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() + 3600 * 1000 * 24 > Date.now();
|
||||
},
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
onClick(picker) {
|
||||
picker.$emit('pick', new Date());
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
||||
picker.$emit('pick', date);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '一周前',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', date);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
let listQuery = {
|
||||
//分页
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
statisticType: ['', '日', '周', '月', '年'].indexOf(this.activeName),
|
||||
startTime: this.timeday + ' 00:00:00',
|
||||
};
|
||||
getData(listQuery).then((response) => {
|
||||
this.homeData = response.data;
|
||||
for (let i in this.homeData) {
|
||||
this.homeData[i] = Number(this.homeData[i]).toFixed(2);
|
||||
}
|
||||
});
|
||||
},
|
||||
timedayChange() {
|
||||
let listQuery = {
|
||||
//分页
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
statisticType: ['', '日', '周', '月', '年'].indexOf(this.activeName),
|
||||
startTime: this.timeday + ' 00:00:00',
|
||||
};
|
||||
getData(listQuery).then((response) => {
|
||||
this.homeData = response.data;
|
||||
for (let i in this.homeData) {
|
||||
this.homeData[i] = Number(this.homeData[i]).toFixed(2);
|
||||
}
|
||||
});
|
||||
},
|
||||
goDetail() {
|
||||
this.$router.push({ path: 'indexDetail' });
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.home-page::before {
|
||||
background-image: url('~@/assets/img/home-bg.png');
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.date-tabs {
|
||||
padding-left: 40px;
|
||||
padding-top: 20px;
|
||||
position: relative;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
:deep(.date-tabs) {
|
||||
.el-tabs__header {
|
||||
margin-bottom: 8px;
|
||||
display: inline-block;
|
||||
transform: translateY(-12px);
|
||||
}
|
||||
|
||||
.el-tabs__content {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.el-tabs__item {
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
line-height: 36px !important;
|
||||
height: 36px;
|
||||
}
|
||||
.el-tabs__item.is-active {
|
||||
color: #0b58ff;
|
||||
}
|
||||
}
|
||||
.detail {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
left: 260px;
|
||||
top: 10px;
|
||||
}
|
||||
:deep(.detail) {
|
||||
.el-input__inner {
|
||||
background-color: transparent;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
// .current-date {
|
||||
// color: #fff;
|
||||
// font-size: 18px;
|
||||
// position: absolute;
|
||||
// left: 260px;
|
||||
// top: 14px;
|
||||
// }
|
||||
.current-time {
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
position: absolute;
|
||||
right: 38px;
|
||||
top: 14px;
|
||||
}
|
||||
.main-top {
|
||||
width: 100%;
|
||||
padding: 0 20px 0 40px;
|
||||
.title {
|
||||
position: absolute;
|
||||
left: 34px;
|
||||
top: 20px;
|
||||
width: 180px;
|
||||
font-size: 32px;
|
||||
z-index: 10;
|
||||
.title-inner {
|
||||
position: absolute;
|
||||
left: 42px;
|
||||
top: 5px;
|
||||
font-size: calc(100vw * 20 / 1920);
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background-color: #fff;
|
||||
border-radius: 24px;
|
||||
height: 192px;
|
||||
padding: 40px 24px 32px 24px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 8px 8px 0 gray;
|
||||
.num-box {
|
||||
height: 120px;
|
||||
padding-top: 26px;
|
||||
text-align: center;
|
||||
.num-style {
|
||||
color: #000;
|
||||
font-size: calc(100vw * 40 / 1920);
|
||||
}
|
||||
.unit-style {
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
font-size: calc(100vw * 18 / 1920);
|
||||
}
|
||||
}
|
||||
.shadow {
|
||||
background: linear-gradient(90deg, #ffffff 80%, #f2f4f9 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
.main-bottom {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
.chart-wrapper {
|
||||
margin-left: 10px;
|
||||
height: 425px;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 3px 3px 0 gray;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.home-page {
|
||||
.el-progress-bar__inner {
|
||||
background-image: url('~@/assets/img/home-progress-bg.png');
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,88 +1,93 @@
|
||||
<template>
|
||||
<div class="errPage-container">
|
||||
<el-button icon="arrow-left" class="pan-back-btn" @click="back">
|
||||
返回
|
||||
</el-button>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<h1 class="text-jumbo text-ginormous">
|
||||
401错误!
|
||||
</h1>
|
||||
<h2>您没有访问权限!</h2>
|
||||
<h6>对不起,您没有访问权限,请不要进行非法操作!您可以返回主页面</h6>
|
||||
<ul class="list-unstyled">
|
||||
<li class="link-type">
|
||||
<router-link to="/">
|
||||
回首页
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream.">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="errPage-container">
|
||||
<el-button icon="arrow-left" class="pan-back-btn" @click="back">
|
||||
返回
|
||||
</el-button>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<h1 class="text-jumbo text-ginormous">401错误!</h1>
|
||||
<h2>您没有访问权限!</h2>
|
||||
<h6>对不起,您没有访问权限,请不要进行非法操作!您可以返回主页面</h6>
|
||||
<ul class="list-unstyled">
|
||||
<li class="link-type">
|
||||
<router-link to="/">回首页</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<img
|
||||
:src="errGif"
|
||||
width="313"
|
||||
height="428"
|
||||
alt="Girl has dropped her ice cream." />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import errGif from '@/assets/401_images/401.gif'
|
||||
import errGif from '@/assets/401_images/401.gif';
|
||||
|
||||
export default {
|
||||
name: 'Page401',
|
||||
data() {
|
||||
return {
|
||||
errGif: errGif + '?' + +new Date()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
if (this.$route.query.noGoBack) {
|
||||
this.$router.push({ path: '/' })
|
||||
} else {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'Page401',
|
||||
data() {
|
||||
return {
|
||||
errGif: errGif + '?' + +new Date(),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
if (this.$route.query.noGoBack) {
|
||||
this.$router.push({
|
||||
path: '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.errPage-container {
|
||||
width: 800px;
|
||||
max-width: 100%;
|
||||
margin: 100px auto;
|
||||
.pan-back-btn {
|
||||
background: #008489;
|
||||
color: #fff;
|
||||
border: none!important;
|
||||
}
|
||||
.pan-gif {
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
.pan-img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
.text-jumbo {
|
||||
font-size: 60px;
|
||||
font-weight: 700;
|
||||
color: #484848;
|
||||
}
|
||||
.list-unstyled {
|
||||
font-size: 14px;
|
||||
li {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
a {
|
||||
color: #008489;
|
||||
text-decoration: none;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.errPage-container {
|
||||
width: 800px;
|
||||
max-width: 100%;
|
||||
margin: 100px auto;
|
||||
.pan-back-btn {
|
||||
background: #008489;
|
||||
color: #fff;
|
||||
border: none !important;
|
||||
}
|
||||
.pan-gif {
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
.pan-img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
.text-jumbo {
|
||||
font-size: 60px;
|
||||
font-weight: 700;
|
||||
color: #484848;
|
||||
}
|
||||
.list-unstyled {
|
||||
font-size: 14px;
|
||||
li {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
a {
|
||||
color: #008489;
|
||||
text-decoration: none;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</h2>
|
||||
|
||||
<!-- 表单 -->
|
||||
<div class="form-cont" style="margin-top: 60px;">
|
||||
<div class="form-cont" style="margin-top: 60px">
|
||||
<div style="">
|
||||
<el-form
|
||||
ref="loginForm"
|
||||
@@ -200,12 +200,14 @@
|
||||
</div>
|
||||
|
||||
<!-- 下方的登录按钮 -->
|
||||
<el-form-item id="button-form-item" style="width: 100%; margin-top: 32px">
|
||||
<el-form-item
|
||||
id="button-form-item"
|
||||
style="width: 100%; margin-top: 32px">
|
||||
<el-button
|
||||
:loading="loading"
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width: 100%; height: 66px; font-size: 18px;"
|
||||
style="width: 100%; height: 66px; font-size: 18px"
|
||||
@click.native.prevent="getCode">
|
||||
<span v-if="!loading">登 录</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
@@ -409,7 +411,14 @@ export default {
|
||||
this.loginForm
|
||||
)
|
||||
.then(() => {
|
||||
this.$router.push({ path: this.redirect || '/' }).catch(() => {});
|
||||
this.$router
|
||||
.push({
|
||||
path: this.redirect || '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
getProductPage,
|
||||
getAllProductPage,
|
||||
createProcess,
|
||||
getProcess,
|
||||
updateProcess,
|
||||
@@ -107,8 +107,8 @@ export default {
|
||||
this.dataForm.processSize = data.processSize || '';
|
||||
this.dataForm.processDesc = data.processDesc || '';
|
||||
this.visible = true;
|
||||
getProductPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
this.productArr = res.data.list;
|
||||
getAllProductPage().then((res) => {
|
||||
this.productArr = res.data;
|
||||
});
|
||||
// getEquipmentPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
// this.equipmentArr = res.data.list;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-24 14:47:58
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-28 10:06:06
|
||||
* @LastEditTime: 2026-01-13 15:56:45
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -24,6 +24,10 @@ import { parseTime } from '@/filter/code-filter';
|
||||
import { getProcessDetailPage } from '@/api/ssdl/product&recipe';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'materialCode',
|
||||
label: '物料编号',
|
||||
},
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '物料型号',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="title">异常原因Top5</div>
|
||||
<div class="alarm-item" style="margin-top: 14px;">
|
||||
<div class="item top1">
|
||||
<dov class="item-data">
|
||||
<div class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
@@ -16,10 +16,10 @@
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item top2">
|
||||
<dov class="item-data">
|
||||
<div class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
@@ -31,10 +31,10 @@
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item top3">
|
||||
<dov class="item-data">
|
||||
<div class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
@@ -46,10 +46,10 @@
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item top4">
|
||||
<dov class="item-data">
|
||||
<div class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
@@ -61,10 +61,10 @@
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item top5">
|
||||
<dov class="item-data">
|
||||
<div class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
@@ -76,7 +76,7 @@
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1999,7 +1999,7 @@ export default {
|
||||
|
||||
// 根据位置编码(如FK10101L)获取单个位置的状态类名
|
||||
getPositionClass(positionCode) {
|
||||
console.log('positionCode'.positionCode);
|
||||
// console.log('positionCode'.positionCode);
|
||||
|
||||
// 查找完全匹配的lineEdgeLibraryCode
|
||||
const targetData = this.dataList.find(item =>
|
||||
|
||||
@@ -1,61 +1,63 @@
|
||||
<template>
|
||||
<div id="dayReport" class="dayReport" :style="styles">
|
||||
<ReportHeader top-title="车间生产看板" />
|
||||
<div class="main-body" style=" flex: 1; display: flex;padding: 16px 20px 22px 24px;flex-direction: column;">
|
||||
<div class="top" style="display: flex;gap: 16px;">
|
||||
<div class="top-three" style="
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
grid-template-columns: 367px 1493px;
|
||||
">
|
||||
<agvStatus />
|
||||
<threeDimensionalChart :dataList="dataList" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="top" style="display: flex;gap: 16px;margin-top: 6px;">
|
||||
<div class="bottom-three" style="
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
grid-template-columns: 512px 930px 402px;
|
||||
">
|
||||
<div class="left-three" style="
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
grid-template-rows: 213px 213px;
|
||||
">
|
||||
<taskType />
|
||||
<taskStatus />
|
||||
</div>
|
||||
<div class="center-three" style="
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
grid-template-rows: 330px 92px;
|
||||
">
|
||||
<realTask />
|
||||
<alarm />
|
||||
<div id="dayReport" class="dayReport" :style="styles">
|
||||
<ReportHeader top-title="车间生产看板" />
|
||||
<div
|
||||
class="main-body"
|
||||
style="
|
||||
flex: 1;
|
||||
display: flex;
|
||||
padding: 16px 20px 22px 24px;
|
||||
flex-direction: column;
|
||||
">
|
||||
<div class="top" style="display: flex; gap: 16px">
|
||||
<div
|
||||
class="top-three"
|
||||
style="display: grid; gap: 12px; grid-template-columns: 367px 1493px">
|
||||
<agvStatus />
|
||||
<threeDimensionalChart :dataList="dataList" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="top" style="display: flex; gap: 16px; margin-top: 6px">
|
||||
<div
|
||||
class="bottom-three"
|
||||
style="
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
grid-template-columns: 512px 930px 402px;
|
||||
">
|
||||
<div
|
||||
class="left-three"
|
||||
style="display: grid; gap: 16px; grid-template-rows: 213px 213px">
|
||||
<taskType />
|
||||
<taskStatus />
|
||||
</div>
|
||||
<div
|
||||
class="center-three"
|
||||
style="display: grid; gap: 16px; grid-template-rows: 330px 92px">
|
||||
<realTask />
|
||||
<alarm />
|
||||
|
||||
<!-- <taskStatus /> -->
|
||||
</div>
|
||||
<alarmTop />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <taskStatus /> -->
|
||||
</div>
|
||||
<alarmTop />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ReportHeader from './components/Header.vue'
|
||||
import ReportHeader from './components/Header.vue';
|
||||
// import screenfull from 'screenfull'
|
||||
import agvStatus from './components/agvStatus.vue'
|
||||
import taskType from './components/taskType.vue'
|
||||
import realTask from './components/realTask.vue'
|
||||
import alarm from './components/alarm.vue'
|
||||
import alarmTop from './components/alarmTop.vue'
|
||||
import agvStatus from './components/agvStatus.vue';
|
||||
import taskType from './components/taskType.vue';
|
||||
import realTask from './components/realTask.vue';
|
||||
import alarm from './components/alarm.vue';
|
||||
import alarmTop from './components/alarmTop.vue';
|
||||
|
||||
import taskStatus from './components/taskStatus.vue'
|
||||
|
||||
import threeDimensionalChart from './components/threeDimensionalChart.vue'
|
||||
import { getLineEdgeLibraryList } from '../../../api/visualization/visualization'
|
||||
import taskStatus from './components/taskStatus.vue';
|
||||
|
||||
import threeDimensionalChart from './components/threeDimensionalChart.vue';
|
||||
import { getLineEdgeLibraryList } from '../../../api/visualization/visualization';
|
||||
|
||||
// import financeCosts from './components/financeCosts.vue'
|
||||
// import keyProductionIndicators from './components/keyProductionIndicators.vue'
|
||||
@@ -64,151 +66,164 @@ import { getLineEdgeLibraryList } from '../../../api/visualization/visualization
|
||||
// import keyWork from './components/keyWork.vue'
|
||||
// import moment from 'moment'
|
||||
export default {
|
||||
name: 'DayReport',
|
||||
components: { ReportHeader, agvStatus, threeDimensionalChart, taskType, taskStatus, realTask, alarm, alarmTop },
|
||||
data() {
|
||||
return {
|
||||
// isFullScreen: false,
|
||||
timer: null,
|
||||
beilv: 1,
|
||||
value: 100,
|
||||
dataList:[]
|
||||
}
|
||||
},
|
||||
name: 'DayReport',
|
||||
components: {
|
||||
ReportHeader,
|
||||
agvStatus,
|
||||
threeDimensionalChart,
|
||||
taskType,
|
||||
taskStatus,
|
||||
realTask,
|
||||
alarm,
|
||||
alarmTop,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// isFullScreen: false,
|
||||
timer: null,
|
||||
beilv: 1,
|
||||
value: 100,
|
||||
dataList: [],
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
// this.init()
|
||||
this.windowWidth(document.documentElement.clientWidth)
|
||||
},
|
||||
computed: {
|
||||
// ...mapGetters(['sidebar']),
|
||||
styles() {
|
||||
const v = Math.floor(this.value * this.beilv * 100) / 10000
|
||||
return {
|
||||
transform: `scale(${v})`,
|
||||
transformOrigin: 'left top'
|
||||
// overflow: hidden;
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
clientWidth(val) {
|
||||
if (!this.timer) {
|
||||
this.clientWidth = val
|
||||
this.beilv2 = this.clientWidth / 1920
|
||||
this.timer = true
|
||||
let _this = this
|
||||
setTimeout(function () {
|
||||
_this.timer = false
|
||||
}, 500)
|
||||
}
|
||||
// 这里可以添加修改时的方法
|
||||
this.windowWidth(val);
|
||||
}
|
||||
},
|
||||
// beforeDestroy() {
|
||||
// clearInterval(this.timer)
|
||||
// this.destroy()
|
||||
// },
|
||||
mounted() {
|
||||
const _this = this;
|
||||
_this.beilv = document.documentElement.clientWidth / 1920
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
_this.clientWidth = `${document.documentElement.clientWidth}`
|
||||
this.beilv = _this.clientWidth / 1920
|
||||
})()
|
||||
}
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
getData(data) {
|
||||
console.log(data);
|
||||
getLineEdgeLibraryList().then((res) => {
|
||||
console.log('res', res);
|
||||
created() {
|
||||
// this.init()
|
||||
this.windowWidth(document.documentElement.clientWidth);
|
||||
},
|
||||
computed: {
|
||||
// ...mapGetters(['sidebar']),
|
||||
styles() {
|
||||
const v = Math.floor(this.value * this.beilv * 100) / 10000;
|
||||
return {
|
||||
transform: `scale(${v})`,
|
||||
transformOrigin: 'left top',
|
||||
// overflow: hidden;
|
||||
};
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
clientWidth(val) {
|
||||
if (!this.timer) {
|
||||
this.clientWidth = val;
|
||||
this.beilv2 = this.clientWidth / 1920;
|
||||
this.timer = true;
|
||||
let _this = this;
|
||||
setTimeout(function () {
|
||||
_this.timer = false;
|
||||
}, 500);
|
||||
}
|
||||
// 这里可以添加修改时的方法
|
||||
this.windowWidth(val);
|
||||
},
|
||||
},
|
||||
// beforeDestroy() {
|
||||
// clearInterval(this.timer)
|
||||
// this.destroy()
|
||||
// },
|
||||
mounted() {
|
||||
const _this = this;
|
||||
let baseWidth = 1920;
|
||||
if (this.$route.query.keyword == 'home') {
|
||||
baseWidth = 2180;
|
||||
}
|
||||
_this.beilv = document.documentElement.clientWidth / baseWidth;
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
_this.clientWidth = `${document.documentElement.clientWidth}`;
|
||||
this.beilv = _this.clientWidth / baseWidth;
|
||||
})();
|
||||
};
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData(data) {
|
||||
console.log(data);
|
||||
getLineEdgeLibraryList().then((res) => {
|
||||
console.log('res', res);
|
||||
|
||||
this.dataList =res.data
|
||||
})
|
||||
},
|
||||
windowWidth(value) {
|
||||
this.clientWidth = value
|
||||
this.beilv2 = this.clientWidth / 1920
|
||||
},
|
||||
// change() {
|
||||
// this.isFullScreen = screenfull.isFullscreen
|
||||
// },
|
||||
// init() {
|
||||
// if (!screenfull.isEnabled) {
|
||||
// this.$message({
|
||||
// message: 'you browser can not work',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// screenfull.on('change', this.change)
|
||||
// },
|
||||
// destroy() {
|
||||
// if (!screenfull.isEnabled) {
|
||||
// this.$message({
|
||||
// message: 'you browser can not work',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// screenfull.off('change', this.change)
|
||||
// },
|
||||
// // 全屏
|
||||
// screenfullChange() {
|
||||
// console.log('screenfull.enabled', screenfull.isEnabled);
|
||||
this.dataList = res.data;
|
||||
});
|
||||
},
|
||||
windowWidth(value) {
|
||||
this.clientWidth = value;
|
||||
this.beilv2 = this.clientWidth / 1920;
|
||||
},
|
||||
// change() {
|
||||
// this.isFullScreen = screenfull.isFullscreen
|
||||
// },
|
||||
// init() {
|
||||
// if (!screenfull.isEnabled) {
|
||||
// this.$message({
|
||||
// message: 'you browser can not work',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// screenfull.on('change', this.change)
|
||||
// },
|
||||
// destroy() {
|
||||
// if (!screenfull.isEnabled) {
|
||||
// this.$message({
|
||||
// message: 'you browser can not work',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// screenfull.off('change', this.change)
|
||||
// },
|
||||
// // 全屏
|
||||
// screenfullChange() {
|
||||
// console.log('screenfull.enabled', screenfull.isEnabled);
|
||||
|
||||
// if (!screenfull.isEnabled) {
|
||||
// this.$message({
|
||||
// message: 'you browser can not work',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// screenfull.toggle(this.$refs.dayReportB)
|
||||
// },
|
||||
// changeDate(val) {
|
||||
// this.date = val
|
||||
// // this.weekDay = this.weekArr[moment(this.date).format('e')]
|
||||
// // this.getData()
|
||||
// if (this.date === moment().format('yyyy-MM-DD')) {
|
||||
// this.loopTime()
|
||||
// } else {
|
||||
// clearInterval(this.timer)
|
||||
// }
|
||||
// },
|
||||
// 导出
|
||||
// exportPDF() {
|
||||
// this.$message.success('正在导出,请稍等!')
|
||||
// const element = document.getElementById('dayRepDom')
|
||||
// element.style.display = 'block'
|
||||
// const fileName = '株洲碲化镉生产日报' + moment().format('yyMMDD') + '.pdf'
|
||||
// html2canvas(element, {
|
||||
// dpi: 300, // Set to 300 DPI
|
||||
// scale: 3 // Adjusts your resolution
|
||||
// }).then(function(canvas) {
|
||||
// const imgWidth = 595.28
|
||||
// const imgHeight = 841.89
|
||||
// const pageData = canvas.toDataURL('image/jpeg', 1.0)
|
||||
// const PDF = new JsPDF('', 'pt', [imgWidth, imgHeight])
|
||||
// PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight)
|
||||
// setTimeout(() => {
|
||||
// PDF.save(fileName) // 导出文件名
|
||||
// }, 1000)
|
||||
// })
|
||||
// element.style.display = 'none'
|
||||
// }
|
||||
}
|
||||
}
|
||||
// if (!screenfull.isEnabled) {
|
||||
// this.$message({
|
||||
// message: 'you browser can not work',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// screenfull.toggle(this.$refs.dayReportB)
|
||||
// },
|
||||
// changeDate(val) {
|
||||
// this.date = val
|
||||
// // this.weekDay = this.weekArr[moment(this.date).format('e')]
|
||||
// // this.getData()
|
||||
// if (this.date === moment().format('yyyy-MM-DD')) {
|
||||
// this.loopTime()
|
||||
// } else {
|
||||
// clearInterval(this.timer)
|
||||
// }
|
||||
// },
|
||||
// 导出
|
||||
// exportPDF() {
|
||||
// this.$message.success('正在导出,请稍等!')
|
||||
// const element = document.getElementById('dayRepDom')
|
||||
// element.style.display = 'block'
|
||||
// const fileName = '株洲碲化镉生产日报' + moment().format('yyMMDD') + '.pdf'
|
||||
// html2canvas(element, {
|
||||
// dpi: 300, // Set to 300 DPI
|
||||
// scale: 3 // Adjusts your resolution
|
||||
// }).then(function(canvas) {
|
||||
// const imgWidth = 595.28
|
||||
// const imgHeight = 841.89
|
||||
// const pageData = canvas.toDataURL('image/jpeg', 1.0)
|
||||
// const PDF = new JsPDF('', 'pt', [imgWidth, imgHeight])
|
||||
// PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight)
|
||||
// setTimeout(() => {
|
||||
// PDF.save(fileName) // 导出文件名
|
||||
// }, 1000)
|
||||
// })
|
||||
// element.style.display = 'none'
|
||||
// }
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.dayReport {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
background: #F2F4F9;
|
||||
// background-size: cover;
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
background: #f2f4f9;
|
||||
// background-size: cover;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user