From ecbd52239f2527bd2e64d4a83d5d4124972c439e Mon Sep 17 00:00:00 2001
From: Yangwl <1726150332@qq.com>
Date: Mon, 10 Mar 2025 16:40:32 +0800
Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E6=8A=A5=E8=A1=A8=E3=80=81?=
=?UTF-8?q?=E9=A2=86=E6=96=99=E5=8D=95=E5=B7=AE=E5=BC=82=E6=8A=A5=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/mes/AttendanceRecords.js | 44 +++
src/views/mes/AttendanceRecords/index.vue | 317 +++++++++++++++++++
src/views/mes/reportWork/index.vue | 3 +-
src/views/mes/reportWorks/index.vue | 367 ++++++----------------
4 files changed, 463 insertions(+), 268 deletions(-)
create mode 100644 src/api/mes/AttendanceRecords.js
create mode 100644 src/views/mes/AttendanceRecords/index.vue
diff --git a/src/api/mes/AttendanceRecords.js b/src/api/mes/AttendanceRecords.js
new file mode 100644
index 0000000..8fded8d
--- /dev/null
+++ b/src/api/mes/AttendanceRecords.js
@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询MES打卡记录列表
+export function listAttendanceRecords(query) {
+ return request({
+ url: '/mes/AttendanceRecords/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询MES打卡记录详细
+export function getAttendanceRecords(id) {
+ return request({
+ url: '/mes/AttendanceRecords/' + id,
+ method: 'get'
+ })
+}
+
+// 新增MES打卡记录
+export function addAttendanceRecords(data) {
+ return request({
+ url: '/mes/AttendanceRecords',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改MES打卡记录
+export function updateAttendanceRecords(data) {
+ return request({
+ url: '/mes/AttendanceRecords',
+ method: 'put',
+ data: data
+ })
+}
+
+// 删除MES打卡记录
+export function delAttendanceRecords(id) {
+ return request({
+ url: '/mes/AttendanceRecords/' + id,
+ method: 'delete'
+ })
+}
diff --git a/src/views/mes/AttendanceRecords/index.vue b/src/views/mes/AttendanceRecords/index.vue
new file mode 100644
index 0000000..4d01756
--- /dev/null
+++ b/src/views/mes/AttendanceRecords/index.vue
@@ -0,0 +1,317 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 修改
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mes/reportWork/index.vue b/src/views/mes/reportWork/index.vue
index 2338db8..9942ff3 100644
--- a/src/views/mes/reportWork/index.vue
+++ b/src/views/mes/reportWork/index.vue
@@ -14,7 +14,6 @@
-
@@ -62,7 +61,7 @@
v-hasPermi="['mes:reportWork:edit']"
>修改
-->
-
+
报工信息维护
diff --git a/src/views/mes/reportWorks/index.vue b/src/views/mes/reportWorks/index.vue
index 497b06b..945e07b 100644
--- a/src/views/mes/reportWorks/index.vue
+++ b/src/views/mes/reportWorks/index.vue
@@ -1,86 +1,80 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
搜索
重置
-
-
- 新增
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
import { listReportWorks} from "@/api/mes/reportWorks";
+import {
+ getProdLineList
+} from '@/api/plan/workorder'
import moment from 'moment';
export default {
name: "ReportWork",
dicts: ['report_type'],
data() {
return {
+ user: {},
optType: undefined,
// 遮罩层
loading: true,
@@ -118,7 +116,6 @@ export default {
// 总条数
total: 0,
consumeTotal:0,
- // SAPCD:"",
// 弹出层标题
title: "",
titleConsume:"",
@@ -133,161 +130,58 @@ export default {
consumePageSize:10,
reportCode:null,
},
+ prodLineList:[],
+ // 日期范围
+ dateRange: [],
// 查询参数
queryParams: {
- createTimeArray: [],
- feedbackTimeArray: [],
pageNum: 1,
pageSize: 10,
- reportType: null,
- reportCode: null,
- workorderCode: null,
- productCode: null,
- productName: null,
- spec: null,
- unit: null,
- quantity: null,
- quantityFeedback: null,
- quantityQualified: null,
- quantityUnqualified: null,
- userName: null,
- nickName: null,
- feedbackChannel: null,
- feedbackTime: null,
- recordUser: null,
- status: null,
- workTime: null,
- machineCode: null,
- machineName: null,
- teamCode: null,
- shiftId: null,
- attr1: null,
- attr2: null,
- attr3: null,
- attr4: null,
workorderCodeSap: null,
- parentOrder:null,
- uploadStatus:"0"
- },
- // 表单参数
- form: {
- endReport:'0',
- consumesInfos:[]
- },
- formSAdd: {
- endReport:'0'
- },
- teamList:[],
- batchList:[],
- // 表单校验
+ },
};
},
created() {
- //this.getDate();
this.getList();
+ getProdLineList().then(response => {
+ this.prodLineList = response
+ })
},
methods: {
-
//产品编码格式化
productCodeFormate(row, column, cellValue){
return cellValue.slice(7,18); //返回值
},
+ /** 动态设置行样式 */
+ rowStyle({ row, rowIndex }) {
+ if (row.standar < row.quantity) {
+ return { backgroundColor: '#ffcccc' }; // 标准领料数量少于实际领料数量,背景色为红色
+ } else if (row.standar > row.quantity) {
+ return { backgroundColor: '#ccffcc' }; // 标准领料数量多于实际领料数量,背景色为绿色
+ }
+ return {}; // 默认无背景色
+ },
- /**获取默认查询时间段**/
- getDate() {
- // let start = this.Fungetdate (0)
- // let end = this.Fungetdate (1)
- //this.queryParams.createTimeArray.push(start,end)
- //this.queryParams.feedbackTimeArray.push(start,end)
- this.getList();
- },
- Fungetdate (num) {``
- var dd = new Date();
- dd.setDate(dd.getDate() + num);
- var y = dd.getFullYear();
- var m = dd.getMonth() + 1;//获取当前月份的日期
- var d = dd.getDate();
- return y + "-" + m + "-" + d;
-
- },
/** 查询报工报表列表 */
getList() {
- /**
- if(this.queryParams.createTimeArray !=null && this.queryParams.createTimeArray.length>0){
- this.queryParams.createTimeStart = moment(this.queryParams.createTimeArray[0]).format('YYYY-MM-DD HH:mm:ss');
- this.queryParams.createTimeEnd = moment(this.queryParams.createTimeArray[1]).format('YYYY-MM-DD HH:mm:ss');
- }**/
-
- // if(this.queryParams.feedbackTimeArray !=null && this.queryParams.feedbackTimeArray.length>0){
- // this.queryParams.feedbackTimeStart = moment(this.queryParams.feedbackTimeArray[0]).format('YYYY-MM-DD');
- // this.queryParams.feedbackTimeEnd = moment(this.queryParams.feedbackTimeArray[1]).format('YYYY-MM-DD');
- // }
this.loading = true;
- listReportWorks(this.queryParams).then(response => {
+ listReportWorks(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.reportWorkList = response.rows;
this.total = response.total;
this.loading = false;
});
},
- // 取消按钮
- cancel() {
- this.open = false;
- this.openReport = false;
- this.openReportSAP=false;
- this.openConsume = false;
- this.reset();
- },
+
// 表单重置
reset() {
this.form = {
- id: null,
- reportType: 'UNI',
- reportCode: null,
- workorderCode: null,
- productCode: null,
- productName: null,
- spec: null,
- unit: null,
- quantity: null,
- quantityFeedback: null,
- quantityQualified: null,
- quantityUnqualified: null,
- userName: null,
- nickName: null,
- feedbackChannel: 'PC',
- feedbackTime: null,
- recordUser: null,
- status: null,
- remark: null,
- workTime: null,
- machineCode: null,
- machineName: null,
- teamCode: null,
- shiftId: null,
- attr1: null,
- attr2: null,
- attr3: null,
- attr4: null,
- createBy: null,
- createTime: null,
- updateTime: null,
- updateBy: null,
- endReport:'0'
+
};
this.resetForm("form");
- this.pOrderTableList = [];
- this.sOrderTableList = [];
- this.pReportRows = [];
- this.sReportRows = [];
- this.reportRows = [];
- this.pConsumeTableList = [];
- this.sConsumeTableList = [];
- this.pConsumeRows = [];
- this.sConsumeRows = [];
- this.consumeRows = [];
+
},
/** 搜索按钮操作 */
handleQuery() {
@@ -299,88 +193,6 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.id)
- this.selectRow = selection
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.open = true;
- this.title = "添加报工记录";
- this.optType = "add";
- },
-
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- this.optType = "edit";
- let sr = this.selectRow[0];
- if(sr.uploadStatus =='sap报工成功'){
- this.$modal.msgError(`上传sap成功,不允许修改`);
- return
- }
-
- const id = row.id || this.ids
- getReportWork(id).then(response => {
- this.form = response.data;
- this.open = true;
- this.title = "修改报工报表";
- });
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.form.id != null) {
- updateReportWork(this.form).then(response => {
- this.$modal.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- addReportWork(this.form).then(response => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
-
- let sr = this.selectRow[0];
- if(sr.uploadStatus =='sap报工成功'){
- this.$modal.msgError(`上传sap成功,不允许删除`);
- return
- }
-
- const ids = row.id || this.ids;
- this.$modal.confirm('是否确认删除报工报表编号为"' + ids + '"的数据项?').then(function() {
- return delReportWork(ids);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- }).catch(() => {});
- },
- /** 报工按钮操作 */
-
-
- handleEdit(index, row) {
- console.log('row:',index, row);
- },
- // 多选框选中数据
- pReportSelection(selection) {
- this.pReportRows = selection
- },
- sReportSelection(selection) {
- this.sReportRows = selection
- },
/** 导出按钮操作 */
@@ -393,3 +205,26 @@ export default {
}
};
+