projects/mes-test #133

Merged
gtz217 merged 281 commits from projects/mes-test into projects/mes 2023-11-30 09:11:34 +08:00
21 changed files with 827 additions and 588 deletions
Showing only changes of commit 3ada2c5d08 - Show all commits

View File

@ -1,7 +1,7 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2023-11-06 09:08:54
# @LastEditTime: 2023-11-07 09:23:07
# @LastEditors: DY
# @Description:
###

View File

@ -1,7 +1,7 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-06 10:50:57
* @LastEditTime: 2023-11-06 17:49:42
* @LastEditors: DY
* @Description:
*/
@ -109,3 +109,30 @@ export function getCoreWOMaPage(query) {
params: query
})
}
// 获得预计用料信息分页
export function getMaterialBomPage(query) {
return request({
url: '/base/material-product-bom/bomUseNum',
method: 'get',
params: query
})
}
// 获得订单分页
export function getConOrderList(query) {
return request({
url: '/base/order/listConOrder',
method: 'get',
params: query
})
}
// 改变工单状态 激活暂停完成作废
export function statusChange(data) {
return request({
url: '/base/core-work-order/statusChange',
method: 'post',
data: data
})
}

View File

@ -1,17 +1,17 @@
/*
* @Author: zhp
* @Date: 2023-09-12 14:07:04
* @LastEditTime: 2023-09-13 09:53:45
* @LastEditors: zhp
* @LastEditTime: 2023-11-07 14:17:38
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
export function getYieldAnalysisPageData(data) {
export function getYieldAnalysisPageData(query) {
return request({
url: '/analysis/production-analysis/getOutput',
method: 'post',
data: data
url: '/base/core-production-line-rec-day/monthList',
method: 'get',
params: query
})
}

View File

@ -1,17 +1,17 @@
/*
* @Author: Do not edit
* @Date: 2023-09-12 09:44:53
* @LastEditTime: 2023-09-15 14:12:26
* @LastEditTime: 2023-11-06 18:57:05
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 获得近24小时产线生产数据
export function getPdlDataOneDay(data) {
export function getPdlDataOneDay(query) {
return request({
url: '/monitoring/production-monitor/getPdlDataOneDay',
method: 'post',
data: data
url: '/base/core-production-line-rec-hour/list24h',
method: 'get',
params: query
})
}

View File

@ -1,416 +0,0 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-04 11:39:25
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="100px"
label-position="top">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产品名称" prop="name">
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入产品名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
:disabled="isdetail"
placeholder="请输入产品编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料类型" prop="materialType">
<el-select
v-model="dataForm.materialType"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择物料类型">
<el-option
v-for="dict in this.getDictDatas('material_type')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品类型" prop="productType">
<el-select
v-model="dataForm.productType"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择产品类型">
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择单位">
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.UNIT_DICT)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位平方数" prop="area">
<el-input-number v-model="dataForm.area" :precision="2" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="规格" prop="specifications">
<el-input v-model="dataForm.specifications" :disabled="isdetail" clearable placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线生产单位用时(S)" prop="processTime">
<el-input v-model.number="dataForm.processTime" type="number" :disabled="isdetail" clearable placeholder="请输入产线生产单位用时" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品属性
</small-title>
<div v-if="!isdetail" class="action_btn">
<template>
<span style="display: inline-block;" @click="addNew()">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="productAttrList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:product-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreProduct, updateCoreProduct, getCoreProduct, getCode, getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'name',
label: '属性名',
},
{
prop: 'value',
label: '属性值',
},
];
const topBtnConfig = [
{
type: 'add',
btnName: 'btn.add'
}
]
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableProps,
topBtnConfig,
addOrUpdateVisible: false,
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreProduct,
updateURL: updateCoreProduct,
infoURL: getCoreProduct,
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataForm: {
id: undefined,
code: undefined,
name: '',
materialType: undefined,
productType: undefined,
area: undefined,
specifications: undefined,
processTime: 0,
remark: undefined,
unit: undefined
},
productAttrList: [],
visible: false,
isdetail: false,
idAttrShow: false,
dataRule: {
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
}
};
},
mounted() {},
methods: {
initData() {
this.productAttrList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCoreProductAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getCoreProductAttrPage({
...this.listQuery,
productId: this.dataForm.id,
}).then((response) => {
this.productAttrList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
this.dataForm.unit = String(this.dataForm.unit)
this.dataForm.materialType = String(this.dataForm.materialType)
this.dataForm.productType = String(this.dataForm.productType)
});
//
this.getList();
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
goback() {
this.visible = false;
this.$emit('refreshDataList');
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-06 10:01:37
* @LastEditTime: 2023-11-06 14:38:20
* @Description:
-->
<template>
@ -16,8 +16,8 @@
{{ '预使用主原料信息' }}
</small-title>
<div class="content">
<div style="height: 15vh">
<div style="font-size: 18px;">工单名{{ workOrderName }}</div>
<div style="height: 10vh">
<div style="font-size: 18px;">工单名{{ dataForm.name }}</div>
</div>
<div class="attr-list">
@ -64,7 +64,7 @@
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:product-id="dataForm.id"
:work-order-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
@ -136,7 +136,6 @@ export default {
tableBtn,
tableProps,
topBtnConfig,
workOrderName: '111',
addOrUpdateVisible: false,
listQuery: {
pageSize: 10,
@ -144,7 +143,8 @@ export default {
total: 0,
},
dataForm: {
id: undefined
id: undefined,
name: ''
},
materialList: [],
visible: false,
@ -199,10 +199,11 @@ export default {
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
init(row, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.dataForm.id = row.id || undefined;
this.dataForm.name = row.name || '';
this.visible = true;
this.getList()
@ -237,6 +238,7 @@ export default {
// /
addNew(id) {
this.addOrUpdateVisible = true;
console.log('22', id)
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});

View File

@ -178,7 +178,8 @@ export default {
priority: '',
productLineIds: [],
type: '',
workers: ''
workers: '',
status: 1
},
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],

View File

@ -75,6 +75,7 @@
<el-select
v-model="dataForm.unit"
filterable
style="width: 100%"
placeholder="请选择单位">
<el-option
v-for="dict in getDictDatas('unit_dict')"
@ -103,7 +104,7 @@ import { getDictDatas} from "@/utils/dict";
export default {
props: {
productId: {
workOrderId: {
type: String,
default: '',
},
@ -121,8 +122,8 @@ export default {
unit: undefined
},
originList: [
{ label: 1, value: '内部'},
{ label: 2, value: '采购'}
{ label: '内部', value: 1},
{ label: '采购', value: 2}
],
supplierList: [],
dataRule: {
@ -142,13 +143,12 @@ export default {
},
init(id) {
this.dataForm.id = id || '';
console.log('1', this.dataForm.id)
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getCoreWOMa({
id: this.dataForm.id
}).then((res) => {
getCoreWOMa(this.dataForm.id).then((res) => {
this.dataForm = res.data
});
}
@ -162,7 +162,7 @@ export default {
if (this.dataForm.id) {
updateCoreWOMa({
...this.dataForm,
workOrderId: this.productId,
workOrderId: this.workOrderId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
@ -173,7 +173,7 @@ export default {
//
createCoreWOMa({
...this.dataForm,
workOrderId: this.productId,
workOrderId: this.workOrderId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;

View File

@ -0,0 +1,413 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-06 17:08:22
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div>
<h2>工单编码{{ dataForm.code }}</h2>
</div>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
基本信息
</small-title>
<div class="formContent">
<el-row :gutter="20">
<el-col :span="8">工单名称:{{ dataForm.name }}</el-col>
<el-col :span="8">工单来源:{{ dataForm.triggerOrigin === 1 ? 'MES' : dataForm.triggerOrigin === 2 ? 'ERP' : ''}}</el-col>
<el-col :span="8">所属订单:
<span v-for="(item, index) in orderArray" :key="index" style="margin-right: 10px">{{ item.name }}</span>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">产品名称:{{ dataForm.productName }}</el-col>
<el-col :span="8"> :{{ dataForm.specifications }}</el-col>
<el-col :span="8">计划生产数量:{{ dataForm.planQuantity }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">预计用时(小时):{{ dataForm.expectedTime }}</el-col>
<el-col :span="8">计划投入数量:{{ dataForm.planAssignQuantity }}</el-col>
<el-col :span="8">优先级:{{ fitlerP(dataForm.priority) }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">负责人:{{ dataForm.workers }}</el-col>
<el-col :span="8">关联产线:{{ dataForm.productLineNames }}</el-col>
<el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }}</el-col>
</el-row>
</div>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
生产信息
</small-title>
<div class="formContent">
<el-row :gutter="20">
<el-col :span="8">订单创建时间:
<span v-for="(item, index) in orderArray" :key="index" style="margin-right: 10px">{{ item.createTime }}</span>
</el-col>
<el-col :span="8">计划开始时间:{{ dataForm.planStartTime }}</el-col>
<el-col :span="8">计划完成时间:{{ dataForm.planFinishTime }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">预计结束时间:{{ dataForm.computeFinishTime }}</el-col>
<el-col :span="8">实际开始时间:{{ dataForm.startProduceTime }}</el-col>
<el-col :span="8">实际完成时间:{{ dataForm.finishProduceTime }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">工单状态:{{ fitlerS(dataForm.status) }}</el-col>
<el-col :span="8">实际投入数量:{{ dataForm.assignQuantity }}</el-col>
<el-col :span="8">实际生产数量:{{ dataForm.actualQuantity }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">废片数量:{{ dataForm.nokQuantity }}</el-col>
<el-col :span="8">检测瑕疵数:{{ 0 }}</el-col>
</el-row>
</div>
<div class="attr-list">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
订单相关信息
</small-title>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="orderList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<!-- <pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" /> -->
</div>
<div class="attr-list">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
预计用料信息
</small-title>
<base-table
:table-props="tableProps1"
:page="listQuery1.pageNo"
:limit="listQuery1.pageSize"
:table-data="materialList" />
<!-- <pagination
v-show="listQuery1.total > 0"
:total="listQuery1.total"
:page.sync="listQuery1.pageNo"
:limit.sync="listQuery1.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" /> -->
</div>
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
// import basicAdd from '../../core/mixins/basic-add';
import { getCoreWO, getMaterialBomPage, getConOrderList } from "@/api/base/coreWorkOrder";
import { orderList } from "@/api/base/orderManage";
import SmallTitle from './SmallTitle';
import { publicFormatter } from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'orderName',
label: '订单名称',
},
{
prop: 'orderCode',
label: '订单编码',
},
{
prop: 'priority',
label: '优先级',
filter: (val) => ['', '低', '正常', '高'][val]
},
{
prop: 'planAssignmentQuantity',
label: '计划分配数量',
},
{
prop: 'actualAssignmentQuantity',
label: '实际分配数量',
}
];
const tableProps1 = [
{
prop: 'materialName',
label: '原料名称'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'num',
label: '剩余生产预计消耗'
},
];
export default {
components: { SmallTitle },
data() {
return {
tableBtn,
tableProps,
tableProps1,
addOrUpdateVisible: false,
urlOptions: {
infoURL: getCoreWO
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
listQuery1: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataForm: {},
orderList: [],
materialList: [],
orderArray: [],
visible: false,
isdetail: false,
};
},
mounted() {},
methods: {
fitlerP(val) {
if (val) {
if (val === 1) {
return '低'
} else if (val === 2) {
return '正常'
} else {
return '高'
}
}
},
fitlerS(val) {
if (val) {
if (val === 1) {
return '等待'
} else if (val === 2) {
return '激活'
} else if (val === 3) {
return '暂停'
} else if (val === 4) {
return '完成'
} else {
return '作废'
}
}
},
initData() {
this.orderList.splice(0);
this.materialList.splice(0);
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCoreProductAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getConOrderList({
workOrderId: this.dataForm.id,
}).then((response) => {
this.orderList = response.data;
// this.listQuery.total = response.data.total;
});
// 使
if (this.dataForm.planProductId) {
getMaterialBomPage({
productId: this.dataForm.planProductId,
}).then((response) => {
this.materialList = response.data;
// this.listQuery.total = response.data.length;
});
}
//
orderList({
workOrderId: this.dataForm.id
}).then((response) => {
this.orderArray = response.data;
// this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
//
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
//
this.getList();
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
goback() {
this.visible = false;
this.$emit('refreshDataList');
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 10px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.formContent {
font-size: 16px;
line-height: 1.5;
margin-bottom: 10px;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -34,23 +34,32 @@
ref="addOrUpdate"
@refreshDataList="refreshWorkOrder"></add-work-order>
</base-dialog>
<!-- 预使用原料信息 -->
<add-or-update
v-if="materialVisible"
ref="material"
@refreshDataList="closeDetail"></add-or-update>
<!-- 查看详情 -->
<detail
v-if="detailVisible"
ref="detail"
@refreshDataList="closeDetail"></add-or-update>
@refreshDataList="closeDetail"></detail>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import AddWorkOrder from './addWorkOrder'
import Detail from './detail.vue';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreWOPage,
deleteCoreWO
deleteCoreWO,
statusChange
} from '@/api/base/coreWorkOrder';
const tableProps = [
{
prop: 'createTime',
@ -103,7 +112,8 @@ export default {
mixins: [basicPage],
components: {
AddWorkOrder,
AddOrUpdate
AddOrUpdate,
Detail
},
data() {
return {
@ -112,12 +122,23 @@ export default {
deleteURL: deleteCoreWO
},
detailVisible: false,
materialVisible: false,
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-work-order:update`)
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
name: 'status',
type: 'equal',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:material`)
@ -136,22 +157,94 @@ export default {
? {
type: 'delete',
btnName: '删除',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 1
}
]
}
}
: undefined,
// {
// type: 'equal',
// btnName: '',
// showParam: {
// type: '&',
// data: [
// {
// name: 'status',
// type: 'equal',
// value: 1
// }
// ]
// }
// }
{
type: 'active',
btnName: '激活',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 1
},
{
name: 'status',
type: 'equal',
value: 3
}
]
}
},
{
type: 'pause',
btnName: '暂停',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 2
}
]
}
},
{
type: 'nullify',
btnName: '作废',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 3
},
{
name: 'status',
type: 'equal',
value: 3
},
{
name: 'status',
type: 'equal',
value: 4
}
]
}
},
{
type: 'finish',
btnName: '完成',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 2
},
{
name: 'status',
type: 'equal',
value: 3
}
]
}
}
].filter((v)=>v),
tableData: [],
formConfig: [
@ -217,16 +310,59 @@ export default {
},
closeDetail() {
this.detailVisible = false
this.materialVisible = false
this.getDataList()
},
//
otherMethods(val) {
if (val.type === 'material') {
this.detailVisible = true;
this.materialVisible = true;
this.addOrEditTitle = "预使用主原料信息";
this.$nextTick(() => {
this.$refs.material.init(val.data, true);
});
} else if (val.type === 'detail') {
this.detailVisible = true;
this.addOrEditTitle = "详情";
this.$nextTick(() => {
this.$refs.detail.init(val.data.id, true);
});
} else {
const param = {
id: val.data.id,
status: undefined
}
if (val.type === 'active') {
param.status = 2
}
if (val.type === 'pause') {
param.status = 3
}
if (val.type === 'nullify') {
param.status = 9
}
if (val.type === 'finish') {
param.status = 4
}
console.log('22',val)
this.$confirm(`确定对${'[工单名称=' + val.data.name + ']'}进行${val.type}操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
statusChange(param).then(({ data }) => {
this.$message({
message: '暂停成功!',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
}
},
buttonClick(val) {

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-10-27 15:11:02
* @LastEditTime: 2023-11-06 19:44:24
* @Description:
-->
<template>
@ -56,6 +56,7 @@
v-model="dataForm.type"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择物料类型">
<el-option
v-for="dict in materialList"
@ -83,6 +84,7 @@
filterable
clearable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择供应商">
<el-option
v-for="dict in supplierList"
@ -100,9 +102,10 @@
v-model="dataForm.unit"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择物料单位">
<el-option
v-for="dict in unitList"
v-for="dict in getDictDatas('unit_dict')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
@ -172,6 +175,7 @@ import { listData } from "@/api/system/dict/data";
import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
import { getDictDatas } from "@/utils/dict";
const tableBtn = [
{
@ -265,17 +269,17 @@ export default {
const supplierRes = await getSupplierList();
this.supplierList = supplierRes.data;
//
const unitRes = await listData({
pageNo: 1,
pageSize: 99,
dictType: 'goods_unit',
});
this.unitList = unitRes.data.list.map(item => {
return {
label: item.label,
value: Number(item.value)
}
});
// const unitRes = await listData({
// pageNo: 1,
// pageSize: 99,
// dictType: 'goods_unit',
// });
// this.unitList = unitRes.data.list.map(item => {
// return {
// label: item.label,
// value: Number(item.value)
// }
// });
},
initData() {
this.materialAttrList.splice(0);
@ -341,6 +345,9 @@ export default {
//
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data;
if (this.dataForm.unit) {
this.dataForm.unit = String(this.dataForm.unit)
}
});
//
this.getList();

View File

@ -58,10 +58,6 @@ const tableProps = [
prop: 'engName',
label: '英文名称'
},
{
prop: 'abbr',
label: '缩写'
},
{
prop: 'materialType',
label: '物料类型'
@ -117,13 +113,13 @@ export default {
formConfig: [
{
type: 'input',
label: '关键字',
label: '物料名称',
placeholder: '物料名称',
param: 'name',
},
{
type: 'input',
label: '关键字',
label: '物料编码',
placeholder: '物料编码',
param: 'code',
},
@ -228,6 +224,27 @@ export default {
console.log(val);
}
},
//
deleteHandle(id, name, index) {
this.$confirm(`是否删除物料名称为"${name}"的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
}
},
};
</script>

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-10-24 18:34:07
* @LastEditTime: 2023-11-06 19:55:59
* @Description:
-->
<template>
@ -64,7 +64,7 @@ export default {
data() {
return {
urlOptions: {
isGetCode: true,
isGetCode: false,
codeURL: getCode,
createURL: createMaterialDate,
updateURL: updateMaterialDate,
@ -81,8 +81,8 @@ export default {
materialList: [],
dataRule: {
materialId: [{ required: true, message: "物料不能为空", trigger: "blur" }],
code: [{ required: true, message: "工厂编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "工厂名称不能为空", trigger: "blur" }],
code: [{ required: true, message: "批次号不能为空", trigger: "blur" }],
name: [{ required: true, message: "批次名称不能为空", trigger: "blur" }],
}
};
},

View File

@ -164,6 +164,27 @@ export default {
console.log(val);
}
},
//
deleteHandle(id, name, index) {
this.$confirm(`是否删除物料批次名称为"${name}"的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
}
},
};
</script>

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-10-27 16:06:44
* @LastEditTime: 2023-11-06 20:04:03
* @Description:
-->
<template>
@ -30,7 +30,9 @@
<el-select
v-model="dataForm.productId"
filterable
clearable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择产品">
<el-option
v-for="dict in productList"
@ -88,6 +90,7 @@
<el-select
v-model="scope.row.materialId"
filterable
clearable
:disabled="!scope.row.isEdit"
placeholder="请选择物料"
@change="setCode(scope.row)">
@ -125,7 +128,7 @@
<!-- <span>{{ item.btnName | i18nFilter }}</span> -->
</el-button>
</el-tooltip>
<el-button v-else type="primary" size="small" @click="saveData(scope.row)">保存</el-button>
<el-button v-else type="text" size="small" @click="saveData(scope.row)">保存</el-button>
<el-tooltip placement="top" content="删除">
<el-button
type="text"
@ -256,7 +259,7 @@ export default {
const unitRes = await listData({
pageNo: 1,
pageSize: 99,
dictType: 'goods_unit',
dictType: 'unit_dict',
});
this.unitList = unitRes.data.list.map(item => {
return {
@ -295,17 +298,17 @@ export default {
.catch(() => {});
},
setCode(row) {
this.materialList.filter(item => {
const tempM = this.materialList.filter(item => {
if (row.materialId === item.id) {
row.materialCode = item.code
}
this.unitList.filter(u => {
if (item.unit === u.value) {
row.unit = u.value
row.mUnit = u.label
}
})
// return row.materialId === item.id
return row.materialId === item.id
})
this.unitList.filter(u => {
if (tempM[0].unit === u.value) {
row.unit = u.value
row.mUnit = u.label
}
})
// row.materialCode = tempList[0].code
// row.unit = tempList[0].unit
@ -343,8 +346,7 @@ export default {
// Bom
getProBomList({
...this.listQuery,
bomId: this.dataForm.id,
createTime: ['2023-10-26 00:00:00', '2023-10-27 12:00:00']
bomId: this.dataForm.id
}).then((response) => {
this.tableData = response.data.records.map(item => {
this.unitList.filter(u => {
@ -450,7 +452,7 @@ export default {
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
max-height: 30vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */

