From 99fd01670315384cadbac1e9bc8ee1e98c50001a Mon Sep 17 00:00:00 2001
From: helloDy <1615073571@qq.com>
Date: Fri, 22 Mar 2024 10:27:57 +0800
Subject: [PATCH] bug 3
---
.env.dev | 4 +-
src/api/base/coreWorkOrder.js | 29 ++-
src/components/DialogForm/index.vue | 27 ++-
src/views/base/coreCustomer/add-or-updata.vue | 11 +-
src/views/base/coreEquipment/index.vue | 1 +
src/views/base/coreEquipmentType/index.vue | 2 +-
src/views/base/coreWorkOrder/addWorkOrder.vue | 35 ++-
src/views/base/coreWorkOrder/allocation.vue | 206 ++++++++++--------
src/views/base/coreWorkOrder/detail.vue | 88 +++++---
src/views/base/coreWorkOrder/index.vue | 12 +-
src/views/base/material/add-or-updata.vue | 16 +-
.../base/materialProductBom/add-or-updata.vue | 42 ++--
src/views/core/monitoring/data24/index.vue | 18 +-
.../equipment/analysis/quality/index.vue | 11 +-
.../base/inspection/Confirm/add-or-updata.vue | 61 +++---
.../base/inspection/Record/index.vue | 2 +-
.../equipment/base/maintain/Record/index.vue | 20 +-
.../equipment/base/repair/Repair--add.vue | 9 +-
src/views/equipment/monitor/SearchBar.vue | 33 ++-
.../equipment/timing-diagram/status/chart.js | 2 +-
20 files changed, 417 insertions(+), 212 deletions(-)
diff --git a/.env.dev b/.env.dev
index 34598f0d..7c54100e 100644
--- a/.env.dev
+++ b/.env.dev
@@ -1,8 +1,8 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
- # @LastEditTime: 2024-03-13 14:57:16
- # @LastEditors: zhp
+ # @LastEditTime: 2024-03-22 10:18:20
+ # @LastEditors: DY
# @Description:
###
# 开发环境配置
diff --git a/src/api/base/coreWorkOrder.js b/src/api/base/coreWorkOrder.js
index 84d69b54..43c6d176 100644
--- a/src/api/base/coreWorkOrder.js
+++ b/src/api/base/coreWorkOrder.js
@@ -1,7 +1,7 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
- * @LastEditTime: 2023-11-15 17:19:19
+ * @LastEditTime: 2024-03-21 10:49:24
* @LastEditors: DY
* @Description:
*/
@@ -118,6 +118,24 @@ export function getCoreWOMaPage(query) {
})
}
+// 获得工单预使用原料分页----根据产品id
+export function getlistByProductId(query) {
+ return request({
+ url: '/base/material-product-bom-det/listByProductId',
+ method: 'get',
+ params: query
+ })
+}
+
+// 获得工单预使用原料分页----根据工艺流程
+export function getlistByFlowId(query) {
+ return request({
+ url: '/extend/process-equ-material-bom-det/listByFlowId',
+ method: 'get',
+ params: query
+ })
+}
+
// 获得预计用料信息分页
export function getMaterialBomPage(query) {
return request({
@@ -162,3 +180,12 @@ export function updateConCoreWOr(data) {
data: data
})
}
+
+// 修改分配产量----批量
+export function updateBatchConCoreWOr(data) {
+ return request({
+ url: '/base/core-order-con-work-order/updateBatch',
+ method: 'put',
+ data: data
+ })
+}
diff --git a/src/components/DialogForm/index.vue b/src/components/DialogForm/index.vue
index 3d19ec29..2c05e32e 100644
--- a/src/components/DialogForm/index.vue
+++ b/src/components/DialogForm/index.vue
@@ -94,7 +94,7 @@
:show-file-list="false"
icon="el-icon-upload2"
:disabled="disabled"
- :before-upload="beforeUpload"
+ :before-upload="col.uploadTips ? beforeUploadPic : beforeUpload"
:on-success="
(response, file, fileList) => {
handleUploadSuccess(response, file, col.prop);
@@ -110,7 +110,7 @@
上传文件
- {{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
+ {{ '只能上传jpg/png文件, 大小不超过2MB' }}
@@ -416,6 +416,26 @@ export default {
// 上传成功的特殊处理
beforeUpload(file) {
+ const checkFileSize = () => {
+ const isLt2M = file.size / 1024 / 1024 < 2;
+ if (!isLt2M) {
+ this.$modal.msgError('上传文件大小不能超过 2MB!');
+ }
+ return isLt2M;
+ };
+ // const checkFileType = () => {
+ // const isJPG =
+ // file.type === 'image/jpeg' ||
+ // file.type === 'image/png' ||
+ // file.type === 'image/jpg';
+ // return isJPG;
+ // };
+ // return checkFileSize() && checkFileType();
+ return checkFileSize();
+ },
+
+ // 上传成功的特殊处理----图片
+ beforeUploadPic(file) {
const checkFileSize = () => {
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
@@ -428,6 +448,9 @@ export default {
file.type === 'image/jpeg' ||
file.type === 'image/png' ||
file.type === 'image/jpg';
+ if (!isJPG) {
+ this.$modal.msgError('只能上传jpg/png文件!');
+ }
return isJPG;
};
return checkFileSize() && checkFileType();
diff --git a/src/views/base/coreCustomer/add-or-updata.vue b/src/views/base/coreCustomer/add-or-updata.vue
index 4331c6be..156fd061 100644
--- a/src/views/base/coreCustomer/add-or-updata.vue
+++ b/src/views/base/coreCustomer/add-or-updata.vue
@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
- * @LastEditTime: 2023-12-12 16:04:44
+ * @LastEditTime: 2024-03-20 16:20:39
* @Description:
-->
@@ -130,6 +130,11 @@ export default {
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data;
+ const tempPic = []
+ this.dataForm.files?.forEach(item => {
+ tempPic.push(item.fileUrl)
+ })
+ this.files = tempPic.join(',')
if (this.setData) {
this.setDataForm()
}
@@ -150,8 +155,8 @@ export default {
}
this.dataForm.files = []
- if (this.files.length > 0) {
- this.files.forEach(item => {
+ if (this.files.split(',').length > 0) {
+ this.files.split(',').forEach(item => {
const temp = {
fileType: 1,
fileUrl: item
diff --git a/src/views/base/coreEquipment/index.vue b/src/views/base/coreEquipment/index.vue
index d7ffd5b5..bcb777b9 100644
--- a/src/views/base/coreEquipment/index.vue
+++ b/src/views/base/coreEquipment/index.vue
@@ -387,6 +387,7 @@ export default {
label: '设备图片',
prop: 'files2',
fileType: 1,
+ uploadTips: true
},
],
[{ input: true, label: '备注', prop: 'remark' }],
diff --git a/src/views/base/coreEquipmentType/index.vue b/src/views/base/coreEquipmentType/index.vue
index d2505792..33814944 100644
--- a/src/views/base/coreEquipmentType/index.vue
+++ b/src/views/base/coreEquipmentType/index.vue
@@ -161,7 +161,7 @@ export default {
{
upload: true,
label: '上传资料',
- prop: 'files',
+ prop: 'files'
},
],
[{ input: true, label: '备注', prop: 'remark' }],
diff --git a/src/views/base/coreWorkOrder/addWorkOrder.vue b/src/views/base/coreWorkOrder/addWorkOrder.vue
index 41d449b0..97cfd830 100644
--- a/src/views/base/coreWorkOrder/addWorkOrder.vue
+++ b/src/views/base/coreWorkOrder/addWorkOrder.vue
@@ -186,8 +186,8 @@ export default {
code: '',
planProductId: '',
specifications: '',
- planStartTime: '',
- planFinishTime: '',
+ planStartTime: undefined,
+ planFinishTime: undefined,
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
@@ -248,7 +248,31 @@ export default {
this.dataForm.materialMethod = 1
}
},
+ reset() {
+ this.dataForm = {
+ id: undefined,
+ workOrderId: '',
+ name: '',
+ code: '',
+ planProductId: '',
+ specifications: '',
+ planStartTime: undefined,
+ planFinishTime: undefined,
+ planAssignQuantity: 0,
+ planQuantity: 0,
+ processFlowId: '',
+ materialMethod: 1,
+ triggerOrigin: 1,
+ priority: '',
+ productLineIds: [],
+ type: '',
+ workers: '',
+ roomNameDict: '',
+ status: 1
+ }
+ },
init(id) {
+ this.reset();
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
@@ -256,6 +280,7 @@ export default {
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
+ console.log('222', this.dataForm)
this.planStartTime = ''
this.planFinishTime = ''
if (this.dataForm.id) {
@@ -264,6 +289,12 @@ export default {
if (this.dataForm.priority !== undefined) {
this.dataForm.priority = String(this.dataForm.priority)
}
+ if (this.dataForm.planStartTime === 0) {
+ this.dataForm.planStartTime = undefined
+ }
+ if (this.dataForm.planFinishTime === 0) {
+ this.dataForm.planFinishTime = undefined
+ }
if (this.dataForm.roomNameDict !== undefined) {
this.dataForm.roomNameDict = String(this.dataForm.roomNameDict)
}
diff --git a/src/views/base/coreWorkOrder/allocation.vue b/src/views/base/coreWorkOrder/allocation.vue
index 9709a62e..8e441796 100644
--- a/src/views/base/coreWorkOrder/allocation.vue
+++ b/src/views/base/coreWorkOrder/allocation.vue
@@ -2,16 +2,19 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
- * @LastEditTime: 2024-03-15 15:34:58
+ * @LastEditTime: 2024-03-22 08:53:20
* @Description:
-->
+ size="55%"
+ :before-close="beforeClose"
+ @closed="$emit('destroy')"
+ >
{{ '分配产量' }}
@@ -52,60 +55,47 @@
+ value-format="timestamp"
+ placeholder="选择实际生产完成时间" />
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 保存
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
import basicAdd from '../../core/mixins/basic-add';
-import { getConOrderList, updateConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder';
+import { getConOrderList, updateConCoreWOr, updateBatchConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder';
import SmallTitle from '../material/SmallTitle';
// import { parseTime } from '../../core/mixins/code-filter';
// import attrAdd from './attr-add';
@@ -158,6 +148,10 @@ export default {
code: undefined,
productId: '',
remark: undefined,
+
+ },
+ form: {
+ tableData: []
},
productList: [],
materialAttrList: [],
@@ -174,26 +168,77 @@ export default {
},
mounted() {},
methods: {
+ beforeClose(done) {
+ // if (this.mode.includes('edit')) {
+ this.$confirm('确认关闭?')
+ .then(_ => {
+ done();
+ })
+ .catch(_ => {});
+ },
// 表单提交
dataFormSubmit() {
+ // console.log('嗨害嗨', this.$refs['table'])
+ console.log('nihc ', this.form.tableData)
+ // this.$refs['tableForm'].validate((valid) => {
+ // if (valid) {
+ // alert('提交成功!');
+ // } else {
+ // alert('表单验证失败!');
+ // return false;
+ // }
+ // });
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
+ this.$refs['tableForm'].validate((valid) => {
+ if (!valid) {
+ return false;
+ }
+ // 修改的提交
+ console.log('aaaaaaa', this.form.tableData)
+ // 判断分配数量
+ let num = 0
+ const tempList = this.form.tableData.map((item) => {
+ item.workOrderId = this.dataForm.id
+ num += item.actualAssignmentQuantity
+ return item
+ })
+ if (num <= this.dataForm.actualQuantity) {
+ if (this.dataForm.id) {
+ statusChange({
+ id: this.dataForm.id,
+ status: 4,
+ finishProduceTime: this.dataForm.finishProduceTime,
+ actualQuantity: this.dataForm.actualQuantity
+ }).then(response => {
+ this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
+ this.saveData(tempList)
+ this.visible = false;
+ this.$emit("refreshDataList");
+ });
+ return;
+ }
+ } else {
+ this.$message.error('实际分配数量超过实际生产数量!')
+ }
+ console.log('2111', num, tempList)
+ });
// 修改的提交
- if (this.dataForm.id) {
- statusChange({
- id: this.dataForm.id,
- status: 4,
- finishProduceTime: this.dataForm.finishProduceTime,
- actualQuantity: this.dataForm.actualQuantity
- }).then(response => {
- this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
- this.visible = false;
- this.$emit("refreshDataList");
- });
- return;
- }
+ // if (this.dataForm.id) {
+ // statusChange({
+ // id: this.dataForm.id,
+ // status: 4,
+ // finishProduceTime: this.dataForm.finishProduceTime,
+ // actualQuantity: this.dataForm.actualQuantity
+ // }).then(response => {
+ // this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
+ // this.visible = false;
+ // this.$emit("refreshDataList");
+ // });
+ // return;
+ // }
// 添加的提交
// this.urlOptions.createURL(this.dataForm).then(response => {
// this.$modal.msgSuccess("新增成功");
@@ -209,30 +254,14 @@ export default {
edit(row) {
row.isEdit = true
},
- saveData(row) {
- if (row.actualAssignmentQuantity) {
- if (row.id) {
- // updateMaterialPBDet({
- // ...row
- // }).then((response) => {
- // this.$modal.msgSuccess('修改成功');
- // // this.visible = false;
- // this.getList();
- // });
- // return;
- }
- // 修改的提交
- updateConCoreWOr({
- ...row,
- workOrderId: this.dataForm.id
- }).then((response) => {
- this.$modal.msgSuccess('分配成功');
- // this.visible = false;
- this.getList();
- });
- } else {
- this.$message.warning('请填写实际分配数量');
- }
+ saveData(list) {
+ console.log('你好', list)
+ // 修改的提交
+ updateBatchConCoreWOr(list).then((response) => {
+ this.$modal.msgSuccess('分配成功');
+ // this.visible = false;
+ this.getList();
+ });
},
getList() {
// 获取工单分配详细列表
@@ -245,6 +274,7 @@ export default {
item.isallocation = item.actualAssignmentQuantity ? true : false
return item
});
+ this.$set(this.form, 'tableData', this.tableData)
this.listQuery.total = response.data.length;
});
},
diff --git a/src/views/base/coreWorkOrder/detail.vue b/src/views/base/coreWorkOrder/detail.vue
index 65802278..0976087f 100644
--- a/src/views/base/coreWorkOrder/detail.vue
+++ b/src/views/base/coreWorkOrder/detail.vue
@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
- * @LastEditTime: 2024-03-15 15:40:24
+ * @LastEditTime: 2024-03-21 16:52:46
* @Description:
-->
@@ -16,7 +16,13 @@
-