projects/mes-dy #66

Merged
gtz217 merged 2 commits from projects/mes-dy into projects/mes-test 2023-11-07 15:55:56 +08:00
21 changed files with 827 additions and 588 deletions

View File

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

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-10-21 11:50:46 * @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-06 10:50:57 * @LastEditTime: 2023-11-06 17:49:42
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -109,3 +109,30 @@ export function getCoreWOMaPage(query) {
params: 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 * @Author: zhp
* @Date: 2023-09-12 14:07:04 * @Date: 2023-09-12 14:07:04
* @LastEditTime: 2023-09-13 09:53:45 * @LastEditTime: 2023-11-07 14:17:38
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
export function getYieldAnalysisPageData(data) { export function getYieldAnalysisPageData(query) {
return request({ return request({
url: '/analysis/production-analysis/getOutput', url: '/base/core-production-line-rec-day/monthList',
method: 'post', method: 'get',
data: data params: query
}) })
} }

View File

@ -1,17 +1,17 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-09-12 09:44:53 * @Date: 2023-09-12 09:44:53
* @LastEditTime: 2023-09-15 14:12:26 * @LastEditTime: 2023-11-06 18:57:05
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
// 获得近24小时产线生产数据 // 获得近24小时产线生产数据
export function getPdlDataOneDay(data) { export function getPdlDataOneDay(query) {
return request({ return request({
url: '/monitoring/production-monitor/getPdlDataOneDay', url: '/base/core-production-line-rec-hour/list24h',
method: 'post', method: 'get',
data: data 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 * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-06 10:01:37 * @LastEditTime: 2023-11-06 14:38:20
* @Description: * @Description:
--> -->
<template> <template>
@ -16,8 +16,8 @@
{{ '预使用主原料信息' }} {{ '预使用主原料信息' }}
</small-title> </small-title>
<div class="content"> <div class="content">
<div style="height: 15vh"> <div style="height: 10vh">
<div style="font-size: 18px;">工单名{{ workOrderName }}</div> <div style="font-size: 18px;">工单名{{ dataForm.name }}</div>
</div> </div>
<div class="attr-list"> <div class="attr-list">
@ -64,7 +64,7 @@
<attr-add <attr-add
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
:product-id="dataForm.id" :work-order-id="dataForm.id"
@refreshDataList="getList" /> @refreshDataList="getList" />
</el-drawer> </el-drawer>
</template> </template>
@ -136,7 +136,6 @@ export default {
tableBtn, tableBtn,
tableProps, tableProps,
topBtnConfig, topBtnConfig,
workOrderName: '111',
addOrUpdateVisible: false, addOrUpdateVisible: false,
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,
@ -144,7 +143,8 @@ export default {
total: 0, total: 0,
}, },
dataForm: { dataForm: {
id: undefined id: undefined,
name: ''
}, },
materialList: [], materialList: [],
visible: false, visible: false,
@ -199,10 +199,11 @@ export default {
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
}); });
}, },
init(id, isdetail) { init(row, isdetail) {
this.initData(); this.initData();
this.isdetail = isdetail || false; this.isdetail = isdetail || false;
this.dataForm.id = id || undefined; this.dataForm.id = row.id || undefined;
this.dataForm.name = row.name || '';
this.visible = true; this.visible = true;
this.getList() this.getList()
@ -237,6 +238,7 @@ export default {
// / // /
addNew(id) { addNew(id) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
console.log('22', id)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(id);
}); });

View File

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

View File

@ -75,6 +75,7 @@
<el-select <el-select
v-model="dataForm.unit" v-model="dataForm.unit"
filterable filterable
style="width: 100%"
placeholder="请选择单位"> placeholder="请选择单位">
<el-option <el-option
v-for="dict in getDictDatas('unit_dict')" v-for="dict in getDictDatas('unit_dict')"
@ -103,7 +104,7 @@ import { getDictDatas} from "@/utils/dict";
export default { export default {
props: { props: {
productId: { workOrderId: {
type: String, type: String,
default: '', default: '',
}, },
@ -121,8 +122,8 @@ export default {
unit: undefined unit: undefined
}, },
originList: [ originList: [
{ label: 1, value: '内部'}, { label: '内部', value: 1},
{ label: 2, value: '采购'} { label: '采购', value: 2}
], ],
supplierList: [], supplierList: [],
dataRule: { dataRule: {
@ -142,13 +143,12 @@ export default {
}, },
init(id) { init(id) {
this.dataForm.id = id || ''; this.dataForm.id = id || '';
console.log('1', this.dataForm.id)
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields(); this.$refs['dataForm'].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
getCoreWOMa({ getCoreWOMa(this.dataForm.id).then((res) => {
id: this.dataForm.id
}).then((res) => {
this.dataForm = res.data this.dataForm = res.data
}); });
} }
@ -162,7 +162,7 @@ export default {
if (this.dataForm.id) { if (this.dataForm.id) {
updateCoreWOMa({ updateCoreWOMa({
...this.dataForm, ...this.dataForm,
workOrderId: this.productId, workOrderId: this.workOrderId,
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess('修改成功');
this.visible = false; this.visible = false;
@ -173,7 +173,7 @@ export default {
// //
createCoreWOMa({ createCoreWOMa({
...this.dataForm, ...this.dataForm,
workOrderId: this.productId, workOrderId: this.workOrderId,
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.visible = false; 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" ref="addOrUpdate"
@refreshDataList="refreshWorkOrder"></add-work-order> @refreshDataList="refreshWorkOrder"></add-work-order>
</base-dialog> </base-dialog>
<!-- 预使用原料信息 -->
<add-or-update <add-or-update
v-if="materialVisible"
ref="material"
@refreshDataList="closeDetail"></add-or-update>
<!-- 查看详情 -->
<detail
v-if="detailVisible" v-if="detailVisible"
ref="detail" ref="detail"
@refreshDataList="closeDetail"></add-or-update> @refreshDataList="closeDetail"></detail>
</div> </div>
</template> </template>
<script> <script>
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import AddWorkOrder from './addWorkOrder' import AddWorkOrder from './addWorkOrder'
import Detail from './detail.vue';
import basicPage from '../../core/mixins/basic-page'; import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
import { import {
getCoreWOPage, getCoreWOPage,
deleteCoreWO deleteCoreWO,
statusChange
} from '@/api/base/coreWorkOrder'; } from '@/api/base/coreWorkOrder';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
@ -103,7 +112,8 @@ export default {
mixins: [basicPage], mixins: [basicPage],
components: { components: {
AddWorkOrder, AddWorkOrder,
AddOrUpdate AddOrUpdate,
Detail
}, },
data() { data() {
return { return {
@ -112,12 +122,23 @@ export default {
deleteURL: deleteCoreWO deleteURL: deleteCoreWO
}, },
detailVisible: false, detailVisible: false,
materialVisible: false,
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:core-work-order:update`) this.$auth.hasPermi(`base:core-work-order:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
showParam: {
type: '&',
data: [
{
name: 'status',
type: 'equal',
value: 1
}
]
}
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:core-work-order:material`) this.$auth.hasPermi(`base:core-work-order:material`)
@ -136,22 +157,94 @@ export default {
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 1
}
]
}
} }
: undefined, : undefined,
// { {
// type: 'equal', type: 'active',
// btnName: '', btnName: '激活',
// showParam: { showParam: {
// type: '&', type: '|',
// data: [ data: [
// { {
// name: 'status', name: 'status',
// type: 'equal', type: 'equal',
// value: 1 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), ].filter((v)=>v),
tableData: [], tableData: [],
formConfig: [ formConfig: [
@ -217,16 +310,59 @@ export default {
}, },
closeDetail() { closeDetail() {
this.detailVisible = false this.detailVisible = false
this.materialVisible = false
this.getDataList() this.getDataList()
}, },
// //
otherMethods(val) { otherMethods(val) {
if (val.type === 'material') { if (val.type === 'material') {
this.detailVisible = true; this.materialVisible = true;
this.addOrEditTitle = "预使用主原料信息"; this.addOrEditTitle = "预使用主原料信息";
this.$nextTick(() => {
this.$refs.material.init(val.data, true);
});
} else if (val.type === 'detail') {
this.detailVisible = true;
this.addOrEditTitle = "详情";
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.detail.init(val.data.id, true); 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) { buttonClick(val) {

View File

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

View File

@ -58,10 +58,6 @@ const tableProps = [
prop: 'engName', prop: 'engName',
label: '英文名称' label: '英文名称'
}, },
{
prop: 'abbr',
label: '缩写'
},
{ {
prop: 'materialType', prop: 'materialType',
label: '物料类型' label: '物料类型'
@ -117,13 +113,13 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '关键字', label: '物料名称',
placeholder: '物料名称', placeholder: '物料名称',
param: 'name', param: 'name',
}, },
{ {
type: 'input', type: 'input',
label: '关键字', label: '物料编码',
placeholder: '物料编码', placeholder: '物料编码',
param: 'code', param: 'code',
}, },
@ -228,6 +224,27 @@ export default {
console.log(val); 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> </script>

View File

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

View File

@ -164,6 +164,27 @@ export default {
console.log(val); 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> </script>

View File

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

View File

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

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-10-26 09:43:51 * @LastEditTime: 2023-11-06 19:27:57
* @Description: * @Description:
--> -->
<template> <template>
@ -164,7 +164,7 @@ export default {
}, },
{ {
id: 2, id: 2,
name: '自动' name: 'PDA'
} }
], ],
materialList: [], materialList: [],
@ -187,7 +187,6 @@ export default {
async getDictData() { async getDictData() {
const materRes = await getMaterialList() const materRes = await getMaterialList()
this.materialList = materRes.data this.materialList = materRes.data
console.log('你好', this.materialList)
const dateRes = await getMaterDateList() const dateRes = await getMaterDateList()
this.materialDateList = dateRes.data this.materialDateList = dateRes.data
const eqRes = await getEqListAll() const eqRes = await getEqListAll()
@ -252,6 +251,9 @@ export default {
return item.id === this.dataForm.materialId return item.id === this.dataForm.materialId
}) })
this.dataForm.materialCode = tempMaterial[0].code 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: '物料编码' label: '物料编码'
}, },
{ {
prop: 'materialDateId', prop: 'materialDateName',
label: '物料批次' label: '物料批次'
}, },
{ {
@ -183,7 +183,6 @@ export default {
} else { } else {
this.listQuery.useTime = [] this.listQuery.useTime = []
} }
console.log('222', this.listQuery, val.time)
this.getDataList(); this.getDataList();
break; break;
case 'reset': case 'reset':
@ -207,6 +206,22 @@ export default {
console.log(val); 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> </script>

View File

@ -19,7 +19,7 @@
// import basicPage from '../../mixins/basic-page'; // import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter';
import { getYieldAnalysisPageData } from '@/api/core/analysis/index'; 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 lineChart from '../LineChart'
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; // import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
@ -58,21 +58,20 @@ export default {
dataListLoading:false, dataListLoading:false,
tableData: [], tableData: [],
listQuery: { listQuery: {
lineIds: [], // lineIds: [],
time: '' recordTime: []
}, },
dateLabelList: [], dateLabelList: [],
optionArrUrl: [getProductionLinePage ],
formConfig: [ formConfig: [
{ // {
type: 'select', // type: 'select',
label: '产线', // label: '线',
selectOptions: [], // selectOptions: [],
param: 'lineIds', // param: 'lineIds',
defaultSelect: '', // defaultSelect: '',
multiple:true, // multiple:true,
filterable: true, // filterable: true,
}, // },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '时间',
@ -94,22 +93,22 @@ export default {
}; };
}, },
created() { created() {
this.getArr(); // this.getArr();
}, },
methods: { methods: {
getArr() { // getArr() {
const params = { // const params = {
page: 1, // page: 1,
limit: 500, // limit: 500,
}; // };
this.optionArrUrl.forEach((item, index) => { // this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => { // item(params).then((response) => {
this.formConfig[index].selectOptions = response.data.list // this.formConfig[index].selectOptions = response.data.list
// this.formConfig[0].defaultSelect = response.data.list[0].id // // this.formConfig[0].defaultSelect = response.data.list[0].id
this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id) // this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
}); // });
}); // });
}, // },
getData() { getData() {
// this.listQuery.lineIds = ['1672847052717821953'] // this.listQuery.lineIds = ['1672847052717821953']
// this.listQuery.productId = val.productId; // this.listQuery.productId = val.productId;
@ -230,12 +229,26 @@ export default {
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.lineIds = val.lineIds ? val.lineIds :undefined // this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : 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;
if (val.time) { 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() this.getData()
} else { } else {
this.$message({ this.$message({

View File

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

View File

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