Commit e7e91326 authored by 528360026@qq.com's avatar 528360026@qq.com

优化生产工单显示组合单

parent 68cbf634
This diff is collapsed.
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<!-- <el-table-column type="selection" width="55" align="center"/>--> <!-- <el-table-column type="selection" width="55" align="center"/>-->
<!-- <el-table-column label="销售订单号" align="center" prop="combinationId"/>--> <!-- <el-table-column label="销售订单号" align="center" prop="combinationId"/>-->
<!-- <el-table-column label="组合单号" align="center" prop="combinationCode"/>--> <!-- <el-table-column label="组合单号" align="center" prop="combinationCode"/>-->
<el-table-column label="组合编码" width="180" prop="combinationCode"> <el-table-column label="组合编码" width prop="combinationCode">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="序号" align="center" prop="combinationSort"/>--> <!-- <el-table-column label="序号" align="center" prop="combinationSort"/>-->
<el-table-column label="生产工单号" align="center" prop="workorderCode"/> <!-- <el-table-column label="生产工单号" align="center" prop="workorderCode"/>-->
<!-- <el-table-column label="销售订单号" align="center" prop="salesOrderNumber"/>--> <!-- <el-table-column label="销售订单号" align="center" prop="salesOrderNumber"/>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
</el-dialog> </el-dialog>
<el-dialog title="组合单明细" :visible.sync="combOpen" width="800px" append-to-body> <el-dialog title="组合单明细" :visible.sync="combOpen" width="800px" append-to-body @close="getList" >
<CombinationInfo :combinationCode="combinationCode"></CombinationInfo> <CombinationInfo :combinationCode="combinationCode"></CombinationInfo>
</el-dialog> </el-dialog>
</div> </div>
......
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">--> <!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
<!-- <el-form-item label="组合单号" prop="combinationCode">--> <!-- <el-form-item label="组合单号" prop="combinationCode">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="queryParams.combinationCode"--> <!-- v-model="queryParams.combinationCode"-->
<!-- placeholder="请输入组合单号"--> <!-- placeholder="请输入组合单号"-->
<!-- clearable--> <!-- clearable-->
<!-- @keyup.enter.native="handleQuery"--> <!-- @keyup.enter.native="handleQuery"-->
<!-- />--> <!-- />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- <el-form-item label="生产工单号" prop="workorderCode">--> <!-- <el-form-item label="生产工单号" prop="workorderCode">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="queryParams.workorderCode"--> <!-- v-model="queryParams.workorderCode"-->
<!-- placeholder="请输入生产工单号"--> <!-- placeholder="请输入生产工单号"-->
<!-- clearable--> <!-- clearable-->
<!-- @keyup.enter.native="handleQuery"--> <!-- @keyup.enter.native="handleQuery"-->
<!-- />--> <!-- />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- <el-form-item label="销售订单号" prop="salesOrderNumber">--> <!-- <el-form-item label="销售订单号" prop="salesOrderNumber">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="queryParams.salesOrderNumber"--> <!-- v-model="queryParams.salesOrderNumber"-->
<!-- placeholder="请输入销售订单号"--> <!-- placeholder="请输入销售订单号"-->
<!-- clearable--> <!-- clearable-->
<!-- @keyup.enter.native="handleQuery"--> <!-- @keyup.enter.native="handleQuery"-->
<!-- />--> <!-- />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- <el-form-item>--> <!-- <el-form-item>-->
<!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>--> <!-- <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-form>--> <!-- </el-form>-->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-plus"
size="mini"
:disabled="multiple"
@click="handleCombination"
v-hasPermi="['pro:combination:add']"
>拆分为组合单
</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
...@@ -139,6 +151,11 @@ ...@@ -139,6 +151,11 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="追加生产单" :visible.sync="combOpen" width="800px" append-to-body @close="getList">
<choose-workorder-for-comb :combinationCode="combinationCode"></choose-workorder-for-comb>
</el-dialog>
</div> </div>
</template> </template>
...@@ -148,12 +165,14 @@ import { ...@@ -148,12 +165,14 @@ import {
getCombination, getCombination,
delCombination, delCombination,
addCombination, addCombination,
updateCombination, combList updateCombination, combList, batchAddCombination
} from "@/api/mes/pro/combination"; } from "@/api/mes/pro/combination";
import {genCode} from "@/api/system/autocode/rule"; import {genCode} from "@/api/system/autocode/rule";
import ChooseWorkorderForComb from "@/views/mes/pro/combination/chooseWorkorderForComb.vue";
export default { export default {
name: "CombinationInfo", name: "CombinationInfo",
components: {ChooseWorkorderForComb},
props: { props: {
combinationCode: { combinationCode: {
type: String, type: String,
...@@ -164,6 +183,7 @@ export default { ...@@ -164,6 +183,7 @@ export default {
return { return {
// 遮罩层 // 遮罩层
loading: true, loading: true,
combOpen: false,
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
...@@ -176,6 +196,7 @@ export default { ...@@ -176,6 +196,7 @@ export default {
total: 0, total: 0,
// 生产组合单表格数据 // 生产组合单表格数据
combinationList: [], combinationList: [],
selectedRows: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -196,8 +217,6 @@ export default { ...@@ -196,8 +217,6 @@ export default {
{required: true, message: "序号不能为空", trigger: "blur"} {required: true, message: "序号不能为空", trigger: "blur"}
], workorderCode: [ ], workorderCode: [
{required: true, message: "生产工单号不能为空", trigger: "blur"} {required: true, message: "生产工单号不能为空", trigger: "blur"}
], salesOrderNumber: [
{required: true, message: "销售订单号不能为空", trigger: "blur"}
] ]
} }
}; };
...@@ -217,6 +236,25 @@ export default { ...@@ -217,6 +236,25 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
async handleCombination() {
let params = []
const res = await delCombination(this.ids);
this.selectedRows.forEach((item, index) => {
params.push({
combinationSort: index,
workorderId: item.workorderId,
workorderCode: item.workorderCode,
salesOrderId: 0,
combinationCode: null
})
});
batchAddCombination(params).then(response => {
this.$modal.msgSuccess("新增组合单成功");
this.getList();
});
},
genCode() { genCode() {
genCode('COMBINATION_CODE').then(response => { genCode('COMBINATION_CODE').then(response => {
this.form.oqcCode = response; this.form.oqcCode = response;
...@@ -233,7 +271,7 @@ export default { ...@@ -233,7 +271,7 @@ export default {
}, },
handleView(row){ handleView(row) {
this.reset(); this.reset();
this.getList(); this.getList();
const combinationCode = row.combinationCode; const combinationCode = row.combinationCode;
...@@ -266,13 +304,13 @@ export default { ...@@ -266,13 +304,13 @@ export default {
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.combinationId) this.ids = selection.map(item => item.combinationId)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.selectedRows = selection;
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.combOpen = true;
this.title = "添加生产组合单";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
......
...@@ -285,7 +285,17 @@ ...@@ -285,7 +285,17 @@
align="center" align="center"
prop="combinationCode" prop="combinationCode"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> >
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="showCombDetail(scope.row.combinationCode)"
>{{ scope.row.combinationCode }}
</el-button
>
</template>
</el-table-column>
<el-table-column <el-table-column
label="工单名称" label="工单名称"
width="200" width="200"
...@@ -731,6 +741,11 @@ ...@@ -731,6 +741,11 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="组合单明细" :visible.sync="combOpen" width="800px" append-to-body @close="getList">
<CombinationInfo :combinationCode="combinationCode"></CombinationInfo>
</el-dialog>
</div> </div>
</template> </template>
...@@ -755,6 +770,7 @@ import Treeselect from "@riophae/vue-treeselect"; ...@@ -755,6 +770,7 @@ 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"; import {addCombination, batchAddCombination} from "@/api/mes/pro/combination";
import CombinationInfo from "@/views/mes/pro/combination/info.vue";
export default { export default {
name: "Workorder", name: "Workorder",
...@@ -764,6 +780,7 @@ export default { ...@@ -764,6 +780,7 @@ export default {
"mes_workorder_type", "mes_workorder_type",
], ],
components: { components: {
CombinationInfo,
Treeselect, Treeselect,
ItemSelect, ItemSelect,
ClientSelect, ClientSelect,
...@@ -776,6 +793,8 @@ export default { ...@@ -776,6 +793,8 @@ export default {
//自动生成编码 //自动生成编码
autoGenFlag: false, autoGenFlag: false,
optType: undefined, optType: undefined,
combOpen: false,
combinationCode: [],
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 显示搜索条件 // 显示搜索条件
...@@ -873,8 +892,18 @@ export default { ...@@ -873,8 +892,18 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
showCombDetail(combinationCode) {
this.combOpen = true;
this.combinationCode = combinationCode;
},
async handleCombination() { async handleCombination() {
let params = [] let params = []
this.selectedRows.forEach((item, index) => {
if (item.combinationCode != '') {
this.$modal.msgWarning(`${item.workorderCode}生产单已绑定组合单,不能再绑定!`);
return
}
});
this.selectedRows.forEach((item, index) => { this.selectedRows.forEach((item, index) => {
params.push({ params.push({
combinationSort: index, combinationSort: index,
...@@ -1056,7 +1085,8 @@ export default { ...@@ -1056,7 +1085,8 @@ export default {
// this.optType="add"; // this.optType="add";
}, },
// 查询明细按钮操作 // 查询明细按钮操作
handleView(row) {handleView handleView(row) {
handleView
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
const workorderId = row.workorderId || this.ids; const workorderId = row.workorderId || this.ids;
......
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