|
@@ -15,7 +15,7 @@
|
|
|
@current-change="dataList"
|
|
|
@selection-change="selectionChange"
|
|
|
>
|
|
|
-<!-- <template #menu-left="{ size }">
|
|
|
+ <!-- <template #menu-left="{ size }">
|
|
|
<el-button
|
|
|
:disabled="toDeleteIds.length < 1"
|
|
|
type="danger"
|
|
@@ -26,16 +26,28 @@
|
|
|
>
|
|
|
</template>-->
|
|
|
<template #menu="{ row, index, type }">
|
|
|
-
|
|
|
- <el-button v-if="row.level === 'first'" @click="openEdit(row)" icon="el-icon-edit" text type="primary"
|
|
|
- >编辑</el-button
|
|
|
+ <el-button
|
|
|
+ v-if="row.level === 'first'"
|
|
|
+ @click="openEdit(row)"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ >编辑</el-button
|
|
|
>
|
|
|
- <el-button @click="deleteRow(row,null,null)" icon="el-icon-delete" text type="danger"
|
|
|
- >删除</el-button
|
|
|
+ <el-button
|
|
|
+ @click="deleteRow(row, null, null)"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ text
|
|
|
+ type="danger"
|
|
|
+ >删除</el-button
|
|
|
>
|
|
|
|
|
|
-
|
|
|
- <el-button @click="binding(row)" icon="el-icon-link" text type="primary"
|
|
|
+ <el-button
|
|
|
+ @click="binding(row)"
|
|
|
+ v-if="row.level != 'fourth'"
|
|
|
+ icon="el-icon-link"
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
>绑定子项</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -55,9 +67,10 @@
|
|
|
/>
|
|
|
<CommonTable
|
|
|
ref="productionLineRef"
|
|
|
- tableTitle="绑定子项"
|
|
|
+ :multiple="true"
|
|
|
+ tableTitle="绑定工位"
|
|
|
tableType="STATION"
|
|
|
- @selected-sure="onSelectedStationFinish"
|
|
|
+ @select-multiple-sure="onSelectedStationFinish"
|
|
|
/>
|
|
|
<CommonTable
|
|
|
ref="userRef"
|
|
@@ -72,7 +85,7 @@
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
-import {useCommonStoreHook, useUserStoreHook} from "@/store";
|
|
|
+import { useCommonStoreHook, useUserStoreHook } from "@/store";
|
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
import { updateWorkShop } from "@/api/workShop";
|
|
|
|
|
@@ -95,17 +108,17 @@ const binding = (row) => {
|
|
|
productionLineRef.value.startSelect();
|
|
|
}
|
|
|
};
|
|
|
-const userRef=ref(null);
|
|
|
-const openEdit = (row) =>{
|
|
|
- crudRef.value && crudRef.value.rowEdit(row,null);
|
|
|
-}
|
|
|
+const userRef = ref(null);
|
|
|
+const openEdit = (row) => {
|
|
|
+ crudRef.value && crudRef.value.rowEdit(row, null);
|
|
|
+};
|
|
|
const deletes = (row) => {
|
|
|
ElMessageBox.confirm("您确定要删除选择的数据吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
- if(row.children && row.children.length > 0){
|
|
|
+ if (row.children && row.children.length > 0) {
|
|
|
ElMessage.error("请先删除下级绑定");
|
|
|
return;
|
|
|
}
|
|
@@ -164,10 +177,10 @@ const importExcelData = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const onUserSelectedFinish=(selectedValue)=>{
|
|
|
- form.value.manager=selectedValue.userName;
|
|
|
-}
|
|
|
-const formData = ref({});
|
|
|
+const onUserSelectedFinish = (selectedValue) => {
|
|
|
+ form.value.manager = selectedValue.userName;
|
|
|
+};
|
|
|
+const formData = ref<any>({});
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option.value = Object.assign(option.value, {
|
|
|
selection: false,
|
|
@@ -270,6 +283,8 @@ const onSelectedLineFinish = (selectedValue) => {
|
|
|
});
|
|
|
};
|
|
|
const onSelectedStationFinish = (selectedValue) => {
|
|
|
+ console.log(selectedValue); //现在多选返回的是id数组
|
|
|
+ // TODO:
|
|
|
formData.value.code = selectedValue.code;
|
|
|
formData.value.parentCode = factory.value.code;
|
|
|
formData.value.id = selectedValue.id;
|