zhuzeyu 11 months ago
parent
commit
7bb5e2ab50

+ 534 - 0
src/views/business/drawing/drawingDetail.vue

@@ -0,0 +1,534 @@
+<template>
+    <div class="page-container column-container">
+        <section class="list-part-container">
+            <!-- 搜索区域 -->
+            <el-form class="list-search-container" :inline="true">
+                <el-form-item label="客户:">
+                    {{ currentProduct.companyAlias }}
+                </el-form-item>
+                <el-form-item label="图号:">
+                    {{ currentProduct.drawingNumber }}
+                </el-form-item>
+                <el-form-item label="规格:">
+                    {{ currentProduct.specification }}
+                </el-form-item>
+                <el-form-item label="产品描述:">
+                    {{ currentProduct.description }}
+                </el-form-item>
+                <el-form-item>
+
+                </el-form-item>
+                <el-form-item class="section-title" label="工艺版本:">
+                    <el-select-v2 v-model="currentTechnological.id" :options="technologicalProcessList" placeholder="请选择版本"
+                        @change="handelTechnological" style="width: 200px" />
+                </el-form-item>
+                <el-form-item class="section-title" label="当前工序:">
+                    <el-select-v2 v-model="technologicalDetailId" clearable :options="technologicalProcessDetailsList"
+                        placeholder="请选择工序" style="width: 200px" @change="handleDetailsChange" />
+
+
+                </el-form-item>
+            </el-form>
+
+        </section>
+        <div class="page-container row-container">
+            <section class="list-part-container" style="flex: 4">
+                <div class="list-btns-container">
+                    <el-button type="primary" icon="Plus" v-hasPermi="['business:electronicDrawings:add']"
+                        @click="handelUpload()">上传
+                    </el-button>
+                </div>
+                <div class="page-container form-container">
+
+
+                    <!-- 列表区 -->
+                    <div class="el-table-container">
+                        <el-table ref="equipmentTable" v-loading="loading" row-key="id"
+                            @current-change="handleSelectionChange" :data="drawingList" height="100%">
+                            <!-- <el-table-column type="selection" width="40" align="center" /> -->
+                            <el-table-column type="index" label="行号" width="50" align="center" />
+
+                            <el-table-column label="图纸" prop="drawingName" align="center">
+                                <template #default="scope">
+                                    <el-button link type="primary">{{
+                                        scope.row.drawingName }}</el-button>
+                                </template>
+                            </el-table-column>
+                            <el-table-column label="状态" width="80px" prop="status" align="center">
+                                <template #default="scope">
+                                    <dict-tag :options="drawing_status" :value="scope.row.status" />
+                                </template>
+                            </el-table-column>
+                            <el-table-column label="是否废弃" width="80px" prop="abandoned" align="center">
+                                <template #default="scope">
+                                    <dict-tag :options="drawing_type" :value="scope.row.abandoned" />
+                                </template>
+                            </el-table-column>
+                            <el-table-column label="制作人" width="100px" prop="producer" align="center" />
+                            <el-table-column label="审核人" width="100px" prop="reviewer" align="center" />
+                            <el-table-column label="批准人" width="100px" prop="issuer" align="center" />
+                            <el-table-column fixed="right" label="操作" align="center" width="240px">
+                                <template #default="scope">
+                                    <el-button v-if="scope.row.status == 0 && scope.row.abandoned == 0" link type="primary"
+                                        v-hasPermi="['business:electronicDrawings:examine']"
+                                        @click="handlePreview(scope.row)">审核
+                                    </el-button>
+                                    <el-button v-if="scope.row.status == 1" link type="success" plain
+                                        v-hasPermi="['business:electronicDrawings:ratify']"
+                                        @click="handlePreview(scope.row)">批准</el-button>
+
+                                    <el-upload
+                                        :action="webHost + '/common/upload'" :headers="headers" :limit="1"
+                                        :on-success="handleReplaceSuccess" :on-exceed="handleReplaceExceed" :before-upload="beforeUpload"
+                                        :show-file-list="false">
+                                        <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link type="warning" plain
+                                            v-hasPermi="['business:drawing:download']"
+                                         >替换</el-button>
+                                    </el-upload>
+
+                                    <el-button v-if="(scope.row.status == 0 || scope.row.status == 1)&& scope.row.abandoned == 0" link type="danger"
+                                        v-hasPermi="['business:electronicDrawings:remove']"
+                                        @click="handleDrawingNG(scope.row)">NG
+                                    </el-button>
+                                    <el-button v-if="scope.row.status == 2&& scope.row.abandoned == 0" link type="danger"
+                                        v-hasPermi="['business:electronicDrawings:remove']"
+                                        @click="handleDrawingRemove(scope.row)">作废
+                                    </el-button>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                    </div>
+                    <!-- 分页 -->
+                    <pagination v-show="total > 0" :total="total" v-model:page="queryparams.pageNum"
+                        v-model:limit="queryparams.pageSize" @pagination="getDrawing" />
+                </div>
+            </section>
+
+            <section class="list-part-container" style="flex: 3">
+                <el-form class="list-search-container" :model="draform" ref="queryRef" :inline="true"
+                    style="margin-right: 0px">
+                    <el-form-item class="section-title" label="预览" />
+                    <el-form-item style="float: inline-end;margin-top: 8px;">
+                        <el-button link type="primary" v-hasPermi="['business:product:remove']"
+                            @click="openDrawing">全屏预览</el-button>
+                    </el-form-item>
+                </el-form>
+                <iframe :src="drawingUrl" frameborder="no" style="width: 100%; height: 100%" scrolling="auto" />
+            </section>
+
+        </div>
+
+        <!-- 添加图纸对话框 -->
+        <el-dialog title="上传文件" v-model="open" width="500px" append-to-body>
+            <el-form ref="drawingRef" :model="form" :rules="rules" label-width="120px" v-loading="formLoading">
+
+
+                <el-form-item label="工序:" prop="technologicalProcessDetailId">
+                    <el-select-v2 v-model="form.technologicalProcessDetailId" clearable
+                        :options="technologicalProcessDetailsList" placeholder="请选择工序:" @change="handleDetailsFormChange"
+                        style="width: 200px" />
+                </el-form-item>
+
+                <el-form-item label="标识:" prop="identification">
+                    <el-checkbox v-model="form.identification" label="重" size="large" />
+                    <el-checkbox v-model="form.markD" label="D标识" size="large" />
+                </el-form-item>
+
+                <el-form-item label="上传文件:" prop="url">
+                    <el-input disabled v-model="form.url" placeholder="上传文件">
+                        <template #append>
+                            <el-upload :disabled="!currentTechnologicalDetail.id" :action="webHost + '/common/upload'"
+                                :headers="headers" :limit="1" :on-success="handleSuccess" :on-exceed="handleExceed"
+                                :before-upload="beforeUpload" :show-file-list="false">
+                                <el-button icon="Upload"></el-button>
+                            </el-upload>
+                        </template>
+                    </el-input>
+                </el-form-item>
+
+
+
+            </el-form>
+            <template #footer>
+                <div class="dialog-footer">
+                    <el-button :disabled="!form.url" type="primary" @click="submitForm">确 定</el-button>
+                    <el-button @click="cancel">取 消</el-button>
+                </div>
+            </template>
+        </el-dialog>
+    </div>
+</template>
+<script setup name="drawingDetails">
+import { ref } from "vue";
+import { getToken } from '@/utils/auth'
+import { getNormalDrawing, getListByName, saveDrawing, drawingNG, replace, drawingRemove } from "@/api/business/drawing";
+import useUserStore from '@/store/modules/user'
+import { getTechnological, getById } from '@/api/business/product'
+import { getTechnologicalProcessDetails } from '@/api/business/technologicalProcessDetail'
+
+const drawingUrl = ref('')
+const webHost = import.meta.env.VITE_APP_BASE_API
+const fileUrl = import.meta.env.VITE_PREVIEW_API
+const hostUrl = import.meta.env.VITE_HOST_URL
+const { proxy } = getCurrentInstance();
+const { drawing_status } = proxy.useDict("drawing_status");
+const { drawing_type } = proxy.useDict("drawing_type");
+
+const total = ref(0)
+const route = useRoute();
+const coverName = ref("")
+const currentProduct = ref({})
+const currentTechnological = ref({})
+const formLoading = ref(false)
+const currentTechnologicalDetail = ref({})
+const technologicalProcessList = ref([])
+const technologicalProcessDetailsList = ref([])
+const technologicalDetailId = ref(null)
+const open = ref(false)
+const draform = ref({})
+const currentDrawing = ref({})
+const repeatingDrawings = ref([])
+const loading = ref(false);
+const drawingList = ref([])
+const headers = { Authorization: getToken() }
+const productId = ref(null)
+const technologicalprocessDetailId = ref(null)
+const technologicalprocessId = ref(null)
+/** 查询对象 */
+const data = reactive({
+    queryparams: {
+        pageNum: 1,
+        pageSize: 10,
+        technologicalProcessDetailId: null
+    },
+    form: {
+        pageNum: 1,
+        pageSize: 10,
+        technologicalProcessDetailId: null,
+        groupDetailList: [],
+        code: "",
+        remark: "",
+        type: false
+    },
+    rules: {
+        technologicalProcessDetailId: [{ required: true, message: "工序不能为空", trigger: "blur" }],
+    },
+});
+const { form, rules, queryparams } = toRefs(data);
+
+function getList() {
+    console.log(route.params)
+    // 解析查询字符串
+    // var urlSearchParams = new URLSearchParams(route.params.currentProduct);
+
+    // 将 URLSearchParams 对象转换为普通对象
+    // var paramsObject = Object.fromEntries(urlSearchParams);
+
+    // currentProduct.value = paramsObject
+
+
+
+    productId.value = route.params.productId
+    technologicalprocessId.value = route.params.productProcessId
+    if (route.params.processDetailId) {
+        console.log(route.params.processDetailId)
+        technologicalprocessDetailId.value = route.params.processDetailId
+    }
+    //查询产品
+    getById(productId.value).then(resMsg => {
+        if (resMsg.code == 200) {
+            currentProduct.value = resMsg.data
+        }
+    })
+
+    //查询工艺版本
+    getTechnological({ productId: productId.value }).then(res => {
+        if (res.code == 200) {
+            technologicalProcessList.value = res.data
+            //版本下拉框默认值
+            currentTechnological.value.id = technologicalprocessId.value
+            if (technologicalprocessDetailId.value !== undefined && technologicalprocessDetailId.value !== null && technologicalprocessDetailId.value !== 'undefined') {
+                technologicalDetailId.value = technologicalprocessDetailId.value
+                currentTechnologicalDetail.value.id = technologicalprocessDetailId.value
+            }
+            //查询工艺工序
+            getTechnologicalProcessDetails({ technologicalProcessId: currentTechnological.value.id }).then(response => {
+                if (response.code == 200) {
+                    technologicalProcessDetailsList.value = response.data
+                    getDrawing()
+                }
+            })
+        }
+    })
+
+}
+function handleDetailsFormChange() {
+    console.log(form.value.technologicalProcessDetailId)
+    console.log(technologicalDetailId.value, 123123)
+    technologicalDetailId.value = form.value.technologicalProcessDetailId
+}
+
+function openDrawing() {
+    window.open(drawingUrl.value)
+}
+
+function handleSelectionChange(row) {
+    currentDrawing.value = row
+    drawingUrl.value = fileUrl + encodeURIComponent(Base64.encode(hostUrl + webHost + row.url))
+}
+
+/**文件数量超出的回调 */
+function handleExceed(files) {
+    form.value.url = files[0].url
+}
+/** 文件上传前的 回调事件 */
+function beforeUpload(file) {
+    formLoading.value = true
+    const allowedTypes = ['application/pdf'];
+    const isAllowed = allowedTypes.includes(file.type);
+    if (!isAllowed) {
+        proxy.$modal.msgError('只能上传 PDF 格式的文件!')
+        formLoading.value = false
+        return false
+    }
+
+}
+function handelUpload() {
+    open.value = true
+    form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
+    console.log(currentTechnologicalDetail.value.id)
+    console.log(technologicalDetailId.value)
+}
+/**获取图纸列表 */
+function getDrawing() {
+    console.log(currentTechnological.value.id)
+    queryparams.value.technologicalProcessId = currentTechnological.value.id
+    if (currentTechnologicalDetail.value.id !== undefined && currentTechnologicalDetail.value.id !== 'undefined') {
+        queryparams.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
+
+    }
+
+    getNormalDrawing(queryparams.value).then(res => {
+        if (res.code == 200) {
+            drawingList.value = res.rows
+            console.log(res.rows)
+            total.value = res.total
+        }
+    })
+}
+/**上传成功回调 */
+function handleSuccess(row) {
+    form.value.url = row.fileName
+    var fileDrawing = {}
+    fileDrawing.drawingName = row.originalFilename
+    fileDrawing.technologicalProcessDetailId = currentTechnologicalDetail.value.id
+
+    getListByName(fileDrawing).then(res => {
+        // debugger;
+        if (res.code == 200) {
+            console.log(res, "数据库查询")
+            repeatingDrawings.value = res.data
+            if (repeatingDrawings.value.length == 0) {
+
+                coverName.value = row.originalFilename
+                formLoading.value = false
+            } else {
+                //判断重名文件状态是否已发行需要替换
+                if (repeatingDrawings.value[0].status == 0) {
+                    proxy.$modal.msgWarning("待审核中已有相同文件");
+                    var item = {}
+                    item = repeatingDrawings.value[0]
+                    item.parentId = currentDrawing.value.id
+                    item.id = null
+                    item.url =  replaceForm.value.url
+                    item.drawingName = fileDrawing.drawingName
+                    item.technologicalProcessDetailId = fileDrawing.technologicalProcessDetailId 
+                    handleReplace(item)
+                } else {
+                    proxy.$modal.msgError("已有相同文件,请修改后重新上传");
+                    open.value = false
+                }
+            }
+        }
+    })
+}
+
+
+/**文件数量超出的回调 */
+function handleReplaceExceed(files) {
+    replaceForm.value.url = files[0].url
+}
+/**上传成功回调 */
+function handleReplaceSuccess(row) {
+    replaceForm.value.url = row.fileName
+    var fileDrawing = {}
+    fileDrawing.drawingName = row.originalFilename
+    fileDrawing.technologicalProcessDetailId = currentTechnologicalDetail.value.id
+
+    getListByName(fileDrawing).then(res => {
+        // debugger;
+        if (res.code == 200) {
+            console.log(res, "数据库查询")
+            repeatingDrawings.value = res.data
+            if (repeatingDrawings.value.length == 0) {
+
+                coverName.value = row.originalFilename
+                formLoading.value = false
+            } else {
+                //判断重名文件状态是否已发行需要替换
+                if (repeatingDrawings.value[0].status == 0) {
+                    proxy.$modal.msgWarning("待审核中已有相同文件");
+                    var item = {}
+                    item = repeatingDrawings.value[0]
+                    item.parentId = currentDrawing.value.id
+                    item.id = null
+                    item.url =  replaceForm.value.url
+                    item.drawingName = fileDrawing.drawingName
+                    item.technologicalProcessDetailId = fileDrawing.technologicalProcessDetailId 
+                    handleReplace(item)
+                } else {
+                    proxy.$modal.msgError("已有相同文件,请修改后重新上传");
+                    open.value = false
+                }
+            }
+        }
+    })
+}
+function submitForm() {
+    proxy.$refs["drawingRef"].validate((valid) => {
+        console.log(proxy.$refs["drawingRef"])
+        if (valid) {
+            open.value = false
+            saveDrawingDetail()
+        }
+    });
+}
+/**保存方法 */
+function saveDrawingDetail() {
+    if (currentTechnologicalDetail.value.id !== undefined && currentTechnologicalDetail.value.id !== null && currentTechnologicalDetail.value.id !== 'undefined') {
+        form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
+    }
+    form.value.drawingName = coverName.value
+
+    var itemList = []
+    itemList.push(form.value)
+    saveDrawing(itemList).then(res => {
+        if (res.code == 200) {
+            reset();
+            getList();
+            formLoading.value = false
+
+        }
+    })
+}
+/**审核 */
+function handlePreview(row) {
+    var drawing = []
+    drawing.push(row)
+    saveDrawing(drawing).then(res => {
+        if (res.code == 200) {
+            proxy.$modal.msgSuccess("审核通过");
+            reset()
+            getList();
+        }
+    })
+}
+function reset() {
+    form.value = {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        remark: null,
+        groupDetailList: [],
+        url: null,
+        drawingName: null,
+        type: false
+    };
+    currentProduct.value = {}
+    currentTechnologicalDetail.value = {}
+    currentTechnological.value = {}
+    coverName.value = ''
+    repeatingDrawings.value = []
+    proxy.resetForm("drawingRef");
+}
+// 取消按钮
+function cancel() {
+    open.value = false
+    reset()
+}
+/**版本change事件 */
+function handelTechnological(row) {
+    getDrawing()
+}
+/**工序选择change事件 */
+function handleDetailsChange(row) {
+    currentTechnologicalDetail.value.id = technologicalDetailId.value == undefined ? null:technologicalDetailId.value
+    getDrawing()
+}
+/**NG电子图纸 */
+function handleDrawingNG(row) {
+    console.log(row)
+    proxy.$modal
+        .confirm("是否确认NG?")
+        .then(function () {
+            var itemList = []
+            itemList.push(row)
+            return drawingNG(itemList);
+        })
+        .then(() => {
+            reset()
+            getList();
+            open.value = false
+            proxy.$modal.msgSuccess("操作成功");
+        })
+        .catch(() => { });
+}
+/**废弃电子图纸 */
+
+function handleDrawingRemove(row) {
+    console.log(row)
+    proxy.$modal
+        .confirm("是否确认作废?")
+        .then(function () {
+            var itemList = []
+            itemList.push(row)
+            return drawingRemove(itemList);
+        })
+        .then(() => {
+            reset()
+            getList();
+            open.value = false
+            proxy.$modal.msgSuccess("操作成功");
+        })
+        .catch(() => { });
+}
+
+function handleReplace(row) {
+    proxy.$modal
+        .confirm("是否确认替换图纸?")
+        .then(function () {
+            return replace(row);
+        })
+        .then(() => {
+            reset()
+            getList();
+            open.value = false
+            proxy.$modal.msgSuccess("替换成功");
+        })
+        .catch(() => { });
+}
+
+getList()
+</script>
+
+<style scoped>
+:deep(.el-form-item .el-form-item__label) {
+    font-size: 18px !important;
+    padding-right: 0 !important;
+}
+
+:deep(#list-search-container .el-form-item--default .el-form-item__content) {
+    line-height: 32px;
+    font-size: 18px;
+}
+</style>

