Эх сурвалжийг харах

Merge branch 'master' of http://120.46.159.163:7400/ezhizao/ezhizao_dms_vue

ezhizao_zx 10 сар өмнө
parent
commit
b6fa38d2b6

+ 5 - 1
.env.development

@@ -19,4 +19,8 @@ VITE_APP_PRODUCTION_API = '/ezhizao-dms-production'
 VITE_PREVIEW_API = 'http://120.46.159.163:8012/onlinePreview?url='
 
 # 服务器地址
-VITE_HOST_URL = 'http://120.46.159.163:401'
+VITE_HOST_URL = 'http://120.46.159.163:401'
+
+VITE_HOST_INNET = 'http://localhost:81'
+
+VITE_HOST_OUTNET = 'http://localhost:81'

+ 65 - 51
src/views/business/conversion/index.vue

@@ -53,28 +53,48 @@ const data = reactive({
 
 const { queryParams } = toRefs(data)
 
+// function processChartData(rawData, selectedYear) {
+//     const monthlyData = new Array(12).fill(0); // 初始化每月数据为0
+//     console.log(rawData,542)
+//     rawData.forEach(record => {
+//         const recordDate = new Date(record.date);
+//         const recordYear = recordDate.getFullYear();
+//         const monthIndex = recordDate.getMonth();
+
+//         // 根据年份和月份设置itemNum的值
+//         if (recordYear === selectedYear) {
+//             // 这里可以根据实际情况调整逻辑
+//             itemNum.value = record.quantity; // 使用quantity作为分子
+//         }
+//     });
+
+//     // 计算每个月的电子化率
+//     for (let i = 0; i < 12; i++) {
+//         // 假设每个月的基数(分母)存储在procuctDrawing中
+//         // 这里需要根据实际情况调整逻辑来获取每个月的基数
+//         const denominator = (selectedYear === 2024 && i >= 2) ? procuctDrawing.value : 0; // 示例逻辑
+//         if (denominator > 0) {
+//             monthlyData[i] = (itemNum.value / denominator * 100).toFixed(2);
+//         }
+//     }
+
+//     return monthlyData;
+// }
+
 function processChartData(rawData, selectedYear) {
     const monthlyData = new Array(12).fill(null);
-
+    const currentYear = new Date().getFullYear();
+    const currentMonthIndex = new Date().getMonth();
     rawData.forEach(record => {
         const recordDate = new Date(record.date);
         const recordYear = recordDate.getFullYear();
         const monthIndex = recordDate.getMonth();
-        if (selectedYear < 2024) {
-            itemNum.value = 0
-        } else if (selectedYear === 2024 && monthIndex == 2) {
-            itemNum.value = 78
-        } else if (selectedYear === 2024 && monthIndex == 3) {
-            itemNum.value = 82
-        } else if (selectedYear === 2024 && monthIndex == 4) {
-            itemNum.value = 85
-        } else if (selectedYear === 2024 && monthIndex == 5) {
-            itemNum.value = 88
-        }else if (selectedYear === 2024 && monthIndex == 6) {
-            itemNum.value = 108
-        }   else if (selectedYear <= 2024 && monthIndex <= 1) {
+        if (!record.quantity) {
             itemNum.value = 0
         }
+        else if (recordYear !== currentYear || monthIndex !== currentMonthIndex) {
+            itemNum.value = record.quantity
+        }
         else {
             itemNum.value = procuctDrawing.value;
         }
@@ -94,7 +114,6 @@ function processChartData(rawData, selectedYear) {
         // 转换为百分比形式
         monthlyData[i] = parseInt(monthlyData[i]);
     }
-    console.log(monthlyData)
     return monthlyData;
 }
 
@@ -108,7 +127,6 @@ function handleCancel() {
 }
 
 function handleSave() {
-    console.log(number.value);
     addConversion({ number: number.value }).then(res => {
         if (res.code == 200) {
             proxy.$modal.msgSuccess("操作成功");
@@ -121,6 +139,7 @@ function sortDataByDateAsc(rawData) {
     return rawData.slice().sort((a, b) => new Date(a.date) - new Date(b.date));
 }
 function updateChart(monthlyData, displayMonths, selectedYear, currentYear) {
+
     echartInstance.value.setOption({
         title: { text: '工艺图纸上线率' },
         tooltip: {
@@ -132,49 +151,45 @@ function updateChart(monthlyData, displayMonths, selectedYear, currentYear) {
                 const param = params[0];
                 const monthIndex = param.dataIndex;
                 const month = displayMonths[monthIndex];
-                let requiredDocumentsThisMonth = 0;
-                var uploadedProducts = 0;
-                const sortedData = sortDataByDateAsc(rawData.value);
-                if (selectedYear < 2024) {
-                    requiredDocumentsThisMonth = 0
-                } else if (sortedData[(monthIndex - 2)]) {
-
-                    requiredDocumentsThisMonth = sortedData[(monthIndex - 2)].number;
-                } else if ((selectedYear > 2023 || (selectedYear === 2024 && monthIndex >= 2)) && !sortedData[monthIndex]) {
-                    requiredDocumentsThisMonth = 100; // 2024年3月及以后默认值为100
-                }
+                const currentYear = new Date().getFullYear();
+                const currentMonthIndex = new Date().getMonth();
+                const rawDataAsc = sortDataByDateAsc(rawData.value);
 
-                if (selectedYear < 2024) {
-                    uploadedProducts = 0
-                } else if (selectedYear === 2024 && monthIndex == 2) {
-                    uploadedProducts = 78
-                } else if (selectedYear === 2024 && monthIndex == 3) {
-                    uploadedProducts = 82
-                } else if (selectedYear === 2024 && monthIndex == 4) {
-                    uploadedProducts = 85
-                } else if (selectedYear === 2024 && monthIndex == 5) {
-                    uploadedProducts = 81
-                } else if (selectedYear === 2024 && monthIndex == 6) {
-                    uploadedProducts = 108
-                } else if (selectedYear <= 2024 && monthIndex <= 1) {
-                    uploadedProducts = 0
-                }
-                else {
+                // 初始化值
+                let rawDataItem, requiredDocumentsThisMonth = 0;
+                let uploadedProducts = 0;
+                let rate = 0;
+
+                // 遍历 rawDataAsc 来找到当前月份的数据项
+                rawDataAsc.forEach(item => {
+                    const itemDate = new Date(item.date); // 确保 item.date 是一个日期字符串或 Date 对象
+                    if (itemDate.getFullYear() === currentYear && itemDate.getMonth() === monthIndex) {
+                        rawDataItem = item;
+                    }
+                });
+
+                if (rawDataItem) {
+                    requiredDocumentsThisMonth = rawDataItem.number;
+                    uploadedProducts = rawDataItem.quantity;
+                } else if (selectedYear === currentYear && monthIndex === currentMonthIndex) {
+                    // 如果当前月份,使用 procuctDrawing.value
                     uploadedProducts = procuctDrawing.value;
                 }
 
+                // 计算上线率
                 if (requiredDocumentsThisMonth > 0) {
-                    var rate = (uploadedProducts / requiredDocumentsThisMonth * 100).toFixed(2)
-                } else {
-                    var rate = 0
+                    rate = (uploadedProducts / requiredDocumentsThisMonth * 100).toFixed(2);
                 }
+
+                // 根据业务逻辑设置 conversion_mes
                 const mes1 = conversion_mes.value[0].label;
                 const mes2 = conversion_mes.value[1].label;
+
                 return `
-                ${month}:<br/>
-                ${mes2}${uploadedProducts},<br/>
-                上线率:${rate}%
-                `;
+        ${month}:<br/>
+        ${mes2}${uploadedProducts},<br/>
+        上线率:${rate}%
+    `;
             }
         },
         xAxis: {
@@ -229,7 +244,6 @@ function getList() {
     listConversion(selectedYear).then(res => {
 
         rawData.value = sortDataByDateDesc(res.data);
-        console.log(rawData.value)
         number.value = rawData.value[0].number;
         getProcuctDrawing().then(res => {
             procuctDrawing.value = res.data;

+ 655 - 495
src/views/business/drawing/drawingDetail.vue

@@ -1,82 +1,149 @@
 <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.productVersion" :options="technologicalProcessList"
-                        placeholder="请选择版本" @change="handelTechnological" style="width: 70px" />
-                </el-form-item>
-                <el-form-item class="section-title" label="当前工序:">
-                    <el-select-v2 v-model="technologicalDetailId" clearable :options="technologicalProcessDetailsList"
-                        placeholder="请选择工序" style="width: 160px" @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="drawingTable" v-loading="loading" row-key="id" highlight-current-row
-                            @current-change="handleSelectionChange" :data="drawingList" height="600px">
-                            <!-- <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" />
-                            <el-table-column label="类型" prop="pattern" align="center" width="80" />
-                            <el-table-column label="状态" width="80px" prop="recordsType" align="center">
-                                <template #default="scope">
-                                    <dict-tag :options="drawing_status" :value="scope.row.recordsType" />
-                                </template>
-                            </el-table-column>
-                            <!-- <el-table-column label="是否废弃" width="80px" prop="abandoned" align="center">
+  <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.productVersion"
+            :options="technologicalProcessList"
+            placeholder="请选择版本"
+            @change="handelTechnological"
+            style="width: 70px"
+          />
+        </el-form-item>
+        <el-form-item class="section-title" label="当前工序:">
+          <el-select-v2
+            v-model="technologicalDetailId"
+            clearable
+            :options="technologicalProcessDetailsList"
+            placeholder="请选择工序"
+            style="width: 160px"
+            @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="drawingTable"
+              v-loading="loading"
+              row-key="id"
+              highlight-current-row
+              @current-change="handleSelectionChange"
+              :data="drawingList"
+              height="600px"
+            >
+              <!-- <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" />
+              <el-table-column
+                label="类型"
+                prop="pattern"
+                align="center"
+                width="80"
+              />
+              <el-table-column
+                label="状态"
+                width="80px"
+                prop="recordsType"
+                align="center"
+              >
+                <template #default="scope">
+                  <dict-tag
+                    :options="drawing_status"
+                    :value="scope.row.recordsType"
+                  />
+                </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">
-                                <template #default="scope">
-                                    <el-button-group
-                                        style="display: flex;align-items: center; justify-content: center;  flex-wrap: nowrap;">
-                                        <el-button
-                                            v-if="scope.row.status == 0 && scope.row.abandoned == 0 && scope.row.producerId != 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:raift']"
-                                            @click="handlePreview(scope.row)">批准</el-button>
-
-                                        <!-- <el-upload style="display: flex;align-items: center; justify-content: center;"
+              <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">
+                <template #default="scope">
+                  <el-button-group
+                    style="
+                      display: flex;
+                      align-items: center;
+                      justify-content: center;
+                      flex-wrap: nowrap;
+                    "
+                  >
+                    <el-button
+                      v-if="
+                        scope.row.status == 0 &&
+                        scope.row.abandoned == 0 &&
+                        scope.row.producerId != 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:raift']"
+                      @click="handlePreview(scope.row)"
+                      >批准</el-button
+                    >
+
+                    <!-- <el-upload style="display: flex;align-items: center; justify-content: center;"
                                             :action="webHost + '/common/upload'" :headers="headers" :limit="1"
                                             :on-success="handleReplaceSuccess" :on-exceed="handleReplaceExceed"
                                             :before-upload="beforeUpload" :show-file-list="false">
@@ -85,522 +152,615 @@
                                                 v-hasPermi="['business:electronicDrawings:replace']">替换</el-button>
                                         </el-upload> -->
 
-                                        <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link
-                                            type="warning" v-hasPermi="['business:electronicDrawings:replace']"
-                                            @click="replaceClick(scope.row)">替换
-                                        </el-button>
-
-                                        <el-button
-                                            v-if="(scope.row.status == 0 || scope.row.status == 1) && scope.row.abandoned == 0 && scope.row.producerId != 0"
-                                            link type="danger" v-hasPermi="['business:electronicDrawings:NG']"
-                                            @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>
-                                    </el-button-group>
-                                </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 :disabled="!drawingUrl" 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>
+                    <el-button
+                      v-if="scope.row.status == 2 && scope.row.abandoned == 0"
+                      link
+                      type="warning"
+                      v-hasPermi="['business:electronicDrawings:replace']"
+                      @click="replaceClick(scope.row)"
+                      >替换
+                    </el-button>
 
+                    <el-button
+                      v-if="
+                        scope.row.status == 0 &&
+                        scope.row.abandoned == 0 &&
+                        scope.row.producerId != 0
+                      "
+                      link
+                      type="danger"
+                      v-hasPermi="['business:electronicDrawings:raiftNG']"
+                      @click="handleDrawingNG(scope.row)"
+                      >NG
+                    </el-button>
+                    <el-button
+                      v-if="scope.row.status == 1"
+                      link
+                      type="danger"
+                      v-hasPermi="['business:electronicDrawings:examineNG']"
+                      @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>
+                  </el-button-group>
+                </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
+              :disabled="!drawingUrl"
+              link
+              type="primary"
+              @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" @close="cancel" append-to-body>
-            <el-form ref="drawingRef" :model="form" :rules="rules" label-width="120px" v-loading="formLoading">
-
-
-                <el-form-item label="工序:" prop="technologicalProcessDetailId" style="margin-top: 20px;">
-                    <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="!form.technologicalProcessDetailId" :action="webHost + '/common/upload'"
-                                :headers="headers" :limit="1" :on-success="handleSuccess" :on-exceed="handleExceed"
-                                :before-upload="beforeUpload" :show-file-list="false" ref="uploadrefss">
-                                <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>
+    <!-- 添加图纸对话框 -->
+    <el-dialog
+      title="上传文件"
+      v-model="open"
+      width="500px"
+      @close="cancel"
+      append-to-body
+    >
+      <el-form
+        ref="drawingRef"
+        :model="form"
+        :rules="rules"
+        label-width="120px"
+        v-loading="formLoading"
+      >
+        <el-form-item
+          label="工序:"
+          prop="technologicalProcessDetailId"
+          style="margin-top: 20px"
+        >
+          <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="!form.technologicalProcessDetailId"
+                :action="webHost + '/common/upload'"
+                :headers="headers"
+                :limit="1"
+                :on-success="handleSuccess"
+                :on-exceed="handleExceed"
+                :before-upload="beforeUpload"
+                :show-file-list="false"
+                ref="uploadrefss"
+              >
+                <el-button icon="Upload"></el-button>
+              </el-upload>
             </template>
-        </el-dialog>
-
-    </div>
+          </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 inNet = import.meta.env.VITE_HOST_INNET
-const outNet = import.meta.env.VITE_HOST_OUTNET
-const hostIp = import.meta.env.VITE_HOST_IP
+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 inNet = import.meta.env.VITE_HOST_INNET;
+const outNet = import.meta.env.VITE_HOST_OUTNET;
+const hostIp = import.meta.env.VITE_HOST_IP;
 const { proxy } = getCurrentInstance();
 const { drawing_status } = proxy.useDict("drawing_status");
 const { drawing_type } = proxy.useDict("drawing_type");
-const uploadrefss = ref()
-const parentName = ref("")
-const total = ref(0)
+const uploadrefss = ref();
+const parentName = ref("");
+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 replaceForm = ref({})
-const repeatingDrawings = ref([])
-const drawingTable = ref(null)
+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 replaceForm = ref({});
+const repeatingDrawings = ref([]);
+const drawingTable = ref(null);
 const loading = ref(false);
-const drawingList = ref([])
-const headers = { Authorization: getToken() }
-const productId = ref(null)
-const technologicalprocessDetailId = ref(null)
-const processCode = ref(null)
-const productVersion = ref(null)
+const drawingList = ref([]);
+const headers = { Authorization: getToken() };
+const productId = ref(null);
+const technologicalprocessDetailId = ref(null);
+const processCode = ref(null);
+const productVersion = ref(null);
 /** 查询对象 */
 const data = reactive({
-    queryparams: {
-        pageNum: 1,
-        pageSize: 10,
-        technologicalProcessDetailId: null
-    },
-    form: {
-        pageNum: 1,
-        pageSize: 10,
-        parentId: null,
-        technologicalProcessDetailId: null,
-        groupDetailList: [],
-        code: "",
-        remark: "",
-        type: false
-    },
-    rules: {
-        technologicalProcessDetailId: [{ required: true, message: "工序不能为空", trigger: "blur" }],
-    },
+  queryparams: {
+    pageNum: 1,
+    pageSize: 10,
+    technologicalProcessDetailId: null,
+  },
+  form: {
+    pageNum: 1,
+    pageSize: 10,
+    parentId: null,
+    technologicalProcessDetailId: null,
+    groupDetailList: [],
+    code: "",
+    remark: "",
+    type: false,
+  },
+  rules: {
+    technologicalProcessDetailId: [
+      { required: true, message: "工序不能为空", trigger: "blur" },
+    ],
+  },
 });
 const { form, rules, queryparams } = toRefs(data);
 
 function getList() {
-    // 解析查询字符串
-    // var urlSearchParams = new URLSearchParams(route.params.currentProduct);
-
-    // 将 URLSearchParams 对象转换为普通对象
-    // var paramsObject = Object.fromEntries(urlSearchParams);
-
-    // currentProduct.value = paramsObject
-
-
-
-    productId.value = route.params.productId
-    productVersion.value = route.params.productVersion
-
-    if (route.params.processCode) {
-        processCode.value = route.params.processCode
-    } else {
-        technologicalDetailId.value = null
+  // 解析查询字符串
+  // var urlSearchParams = new URLSearchParams(route.params.currentProduct);
+
+  // 将 URLSearchParams 对象转换为普通对象
+  // var paramsObject = Object.fromEntries(urlSearchParams);
+
+  // currentProduct.value = paramsObject
+
+  productId.value = route.params.productId;
+  productVersion.value = route.params.productVersion;
+
+  if (route.params.processCode && !processCode.value) {
+    processCode.value = route.params.processCode;
+  } else {
+    technologicalDetailId.value = null;
+  }
+  //查询产品
+  getById(productId.value).then((resMsg) => {
+    if (resMsg.code == 200) {
+      currentProduct.value = resMsg.data;
     }
-    //查询产品
-    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.productVersion = productVersion.value
-
-            //查询工艺工序
-            getTechnologicalProcessDetails({ technologyVersion: currentTechnological.value.productVersion, productId: productId.value ,isHistory:0}).then(response => {
-                if (response.code == 200) {
-                    technologicalProcessDetailsList.value = response.data
-                    if (processCode.value !== undefined && processCode.value !== null && processCode.value !== 'undefined') {
-                        technologicalDetailId.value = response.data.find(detail => detail.code == processCode.value).value;
-                        currentTechnologicalDetail.value.id = response.data.find(detail => detail.code === processCode.value).value;
-                    } else {
-                        technologicalDetailId.value = null
-                    }
-                    getDrawing()
-                }
-            })
+  });
+
+  //查询工艺版本
+  getTechnological({ productId: productId.value }).then((res) => {
+    if (res.code == 200) {
+      technologicalProcessList.value = res.data;
+      //版本下拉框默认值
+      currentTechnological.value.productVersion = productVersion.value;
+
+      //查询工艺工序
+      getTechnologicalProcessDetails({
+        technologyVersion: currentTechnological.value.productVersion,
+        productId: productId.value,
+        isHistory: 0,
+      }).then((response) => {
+        if (response.code == 200) {
+          technologicalProcessDetailsList.value = response.data;
+          if (
+            processCode.value !== undefined &&
+            processCode.value !== null &&
+            processCode.value !== "undefined"
+          ) {
+            if (!technologicalDetailId.value) {
+              technologicalDetailId.value = response.data.find(
+                (detail) => detail.code == processCode.value
+              ).value;
+              currentTechnologicalDetail.value.id = response.data.find(
+                (detail) => detail.code === processCode.value
+              ).value;
+            }
+          } else {
+            technologicalDetailId.value = null;
+          }
+          getDrawing();
         }
-    })
-
+      });
+    }
+  });
 }
 function handleDetailsFormChange(row) {
-    if (row) {
-        technologicalDetailId.value = form.value.technologicalProcessDetailId
-        var matchingDetail = technologicalProcessDetailsList.value.find(detail => detail.value === technologicalDetailId.value);
-        processCode.value = matchingDetail.code
-    } else {
-        processCode.value = null
-        drawingUrl.value = null
-    }
-
+  if (row) {
+    technologicalDetailId.value = form.value.technologicalProcessDetailId;
+    var matchingDetail = technologicalProcessDetailsList.value.find(
+      (detail) => detail.value === technologicalDetailId.value
+    );
+    processCode.value = matchingDetail.code;
+  } else {
+    processCode.value = null;
+    drawingUrl.value = null;
+  }
 }
 
 function openDrawing() {
-    window.open(drawingUrl.value)
-
+  window.open(drawingUrl.value);
 }
 
 function handleSelectionChange(row) {
-    console.log(123123)
-    if (row) {
-        loading.value = true
-        currentDrawing.value = row
-        // drawingUrl.value = fileUrl + encodeURIComponent(Base64.encode(document.location.origin + webHost + row.url))
-
-        var itemUrl = document.location.origin
-        var fUrl = ''
-        if (itemUrl.includes(hostIp)) {
-            fUrl = inNet
-        } else {
-            fUrl = outNet
-        }
-        console.log(fUrl + encodeURIComponent(Base64.encode(hostUrl + webHost + row.url)))
-        drawingUrl.value = (fUrl + encodeURIComponent(Base64.encode(hostUrl + webHost + row.url)))
-        loading.value = false
+  console.log(123123);
+  if (row) {
+    loading.value = true;
+    currentDrawing.value = row;
+    // drawingUrl.value = fileUrl + encodeURIComponent(Base64.encode(document.location.origin + webHost + row.url))
+
+    var itemUrl = document.location.origin;
+    var fUrl = "";
+    if (itemUrl.includes(hostIp)) {
+      fUrl = inNet;
+    } else {
+      fUrl = outNet;
     }
-
+    console.log(
+      fUrl + encodeURIComponent(Base64.encode(hostUrl + webHost + row.url))
+    );
+    drawingUrl.value =
+      fUrl + encodeURIComponent(Base64.encode(hostUrl + webHost + row.url));
+    loading.value = false;
+  }
 }
 
-
 /**文件数量超出的回调 */
 function handleExceed(files) {
-    form.value.url = files[0].url
+  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
-    }
-
+  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.identification = 0
-    form.value.markD = 0
-    form.value.productId = productId.value
-    form.value.productVersion = currentTechnological.value.productVersion
-    form.value.processCode = processCode.value
-    form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
+  open.value = true;
+  form.value.identification = 0;
+  form.value.markD = 0;
+  form.value.productId = productId.value;
+  form.value.productVersion = currentTechnological.value.productVersion;
+  form.value.processCode = processCode.value;
+  form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id;
 }
 /**获取图纸列表 */
 function getDrawing() {
-
-    queryparams.value.productId = productId.value
-    queryparams.value.productVersion = currentTechnological.value.productVersion
-    queryparams.value.processCode = processCode.value
-    // 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(1225, res.rows)
-            if (res.rows.length > 0) {
-                proxy.$refs.drawingTable.setCurrentRow(res.rows[0])
-            } else {
-                drawingUrl.value = null
-            }
-            total.value = res.total
-        }
-    })
+  queryparams.value.productId = productId.value;
+  queryparams.value.productVersion = currentTechnological.value.productVersion;
+
+  queryparams.value.processCode = processCode.value;
+  // 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(1225, res.rows);
+      if (res.rows.length > 0) {
+        proxy.$refs.drawingTable.setCurrentRow(res.rows[0]);
+      } else {
+        drawingUrl.value = null;
+      }
+      total.value = res.total;
+    }
+  });
 }
 /**上传成功回调 */
 function handleSuccess(row) {
-    form.value.url = row.fileName
-
-    var fileDrawing = {}
-    fileDrawing.drawingName = row.originalFilename
-    fileDrawing.productId = productId.value
-    fileDrawing.processCode = processCode.value
-    getListByName(fileDrawing).then(res => {
-        // debugger;
-        if (res.code == 200) {
-            repeatingDrawings.value = res.data
-            if (repeatingDrawings.value.length == 0) {
-
-                coverName.value = row.originalFilename
-                formLoading.value = false
-            } else {
-                //判断重名文件状态是否已发行需要替换
-                if (repeatingDrawings.value[0].status == 2) {
-                    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
-                }
-            }
+  form.value.url = row.fileName;
+
+  var fileDrawing = {};
+  fileDrawing.drawingName = row.originalFilename;
+  fileDrawing.productId = productId.value;
+  fileDrawing.processCode = processCode.value;
+  getListByName(fileDrawing).then((res) => {
+    // debugger;
+    if (res.code == 200) {
+      repeatingDrawings.value = res.data;
+      if (repeatingDrawings.value.length == 0) {
+        coverName.value = row.originalFilename;
+        formLoading.value = false;
+      } else {
+        //判断重名文件状态是否已发行需要替换
+        if (repeatingDrawings.value[0].status == 2) {
+          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
+  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
-    var item = {}
-    item.parentId = currentDrawing.value.id
-    item.id = null
-    item.url = replaceForm.value.url
-    item.drawingName = fileDrawing.drawingName
-    item.technologicalProcessDetailId = fileDrawing.technologicalProcessDetailId
-    handleReplace(item)
-
+  replaceForm.value.url = row.fileName;
+  var fileDrawing = {};
+  fileDrawing.drawingName = row.originalFilename;
+  fileDrawing.technologicalProcessDetailId =
+    currentTechnologicalDetail.value.id;
+  var item = {};
+  item.parentId = currentDrawing.value.id;
+  item.id = null;
+  item.url = replaceForm.value.url;
+  item.drawingName = fileDrawing.drawingName;
+  item.technologicalProcessDetailId = fileDrawing.technologicalProcessDetailId;
+  handleReplace(item);
 }
 
 function replaceClick(row) {
-    console.log(form.value.identification, 453)
-    form.value.parentId = row.id
-    form.value.technologicalProcessDetailId = row.technologicalProcessDetailId
-    form.value.identification = 0
-    form.value.markD = 0
-    open.value = true
+  console.log(form.value.identification, 453);
+  form.value.parentId = row.id;
+  form.value.technologicalProcessDetailId = row.technologicalProcessDetailId;
+  form.value.identification = 0;
+  form.value.markD = 0;
+  open.value = true;
 }
 function submitForm() {
-    proxy.$refs["drawingRef"].validate((valid) => {
-        if (valid) {
-
-            if (form.value.parentId) {
-                proxy.$modal
-                    .confirm("是否确认替换图纸?")
-                    .then(function () {
-                        if (currentTechnologicalDetail.value.id !== undefined && currentTechnologicalDetail.value.id !== null && currentTechnologicalDetail.value.id !== 'undefined') {
-                            form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
-                        }
-                        return replace(form.value);
-                    })
-                    .then(() => {
-                        reset()
-                        handleDetailsChange();
-                        open.value = false
-                        proxy.$modal.msgSuccess("替换成功");
-                    })
-                    .catch(() => { });
-            } else {
-                saveDrawingDetail()
+  proxy.$refs["drawingRef"].validate((valid) => {
+    if (valid) {
+      if (form.value.parentId) {
+        proxy.$modal
+          .confirm("是否确认替换图纸?")
+          .then(function () {
+            if (
+              currentTechnologicalDetail.value.id !== undefined &&
+              currentTechnologicalDetail.value.id !== null &&
+              currentTechnologicalDetail.value.id !== "undefined"
+            ) {
+              form.value.technologicalProcessDetailId =
+                currentTechnologicalDetail.value.id;
             }
-
-        }
-    });
+            return replace(form.value);
+          })
+          .then(() => {
+            reset();
+            handleDetailsChange();
+            open.value = false;
+            proxy.$modal.msgSuccess("替换成功");
+          })
+          .catch(() => {});
+      } else {
+        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
-    form.value.processCode = processCode.value
-    form.value.productId = productId.value
-    form.value.productVersion = productVersion.value
-    var itemList = []
-    itemList.push(form.value)
-    saveDrawing(itemList).then(res => {
-        if (res.code == 200) {
-            reset();
-            getList();
-            formLoading.value = false
-            open.value = false
-        }
-    })
+  // if (currentTechnologicalDetail.value.id !== undefined && currentTechnologicalDetail.value.id !== null && currentTechnologicalDetail.value.id !== 'undefined') {
+  //     form.value.technologicalProcessDetailId = currentTechnologicalDetail.value.id
+  // }
+
+  form.value.drawingName = coverName.value;
+  form.value.processCode = processCode.value;
+  form.value.productId = productId.value;
+  form.value.productVersion = productVersion.value;
+  var itemList = [];
+  itemList.push(form.value);
+  saveDrawing(itemList).then((res) => {
+    if (res.code == 200) {
+      reset();
+      getList();
+      formLoading.value = false;
+      open.value = false;
+    }
+  });
 }
 /**审核 */
 function handlePreview(row) {
-    var drawing = []
-    drawing.push(row)
-    saveDrawing(drawing).then(res => {
-        if (res.code == 200) {
-            proxy.$modal.msgSuccess("审核通过");
-            reset()
-            getList();
-        }
-    })
+  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,
-        identification: 0,
-        markD: 0,
-        type: false
-    };
-    currentTechnologicalDetail.value = {}
-    coverName.value = ''
-    repeatingDrawings.value = []
-    proxy.resetForm("drawingRef");
+  form.value = {
+    pageNum: 1,
+    pageSize: 10,
+    code: null,
+    remark: null,
+    groupDetailList: [],
+    url: null,
+    drawingName: null,
+    identification: 0,
+    markD: 0,
+    type: false,
+  };
+  currentTechnologicalDetail.value = {};
+  coverName.value = "";
+  repeatingDrawings.value = [];
+  proxy.resetForm("drawingRef");
 }
 // 取消按钮
 function cancel() {
+  uploadrefss.value.clearFiles();
+  handleDetailsChange();
 
-    uploadrefss.value.clearFiles()
-    handleDetailsChange();
-
-    open.value = false
+  open.value = false;
 
-    reset()
+  reset();
 }
 /**版本change事件 */
 function handelTechnological(row) {
-    getDrawing()
+  getDrawing();
 }
 /**工序选择change事件 */
 function handleDetailsChange() {
-    if (technologicalDetailId.value) {
-        var matchingDetail = technologicalProcessDetailsList.value.find(detail => detail.value === technologicalDetailId.value);
-        currentTechnologicalDetail.value.id = technologicalDetailId.value == undefined ? null : technologicalDetailId.value
-        processCode.value = matchingDetail.code
-    } else {
-        processCode.value = null
-        drawingUrl.value = null
-    }
-    getDrawing()
+  if (technologicalDetailId.value) {
+    var matchingDetail = technologicalProcessDetailsList.value.find(
+      (detail) => detail.value === technologicalDetailId.value
+    );
+    currentTechnologicalDetail.value.id =
+      technologicalDetailId.value == undefined
+        ? null
+        : technologicalDetailId.value;
+    processCode.value = matchingDetail.code;
+  } else {
+    processCode.value = null;
+    drawingUrl.value = null;
+  }
+  getDrawing();
 }
 /**NG电子图纸 */
 function handleDrawingNG(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(() => { });
+  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) {
-    proxy.$modal
-        .confirm("是否确认作废?")
-        .then(function () {
-            var itemList = []
-            itemList.push(row)
-            return drawingRemove(itemList);
-        })
-        .then(() => {
-            reset()
-            getList();
-            open.value = false
-            proxy.$modal.msgSuccess("操作成功");
-        })
-        .catch(() => { });
+  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(() => { });
+  proxy.$modal
+    .confirm("是否确认替换图纸?")
+    .then(function () {
+      return replace(row);
+    })
+    .then(() => {
+      reset();
+      getList();
+      open.value = false;
+      proxy.$modal.msgSuccess("替换成功");
+    })
+    .catch(() => {});
 }
 
-getList()
+getList();
 </script>
 
 <style scoped>
 :deep(.el-form-item .el-form-item__label) {
-    font-size: 14px !important;
-    padding-right: 0 !important;
+  font-size: 14px !important;
+  padding-right: 0 !important;
 }
 
 :deep(#list-search-container .el-form-item--default .el-form-item__content) {
-    line-height: 32px;
-    font-size: 18px;
+  line-height: 32px;
+  font-size: 18px;
 }
 </style>

+ 331 - 198
src/views/business/drawingAuditing/index.vue

@@ -1,107 +1,203 @@
 <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:electronicDrawings:examine']"
-                    @click="handleSaveBacth()">批量通过
+  <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:electronicDrawings:examine']"
+          @click="handleSaveBacth()"
+          >批量通过
+        </el-button>
+        <el-button
+          :disabled="selections.length == 0"
+          type="danger"
+          v-hasPermi="['business:electronicDrawings:examineNG']"
+          @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="productVersion"
+              width="100"
+              align="center"
+            />
+            <el-table-column label="工序" prop="processAlias" align="center" />
+            <el-table-column label="图纸" prop="drawingName" align="center">
+            </el-table-column>
+            <el-table-column label="类型" prop="pattern" align="center" />
+            <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="制作人" prop="producer" align="center" />
+            <el-table-column label="操作" width="150" align="center">
+              <template #default="scope">
+                <el-button
+                  link
+                  type="primary"
+                  @click="handlePreview(scope.row)"
+                >
+                  预览
                 </el-button>
-                <el-button :disabled="selections.length == 0" type="danger" v-hasPermi="['business:electronicDrawings:NG']"
-                    @click="handleNGBacth()">批量NG
+                <el-button
+                  v-hasPermi="['business:electronicDrawings:examine']"
+                  link
+                  type="success"
+                  @click="saveDrawingDetail(scope.row)"
+                >
+                  通过
                 </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="状态" 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="制作人" prop="producer" align="center" />
-                        <el-table-column label="操作" width="150" align="center">
-                            <template #default="scope">
-                                <el-button v-hasPermi="['business:electronicDrawings:examine']" link type="success"
-                                    @click="saveDrawingDetail(scope.row)">
-                                    通过
-                                </el-button>
-                                <el-button v-hasPermi="['business:electronicDrawings:NG']" 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>
+                <el-button
+                  v-hasPermi="['business:electronicDrawings:examineNG']"
+                  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">
@@ -110,136 +206,173 @@
 //     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'
+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 hostIp = import.meta.env.VITE_HOST_IP;
+const hostUrl = import.meta.env.VITE_HOST_URL;
+const inNet = import.meta.env.VITE_HOST_INNET;
+const outNet = import.meta.env.VITE_HOST_OUTNET;
 /**字典数组 */
 const { equipment_status } = proxy.useDict("equipment_status");
 const { yes_no } = proxy.useDict("yes_no");
-const drawingTabel = ref(null)
+const drawingTabel = ref(null);
 const selections = ref([]);
 const total = ref(0);
 const { drawing_status } = proxy.useDict("drawing_status");
 
 const drawingList = ref([]);
 const loading = ref(false);
-const patternLabels = ref([{
-    value: '新产品',
-    label: '新产品'
-}, {
-    value: '替换',
-    label: '替换'
-}])
+const patternLabels = ref([
+  {
+    value: "新产品",
+    label: "新产品",
+  },
+  {
+    value: "替换",
+    label: "替换",
+  },
+]);
 const data = reactive({
-    queryParams: {
-        status: 0,
-        abandoned:0,
-        pageNum: 1,
-        pageSize: 10,
-    },
-    form: {
-        pageNum: 1,
-        pageSize: 10,
-        technologicalProcessDetailId: null,
-        groupDetailList: [],
-        code: "",
-        remark: "",
-        type: false
-    }
-
+  queryParams: {
+    status: 0,
+    abandoned: 0,
+    pageNum: 1,
+    pageSize: 10,
+  },
+  form: {
+    pageNum: 1,
+    pageSize: 10,
+    technologicalProcessDetailId: null,
+    groupDetailList: [],
+    code: "",
+    remark: "",
+    type: false,
+  },
 });
 const { form, queryParams } = toRefs(data);
 
-
 /****************************************************  生命周期函数区  ****************************************************/
 onMounted(() => {
-    getDrawingList();
+  getDrawingList();
 });
 /****************************************************  方法区  ****************************************************/
 
-
 /**删除设备明细 */
 function handleNGdrawingDetail(row) {
-    proxy.$modal
-        .confirm("是否确认废弃图纸?")
-        .then(function () {
-            var itemList = []
-            itemList.push(row)
-            return drawingNG(itemList);
-        })
-        .then(() => {
-            reset()
-            getDrawingList();
-            open.value = false
-            proxy.$modal.msgSuccess("废弃成功");
-        })
-        .catch(() => { });
-};
+  proxy.$modal
+    .confirm("是否确认废弃图纸?")
+    .then(function () {
+      var itemList = [];
+      itemList.push(row);
+      return drawingNG(itemList);
+    })
+    .then(() => {
+      reset();
+      getDrawingList();
+      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
-        }
-    })
+  var itemList = [];
+  itemList.push(row);
+  saveDrawing(itemList).then((res) => {
+    if (res.code == 200) {
+      getDrawingList();
+      loading.value = false;
+    }
+  });
+}
+
+/**预览 */
+function handlePreview(row) {
+  //0617预览不需要内嵌,新开一个标签页
+  // hostUrl+webHost+row.url 必须时文件全路径 不能转
+  // window.open(fileUrl + encodeURIComponent(Base64.encode(document.location.origin  + webHost + row.url)))
+  // // window.open(fileUrl+ encodeURIComponent(Base64.encode(document.location.host +webHost+row.url)))
+  // console.log('全路径:'+hostUrl+webHost+row.url)
+
+  console.log(document.location);
+  //0617预览不需要内嵌,新开一个标签页
+  // hostUrl+webHost+row.url 必须时文件全路径 不能转
+  var itemUrl = document.location.origin;
+  var fUrl = "";
+  var webUrl = "";
+  console.log(hostIp, itemUrl, 215);
+  console.log(document.location.origin + webHost + row.url);
+  if (itemUrl.includes(hostIp)) {
+    fUrl = inNet;
+    // webUrl = "http://192.168.10.41"
+  } else {
+    fUrl = outNet;
+    // webUrl = "http://36.129.132.128:401"
+  }
+  window.open(
+    fUrl + encodeURIComponent(Base64.encode(hostUrl + webHost + row.url))
+  );
 }
 
 /** 搜索按钮操作 */
 function handleRefreshDrawing() {
-    getDrawingList();
+  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 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();
+  getDrawingList();
 }
 /**
  * 列表checkbox列选择 事件
  */
 function handleSelectionChange(selection) {
-    selections.value = 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 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 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;
@@ -247,21 +380,21 @@ function getRowKey(row) {
 </script>
 <style scoped>
 :deep(.el-tree-node__label) {
-    font-size: 14px !important;
-    display: inline-block;
-    width: 100%;
+  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;
+  height: 40px;
+  border-bottom: 1px solid #ebeef5;
+  padding: 8px 0;
+  line-height: 23px;
 }
 
 .move-handle {
-    cursor: move;
-    background-color: #eee;
+  cursor: move;
+  background-color: #eee;
 }
 </style>
   

+ 345 - 198
src/views/business/drawingRatify/index.vue

@@ -1,108 +1,218 @@
 <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:electronicDrawings:raift']"
-                    @click="handleSaveBacth()">批量批准
+  <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:electronicDrawings:raift']"
+          @click="handleSaveBacth()"
+          >批量批准
+        </el-button>
+        <el-button
+          :disabled="selections.length == 0"
+          type="danger"
+          v-hasPermi="['business:electronicDrawings:raiftNG']"
+          @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="productVersion"
+              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="状态"
+              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="制作人"
+              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
+                  link
+                  type="primary"
+                  @click="handlePreview(scope.row)"
+                >
+                  预览
                 </el-button>
-                <el-button :disabled="selections.length == 0" type="danger" v-hasPermi="['business:electronicDrawings:NG']"
-                    @click="handleNGBacth()">批量NG
+                <el-button
+                  v-hasPermi="['business:electronicDrawings:raift']"
+                  link
+                  type="success"
+                  @click="saveDrawingDetail(scope.row)"
+                >
+                  通过
                 </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="状态" 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="制作人" 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:electronicDrawings:raift']" link type="success"
-                                    @click="saveDrawingDetail(scope.row)">
-                                    通过
-                                </el-button>
-                                <el-button v-hasPermi="['business:electronicDrawings:NG']" 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>
+                <el-button
+                  v-hasPermi="['business:electronicDrawings:raiftNG']"
+                  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">
@@ -111,135 +221,172 @@
 //     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'
+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 hostIp = import.meta.env.VITE_HOST_IP;
+const hostUrl = import.meta.env.VITE_HOST_URL;
+const inNet = import.meta.env.VITE_HOST_INNET;
+const outNet = import.meta.env.VITE_HOST_OUTNET;
 /**字典数组 */
 const { equipment_status } = proxy.useDict("equipment_status");
 const { drawing_status } = proxy.useDict("drawing_status");
 
 const { yes_no } = proxy.useDict("yes_no");
-const drawingTabel = ref(null)
+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 patternLabels = ref([
+  {
+    value: "新产品",
+    label: "新产品",
+  },
+  {
+    value: "替换",
+    label: "替换",
+  },
+]);
 const data = reactive({
-    queryParams: {
-        status: 1,
-        abandoned:0,
-        pageNum: 1,
-        pageSize: 10,
-    },
-    form: {
-        pageNum: 1,
-        pageSize: 10,
-        technologicalProcessDetailId: null,
-        groupDetailList: [],
-        code: "",
-        remark: "",
-        type: false
-    }
-
+  queryParams: {
+    status: 1,
+    abandoned: 0,
+    pageNum: 1,
+    pageSize: 10,
+  },
+  form: {
+    pageNum: 1,
+    pageSize: 10,
+    technologicalProcessDetailId: null,
+    groupDetailList: [],
+    code: "",
+    remark: "",
+    type: false,
+  },
 });
 const { form, queryParams } = toRefs(data);
 
-
 /****************************************************  生命周期函数区  ****************************************************/
 onMounted(() => {
-    getDrawingList();
+  getDrawingList();
 });
 /****************************************************  方法区  ****************************************************/
 
-
 /**删除设备明细 */
 function handleNGdrawingDetail(row) {
-    proxy.$modal
-        .confirm("是否确认废弃图纸?")
-        .then(function () {
-            var itemList = []
-            itemList.push(row)
-            return drawingNG(itemList);
-        })
-        .then(() => {
-            reset()
-            open.value = false
-            proxy.$modal.msgSuccess("废弃成功");
-        })
-        .catch(() => { });
-};
+  proxy.$modal
+    .confirm("是否确认废弃图纸?")
+    .then(function () {
+      var itemList = [];
+      itemList.push(row);
+      return drawingNG(itemList);
+    })
+    .then(() => {
+      reset();
+      open.value = false;
+      proxy.$modal.msgSuccess("废弃成功");
+    })
+    .catch(() => {});
+}
+
+/**预览 */
+function handlePreview(row) {
+  //0617预览不需要内嵌,新开一个标签页
+  // hostUrl+webHost+row.url 必须时文件全路径 不能转
+  // window.open(fileUrl + encodeURIComponent(Base64.encode(document.location.origin  + webHost + row.url)))
+  // // window.open(fileUrl+ encodeURIComponent(Base64.encode(document.location.host +webHost+row.url)))
+  // console.log('全路径:'+hostUrl+webHost+row.url)
+
+  console.log(document.location);
+  //0617预览不需要内嵌,新开一个标签页
+  // hostUrl+webHost+row.url 必须时文件全路径 不能转
+  var itemUrl = document.location.origin;
+  var fUrl = "";
+  var webUrl = "";
+  console.log(hostIp, itemUrl, 215);
+  console.log(document.location.origin + webHost + row.url);
+  if (itemUrl.includes(hostIp)) {
+    fUrl = inNet;
+    // webUrl = "http://192.168.10.41"
+  } else {
+    fUrl = outNet;
+    // webUrl = "http://36.129.132.128:401"
+  }
+  window.open(
+    fUrl + encodeURIComponent(Base64.encode(hostUrl + webHost + row.url))
+  );
+}
 
 /**通过按钮 */
 function saveDrawingDetail(row) {
-    var itemList = []
-    itemList.push(row)
-    saveDrawing(itemList).then(res => {
-        if (res.code == 200) {
-            getDrawingList();
-            loading.value = false
-        }
-    })
+  var itemList = [];
+  itemList.push(row);
+  saveDrawing(itemList).then((res) => {
+    if (res.code == 200) {
+      getDrawingList();
+      loading.value = false;
+    }
+  });
 }
 
 /** 搜索按钮操作 */
 function handleRefreshDrawing() {
-    getDrawingList();
+  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 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();
+  getDrawingList();
 }
 /**
  * 列表checkbox列选择 事件
  */
 function handleSelectionChange(selection) {
-    selections.value = 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 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 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;
@@ -247,21 +394,21 @@ function getRowKey(row) {
 </script>
 <style scoped>
 :deep(.el-tree-node__label) {
-    font-size: 14px !important;
-    display: inline-block;
-    width: 100%;
+  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;
+  height: 40px;
+  border-bottom: 1px solid #ebeef5;
+  padding: 8px 0;
+  line-height: 23px;
 }
 
 .move-handle {
-    cursor: move;
-    background-color: #eee;
+  cursor: move;
+  background-color: #eee;
 }
 </style>
   

+ 219 - 73
src/views/business/outsourceInspectionVerify/index.vue

@@ -2,33 +2,71 @@
 <template>
   <div class="page-container column-container">
     <!-- 搜索区 -->
-    <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
+    <el-form
+      class="list-search-container"
+      :model="queryParams"
+      ref="queryRef"
+      :inline="true"
+    >
       <el-form-item label="单据号:" prop="outsourcedInspectionNo">
-        <el-input v-model="queryParams.outsourcedInspectionNo" placeholder="请输入单据号" style="width: 144px" clearable
-          @keyup.enter="handleQuery" />
+        <el-input
+          v-model="queryParams.outsourcedInspectionNo"
+          placeholder="请输入单据号"
+          style="width: 144px"
+          clearable
+          @keyup.enter="handleQuery"
+        />
       </el-form-item>
       <el-form-item label="检查日期:" prop="startTime">
         <!-- <el-input v-model="queryParams.startTime" placeholder="" style="width: 144px" clearable
           @keyup.enter="handleQuery" /> -->
-        <el-date-picker v-model="queryParams.startTime" type="date" placeholder="选择日期" style="width: 144px" clearable
-          @keyup.enter="handleQuery" value-format="YYYY-MM-DD" />
+        <el-date-picker
+          v-model="queryParams.startTime"
+          type="date"
+          placeholder="选择日期"
+          style="width: 144px"
+          clearable
+          @keyup.enter="handleQuery"
+          value-format="YYYY-MM-DD"
+        />
       </el-form-item>
       <el-form-item label="外协商名称:" prop="supplierName">
-        <el-input v-model="queryParams.supplierName" placeholder="请输入外协商名称" style="width: 144px" clearable
-          @keyup.enter="handleQuery" />
+        <el-input
+          v-model="queryParams.supplierName"
+          placeholder="请输入外协商名称"
+          style="width: 144px"
+          clearable
+          @keyup.enter="handleQuery"
+        />
       </el-form-item>
       <el-form-item label="批次号:" prop="lotCode">
-        <el-input v-model="queryParams.lotCode" placeholder="请输入批次号" style="width: 144px" clearable
-          @keyup.enter="handleQuery" />
+        <el-input
+          v-model="queryParams.lotCode"
+          placeholder="请输入批次号"
+          style="width: 144px"
+          clearable
+          @keyup.enter="handleQuery"
+        />
       </el-form-item>
       <el-form-item label="状态:" prop="auditStatus">
-        <el-select v-model="queryParams.auditStatus" style="width: 144px" clearable placeholder="请选择">
-          <el-option v-for="dict in outsource_before_checkout_verify_status" :key="dict.value" :label="dict.label"
-            :value="dict.value" />
+        <el-select
+          v-model="queryParams.auditStatus"
+          style="width: 144px"
+          clearable
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="dict in outsource_before_checkout_verify_status"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+        <el-button type="primary" icon="Search" @click="handleQuery"
+          >搜索</el-button
+        >
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -40,46 +78,140 @@
     <!-- 渲染数据区 -->
     <div class="el-table-container">
       <div class="el-table-inner-container">
-        <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
-          @selection-change="handleSelectionChange">
+        <el-table
+          v-loading="loading"
+          :data="orderList"
+          size="small"
+          border
+          height="100%"
+          @selection-change="handleSelectionChange"
+        >
           <el-table-column type="selection" width="48" align="center" />
-          <el-table-column label="外协单位" align="center" prop="outsourcedOrderDetail.supplierName" width="320" />
-          <el-table-column label="批次号" align="center" prop="lotCode" width="100" />
-          <el-table-column label="产品描述" align="center" prop="productDescription" width="320" />
-          <el-table-column label="质检单号" align="center" prop="outsourcedInspectionNo" width="120" />
-          <el-table-column label="检查状态" align="center" prop="status" width="120">
+          <el-table-column
+            label="外协单位"
+            align="center"
+            prop="outsourcedOrderDetail.supplierName"
+            width="150"
+          />
+          <el-table-column
+            label="批次号"
+            align="center"
+            prop="lotCode"
+            width="100"
+          />
+          <el-table-column
+            label="产品描述"
+            align="center"
+            prop="productDescription"
+            width="320"
+          />
+          <el-table-column
+            label="检查单号"
+            align="center"
+            prop="outsourcedInspectionNo"
+            width="120"
+          />
+          <el-table-column
+            label="检查状态"
+            align="center"
+            prop="status"
+            width="120"
+          >
             <template #default="scope">
-              <dict-tag :options="process_inspection_status" :value="scope.row.status" />
+              <dict-tag
+                :options="process_inspection_status"
+                :value="scope.row.status"
+              />
             </template>
           </el-table-column>
-          <el-table-column label="外协工序" align="center" prop="processNames" width="120" />
-          <el-table-column label="外协日期" align="center" prop="outsourcedOrderDetail.formDate" width="120">
+          <el-table-column
+            label="外协工序"
+            align="center"
+            prop="processNames"
+            width="120"
+          />
+          <el-table-column
+            label="外协日期"
+            align="center"
+            prop="outsourcedOrderDetail.formDate"
+            width="120"
+          >
             <template #default="scope">
-              {{ parseTime(scope.row.outsourcedOrderDetail.formDate, "{y}-{m}-{d}") }}
+              {{
+                parseTime(
+                  scope.row.outsourcedOrderDetail.formDate,
+                  "{y}-{m}-{d}"
+                )
+              }}
             </template>
           </el-table-column>
-          <el-table-column label="发出量" align="center" prop="outsourcedOrderDetail.productNum" width="120" />
-          <el-table-column label="收回日期" align="center" prop="returnReceiptDetail.formDate" width="120" />
-          <el-table-column label="收回量" align="center" prop="returnReceiptDetail.auditNum" width="120" />
-          <el-table-column label="状态" align="center" prop="auditStatus" width="120">
+          <el-table-column
+            label="发出量"
+            align="center"
+            prop="outsourcedOrderDetail.productNum"
+            width="120"
+          />
+          <el-table-column
+            label="收回日期"
+            align="center"
+            prop="returnReceiptDetail.formDate"
+            width="120"
+          />
+          <el-table-column
+            label="收回量"
+            align="center"
+            prop="returnReceiptDetail.auditNum"
+            width="120"
+          />
+          <el-table-column
+            label="状态"
+            align="center"
+            prop="auditStatus"
+            width="120"
+          >
             <template #default="scope">
-              <dict-tag :options="outsource_before_checkout_verify_status" :value="scope.row.auditStatus" />
+              <dict-tag
+                :options="outsource_before_checkout_verify_status"
+                :value="scope.row.auditStatus"
+              />
             </template>
           </el-table-column>
-          <el-table-column label="检查日期" align="center" prop="startTime" width="120">
+          <el-table-column
+            label="检查日期"
+            align="center"
+            prop="startTime"
+            width="120"
+          >
             <template #default="scope">
               {{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}
             </template>
           </el-table-column>
           <el-table-column label="备注" align="center" prop="remark" />
-          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
+          <el-table-column
+            label="操作"
+            align="center"
+            class-name="small-padding fixed-width"
+            width="200"
+          >
             <template #default="scope">
-              <el-button v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2" link type="warning"
-                icon="Check" @click="handleConfirm(scope.row)" v-hasPermi="['business:beforeCheckoutVerify:edit']">
+              <el-button
+                v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2"
+                link
+                type="warning"
+                icon="Check"
+                @click="handleConfirm(scope.row)"
+                v-hasPermi="['business:beforeCheckoutVerify:edit']"
+              >
                 通过
               </el-button>
-              <el-button v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 1" link type="primary"
-                icon="Close" @click="handleReject(scope.row)" v-hasPermi="['business:beforeCheckoutVerify:edit']">
+              <el-button
+                v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 1"
+                link
+                type="primary"
+                icon="Close"
+                @click="handleReject(scope.row)"
+                v-hasPermi="['business:beforeCheckoutVerify:edit']"
+              >
                 不通过
               </el-button>
             </template>
@@ -89,8 +221,13 @@
     </div>
 
     <!-- 分页 -->
-    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize" @pagination="getList" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
@@ -99,14 +236,18 @@ import {
   listCheckoutInspection,
   rejectInspection,
   confirmInspection,
-  checkFurnace
-} from '@/api/business/beforeCheckoutVerify'
+  checkFurnace,
+} from "@/api/business/beforeCheckoutVerify";
 import { nextTick } from "vue";
 const { proxy } = getCurrentInstance();
 /** 字典数组区 */
-const { outsource_before_checkout_verify_status } = proxy.useDict("outsource_before_checkout_verify_status");
+const { outsource_before_checkout_verify_status } = proxy.useDict(
+  "outsource_before_checkout_verify_status"
+);
 
-const { process_inspection_status } = proxy.useDict("process_inspection_status");
+const { process_inspection_status } = proxy.useDict(
+  "process_inspection_status"
+);
 
 const orderList = ref([]);
 const loading = ref(true);
@@ -114,7 +255,7 @@ const ids = ref([]);
 const single = ref(true);
 const multiple = ref(true);
 const total = ref(0);
-const printCarriers = ref([])
+const printCarriers = ref([]);
 const webHost = import.meta.env.VITE_APP_PRODUCTION_API;
 /** 查询对象 */
 const queryParams = ref({
@@ -129,7 +270,7 @@ const queryParams = ref({
   packagingMethod: null,
   freightPrice: null,
   freightAmount: null,
-  isFirstProcess: 0
+  isFirstProcess: 0,
 });
 
 /***********************  方法区  ****************************/
@@ -165,51 +306,56 @@ function handleSelectionChange(selection) {
 }
 
 function handleConfirm(row) {
-  checkFurnace(row).then(res => {
+  checkFurnace(row).then((res) => {
     if (res.code === 200) {
       if (res.data.length === 1) {
-        proxy.$confirm('是否确认通过?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          confirmInspection(res.data).then(res => {
-            getList()
+        proxy
+          .$confirm("是否确认通过?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
           })
-        });
+          .then(() => {
+            confirmInspection(res.data).then((res) => {
+              getList();
+            });
+          });
       } else {
-        proxy.$confirm('该炉已全部质检,是否全部确认通过?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          confirmInspection(res.data).then(res => {
-            getList()
+        proxy
+          .$confirm("该炉已全部质检,是否全部确认通过?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
           })
-        });
+          .then(() => {
+            confirmInspection(res.data).then((res) => {
+              getList();
+            });
+          });
       }
     } else {
-      proxy.$msgError(res.msg)
+      proxy.$msgError(res.msg);
     }
-  })
+  });
 }
 
 function handleReject(row) {
-  checkFurnace(row).then(res => {
+  checkFurnace(row).then((res) => {
     if (res.code === 200) {
-      proxy.$confirm('是否确认不通过?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        rejectInspection(res.data).then(res => {
-          getList();
+      proxy
+        .$confirm("是否确认不通过?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
         })
-      });
+        .then(() => {
+          rejectInspection(res.data).then((res) => {
+            getList();
+          });
+        });
     }
-  })
+  });
 }
 
-
 getList();
 </script>

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 673 - 309
src/views/business/product/index.vue


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно