|
@@ -43,7 +43,7 @@
|
|
|
|
|
|
|
|
|
<template #menu="{ row, index, type }">
|
|
|
- <el-button @click="deleteTep(row.id)" text type="primary" v-if="props.isTree=='1'&&props.groupId"
|
|
|
+ <el-button @click="deleteGroup(row.id)" text type="primary" v-if="props.isTree=='1'&&props.groupId"
|
|
|
>删除
|
|
|
</el-button
|
|
|
>
|
|
@@ -98,6 +98,10 @@ import {
|
|
|
addEsopBatch,
|
|
|
addCheckBatch,
|
|
|
addFuliao,
|
|
|
+ treeDataAddBatch,
|
|
|
+ removeGroup,
|
|
|
+ removeAccessoryGroup,
|
|
|
+ treeAccessoryAddBatch
|
|
|
} from "@/api/craft/process/index";
|
|
|
import SingleUpload from "@/components/Upload/SingleUpload.vue";
|
|
|
|
|
@@ -169,7 +173,40 @@ const goToSelectMaterial = () => {
|
|
|
selectedVersion.value = "";
|
|
|
versionDV.value = false;
|
|
|
};
|
|
|
+const deleteGroupId = ref({});
|
|
|
+const deleteGroup = (id) =>{
|
|
|
+ deleteGroupId.value.id = id;
|
|
|
+ if(props.tableType === "wuliaocaiji"){
|
|
|
+ removeGroup(deleteGroupId.value).then(
|
|
|
+ (data)=>{
|
|
|
+ if(data.code==='200'){
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ search.value.itemGroupId = props.groupId
|
|
|
+ dataList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ if(props.tableType === "fuliaoCJ"){
|
|
|
+ removeAccessoryGroup(deleteGroupId.value).then(
|
|
|
+ (data)=>{
|
|
|
+ if(data.code==='200'){
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ search.value.itemGroupId = props.groupId
|
|
|
+ dataList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
+}
|
|
|
const startCreat = () => {
|
|
|
if (props.tableType === "wuliaocaiji") {
|
|
|
if (bomVersion.value) {
|
|
@@ -322,6 +359,7 @@ const esopList = ref([]);
|
|
|
//批量增加点检
|
|
|
const checkItem = ref({});
|
|
|
const checkList = ref([]);
|
|
|
+const itemGroupList = ref([]);
|
|
|
const onSelectedFinish = (itemValue) => {
|
|
|
if (Object.keys(itemValue).length == 0) {
|
|
|
ElMessage.error("请选择数据,数据不能为空!");
|
|
@@ -333,22 +371,62 @@ const onSelectedFinish = (itemValue) => {
|
|
|
checkItem.value.checkList = [];
|
|
|
esopItem.value.esopList = [];
|
|
|
esopList.value = [];
|
|
|
+ itemGroupList.value = [];
|
|
|
//主料分组保存
|
|
|
if (commonTableType.value === "MATERIAL_GATHER") {
|
|
|
- console.log("选择", itemGroup.value);
|
|
|
if (!itemGroup.value) {
|
|
|
ElMessage.error("未选择分组信息!");
|
|
|
+ return;
|
|
|
}
|
|
|
+ itemValue?.forEach(
|
|
|
+ (item,index)=>{
|
|
|
+ const groupItem = ref({});
|
|
|
+ groupItem.value.id = item.id;
|
|
|
+ groupItem.value.itemGroupId = itemGroup.value;
|
|
|
+ itemGroupList.value.push(groupItem.value);
|
|
|
+ }
|
|
|
+ )
|
|
|
+ treeDataAddBatch(itemGroupList.value).then(
|
|
|
+ (data)=>{
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ search.value.itemGroupId = props.groupId
|
|
|
+ dataList();
|
|
|
+ }
|
|
|
+
|
|
|
+ )
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- //主料分组保存
|
|
|
+ //辅料分组保存
|
|
|
if (commonTableType.value === "OP_ACCESSORY") {
|
|
|
|
|
|
|
|
|
if (!itemGroup.value) {
|
|
|
ElMessage.error("未选择分组信息!");
|
|
|
}
|
|
|
+
|
|
|
+ itemValue?.forEach(
|
|
|
+ (item,index)=>{
|
|
|
+ const groupItem = ref({});
|
|
|
+ groupItem.value.id = item.id;
|
|
|
+ groupItem.value.itemGroupId = itemGroup.value;
|
|
|
+ itemGroupList.value.push(groupItem.value);
|
|
|
+ }
|
|
|
+ )
|
|
|
+ treeAccessoryAddBatch(itemGroupList.value).then(
|
|
|
+ (data)=>{
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ search.value.itemGroupId = props.groupId
|
|
|
+ dataList();
|
|
|
+ }
|
|
|
+
|
|
|
+ )
|
|
|
return;
|
|
|
}
|
|
|
if (props.tableType === "wuliaocaiji") {
|
|
@@ -493,7 +571,7 @@ onMounted(() => {
|
|
|
search.value.isTree = props.isTree;
|
|
|
if (props.groupId) {
|
|
|
search.value.itemGroupId = props.groupId;
|
|
|
-
|
|
|
+ itemGroup.value=props.groupId;
|
|
|
}
|
|
|
//物料双规格分组的话没有编辑,删除要自定义
|
|
|
if (props.isTree === '1') {
|
|
@@ -540,13 +618,6 @@ watch(
|
|
|
}
|
|
|
);
|
|
|
|
|
|
-watch(
|
|
|
- () => itemGroup.value,
|
|
|
- () => {
|
|
|
- console.log("改变", itemGroup.value);
|
|
|
-
|
|
|
- }
|
|
|
-);
|
|
|
/**监听分组是否变化*/
|
|
|
watch(
|
|
|
() => props.groupId,
|
|
@@ -562,8 +633,8 @@ watch(
|
|
|
column: tableConfig[props.tableType].column,
|
|
|
});
|
|
|
search.value.itemGroupId = props.groupId
|
|
|
- itemGroup.value = "props.groupId "
|
|
|
- console.log("监听", itemGroup.value);
|
|
|
+ itemGroup.value = props.groupId
|
|
|
+ console.log("aaaa",itemGroup.value);
|
|
|
dataList();
|
|
|
}
|
|
|
);
|