Commit a02e1dec authored by 李驰骋's avatar 李驰骋

Merge remote-tracking branch 'origin/dev' into dev

parents fcf95c1b c4c71f47
import request from '@/utils/request'
// 查询生产组合单列表
export function listCombination(query) {
return request({
url: '/pro/combination/list',
method: 'get',
params: query
})
}
// 查询生产组合单列表
export function combList(query) {
return request({
url: '/pro/combination/combList',
method: 'get',
params: query
})
}
// 查询生产组合单详细
export function getCombination(combinationId) {
return request({
url: '/pro/combination/' + combinationId,
method: 'get'
})
}
// 新增生产组合单
export function addCombination(data) {
return request({
url: '/pro/combination',
method: 'post',
data: data
})
}
// 新增生产组合单
export function batchAddCombination(data) {
return request({
url: '/pro/combination/batchAdd',
method: 'post',
data: data
})
}
// 修改生产组合单
export function updateCombination(data) {
return request({
url: '/pro/combination',
method: 'put',
data: data
})
}
// 删除生产组合单
export function delCombination(combinationId) {
return request({
url: '/pro/combination/' + combinationId,
method: 'delete'
})
}
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="组合单号" prop="combinationCode">
<el-input
v-model="queryParams.combinationCode"
placeholder="请输入组合单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="序号" prop="combinationSort">-->
<!-- <el-input-->
<!-- v-model="queryParams.combinationSort"-->
<!-- placeholder="请输入序号"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<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="salesOrderNumber">
<el-input
v-model="queryParams.salesOrderNumber"
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
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['pro:combination:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['pro:combination:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['pro:combination:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['pro:combination:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="combinationList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center"/>-->
<!-- <el-table-column label="销售订单号" align="center" prop="combinationId"/>-->
<!-- <el-table-column label="组合单号" align="center" prop="combinationCode"/>-->
<el-table-column label="组合编码" width="180" prop="combinationCode">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleView(scope.row)"
>{{ scope.row.combinationCode }}
</el-button
>
</template>
</el-table-column>
<!-- <el-table-column label="序号" align="center" prop="combinationSort"/>-->
<el-table-column label="生产工单号" align="center" prop="workorderCode"/>
<!-- <el-table-column label="销售订单号" align="center" prop="salesOrderNumber"/>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['pro:combination:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['pro:combination:remove']"
>删除
</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"
/>
<!-- 添加或修改生产组合单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="组合单号" prop="combinationCode">
<el-input v-model="form.combinationCode" placeholder="请输入组合单号"/>
</el-form-item>
<el-form-item label="序号" prop="combinationSort">
<el-input v-model="form.combinationSort" placeholder="请输入序号"/>
</el-form-item>
<el-form-item label="生产工单号" prop="workorderCode">
<el-input v-model="form.workorderCode" placeholder="请输入生产工单号"/>
</el-form-item>
<el-form-item label="销售订单号" prop="salesOrderNumber">
<el-input v-model="form.salesOrderNumber" placeholder="请输入销售订单号"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<el-dialog title="组合单明细" :visible.sync="combOpen" width="800px" append-to-body>
<CombinationInfo :combinationCode="combinationCode"></CombinationInfo>
</el-dialog>
</div>
</template>
<script>
import {
listCombination,
getCombination,
delCombination,
addCombination,
updateCombination,
combList
} from "@/api/mes/pro/combination";
import {genCode} from "@/api/system/autocode/rule";
import CombinationInfo from "./info.vue";
export default {
name: "Combination",
components: {CombinationInfo},
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 生产组合单表格数据
combinationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
combinationCode: null, combinationSort: null, workorderCode: null, salesOrderNumber: null
},
// 表单参数
form: {},
// 表单校验
rules: {
combinationCode: [
{required: true, message: "组合单号不能为空", trigger: "blur"}
], combinationSort: [
{required: true, message: "序号不能为空", trigger: "blur"}
], workorderCode: [
{required: true, message: "生产工单号不能为空", trigger: "blur"}
], salesOrderNumber: [
{required: true, message: "销售订单号不能为空", trigger: "blur"}
]
},
combOpen: false,
combinationCode: ''
};
},
created() {
this.getList();
},
methods: {
genCode() {
genCode('COMBINATION_CODE').then(response => {
this.form.oqcCode = response;
});
},
/** 查询生产组合单列表 */
getList() {
this.loading = true;
combList(this.queryParams).then(response => {
this.combinationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleView(row) {
this.combOpen = true;
this.combinationCode = row.combinationCode;
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
combinationId: null, combinationCode: null, combinationSort: null, workorderCode: null, salesOrderNumber: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.combinationId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加生产组合单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const combinationId = row.combinationId || this.ids
getCombination(combinationId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改生产组合单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.combinationId != null) {
updateCombination(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCombination(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const combinationIds = row.combinationId || this.ids;
this.$modal.confirm('是否确认删除生产组合单编号为"' + combinationIds + '"的数据项?').then(function () {
return delCombination(combinationIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('pro/combination/export', {
...this.queryParams
}, `combination_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
<!-- <el-form-item label="组合单号" prop="combinationCode">-->
<!-- <el-input-->
<!-- v-model="queryParams.combinationCode"-->
<!-- placeholder="请输入组合单号"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <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="salesOrderNumber">-->
<!-- <el-input-->
<!-- v-model="queryParams.salesOrderNumber"-->
<!-- 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
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['pro:combination:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['pro:combination:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['pro:combination:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['pro:combination:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="combinationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="组合单号" align="center" prop="combinationCode"/>
<el-table-column label="序号" align="center" prop="combinationSort"/>
<el-table-column label="生产工单号" align="center" prop="workorderCode"/>
<!-- <el-table-column label="销售订单号" align="center" prop="salesOrderId"/>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['pro:combination:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['pro:combination:remove']"
>删除
</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"
/>
<!-- 添加或修改生产组合单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="组合单号" prop="combinationCode">
<el-input v-model="form.combinationCode" placeholder="请输入组合单号"/>
</el-form-item>
<el-form-item label="序号" prop="combinationSort">
<el-input v-model="form.combinationSort" placeholder="请输入序号"/>
</el-form-item>
<el-form-item label="生产工单号" prop="workorderCode">
<el-input v-model="form.workorderCode" placeholder="请输入生产工单号"/>
</el-form-item>
<el-form-item label="销售订单号" prop="salesOrderNumber">
<el-input v-model="form.salesOrderNumber" placeholder="请输入销售订单号"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listCombination,
getCombination,
delCombination,
addCombination,
updateCombination, combList
} from "@/api/mes/pro/combination";
import {genCode} from "@/api/system/autocode/rule";
export default {
name: "CombinationInfo",
props: {
combinationCode: {
type: String,
default: null
}
},
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 生产组合单表格数据
combinationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
combinationCode: null, combinationSort: null, workorderCode: null, salesOrderNumber: null
},
// 表单参数
form: {},
// 表单校验
rules: {
combinationCode: [
{required: true, message: "组合单号不能为空", trigger: "blur"}
], combinationSort: [
{required: true, message: "序号不能为空", trigger: "blur"}
], workorderCode: [
{required: true, message: "生产工单号不能为空", trigger: "blur"}
], salesOrderNumber: [
{required: true, message: "销售订单号不能为空", trigger: "blur"}
]
}
};
},
watch: {
combinationCode: {
handler(newVal, oldVal) {
if (newVal) {
this.queryParams.combinationCode = newVal;
this.getList();
}
},
immediate: true
}
},
created() {
this.getList();
},
methods: {
genCode() {
genCode('COMBINATION_CODE').then(response => {
this.form.oqcCode = response;
});
},
/** 查询生产组合单列表 */
getList() {
this.loading = true;
listCombination(this.queryParams).then(response => {
this.combinationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleView(row){
this.reset();
this.getList();
const combinationCode = row.combinationCode;
this.$router.push("/mes/pro/combination/info?combinationCode=" + combinationCode);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
combinationId: null, combinationCode: null, combinationSort: null, workorderCode: null, salesOrderNumber: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.combinationId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加生产组合单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const combinationId = row.combinationId || this.ids
getCombination(combinationId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改生产组合单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.combinationId != null) {
updateCombination(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCombination(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const combinationIds = row.combinationId || this.ids;
this.$modal.confirm('是否确认删除生产组合单编号为"' + combinationIds + '"的数据项?').then(function () {
return delCombination(combinationIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('pro/combination/export', {
...this.queryParams
}, `combination_${new Date().getTime()}.xlsx`)
}
}
};
</script>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <!-- <el-button
type="primary" type="primary"
plain plain
icon="el-icon-plus" icon="el-icon-plus"
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['pro:materialRequest:export']" v-hasPermi="['pro:materialRequest:export']"
>导出</el-button> >导出</el-button> -->
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
</el-form-item> --> </el-form-item> -->
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select value="['','']" <el-select value="['','']"
v-model="queryParams.statusArr" v-model="queryParams.statusArr"
clearable clearable
placeholder="请选择状态" placeholder="请选择状态"
multiple="true" multiple="true"
> >
<el-option <el-option
v-for="dict in dict.type.mes_workorder_status" v-for="dict in dict.type.mes_workorder_status"
...@@ -106,10 +106,12 @@ ...@@ -106,10 +106,12 @@
icon="el-icon-search" icon="el-icon-search"
size="mini" size="mini"
@click="handleQuery" @click="handleQuery"
>搜索</el-button >搜索
</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button >重置
</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -123,7 +125,8 @@ ...@@ -123,7 +125,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['mes:pro:workorder:add']" v-hasPermi="['mes:pro:workorder:add']"
>新增</el-button >新增
</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -135,7 +138,8 @@ ...@@ -135,7 +138,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['mes:pro:workorder:edit']" v-hasPermi="['mes:pro:workorder:edit']"
>修改</el-button >修改
</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -147,7 +151,8 @@ ...@@ -147,7 +151,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['mes:pro:workorder:remove']" v-hasPermi="['mes:pro:workorder:remove']"
>删除</el-button >删除
</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -158,7 +163,8 @@ ...@@ -158,7 +163,8 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['mes:pro:workorder:export']" v-hasPermi="['mes:pro:workorder:export']"
>导出</el-button >导出
</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -167,10 +173,23 @@ ...@@ -167,10 +173,23 @@
plain plain
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
:disabled="single" :disabled="multiple"
@click="handleCombination"
v-hasPermi="['mes:pro:workorder:dofinish']"
>创建组合单
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-plus"
size="mini"
:disabled="multiple"
@click="handleDofinish" @click="handleDofinish"
v-hasPermi="['mes:pro:workorder:dofinish']" v-hasPermi="['mes:pro:workorder:dofinish']"
>生成任务单</el-button >生成任务单
</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -179,10 +198,11 @@ ...@@ -179,10 +198,11 @@
plain plain
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
:disabled="single" :disabled="multiple"
@click="handleToolNumCheck" @click="handleToolNumCheck"
v-hasPermi="['mes:pro:workorder:dofinish']" v-hasPermi="['mes:pro:workorder:dofinish']"
>工装量具齐套检查</el-button >工装量具齐套检查
</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -193,7 +213,8 @@ ...@@ -193,7 +213,8 @@
size="mini" size="mini"
@click="handleImport" @click="handleImport"
v-hasPermi="['mes:pro:workorder:edit']" v-hasPermi="['mes:pro:workorder:edit']"
>导入工单</el-button >导入工单
</el-button
> >
</el-col> </el-col>
<right-toolbar <right-toolbar
...@@ -225,7 +246,8 @@ ...@@ -225,7 +246,8 @@
:underline="false" :underline="false"
style="font-size: 12px; vertical-align: baseline" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate" @click="importTemplate"
>下载模板</el-link >下载模板
</el-link
> >
</div> </div>
</el-upload> </el-upload>
...@@ -244,15 +266,16 @@ ...@@ -244,15 +266,16 @@
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
> >
<!-- 新增复选框 --> <!-- 新增复选框 -->
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="工单编码" width="180" prop="workorderCode"> <el-table-column label="工单编码" width="180" prop="workorderCode">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@click="handleView(scope.row)" @click="(scope.row)"
v-hasPermi="['mes:pro:workorder:query']" v-hasPermi="['mes:pro:workorder:query']"
>{{ scope.row.workorderCode }}</el-button >{{ scope.row.workorderCode }}
</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
...@@ -311,9 +334,9 @@ ...@@ -311,9 +334,9 @@
prop="productSpc" prop="productSpc"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column label="单位" align="center" prop="unitOfMeasure" /> <el-table-column label="单位" align="center" prop="unitOfMeasure"/>
<el-table-column label="工单数量" align="center" prop="quantity" /> <el-table-column label="工单数量" align="center" prop="quantity"/>
<el-table-column label="调整数量" align="center" prop="quantityChanged" /> <el-table-column label="调整数量" align="center" prop="quantityChanged"/>
<el-table-column <el-table-column
label="已生产数量" label="已生产数量"
align="center" align="center"
...@@ -332,7 +355,7 @@ ...@@ -332,7 +355,7 @@
width="100px" width="100px"
prop="arrangeCode" prop="arrangeCode"
/> />
<el-table-column label="客户编码" align="center" prop="clientCode" /> <el-table-column label="客户编码" align="center" prop="clientCode"/>
<el-table-column <el-table-column
label="客户名称" label="客户名称"
align="center" align="center"
...@@ -372,7 +395,8 @@ ...@@ -372,7 +395,8 @@
v-if="scope.row.status == 'PREPARE'" v-if="scope.row.status == 'PREPARE'"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['mes:pro:workorder:edit']" v-hasPermi="['mes:pro:workorder:edit']"
>修改</el-button >修改
</el-button
> >
<el-button <el-button
size="mini" size="mini"
...@@ -381,7 +405,8 @@ ...@@ -381,7 +405,8 @@
v-if="scope.row.status == 'PREPARE'" v-if="scope.row.status == 'PREPARE'"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['mes:pro:workorder:remove']" v-hasPermi="['mes:pro:workorder:remove']"
>删除</el-button >删除
</el-button
> >
<!-- <el-button <!-- <el-button
size="mini" size="mini"
...@@ -469,7 +494,8 @@ ...@@ -469,7 +494,8 @@
v-for="dict in dict.type.mes_workorder_sourcetype" v-for="dict in dict.type.mes_workorder_sourcetype"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{ dict.label }}</el-radio >{{ dict.label }}
</el-radio
> >
</el-radio-group> </el-radio-group>
<el-radio-group v-model="form.orderSource" v-else> <el-radio-group v-model="form.orderSource" v-else>
...@@ -477,7 +503,8 @@ ...@@ -477,7 +503,8 @@
v-for="dict in dict.type.mes_workorder_sourcetype" v-for="dict in dict.type.mes_workorder_sourcetype"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{ dict.label }}</el-radio >{{ dict.label }}
</el-radio
> >
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
...@@ -582,7 +609,7 @@ ...@@ -582,7 +609,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="批次号" prop="batchCode"> <el-form-item label="批次号" prop="batchCode">
<el-input v-model="form.batchCode" placeholder="请输入批次号" /> <el-input v-model="form.batchCode" placeholder="请输入批次号"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -626,7 +653,7 @@ ...@@ -626,7 +653,7 @@
icon="el-icon-search" icon="el-icon-search"
></el-button> ></el-button>
</el-input> </el-input>
<VendorSelect ref="vendorSelect" @onSelected="onVendorSelected" /> <VendorSelect ref="vendorSelect" @onSelected="onVendorSelected"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -666,20 +693,22 @@ ...@@ -666,20 +693,22 @@
@handleAddSub="handleSubAdd" @handleAddSub="handleSubAdd"
></Workorderbom> ></Workorderbom>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="物料需求"> </el-tab-pane> <el-tab-pane label="物料需求"></el-tab-pane>
</el-tabs> </el-tabs>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button <el-button
type="primary" type="primary"
@click="cancel" @click="cancel"
v-if="optType == 'view' || form.status != 'PREPARE'" v-if="optType == 'view' || form.status != 'PREPARE'"
>返回</el-button >返回
</el-button
> >
<el-button <el-button
type="primary" type="primary"
@click="submitForm" @click="submitForm"
v-if="form.status == 'PREPARE' && optType != 'view'" v-if="form.status == 'PREPARE' && optType != 'view'"
> </el-button >
</el-button
> >
<el-button <el-button
type="success" type="success"
...@@ -689,7 +718,8 @@ ...@@ -689,7 +718,8 @@
optType != 'view' && optType != 'view' &&
form.workorderId != null form.workorderId != null
" "
> </el-button >
</el-button
> >
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
...@@ -698,517 +728,540 @@ ...@@ -698,517 +728,540 @@
</template> </template>
<script> <script>
import { import {
listWorkorder, listWorkorder,
getWorkorder, getWorkorder,
delWorkorder, delWorkorder,
addWorkorder, addWorkorder,
updateWorkorder, updateWorkorder,
dofinish, dofinish,
doCheckToolNum doCheckToolNum
} from "@/api/mes/pro/workorder"; } from "@/api/mes/pro/workorder";
import { addProtaskList } from "@/api/mes/pro/protask"; import {addProtaskList} from "@/api/mes/pro/protask";
import Workorderbom from "./bom/bom.vue"; import Workorderbom from "./bom/bom.vue";
import WorkorderItemList from "./items/item.vue"; import WorkorderItemList from "./items/item.vue";
import ItemSelect from "@/components/itemSelect/single.vue"; import ItemSelect from "@/components/itemSelect/single.vue";
import ClientSelect from "@/components/clientSelect/single.vue"; import ClientSelect from "@/components/clientSelect/single.vue";
import VendorSelect from "@/components/vendorSelect/single.vue"; import VendorSelect from "@/components/vendorSelect/single.vue";
import { genCode } from "@/api/system/autocode/rule"; import {genCode} from "@/api/system/autocode/rule";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getToken } from "@/utils/auth"; import {getToken} from "@/utils/auth";
import {addCombination, batchAddCombination} from "@/api/mes/pro/combination";
export default { export default {
name: "Workorder", name: "Workorder",
dicts: [ dicts: [
"mes_workorder_status", "mes_workorder_status",
"mes_workorder_sourcetype", "mes_workorder_sourcetype",
"mes_workorder_type", "mes_workorder_type",
], ],
components: { components: {
Treeselect, Treeselect,
ItemSelect, ItemSelect,
ClientSelect, ClientSelect,
VendorSelect, VendorSelect,
Workorderbom, Workorderbom,
WorkorderItemList, WorkorderItemList,
}, },
data() { data() {
return { return {
//自动生成编码 //自动生成编码
autoGenFlag: false, autoGenFlag: false,
optType: undefined, optType: undefined,
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 总条数 // 总条数
total: 0, total: 0,
// 非多个禁用 // 非多个禁用
multiple: true, multiple: true,
// 生产工单表格数据 // 生产工单表格数据
workorderList: [], workorderList: [],
// 生产工单树选项 // 生产工单树选项
workorderOptions: [], workorderOptions: [],
selectedRows: [], selectedRows: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false,
upload: {
// 是否显示弹出层(用户导入)
open: false, open: false,
upload: { // 弹出层标题(用户导入)
// 是否显示弹出层(用户导入) title: "",
open: false, // 是否禁用上传
// 弹出层标题(用户导入) isUploading: false,
title: "", // 是否更新已经存在的用户数据
// 是否禁用上传 updateSupport: 0,
isUploading: false, // 设置上传的请求头部
// 是否更新已经存在的用户数据 headers: {Authorization: "Bearer " + getToken()},
updateSupport: 0, // 上传的地址
// 设置上传的请求头部 url: process.env.VUE_APP_BASE_API + "/mes/pro/workorder/importData",
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/mes/pro/workorder/importData",
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
workorderCode: null,
workorderName: null,
orderSource: null,
sourceCode: null,
productId: null,
productCode: null,
productName: null,
productSpc: null,
routeName: null,
unitOfMeasure: null,
quantity: null,
quantityProduced: null,
quantityChanged: null,
quantityScheduled: null,
clientId: null,
clientCode: null,
clientName: null,
requestDate: null,
parentId: null,
ancestors: null,
statusArr: ["PREPARE","PUBLISHED"],
},
// 表单参数
form: {},
// 表单校验
rules: {
workorderCode: [
{ required: true, message: "工单编码不能为空", trigger: "blur" },
],
workorderName: [
{ required: true, message: "工单名称不能为空", trigger: "blur" },
],
workorderType: [
{ required: true, message: "请选择生产工单类型", trigger: "blur" },
],
orderSource: [
{ required: true, message: "来源类型不能为空", trigger: "blur" },
],
productId: [
{ required: true, message: "产品不能为空", trigger: "blur" },
],
productCode: [
{ required: true, message: "产品编号不能为空", trigger: "blur" },
],
productName: [
{ required: true, message: "产品名称不能为空", trigger: "blur" },
],
quantity: [
{ required: true, message: "生产数量不能为空", trigger: "blur" },
],
requestDate: [
{ required: true, message: "需求日期不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询生产工单列表 */
getList() {
this.loading = true;
listWorkorder(this.queryParams).then((response) => {
this.workorderList = this.handleTree(
response.rows,
"workorderId",
"parentId"
);
this.total = response.total;
this.loading = false;
});
},
importTemplate() {
this.download(
"mes/pro/workorder/importTemplate",
{},
`work_order_template_${new Date().getTime()}.xlsx`
);
}, },
/** 导入按钮操作 */ // 查询参数
handleImport() { queryParams: {
this.upload.open = true; pageNum: 1,
pageSize: 10,
workorderCode: null,
workorderName: null,
orderSource: null,
sourceCode: null,
productId: null,
productCode: null,
productName: null,
productSpc: null,
routeName: null,
unitOfMeasure: null,
quantity: null,
quantityProduced: null,
quantityChanged: null,
quantityScheduled: null,
clientId: null,
clientCode: null,
clientName: null,
requestDate: null,
parentId: null,
ancestors: null,
statusArr: ["PREPARE", "PUBLISHED"],
}, },
// 文件上传中处理 // 表单参数
handleFileUploadProgress(event, file, fileList) { form: {},
this.upload.isUploading = true; // 表单校验
rules: {
workorderCode: [
{required: true, message: "工单编码不能为空", trigger: "blur"},
],
workorderName: [
{required: true, message: "工单名称不能为空", trigger: "blur"},
],
workorderType: [
{required: true, message: "请选择生产工单类型", trigger: "blur"},
],
orderSource: [
{required: true, message: "来源类型不能为空", trigger: "blur"},
],
productId: [
{required: true, message: "产品不能为空", trigger: "blur"},
],
productCode: [
{required: true, message: "产品编号不能为空", trigger: "blur"},
],
productName: [
{required: true, message: "产品名称不能为空", trigger: "blur"},
],
quantity: [
{required: true, message: "生产数量不能为空", trigger: "blur"},
],
requestDate: [
{required: true, message: "需求日期不能为空", trigger: "blur"},
],
}, },
// 文件上传成功处理 };
handleFileSuccess(response, file, fileList) { },
this.upload.open = false; created() {
this.upload.isUploading = false; this.getList();
this.$refs.upload.clearFiles(); },
this.$alert( methods: {
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + async handleCombination() {
response.msg + let params = []
"</div>", this.selectedRows.forEach((item, index) => {
"导入结果", params.push({
{ dangerouslyUseHTMLString: true } combinationSort: index,
); workorderId: item.workorderId,
workorderCode: item.workorderCode,
salesOrderId: 0,
combinationCode: null
})
});
batchAddCombination(params).then(response => {
this.$modal.msgSuccess("新增组合单成功");
this.getList(); this.getList();
}, });
// 提交上传文件 },
submitFileForm() { /** 查询生产工单列表 */
this.$refs.upload.submit(); getList() {
}, this.loading = true;
/** 转换生产工单数据结构 */ listWorkorder(this.queryParams).then((response) => {
normalizer(node) { this.workorderList = this.handleTree(
if (node.children && !node.children.length) { response.rows,
delete node.children; "workorderId",
} "parentId"
return { );
id: node.workorderId, this.total = response.total;
label: node.workorderName, this.loading = false;
children: node.children, });
}; },
}, importTemplate() {
/** 查询生产工单下拉树结构 */ this.download(
getTreeselect() { "mes/pro/workorder/importTemplate",
listWorkorder().then((response) => { {},
this.workorderOptions = []; `work_order_template_${new Date().getTime()}.xlsx`
const data = { );
workorderId: 0, },
workorderName: "顶级节点", /** 导入按钮操作 */
children: [], handleImport() {
}; this.upload.open = true;
data.children = this.handleTree( },
response.data, // 文件上传中处理
"workorderId", handleFileUploadProgress(event, file, fileList) {
"parentId" this.upload.isUploading = true;
); },
this.workorderOptions.push(data); // 文件上传成功处理
}); handleFileSuccess(response, file, fileList) {
}, this.upload.open = false;
// 取消按钮 this.upload.isUploading = false;
cancel() { this.$refs.upload.clearFiles();
this.open = false; this.$alert(
this.reset(); "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
}, response.msg +
// 表单重置 "</div>",
reset() { "导入结果",
this.form = { {dangerouslyUseHTMLString: true}
workorderId: null, );
workorderCode: null, this.getList();
workorderName: null, },
workorderType: "SELF", // 提交上传文件
orderSource: null, submitFileForm() {
sourceCode: null, this.$refs.upload.submit();
productId: null, },
productCode: null, /** 转换生产工单数据结构 */
productName: null, normalizer(node) {
productSpc: null, if (node.children && !node.children.length) {
routeName: null, delete node.children;
unitOfMeasure: null, }
quantity: null, return {
quantityProduced: null, id: node.workorderId,
quantityChanged: null, label: node.workorderName,
quantityScheduled: null, children: node.children,
clientId: null, };
clientCode: null, },
clientName: null, /** 查询生产工单下拉树结构 */
vendorId: null, getTreeselect() {
vendorCode: null, listWorkorder().then((response) => {
vendorName: null, this.workorderOptions = [];
requestDate: null, const data = {
parentId: null, workorderId: 0,
status: "PREPARE", workorderName: "顶级节点",
remark: null, children: [],
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
}; };
this.autoGenFlag = false; data.children = this.handleTree(
this.resetForm("form"); response.data,
}, "workorderId",
/** 搜索按钮操作 */ "parentId"
handleQuery() { );
this.getList(); this.workorderOptions.push(data);
}, });
},
/** 重置按钮操作 */ // 取消按钮
resetQuery() { cancel() {
this.resetForm("queryForm"); this.open = false;
this.handleQuery(); this.reset();
}, },
//从BOM行中直接新增 // 表单重置
handleSubAdd(row) { reset() {
this.open = false; this.form = {
this.reset(); workorderId: null,
this.getTreeselect(); workorderCode: null,
if (row != null && row.workorderId) { workorderName: null,
this.form = row; workorderType: "SELF",
this.form.parentId = row.workorderId; orderSource: null,
this.form.workorderId = null; sourceCode: null,
this.form.workorderCode = null; productId: null,
} else { productCode: null,
this.form.parentId = 0; productName: null,
} productSpc: null,
this.open = true; routeName: null,
this.title = "添加生产工单"; unitOfMeasure: null,
this.optType = "add"; quantity: null,
}, quantityProduced: null,
/** 新增按钮操作 */ quantityChanged: null,
handleAdd(row) { quantityScheduled: null,
this.getTreeselect(); clientId: null,
// 跳转到申请单界 clientCode: null,
this.$router.push("/mes/pro/workorder/apply"); clientName: null,
return; vendorId: null,
// this.reset(); vendorCode: null,
// this.getTreeselect(); vendorName: null,
// if (row != null && row.workorderId) { requestDate: null,
// this.form.parentId = row.workorderId; parentId: null,
// this.form.orderSource = row.orderSource; status: "PREPARE",
// this.form.sourceCode = row.sourceCode; remark: null,
// this.form.clientId = row.clientId; createBy: null,
// this.form.clientCode = row.clientCode; createTime: null,
// this.form.clientName = row.clientName; updateBy: null,
// } else { updateTime: null,
// this.form.parentId = 0; };
// } this.autoGenFlag = false;
// this.open = true; this.resetForm("form");
// this.title = "添加生产工单"; },
// this.optType="add"; /** 搜索按钮操作 */
}, handleQuery() {
// 查询明细按钮操作 this.getList();
handleView(row) { },
this.reset();
this.getTreeselect();
const workorderId = row.workorderId || this.ids;
this.$router.push("/mes/pro/workorder/info?workorderId=" + workorderId);
// this.reset(); /** 重置按钮操作 */
// this.getTreeselect(); resetQuery() {
// const workorderId = row.workorderId || this.ids; this.resetForm("queryForm");
// getWorkorder(workorderId).then(response => { this.handleQuery();
// this.form = response.data; },
// this.open = true; //从BOM行中直接新增
// this.title = "查看工单信息"; handleSubAdd(row) {
// this.optType = "view"; this.open = false;
// }); this.reset();
}, this.getTreeselect();
handleSelectionChange(selection) { if (row != null && row.workorderId) {
this.form = row;
this.form.parentId = row.workorderId;
this.form.workorderId = null;
this.form.workorderCode = null;
} else {
this.form.parentId = 0;
}
this.open = true;
this.title = "添加生产工单";
this.optType = "add";
},
/** 新增按钮操作 */
handleAdd(row) {
this.getTreeselect();
// 跳转到申请单界
this.$router.push("/mes/pro/workorder/apply");
return;
// this.reset();
// this.getTreeselect();
// if (row != null && row.workorderId) {
// this.form.parentId = row.workorderId;
// this.form.orderSource = row.orderSource;
// this.form.sourceCode = row.sourceCode;
// this.form.clientId = row.clientId;
// this.form.clientCode = row.clientCode;
// this.form.clientName = row.clientName;
// } else {
// this.form.parentId = 0;
// }
// this.open = true;
// this.title = "添加生产工单";
// this.optType="add";
},
// 查询明细按钮操作
handleView(row) {handleView
this.reset();
this.getTreeselect();
const workorderId = row.workorderId || this.ids;
this.$router.push("/mes/pro/workorder/info?workorderId=" + workorderId);
// this.reset();
// this.getTreeselect();
// const workorderId = row.workorderId || this.ids;
// getWorkorder(workorderId).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "查看工单信息";
// this.optType = "view";
// });
},
handleSelectionChange(selection) {
// this.selectedRows = val; // this.selectedRows = val;
this.selectedRows = selection; this.selectedRows = selection;
this.ids = selection.map(item => item.toolId) this.ids = selection.map(item => item.toolId)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
// // 多选框选中数据 // // 多选框选中数据
// handleSelectionChange(selection) { // handleSelectionChange(selection) {
// this.ids = selection.map(item => item.toolId) // this.ids = selection.map(item => item.toolId)
// this.single = selection.length!==1 // this.single = selection.length!==1
// this.multiple = !selection.length // this.multiple = !selection.length
// }, // },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const workorderId = row.workorderId || this.ids; const workorderId = row.workorderId || this.ids;
this.$router.push("/mes/pro/workorder/edit?workorderId=" + workorderId); this.$router.push("/mes/pro/workorder/edit?workorderId=" + workorderId);
// this.reset(); // this.reset();
// this.getTreeselect(); // this.getTreeselect();
// if (row != null) { // if (row != null) {
// this.form.parentId = row.workorderId; // this.form.parentId = row.workorderId;
// } // }
// getWorkorder(row.workorderId).then(response => { // getWorkorder(row.workorderId).then(response => {
// this.form = response.data; // this.form = response.data;
// this.open = true; // this.open = true;
// this.title = "修改生产工单"; // this.title = "修改生产工单";
// this.optType="edit"; // this.optType="edit";
// }); // });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.workorderId != null) { if (this.form.workorderId != null) {
updateWorkorder(this.form).then((response) => { updateWorkorder(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
//this.open = false; //this.open = false;
this.$refs["bomlist"].getList(); this.$refs["bomlist"].getList();
this.getList(); this.getList();
}); });
} else { } else {
addWorkorder(this.form).then((response) => { addWorkorder(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
//this.open = false; //this.open = false;
this.form.workorderId = response.data; this.form.workorderId = response.data;
this.getList(); this.getList();
}); });
}
} }
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm(
'是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?'
)
.then(function () {
return delWorkorder(row.workorderId);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {
}); });
}, },
/** 删除按钮操作 */ /** 生产任务单操作 */
handleDelete(row) { handleDofinish() {
this.$modal this.$modal
.confirm( .confirm("是否生成选中的任务单?")
'是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?' .then(() => {
) const ids = this.selectedRows.map((v) => v.workorderId);
.then(function () { console.log("00000", ids);
return delWorkorder(row.workorderId);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 生产任务单操作 */
handleDofinish() {
this.$modal
.confirm("是否生成选中的任务单?")
.then(() => {
const ids = this.selectedRows.map((v) => v.workorderId);
console.log("00000", ids);
return addProtaskList(ids); return addProtaskList(ids);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("生成成功"); this.$modal.msgSuccess("生成成功");
}) })
.catch(() => {}); .catch(() => {
}, });
handleToolNumCheck(){ },
this.$modal handleToolNumCheck() {
.confirm("是否检查刀具模版齐套?") this.$modal
.then(() => { .confirm("是否检查刀具模版齐套?")
const ids = this.selectedRows.map((v) => v.workorderId); .then(() => {
return doCheckToolNum(ids); const ids = this.selectedRows.map((v) => v.workorderId);
}) return doCheckToolNum(ids);
.then(() => { })
this.getList(); .then(() => {
this.$modal.msgSuccess("已齐套"); this.getList();
}) this.$modal.msgSuccess("已齐套");
.catch(() => {}); })
}, .catch(() => {
handleSelectProduct() { });
this.$refs.itemSelect.showFlag = true; },
}, handleSelectProduct() {
handleSelectClient() { this.$refs.itemSelect.showFlag = true;
this.$refs.clientSelect.showFlag = true; },
}, handleSelectClient() {
/** 导出按钮操作 */ this.$refs.clientSelect.showFlag = true;
handleExport() { },
this.download( /** 导出按钮操作 */
"mes/pro/workorder/export", handleExport() {
{ this.download(
...this.queryParams, "mes/pro/workorder/export",
}, {
`workorder_${new Date().getTime()}.xlsx` ...this.queryParams,
); },
}, `workorder_${new Date().getTime()}.xlsx`
handleConfirm() { );
let that = this; },
this.$modal handleConfirm() {
.confirm("是确认完成工单编制?【确认后将不能更改】") let that = this;
.then(function () { this.$modal
that.form.status = "CONFIRMED"; .confirm("是确认完成工单编制?【确认后将不能更改】")
that.submitForm(); .then(function () {
}); that.form.status = "CONFIRMED";
}, that.submitForm();
handleFinish(row) { });
const workorderIds = row.workorderId || this.ids; },
this.$modal handleFinish(row) {
.confirm("确认完成工单?一旦完成,此工单将无法继续报工") const workorderIds = row.workorderId || this.ids;
.then(function () { this.$modal
return dofinish(workorderIds); //完成工单 .confirm("确认完成工单?一旦完成,此工单将无法继续报工")
}) .then(function () {
.then(() => { return dofinish(workorderIds); //完成工单
this.getList(); })
this.$modal.msgSuccess("更改成功"); .then(() => {
}) this.getList();
.catch(() => {}); this.$modal.msgSuccess("更改成功");
}, })
// //物料选择弹出框 .catch(() => {
// onItemSelected(obj){ });
// if(obj != undefined && obj != null){ },
// this.form.productId = obj.itemId; // //物料选择弹出框
// this.form.productCode = obj.itemCode; // onItemSelected(obj){
// this.form.productName = obj.itemName; // if(obj != undefined && obj != null){
// this.form.productSpc = obj.specification; // this.form.productId = obj.itemId;
// this.form.unitOfMeasure = obj.unitOfMeasure; // this.form.productCode = obj.itemCode;
// } // this.form.productName = obj.itemName;
// }, // this.form.productSpc = obj.specification;
//客户选择弹出框 // this.form.unitOfMeasure = obj.unitOfMeasure;
onClientSelected(obj) { // }
if (obj != undefined && obj != null) { // },
this.form.clientId = obj.clientId; //客户选择弹出框
this.form.clientCode = obj.clientCode; onClientSelected(obj) {
this.form.clientName = obj.clientName; if (obj != undefined && obj != null) {
} this.form.clientId = obj.clientId;
}, this.form.clientCode = obj.clientCode;
//供应商选择 this.form.clientName = obj.clientName;
handleSelectVendor() { }
this.$refs.vendorSelect.showFlag = true; },
}, //供应商选择
//供应商选择弹出框 handleSelectVendor() {
onVendorSelected(obj) { this.$refs.vendorSelect.showFlag = true;
debugger; },
if (obj != undefined && obj != null) { //供应商选择弹出框
this.form.vendorId = obj.vendorId; onVendorSelected(obj) {
this.form.vendorCode = obj.vendorCode; debugger;
this.form.vendorName = obj.vendorName; if (obj != undefined && obj != null) {
} this.form.vendorId = obj.vendorId;
}, this.form.vendorCode = obj.vendorCode;
/** 完成任务单操作 */ this.form.vendorName = obj.vendorName;
confirmWorkorder(row) { }
this.$modal },
.confirm( /** 完成任务单操作 */
'是否将工单编号"' + row.workorderCode + '"的草稿数据项改为已确认?' confirmWorkorder(row) {
) this.$modal
.then(function () { .confirm(
return confirmedWorkorder(row.workorderId); '是否将工单编号"' + row.workorderCode + '"的草稿数据项改为已确认?'
}) )
.then(() => { .then(function () {
this.getList(); return confirmedWorkorder(row.workorderId);
this.$modal.msgSuccess("已确认成功"); })
}) .then(() => {
.catch(() => {}); this.getList();
}, this.$modal.msgSuccess("已确认成功");
//自动生成编码 })
handleAutoGenChange(autoGenFlag) { .catch(() => {
if (autoGenFlag) { });
genCode("WORKORDER_CODE").then((response) => { },
this.form.workorderCode = response; //自动生成编码
}); handleAutoGenChange(autoGenFlag) {
} else { if (autoGenFlag) {
this.form.workorderCode = null; genCode("WORKORDER_CODE").then((response) => {
} this.form.workorderCode = response;
}, });
} else {
this.form.workorderCode = null;
}
}, },
}; },
};
</script> </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