Commit d3e99518 authored by 沈翠玲's avatar 沈翠玲

委外排产

parent 2b585d4d
...@@ -110,4 +110,30 @@ export function toOutsource(query) { ...@@ -110,4 +110,30 @@ export function toOutsource(query) {
}); });
} }
// 拆分
export function outsourceSplit(query) {
return request({
url: "/mes/pro/taskWorkunit/outsourceSplit",
method: "post",
data: query
});
}
// 拆分
export function toSelfMade(query) {
return request({
url: "/mes/pro/taskWorkunit/toSelfMade",
method: "post",
data: query
});
}
// 委外确认
export function outsourceConfirm(query) {
return request({
url: "/mes/pro/taskWorkunit/outsourceConfirm",
method: "post",
data: query
});
}
<template>
<div class="app-container" style="display: flex;">
<div style="width: 100%;">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="生产工单" prop="workorderCode">
<el-input
v-model="queryParams.workorderCode"
placeholder="请输入生产工单"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否已委外" prop="outsourced">
<el-select v-model="queryParams.outsourced" placeholder="请选择" clearable>
<el-option
v-for="dict in dict.type.sys_yes_non"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="物料编码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled='multiple'
@click="handleOpenTask('split')"
>拆分</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled='multiple'
@click="handleOpenTask('myself')"
>转自制</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled='multiple'
@click="handleOutsource"
>委外确认</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="maintenanceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="生产工单" align="center" prop="workorderCode" />
<el-table-column label="外协单号" align="center" prop="taskCode" />
<el-table-column label="是否已委外" align="center" prop="outsourced" >
<template slot-scope="scope">
{{scope.row.outsourced ? '是' : '否'}}
</template>
</el-table-column>
<el-table-column
label="物料编码"
align="center"
prop="itemCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="物料名称"
align="center"
prop="itemName"
:show-overflow-tooltip="true"
/>
<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="outsourceUnitPrice"
width="180"
> <template slot-scope="scope">
<el-input-number
style="width: 150px"
:step="1"
:min="0"
:disabled="scope.row.outsourced"
@change="changeoutsourceUnitPrice(scope.row)"
v-model="scope.row.outsourceUnitPrice"
/>
</template>
</el-table-column>
<el-table-column
label="委外加工商"
align="center"
prop="vendorName"
width="200"
>
<template slot-scope="scope">
<el-input v-model="scope.row.vendorName" placeholder="请选择供应商" v-if="!scope.row.outsourced">
<el-button slot="append" @click="handleSelectVendor(scope.row)" icon="el-icon-search"></el-button>
</el-input>
<span v-else>{{
scope.row.vendorName
}}</span>
<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-if="!scope.row.outsourced"
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="请选择计划开始时间"
@focus="writeRow(scope.row)"
@change="editTime(scope.row, 'start')"
>
</el-date-picker>
<span v-else>{{
parseTime(scope.row.scheduleStartDate)
}}</span>
</template>
</el-table-column>
<el-table-column
label="计划结束时间"
align="center"
prop="scheduleEndDate"
width="230"
>
<template slot-scope="scope">
<el-date-picker
v-if="!scope.row.outsourced"
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="请选择计划结束时间"
@focus="writeRow(scope.row)"
@change="editTime(scope.row, 'end')"
>
</el-date-picker>
<span v-else>{{
parseTime(scope.row.scheduleEndDate)
}}</span>
</template>
</el-table-column>
<!-- <el-table-column
label="操作"
width="150px"
align="center"
class-name="small-padding fixed-width"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:pro:protask:edit']"
>编辑</el-button
>
</template>
</el-table-column> -->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<el-dialog
:title="title"
:visible.sync="isVisibleTASK"
width="1000px"
append-to-body
>
<taskList v-if="isVisibleTASK" ref="taskListRef" :selections="selections" :title="title"></taskList>
<div slot="footer" class="dialog-footer">
<el-button @click="isVisibleTASK = false">取 消</el-button>
<el-button @click="toOutsource">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getListData,
updateList,
outsourceConfirm} from '@/api/mes/pro/scheduleList'
import VendorSelect from "@/components/vendorSelect/single.vue";
import taskList from './taskList.vue'
import dayjs from 'dayjs'
export default {
components: {taskList, VendorSelect},
dicts: ['sys_yes_non'],
name: "OutSourceSchedule",
data() {
return {
currentData: {},
currentTask: null,
isVisibleTASK: false,
taskWorkunitList: [],
queryWorkunitParams: {
workshopId: null,
workstationId: null
},
taskId: null,
Assignform: {
quantity: 1,
workunitName: ''
},
scheduleBtnDis: false,
taskWorkunitId: null,
isOrder: true,
// 遮罩层
loading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
maintenanceList: [],
optType: null,
// 总条数
total: 0,
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
selections: [],
workstationId: null,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
outsourced: null,
statusArr: [],
itemCode: null,
workorderCode: null,
scheduleStartDate: null,
scheduleEndDate: null,
},
editTimeLast: null,
arrangeCode: null,
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
handleSelectVendor(row) {
this.currentData = row
this.$refs.vendorSelect.showFlag = true;
},
toOutsource() {
this.$refs['taskListRef'].toOutsource().then(res => {
this.isVisibleTASK = false
this.getList();
})
},
handleOpenTask(type){
this.isVisibleTASK = true
this.title = type === 'split' ? '拆分' : '转自制'
},
// 获取工作单元
async onVendorSelected(row) {
this.currentData['vendorName'] = row.vendorName
await this.submitForm({...this.currentData, vendorId: row.vendorId, vendorName: row.vendorName})
this.$refs['vendorSelect'].showFlag = false
},
changeoutsourceUnitPrice(row) {
this.submitForm(row)
},
onWorkstationSelect(row) {
if (row != undefined && row != null) {
this.Assignform.workunitId = row.workunitId
this.Assignform.workunitName = row.workunitName
}
},
handleClick(row,index) {
this.currentTask = index
this.queryParams.workunitId = row.workunitId
this.queryParams.pageNum = 1
this.getList()
},
/** 查询要维护刀模版列表 */
async getList() {
this.queryParams.workCenterId = this.queryWorkunitParams.workstationId
this.queryParams.workshopId = this.queryWorkunitParams.workshopId
this.loading = true;
const params = {...this.queryParams, workunitId: 1}
if (params.scheduleEndDate&&params.scheduleEndDate.length > 0) {
params.scheduleEndDateFrom = params.scheduleEndDate[0]
params.scheduleEndDateTo = params.scheduleEndDate[1]
}
if (params.scheduleStartDate&&params.scheduleStartDate.length > 0) {
params.scheduleStartDateFrom = params.scheduleStartDate[0]
params.scheduleStartDateTo = params.scheduleStartDate[1]
}
if (params.outsourced) params.outsourced = Number(params.outsourced)
delete params.scheduleStartDate
delete params.scheduleEndDate
const response = await getListData(params)
this.maintenanceList = response.rows;
this.maintenanceList.forEach(s=>{
s.quantityWait = (s.quantity-s.quantityQualify)|0;
})
this.total = response.total;
this.loading = false;
},
// 取消按钮
cancel() {
this.open = false;
this.opena = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
toolMaintenanceId: null,
toolMaintenanceCode: null,
toolId: null,
maintenanceStatus: null,
maintenanceType: null,
itemCode: null,
toolName: null,
toolCode: null,
location: null,
processId: null,
processPerson: null,
lifeTime: null,
processTime: null,
startTime: null,
endTime: null, };
this.resetForm("form");
},
writeRow(row) {
this.editTimeLast = JSON.parse(JSON.stringify(row))
},
editTime(row, type){
const scheduleStartDate = dayjs(this.editTimeLast.scheduleStartDate)
const scheduleEndDate = dayjs(this.editTimeLast.scheduleEndDate)
if (type === 'start') {
const duration = scheduleEndDate.diff(scheduleStartDate)
row.scheduleEndDate = dayjs(row.scheduleStartDate).add(duration).format('YYYY-MM-DD HH:mm:ss')
} else {
const duration = scheduleStartDate.diff(scheduleEndDate)
console.log('duration', duration)
row.scheduleStartDate = dayjs(row.scheduleEndDate).add(duration).format('YYYY-MM-DD HH:mm:ss')
}
this.submitForm(row)
},
/** 搜索按钮操作 */
handleWorkunitQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetWorkunitQuery() {
this.resetForm("queryWorkunitForm");
this.handleWorkunitQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.statusArr = []
this.handleQuery();
},
handleBrandSelect(){
this.$refs.brSelect.showFlag = true;
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.taskWorkunitId)
this.selections = selection
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 提交按钮 */
async submitForm(row) {
const {scheduleStartDate, scheduleEndDate, taskWorkunitId, vendorId, vendorName, outsourceUnitPrice } = row
const params = {scheduleStartDate, scheduleEndDate, taskWorkunitId, vendorId, vendorName, outsourceUnitPrice }
await updateList(params)
this.$modal.msgSuccess("修改成功");
this.getList();
},
handleOutsource(){
this.$modal
.confirm('是否确认委外?')
.then( ()=> {
outsourceConfirm(this.ids).then(res => {
if(res.code === 200) {
this.$modal.msgSuccess("确认委外成功");
this.getList();
}
})
})
}
}
};
</script>
<style lang="scss" scoped>
.cardBox{
padding: 10px;
margin-right:30px;
max-height:600px;
overflow-y:auto;
.list{
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.list-item{
width: 100%;
padding: 10px;
border: 1px solid #eee;
border-radius: 6px;
margin-bottom:10px;
cursor: pointer;
.item-top{
font-size:16px;
font-weight: 600;
}
&:nth-child(2n) {
background:#dfdfdf;
}
&:nth-child(2n+1) {
background:#efefef;
}
&:hover{
background: #85ce61;
color:#fff;
}
&.active{
background: #85ce61;
color:#fff;
}
}
}
}
</style>
<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="taskCode" />
<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" />
<template v-if="title === '拆分'">
<el-table-column
label="拆分数量"
align="center"
prop="splitQuantity"
width="180"
> <template slot-scope="scope">
<el-input-number
style="width: 150px"
:step="1"
:min="0"
v-model="scope.row.splitQuantity"
/>
</template>
</el-table-column>
<el-table-column
label="委外单价"
align="center"
prop="outsourceUnitPrice"
width="180"
> <template slot-scope="scope">
<el-input-number
style="width: 150px"
:step="1"
:min="0"
v-model="scope.row.outsourceUnitPrice"
/>
</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>
</template>
<template v-else>
<el-table-column
label="自制数量"
align="center"
prop="toSelfMadeQuantity"
width="180"
> <template slot-scope="scope">
<el-input-number
style="width: 150px"
:step="1"
:min="0"
v-model="scope.row.toSelfMadeQuantity"
/>
</template>
</el-table-column>
<el-table-column
label="作业单元"
align="center"
prop="workunitName"
width="200"
>
<template slot-scope="scope">
<el-input v-model="scope.row.workunitName">
<el-button
slot="append"
icon="el-icon-search"
@click="currentData = scope.row, $refs['WorkunitSelect'].showFlag = true"
></el-button>
</el-input>
<WorkuintSelect
ref="WorkunitSelect"
:workstationId="currentData && currentData.workstationId"
@onSelected="onWorkunitSelect"
/>
</template>
</el-table-column>
</template>
<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 { outsourceSplit, toSelfMade } from '@/api/mes/pro/scheduleList'
import WorkuintSelect from "./workunitSelectSche.vue";
export default {
name: "taskList",
props: ["selections", 'title'],
components: {VendorSelect, WorkuintSelect},
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) => {
if (this.title === '拆分') {
const list = this.itemList.map(v => {
return {
"scheduleEndDate": v.scheduleEndDate,
"scheduleStartDate": v.scheduleStartDate,
"taskWorkunitId": v.taskWorkunitId,
"outsourceUnitPrice": v.outsourceUnitPrice,
"vendorId": v.vendorId,
"splitQuantity": v.splitQuantity,
"vendorName": v.vendorName
}
})
outsourceSplit(list).then(res => {
if(res.code === 200) {
this.$modal.msgSuccess('拆分成功')
resolve()
} else {
this.$modal.msgError(res.msg || "拆分失败")
reject()
}
})
} else {
const list = this.itemList.map(v => {
return {
"scheduleEndDate": v.scheduleEndDate,
"scheduleStartDate": v.scheduleStartDate,
"taskWorkunitId": v.taskWorkunitId,
"toSelfMadeQuantity": v.toSelfMadeQuantity,
"workunitCode": v.workunitCode,
"workunitId": v.workunitId
}
})
toSelfMade(list).then(res => {
if(res.code === 200) {
this.$modal.msgSuccess('转自制成功')
resolve()
} else {
this.$modal.msgError(res.msg || "转自制失败")
reject()
}
})
}
})
},
async onWorkunitSelect(obj) {
if (obj != undefined && obj != null) {
this.currentData.workunitId = obj.workunitId;
this.currentData.workunitCode = obj.workunitCode
this.currentData.workunitName = obj.workunitName;
}
this.$refs.WorkunitSelect.showFlag = false;
},
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;
}
this.$refs.vendorSelect.showFlag = false;
},
/** 查询物料编码列表 */
getList() {
const itemList = JSON.parse(JSON.stringify(this.selections));
itemList.forEach(element => {
if(this.title === '拆分') {
element['splitQuantity'] = element.quantity
} else {
element['toSelfMadeQuantity'] = element.quantity
}
});
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>
<template>
<el-dialog
title="工作单元选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal="false"
width="80%"
>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="工作单元编码" prop="workunitCode">
<el-input
v-model="queryParams.workunitCode"
placeholder="请输入工单编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工作单元名称" prop="workunitName">
<el-input
v-model="queryParams.workunitName"
placeholder="请输入工作单元名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工作中心" prop="workstationId">
<el-select filterable v-model="queryParams.workstationId" placeholder="请选择工作中心" clearable @change="getList">
<el-option
v-for="dict in workstationList"
:key="dict.workstationId"
:label="dict.workstationName"
:value="dict.workstationId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="workunitList"
@current-change="handleCurrent"
@row-dblclick="handleRowDbClick"
height="500px"
>
<el-table-column width="55" align="center">
<template v-slot="scope">
<el-radio
v-model="selectedWorkunitId"
:label="scope.row.workunitId"
@change="handleRowChange(scope.row)"
>{{ "" }}</el-radio
>
</template>
</el-table-column>
<el-table-column label="工作中心名称" width="180" prop="workstationName" />
<el-table-column
label="工作单元编码"
width="200"
align="center"
prop="workunitCode"
:show-overflow-tooltip="true"
/>
<el-table-column label="工作单元名称" align="center" prop="workunitName" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<el-button @click="showFlag = false">取 消</el-button>
<el-button type="primary" @click="confirmSelect">确 定</el-button>
</div>
</el-dialog>
</template>
<script>
import {
getworkstationList} from '@/api/mes/pro/scheduleList'
import { listByUser } from "@/api/system/user";
export default {
name: "WorkunitSelectSingle",
components: {},
dicts: [],
props: {
userId: undefined,
workstationName: {
type: String,
default: "",
},
workstationId: {
type: String | Number,
default: "",
},
workunitId: {
type: Number | undefined,
default: undefined,
}, //外部传入的工单过滤信息
},
data() {
return {
showFlag: false,
// 遮罩层
loading: true,
// 选中数组
selectedWorkunitId: undefined,
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 生产工单表格数据
workunitList: [],
workstationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
workunitCode: null,
userId: this.userId,
pageNum: 1,
pageSize: 10,
workunitName: null,
workstationId: this.workstationId,
workstationName: this.workstationName,
workunitId: null,
enableFlag: "Y",
},
};
},
watch: {
showFlag: {
handler(newName) {
this.selectedWorkunitId = null
this.selectedRows = []
this.queryParams.workstationName = this.workstationName;
this.queryParams.userId = this.userId;
this.queryParams.workstationId = this.workstationId;
this.getList();
this.hanldeGetworkstationList()
},
immediate: true
}
},
created() {
},
methods: {
async hanldeGetworkstationList() {
const response = await getworkstationList({workshopId: null})
this.workstationList = response.rows
},
/** 查询生产工单列表 */
getList() {
this.loading = true;
listByUser(this.queryParams).then((response) => {
this.workunitList = response.rows;
this.loading = false;
this.total = response.total
});
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleCurrent(row) {
console.log(row);
if (row) {
this.selectedRows = row;
}
},
// 单选选中数据
handleRowChange(row) {
if (row) {
this.selectedRows = row;
}
},
//双击选中
handleRowDbClick(row) {
if (row) {
this.selectedRows = row;
this.$emit("onSelected", this.selectedRows);
this.showFlag = false;
}
},
//确定选中
confirmSelect() {
if (this.selectedWorkunitId == null || this.selectedWorkunitId == 0) {
this.$notify({
title: "提示",
type: "warning",
message: "请至少选择一条数据!",
});
return;
}
this.$emit("onSelected", this.selectedRows);
this.showFlag = false;
},
},
};
</script>
\ No newline at end of file
...@@ -692,7 +692,7 @@ export default { ...@@ -692,7 +692,7 @@ export default {
this.queryParams.workCenterId = this.queryWorkunitParams.workstationId this.queryParams.workCenterId = this.queryWorkunitParams.workstationId
this.queryParams.workshopId = this.queryWorkunitParams.workshopId this.queryParams.workshopId = this.queryWorkunitParams.workshopId
this.loading = true; this.loading = true;
const params = {...this.queryParams} const params = {...this.queryParams, neWorkunitId: 1}
if (params.scheduleEndDate&&params.scheduleEndDate.length > 0) { if (params.scheduleEndDate&&params.scheduleEndDate.length > 0) {
params.scheduleEndDateFrom = params.scheduleEndDate[0] params.scheduleEndDateFrom = params.scheduleEndDate[0]
params.scheduleEndDateTo = params.scheduleEndDate[1] params.scheduleEndDateTo = params.scheduleEndDate[1]
......
...@@ -155,14 +155,15 @@ export default { ...@@ -155,14 +155,15 @@ export default {
this.currentData.vendorId = obj.vendorId; this.currentData.vendorId = obj.vendorId;
this.currentData.vendorName = obj.vendorName; this.currentData.vendorName = obj.vendorName;
} }
this.$refs.vendorSelect.showFlag = false;
}, },
/** 查询物料编码列表 */ /** 查询物料编码列表 */
getList() { getList() {
const itemList = JSON.parse(JSON.stringify(this.selections)); const itemList = JSON.parse(JSON.stringify(this.selections));
itemList.forEach(element => { itemList.forEach(element => {
element['toOutsourceQuantity'] = element.quantity element['toOutsourceQuantity'] = element.quantity
element['vendorName'] = null element['vendorName'] = element['vendorName'] || null
element['vendorId'] = null element['vendorId'] = element['vendorId'] || null
}); });
this.itemList = itemList this.itemList = itemList
}, },
......
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