This commit is contained in:
xiaowei.song
2024-06-06 13:19:00 +08:00
7 changed files with 840 additions and 702 deletions

View File

@@ -3,61 +3,61 @@ import { downFile } from '@/utils/request'
// 导出函数,获取工作计划列表
export function getWorkplanList(query) {
return request({
url: '/mes/pro/workplan_v2/list',
method: 'get',
params: query,
})
return request({
url: '/mes/pro/workplan_v2/list',
method: 'get',
params: query,
})
}
// 导出函数,添加新的工作计划
export function addNewworkplan(data) {
return request({
url: '/mes/pro/workplan_v2/addworkplan',
method: 'post',
data: data,
contextType: 'application/json',
})
return request({
url: '/mes/pro/workplan_v2/addworkplan',
method: 'post',
data: data,
contextType: 'application/json',
})
}
// 导出函数,删除工作计划
export function deleteworkplan(id) {
return request({
url: '/mes/pro/workplan_v2/deleteitem/' + id,
method: 'get',
})
return request({
url: '/mes/pro/workplan_v2/deleteitem/' + id,
method: 'get',
})
}
// 导出函数,删除所有工作计划
export function deleteAllWorkplan(query) {
return request({
url: '/mes/pro/workplan_v2/deleteAll',
method: 'get',
params: query,
})
return request({
url: '/mes/pro/workplan_v2/deleteAll',
method: 'get',
params: query,
})
}
// 导出函数,更新工作计划
export function updateworkplan(data) {
return request({
url: '/mes/pro/workplan_v2/updateworkplan',
method: 'post',
data: data,
contextType: 'application/json',
})
return request({
url: '/mes/pro/workplan_v2/updateworkplan',
method: 'post',
data: data,
contextType: 'application/json',
})
}
// 导出函数,处理周汇总
export function handleWeekSummary(query) {
return request({
url: '/mes/pro/workplan_v2/getWeekSummary',
method: 'get',
params: query,
})
return request({
url: '/mes/pro/workplan_v2/getWeekSummary',
method: 'get',
params: query,
})
}
@@ -66,5 +66,15 @@ export function handleWeekSummary(query) {
// 导出函数,下载工作计划
export async function dowmloadWorkplan(query) {
await downFile('/mes/pro/workplan_v2/downloadWorkplan', { ...query })
await downFile('/mes/pro/workplan_v2/downloadWorkplan', { ...query })
}
// 检查计划数据
export function checkWorkPlan(data) {
return request({
url: '/mes/pro/workplan_v2/checkWorkPlan',
method: 'post',
data: data,
})
}

View File

@@ -30,6 +30,12 @@
<el-button type="success" size="mini" @click="generate_workorder">生成工单</el-button>
</div>
<!-- 背景描述 -->
<div class="tag-box">
<el-tag style="margin-right: 10px;" v-for="(item,index) in stateCheckOptions" :key="index" :color="item.color">
<span style="color: black;font-weight: 600;font-size: 16px;">{{item.text}}:{{checkNumOption[index]}}</span>
</el-tag>
</div>
<div class="nowOrderRetainBox">
<span>当前首检工单</span>
<span v-if="nowOrderRetainStr!==''">{{nowOrderRetainStr}}</span>
@@ -71,8 +77,8 @@
</div>
</el-dialog>
<vxe-table border resizable show-overflow ref="xTable" v-loading="loading_1" height="800" :row-config="{ isHover: true, useKey: true, keyField: 'sort' }" :data="workorder_table_data">
<vxe-column type="seq" width="60"></vxe-column>
<vxe-table :cell-style="rowClassName" border resizable show-overflow ref="xTable" v-loading="loading_1" height="800" :row-config="{ isHover: true, useKey: true, keyField: 'sort' }" :data="workorder_table_data">
<vxe-column type="seq" width="60" align="center"></vxe-column>
<!-- <vxe-column field="sort" title="序号"></vxe-column> -->
<!-- <vxe-column field="id" title="1工单号"></vxe-column> -->
<vxe-column title="工单号">
@@ -190,7 +196,7 @@
return {
mqttClient: null,
mqttClientId: emqxUtil.title + Math.random().toString(16).substring(2, 8),
sortable:null,
sortable: null,
search: {
year: new Date().getFullYear(),
week: 1,
@@ -255,11 +261,31 @@
rules: {
finishedPartNumber: [{ required: true, message: '成品零件号不能为空', trigger: 'blur' }],
},
// 数据检查
stateCheckOptions: [
{ state: 0, color: '#ffffff', text: '正常' },
{ state: 1, color: '#FA8072', text: '物料不存在' },
{ state: 2, color: '#EE82EE', text: '毛坯号异常' },
{ state: 3, color: '#FFC0CB', text: '颜色异常' },
{ state: 4, color: '#E6E6FA', text: '规格异常' },
{ state: 5, color: '#ffffd5', text: '物料不包含此描述' },
],
tableAllData: [],
// checkNumOption: [0, 0, 0, 0, 0, 0],
}
},
created() {
this.initMqtt();
},
computed: {
checkNumOption() {
let list = [0, 0, 0, 0, 0, 0];
for (let item of this.tableAllData) {
list[item.state]++;
}
return list;
}
},
mounted() {
this.getList()
// this.drag()
@@ -315,15 +341,15 @@
this.$nextTick(function () {
this.workorder_table_data = newArray;
const query = {
oldId:this.workorder_table_data[oldIndex].id,
oldSort:this.workorder_table_data[oldIndex].sort,
newId:this.workorder_table_data[newIndex].id,
newSort:this.workorder_table_data[newIndex].sort,
oldId: this.workorder_table_data[oldIndex].id,
oldSort: this.workorder_table_data[oldIndex].sort,
newId: this.workorder_table_data[newIndex].id,
newSort: this.workorder_table_data[newIndex].sort,
}
updateSort2(query).then((res) => {
if (res.code == 200 && res.data > 0) {
this.$notify.success('修改成功')
}else{
} else {
this.$notify.error('修改失败')
}
})
@@ -349,8 +375,17 @@
this.pagination.total = res.data.item2
}
})
let allQuery = query;
allQuery.pageNum = 1;
allQuery.pageSize = 1000;
getWorkoderList(allQuery).then((res) => {
if (res.code == 200) {
this.tableAllData = res.data.item1
}
})
},
//todo 导入生产工单
importworkorder() {
this.upload.open = true
@@ -587,7 +622,19 @@
this.workorderItem.previousNumber = 0;
}
},
// 更改单元格格式
rowClassName(item) {
const row = item.row;
const options = this.stateCheckOptions;
for (let index in options) {
if (row.state === options[index].state) {
return {
backgroundColor: options[index].color,
}
}
}
return null;
},
initMqtt() {
const that = this;
if (that.mqttClient !== null && that.mqttClient.connected) {
@@ -650,4 +697,9 @@
align-items: center;
justify-content: center;
}
.tag-box{
margin-top: 10px;
margin-bottom: 10px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -445,6 +445,7 @@
<el-button type="primary" icon="el-icon-arrow-left" size="mini" @click="getPrevious_current_workorder">上一个工单</el-button>
</el-button-group>
</div>
<el-button type="success" size="medium" @click="setWorkOrderStartTime">同步开始时间</el-button>
<el-button type="primary" size="medium" @click="workOrderCompleted">本工单完成</el-button>
<table>
<tr>
@@ -769,14 +770,41 @@
},
//todo 工单完成
workOrderCompleted() {
const oldWorkorderId = this.CurrentWorkorder.clientWorkorder;
this.$modal.confirm('是否确认完成本工单?').then(() => {
this.getNext_current_workorder()
this.$confirm('是否确认完成本工单?', '操作提示', { type: 'warning', closeOnClickModal: false }).then(() => {
this.getNext_current_workorder(false);
}).catch(() => {
this.$message.info("操作取消");
})
},
// 设置工单开始时间
setWorkOrderStartTime() {
const workorderId = this.CurrentWorkorder.clientWorkorder;
writeProcessFlow_first({ workorderID: workorderId, time: new Date() });
const data = {
workOrderId: workorderId
}
GetQcQualityStatisticsFirstStartTime(data).then(res => {
if (res.code === 200) {
this.workOrderStartTime = res.data;
}
})
},
//todo 获取下一个工单号
getNext_current_workorder() {
getNext_current_workorder(check = true) {
if (!this.checkHasStartTime() && check) {
this.$confirm("当前工单未点击本工单完成,无工单开始时间,是否进入下一个工单?", '操作提示', { type: 'warning', closeOnClickModal: false }).then(() => {
this.getNextWorkOrder();
}).catch(() => {
this.$message.info("操作取消");
})
} else {
this.getNextWorkOrder();
}
},
getNextWorkOrder() {
const oldWorkorderId = this.CurrentWorkorder.clientWorkorder;
get_next_current_workorder()
.then((res) => {
if (res.code == 200) {
@@ -810,10 +838,9 @@
this.team = result.data.team
this.publishNowOrderRetain(this.CurrentWorkorder.clientWorkorder)
this.setWorkOrderStartTime();
this.$loading().close()
}
return writeProcessFlow_first({ workorderID: this.CurrentWorkorder.clientWorkorder, time: new Date() });
})
},
//todo 获取上一个工单号
@@ -852,6 +879,15 @@
})
},
//TODO 检查===
//1.非完成切换工单时检查是否含有开始时间
checkHasStartTime() {
if (this.workOrderStartTime === "" || this.workOrderStartTime === "工单无开始时间!") {
return false;
}
return true;
},
//todo 累加器 这里是值传递还是引用传递??????????????????????????????
Accumulator(item, type, index) {
let query = {}
@@ -1146,6 +1182,8 @@
::v-deep .el-button {
float: right;
margin-bottom: 10px;
margin-right: 10px;
}
}

View File

@@ -455,7 +455,9 @@
<el-button type="primary" icon="el-icon-arrow-left" size="mini" @click="getPrevious_current_workorder">上一个工单</el-button>
</el-button-group>
</div>
<el-button type="primary" size="medium" @click="workOrderCompleted">本工单完成</el-button>
<div style="height: 40px;">
<el-button type="primary" size="medium" @click="workOrderCompleted">本工单完成</el-button>
</div>
<table>
<tr>
<td>产品描述</td>
@@ -574,7 +576,7 @@
created() {
this.initMqtt();
this.getcurrentWorkorder()
// this.startTimer()
},
mounted() {},
@@ -776,39 +778,50 @@
this.$modal
.confirm('是否确认完成本工单?')
.then(() => {
this.getNext_current_workorder()
this.$notify.success(`已完成工单${saveWorkorderInfo.clientWorkorder},即将跳转下一个工单`);
//todo 更改这个工单状态为2
return update_workorder_status({ workorderID: saveWorkorderInfo.clientWorkorder })
})
.then((res) => {
if (res.code == 200) {
this.$notify.success('工单完成')
//todo 生成质量统计表 !!!!需要工单和班组
let query = {
workorderID: saveWorkorderInfo.clientWorkorder,
team: saveWorkorderInfo.team,
firstquality_time: this.$store.state.quality.firstquality_time,
}
return generateQualityStatisticsTable(query)
this.getNext_current_workorder().then(() => {
setTimeout(() => {
update_workorder_status({ workorderID: saveWorkorderInfo.clientWorkorder })
.then((res) => {
if (res.code == 200) {
this.$notify.success(`工单${saveWorkorderInfo.clientWorkorder},开始生成相关数据……`)
//todo 生成质量统计表 !!!!需要工单和班组
let query = {
workorderID: saveWorkorderInfo.clientWorkorder,
team: saveWorkorderInfo.team,
firstquality_time: this.$store.state.quality.firstquality_time,
}
return generateQualityStatisticsTable(query)
}
}).then((res) => {
if (res.code == 200) {
this.$notify.success(`工单${saveWorkorderInfo.clientWorkorder}质量统计表生成成功`)
}
// 入库检验数据转换
const quest = { workorder: saveWorkorderInfo.clientWorkorder }
return convertToIncomingInspectionData(quest)
}
}).then((res) => {
if (res.code == 200) {
this.$notify.success('质量统计表生成成功')
}
// 入库检验数据转换
const quest = { workorder: saveWorkorderInfo.clientWorkorder }
return convertToIncomingInspectionData(quest)
}).then((res) => {
if (res.code == 200) {
this.$notify.success(`工单${saveWorkorderInfo.clientWorkorder}生成入库检验数量为${res.data}`);
}
})
}, 500);
setTimeout(() => {
location.reload();
}, 2000);
})
}).catch(() => {
}).then((res) => {
if (res.code == 200) {
this.$notify.success("生成入库检验数量为" + res.data);
}
})
},
//todo 获取下一个工单号
getNext_current_workorder() {
get_next_current_workorder()
return get_next_current_workorder()
.then((res) => {
if (res.code == 200) {
if (res.data != null) {
@@ -819,11 +832,11 @@
this.publishOrderChange();
return GetcheckItemTable({ workorderID: this.CurrentWorkorder.clientWorkorder })
} else {
this.$notify.warning('已经是最后一个工单,没有工单')
this.$notify.warning('当前为列表最后工单,请刷新尝试获取最新工单');
return null;
}
} else if (res.code == 210) {
this.$notify.warning('已经是最后一个工单,没有工单')
this.$notify.warning('当前无更多数据,请刷新尝试获取最新工单');
return null;
}
})
@@ -833,17 +846,12 @@
}
if (result.code == 200) {
this.paint = result.data.paint
this.device = result.data.device
this.blank = result.data.blank
this.program = result.data.program
this.team = result.data.team
this.$loading().close()
}
})
},
//todo 获取上一个工单号
@@ -858,11 +866,11 @@
this.publishOrderChange();
return GetcheckItemTable({ workorderID: this.CurrentWorkorder.clientWorkorder })
} else {
this.$notify.warning('没有生产工单')
this.$notify.warning('当前为列表第一个工单,请刷新尝试获取最新工单')
return null;
}
} else if (res.code == 210) {
this.$notify.warning('没有生产工单')
this.$notify.warning('当前为列表第一个工单,请刷新尝试获取最新工单')
return null;
}
})
@@ -1134,7 +1142,7 @@
this.$nextTick(() => {
this.$refs.elImageRef.clickHandler();
})
},
},
// 退出后关闭计时器
@@ -1143,7 +1151,7 @@
},
}
</script>

