Commit 2ec8d163 authored by 张海景's avatar 张海景

update:修改工单打样下达

parent 8db0f636
<template>
<div>
<el-form :model="tableForm" ref="tableForm" label-width="0px" class="demo-ruleForm">
<el-table
v-loading="loading"
:data="itemList"
:data="tableForm.tableData"
>
<!-- <el-table-column type="selection" width="55" align="center"/> -->
<el-table-column label="工序名称" width="120" prop="processName"/>
......@@ -12,6 +13,8 @@
<el-table-column label="工序总量" width="80" prop="quantity"/>
<el-table-column label="工作单元" width="180" prop="workunitId">
<template slot-scope="scope">
<el-form-item :prop="'tableData.' + scope.$index + '.workunitId'"
:rules="rules.workunitId">
<el-select v-model="scope.row.workunitId" placeholder="请选择" @focus="handleFous(scope.row)">
<el-option
v-for="(item,index) in scope.row.taskList"
......@@ -20,10 +23,13 @@
:value="item.workunitId">
</el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="计划开始时间" width="220" prop="scheduleStartTime">
<template slot-scope="scope">
<el-form-item :prop="'tableData.' + scope.$index + '.scheduleStartTime'"
:rules="rules.scheduleStartTime">
<el-date-picker
v-model="scope.row.scheduleStartTime"
type="datetime"
......@@ -32,10 +38,13 @@
format ="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="计划结束时间" width="220" prop="scheduleEndTime">
<template slot-scope="scope">
<el-form-item :prop="'tableData.' + scope.$index + '.scheduleEndTime'"
:rules="rules.scheduleEndTime">
<el-date-picker
v-model="scope.row.scheduleEndTime"
type="datetime"
......@@ -44,14 +53,16 @@
format ="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</template>
<script>
import { getProWorkOrderProcessList } from "@/api/mes/pro/workorder";
import { getProWorkOrderProcessList, workorderProofMakeProduction } from "@/api/mes/pro/workorder";
import { gettaskWorkunitList } from '@/api/mes/pro/scheduleList'
export default {
......@@ -72,6 +83,33 @@ export default {
// 物料产品表格数据
itemList: [{}],
loading: false,
tableForm: {
//附属条件表格
tableData: []
},
rules: {
workunitId: [
{
required: true,
message: '请选择工作单元',
trigger: ['change', 'blur']
}
],
scheduleStartTime: [
{
required: true,
message: '请选择计划开始时间',
trigger: ['change', 'blur']
}
],
scheduleEndTime: [
{
required: true,
message: '请选择计划结束时间',
trigger: ['change', 'blur']
}
]
},
};
},
created() {
......@@ -88,7 +126,7 @@ export default {
getProWorkOrderProcessList({
workorderId: this.$attrs.workorderId
}).then((response) => {
this.itemList = response.rows
this.tableForm.tableData = response.rows
this.loading = false;
});
},
......@@ -111,6 +149,34 @@ export default {
this.$set(row,'taskList',response.rows)
console.log(row)
},
validateKey(rule, value, callback) {
if (value === '') {
callback(new Error('请选择类型'))
} else {
callback()
}
},
submit(tableData) {
// console.log(tableData)
this.$refs.tableForm.validate(async(valid) => {
if (valid) {
let params = {
workorderId: this.$attrs.workorderId
}
params.processData = this.tableForm.tableData.map(item => {
return {
"scheduleEndTime": item.scheduleEndTime,
"scheduleStartTime": item.scheduleStartTime,
"workorderProcessId": item.workorderProcessId,
"workunitId": item.workunitId
}
})
console.log(params)
await workorderProofMakeProduction(params)
this.$emit('close')
}
})
},
},
};
</script>
......@@ -17,11 +17,11 @@
/>
</el-form-item> -->
<el-form-item label="状态" prop="status">
<el-select value="['','']"
<el-select
v-model="queryParams.statusArr"
clearable
placeholder="请选择状态"
multiple="true"
multiple
>
<el-option
v-for="dict in dict.type.mes_workorder_status"
......@@ -270,10 +270,10 @@
width="1200px"
append-to-body
>
<CommandList v-if="commandVisible" ref="CommandListRef" :workorderId="currentData.workorderId"></CommandList>
<CommandList v-if="commandVisible" ref="CommandListRef" @close="commandVisible = false" :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>
<el-button type="primary" @click="$refs.CommandListRef.submit(), getList()">确 定</el-button>
</div>
</el-dialog>
......@@ -859,8 +859,7 @@ import {
addWorkorder,
updateWorkorder,
dofinish,
doCheckToolNum,
workorderProofMakeProduction
doCheckToolNum
} from "@/api/mes/pro/workorder";
import {addProtaskList} from "@/api/mes/pro/protask";
......@@ -1014,28 +1013,12 @@ export default {
methods: {
handleCommandClick() {
this.currentData = this.selectedRows[0]
if (this.selectedRows[0].workorderType == 'prototype') {
if (this.selectedRows[0].workorderType == 'prototype'&&this.selectedRows[0].status === "PREPARE") {
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