View File

@ -97,16 +97,10 @@ export default {
formConfig: [
{
type: 'input',
label: '关键字',
placeholder: '物料名称',
label: '产品名称',
placeholder: '产品名称',
param: 'name',
},
{
type: 'input',
label: '关键字',
placeholder: '物料编码',
param: 'code',
},
{
type: 'button',
btnName: '查询',
@ -158,7 +152,6 @@ export default {
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.listQuery.code = val.code ? val.code : undefined;
this.getDataList();
break;
case 'reset':

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-10-26 09:43:51
* @LastEditTime: 2023-11-06 19:27:57
* @Description:
-->
<template>
@ -164,7 +164,7 @@ export default {
},
{
id: 2,
name: '自动'
name: 'PDA'
}
],
materialList: [],
@ -187,7 +187,6 @@ export default {
async getDictData() {
const materRes = await getMaterialList()
this.materialList = materRes.data
console.log('你好', this.materialList)
const dateRes = await getMaterDateList()
this.materialDateList = dateRes.data
const eqRes = await getEqListAll()
@ -252,6 +251,9 @@ export default {
return item.id === this.dataForm.materialId
})
this.dataForm.materialCode = tempMaterial[0].code
getMaterDateList({materialId: this.dataForm.materialId}).then(res =>{
this.materialDateList = res.data
})
}
},
};

View File

@ -56,7 +56,7 @@ const tableProps = [
label: '物料编码'
},
{
prop: 'materialDateId',
prop: 'materialDateName',
label: '物料批次'
},
{
@ -183,7 +183,6 @@ export default {
} else {
this.listQuery.useTime = []
}
console.log('222', this.listQuery, val.time)
this.getDataList();
break;
case 'reset':
@ -207,6 +206,22 @@ export default {
console.log(val);
}
},
//tableBtn
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.materialName, val.data._pageIndex)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
}
},
};
</script>

View File

@ -19,7 +19,7 @@
// import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
import { getProductionLinePage } from '@/api/core/base/productionLine';
// import { getProductionLinePage } from '@/api/core/base/productionLine';
import lineChart from '../LineChart'
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
@ -58,21 +58,20 @@ export default {
dataListLoading:false,
tableData: [],
listQuery: {
lineIds: [],
time: ''
// lineIds: [],
recordTime: []
},
dateLabelList: [],
optionArrUrl: [getProductionLinePage ],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineIds',
defaultSelect: '',
multiple:true,
filterable: true,
},
// {
// type: 'select',
// label: '线',
// selectOptions: [],
// param: 'lineIds',
// defaultSelect: '',
// multiple:true,
// filterable: true,
// },
{
type: 'datePicker',
label: '时间',
@ -94,22 +93,22 @@ export default {
};
},
created() {
this.getArr();
// this.getArr();
},
methods: {
getArr() {
const params = {
page: 1,
limit: 500,
};
this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => {
this.formConfig[index].selectOptions = response.data.list
// this.formConfig[0].defaultSelect = response.data.list[0].id
this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
});
});
},
// getArr() {
// const params = {
// page: 1,
// limit: 500,
// };
// this.optionArrUrl.forEach((item, index) => {
// item(params).then((response) => {
// this.formConfig[index].selectOptions = response.data.list
// // this.formConfig[0].defaultSelect = response.data.list[0].id
// this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
// });
// });
// },
getData() {
// this.listQuery.lineIds = ['1672847052717821953']
// this.listQuery.productId = val.productId;
@ -230,12 +229,26 @@ export default {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.lineIds = val.lineIds ? val.lineIds :undefined
// this.listQuery.productId = val.productId;
this.listQuery.time = val.time ? new Date(val.time).getTime() : undefined
// this.listQuery.pageNo = 1;
// this.listQuery.pageSize = 10;
// this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : undefined
if (val.time) {
const tempTtime = new Date(val.time)
let day = 0
switch (tempTtime.getMonth() + 1) {
case 1, 3, 5, 7, 8, 10, 12:
day = 31;
break;
case 2:
day = 28;
break;
case 4, 6, 9, 11:
day = 30;
break;
}
console.log(parseTime(new Date(tempTtime.getFullYear(), 11, 31, 23, 59, 59)))
this.listQuery.recordTime = [
val.time,
parseTime(new Date(tempTtime.getFullYear(), tempTtime.getMonth(), day, 23, 59, 59))
]
this.getData()
} else {
this.$message({

View File

@ -2,7 +2,7 @@
filename: index.vue
author: liubin
date: 2023-08-04 14:44:58
description: 设备24小时生产记录
description: 近24小时产线生产数据
-->
<template>
<div class="app-container">
@ -24,6 +24,7 @@
<script>
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
import { parseTime } from '../../mixins/code-filter';
export default {
name: 'productionLineData24',
@ -54,28 +55,32 @@ export default {
},
methods: {
/** 构建tableProps - 依据第一个元素所提供的信息 */
buildProps(plData) {
plData.forEach(item => {
this.timeList.push(item.name)
})
const timeArray = Array.from(new Set(this.timeList))
console.log('nihc', timeArray)
for (const times of timeArray) {
if (times !== '投入数量' && times !== '产出数量' && times !== '报废数量' && times !== '产出面积') {
const subprop = {
label: times.slice(0, 10) + ' ' + times.slice(11),
align: 'center',
children: [
{ prop: times + '_in', label: '投入数量' },
{ prop: times + '_out', label: '产出数量' },
{ prop: times + '_junk', label: '报废数量' },
{ prop: times + '_area', label: '产出面积' }
]
}
this.arr.push(subprop)
buildProps() {
//
var currentTime = new Date();
let timeArr = []
// 24--
for (let i = 0; i < 24; i ++) {
timeArr.unshift(new Date(currentTime.getFullYear(), currentTime.getMonth(), currentTime.getDate(), currentTime.getHours() - i, 0, 0).getTime())
}
console.log("24小时内的开始时间" + timeArr, timeArr.length);
for(const times of timeArr) {
const subprop = {
label: parseTime(times),
align: 'center',
children: [
{ prop: times + '_up', label: '上片数据' },
{ prop: times + '_down', label: '下片数据' },
{ prop: times + '_good', label: '良品面积' },
{ prop: times + '_bad', label: '报废数据' },
{ prop: times + '_percent', label: '报废比例(%)' }
]
}
this.arr.push(subprop)
}
this.tableProps = this.arr
console.log('111', this.tableProps)
},
setRowSpan(arr) {
let count = 0
@ -101,20 +106,11 @@ export default {
console.log('打印看下数据list', list)
list.forEach((ele, index) => {
let tempData = []
ele.data.forEach(item => {
item.children.forEach(params => {
if (params.dynamicName === '投入数量') {
tempData[item.dynamicName + '_in'] = params.dynamicValue
} else if (params.dynamicName === '产出数量') {
tempData[item.dynamicName + '_out'] = params.dynamicValue
} else if (params.dynamicName === '报废数量') {
tempData[item.dynamicName + '_junk'] = params.dynamicValue
} else {
tempData[item.dynamicName + '_area'] = params.dynamicValue
}
})
})
tempData['proLineName'] = ele.proLineName
tempData[ele.recordTime + '_up'] = ele.inputNum
tempData[ele.recordTime + '_down'] = ele.outputNum
tempData[ele.recordTime + '_up'] = ele.inputNum
tempData['proLineName'] = ele.lineName
tempData['workOrderName'] = ele.workOrderName
tempData['spec'] = ele.spec
this.tableData.push(tempData)
console.log('看看数据', this.tableData, tempData)
@ -151,17 +147,23 @@ export default {
prop: 'proLineName',
label: '生产线',
fixed: 'left',
showOverflowTooltip: true
'show-overflow-tooltip': true
},
{
prop: 'workOrderName',
label: '当前工单',
fixed: 'left',
'show-overflow-tooltip': true
},
{
prop: 'spec',
label: '产品规格',
fixed: 'left',
showOverflowTooltip: true
'show-overflow-tooltip': true
}
]
this.buildProps(res.data.nameData);
this.buildData(res.data.data);
this.buildProps();
this.buildData(res.data);
})
// // const data = this.res.data;

View File

@ -288,9 +288,13 @@ export default {
this.open = true;
this.title = '添加保养计划';
},
handleDetail(id){
alert('跳转到 保养记录')
},
handleDetail(id){
// alert(' ')
this.$router.push({
name: 'Record',
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();