diff --git a/.env.dev b/.env.dev index 2f15db72..f863fa20 100644 --- a/.env.dev +++ b/.env.dev @@ -1,20 +1,20 @@ ### # @Author: Do not edit # @Date: 2023-08-29 09:40:39 - # @LastEditTime: 2023-10-16 09:22:52 - # @LastEditors: DY - # @Description: -### + # @LastEditTime: 2024-09-10 14:43:39 + # @LastEditors: zwq + # @Description: +### # 开发环境配置 ENV = 'development' # 页面标题 -VUE_APP_TITLE = 产线监控系统 +VUE_APP_TITLE = 成本管理系统 # 芋道管理系统/开发环境 # VUE_APP_BASE_API = 'http://192.168.1.49:48080' -# VUE_APP_BASE_API = 'http://192.168.1.8:48080' -VUE_APP_BASE_API = 'http://192.168.0.33:48080' +VUE_APP_BASE_API = 'http://line.kszny.picaiba.com' +# VUE_APP_BASE_API = 'http://192.168.1.40:48080' # VUE_APP_BASE_API = 'http://192.168.1.188:48080' # 路由懒加载 diff --git a/.env.prod b/.env.prod index 7ac2b7f1..724977ea 100644 --- a/.env.prod +++ b/.env.prod @@ -1,15 +1,24 @@ +### + # @Author: zwq + # @Date: 2024-03-27 15:49:55 + # @LastEditors: zwq + # @LastEditTime: 2024-09-10 15:19:19 + # @Description: +### # 生产环境配置 ENV = 'production' # 页面标题 -VUE_APP_TITLE = 产线监控系统 +VUE_APP_TITLE = 成本管理系统 # 芋道管理系统/生产环境 -VUE_APP_BASE_API = '/prod-api' +# VUE_APP_BASE_API = '/prod-api' +VUE_APP_BASE_API = '' # 根据服务器或域名修改 # PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/' -PUBLIC_PATH = 'http://192.168.0.33:8888/' +# PUBLIC_PATH = 'http://192.168.0.33:8888/' +PUBLIC_PATH = '' # 二级部署路径 VUE_APP_APP_NAME ='yudao-admin' diff --git a/package.json b/package.json index 08d55ea0..d715cd55 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "license": "MIT", "scripts": { "local": "vue-cli-service serve --mode local", - "dev": "vue-cli-service serve --mode dev", + "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev", "front": "vue-cli-service serve --mode front", - "build:prod": "vue-cli-service build --mode prod", + "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod", "build:stage": "vue-cli-service build --mode stage", "build:dev": "vue-cli-service build --mode dev", "build:static": "vue-cli-service build --mode static", diff --git a/src/api/base/equipmentConfig.js b/src/api/base/equipmentConfig.js new file mode 100644 index 00000000..c5fe331d --- /dev/null +++ b/src/api/base/equipmentConfig.js @@ -0,0 +1,53 @@ +/* + * @Author: Do not edit + * @Date: 2024-02-21 13:43:02 + * @LastEditTime: 2024-04-30 10:07:59 + * @LastEditors: zwq + * @Description: + */ +import request from '@/utils/request' + +// 获得关联表名 +export function getplcAllList(query) { + return request({ + url: '/base/equipment-plc/listAll', + method: 'get', + params: query + }) +} + +// 获得设备 +export function getEquipmentList(query) { + return request({ + url: '/base/core-equipment/page', + method: 'get', + params: query + }) +} + +// 根据产线获得工段 +export function listByParentId(query) { + return request({ + url: '/base/core-workshop-section/listByParentId', + method: 'get', + params: query + }) +} + +// 获得产线工段设备树形结构 +export function getTree(query) { + return request({ + url: '/base/factory/getTree', + method: 'get', + params: query + }) +} + +// 获得设备分组列表 +export function getgroupAllList(query) { + return request({ + url: '/base/equipment-group/listAll', + method: 'get', + params: query + }) +} diff --git a/src/api/base/productionLine.js b/src/api/base/productionLine.js index 7fade9c9..5a226e94 100644 --- a/src/api/base/productionLine.js +++ b/src/api/base/productionLine.js @@ -1,3 +1,10 @@ +/* + * @Author: zwq + * @Date: 2024-03-27 15:49:55 + * @LastEditors: zwq + * @LastEditTime: 2024-09-10 14:36:19 + * @Description: + */ import request from '@/utils/request' // 获得所有工厂产线列表 export function getLineAll() { @@ -5,4 +12,12 @@ export function getLineAll() { url: '/base/production-line/listAll', method: 'get' }) -} \ No newline at end of file +} +// 获得产线分页 +export function getLinePage(query) { + return request({ + url: '/base/production-line/page', + method: 'get', + params: query + }) +} diff --git a/src/api/cost/costDeepRatioHis.js b/src/api/cost/costDeepRatioHis.js new file mode 100644 index 00000000..c273e5df --- /dev/null +++ b/src/api/cost/costDeepRatioHis.js @@ -0,0 +1,55 @@ +/* + * @Author: zwq + * @Date: 2024-04-18 16:53:17 + * @LastEditors: zwq + * @LastEditTime: 2024-09-06 15:00:09 + * @Description: + */ + +import request from '@/utils/request' +// 更新深加工良品率 +export function updateDeepRatioHis(data) { + return request({ + url: '/monitoring/cost-deep-ratio-his/update', + method: 'put', + data: data + }) +} +// 获得深加工产线良品率 +export function getDeepPDRatioHisPage(query) { + return request({ + url: '/monitoring/cost-deep-ratio-his/page-pd', + method: 'get', + params: query + }) +} +// 获得深加工工段良品率 +export function getDeepWSRatioHisPage(query) { + return request({ + url: '/monitoring/cost-deep-ratio-his/page-ws', + method: 'get', + params: query + }) +} + +// 导出深加工工段良品率 Excel +export function exportDeepWSRatioHisExcel(query) { + return request({ + url: '/monitoring/cost-deep-ratio-his/export-excel-ws', + method: 'get', + params: query, + responseType: 'blob' + }) +} + + +// 导出深加工产线良品率 Excel +export function exportDeepPDRatioHisExcel(query) { + return request({ + url: '/monitoring/cost-deep-ratio-his/export-excel-pd', + method: 'get', + params: query, + responseType: 'blob' + }) +} + diff --git a/src/api/cost/costEnergy.js b/src/api/cost/costEnergy.js index 7831ae34..38546f0d 100644 --- a/src/api/cost/costEnergy.js +++ b/src/api/cost/costEnergy.js @@ -32,3 +32,22 @@ export function getEnergyRealtimePage(query) { params: query }) } +// 导出能源成本成本查询 Excel +export function exportEnergyRealtimeExcel(query) { + return request({ + url: '/monitoring/cost-energy-realtime/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} + +// 导出能源成本历史 Excel +export function exportEnergyHisExcel(query) { + return request({ + url: '/monitoring/cost-energy-his/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/api/cost/costEnergyDeep.js b/src/api/cost/costEnergyDeep.js index adadc91a..081578a4 100644 --- a/src/api/cost/costEnergyDeep.js +++ b/src/api/cost/costEnergyDeep.js @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2024-04-18 16:53:17 * @LastEditors: zwq - * @LastEditTime: 2024-04-22 14:51:14 + * @LastEditTime: 2024-09-06 15:19:24 * @Description: */ @@ -32,3 +32,23 @@ export function getEnergyRealtimePage(query) { params: query }) } + +// 导出深加工能源成本成本查询 Excel +export function exportEnergyRealtimeExcel(query) { + return request({ + url: '/monitoring/cost-deep-energy-realtime/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} + +// 导出深加工能源成本历史 Excel +export function exportEnergyHisExcel(query) { + return request({ + url: '/monitoring/cost-deep-energy-his/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/api/cost/costMaterial.js b/src/api/cost/costMaterial.js index 9cf72cea..150dad07 100644 --- a/src/api/cost/costMaterial.js +++ b/src/api/cost/costMaterial.js @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2024-04-18 16:53:17 * @LastEditors: zwq - * @LastEditTime: 2024-04-19 16:12:14 + * @LastEditTime: 2024-09-05 13:55:30 * @Description: */ @@ -32,3 +32,23 @@ export function getMaterialRealtimePage(query) { params: query }) } + +// 导出原料成本成本查询 Excel +export function exportMaterialRealtimeExcel(query) { + return request({ + url: '/monitoring/cost-material-realtime/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} + +// 导出原料成本历史 Excel +export function exportMaterialHisExcel(query) { + return request({ + url: '/monitoring/cost-material-his/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/api/cost/costOriginRatioHis.js b/src/api/cost/costOriginRatioHis.js index f4a43db7..0f0343b3 100644 --- a/src/api/cost/costOriginRatioHis.js +++ b/src/api/cost/costOriginRatioHis.js @@ -24,3 +24,13 @@ export function getcostOriginRatioHisPage(query) { }) } +// 导出原片良品率 Excel +export function exportcostOriginRatioHisExcel(query) { + return request({ + url: '/monitoring/cost-origin-ratio-his/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} + diff --git a/src/api/cost/costOthercostHis.js b/src/api/cost/costOthercostHis.js index ee3f1695..d305affa 100644 --- a/src/api/cost/costOthercostHis.js +++ b/src/api/cost/costOthercostHis.js @@ -32,3 +32,22 @@ export function getRawOthercostSunPage(query) { params: query }) } +// 导出原片其他成本-成本查询 Excel +export function exportRawOthercostSunExcel(query) { + return request({ + url: '/monitoring/cost-othercost-log/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} + +// 导出原片其他成本-历史 Excel +export function exportRawOthercostHisExcel(query) { + return request({ + url: '/monitoring/cost-othercost-his/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/api/cost/costOthercostHisDeep.js b/src/api/cost/costOthercostHisDeep.js index fdf06342..8bc73c95 100644 --- a/src/api/cost/costOthercostHisDeep.js +++ b/src/api/cost/costOthercostHisDeep.js @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2024-04-18 16:53:17 * @LastEditors: zwq - * @LastEditTime: 2024-04-22 15:15:18 + * @LastEditTime: 2024-09-06 15:13:20 * @Description: */ @@ -32,3 +32,22 @@ export function getRawOthercostSunPage(query) { params: query }) } +// 导出深加工其他成本-成本查询 Excel +export function exportRawOthercostSunExcel(query) { + return request({ + url: '/monitoring/cost-deep-othercost-log/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} + +// 导出深加工其他成本-历史 Excel +export function exportRawOthercostHisExcel(query) { + return request({ + url: '/monitoring/cost-deep-othercost-his/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/api/cost/costOthercostLog.js b/src/api/cost/costOthercostLog.js index 553d4cd0..bff532e8 100644 --- a/src/api/cost/costOthercostLog.js +++ b/src/api/cost/costOthercostLog.js @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2024-04-15 17:01:20 * @LastEditors: zwq - * @LastEditTime: 2024-04-18 15:40:27 + * @LastEditTime: 2024-09-06 14:12:09 * @Description: */ import request from '@/utils/request' @@ -53,7 +53,7 @@ export function getRawOthercostLogPage(query) { // 导出原片其他成本-记录 Excel export function exportRawOthercostLogExcel(query) { return request({ - url: '/monitoring/cost-othercost-log/export-excel', + url: '/monitoring/cost-othercost-log/export-log-excel', method: 'get', params: query, responseType: 'blob' diff --git a/src/api/cost/costOthercostLogDeep.js b/src/api/cost/costOthercostLogDeep.js index bfdcb0d2..e0f86046 100644 --- a/src/api/cost/costOthercostLogDeep.js +++ b/src/api/cost/costOthercostLogDeep.js @@ -53,7 +53,7 @@ export function getRawOthercostLogPage(query) { // 导出深加工其他成本-记录 Excel export function exportRawOthercostLogExcel(query) { return request({ - url: '/monitoring/cost-deep-othercost-log/export-excel', + url: '/monitoring/cost-deep-othercost-log/export-log-excel', method: 'get', params: query, responseType: 'blob' diff --git a/src/api/cost/deepCostStatistics.js b/src/api/cost/deepCostStatistics.js new file mode 100644 index 00000000..7c86e852 --- /dev/null +++ b/src/api/cost/deepCostStatistics.js @@ -0,0 +1,53 @@ +/* + * @Author: zwq + * @Date: 2024-04-18 16:53:17 + * @LastEditors: zwq + * @LastEditTime: 2024-09-02 14:43:30 + * @Description: + */ + +import request from '@/utils/request' + +// 获得深加工成本分页 +export function getDeepCostStatisticsPage(query) { + return request({ + url: '/monitoring/cost-deep-cost-his/page', + method: 'get', + params: query + }) +} +// 更新深加工成本-历史 +export function updateDeepCostStatistics(data) { + return request({ + url: '/monitoring/cost-deep-cost-his/update', + method: 'put', + data: data + }) +} +// 获得深加工成本统计成本查询分页 +export function getDeepCostStatisticsRealtimePage(query) { + return request({ + url: '/monitoring/cost-deep-cost-realtime/page', + method: 'get', + params: query + }) +} + +// 导出深加工成本统计成本查询 Excel +export function exportDeepStatisticsRealtimeExcel(query) { + return request({ + url: '/monitoring/cost-deep-cost-realtime/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} +// 导出深加工成本统计-历史成本 Excel +export function exportDeepCostStatisticsHisExcel(query) { + return request({ + url: '/monitoring/cost-deep-cost-his/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/api/cost/rawCostStatistics.js b/src/api/cost/rawCostStatistics.js new file mode 100644 index 00000000..c93ce7ec --- /dev/null +++ b/src/api/cost/rawCostStatistics.js @@ -0,0 +1,54 @@ +/* + * @Author: zwq + * @Date: 2024-04-18 16:53:17 + * @LastEditors: zwq + * @LastEditTime: 2024-09-06 14:35:13 + * @Description: + */ + +import request from '@/utils/request' + +// 获得原片成本分页 +export function getRawCostStatisticsPage(query) { + return request({ + url: '/monitoring/cost-origincost-his/page', + method: 'get', + params: query + }) +} +// 更新原片成本-历史 +export function updateRawCostStatistics(data) { + return request({ + url: '/monitoring/cost-origincost-his/update', + method: 'put', + data: data + }) +} +// 获得原片成本统计成本查询分页 +export function getRawCostStatisticsRealtimePage(query) { + return request({ + url: '/monitoring/cost-origin-cost-realtime/page', + method: 'get', + params: query + }) +} + +// 导出原片成本统计成本查询 Excel +export function exportRawStatisticsRealtimeExcel(query) { + return request({ + url: '/monitoring/cost-origin-cost-realtime/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} + +// 导出原片成本统计-历史成本 Excel +export function exportRawCostStatisticsHisExcel(query) { + return request({ + url: '/monitoring/cost-origincost-his/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/components/ButtonNav/index.vue b/src/components/ButtonNav/index.vue new file mode 100644 index 00000000..c3bc57aa --- /dev/null +++ b/src/components/ButtonNav/index.vue @@ -0,0 +1,132 @@ + + + + + + + + + diff --git a/src/filter/code-filter.js b/src/filter/code-filter.js index 23c4b8b1..8297f577 100644 --- a/src/filter/code-filter.js +++ b/src/filter/code-filter.js @@ -2,7 +2,7 @@ /* * @Date: 2020-12-29 16:49:28 * @LastEditors: zwq - * @LastEditTime: 2023-12-07 10:00:51 + * @LastEditTime: 2024-09-10 15:15:21 * @FilePath: \basic-admin\src\filters\basicData\index.js * @Description: */ @@ -47,7 +47,7 @@ export function parseTime(time, pattern) { if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { time = parseInt(time) } else if (typeof time === 'string') { - time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),''); + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm), ''); } if ((typeof time === 'number') && (time.toString().length === 10)) { time = time * 1000 @@ -61,14 +61,25 @@ export function parseTime(time, pattern) { h: date.getHours(), i: date.getMinutes(), s: date.getSeconds(), - a: date.getDay() + a: date.getDay(), + w: '', } - const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { + const time_str = format.replace(/{([ymdhisaw])+}/g, (result, key) => { let value = formatObj[key] // Note: getDay() returns 0 on Sunday if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } + if (key === 'w') { + const current = new Date(time); + current.setHours(0, 0, 0); + current.setDate(current.getDate() + 4 - (current.getDay() || 7)); + const firstThursday = new Date(current.getFullYear(), 0, 4); + firstThursday.setDate(firstThursday.getDate() + 4 - (firstThursday.getDay() || 7)); + const time1 = current.getTime() - firstThursday.getTime(); + const weeks = Math.ceil(time1 / (7 * 24 * 3600 * 1000)); + return (weeks + 1) + } if (result.length > 0 && value < 10) { value = '0' + value } diff --git a/src/router/index.js b/src/router/index.js index 9ac00be5..509a429c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -76,9 +76,10 @@ export const constantRoutes = [ children: [ { path: "index", - component: (resolve) => require(["@/views/index"], resolve), + component: (resolve) => require(["@/views/cost/raw/costMaterial/index"], resolve), name: "首页", meta: { title: "首页", icon: "dashboard", affix: true }, + hidden: true }, ], }, diff --git a/src/views/base/equipmentBindGroup/components/BasicDrawer.vue b/src/views/base/equipmentBindGroup/components/BasicDrawer.vue index 3bfb196c..cb47e181 100644 --- a/src/views/base/equipmentBindGroup/components/BasicDrawer.vue +++ b/src/views/base/equipmentBindGroup/components/BasicDrawer.vue @@ -1,8 +1,8 @@ -