更新班组
This commit is contained in:
69
src/views/group/Schedule/bind-line.vue
Normal file
69
src/views/group/Schedule/bind-line.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-16 16:37:40
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div style="width: 100%; display: flex; justify-content: center">
|
||||
<tree-transfer
|
||||
:title="title"
|
||||
:from_data="fromData"
|
||||
:to_data="toData"
|
||||
@add-btn="add"
|
||||
@remove-btn="remove"
|
||||
pid="pid"
|
||||
:defaultProps="{ label: 'name' }"
|
||||
height="450px"
|
||||
style="padding-bottom:20px"
|
||||
:mode="mode"
|
||||
filter
|
||||
openAll></tree-transfer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import treeTransfer from 'el-tree-transfer';
|
||||
import { getGroupPlanTree } from '@/api/group/Schedule';
|
||||
|
||||
export default {
|
||||
components: { treeTransfer },
|
||||
data() {
|
||||
return {
|
||||
groupId: undefined,
|
||||
title: ['待选', '已选'],
|
||||
mode: 'transfer',
|
||||
fromData: [], //左边内容
|
||||
toData: [], //右边已选内容
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.fromData = [];
|
||||
this.toData = [];
|
||||
this.groupId = id;
|
||||
getGroupPlanTree().then((res) => {
|
||||
this.fromData = res.data;
|
||||
this.fromData.forEach((item) => {
|
||||
item.productionLineId = 0;
|
||||
});
|
||||
});
|
||||
},
|
||||
// 监听穿梭框组件添加
|
||||
add(fromData, toData, obj) {
|
||||
console.log('fromData:', fromData);
|
||||
console.log('toData:', toData,obj);
|
||||
},
|
||||
// 监听穿梭框组件移除
|
||||
remove(fromData, toData, obj) {
|
||||
console.log('fromData:', fromData);
|
||||
console.log('toData:', toData);
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$emit('refreshTableData',this.toData);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user