diff --git a/hw-ui/public/index.html b/hw-ui/public/index.html index 529f24e9..22b08426 100644 --- a/hw-ui/public/index.html +++ b/hw-ui/public/index.html @@ -4,6 +4,7 @@ + <%= webpackConfig.name %> diff --git a/hw-ui/src/api/board/fifthFloorProduction.js b/hw-ui/src/api/board/fifthFloorProduction.js new file mode 100644 index 00000000..0bd505cc --- /dev/null +++ b/hw-ui/src/api/board/fifthFloorProduction.js @@ -0,0 +1,46 @@ +import request from '@/utils/request2' + +// 工单生产进度 +export function workOrderProgress(query) { + return request({ + url: '/fifthMesBorder/workOrderProgress', + method: 'get', + params: query + }) +} + +// 楼层生产数据 +export function productProgress(query) { + return request({ + url: '/fifthMesBorder/productProgress', + method: 'get', + params: query + }) +} + +// 组员生产合格率 +export function productionQualified(query) { + return request({ + url: '/fifthMesBorder/productionQualified', + method: 'get', + params: query + }) +} + +// 工时统计 +export function orderTime(query) { + return request({ + url: '/fifthMesBorder/orderTime', + method: 'get', + params: query + }) +} + +// 工位生产效率 +export function orderEfficiency(query) { + return request({ + url: '/fifthMesBorder/orderEfficiency', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/board/fifthFloorWarehouse.js b/hw-ui/src/api/board/fifthFloorWarehouse.js new file mode 100644 index 00000000..9412a535 --- /dev/null +++ b/hw-ui/src/api/board/fifthFloorWarehouse.js @@ -0,0 +1,17 @@ +import request from '@/utils/request1' + +export function locationCount(query) { + return request({ + url: '/FifthWmsBorder/locationCount', + method: 'get', + params: query + }) +} + +export function fifthPanake(query) { + return request({ + url: '/FifthWmsBorder/fifthPanake', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/board/firstFloorWarehouse.js b/hw-ui/src/api/board/firstFloorWarehouse.js new file mode 100644 index 00000000..30ff59d1 --- /dev/null +++ b/hw-ui/src/api/board/firstFloorWarehouse.js @@ -0,0 +1,47 @@ +import request from '@/utils/request1' +import request1 from '@/utils/request2' + +// 出入库详情 +export function inAndOutInfo(query) { + return request({ + url: '/FirstWmsBorder/inAndOutInfo', + method: 'get', + params: query + }) +} + +// 原材料库存占比 +export function stockPercentage(query) { + return request({ + url: '/FirstWmsBorder/stockPercentage', + method: 'get', + params: query + }) +} + +// 采购订单 +export function purchaseInfo(query) { + return request({ + url: '/FirstWmsBorder/purchaseInfo', + method: 'get', + params: query + }) +} + +// 生产订单物料需求 +export function bomInfo(query) { + return request({ + url: '/FirstWmsBorder/bomInfo', + method: 'get', + params: query + }) +} + +// 成品出入库 +export function productInAndOutInfo(query) { + return request({ + url: '/FirstWmsBorder/productInAndOutInfo', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/board/fourthFloorWarehouse.js b/hw-ui/src/api/board/fourthFloorWarehouse.js new file mode 100644 index 00000000..fe16bdc2 --- /dev/null +++ b/hw-ui/src/api/board/fourthFloorWarehouse.js @@ -0,0 +1,47 @@ +import request from '@/utils/request1' +import request1 from '@/utils/request2' + +// 出入库详情 +export function inAndOutInfo(query) { + return request({ + url: '/FourthWmsBorder/inAndOutInfo', + method: 'get', + params: query + }) +} + +// 原材料库存占比 +export function stockPercentage(query) { + return request({ + url: '/FourthWmsBorder/stockPercentage', + method: 'get', + params: query + }) +} + +// 采购订单 +export function purchaseInfo(query) { + return request({ + url: '/FourthWmsBorder/purchaseInfo', + method: 'get', + params: query + }) +} + +// 生产订单物料需求 +export function bomInfo(query) { + return request({ + url: '/FourthWmsBorder/bomInfo', + method: 'get', + params: query + }) +} + +// 成品出入库 +export function productInAndOutInfo(query) { + return request({ + url: '/FourthWmsBorder/productInAndOutInfo', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/board/secondFloorProduction.js b/hw-ui/src/api/board/secondFloorProduction.js new file mode 100644 index 00000000..769b3c36 --- /dev/null +++ b/hw-ui/src/api/board/secondFloorProduction.js @@ -0,0 +1,61 @@ +import request from '@/utils/request2' + +// 工单计划 +export function workOrderProgress(query) { + return request({ + url: '/SecondMesBorder/selectOrderMonth', + method: 'get', + params: query + }) +} + +// 最近工单完成情况 +export function selectLatestWorkOrder(query) { + return request({ + url: '/SecondMesBorder/selectLatestWorkOrder', + method: 'get', + params: query + }) +} + +// 获取设备状态 +export function getLineStatus(query) { + return request({ + url: '/SecondMesBorder/getLineStatus', + method: 'get', + params: query + }) +} + +// 小时产量 +export function getHourProduction(query) { + return request({ + url: '/SecondMesBorder/getHourProduction', + method: 'get', + params: query + }) +} + +export function getDayProduction(query) { + return request({ + url: '/SecondMesBorder/getDayProduction', + method: 'get', + params: query + }) +} + +export function dustAnalysis(query) { + return request({ + url: '/SecondMesBorder/dustAnalysis', + method: 'get', + params: query + }) +} + +export function deviceTimeCount(query) { + return request({ + url: '/SecondMesBorder/deviceTimeCount', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/board/secondFloorWarehouse.js b/hw-ui/src/api/board/secondFloorWarehouse.js new file mode 100644 index 00000000..6340a9e3 --- /dev/null +++ b/hw-ui/src/api/board/secondFloorWarehouse.js @@ -0,0 +1,49 @@ +import request from '@/utils/request1' + +export function workOrderProgress(query) { + return request({ + url: '/SecondWmsBorder/totalStock', + method: 'get', + params: query + }) +} + +export function instockTimeCount(query) { + return request({ + url: '/SecondWmsBorder/instockTimeCount', + method: 'get', + params: query + }) +} + +export function locationCount(query) { + return request({ + url: '/SecondWmsBorder/locationCount', + method: 'get', + params: query + }) +} + +export function tableInfo(query) { + return request({ + url: '/SecondWmsBorder/tableInfo', + method: 'get', + params: query + }) +} + +export function inAndOutStockInfo(query) { + return request({ + url: '/SecondWmsBorder/inAndOutStockInfo', + method: 'get', + params: query + }) +} + +export function todayInstockAmount(query) { + return request({ + url: '/SecondWmsBorder/todayInstockAmount', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/board/thirdFloorProduction.js b/hw-ui/src/api/board/thirdFloorProduction.js new file mode 100644 index 00000000..aa6c8459 --- /dev/null +++ b/hw-ui/src/api/board/thirdFloorProduction.js @@ -0,0 +1,64 @@ +import request from '@/utils/request2' + +// 工单计划 +export function thirdOrderPlan(query) { + return request({ + url: '/ThirdMesBorder/thirdOrderPlan', + method: 'get', + params: query + }) +} + +// 工单信息 +export function getLatestWorkOrder(query) { + return request({ + url: '/ThirdMesBorder/getLatestWorkOrder', + method: 'get', + params: query + }) +} + +// 产线信息 +export function getLineStatus(query) { + return request({ + url: '/ThirdMesBorder/getLineStatus', + method: 'get', + params: query + }) +} + +// 温湿度统计 +export function temperatureAndhumunity(query) { + return request({ + url: '/ThirdMesBorder/temperatureAndhumunity', + method: 'get', + params: query + }) +} + +// 生产统计数据 +export function productAmount(query) { + return request({ + url: '/ThirdMesBorder/productAmount', + method: 'get', + params: query + }) +} + +// 生产完成统计 +export function productCompleteCount(query) { + return request({ + url: '/ThirdMesBorder/productCompleteCount', + method: 'get', + params: query + }) +} + +// 原料入库时间 +export function rawInstock(query) { + return request({ + url: '/ThirdMesBorder/rawInstock', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/board/thirdFloorWarehouse.js b/hw-ui/src/api/board/thirdFloorWarehouse.js new file mode 100644 index 00000000..91639214 --- /dev/null +++ b/hw-ui/src/api/board/thirdFloorWarehouse.js @@ -0,0 +1,36 @@ +import request from '@/utils/request1' +import request1 from '@/utils/request2' + +export function monthRawAmount(query) { + return request({ + url: '/ThirdWmsBorder/monthRawAmount', + method: 'get', + params: query + }) +} + +export function locationStatus(query) { + return request({ + url: '/ThirdWmsBorder/locationStatus', + method: 'get', + params: query + }) +} + +export function productPlan(query) { + return request({ + url: '/ThirdWmsBorder/productPlan', + method: 'get', + params: query + }) +} + + +// 当前库存统计 +export function productCompleteCount(query) { + return request1({ + url: '/ThirdMesBorder/productCompleteCount', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/assets/board/warehouseBg3.jpg b/hw-ui/src/assets/board/warehouseBg3.jpg index e902792d..dc7b7ea0 100644 Binary files a/hw-ui/src/assets/board/warehouseBg3.jpg and b/hw-ui/src/assets/board/warehouseBg3.jpg differ diff --git a/hw-ui/src/assets/board/warehouseBg3_2.jpg b/hw-ui/src/assets/board/warehouseBg3_2.jpg new file mode 100644 index 00000000..e902792d Binary files /dev/null and b/hw-ui/src/assets/board/warehouseBg3_2.jpg differ diff --git a/hw-ui/src/utils/request.js b/hw-ui/src/utils/request.js index 3630d55a..4e86de01 100644 --- a/hw-ui/src/utils/request.js +++ b/hw-ui/src/utils/request.js @@ -17,7 +17,7 @@ const service = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: process.env.VUE_APP_BASE_API, // 超时 - timeout: 10000 + timeout: 50000 }) // request拦截器 diff --git a/hw-ui/src/utils/request1.js b/hw-ui/src/utils/request1.js new file mode 100644 index 00000000..014aea72 --- /dev/null +++ b/hw-ui/src/utils/request1.js @@ -0,0 +1,151 @@ +import axios from 'axios' +import { Notification, MessageBox, Message, Loading } from 'element-ui' +import store from '@/store' +import { getToken } from '@/utils/auth' +import errorCode from '@/utils/errorCode' +import { tansParams, blobValidate } from "@/utils/ruoyi"; +import cache from '@/plugins/cache' +import { saveAs } from 'file-saver' + +let downloadLoadingInstance; +// 是否显示重新登录 +export let isRelogin = { show: false }; + +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +// 创建axios实例 +const service = axios.create({ + // axios中请求配置有baseURL选项,表示请求URL公共部分 + baseURL: '/board-api-ware', + // 超时 + timeout: 50000 +}) + +// request拦截器 +service.interceptors.request.use(config => { + // 是否需要设置 token + const isToken = (config.headers || {}).isToken === false + // 是否需要防止数据重复提交 + const isRepeatSubmit = (config.headers || {}).repeatSubmit === false + if (getToken() && !isToken) { + config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + } + // get请求映射params参数 + if (config.method === 'get' && config.params) { + let url = config.url + '?' + tansParams(config.params); + url = url.slice(0, -1); + config.params = {}; + config.url = url; + } + if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { + const requestObj = { + url: config.url, + data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, + time: new Date().getTime() + } + const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 请求数据大小 + const limitSize = 5 * 1024 * 1024; // 限制存放数据5M + if (requestSize >= limitSize) { + console.warn(`[${config.url}]: ` + '请求数据大小超出允许的5M限制,无法进行防重复提交验证。') + return config; + } + const sessionObj = cache.session.getJSON('sessionObj') + if (sessionObj === undefined || sessionObj === null || sessionObj === '') { + cache.session.setJSON('sessionObj', requestObj) + } else { + const s_url = sessionObj.url; // 请求地址 + const s_data = sessionObj.data; // 请求数据 + const s_time = sessionObj.time; // 请求时间 + const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { + const message = '数据正在处理,请勿重复提交'; + return Promise.reject(new Error(message)) + } else { + cache.session.setJSON('sessionObj', requestObj) + } + } + } + return config +}, error => { + console.log(error) + Promise.reject(error) +}) + +// 响应拦截器 +service.interceptors.response.use(res => { + // 未设置状态码则默认成功状态 + const code = res.data.code || 200; + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { + return res.data + } + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true; + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { + isRelogin.show = false; + store.dispatch('LogOut').then(() => { + location.href = '/index'; + }) + }).catch(() => { + isRelogin.show = false; + }); + } + return Promise.reject('无效的会话,或者会话已过期,请重新登录。') + } else if (code === 500) { + Message({ message: msg, type: 'error' }) + return Promise.reject(new Error(msg)) + } else if (code === 601) { + Message({ message: msg, type: 'warning' }) + return Promise.reject('error') + } else if (code !== 200) { + Notification.error({ title: msg }) + return Promise.reject('error') + } else { + return res.data + } + }, + error => { + console.log('err' + error) + let { message } = error; + if (message == "Network Error") { + message = "后端接口连接异常"; + } else if (message.includes("timeout")) { + message = "系统接口请求超时"; + } else if (message.includes("Request failed with status code")) { + message = "系统接口" + message.substr(message.length - 3) + "异常"; + } + Message({ message: message, type: 'error', duration: 5 * 1000 }) + return Promise.reject(error) + } +) + +// 通用下载方法 +export function download(url, params, filename, config) { + downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) + return service.post(url, params, { + transformRequest: [(params) => { return tansParams(params) }], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob', + ...config + }).then(async (data) => { + const isBlob = blobValidate(data); + if (isBlob) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg); + } + downloadLoadingInstance.close(); + }).catch((r) => { + console.error(r) + Message.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close(); + }) +} + +export default service diff --git a/hw-ui/src/utils/request2.js b/hw-ui/src/utils/request2.js new file mode 100644 index 00000000..69b27edf --- /dev/null +++ b/hw-ui/src/utils/request2.js @@ -0,0 +1,151 @@ +import axios from 'axios' +import { Notification, MessageBox, Message, Loading } from 'element-ui' +import store from '@/store' +import { getToken } from '@/utils/auth' +import errorCode from '@/utils/errorCode' +import { tansParams, blobValidate } from "@/utils/ruoyi"; +import cache from '@/plugins/cache' +import { saveAs } from 'file-saver' + +let downloadLoadingInstance; +// 是否显示重新登录 +export let isRelogin = { show: false }; + +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +// 创建axios实例 +const service = axios.create({ + // axios中请求配置有baseURL选项,表示请求URL公共部分 + baseURL: '/board-api-prod', + // 超时 + timeout: 50000 +}) + +// request拦截器 +service.interceptors.request.use(config => { + // 是否需要设置 token + const isToken = (config.headers || {}).isToken === false + // 是否需要防止数据重复提交 + const isRepeatSubmit = (config.headers || {}).repeatSubmit === false + if (getToken() && !isToken) { + config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + } + // get请求映射params参数 + if (config.method === 'get' && config.params) { + let url = config.url + '?' + tansParams(config.params); + url = url.slice(0, -1); + config.params = {}; + config.url = url; + } + if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { + const requestObj = { + url: config.url, + data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, + time: new Date().getTime() + } + const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 请求数据大小 + const limitSize = 5 * 1024 * 1024; // 限制存放数据5M + if (requestSize >= limitSize) { + console.warn(`[${config.url}]: ` + '请求数据大小超出允许的5M限制,无法进行防重复提交验证。') + return config; + } + const sessionObj = cache.session.getJSON('sessionObj') + if (sessionObj === undefined || sessionObj === null || sessionObj === '') { + cache.session.setJSON('sessionObj', requestObj) + } else { + const s_url = sessionObj.url; // 请求地址 + const s_data = sessionObj.data; // 请求数据 + const s_time = sessionObj.time; // 请求时间 + const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { + const message = '数据正在处理,请勿重复提交'; + return Promise.reject(new Error(message)) + } else { + cache.session.setJSON('sessionObj', requestObj) + } + } + } + return config +}, error => { + console.log(error) + Promise.reject(error) +}) + +// 响应拦截器 +service.interceptors.response.use(res => { + // 未设置状态码则默认成功状态 + const code = res.data.code || 200; + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { + return res.data + } + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true; + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { + isRelogin.show = false; + store.dispatch('LogOut').then(() => { + location.href = '/index'; + }) + }).catch(() => { + isRelogin.show = false; + }); + } + return Promise.reject('无效的会话,或者会话已过期,请重新登录。') + } else if (code === 500) { + Message({ message: msg, type: 'error' }) + return Promise.reject(new Error(msg)) + } else if (code === 601) { + Message({ message: msg, type: 'warning' }) + return Promise.reject('error') + } else if (code !== 200) { + Notification.error({ title: msg }) + return Promise.reject('error') + } else { + return res.data + } + }, + error => { + console.log('err' + error) + let { message } = error; + if (message == "Network Error") { + message = "后端接口连接异常"; + } else if (message.includes("timeout")) { + message = "系统接口请求超时"; + } else if (message.includes("Request failed with status code")) { + message = "系统接口" + message.substr(message.length - 3) + "异常"; + } + Message({ message: message, type: 'error', duration: 5 * 1000 }) + return Promise.reject(error) + } +) + +// 通用下载方法 +export function download(url, params, filename, config) { + downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) + return service.post(url, params, { + transformRequest: [(params) => { return tansParams(params) }], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob', + ...config + }).then(async (data) => { + const isBlob = blobValidate(data); + if (isBlob) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg); + } + downloadLoadingInstance.close(); + }).catch((r) => { + console.error(r) + Message.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close(); + }) +} + +export default service diff --git a/hw-ui/src/views/board/production/fifthFloor.vue b/hw-ui/src/views/board/production/fifthFloor.vue index 617da282..149f1334 100644 --- a/hw-ui/src/views/board/production/fifthFloor.vue +++ b/hw-ui/src/views/board/production/fifthFloor.vue @@ -3,87 +3,28 @@
京源生产监控平台
+ class="title" + > {{ i }}
-
-
- 编号 -
-
- 生产工单 -
-
- 计划数量 -
-
- 实际数量 -
-
- 差异值 -
-
- 完成率 -
-
- -
-
-
- {{ item.value1 }} -
-
- {{ item.value2 }} -
-
- {{ item.value3 }} -
-
- {{ item.value4 }} -
-
- {{ item.value5 }} -
-
- {{ item.value6 }} -
-
-
-
-
-
-
+
编号
-
+
生产工单
-
+
计划数量
-
+
实际数量
-
+
差异值
-
+
完成率
@@ -99,28 +40,100 @@ >
- {{ item.value1 }} + class="scrollTableItem" style="width: 12%" + > + {{ item.no }}
- {{ item.value2 }} + class="scrollTableItem" style="width: 36%" + > + {{ item.orderCode }}
- {{ item.value3 }} + class="scrollTableItem" style="width: 14%" + > + {{ item.planAmount }}
- {{ item.value4 }} + class="scrollTableItem" style="width: 14%" + > + {{ item.completeAmount }}
- {{ item.value5 }} + class="scrollTableItem" style="width: 12%" + > + {{ item.quantityAmount }}
- {{ item.value6 }} + class="scrollTableItem" style="width: 12%" + > + {{ item.finishingRate }}% +
+
+
+ +
+
+
+
+ 编号 +
+
+ 工序名称 +
+
+ 开始时间 +
+
+ 结束时间 +
+
+ 生产用时 +
+
+ 计划用时 +
+
+ +
+
+
+ {{ item.processId }} +
+
+ {{ item.processName }} +
+
+ {{ item.planAmount }} +
+
+ {{ item.completeAmount }} +
+
+ {{ item.quantityAmount }} +
+
+ {{ item.finishingRate }}%
@@ -132,29 +145,36 @@
-
1
-
0
-
0
-
0
-
1
-
0
-
0
-
0
-
1
-
0
-
0
-
0
-
1
-
0
-
0
-
0
+
{{ topData.planAmount[0] }}
+
{{ topData.planAmount[1] }}
+
{{ topData.planAmount[2] }}
+
{{ topData.planAmount[3] }}
+
{{ topData.completeAmount[0] }}
+
{{ topData.completeAmount[1] }}
+
{{ topData.completeAmount[2] }}
+
{{ topData.completeAmount[3] }}
+
{{ topData.diff[0] }}
+
{{ topData.diff[1] }}
+
{{ topData.diff[2] }}
+
{{ topData.diff[3] }}
+
{{ topData.rate[0] }}
+
{{ topData.rate[1] }}
+
{{ topData.rate[2] }}
+
%
diff --git a/hw-ui/src/views/board/warehouse/fifthFloor2.vue b/hw-ui/src/views/board/warehouse/fifthFloor2.vue new file mode 100644 index 00000000..dd449e87 --- /dev/null +++ b/hw-ui/src/views/board/warehouse/fifthFloor2.vue @@ -0,0 +1,563 @@ + + + + + + + diff --git a/hw-ui/src/views/board/warehouse/firstFloor.vue b/hw-ui/src/views/board/warehouse/firstFloor.vue index a5a5afb7..3bb96971 100644 --- a/hw-ui/src/views/board/warehouse/firstFloor.vue +++ b/hw-ui/src/views/board/warehouse/firstFloor.vue @@ -47,24 +47,29 @@ >
- {{ item.value1 }} + class="scrollTableItem" + > + {{ item.taskCode }}
- {{ item.value2 }} + class="scrollTableItem" + > + 入库
- {{ item.value3 }} + class="scrollTableItem" + > + {{ item.materialName }}
- {{ item.value4 }} + class="scrollTableItem" + > + {{ item.locationCode }}
- {{ item.value5 }} + class="scrollTableItem" + > + {{ item.applylate }}
@@ -91,64 +96,57 @@
- {{ item.value1 }} + class="scrollTableItem" + > + {{ item.orderCode }}
- {{ item.value2 }} + class="scrollTableItem" + > + {{ item.materialName }}
- {{ item.value3 }} + class="scrollTableItem" + > + {{ item.saleAmount }}
- {{ item.value4 }} + class="scrollTableItem" + > +
- {{ item.value5 }} + class="scrollTableItem" + > + {{ item.releaseTime }}
-
1
-
0
-
0
-
0
- -
1
-
0
-
0
-
0
- -
1
-
0
-
0
-
0
- -
1
-
0
-
0
-
0
- -
1
-
0
-
0
-
0
+
{{ topData.num1[0] }}
+
{{ topData.num1[1] }}
+
{{ topData.num1[2] }}
+
{{ topData.num1[3] }}
+
{{ topData.num2[0] }}
+
{{ topData.num2[1] }}
+
{{ topData.num2[2] }}
+
{{ topData.num2[3] }}
+
{{ topData.num3[0] }}
+
{{ topData.num3[1] }}
+
{{ topData.num3[2] }}
+
{{ topData.num3[3] }}
@@ -161,6 +159,14 @@ import vueSeamlessScroll from 'vue-seamless-scroll' import Chart from '@/components/board/Chart' import HighChart from '@/components/board/HighChart' import * as echarts from 'echarts' +import { + bomInfo, + inAndOutInfo, + productInAndOutInfo, + purchaseInfo, + stockPercentage +} from '@/api/board/firstFloorWarehouse' +import { parseTime } from '@/utils/ruoyi' const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 export default { @@ -172,26 +178,31 @@ export default { }, data() { return { + topData: { + num1: [0, 0, 0, 0], + num2: [0, 0, 0, 0], + num3: [0, 0, 0, 0] + }, title: [ + '原料库入库数量:', '原料库出库数量:', - '辅料库出库数量:', - '半成品入库数量:', - '辅料库出库数量:', '半成品入库数量:', + ' ', + ' ', '库存占比' ], titlePosition: [ { top: 11.5, - left: 3.5 + left: 7.5 }, { top: 11.5, - left: 22.5 + left: 40.3 }, { top: 11.5, - left: 41.3 + left: 72.8 }, { top: 11.5, @@ -214,341 +225,14 @@ export default { openWatch: true, // 开启数据实时监控刷新dom singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1 singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3 - waitTime: 0, + waitTime: 0 }, - scrollTableData: Array(100).fill('').map(function (i, k) { - return { - value1: k + 1, - value2: '出库', - value3: '物料1', - value4: '000' + k, - value5: '2024.03.04', - } - }), + scrollTableData: [], + scrollTableData1: [] } }, mounted() { - this.$refs.chart1.setData({ - title: { - text: '原料库存占比', - style: { - color: '#fff' - } - }, - credits: { - enabled: false - }, - chart: { - type: 'pie', - animation: false, - backgroundColor: null, - events: { - load: function() { - let each = Highcharts.each, - points = this.series[0].points - each(points, function(p, i) { - p.graphic.attr({ - translateY: -p.shapeArgs.ran - }) - p.graphic.side1.attr({ - translateY: -p.shapeArgs.ran - }) - p.graphic.side2.attr({ - translateY: -p.shapeArgs.ran - }) - }) - } - }, - options3d: { - enabled: true, - alpha: 60, - beta: 0 - } - }, - legend: { - reversed: true, - itemStyle: { - color: '#fff' - } - }, - plotOptions: { - pie: { - allowPointSelect: false, - cursor: 'pointer', - depth: 35, - startAngle: 45, - size: 200, - dataLabels: { - enabled: true, - formatter: function() { - return this.point.options.name + '
' + this.point.options.h + '%' - } - }, - showInLegend: false, - point: { - events: { - legendItemClick: function(e) { - return false // 直接 return false 即可禁用图例点击事件 - } - } - } - } - }, - series: [ - { - type: 'pie', - name: 'Browser share', - data: [ - { - 'name': '材料1', - y: 30.0, - h: 30.0 - }, - { - name: '材料2', - y: 26.8, - h: 26.8 - }, - { - 'name': '材料3', - y: 15, - h: 15 - }, - { - name: '材料4', - y: 12.8, - h: 12.8 - }, - { - 'name': '材料5', - y: 8.5, - h: 8.5 - }, - { - 'name': '材料6', - y: 6.2, - h: 6.2 - }, - { - 'name': '材料7', - y: 0.7, - h: 0.7 - } - ].sort((a, b) => a.y - b.y) - }] - }) - this.$refs.chart2.setData({ - title: { - text: '原料库存占比', - style: { - color: '#fff' - } - }, - credits: { - enabled: false - }, - chart: { - type: 'pie', - startAngle: Math.PI / 6, - animation: false, - backgroundColor: null, - events: { - load: function() { - let each = Highcharts.each, - points = this.series[0].points - each(points, function(p, i) { - p.graphic.attr({ - translateY: -p.shapeArgs.ran - }) - p.graphic.side1.attr({ - translateY: -p.shapeArgs.ran - }) - p.graphic.side2.attr({ - translateY: -p.shapeArgs.ran - }) - }) - } - }, - options3d: { - enabled: true, - alpha: 60, - beta: 0 - } - }, - legend: { - reversed: true, - itemStyle: { - color: '#fff' - } - }, - plotOptions: { - pie: { - allowPointSelect: false, - cursor: 'pointer', - depth: 35, - startAngle: 45, - size: 200, - dataLabels: { - enabled: true, - formatter: function() { - return this.point.options.name + '
' + this.point.options.h + '%' - } - }, - showInLegend: false, - point: { - events: { - legendItemClick: function(e) { - return false // 直接 return false 即可禁用图例点击事件 - } - } - } - } - }, - series: [ - { - type: 'pie', - name: 'Browser share', - data: [ - { - 'name': '材料1', - y: 30.0, - h: 30.0 - }, - { - name: '材料2', - y: 26.8, - h: 26.8 - }, - { - 'name': '材料3', - y: 15, - h: 15 - }, - { - name: '材料4', - y: 12.8, - h: 12.8 - }, - { - 'name': '材料5', - y: 8.5, - h: 8.5 - }, - { - 'name': '材料6', - y: 6.2, - h: 6.2 - }, - { - 'name': '材料7', - y: 0.7, - h: 0.7 - } - ].sort((a, b) => a.y - b.y) - }] - }) - this.$refs.chart3.setData({ - tooltip: { - trigger: "axis", - axisPointer: { - // 坐标轴指示器,坐标轴触发有效 - type: "shadow", // 默认为直线,可选为:'line' | 'shadow' - }, - }, - grid: { - left: "2%", - right: "4%", - bottom: "14%", - top: "16%", - containLabel: true, - }, - legend: { - x: 'center', - top: 12, - textStyle: { - color: "#fff", - }, - itemWidth: 12, - itemHeight: 10, - // itemGap: 35 - }, - xAxis: { - type: "category", - data: ["01-01", "01-02", "01-03", "01-04", "01-05", "01-06", "01-07"], - axisLine: { - lineStyle: { - color: "white", - }, - }, - axisLabel: { - // interval: 0, - // rotate: 40, - textStyle: { - fontFamily: "Microsoft YaHei", - }, - }, - }, - - yAxis: { - type: "value", - max: "1200", - axisLine: { - show: false, - lineStyle: { - color: "white", - }, - }, - splitLine: { - show: true, - lineStyle: { - color: "rgba(255,255,255,0.3)", - }, - }, - axisLabel: {}, - }, - series: [ - { - name: "入库", - type: "bar", - barWidth: "15%", - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#fccb05", - }, - { - offset: 1, - color: "#f5804d", - }, - ]), - }, - }, - data: [400, 400, 300, 300, 300, 400, 400, 400, 300], - }, - { - name: "出库", - type: "bar", - barWidth: "15%", - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#8bd46e", - }, - { - offset: 1, - color: "#09bcb7", - }, - ]), - }, - }, - data: [400, 500, 500, 500, 500, 400, 400, 500, 500], - }, - ], - }) + this.getData() window.onresize = () => { this.$refs.chart1.resize() @@ -556,7 +240,320 @@ export default { this.$refs.chart3.resize() } }, - methods: {} + methods: { + getData() { + inAndOutInfo().then(e => { + console.log(e) + this.topData.num1= [...[0, 0, 0, 0], ...(e.data.inStocks.find(v=>v.warehouseId===111)?.outstockAmount || 0).toString().split('')].slice(-4) + this.topData.num2= [...[0, 0, 0, 0], ...(e.data.rawOutstocks?.find(v=>v.warehouseId===111)?.outstockAmount || 0).toString().split('')].slice(-4) + this.topData.num3= [...[0, 0, 0, 0], ...(e.data.inStocks.find(v=>v.warehouseId===131)?.outstockAmount || 0).toString().split('')].slice(-4) + }) + stockPercentage().then(e => { + let num1 = e.data.nostockAmount + e.data.stockAmount + let num2 = e.data.stockAmount + let num2_1 + let num3 = e.data.nostockAmount + let num3_1 + if (num1 === 0) { + num2_1 = 50 + num3_1 = 50 + } else { + num2_1 = parseFloat(((num2 / num1) * 100).toFixed(2)) + num3_1 = parseFloat(((num3 / num1) * 100).toFixed(2)) + } + this.$refs.chart1.setData({ + title: { + text: '原料库存占比', + style: { + color: '#fff' + } + }, + credits: { + enabled: false + }, + chart: { + type: 'pie', + animation: false, + backgroundColor: null, + events: { + load: function() { + let each = Highcharts.each, + points = this.series[0].points + each(points, function(p, i) { + p.graphic.attr({ + translateY: -p.shapeArgs.ran + }) + p.graphic.side1.attr({ + translateY: -p.shapeArgs.ran + }) + p.graphic.side2.attr({ + translateY: -p.shapeArgs.ran + }) + }) + } + }, + options3d: { + enabled: true, + alpha: 60, + beta: 0 + } + }, + legend: { + reversed: true, + itemStyle: { + color: '#fff' + } + }, + plotOptions: { + pie: { + allowPointSelect: false, + cursor: 'pointer', + depth: 35, + startAngle: 45, + size: 200, + dataLabels: { + enabled: true, + formatter: function() { + return this.point.options.name + '
' + this.point.options.h + '%' + } + }, + showInLegend: false, + point: { + events: { + legendItemClick: function(e) { + return false // 直接 return false 即可禁用图例点击事件 + } + } + } + } + }, + series: [ + { + type: 'pie', + name: '占比', + data: [ + { + 'name': '已使用', + y: num2_1, + h: Math.min(num2_1, 50) + }, + { + name: '未使用', + y: num3_1, + h: Math.min(num3_1, 50) + } + ].sort((a, b) => a.y - b.y) + }] + }) + let num11 = e.data.noProductstockAmount + e.data.productstockAmount + let num12 = e.data.productstockAmount + let num12_1 + let num13 = e.data.noProductstockAmount + let num13_1 + if (num11 === 0) { + num12_1 = 50 + num13_1 = 50 + } else { + num12_1 = parseFloat(((num12 / num11) * 100).toFixed(2)) + num13_1 = parseFloat(((num13 / num11) * 100).toFixed(2)) + } + this.$refs.chart2.setData({ + title: { + text: '成品库存占比', + style: { + color: '#fff' + } + }, + credits: { + enabled: false + }, + chart: { + type: 'pie', + startAngle: Math.PI / 6, + animation: false, + backgroundColor: null, + events: { + load: function() { + let each = Highcharts.each, + points = this.series[0].points + each(points, function(p, i) { + p.graphic.attr({ + translateY: -p.shapeArgs.ran + }) + p.graphic.side1.attr({ + translateY: -p.shapeArgs.ran + }) + p.graphic.side2.attr({ + translateY: -p.shapeArgs.ran + }) + }) + } + }, + options3d: { + enabled: true, + alpha: 60, + beta: 0 + } + }, + legend: { + reversed: true, + itemStyle: { + color: '#fff' + } + }, + plotOptions: { + pie: { + allowPointSelect: false, + cursor: 'pointer', + depth: 35, + startAngle: 45, + size: 200, + dataLabels: { + enabled: true, + formatter: function() { + return this.point.options.name + '
' + this.point.options.h + '%' + } + }, + showInLegend: false, + point: { + events: { + legendItemClick: function(e) { + return false // 直接 return false 即可禁用图例点击事件 + } + } + } + } + }, + series: [ + { + type: 'pie', + name: '占比', + data: [ + { + 'name': '已使用', + y: num12_1, + h: num12_1 + }, + { + name: '未使用', + y: num12_1, + h: num12_1 + } + ].sort((a, b) => a.y - b.y) + }] + }) + }) + purchaseInfo().then(e => { + this.scrollTableData = e.data + }) + bomInfo().then(e => { + this.scrollTableData1 = e.data + }) + productInAndOutInfo().then(e => { + this.$refs.chart3.setData({ + tooltip: { + trigger: 'axis', + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' + } + }, + grid: { + left: '2%', + right: '4%', + bottom: '14%', + top: '16%', + containLabel: true + }, + legend: { + x: 'center', + top: 12, + textStyle: { + color: '#fff' + }, + itemWidth: 12, + itemHeight: 10 + // itemGap: 35 + }, + xAxis: { + type: 'category', + data: e.data.map(v => parseTime(v.day, '{m}-{d}')), + axisLine: { + lineStyle: { + color: 'white' + } + }, + axisLabel: { + // interval: 0, + // rotate: 40, + textStyle: { + fontFamily: 'Microsoft YaHei' + } + } + }, + + yAxis: { + type: 'value', + axisLine: { + show: false, + lineStyle: { + color: 'white' + } + }, + splitLine: { + show: true, + lineStyle: { + color: 'rgba(255,255,255,0.3)' + } + }, + axisLabel: {} + }, + series: [ + { + name: '入库', + type: 'bar', + barWidth: '15%', + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: '#fccb05' + }, + { + offset: 1, + color: '#f5804d' + } + ]) + } + }, + data: e.data.map(v => v.instockAmount) + }, + { + name: '出库', + type: 'bar', + barWidth: '15%', + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: '#8bd46e' + }, + { + offset: 1, + color: '#09bcb7' + } + ]) + } + }, + data: e.data.map(v => v.outStockAmount) + } + ] + }) + }) + } + } } diff --git a/hw-ui/src/views/board/warehouse/secondFloor.vue b/hw-ui/src/views/board/warehouse/secondFloor.vue index d430afd0..ca481462 100644 --- a/hw-ui/src/views/board/warehouse/secondFloor.vue +++ b/hw-ui/src/views/board/warehouse/secondFloor.vue @@ -3,25 +3,20 @@
京源智能仓储监控平台
+ class="title" + > {{ i }}
-
- 任务编号 +
+ 柜体名称
-
- 任务类型 +
+ 规格型号
-
- 物料名称 -
-
- 库位编号 -
-
- 时间 +
+ 完成时长
- {{ item.value1 }} + class="scrollTableItem" style="width: 33%" + > + {{ item.productId }}
- {{ item.value2 }} + class="scrollTableItem" style="width: 33%" + > + {{ item.productBarcode }}
- {{ item.value3 }} -
-
- {{ item.value4 }} -
-
- {{ item.value5 }} + class="scrollTableItem" style="width: 33%" + > + {{ item.time }}
@@ -78,27 +68,34 @@
库存占用率
当日入库量:
-
1122
+
{{ topData.dayInstockAmount || 0 }}
-
当日入库量:
-
1122
+
当日出库量:
+
{{ topData.dayOutstockAmount || 0 }}
-
当日入库量:
-
1122
+
本月入库量:
+
{{ topData.monthInstockAmount || 0 }}
-
当日入库量:
-
1122
+
本月出库量:
+
{{ topData.monthOutstockAmount || 0 }}