Commit 6f86e825 authored by 528360026@qq.com's avatar 528360026@qq.com

更改组合单创建根据组合规格多个组合规则自动产生多个组合单

parent dc9b3799
......@@ -105,28 +105,30 @@
>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createBy"/>
<el-table-column label="创建时间" align="center" prop="createTime"/>
<!-- <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 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>
......
......@@ -99,7 +99,8 @@
<el-table-column label="组合单号" align="center" prop="combinationCode"/>
<el-table-column label="序号" align="center" width prop="combinationSort">
<template slot-scope="scope">
<el-input-number v-model="scope.row.combinationSort" @change="handleChangeSort(scope.row)" :min="0" style="width: 140px"
<el-input-number v-model="scope.row.combinationSort" @change="handleChangeSort(scope.row)" :min="0"
style="width: 140px"
label="序号"></el-input-number>
</template>
</el-table-column>
......@@ -229,18 +230,23 @@ export default {
watch: {
combinationCode: {
handler(newVal, oldVal) {
if (newVal) {
this.$nextTick(() => {
this.queryParams.combinationCode = newVal;
this.getList();
}
})
},
immediate: true
immediate: true,
deep: true
}
},
created() {
this.getList();
// this.getList();
},
methods: {
changeCombination(combinationCode) {
this.queryParams.combinationCode = combinationCode;
this.getList();
},
handleChangeSort(item) {
updateCombination({...item}).then(response => {
});
......
<template>
<div>
<el-tabs type="border-card">
<el-tab-pane v-for="item in combinationCodes">
<div slot="label" @click="changeCombination(item)">{{ item }}
</div>
<CombinationInfo ref="caonima" :combinationCode="combinationCode"></CombinationInfo>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import CombinationInfo from "./info.vue";
import Da from "element-ui/src/locale/lang/da";
export default {
name: "CombinationInfos",
components: {CombinationInfo},
props: {
combinationCodes: {
type: Array,
default: null
}
},
data() {
return {combinationCode: '', key: ''}
},
watch: {
combinationCodes: {
handler(newVal, oldVal) {
this.$nextTick(() => {
this.combinationCode = this.combinationCodes[0]
})
},
immediate: true
}
},
created() {
},
methods: {
changeCombination(combinationCode) {
this.$nextTick(() => {
this.combinationCode = combinationCode
this.$refs.caonima[0].changeCombination(combinationCode)
})
}
}
};
</script>
<style scoped>
</style>
......@@ -757,8 +757,9 @@
</el-dialog>
<el-dialog title="组合单明细" :visible.sync="combOpen" width="800px" append-to-body @close="getList">
<CombinationInfo :combinationCode="combinationCode"></CombinationInfo>
<el-dialog title="组合单明细" v-if="combOpen" :visible.sync="combOpen" width="800px" append-to-body
@close="getList">
<CombinationInfos :combinationCodes="combinationCodes"></CombinationInfos>
</el-dialog>
</div>
</template>
......@@ -784,7 +785,7 @@ import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {getToken} from "@/utils/auth";
import {addCombination, batchAddCombination} from "@/api/mes/pro/combination";
import CombinationInfo from "@/views/mes/pro/combination/info.vue";
import CombinationInfos from "@/views/mes/pro/combination/infos.vue";
import {batchAddArrange} from "@/api/mes/pro/arrange";
export default {
......@@ -795,7 +796,7 @@ export default {
"mes_workorder_type",
],
components: {
CombinationInfo,
CombinationInfos,
Treeselect,
ItemSelect,
ClientSelect,
......@@ -809,7 +810,7 @@ export default {
autoGenFlag: false,
optType: undefined,
combOpen: false,
combinationCode: [],
combinationCodes: [],
// 遮罩层
loading: true,
// 显示搜索条件
......@@ -909,7 +910,7 @@ export default {
methods: {
showCombDetail(combinationCode) {
this.combOpen = true;
this.combinationCode = combinationCode;
this.combinationCodes = [combinationCode];
},
async handleArrange() {
......@@ -936,26 +937,33 @@ export default {
},
async handleCombination() {
let params = []
this.selectedRows.forEach((item, index) => {
if (item.combinationCode != '') {
let hasNonEmptyCombination = false;
this.selectedRows.every((item, index) => {
if (item.combinationCode != '' && item.combinationCode != null) {
this.$modal.msgWarning(`${item.workorderCode}生产单已绑定组合单,不能再绑定!`);
return
hasNonEmptyCombination = true;
return false; // 结束every循环
}
return true; // 继续检查下一个项
});
this.selectedRows.forEach((item, index) => {
params.push({
combinationSort: index + 1,
workorderId: item.workorderId,
workorderCode: item.workorderCode,
salesOrderId: 0,
combinationCode: null
})
});
if (!hasNonEmptyCombination) {
this.selectedRows.forEach((item, index) => {
params.push({
combinationSort: index + 1,
workorderId: item.workorderId,
workorderCode: item.workorderCode,
salesOrderId: 0,
combinationCode: null
})
});
batchAddCombination(params).then(response => {
this.$modal.msgSuccess("新增组合单成功");
this.getList();
});
batchAddCombination(params).then(response => {
this.combOpen = true
this.combinationCodes = response
this.$modal.msgSuccess("新增组合单成功");
this.getList();
});
}
},
/** 查询生产工单列表 */
getList() {
......
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