+ 259 - 0
src/views/business/drawingAuditing/index.vue

@@ -0,0 +1,259 @@
+<template>
+    <div class="page-container row-container">
+
+        <section class="list-part-container" style="flex: 2">
+            <!-- 搜索区域 -->
+            <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
+                <el-form-item label="类型:" prop="pattern">
+                    <el-select-v2 v-model="queryParams.pattern" clearable filterable :options="patternLabels"
+                        placeholder="类型" @change="handleRefreshDrawing" style="width: 120px;" />
+                </el-form-item>
+                <el-form-item label="客户名称:">
+                    <el-input placeholder="请输入客户名称" v-model.trim="queryParams.companyAlias" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="图号:">
+                    <el-input placeholder="请输入图号" v-model.trim="queryParams.drawingNumber" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="规格:">
+                    <el-input placeholder="请输入规格" v-model.trim="queryParams.specification" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="产品描述:">
+                    <el-input placeholder="请输入产品描述" v-model.trim="queryParams.description" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="工艺版本:" prop="technologyVersion">
+                    <el-input placeholder="请输入工艺版本" v-model.trim="queryParams.technologyVersion" @keydown.enter.prevent
+                        clearable style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="工序:" prop="processAlias">
+                    <el-input placeholder="请输入工序" v-model.trim="queryParams.processAlias" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="info" icon="Search" @click="handleRefreshDrawing">搜索</el-button>
+                </el-form-item>
+            </el-form>
+            <div class="list-btns-container">
+                <el-button :disabled="selections.length == 0" type="success" v-hasPermi="['business:drawing:add']"
+                    @click="handleSaveBacth()">批量通过
+                </el-button>
+                <el-button :disabled="selections.length == 0" type="danger" v-hasPermi="['business:drawing:add']"
+                    @click="handleNGBacth()">批量NG
+                </el-button>
+            </div>
+            <!-- 列表区域 -->
+            <div class="el-table-container">
+
+
+                <div class="el-table-inner-container">
+                    <el-table ref="drawingTabel" v-loading="loading" :row-key="getRowKey"  @selection-change="handleSelectionChange"
+                        :data="drawingList" height="100%">
+                        <el-table-column type="selection" width="40" align="center" :reserve-selection="true" />
+                        <el-table-column label="行号" type="index" width="50" align="center" />
+                        <el-table-column label="客户" width="120" align="center">
+                            <template #default="scope">
+                                <span>{{ scope.row.product.companyAlias }}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="图号" width="120" align="center">
+                            <template #default="scope">
+                                <span>{{ scope.row.product.drawingNumber }}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="规格" width="250" align="center">
+                            <template #default="scope">
+                                <span>{{ scope.row.product.specification }}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="产品描述" width="100" align="center">
+                            <template #default="scope">
+                                <span>{{ scope.row.product.description }}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="工艺版本" prop="technologyVersion" width="100" align="center" />
+                        <el-table-column label="工序" prop="processAlias" align="center" />
+                        <el-table-column label="图纸" prop="drawingName" align="center" />
+                        <el-table-column label="类型" prop="pattern" align="center" />
+                        <el-table-column label="制作人" prop="producer" align="center" />
+                        <el-table-column label="操作" width="150" align="center">
+                            <template #default="scope">
+                                <el-button v-hasPermi="['business:equipment:edit']" link type="success"
+                                    @click="saveDrawingDetail(scope.row)">
+                                    通过
+                                </el-button>
+                                <el-button v-hasPermi="['business:equipment:remove']" link type="danger"
+                                    @click="handleNGdrawingDetail(scope.row.id)">
+                                    NG
+                                </el-button>
+                            </template>
+                        </el-table-column>
+                    </el-table>
+                </div>
+            </div>
+            <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+                v-model:limit="queryParams.pageSize" @pagination="getDrawingList" />
+        </section>
+    </div>
+</template>
+  
+<script setup name="drawingAuditing">
+//   import {
+//     getNormalDrawing,
+//     detailList,
+//     delDetails,
+//   } from "@/api/business/equipment";
+import { getNormalDrawing, getListByName, saveDrawing, drawingNG, replace } from "@/api/business/drawing";
+import { getTechnological } from '@/api/business/product'
+import { getTechnologicalProcessDetails } from '@/api/business/technologicalProcessDetail'
+const { proxy } = getCurrentInstance();
+const webHost = import.meta.env.VITE_APP_PRODUCTION_API;
+/**字典数组 */
+const { equipment_status } = proxy.useDict("equipment_status");
+const { yes_no } = proxy.useDict("yes_no");
+const drawingTabel = ref(null)
+const selections = ref([]);
+const total = ref(0);
+const drawingList = ref([]);
+const loading = ref(false);
+const patternLabels = ref([{
+    value: '新产品',
+    label: '新产品'
+}, {
+    value: '替换',
+    label: '替换'
+}])
+const data = reactive({
+    queryParams: {
+        status: 0,
+        pageNum: 1,
+        pageSize: 10,
+    },
+    form: {
+        pageNum: 1,
+        pageSize: 10,
+        technologicalProcessDetailId: null,
+        groupDetailList: [],
+        code: "",
+        remark: "",
+        type: false
+    }
+
+});
+const { form, queryParams } = toRefs(data);
+
+
+/****************************************************  生命周期函数区  ****************************************************/
+onMounted(() => {
+    getDrawingList();
+});
+/****************************************************  方法区  ****************************************************/
+
+
+/**删除设备明细 */
+function handleNGdrawingDetail(row) {
+    proxy.$modal
+        .confirm("是否确认废弃图纸?")
+        .then(function () {
+            var itemList = []
+            itemList.push(row)
+            return drawingNG(itemList);
+        })
+        .then(() => {
+            reset()
+            getList();
+            open.value = false
+            proxy.$modal.msgSuccess("废弃成功");
+        })
+        .catch(() => { });
+};
+
+/**通过按钮 */
+function saveDrawingDetail(row) {
+    var itemList = []
+    itemList.push(row)
+    saveDrawing(itemList).then(res => {
+        if (res.code == 200) {
+            getDrawingList();
+            loading.value = false
+        }
+    })
+}
+
+/** 搜索按钮操作 */
+function handleRefreshDrawing() {
+    getDrawingList();
+}
+/** 获取设备档案列表 */
+function getDrawingList (){
+    console.log(selections.value)
+    loading.value = true;
+    getNormalDrawing(queryParams.value).then((res) => {
+        drawingList.value = res.rows;
+        loading.value = false;
+        total.value = res.total;
+    });
+
+};
+//刷新设备档案管理
+function handleRefreshDetail() {
+    getDrawingList();
+}
+/**
+ * 列表checkbox列选择 事件
+ */
+function handleSelectionChange(selection) {
+    selections.value = selection;
+}
+/**批量通过 */
+function handleSaveBacth(){
+    if(selections.value.length>0){
+        saveDrawing(selections.value).then(res =>{
+            if(res.code ==200){
+                proxy.$modal.msgSuccess("操作成功");
+                selections.value = []
+                drawingTabel.value.clearSelection()
+                getDrawingList()
+            }
+        })
+    }
+}
+/**批量废弃 */
+function handleNGBacth(){
+    if(selections.value.length>0){
+        drawingNG(selections.value).then(res =>{
+            if(res.code ==200){
+                proxy.$modal.msgSuccess("操作成功");
+                selections.value = []
+                drawingTabel.value.clearSelection()
+                getDrawingList()
+            }
+        })
+    }
+}
+function getRowKey(row) {
+  return row.id;
+}
+</script>
+<style scoped>
+:deep(.el-tree-node__label) {
+    font-size: 14px !important;
+    display: inline-block;
+    width: 100%;
+}
+
+:deep(.el-tree-node__content) {
+    height: 40px;
+    border-bottom: 1px solid #ebeef5;
+    padding: 8px 0;
+    line-height: 23px;
+}
+
+.move-handle {
+    cursor: move;
+    background-color: #eee;
+}
+</style>
+  

