|
@@ -17,7 +17,6 @@
|
|
|
@size-change="dataList"
|
|
|
@current-change="dataList"
|
|
|
>
|
|
|
-
|
|
|
<template #filePath-form="scope">
|
|
|
<!-- <single-upload v-model="form.filePath" />
|
|
|
<FilesUpload v-model:src="form.filePath" v-model:src-list="form.filePath" /> -->
|
|
@@ -29,7 +28,11 @@
|
|
|
<!-- :show-pdf-number="form.showAppointPageNum"-->
|
|
|
<!-- :pdf-source="pdfPath"-->
|
|
|
<!-- />-->
|
|
|
- <el-button link type="primary" @click="toShowPDF(pdfPath,form.showAppointPageNum)">
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="toShowPDF(pdfPath, form.showAppointPageNum)"
|
|
|
+ >
|
|
|
预览
|
|
|
</el-button>
|
|
|
</div>
|
|
@@ -42,17 +45,19 @@
|
|
|
<!-- :is-link="true"-->
|
|
|
<!-- :pdf-source="getSOAPpdf(row)"-->
|
|
|
<!-- />-->
|
|
|
- <el-button link type="primary" @click="toShowPDF(row.filePath,1)">
|
|
|
+ <el-button link type="primary" @click="toShowPDF(row.filePath, 1)">
|
|
|
查看PDF
|
|
|
</el-button>
|
|
|
</template>
|
|
|
|
|
|
-
|
|
|
<template #menu="{ row, index, type }">
|
|
|
- <el-button @click="deleteGroup(row.id)" text type="primary" v-if="props.isTree=='1'&&props.groupId"
|
|
|
- >删除
|
|
|
- </el-button
|
|
|
- >
|
|
|
+ <el-button
|
|
|
+ @click="deleteGroup(row.id)"
|
|
|
+ text
|
|
|
+ type="primary"
|
|
|
+ v-if="props.isTree == '1' && props.groupId"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<CommonTable
|
|
@@ -62,9 +67,9 @@
|
|
|
:multipleRow="true"
|
|
|
@selected-sure="onSelectedFinish"
|
|
|
/>
|
|
|
- <el-dialog v-model="dialogVisible">
|
|
|
- <VuePdfEmbed :source="previewImgUrl" annotation-layer text-layer/>
|
|
|
- </el-dialog>
|
|
|
+ <!-- <el-dialog v-model="dialogVisible">
|
|
|
+ <VuePdfEmbed :source="previewImgUrl" annotation-layer text-layer />
|
|
|
+ </el-dialog> -->
|
|
|
|
|
|
<el-dialog v-model="versionDV" title="请先选择版本号" width="500" center>
|
|
|
<el-select
|
|
@@ -92,11 +97,9 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import {ref, getCurrentInstance} from "vue";
|
|
|
-import {useCrud} from "@/hooks/userCrud";
|
|
|
-import {getTableConfig} from "./configs";
|
|
|
-import PDFView from "@/components/PDFView/index.vue";
|
|
|
-import VuePdfEmbed from "vue-pdf-embed";
|
|
|
+import { ref, getCurrentInstance } from "vue";
|
|
|
+import { useCrud } from "@/hooks/userCrud";
|
|
|
+import { getTableConfig } from "./configs";
|
|
|
import {
|
|
|
saveCompoents,
|
|
|
getBomVersion,
|
|
@@ -108,7 +111,7 @@ import {
|
|
|
treeDataAddBatch,
|
|
|
removeGroup,
|
|
|
removeAccessoryGroup,
|
|
|
- treeAccessoryAddBatch
|
|
|
+ treeAccessoryAddBatch,
|
|
|
} from "@/api/craft/process/index";
|
|
|
import SingleUpload from "@/components/Upload/SingleUpload.vue";
|
|
|
|
|
@@ -138,15 +141,15 @@ const afterDataListToGetBomVersion = () => {
|
|
|
toGetBomVersion();
|
|
|
};
|
|
|
// 传入一个url,后面不带/
|
|
|
-const {url, form, data, option, search, page, toDeleteIds, Methords, Utils} =
|
|
|
+const { url, form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
|
src: tableConfig[props.tableType].url,
|
|
|
afterDataList: afterDataListToGetBomVersion,
|
|
|
});
|
|
|
|
|
|
-const {dataList, createRow, updateRow, deleteRow, searchChange, resetChange} =
|
|
|
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
Methords; //增删改查
|
|
|
-const {selectionChange, multipleUpdate} = Methords; //选中和批量删除事件
|
|
|
+const { selectionChange, multipleUpdate } = Methords; //选中和批量删除事件
|
|
|
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
const bomVersion = ref(null);
|
|
@@ -185,46 +188,41 @@ const goToSelectMaterial = () => {
|
|
|
versionDV.value = false;
|
|
|
};
|
|
|
const deleteGroupId = ref({});
|
|
|
-const deleteGroup = (id) =>{
|
|
|
+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 === "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();
|
|
|
- }
|
|
|
+ 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) {
|
|
|
selectedVersion.value = bomVersion.value;
|
|
|
goToSelectMaterial();
|
|
|
} else {
|
|
|
- getBomVersion({materialCode: route.fullPath.split("/")[5]}).then(
|
|
|
+ getBomVersion({ materialCode: route.fullPath.split("/")[5] }).then(
|
|
|
(res) => {
|
|
|
versionList.value = res?.data ?? [];
|
|
|
versionDV.value = true;
|
|
@@ -276,7 +274,7 @@ const startCreat = () => {
|
|
|
commonTableType.value = "OP_CHECK";
|
|
|
nextTick(() => {
|
|
|
commonTableRef.value?.startSelect({
|
|
|
- operationId: route.params.id
|
|
|
+ operationId: route.params.id,
|
|
|
});
|
|
|
commonTableRef.value?.mergeOption({
|
|
|
selection: true,
|
|
@@ -284,7 +282,6 @@ const startCreat = () => {
|
|
|
header: false,
|
|
|
selectable: function (row, index) {
|
|
|
return row.isSelect;
|
|
|
-
|
|
|
},
|
|
|
});
|
|
|
});
|
|
@@ -334,7 +331,7 @@ const groupCreat = () => {
|
|
|
|
|
|
nextTick(() => {
|
|
|
commonTableRef.value?.startSelect({
|
|
|
- operationId: route.fullPath.split("/")[4] //查询工序下选择的物料)
|
|
|
+ operationId: route.fullPath.split("/")[4], //查询工序下选择的物料)
|
|
|
});
|
|
|
commonTableRef.value?.mergeOption({
|
|
|
selection: true,
|
|
@@ -344,12 +341,11 @@ const groupCreat = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
const saveSortData = async () => {
|
|
|
multipleUpdate();
|
|
|
};
|
|
|
|
|
|
-defineExpose({startCreat, saveSortData, groupCreat});
|
|
|
+defineExpose({ startCreat, saveSortData, groupCreat });
|
|
|
|
|
|
const onSortChange = () => {
|
|
|
data.value.forEach((item) => {
|
|
@@ -389,55 +385,43 @@ const onSelectedFinish = (itemValue) => {
|
|
|
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();
|
|
|
- }
|
|
|
-
|
|
|
- )
|
|
|
+ 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();
|
|
|
- }
|
|
|
-
|
|
|
- )
|
|
|
+ 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") {
|
|
@@ -561,16 +545,15 @@ const onSelectedFinish = (itemValue) => {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
};
|
|
|
const itemGroup = ref(null);
|
|
|
const previewImgUrl = ref("");
|
|
|
-const dialogVisible = ref(false);
|
|
|
-const imgUrlClick = (itemValue) => {
|
|
|
- previewImgUrl.value =
|
|
|
- import.meta.env.VITE_APP_UPLOAD_URL + itemValue.filePath;
|
|
|
- dialogVisible.value = true;
|
|
|
-};
|
|
|
+// const dialogVisible = ref(false);
|
|
|
+// const imgUrlClick = (itemValue) => {
|
|
|
+// previewImgUrl.value =
|
|
|
+// import.meta.env.VITE_APP_UPLOAD_URL + itemValue.filePath;
|
|
|
+// dialogVisible.value = true;
|
|
|
+// };
|
|
|
const getSOAPpdf = (itemValue) => {
|
|
|
return import.meta.env.VITE_APP_UPLOAD_URL + itemValue.filePath;
|
|
|
};
|
|
@@ -582,10 +565,10 @@ onMounted(() => {
|
|
|
search.value.isTree = props.isTree;
|
|
|
if (props.groupId) {
|
|
|
search.value.itemGroupId = props.groupId;
|
|
|
- itemGroup.value=props.groupId;
|
|
|
+ itemGroup.value = props.groupId;
|
|
|
}
|
|
|
//物料双规格分组的话没有编辑,删除要自定义
|
|
|
- if (props.isTree === '1') {
|
|
|
+ if (props.isTree === "1") {
|
|
|
option.value = Object.assign(option.value, {
|
|
|
searchEnter: true,
|
|
|
addBtn: false,
|
|
@@ -607,7 +590,6 @@ onMounted(() => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
dataList();
|
|
|
toGetBomVersion();
|
|
|
});
|
|
@@ -643,9 +625,9 @@ watch(
|
|
|
sortable: true,
|
|
|
column: tableConfig[props.tableType].column,
|
|
|
});
|
|
|
- search.value.itemGroupId = props.groupId
|
|
|
- itemGroup.value = props.groupId
|
|
|
- console.log("aaaa",itemGroup.value);
|
|
|
+ search.value.itemGroupId = props.groupId;
|
|
|
+ itemGroup.value = props.groupId;
|
|
|
+ console.log("aaaa", itemGroup.value);
|
|
|
dataList();
|
|
|
}
|
|
|
);
|
|
@@ -653,7 +635,7 @@ watch(
|
|
|
const toGetBomVersion = () => {
|
|
|
getRouteMaxVersion(
|
|
|
route.fullPath.split("/")[6] ? route.fullPath.split("/")[6] : routeId.value
|
|
|
- ).then(({data}) => {
|
|
|
+ ).then(({ data }) => {
|
|
|
bomVersion.value = data;
|
|
|
});
|
|
|
};
|