View File

@@ -15,8 +15,8 @@
</el-form-item>
<el-form-item label="类别" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类别" @change="handleQuery">
<el-option label="全部" :value="0"></el-option>
<el-option v-for="item in typeOptions" :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
<el-option label="全部" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
@@ -182,7 +182,7 @@
queryParams: {
pageNum: 1,
pageSize: 10,
type: 0,
type: 1,
status: 1,
sort: undefined,
sortType: undefined,

View File

@@ -21,11 +21,11 @@
<!-- 工具区域 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="success" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-plus" size="mini" @click="handleAdd(1)">增加库存</el-button>
<el-button type="success" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-edit" size="mini" @click="handleAdd(1)">库存变动</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button type="danger" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-minus" size="mini" @click="handleAdd(2)">减少库存</el-button>
</el-col>
</el-col> -->
</el-row>
<!-- 数据区域 -->
<el-table :data="dataList" v-loading="loading" ref="table" border highlight-current-row>
@@ -74,15 +74,28 @@
</el-col>
<el-col :lg="12">
<el-form-item label="变动类别" prop="type">
<el-tag v-if="formAdd.type === 1" type="primary">毛坯</el-tag>
<el-tag v-if="formAdd.type === 2" type="warning">返工件</el-tag>
<el-tag v-if="formAdd.type === 1" type="primary">毛坯</el-tag>
<el-tag v-if="formAdd.type === 2" type="warning">返工件</el-tag>
<span style="margin-right: 10px;"></span>
<el-tag v-if="formAdd.actionType === 1" type="success">增加库存</el-tag>
<el-tag v-if="formAdd.actionType === 2" type="danger">减少库存</el-tag>
<el-tag v-if="formAdd.actionType === 1" type="success">增加库存</el-tag>
<el-tag v-if="formAdd.actionType === 2" type="danger">减少库存</el-tag>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="变动数量" prop="changeQuantity">
<el-form-item label="库存操作" prop="quantity">
<el-select v-model="formAdd.actionType">
<el-option label="增加" :value="1"></el-option>
<el-option label="减少" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="库存数量" prop="quantity">
<el-input :readonly="true" v-model.number="formAdd.quantity" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item :label="formAdd.actionType === 1?'增加数':'减少数'" prop="changeQuantity">
<el-input v-model.number="formAdd.changeQuantity" placeholder="请输入变动数量" />
</el-form-item>
</el-col>
@@ -110,6 +123,9 @@
addInventoryNum,
reduceInventoryNum
} from '@/api/wmsManagement/wmBlankRecord.js';
import {
getWmBlankInventory,
} from '@/api/wmsManagement/wmBlankInventory.js';
export default {
inheritAttrs: false,
props: {
@@ -169,6 +185,23 @@
},
mounted() {},
methods: {
// 初始化数据
initData() {
this.formAdd.fkBlankInventoryId = this.ItemData.id;
this.formAdd.description = this.ItemData.description ?? "";
this.formAdd.specification = this.ItemData.specification ?? "";
this.formAdd.blankNum = this.ItemData.blankNum ?? "";
this.formAdd.type = this.ItemData.type;
this.formAdd.changeQuantity = 0;
this.formAdd.remark = "";
// 库存值更新
getWmBlankInventory(this.ItemData.id).then((res) => {
const { code, data } = res;
if (code == 200) {
this.formAdd.quantity = data.quantity;
}
});
},
// 查询数据
getList() {
this.loading = true;
@@ -204,21 +237,17 @@
this.getList();
},
handleAdd(type = 0) {
if (type === 1) {
this.addDialogTitle = "增加库存";
} else {
this.addDialogTitle = "减少库存";
}
this.formAdd.fkBlankInventoryId = this.ItemData.id;
this.formAdd.blankNum = this.ItemData.blankNum;
this.formAdd.description = this.ItemData.description;
this.formAdd.specification = this.ItemData.specification;
this.formAdd.type = this.ItemData.type;
// if (type === 1) {
// this.addDialogTitle = "增加库存";
// } else {
// this.addDialogTitle = "减少库存";
// }
this.addDialogTitle = "修改库存";
this.formAdd.actionType = type;
this.formAdd.changeQuantity = 0;
this.formAdd.remark = "";
this.initData();
this.addDialogOpen = true;
},
handelConfirm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
@@ -237,6 +266,7 @@
this.$message.success("手动添加记录成功!");
this.getList();
this.emitRefresh();
this.initData();
this.addDialogOpen = false;
}
})
@@ -251,6 +281,7 @@
this.$message.success("手动添加记录成功!");
this.getList();
this.emitRefresh();
this.initData();
this.addDialogOpen = false;
}
})