Commit 2b585d4d authored by 沈翠玲's avatar 沈翠玲

生产排产

parent e268c93e
......@@ -101,4 +101,13 @@ export function getdefaultWorkCenterList() {
});
}
// 转委外
export function toOutsource(query) {
return request({
url: "/mes/pro/taskWorkunit/toOutsource",
method: "post",
data: query
});
}
......@@ -128,6 +128,15 @@
@click="handleJobAssignment"
>作业分派</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled='multiple'
@click="handleOpenTask"
>转委外</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="primary"
......@@ -459,7 +468,18 @@
<el-button @click="arrangCodeVisible = false">取 消</el-button>
</div>
</el-dialog>
<el-dialog
title="转委外"
:visible.sync="isVisibleTASK"
width="1000px"
append-to-body
>
<taskList v-if="isVisibleTASK" ref="taskListRef" :selections="selections" ></taskList>
<div slot="footer" class="dialog-footer">
<el-button @click="isVisibleTASK = false">取 消</el-button>
<el-button @click="toOutsource">确 定</el-button>
</div>
</el-dialog>
<WorkuintSelect
ref="WorkunitSelect"
:workstationId="currentData.workstationId"
......@@ -480,6 +500,7 @@ import {
gettaskWorkunitList,
getdefaultWorkCenterList} from '@/api/mes/pro/scheduleList'
import {putProtaskSplit} from '@/api/mes/pro/protask'
import taskList from './taskList.vue'
import BrandSelect from "@/components/TmTool/index.vue";
import OrderList from './orderList.vue'
import jobAssign from './jobAssign.vue'
......@@ -487,7 +508,7 @@ import arrangCodeList from './arrangCodeList.vue'
import WorkuintSelect from "./workunitSelectSche.vue";
import dayjs from 'dayjs'
export default {
components: {BrandSelect, OrderList, arrangCodeList, WorkuintSelect, jobAssign},
components: {BrandSelect, taskList, OrderList, arrangCodeList, WorkuintSelect, jobAssign},
dicts: ['TASK_STATUS'],
name: "scheduleList",
data() {
......@@ -495,6 +516,7 @@ export default {
currentData: {},
currentTask: null,
workshopList: [],
isVisibleTASK: false,
workstationList: [],
taskWorkunitList: [],
queryWorkunitParams: {
......@@ -559,6 +581,15 @@ export default {
this.hanldeGetdefaultWorkCenterList()
},
methods: {
toOutsource() {
this.$refs['taskListRef'].toOutsource().then(res => {
this.isVisibleTASK = false
this.getList();
})
},
handleOpenTask(){
this.isVisibleTASK = true
},
clickTask(arrangeCode){
this.arrangeCode= arrangeCode
this.isOrder = true
......
<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="workorderCode" />
<el-table-column label="物料编码" width="120" prop="itemCode" />
<el-table-column label="物料名称" width="80" prop="itemName" />
<el-table-column
label="工序名称"
align="center"
prop="processName"
:show-overflow-tooltip="true"
/>
<el-table-column label="排产数量" align="center" prop="quantity" />
<el-table-column
label="委外数量"
align="center"
prop="toOutsourceQuantity"
width="180"
> <template slot-scope="scope">
<el-input-number
style="width: 150px"
:step="1"
:min="0"
v-model="scope.row.toOutsourceQuantity"
/>
</template>
</el-table-column>
<el-table-column
label="委外加工商"
align="center"
prop="scheduleStartDate"
width="230"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<el-input v-model="scope.row.vendorName" placeholder="请选择供应商">
<el-button slot="append" @click="handleSelectVendor(scope.row)" icon="el-icon-search"></el-button>
</el-input>
<VendorSelect ref="vendorSelect" @onSelected="onVendorSelected" />
</template>
</el-table-column>
<el-table-column
label="计划开始时间"
align="center"
prop="scheduleStartDate"
width="230"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.scheduleStartDate"
type="datetime"
style="width: 100%;"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划开始时间"
>
</el-date-picker>
</template>
</el-table-column>
<el-table-column
label="计划结束时间"
align="center"
prop="scheduleEndDate"
width="230"
>
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.scheduleEndDate"
type="datetime"
style="width: 100%;"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划结束时间"
>
</el-date-picker>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import VendorSelect from "@/components/vendorSelect/single.vue";
import { toOutsource } from '@/api/mes/pro/scheduleList'
export default {
name: "taskList",
props: ["selections"],
components: {VendorSelect},
data() {
return {
showFlag: false,
// 选中数组
ids: [],
selectedRows: [],
queryParams: {
pageNum: 1,
pageSize: 10
},
currentData: null,
total: 0,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 物料产品表格数据
itemList: null,
loading: false,
};
},
created() {
},
mounted() {
this.getList();
},
methods: {
toOutsource(){
return new Promise((resolve, reject) => {
const list = this.itemList.map(v => {
return {
"scheduleEndDate": v.scheduleEndDate,
"scheduleStartDate": v.scheduleStartDate,
"taskWorkunitId": v.taskWorkunitId,
"toOutsourceQuantity": v.toOutsourceQuantity,
"vendorId": v.vendorId,
"vendorName": v.vendorName
}
})
toOutsource(list).then(res => {
if(res.code === 200) {
this.$modal.msgSuccess('转委外成功')
resolve()
} else {
this.$modal.msgError(res.msg || "转委外失败")
reject()
}
})
})
},
handleSelectVendor(row) {
this.currentData = row
this.$refs.vendorSelect.showFlag = true;
},
//供应商选择弹出框
onVendorSelected(obj) {
if (obj != undefined && obj != null) {
this.currentData.vendorId = obj.vendorId;
this.currentData.vendorName = obj.vendorName;
}
},
/** 查询物料编码列表 */
getList() {
const itemList = JSON.parse(JSON.stringify(this.selections));
itemList.forEach(element => {
element['toOutsourceQuantity'] = element.quantity
element['vendorName'] = null
element['vendorId'] = null
});
this.itemList = itemList
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.statusArr = ["ORCHESTRATED"]
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.workorderId);
this.single = selection.length != 1;
this.multiple = !selection.length;
this.selectedRows = selection;
},
},
};
</script>
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