From 1e538579a81c3ae1ea630debed53d1bd528361f3 Mon Sep 17 00:00:00 2001 From: zwq Date: Fri, 4 Aug 2023 14:32:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E5=9F=BA=E7=A1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/core/base/productionLine.js | 15 +++++- src/views/core/base/factory/index.vue | 12 ----- src/views/core/base/product/add-or-updata.vue | 8 +-- src/views/core/base/productionLine/index.vue | 53 ++++++++++++++++--- src/views/core/mixins/code-filter.js | 43 ++------------- 5 files changed, 67 insertions(+), 64 deletions(-) diff --git a/src/api/core/base/productionLine.js b/src/api/core/base/productionLine.js index 05467e1b..29fcb8f6 100644 --- a/src/api/core/base/productionLine.js +++ b/src/api/core/base/productionLine.js @@ -1,3 +1,10 @@ +/* + * @Author: zwq + * @Date: 2023-07-26 09:56:38 + * @LastEditors: zwq + * @LastEditTime: 2023-08-04 13:59:23 + * @Description: + */ import request from '@/utils/request' // 创建工厂产线 @@ -15,7 +22,13 @@ export function getCode() { method: 'get' }) } - +// 获得产线status +export function getStatus(ids) { + return request({ + url: '/base/equipment-status-realtime/lineStatus?ids=' + ids, + method: 'get' + }) +} // 更新工厂产线 export function updateProductionLine(data) { return request({ diff --git a/src/views/core/base/factory/index.vue b/src/views/core/base/factory/index.vue index 7aa8a17c..526717db 100644 --- a/src/views/core/base/factory/index.vue +++ b/src/views/core/base/factory/index.vue @@ -114,17 +114,6 @@ export default { placeholder: '工厂名称', param: 'name', }, - { - type: 'datePicker', - label: '创建时间', - dateType: 'daterange', - format: 'yyyy-MM-dd', - valueFormat: 'yyyy-MM-dd HH:mm:ss', - rangeSeparator: '-', - startPlaceholder: '开始时间', - endPlaceholder: '结束时间', - param: 'createTime', - }, { type: 'button', btnName: '搜索', @@ -173,7 +162,6 @@ export default { this.listQuery.pageSize = 10; this.listQuery.name = val.name; this.listQuery.code = val.code; - this.listQuery.createTime = val.createTime; this.getDataList(); break; case 'reset': diff --git a/src/views/core/base/product/add-or-updata.vue b/src/views/core/base/product/add-or-updata.vue index 86c387a7..9989a25f 100644 --- a/src/views/core/base/product/add-or-updata.vue +++ b/src/views/core/base/product/add-or-updata.vue @@ -318,9 +318,9 @@ export default { if (raw.type === 'delete') { this.$confirm( `确定对${ - val.data.name - ? '[名称=' + val.data.name + ']' - : '[序号=' + val.data._pageIndex + ']' + raw.data.name + ? '[名称=' + raw.data.name + ']' + : '[序号=' + raw.data._pageIndex + ']' }进行删除操作?`, '提示', { @@ -330,7 +330,7 @@ export default { } ) .then(() => { - deleteProductAttr(val.data.id).then(({ data }) => { + deleteProductAttr(raw.data.id).then(({ data }) => { this.$message({ message: '操作成功', type: 'success', diff --git a/src/views/core/base/productionLine/index.vue b/src/views/core/base/productionLine/index.vue index cb0d18ae..a3e27792 100644 --- a/src/views/core/base/productionLine/index.vue +++ b/src/views/core/base/productionLine/index.vue @@ -5,7 +5,7 @@ ref="searchBarForm" @headBtnClick="buttonClick" /> import AddOrUpdate from './add-or-updata'; import basicPage from '../../mixins/basic-page'; +import codeFilter from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter'; import { - deleteProductionLine, - getProductionLinePage, - exportProductionLineExcel -} from "@/api/core/base/productionLine"; + deleteProductionLine, + getProductionLinePage, + exportProductionLineExcel, + getStatus, +} from '@/api/core/base/productionLine'; const tableProps = [ { @@ -63,6 +65,17 @@ const tableProps = [ label: '工厂', align: 'center', }, + { + prop: 'externalCode', + label: '额外编码', + align: 'center', + }, + { + prop: 'status', + label: '当前状态', + align: 'center', + filter: codeFilter('lineStatus'), + }, { prop: 'description', label: '描述', @@ -98,13 +111,13 @@ export default { btnName: '编辑', } : undefined, - this.$auth.hasPermi(`base:production-line:delete`) + this.$auth.hasPermi(`base:production-line:delete`) ? { type: 'delete', btnName: '删除', } : undefined, - ].filter((v)=>v), + ].filter((v) => v), tableData: [], formConfig: [ { @@ -131,7 +144,9 @@ export default { type: 'separate', }, { - type: this.$auth.hasPermi('base:production-line:create') ? 'button' : '', + type: this.$auth.hasPermi('base:production-line:create') + ? 'button' + : '', btnName: '新增', name: 'add', color: 'success', @@ -154,6 +169,28 @@ export default { }, created() {}, methods: { + // 获取数据列表 + getDataList() { + this.dataListLoading = true; + this.urlOptions.getDataListURL(this.listQuery).then((response) => { + this.total = response.data.total; + this.getStatus(response.data.list); + this.dataListLoading = false; + }); + }, + getStatus(list) { + const ids = list.map((i) => { + return i.id; + }); + getStatus(ids).then((response) => { + response.forEach((a) => { + list.forEach((b) => { + if (b.id === a.id) b.status = a.status; + }); + }); + this.tableData = list; + }); + }, buttonClick(val) { switch (val.btnName) { case 'search': diff --git a/src/views/core/mixins/code-filter.js b/src/views/core/mixins/code-filter.js index 4fdf94b0..32340cc0 100644 --- a/src/views/core/mixins/code-filter.js +++ b/src/views/core/mixins/code-filter.js @@ -8,45 +8,10 @@ */ const table = { - eightDisciplineType: { - 1: '客诉问题', - 2: '重大质量问题', - 0: '重复发生问题', - }, - examineStatus: { - 1: '需要审批', - 0: '不需要审批', - }, - gradeFinish: { - 1: '已打分', - 0: '未打分', - }, - step: { - 0: 'D0', - 1: 'D1', - 2: 'D2', - 3: 'D3', - 4: 'D4', - 5: 'D5', - 6: 'D6', - 7: 'D7', - 8: 'D8', - }, - containmentLocaleName: - { - 1: "装配线", - 2: "生产线", - 3: "实验室", - 4: "成品在途", - 5: "第三方中间商", - }, - developCountermeasuresName: - { - 1: "让步接收", - 2: "分选返工", - 3: "隔离", - 4: "退换货", - 5: "通知供应商", + lineStatus: { + 1: '生产中', + 2: '停止', + 3: '未知', }, } From 18a9a4f51b85262f3e2a709ea048498b6945fce5 Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Mon, 14 Aug 2023 16:19:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=83=BD=E6=BA=90=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 3 +- src/api/base/energyType.js | 62 ++++ src/utils/dict.js | 17 +- .../base/energyType/components/InnerTable.vue | 107 ++++++ .../base/energyType/components/InputArea.vue | 37 ++ .../energyType/components/TimePickerArea.vue | 43 +++ .../energyType/components/energyTypeAdd.vue | 332 ++++++++++++++++++ src/views/energy/base/energyType/index.vue | 217 ++++++++++++ src/views/group/base/groupTeam/index.vue | 8 +- 9 files changed, 820 insertions(+), 6 deletions(-) create mode 100644 src/api/base/energyType.js create mode 100644 src/views/energy/base/energyType/components/InnerTable.vue create mode 100644 src/views/energy/base/energyType/components/InputArea.vue create mode 100644 src/views/energy/base/energyType/components/TimePickerArea.vue create mode 100644 src/views/energy/base/energyType/components/energyTypeAdd.vue create mode 100644 src/views/energy/base/energyType/index.vue diff --git a/.env.dev b/.env.dev index 8ef6dd7c..9e1d10f4 100644 --- a/.env.dev +++ b/.env.dev @@ -5,7 +5,8 @@ ENV = 'development' VUE_APP_TITLE = 芋道管理系统 # 芋道管理系统/开发环境 -VUE_APP_BASE_API = 'http://192.168.0.33:48080' +# VUE_APP_BASE_API = 'http://192.168.0.33:48080' +VUE_APP_BASE_API = 'http://192.168.1.188:48080' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/api/base/energyType.js b/src/api/base/energyType.js new file mode 100644 index 00000000..b6dbe552 --- /dev/null +++ b/src/api/base/energyType.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' + +// 创建能源类型 +export function createEnergyType(data) { + return request({ + url: '/base/energy-type/create', + method: 'post', + data: data + }) +} + +// 更新能源类型 +export function updateEnergyType(data) { + return request({ + url: '/base/energy-type/update', + method: 'put', + data: data + }) +} + +// 删除能源类型 +export function deleteEnergyType(id) { + return request({ + url: '/base/energy-type/delete?id=' + id, + method: 'delete' + }) +} + +// 获得能源类型 +export function getEnergyType(id) { + return request({ + url: '/base/energy-type/get?id=' + id, + method: 'get' + }) +} + +// 获得能源类型分页 +export function getEnergyTypePage(data) { + return request({ + url: '/base/energy-type/page', + method: 'post', + data: data + }) +} + +// 获得能源类型编码 +export function getEnergyTypeCode() { + return request({ + url: '/base/energy-type/getCode', + method: 'get' + }) +} + +// 导出能源类型 Excel +export function exportEnergyTypeExcel(query) { + return request({ + url: '/base/energy-type/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/utils/dict.js b/src/utils/dict.js index a3a47222..aa6c9f58 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -86,6 +86,9 @@ export const DICT_TYPE = { // ============== PRODUCT - 产品模块 ============= UNIT_DICT: 'unit_dict', PRODUCT_TYPE: 'product_type', + + // ============== ENERGY - 能源模块 ============= + ENERGY_UNIT: 'energy_unit' } /** @@ -95,7 +98,7 @@ export const DICT_TYPE = { * @returns {*|Array} 数据字典数组 */ export function getDictDatas(dictType) { - console.log('---> ', dictType, store.getters.dict_datas) + // console.log('---> ', dictType, store.getters.dict_datas) return store.getters.dict_datas[dictType] || [] } @@ -145,3 +148,15 @@ export function getDictDataLabel(dictType, value) { const dict = getDictData(dictType, value); return dict ? dict.label : ''; } + +// table中用来过滤字典 +export function publicFormatter(dictTable) { + const dictDatas = getDictDatas(dictTable) + return function (val) { + const arr = {} + dictDatas.map((item) => { + arr[item.value] = item.label + }) + return arr?.[val] + } +} diff --git a/src/views/energy/base/energyType/components/InnerTable.vue b/src/views/energy/base/energyType/components/InnerTable.vue new file mode 100644 index 00000000..ff3adce7 --- /dev/null +++ b/src/views/energy/base/energyType/components/InnerTable.vue @@ -0,0 +1,107 @@ + + + diff --git a/src/views/energy/base/energyType/components/InputArea.vue b/src/views/energy/base/energyType/components/InputArea.vue new file mode 100644 index 00000000..94088653 --- /dev/null +++ b/src/views/energy/base/energyType/components/InputArea.vue @@ -0,0 +1,37 @@ + + + diff --git a/src/views/energy/base/energyType/components/TimePickerArea.vue b/src/views/energy/base/energyType/components/TimePickerArea.vue new file mode 100644 index 00000000..d3b6810b --- /dev/null +++ b/src/views/energy/base/energyType/components/TimePickerArea.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/views/energy/base/energyType/components/energyTypeAdd.vue b/src/views/energy/base/energyType/components/energyTypeAdd.vue new file mode 100644 index 00000000..ea64c5c8 --- /dev/null +++ b/src/views/energy/base/energyType/components/energyTypeAdd.vue @@ -0,0 +1,332 @@ + + diff --git a/src/views/energy/base/energyType/index.vue b/src/views/energy/base/energyType/index.vue new file mode 100644 index 00000000..c3c10dd4 --- /dev/null +++ b/src/views/energy/base/energyType/index.vue @@ -0,0 +1,217 @@ + + + diff --git a/src/views/group/base/groupTeam/index.vue b/src/views/group/base/groupTeam/index.vue index 5af98769..b692c247 100644 --- a/src/views/group/base/groupTeam/index.vue +++ b/src/views/group/base/groupTeam/index.vue @@ -87,14 +87,14 @@ export default { formConfig: [ { type: 'input', - label: '名称', - placeholder: '名称', + label: '班次名称', + placeholder: '班次名称', param: 'name' }, { type: 'input', - label: '编码', - placeholder: '编码', + label: '班次编码', + placeholder: '班次编码', param: 'code' }, {