+ 260 - 0
src/views/business/drawingRatify/index.vue

@@ -0,0 +1,260 @@
+<template>
+    <div class="page-container row-container">
+
+        <section class="list-part-container" style="flex: 2">
+            <!-- 搜索区域 -->
+            <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
+                <el-form-item label="类型:" prop="pattern">
+                    <el-select-v2 v-model="queryParams.pattern" clearable filterable :options="patternLabels"
+                        placeholder="类型" @change="handleRefreshDrawing" style="width: 120px;" />
+                </el-form-item>
+                <el-form-item label="客户名称:">
+                    <el-input placeholder="请输入客户名称" v-model.trim="queryParams.companyAlias" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="图号:">
+                    <el-input placeholder="请输入图号" v-model.trim="queryParams.drawingNumber" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="规格:">
+                    <el-input placeholder="请输入规格" v-model.trim="queryParams.specification" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="产品描述:">
+                    <el-input placeholder="请输入产品描述" v-model.trim="queryParams.description" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="工艺版本:" prop="technologyVersion">
+                    <el-input placeholder="请输入工艺版本" v-model.trim="queryParams.technologyVersion" @keydown.enter.prevent
+                        clearable style="width: 120px" />
+                </el-form-item>
+                <el-form-item label="工序:" prop="processAlias">
+                    <el-input placeholder="请输入工序" v-model.trim="queryParams.processAlias" @keydown.enter.prevent clearable
+                        style="width: 120px" />
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="info" icon="Search" @click="handleRefreshDrawing">搜索</el-button>
+                </el-form-item>
+            </el-form>
+            <div class="list-btns-container">
+                <el-button :disabled="selections.length == 0" type="success" v-hasPermi="['business:drawing:add']"
+                    @click="handleSaveBacth()">批量批准
+                </el-button>
+                <el-button :disabled="selections.length == 0" type="danger" v-hasPermi="['business:drawing:add']"
+                    @click="handleNGBacth()">批量NG
+                </el-button>
+            </div>
+            <!-- 列表区域 -->
+            <div class="el-table-container">
+
+
+                <div class="el-table-inner-container">
+                    <el-table ref="drawingTabel" v-loading="loading" :row-key="getRowKey"  @selection-change="handleSelectionChange"
+                        :data="drawingList" height="100%">
+                        <el-table-column type="selection" width="40" align="center" :reserve-selection="true" />
+                        <el-table-column label="行号" type="index" width="50" align="center" />
+                        <el-table-column label="客户" width="120" align="center">
+                            <template #default="scope">
+                                <span>{{ scope.row.product.companyAlias }}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="图号" width="120" align="center">
+                            <template #default="scope">
+                                <span>{{ scope.row.product.drawingNumber }}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="规格" width="250" align="center">
+                            <template #default="scope">
+                                <span>{{ scope.row.product.specification }}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="产品描述"  align="center">
+                            <template #default="scope">
+                                <span>{{ scope.row.product.description }}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="工艺版本" prop="technologyVersion" width="60" align="center" />
+                        <el-table-column label="工序" prop="processAlias" align="center" />
+                        <el-table-column label="图纸" prop="drawingName" align="center" />
+                        <el-table-column label="类型" prop="pattern" align="center" width="60"/>
+                        <el-table-column label="制作人" prop="producer" align="center" width="100"/>
+                        <el-table-column label="审核人" prop="reviewer" align="center" width="100"/>
+                        <el-table-column label="操作" width="150" align="center">
+                            <template #default="scope">
+                                <el-button v-hasPermi="['business:equipment:edit']" link type="success"
+                                    @click="saveDrawingDetail(scope.row)">
+                                    通过
+                                </el-button>
+                                <el-button v-hasPermi="['business:equipment:remove']" link type="danger"
+                                    @click="handleNGdrawingDetail(scope.row.id)">
+                                    NG
+                                </el-button>
+                            </template>
+                        </el-table-column>
+                    </el-table>
+                </div>
+            </div>
+            <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+                v-model:limit="queryParams.pageSize" @pagination="getDrawingList" />
+        </section>
+    </div>
+</template>
+  
+<script setup name="drawingAuditing">
+//   import {
+//     getNormalDrawing,
+//     detailList,
+//     delDetails,
+//   } from "@/api/business/equipment";
+import { getNormalDrawing, getListByName, saveDrawing, drawingNG, replace } from "@/api/business/drawing";
+import { getTechnological } from '@/api/business/product'
+import { getTechnologicalProcessDetails } from '@/api/business/technologicalProcessDetail'
+const { proxy } = getCurrentInstance();
+const webHost = import.meta.env.VITE_APP_PRODUCTION_API;
+/**字典数组 */
+const { equipment_status } = proxy.useDict("equipment_status");
+const { yes_no } = proxy.useDict("yes_no");
+const drawingTabel = ref(null)
+const selections = ref([]);
+const total = ref(0);
+const drawingList = ref([]);
+const loading = ref(false);
+const patternLabels = ref([{
+    value: '新产品',
+    label: '新产品'
+}, {
+    value: '替换',
+    label: '替换'
+}])
+const data = reactive({
+    queryParams: {
+        status: 1,
+        pageNum: 1,
+        pageSize: 10,
+    },
+    form: {
+        pageNum: 1,
+        pageSize: 10,
+        technologicalProcessDetailId: null,
+        groupDetailList: [],
+        code: "",
+        remark: "",
+        type: false
+    }
+
+});
+const { form, queryParams } = toRefs(data);
+
+
+/****************************************************  生命周期函数区  ****************************************************/
+onMounted(() => {
+    getDrawingList();
+});
+/****************************************************  方法区  ****************************************************/
+
+
+/**删除设备明细 */
+function handleNGdrawingDetail(row) {
+    proxy.$modal
+        .confirm("是否确认废弃图纸?")
+        .then(function () {
+            var itemList = []
+            itemList.push(row)
+            return drawingNG(itemList);
+        })
+        .then(() => {
+            reset()
+            getList();
+            open.value = false
+            proxy.$modal.msgSuccess("废弃成功");
+        })
+        .catch(() => { });
+};
+
+/**通过按钮 */
+function saveDrawingDetail(row) {
+    var itemList = []
+    itemList.push(row)
+    saveDrawing(itemList).then(res => {
+        if (res.code == 200) {
+            getDrawingList();
+            loading.value = false
+        }
+    })
+}
+
+/** 搜索按钮操作 */
+function handleRefreshDrawing() {
+    getDrawingList();
+}
+/** 获取设备档案列表 */
+function getDrawingList (){
+    console.log(selections.value)
+    loading.value = true;
+    getNormalDrawing(queryParams.value).then((res) => {
+        drawingList.value = res.rows;
+        loading.value = false;
+        total.value = res.total;
+    });
+
+};
+//刷新设备档案管理
+function handleRefreshDetail() {
+    getDrawingList();
+}
+/**
+ * 列表checkbox列选择 事件
+ */
+function handleSelectionChange(selection) {
+    selections.value = selection;
+}
+/**批量通过 */
+function handleSaveBacth(){
+    if(selections.value.length>0){
+        saveDrawing(selections.value).then(res =>{
+            if(res.code ==200){
+                proxy.$modal.msgSuccess("操作成功");
+                selections.value = []
+                drawingTabel.value.clearSelection()
+                getDrawingList()
+            }
+        })
+    }
+}
+/**批量废弃 */
+function handleNGBacth(){
+    if(selections.value.length>0){
+        drawingNG(selections.value).then(res =>{
+            if(res.code ==200){
+                proxy.$modal.msgSuccess("操作成功");
+                selections.value = []
+                drawingTabel.value.clearSelection()
+                getDrawingList()
+            }
+        })
+    }
+}
+function getRowKey(row) {
+  return row.id;
+}
+</script>
+<style scoped>
+:deep(.el-tree-node__label) {
+    font-size: 14px !important;
+    display: inline-block;
+    width: 100%;
+}
+
+:deep(.el-tree-node__content) {
+    height: 40px;
+    border-bottom: 1px solid #ebeef5;
+    padding: 8px 0;
+    line-height: 23px;
+}
+
+.move-handle {
+    cursor: move;
+    background-color: #eee;
+}
+</style>
+  

