Commit 8db0f636 authored by 张海景's avatar 张海景

update:修改打样工单下达

parent f6b4bdd3
......@@ -25,6 +25,24 @@ export function getWorkorder(workorderId) {
})
}
// 查询生产工单工序列表
export function getProWorkOrderProcessList(query) {
return request({
url: "/pro/proWorkOrderProcess/list",
method: "get",
params: query
});
}
// 打样生产工单任务生成
export function workorderProofMakeProduction(data) {
return request({
url: "/mes/pro/workorder/proofMakeProduction",
method: "post",
data: data,
});
}
// 新增生产工单
export function addWorkorder(data) {
return request({
......
<template>
<div>
<el-table
v-loading="loading"
:data="itemList"
>
<!-- <el-table-column type="selection" width="55" align="center"/> -->
<el-table-column label="工序名称" width="120" prop="processName"/>
<el-table-column label="工作中心" width="120" prop="workstationName"/>
<el-table-column label="标准工时" width="100" prop="stdWorkingTime"/>
<el-table-column label="工时单位" width="80" prop="stdWorkingTimeUom"/>
<el-table-column label="工序总量" width="80" prop="quantity"/>
<el-table-column label="工作单元" width="180" prop="workunitId">
<template slot-scope="scope">
<el-select v-model="scope.row.workunitId" placeholder="请选择" @focus="handleFous(scope.row)">
<el-option
v-for="(item,index) in scope.row.taskList"
:key="index"
:label="item.workunitName"
:value="item.workunitId">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="计划开始时间" width="220" prop="scheduleStartTime">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.scheduleStartTime"
type="datetime"
style="width: 100%;"
placeholder="请选择计划开始时间"
format ="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="计划结束时间" width="220" prop="scheduleEndTime">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.scheduleEndTime"
type="datetime"
style="width: 100%;"
placeholder="请选择计划结束时间"
format ="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { getProWorkOrderProcessList } from "@/api/mes/pro/workorder";
import { gettaskWorkunitList } from '@/api/mes/pro/scheduleList'
export default {
name: "commandList",
components: { },
data() {
return {
showFlag: false,
// 选中数组
ids: [],
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 物料产品表格数据
itemList: [{}],
loading: false,
};
},
created() {
},
mounted() {
this.getList();
},
methods: {
/** 查询物料编码列表 */
getList() {
this.loading = true;
console.log(this.$attrs.workorderId, 'attrs')
getProWorkOrderProcessList({
workorderId: this.$attrs.workorderId
}).then((response) => {
this.itemList = response.rows
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.statusArr = ["ORCHESTRATED"]
this.handleQuery();
},
async handleFous(row) {
if (row.taskList&&row.taskList.length) {
return
}
const response = await gettaskWorkunitList({workstationId: row.workstationId})
this.$set(row,'taskList',response.rows)
console.log(row)
},
},
};
</script>
......@@ -245,12 +245,38 @@
>生成任务单
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-plus"
size="mini"
:disabled="single"
@click="handleCommandClick"
v-hasPermi="['mes:pro:workorder:dofinish']"
>生产打样下达
</el-button>
</el-col>
<!-- <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar> -->
</el-row>
<!-- 生产打样下达 -->
<el-dialog
title="打样下达填报"
:visible.sync="commandVisible"
width="1200px"
append-to-body
>
<CommandList v-if="commandVisible" ref="CommandListRef" :workorderId="currentData.workorderId"></CommandList>
<div slot="footer" class="dialog-footer">
<el-button @click="commandVisible = false">取 消</el-button>
<el-button type="primary" @click="handleSubmitCommand">确 定</el-button>
</div>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog title="导入工单" :visible.sync="upload.open" width="400px">
<el-upload
......@@ -833,7 +859,8 @@ import {
addWorkorder,
updateWorkorder,
dofinish,
doCheckToolNum
doCheckToolNum,
workorderProofMakeProduction
} from "@/api/mes/pro/workorder";
import {addProtaskList} from "@/api/mes/pro/protask";
......@@ -851,6 +878,7 @@ import {addCombination, batchAddCombination} from "@/api/mes/pro/combination";
import CombinationInfos from "@/views/mes/pro/combination/infos.vue";
import {batchAddArrange} from "@/api/mes/pro/arrange";
import ArrangeInfo from "@/views/mes/pro/arrange/info.vue";
import CommandList from "./commandList.vue";
export default {
name: "Workorder",
......@@ -870,9 +898,11 @@ export default {
VendorSelect,
Workorderbom,
WorkorderItemList,
CommandList
},
data() {
return {
commandVisible: false,
showArrangBtn: false,
showCombinationBtn: false,
currentData: {},
......@@ -982,6 +1012,30 @@ export default {
this.getList();
},
methods: {
handleCommandClick() {
this.currentData = this.selectedRows[0]
if (this.selectedRows[0].workorderType == 'prototype') {
this.commandVisible = true
} else {
this.$message.warning('请选择工单类型为打样工单、状态为待发布的数据')
}
},
async handleSubmitCommand() {
let params = {
workorderId: this.currentData.workorderId
}
params.processData = this.$refs.CommandListRef.itemList.map(item => {
return {
"scheduleEndTime": item.scheduleEndTime,
"scheduleStartTime": item.scheduleStartTime,
"workorderProcessId": item.workorderProcessId,
"workunitId": item.workunitId
}
})
console.log(params)
const res = await workorderProofMakeProduction(params)
this.commandVisible = false
},
handleViewRecord(row){
this.currentData = row
this.$refs.WorkorderRecordSelectRef.showFlag = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment