Merge pull request '更新bug' (#412) from projects/mes-zwq into projects/mes-test

Reviewed-on: #412
This commit is contained in:
朱文强 2024-12-27 15:39:23 +08:00
commit baede9ef34
17 changed files with 693 additions and 485 deletions

View File

@ -1,8 +1,8 @@
/* /*
* @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-15 17:19:19 * @LastEditTime: 2024-12-27 15:20:14
* @LastEditors: DY * @LastEditors: zwq
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@ -170,3 +170,11 @@ export function updateBatch(data) {
data: data data: data
}) })
} }
// 更新订单表与工单关联表 多对多
export function updateConCoreWOr(data) {
return request({
url: '/base/core-order-con-work-order/update',
method: 'put',
data: data
})
}

View File

@ -23,6 +23,13 @@ export function getItemPageData(data) {
}) })
} }
export function getByEquId(id) {
return request({
url: '/base/equipment-maintain-program/getByEquId?id=' + id,
method: 'get',
})
}
export function getItemData(id) { export function getItemData(id) {
return request({ return request({
url: 'base/equipment-maintain-program/get?id=' + id, url: 'base/equipment-maintain-program/get?id=' + id,

View File

@ -37,7 +37,7 @@
<script> <script>
import { createPlanDet, updatePlanDet, getPlanDet } from '@/api/equipment/base/maintain/planconfig'; import { createPlanDet, updatePlanDet, getPlanDet } from '@/api/equipment/base/maintain/planconfig';
import { getEquipmentPage } from '@/api/base/equipment' import { getEquipmentPage } from '@/api/base/equipment'
import { getItemPageData } from '@/api/equipment/base/maintain/items'; import { getByEquId } from '@/api/equipment/base/maintain/items';
export default { export default {
props: { props: {
@ -94,20 +94,14 @@ export default {
}); });
}, },
async handleChange(val) { async handleChange(val) {
console.log(val); // let equipmentTypeId = undefined
let equipmentTypeId = undefined // this.eqList.forEach((ele) => {
this.eqList.forEach((ele) => { // if (ele.id == val) {
if (ele.id == val) { // equipmentTypeId = ele.equipmentTypeId
equipmentTypeId = ele.equipmentTypeId // }
} // })
}) const { code, data } = await getByEquId(val)
const { code, data } = await getItemPageData({ this.programList = data
pageNo: 1,
pageSize: 99,
equipmentTypeId: equipmentTypeId,
})
this.programList = data.list
console.log(data);
}, },
handleDecChange(val) { handleDecChange(val) {
let maintenanceDes = undefined let maintenanceDes = undefined

View File

@ -70,6 +70,12 @@ import { getList,} from "@/api/base/qualityScrapType";
export default { export default {
mixins: [basicAdd], mixins: [basicAdd],
props: {
mainId: {
type: String,
},
},
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -96,7 +102,7 @@ export default {
id: undefined, id: undefined,
program: undefined, program: undefined,
resultType: undefined, resultType: undefined,
equipmentTypeId: undefined, mainId:this.mainId,
minValue: undefined, minValue: undefined,
maxValue: undefined, maxValue: undefined,
maintainResult:undefined, maintainResult:undefined,
@ -117,7 +123,6 @@ export default {
}, },
mounted() { mounted() {
this.getDict() this.getDict()
console.log('我看看', this.dataForm)
}, },
methods: { methods: {
handleClear() { handleClear() {

View File

@ -1,8 +1,8 @@
/* /*
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: zhp * @LastEditors: zwq
* @LastEditTime: 2024-07-19 14:47:02 * @LastEditTime: 2024-12-13 15:50:49
* @Description: * @Description:
*/ */
export default { export default {
@ -28,10 +28,8 @@ export default {
activated() { activated() {
}, },
methods: { methods: {
init(obj) { init(id) {
console.log(obj); this.dataForm.id = id || "";
this.dataForm.id = obj.id || "";
this.dataForm.equipmentTypeId = obj.equipmentTypeId || "";
this.visible = true; this.visible = true;
if (this.urlOptions.getOption) { if (this.urlOptions.getOption) {
this.getArr() this.getArr()

View File

@ -1,8 +1,8 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-07-19 09:49:22 * @Date: 2024-07-19 09:49:22
* @LastEditTime: 2024-07-22 09:17:31 * @LastEditTime: 2024-12-13 15:52:24
* @LastEditors: zhp * @LastEditors: zwq
* @Description: * @Description:
*/ */
export default { export default {
@ -88,12 +88,8 @@ export default {
if (val.type === "edit") { if (val.type === "edit") {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑" this.addOrEditTitle = "编辑"
let obj = {
id: val.data.id,
equipmentTypeId:val.data.equipmentTypeId
}
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(obj); this.$refs.addOrUpdate.init(val.data.id);
}); });
} else if (val.type === "delete") { } else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.program, val.data._pageIndex) this.deleteHandle(val.data.id, val.data.program, val.data._pageIndex)

View File

@ -186,7 +186,7 @@ export default {
handleDetail(row) { handleDetail(row) {
this.showDetailVisible = true this.showDetailVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.showDetail.init(row.equipmentTypeId) this.$refs.showDetail.init(row.id)
}) })
// alert(' ') // alert(' ')
// console.log(row) // console.log(row)

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-07-12 13:28:21 * @Date: 2024-07-12 13:28:21
* @LastEditTime: 2024-07-23 14:00:38 * @LastEditTime: 2024-12-13 16:03:29
* @LastEditors: zhp * @LastEditors: zwq
* @Description: * @Description:
--> -->
<template> <template>
@ -22,7 +22,7 @@
</el-drawer> </el-drawer>
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel" <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel" width="30%"> @confirm="handleConfirm" :before-close="handleCancel" width="30%">
<add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update> <add-or-update ref="addOrUpdate" @refreshDataList="successSubmit" :main-id="queryParams.mainId"></add-or-update>
</base-dialog> </base-dialog>
</div> </div>
@ -74,7 +74,7 @@ export default {
queryParams: { queryParams: {
pageNo:1, pageNo:1,
pageSize:10, pageSize:10,
equipmentTypeId:null, mainId:null,
}, },
tableProps, tableProps,
basePath: 'base/equipment-maintain-program', basePath: 'base/equipment-maintain-program',
@ -105,21 +105,18 @@ export default {
}, },
getDataList(id) { getDataList(id) {
this.dataListLoading = true; this.dataListLoading = true;
this.queryParams.equipmentTypeId = id this.queryParams.mainId = id
this.urlOptions.getDataListURL(this.listQuery).then(response => { this.urlOptions.getDataListURL(this.queryParams).then(response => {
this.tableData = response.data.list; this.tableData = response.data.list;
this.listQuery.total = response.data.total; this.queryParams.total = response.data.total;
this.dataListLoading = false this.dataListLoading = false
}); });
}, },
handleAdd() { handleAdd() {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.addOrEditTitle = '新增' this.addOrEditTitle = '新增'
let obj = {
equipmentTypeId: this.queryParams.equipmentTypeId
}
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(obj) this.$refs.addOrUpdate.init()
}); });
}, },
init(id) { init(id) {

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: zwq * @LastEditors: zwq
* @LastEditTime: 2024-08-14 15:24:11 * @LastEditTime: 2024-12-12 09:54:25
* @Description: * @Description:
--> -->
<template> <template>
@ -83,7 +83,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" v-if="showTime"> <el-col :span="8" v-if="showTime">
<el-form-item label="生产单位用时" prop="processTime"> <el-form-item label="生产单位用时(s)" prop="processTime">
<el-input <el-input
v-model.number="dataForm.processTime" v-model.number="dataForm.processTime"
type="number" type="number"

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2024-07-01 14:54:06 * @Date: 2024-07-01 14:54:06
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-08-21 11:19:51 * @LastEditTime: 2024-12-16 10:03:30
* @Description: * @Description:
--> -->
<template> <template>
@ -346,6 +346,7 @@ export default {
this.listQuery.typeId = data.id || undefined; this.listQuery.typeId = data.id || undefined;
this.listQuery.product = data.product; this.listQuery.product = data.product;
this.$refs.searchBarForm.formInline.type = data.name || undefined; this.$refs.searchBarForm.formInline.type = data.name || undefined;
this.getDataList()
}, },
// //
append(data) { append(data) {

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: zwq * @LastEditors: zwq
* @LastEditTime: 2024-10-14 09:26:53 * @LastEditTime: 2024-12-12 16:13:11
* @Description: * @Description:
--> -->
<template> <template>
@ -41,18 +41,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="物料批次" prop="materialDateId"> <el-form-item label="物料批次" prop="materialDate">
<el-select <el-select
v-model="dataForm.materialDateId" v-model="dataForm.materialDate"
clearable clearable
filterable filterable
allow-create
placeholder="请选择物料批次" placeholder="请选择物料批次"
style="width: 100%"> style="width: 100%">
<el-option <el-option
v-for="dict in materialDateList" v-for="dict in materialDateList"
:key="dict.id" :key="dict.id"
:label="dict.code" :label="dict.code"
:value="dict.id" /> :value="dict.code" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -164,7 +165,7 @@ export default {
id: undefined, id: undefined,
materialId: undefined, materialId: undefined,
materialCode: undefined, materialCode: undefined,
materialDateId: undefined, materialDate: undefined,
equipmentId: undefined, equipmentId: undefined,
userName: undefined, userName: undefined,
userNames: [], userNames: [],
@ -208,15 +209,17 @@ export default {
methods: { methods: {
async getDictData() { async getDictData() {
const materRes = await getMaterialTree(); // const materRes = await getMaterialTree(); //
let typeId = materRes.data.find(item=>item.product === 0).id let typeId = materRes.data.find((item) => item.product === 0).id;
const listQuery = { const listQuery = {
typeId:typeId typeId: typeId,
} };
const materData = await getMaterialList(listQuery); const materData = await getMaterialList(listQuery);
this.materialList = []; this.materialList = [];
this.materialList = materData.data; this.materialList = materData.data;
if (!this.dataForm.id) {
const dateRes = await getMaterDateList(); const dateRes = await getMaterDateList();
this.materialDateList = dateRes.data; this.materialDateList = dateRes.data;
}
const eqRes = await getEqListAll(); const eqRes = await getEqListAll();
this.eqList = eqRes.data; this.eqList = eqRes.data;
const workerRes = await listSimpleUsers(); const workerRes = await listSimpleUsers();
@ -257,7 +260,7 @@ export default {
this.dataForm.id = response.data.id; this.dataForm.id = response.data.id;
this.dataForm.materialCode = response.data.materialCode; this.dataForm.materialCode = response.data.materialCode;
this.dataForm.materialId = response.data.materialId; this.dataForm.materialId = response.data.materialId;
this.dataForm.materialDateId = response.data.materialDateId; this.dataForm.materialDate = response.data.materialDateName;
this.dataForm.equipmentId = response.data.equipmentId; this.dataForm.equipmentId = response.data.equipmentId;
this.dataForm.useTime = response.data.useTime; this.dataForm.useTime = response.data.useTime;
// this.dataForm.userName = response.data.userName // this.dataForm.userName = response.data.userName
@ -265,6 +268,11 @@ export default {
this.dataForm.source = response.data.source; this.dataForm.source = response.data.source;
this.dataForm.remark = response.data.remark; this.dataForm.remark = response.data.remark;
this.dataForm.userNames = response.data.userName.split(','); this.dataForm.userNames = response.data.userName.split(',');
getMaterDateList({ materialId: this.dataForm.materialId }).then(
(res) => {
this.materialDateList = res.data;
}
);
}); });
} else { } else {
} }

View File

@ -2,21 +2,26 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-11-19 16:49:09 * @LastEditTime: 2024-12-27 15:34:28
* @Description: * @Description:
--> -->
<template> <template>
<div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column"> <div
<el-row v-show="workOrderButton.length !== 0" class="" style=" class="status-timegraph-container"
margin-bottom: 4px; style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
border-radius: 8px; <el-row
"> v-show="workOrderButton.length !== 0"
<workOrderNav :id-list="workOrderButton" @getWorkOrderId="getId"> class=""
</workOrderNav> style="margin-bottom: 4px; border-radius: 8px">
<workOrderNav
:id-list="workOrderButton"
@getWorkOrderId="getId"></workOrderNav>
</el-row> </el-row>
<el-row class="" style=" <el-row
class=""
style="
height: 1px; height: 1px;
flex: .3; flex: 0.3;
margin-bottom: 12px; margin-bottom: 12px;
background: #fff; background: #fff;
padding: 16px; padding: 16px;
@ -26,41 +31,123 @@
"> ">
<div class="content"> <div class="content">
<div> <div>
<h1 class='orderTitle'>工单编码{{ dataForm.code }}</h1> <h1 class="orderTitle">工单编码{{ dataForm.code }}</h1>
<el-button type="primary" plain style='position: absolute;right: 16px;top:5px' v-show="workOrderButton.length === 0" @click='goWorkOrderList()'><svg-icon icon-class="return" />返回</el-button> <el-button
type="primary"
plain
style="position: absolute; right: 16px; top: 5px"
v-show="workOrderButton.length === 0"
@click="goWorkOrderList()">
<svg-icon icon-class="return" />
返回
</el-button>
</div> </div>
<small-title style="margin: 16px 0" size="sm" :no-padding="true"> <small-title style="margin: 16px 0" size="sm" :no-padding="true">
基本信息 基本信息
</small-title> </small-title>
<div class="formContent"> <div class="formContent">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"><p class='title'>工单名称</p><p class='text'>{{ dataForm.name }}</p></el-col> <el-col :span="4">
<el-col :span="4"><p class='title'>工单来源</p><p class='text'>{{ dataForm.triggerOrigin === 1 ? 'MES-手动' : (dataForm.triggerOrigin === 2 ? 'MES-订单下发' : (dataForm.triggerOrigin === 3 ? 'ERP' : ''))}}</p> <p class="title">工单名称</p>
<p class="text">{{ dataForm.name }}</p>
</el-col> </el-col>
<el-col :span="4"><p class='title'>所属订单</p> <el-col :span="4">
<p class='text' style='overflow: hidden;white-space: nowrap;text-overflow: ellipsis;' :title="orderList.map(item => item.orderName).join(', ')">{{ orderList.map(item => item.orderName).join(', ') }}</p> <p class="title">工单来源</p>
<p class="text">
{{
dataForm.triggerOrigin === 1
? 'MES-手动'
: dataForm.triggerOrigin === 2
? 'MES-订单下发'
: dataForm.triggerOrigin === 3
? 'ERP'
: ''
}}
</p>
</el-col> </el-col>
<el-col :span="4"><p class='title'>产品名称</p><p class='text'>{{ dataForm.productName }}</p></el-col> <el-col :span="4">
<el-col :span="4"><p class='title'> </p><p class='text'>{{ dataForm.specifications }}</p></el-col> <p class="title">所属订单</p>
<el-col :span="4"><p class='title'>计划生产数量</p><p class='text'>{{ dataForm.planQuantity }}</p></el-col> <p
<el-col :span="4"><p class='title'>预计用时(小时)</p><p class='text'>{{ dataForm.remainingTime }}</p></el-col> class="text"
<el-col :span="4"><p class='title'>计划投入数量</p><p class='text'>{{ dataForm.planAssignQuantity }}</p></el-col> style="
<el-col :span="4"><p class='title'>优先级</p><p class='text'> {{ fitlerP(dataForm.priority) }}</p></el-col> overflow: hidden;
<el-col :span="4"><p class='title'>负责人</p><p class='text'>{{ dataForm.workers }}</p></el-col> white-space: nowrap;
<el-col :span="4"><p class='title'>关联产线</p> text-overflow: ellipsis;
<p class='text'><span v-for="(item, index) in dataForm.productLineIds" :key="index" style="margin-right: 10px">{{ item.lineName "
}}</span></p> :title="orderList.map((item) => item.orderName).join(', ')">
{{ orderList.map((item) => item.orderName).join(', ') }}
</p>
</el-col>
<el-col :span="4">
<p class="title">产品名称</p>
<p class="text">{{ dataForm.productName }}</p>
</el-col>
<el-col :span="4">
<p class="title"> </p>
<p class="text">{{ dataForm.specifications }}</p>
</el-col>
<el-col :span="4">
<p class="title">计划生产数量</p>
<p class="text">{{ dataForm.planQuantity }}</p>
</el-col>
<el-col :span="4">
<p class="title">预计用时(小时)</p>
<p class="text">{{ dataForm.remainingTime }}</p>
</el-col>
<el-col :span="4">
<p class="title">计划投入数量</p>
<p class="text">{{ dataForm.planAssignQuantity }}</p>
</el-col>
<el-col :span="4">
<p class="title">优先级</p>
<p class="text">{{ fitlerP(dataForm.priority) }}</p>
</el-col>
<el-col :span="4">
<p class="title">负责人</p>
<p class="text">{{ dataForm.workers }}</p>
</el-col>
<el-col :span="4">
<p class="title">关联产线</p>
<p class="text">
<span
v-for="(item, index) in dataForm.productLineIds"
:key="index"
style="margin-right: 10px">
{{ item.lineName }}
</span>
</p>
</el-col>
<el-col :span="4">
<p class="title">物料计算方式</p>
<p class="text">
{{
dataForm.materialMethod === 1
? '产品基础'
: dataForm.materialMethod === 2
? '工艺扩展'
: ''
}}
</p>
</el-col> </el-col>
<el-col :span="4"><p class='title'>物料计算方式</p><p class='text'>{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展'
:
'' }}</p></el-col>
<el-col :span="4"><p class='title'>关联工艺</p><p class='text'>{{ dataForm.processFlowName }}</p></el-col> <el-col :span="4">
<p class="title">关联工艺</p>
<p class="text">
<span
v-for="(item, index) in dataForm.productLineIds"
:key="index"
style="margin-right: 10px">
{{ item.processFlowName }}
</span>
</p>
</el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
</el-row> </el-row>
<el-row class="" style=" <el-row
class=""
style="
height: 1px; height: 1px;
flex: 1; flex: 1;
margin-bottom: 12px; margin-bottom: 12px;
@ -74,45 +161,108 @@
<el-tab-pane label="生产信息" name="produce"> <el-tab-pane label="生产信息" name="produce">
<div class="formContent"> <div class="formContent">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"><p class='title'>工单创建时间</p><p class='text'>{{ parseTime(dataForm.createTime) }}</p></el-col> <el-col :span="4">
<el-col :span="4"><p class='title'>计划开始时间</p><p class='text'>{{ parseTime(dataForm.planStartTime) }}</p></el-col> <p class="title">工单创建时间</p>
<el-col :span="4"><p class='title'>计划完成时间</p><p class='text'>{{ parseTime(dataForm.planFinishTime) }}</p></el-col> <p class="text">{{ parseTime(dataForm.createTime) }}</p>
<el-col :span="4"><p class='title'>预计结束时间</p><p class='text'>{{ parseTime(dataForm.expectedFinishTime) }}</p></el-col> </el-col>
<el-col :span="4"><p class='title'>实际开始时间</p><p class='text'>{{ parseTime(dataForm.startProduceTime) }}</p></el-col> <el-col :span="4">
<el-col :span="4"><p class='title'>实际完成时间</p><p class='text'>{{ parseTime(dataForm.finishProduceTime) }}</p></el-col> <p class="title">计划开始时间</p>
<el-col :span="4"><p class='title'>工单状态</p><p class='text'>{{ fitlerS(dataForm.status) }}</p></el-col> <p class="text">{{ parseTime(dataForm.planStartTime) }}</p>
<el-col :span="4"><p class='title'>实际投入数量</p><p class='text'>{{ dataForm.assignQuantity }}</p></el-col> </el-col>
<el-col :span="4"><p class='title'>实际生产数量</p><p class='text'>{{ dataForm.actualQuantity }}</p></el-col> <el-col :span="4">
<el-col :span="4"><p class='title'>废片数量</p><p class='text'>{{ dataForm.nokQuantity }}</p></el-col> <p class="title">计划完成时间</p>
<el-col :span="4"><p class='title'>检测瑕疵数</p><p class='text'>{{ dataForm.unpassCheckNum }}</p></el-col> <p class="text">{{ parseTime(dataForm.planFinishTime) }}</p>
</el-col>
<el-col :span="4">
<p class="title">预计结束时间</p>
<p class="text">{{ parseTime(dataForm.expectedFinishTime) }}</p>
</el-col>
<el-col :span="4">
<p class="title">实际开始时间</p>
<p class="text">{{ parseTime(dataForm.startProduceTime) }}</p>
</el-col>
<el-col :span="4">
<p class="title">实际完成时间</p>
<p class="text">{{ parseTime(dataForm.finishProduceTime) }}</p>
</el-col>
<el-col :span="4">
<p class="title">工单状态</p>
<p class="text">{{ fitlerS(dataForm.status) }}</p>
</el-col>
<el-col :span="4">
<p class="title">实际投入数量</p>
<p class="text">{{ dataForm.assignQuantity }}</p>
</el-col>
<el-col :span="4">
<p class="title">实际生产数量</p>
<p class="text">{{ dataForm.actualQuantity }}</p>
</el-col>
<el-col :span="4">
<p class="title">废片数量</p>
<p class="text">{{ dataForm.nokQuantity }}</p>
</el-col>
<el-col :span="4">
<p class="title">检测瑕疵数</p>
<p class="text">{{ dataForm.unpassCheckNum }}</p>
</el-col>
</el-row> </el-row>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="订单信息" name="order"> <el-tab-pane label="订单信息" name="order">
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" <base-table
:limit="listQuery.pageSize" :table-data="orderList"> :max-height="tableH"
<method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" :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" /> @clickBtn="handleClick" />
</base-table> </base-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="预计用料" name="material"> <el-tab-pane label="预计用料" name="material">
<base-table :max-height="tableH" :table-props="tableProps1" :page="listQuery1.pageNo" <base-table
:limit="listQuery1.pageSize" :table-data="materialList" /> :max-height="tableH"
:table-props="tableProps1"
:page="listQuery1.pageNo"
:limit="listQuery1.pageSize"
:table-data="materialList" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="质量信息" name="quality"> <el-tab-pane label="质量信息" name="quality">
<base-table :max-height="tableH" :table-props="tablePropsQuality" :table-data="qualityList" :page="1" <span style="font-size: 14px;">该工单未通过检测数合计:{{ allSumScrap }}</span>
<base-table
:max-height="tableH"
:table-props="tablePropsQuality"
:table-data="qualityList"
:page="1"
:limit="10" /> :limit="10" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="能源信息" name="energy"> <el-tab-pane label="能源信息" name="energy">
<div class="toggleTabBox"> <div class="toggleTabBox">
<div :class="{ active: activeModule === 'dataList' }" @click="toggleTab('dataList')">数据列表</div> <div
<div :class="{ active: activeModule === 'barChart' }" @click="toggleTab('barChart')">柱状图</div> :class="{ active: activeModule === 'dataList' }"
@click="toggleTab('dataList')">
数据列表
</div>
<div
:class="{ active: activeModule === 'barChart' }"
@click="toggleTab('barChart')">
柱状图
</div>
</div> </div>
<div> <div>
<div v-show="activeModule === 'dataList'"> <div v-show="activeModule === 'dataList'">
<!-- 表格 --> <!-- 表格 -->
<base-table :max-height="tableH" :table-props="tablePropsEnergy" :page="listQueryEnergy.pageNo" <base-table
:limit="listQueryEnergy.pageSize" :table-data="energyList" /> :max-height="tableH"
:table-props="tablePropsEnergy"
:page="listQueryEnergy.pageNo"
:limit="listQueryEnergy.pageSize"
:table-data="energyList" />
</div> </div>
<!-- 图形 --> <!-- 图形 -->
<div v-show="activeModule === 'barChart'"> <div v-show="activeModule === 'barChart'">
@ -121,7 +271,6 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-row> </el-row>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
@ -137,19 +286,23 @@
<script> <script>
// import basicAdd from '../../core/mixins/basic-add'; // import basicAdd from '../../core/mixins/basic-add';
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById,getMaterialCostWorkOrder } from "@/api/base/coreWorkOrder";
import tableHeightMixin from '@/mixins/tableHeightMixin';
import { getOrderEnergyData } from "@/api/monitoring/orderEnergy";
// import { orderList } from "@/api/base/orderManage";
import { import {
getStatisticalDataPage, getCoreWO,
} from '@/api/monitoring/statisticalData'; getMaterialBomPage,
import { getProcessFlowList } from '@/api/base/orderManage' getConOrderList,
getCoreWOListById,
getMaterialCostWorkOrder,
} from '@/api/base/coreWorkOrder';
import tableHeightMixin from '@/mixins/tableHeightMixin';
import { getOrderEnergyData } from '@/api/monitoring/orderEnergy';
// import { orderList } from "@/api/base/orderManage";
import { getStatisticalDataPage } from '@/api/monitoring/statisticalData';
import { getProcessFlowList } from '@/api/base/orderManage';
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import { publicFormatter } from "@/utils/dict"; import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi';
import workOrderNav from './workOrderNav.vue' import workOrderNav from './workOrderNav.vue';
import BarChart from "./barChart" import BarChart from './barChart';
const tableBtn = [ const tableBtn = [
{ {
type: 'edit', type: 'edit',
@ -176,28 +329,28 @@ const tableProps = [
{ {
prop: 'actualAssignmentQuantity', prop: 'actualAssignmentQuantity',
label: '实际分配数量', label: '实际分配数量',
} },
]; ];
const tableProps1 = [ const tableProps1 = [
{ {
prop: 'materialName', prop: 'materialName',
label: '物料名称' label: '物料名称',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict'),
}, },
{ {
prop: 'remainingNum', prop: 'remainingNum',
label: '剩余生产预计消耗' label: '剩余生产预计消耗',
}, },
]; ];
const tablePropsEnergy = [ const tablePropsEnergy = [
{ {
prop: 'objName', prop: 'objName',
label: '对象名称' label: '对象名称',
}, },
{ {
prop: 'objCode', prop: 'objCode',
@ -216,11 +369,11 @@ const tablePropsEnergy = [
}, },
{ {
prop: 'endNum', prop: 'endNum',
label: '工单结束值/当前值' label: '工单结束值/当前值',
}, },
{ {
prop: 'useNum', prop: 'useNum',
label: '使用量' label: '使用量',
}, },
]; ];
export default { export default {
@ -229,16 +382,16 @@ export default {
computed: { computed: {
tablePropsQuality() { tablePropsQuality() {
return [ return [
{ // {
// width: 128, // // width: 128,
prop: 'workOrderName', // prop: 'workOrderName',
label: '工单名称', // label: '',
}, // },
{ // {
// width: 128, // // width: 128,
prop: 'productionName', // prop: 'productionName',
label: '产品', // label: '',
}, // },
{ {
// width: 160, // width: 160,
prop: 'inspectionContent', prop: 'inspectionContent',
@ -248,7 +401,7 @@ export default {
{ {
// width: 128, // width: 128,
prop: 'sumScrap', prop: 'sumScrap',
label: '未检测总数', label: '未通过检测总数',
}, },
{ {
// width: 128, // width: 128,
@ -291,8 +444,9 @@ export default {
workOrderId: undefined, workOrderId: undefined,
addOrUpdateVisible: false, addOrUpdateVisible: false,
urlOptions: { urlOptions: {
infoURL: getCoreWO infoURL: getCoreWO,
}, },
allSumScrap: 0,
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
@ -320,36 +474,39 @@ export default {
visible: false, visible: false,
isdetail: false, isdetail: false,
workOrderButton: [], workOrderButton: [],
processFlowList: [] processFlowList: [],
}; };
}, },
watch: { watch: {
workOrderId(newValue, oldValue) { workOrderId(newValue, oldValue) {
this.activeName = 'produce' this.activeName = 'produce';
this.init(newValue) this.init(newValue);
this.dataForm.id = newValue this.dataForm.id = newValue;
} },
}, },
created() { created() {
this.getDict() this.getDict();
}, },
mounted() { mounted() {
if (this.$route.query.woIdString && this.$route.query.woIdString !== 'undefined') { if (
const idList = this.$route.query.woIdString.split(',') this.$route.query.woIdString &&
this.$route.query.woIdString !== 'undefined'
) {
const idList = this.$route.query.woIdString.split(',');
console.log(idList); console.log(idList);
getCoreWOListById(idList).then(res => { getCoreWOListById(idList).then((res) => {
this.workOrderButton = res.data.map(work => { this.workOrderButton = res.data.map((work) => {
return { return {
id: work.id, id: work.id,
name: work.name name: work.name,
} };
}) });
console.log('this.workOrderButton======', this.workOrderButton); console.log('this.workOrderButton======', this.workOrderButton);
this.init(this.workOrderButton[0].id, true) this.init(this.workOrderButton[0].id, true);
}) });
} else { } else {
this.init(this.$route.query.id, true) this.init(this.$route.query.id, true);
} }
}, },
methods: { methods: {
@ -357,7 +514,7 @@ export default {
this.$router.go(-1); this.$router.go(-1);
}, },
getId(val) { getId(val) {
this.workOrderId = val this.workOrderId = val;
}, },
async switchTab(val) { async switchTab(val) {
if (this.activeName === 'order') { if (this.activeName === 'order') {
@ -378,26 +535,27 @@ export default {
getOrderEnergyData({ getOrderEnergyData({
workOrderId: this.dataForm.id, workOrderId: this.dataForm.id,
}).then((response) => { }).then((response) => {
this.energyList = response.data this.energyList = response.data;
this.chartData = response.data this.chartData = response.data;
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); });
} else if (this.activeName === 'quality') { } else if (this.activeName === 'quality') {
this.allSumScrap = 0
const { const {
data: { data, otherList, otherMap, nameData }, data: { data, otherList, otherMap, nameData },
} = await getStatisticalDataPage({ } = await getStatisticalDataPage({
workOrderIdList:[this.dataForm,id] workOrderId:this.dataForm.id
}) });
// console.log(this.queryParams); // console.log(this.queryParams);
this.dynamicProps = this.filterNameData(nameData) this.dynamicProps = this.filterNameData(nameData);
this.qualityList = this.filterData(data); this.qualityList = this.filterData(data);
} }
}, },
getDict() { getDict() {
// //
getProcessFlowList().then(res => { getProcessFlowList().then((res) => {
this.processFlowList = res.data || [] this.processFlowList = res.data || [];
}) });
}, },
filterNameData(nameData) { filterNameData(nameData) {
const ndSet = new Set(); const ndSet = new Set();
@ -418,12 +576,14 @@ export default {
innerData.map((d) => { innerData.map((d) => {
keyValuePairs[d.dynamicName] = d.dynamicValue; keyValuePairs[d.dynamicName] = d.dynamicValue;
}); });
this.allSumScrap +=item.sumScrap
return { return {
inspectionContent: item.inspectionContent, inspectionContent: item.inspectionContent,
...keyValuePairs, ...keyValuePairs,
sumInput: item.sumInput, sumScrap: item.sumScrap,
productionName: item.productionName, productionName: item.productionName,
workOrderId: item.workOrderId, workOrderId: item.workOrderId,
workOrderName: item.workOrderName,
scrapRatio: item.scrapRatio, scrapRatio: item.scrapRatio,
}; };
}); });
@ -431,26 +591,26 @@ export default {
fitlerP(val) { fitlerP(val) {
if (val) { if (val) {
if (val === 1) { if (val === 1) {
return '低' return '低';
} else if (val === 2) { } else if (val === 2) {
return '正常' return '正常';
} else { } else {
return '高' return '高';
} }
} }
}, },
fitlerS(val) { fitlerS(val) {
if (val) { if (val) {
if (val === 1) { if (val === 1) {
return '等待' return '等待';
} else if (val === 2) { } else if (val === 2) {
return '激活' return '激活';
} else if (val === 3) { } else if (val === 3) {
return '暂停' return '暂停';
} else if (val === 4) { } else if (val === 4) {
return '完成' return '完成';
} else { } else {
return '作废' return '作废';
} }
} }
}, },
@ -491,11 +651,11 @@ export default {
} }
}, },
toggleTab(val) { toggleTab(val) {
this.activeModule = val this.activeModule = val;
if (this.activeModule === 'barChart') { if (this.activeModule === 'barChart') {
this.$nextTick((res) => { this.$nextTick((res) => {
this.$refs.orderEnergyChart.getChart() this.$refs.orderEnergyChart.getChart();
}) });
} }
}, },
getList() { getList() {
@ -524,17 +684,19 @@ export default {
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
if (this.dataForm.id) { if (this.dataForm.id) {
// //
this.urlOptions.infoURL(id).then(response => { this.urlOptions.infoURL(id).then((response) => {
this.dataForm = response.data this.dataForm = response.data;
// //
if (this.dataForm.processFlowId) { if (this.dataForm.productLineIds.length>0) {
this.processFlowList.filter(item => { console.log(this.processFlowList)
if (item.id === this.dataForm.processFlowId) { this.dataForm.productLineIds.forEach(item=>{
this.dataForm.processFlowName = item.name this.processFlowList.filter(item1 => {
if (item1.id === item.processId) {
item.processFlowName = item1.name
} }
});
}) })
} }
// //
@ -542,7 +704,7 @@ export default {
}); });
} else { } else {
if (this.urlOptions.isGetCode) { if (this.urlOptions.isGetCode) {
this.getCode() this.getCode();
} }
} }
}); });
@ -556,8 +718,8 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(id);
}); });
} },
} },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -577,7 +739,6 @@ export default {
color: rgba(102, 102, 102, 0.75); color: rgba(102, 102, 102, 0.75);
margin: 10px 0px; margin: 10px 0px;
} }
} }
.action_btn { .action_btn {
float: right; float: right;
@ -606,7 +767,7 @@ export default {
.active { .active {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
border-bottom-color: #0B58FF; border-bottom-color: #0b58ff;
} }
} }
</style> </style>

View File

@ -1,6 +1,5 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
@ -51,11 +50,9 @@ import codeFilter from '@/mixins/code-filter';
import { import {
deleteWarehouseArea, deleteWarehouseArea,
getWarehouseAreaPage, getWarehouseAreaPage,
getWarehouseAreaListAll getWarehouseAreaListAll,
} from "@/api/warehouse/warehouse-area-setup"; } from '@/api/warehouse/warehouse-area-setup';
import { import { getWarehouseList } from '@/api/warehouse/warehouse-setup';
getWarehouseList
} from "@/api/warehouse/warehouse-setup";
import tableHeightMixin from '@/mixins/tableHeightMixin'; import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [ const tableProps = [
@ -129,7 +126,9 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('warehouse:warehouse-area-setup:create') ? 'button' : '', type: this.$auth.hasPermi('warehouse:warehouse-area-setup:create')
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
@ -180,6 +179,22 @@ export default {
console.log(val); console.log(val);
} }
}, },
//
getDataList() {
this.dataListLoading = true;
getWarehouseAreaListAll().then((response) => { //
this.formConfig[1].selectOptions = response.data;
});
this.urlOptions.getDataListURL(this.listQuery).then(response => {
if (response.hasOwnProperty('data')) {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
} else {
this.tableData = []
}
this.dataListLoading = false;
});
},
}, },
}; };
</script> </script>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-08-21 10:26:21 * @LastEditTime: 2024-12-16 16:30:12
* @Description: * @Description:
--> -->
<template> <template>
@ -204,13 +204,17 @@ export default {
}, },
created() { created() {
getWarehouseList().then((response) => { getWarehouseList().then((response) => {
this.warehouseArr = response.data; this.warehouseArr = response.data.filter((item) =>
item.type === 1
);
}); });
}, },
methods: { methods: {
getAreaList() { getAreaList() {
getWarehouseAreaList(this.dataForm.warehouseId).then((response) => { getWarehouseAreaList(this.dataForm.warehouseId).then((response) => {
this.areaArr = response.data; this.areaArr = response.data;
this.dataForm.areaId = null
this.dataForm.areaType = null
if (this.areaArr.length === 0) { if (this.areaArr.length === 0) {
this.$message('该仓库下暂无库区'); this.$message('该仓库下暂无库区');
} }

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2024-08-02 16:26:58 * @Date: 2024-08-02 16:26:58
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-08-08 16:38:53 * @LastEditTime: 2024-12-19 14:15:06
* @Description:, * @Description:,
--> -->
<template> <template>
@ -103,7 +103,7 @@ export default {
}, },
created() { created() {
getUserProfile().then((response) => { getUserProfile().then((response) => {
this.dataForm.operator = response.data.username; this.dataForm.operator = response.data.nickname;
}); });
}, },
methods: { methods: {

View File

@ -67,6 +67,14 @@ const tableProps = [
prop: 'warehouseName', prop: 'warehouseName',
label: '仓库名称', label: '仓库名称',
}, },
{
prop: 'areaName',
label: '库区名称',
},
{
prop: 'areaType',
label: '库区类型',
},
{ {
prop: 'name', prop: 'name',
label: '库位名称', label: '库位名称',
@ -95,6 +103,10 @@ const tableProps = [
filter: parseTime, filter: parseTime,
width: 150, width: 150,
}, },
{
prop: 'goodsName',
label: '物品名称',
},
{ {
prop: 'remark', prop: 'remark',
label: '备注', label: '备注',

View File

@ -18,7 +18,7 @@
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="90" :width="90"
label="库位详情" label="详情"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
</base-table> </base-table>
@ -70,10 +70,12 @@ const tableProps = [
{ {
prop: 'oldCode', prop: 'oldCode',
label: '源库位编码', label: '源库位编码',
width: 150,
}, },
{ {
prop: 'palletCode', prop: 'palletCode',
label: '移动托盘编码', label: '移动托盘编码',
width: 150,
}, },
{ {
prop: 'goodName', prop: 'goodName',