+ 250 - 0
src/views/business/electronicDrawings/index.vue

@@ -0,0 +1,250 @@
+<template>
+	<div class="page-container row-container">
+		<section class="list-part-container column-container" style="flex: 1">
+			<el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
+				<el-form-item class="section-title" label="图纸管理" />
+				<el-form-item label="产品类别:">
+					<el-select v-model="queryParams.type" clearable placeholder="请选择类别"  style="width: 150px">
+						<el-option v-for="dict in product_type" :key="dict.value" :label="dict.label"
+							:value="dict.value"></el-option>
+					</el-select>
+				</el-form-item>
+				<el-form-item label="客户集团简称:">
+					<el-input placeholder="请输入客户集团简称" v-model.trim="queryParams.companyAlias" clearable
+						@keyup.enter="handleQueryProduct" @keydown.enter.prevent style="width: 150px"  />
+				</el-form-item>
+				<el-form-item label="图号:">
+					<el-input placeholder="请输入产品图号" v-model.trim="queryParams.drawingNumber" clearable
+						@keyup.enter="handleQueryProduct" @keydown.enter.prevent  style="width: 150px"/>
+				</el-form-item>
+				<el-form-item label="规格:">
+					<el-input placeholder="请输入产品规格" v-model.trim="queryParams.specification" clearable
+						@keyup.enter="handleQueryProduct" @keydown.enter.prevent  style="width: 150px"/>
+				</el-form-item>
+				<el-form-item label="料号:">
+					<el-input placeholder="请输入产品料号" v-model.trim="queryParams.productCode" clearable
+						@keyup.enter="handleQueryProduct" @keydown.enter.prevent  style="width: 150px"/>
+				</el-form-item>
+				<el-form-item label="产品描述:">
+					<el-input placeholder="请输入产品描述" v-model.trim="queryParams.description" clearable
+						@keyup.enter="handleQueryProduct" @keydown.enter.prevent  style="width: 150px"/>
+				</el-form-item>
+				<el-form-item>
+					<el-button type="info" icon="Search" @click="handleQueryProduct">搜索</el-button>
+				</el-form-item>
+			</el-form>
+			<!-- 列表区 -->
+			<div class="el-table-container">
+				<div class="el-table-inner-container">
+					<el-table ref="productTable" v-loading="productLoading" :data="productList" row-key="id"
+						highlight-current-row height="100%">
+						<el-table-column type="index" label="行号" width="50" align="center" />
+						<el-table-column label="料号" align="center" prop="productCode" />
+						<el-table-column label="预入仓库" align="center" prop="preStock" />
+						<el-table-column label="类别" align="center" prop="type">
+							<template #default="scope">
+								<dict-tag :options="product_type" :value="scope.row.type" />
+							</template>
+						</el-table-column>
+						<el-table-column label="轴类型大类" width="150px" align="center" prop="shaftBroadCategoryCode">
+							<template #default="scope">
+								<dict-tag :options="product_dtype" :value="scope.row.shaftBroadCategoryCode" />
+							</template>
+						</el-table-column>
+						<el-table-column label="轴类型" align="center" prop="shaftCategoryCode" />
+						<el-table-column label="规格" align="center" prop="specification" />
+						<el-table-column label="图号" align="center" width="110" prop="drawingNumber" />
+						<el-table-column label="客户集团简称" align="center" width="120px" prop="companyAlias" />
+						<el-table-column label="产品描述" align="center" width="200px" prop="description" />
+						<el-table-column label="直径" align="center" prop="diameter" />
+						<el-table-column label="成品长度" align="center" prop="lenght" />
+						<el-table-column label="厚度" align="center" prop="thickness" />
+						<el-table-column label="客户代号" align="center" prop="companyCode" />
+						<el-table-column label="销售员编码" align="center" prop="salesmanCode" />
+						<el-table-column label="保管员编码" align="center" prop="stockKeeperCode" />
+						<el-table-column label="调度员编号" align="center" prop="dispatcherCode" />
+						<el-table-column label="备注" align="center" prop="remark" />
+						<el-table-column label="产品状态" align="center" prop="productStatusCode">
+							<template #default="scope">
+								<dict-tag :options="product_status_code" :value="scope.row.productStatusCode" />
+							</template>
+						</el-table-column>
+						<el-table-column label="生产类型" align="center" prop="productionTypeCode">
+							<template #default="scope">
+								<dict-tag :options="production_type_code" :value="scope.row.productionTypeCode" />
+							</template>
+						</el-table-column>
+						<el-table-column label="技术员编码" align="center" prop="technicianCode" />
+						<el-table-column fixed="right" label="图纸" align="center" width="140px">
+							<template #default="scope">
+								<el-button link type="primary" v-hasPermi="['business:product:remove']"
+									@click="handleProduct(scope.row)">图纸</el-button>
+							</template>
+						</el-table-column>
+					</el-table>
+				</div>
+			</div>
+			<!-- 分页 -->
+			<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+				v-model:limit="queryParams.pageSize" @pagination="getList" />
+		</section>
+		<el-drawer v-model="openVersoinForm" size="30%" direction="rtl" :close-on-press-escape="false">
+			<div class="page-container form-container">
+				<div class="form-btns-container">
+					<span class="title-label"><el-icon>
+							<Document />
+						</el-icon>
+						电子工艺图纸</span>
+				</div>
+				<!-- 搜索区域 -->
+				<el-form class="list-search-container" :inline="true">
+					<el-form-item>
+						<el-select-v2 v-model="currentTechnological.id" clearable :options="technologicalProcessList"
+							placeholder="请选择版本" @change="handelTechnological" style="width: 220px" />
+						<el-button :disabled="!currentTechnological.id" type="primary" icon="Search" v-hasPermi="['business:drawing:record']"
+							style="margin-left: 10px;" @click="handelDrawing">查看全部
+						</el-button>
+					</el-form-item>
+				</el-form>
+			</div>
+			<div class="el-table-inner-container">
+				<el-table :data="technologicalprocessDetailList" v-loading="technologicalprocessDetailLoading"
+					:row-key="getRowKey" highlight-current-row height="100%">
+					<el-table-column type="index" label="行号" width="50" align="center" />
+					<el-table-column label="工序步骤编号" width="100" align="center" prop="processStepNumber">
+						<template #default="scope">
+
+							<div>{{ scope.row.processStepNumber }}</div>
+						</template>
+					</el-table-column>
+					<el-table-column label="工序编码" align="center" prop="processCode" />
+					<el-table-column label="工序简称" align="center" prop="processAlias" />
+					<el-table-column label="操作" width="140px" align="center">
+						<template #default="scope">
+							<el-button link type="primary" v-hasPermi="['business:product:remove']"
+								@click="handelDrawing(scope.row)">图纸维护</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+			</div>
+		</el-drawer>
+	</div>
+</template>
+
+<script setup name="Process">
+import { listProduct, getTechnological } from '@/api/business/product'
+import { listTechnologicalProcessDetail } from '@/api/business/technologicalProcessDetail'
+import router from "@/router";
+
+const { proxy } = getCurrentInstance()
+/**字典 */
+const { product_type } = proxy.useDict('product_type')
+const { product_dtype } = proxy.useDict('product_dtype')
+const { product_status_code } = proxy.useDict('product_status_code')
+const { production_type_code } = proxy.useDict('production_type_code')
+//产品
+const productList = ref([])
+const productLoading = ref(false)
+const total = ref(0)
+const openVersoinForm = ref(false)
+const currentProduct = ref({})
+const ids = ref([])
+const currentTechnological = ref({})
+//版本
+const technologicalProcessList = ref([])
+/** 工序变量 */
+const technologicalprocessDetailList = ref([])
+const technologicalprocessDetailLoading = ref(false)
+/** 查询对象 */
+const queryParams = ref({
+	pageNum: 1,
+	pageSize: 10,
+	code: '',
+	name: '',
+	combinedValue: null,
+	productCode: ''
+})
+
+const yesOrNo = [
+	{ label: '是', value: '1', elTagType: 'primary', elTagClass: '' },
+	{ label: '否', value: '0', elTagType: 'danger', elTagClass: '' },
+]
+
+/***********************  方法区  ****************************/
+/***********************  部门管理相关事件  ****************************/
+/** 查询产品列表 */
+function getList() {
+	currentTechnological.value = {}
+	currentProduct.value = {}
+	productLoading.value = true
+	listProduct(queryParams.value).then((response) => {
+		productList.value = response.rows
+		total.value = response.total
+		productLoading.value = false
+
+	})
+}
+/**产品查询 */
+function handleQueryProduct() {
+	getList()
+}
+function handleProduct(row) {
+	openVersoinForm.value = true
+	currentTechnological.value = {}
+	console.log(row)
+	currentProduct.value = row
+	var technological = {}
+	technological.productId = row.id
+	getTechnological(technological).then(res => {
+		if (res.code == 200) {
+			technologicalProcessList.value = res.data
+		}
+	})
+
+}
+
+function handelTechnological() {
+	if (currentTechnological.value.id) {
+		currentProduct.value.technologicalprocessId = currentTechnological.value.id
+		handelDetails()
+	}
+}
+
+function handelDetails() {
+	technologicalprocessDetailLoading.value = true
+	listTechnologicalProcessDetail({
+		technologicalProcessId: currentTechnological.value.id
+	}).then((res) => {
+		technologicalprocessDetailList.value = res.rows
+		technologicalprocessDetailLoading.value = false
+	})
+}
+
+function handelDrawing(row) {
+	console.log(currentProduct)
+	if(row){
+		currentProduct.value.technologicalprocessDetailId = row.id
+		router.push({
+  path: `/drawing/drawingDetail/${currentProduct.value.id}/${currentProduct.value.technologicalprocessId}/${row.id}`});
+
+	}else{
+		currentProduct.value.technologicalprocessDetailId =null
+		router.push({
+  path: `/drawing/drawingDetail/${currentProduct.value.id}/${currentProduct.value.technologicalprocessId}`});
+	}
+
+
+
+	// var item = Object.keys(currentProduct.value)
+	// 	.map(key => encodeURIComponent(key) + '=' + encodeURIComponent(currentProduct.value[key]))
+	// 	.join('&');
+	// 	router.push({ name: 'drawingDetails', params: { currentProduct: item } });
+}
+/** 获取行 id */
+function getRowKey(row) {
+	return row.id
+}
+onMounted(() => {
+	getList()
+})
+</script>