gaoluyang
2026-06-02 5b45cbaaafbc45023d7916d9e700d3c59cc33c03
新疆马铃薯
1.过程检验下载添加3个模版
已修改6个文件
196 ■■■■■ 文件已修改
src/api/qualityManagement/rawMaterialInspection.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/financialManagement/receivable/salesReturn.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/index.vue 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/components/detailDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/components/formDia.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/qualityManagement/rawMaterialInspection.js
@@ -64,3 +64,39 @@
    })
}
// 导出伟龙模板
export function exportWeilongTemplate(id) {
    return request({
        url: `/quality/qualityInspect/export/weilong/${id}`,
        method: 'get',
        responseType: 'blob',
    })
}
// 导出百事模板
export function exportBaishiTemplate(id) {
    return request({
        url: `/quality/qualityInspect/export/baishi/${id}`,
        method: 'get',
        responseType: 'blob',
    })
}
// 导出达利模板
export function exportDaliTemplate(id) {
    return request({
        url: `/quality/qualityInspect/export/dali/${id}`,
        method: 'get',
        responseType: 'blob',
    })
}
// 导出通用模板
export function exportCommonTemplate(id) {
    return request({
        url: `/quality/qualityInspect/export/common/${id}`,
        method: 'get',
        responseType: 'blob',
    })
}
src/views/financialManagement/receivable/salesReturn.vue
@@ -74,7 +74,7 @@
const columns = [
  { label: "退货单号", prop: "returnNo", minWidth: "150" },
  { label: "客户名称", prop: "customerName", minWidth: "180" },
  { label: "关联发货单号", prop: "shippingNo", minWidth: "150" },
  { label: "关联批号", prop: "shippingNo", minWidth: "150" },
  { label: "退货日期", prop: "makeTime", minWidth: "170" },
  {
    label: "退款总额",
src/views/qualityManagement/processInspection/index.vue
@@ -72,6 +72,35 @@
      </template>
    </el-dialog>
    <el-dialog v-model="templateDialogVisible"
               title="选择导出模板"
               width="450px"
               @close="closeTemplateDialog">
      <div class="template-grid">
        <div class="template-item" @click="handleTemplateExport('weilong')">
          <div class="template-icon weilong-icon">伟</div>
          <div class="template-name">伟龙模板</div>
        </div>
        <div class="template-item" @click="handleTemplateExport('baishi')">
          <div class="template-icon baishi-icon">百</div>
          <div class="template-name">百事模板</div>
        </div>
        <div class="template-item" @click="handleTemplateExport('dali')">
          <div class="template-icon dali-icon">达</div>
          <div class="template-name">达利模板</div>
        </div>
        <div class="template-item" @click="handleTemplateExport('common')">
          <div class="template-icon common-icon">通</div>
          <div class="template-name">通用模板</div>
        </div>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeTemplateDialog">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
@@ -96,6 +125,10 @@
    qualityInspectListPage,
    qualityInspectUpdate,
    submitQualityInspect,
    exportWeilongTemplate,
    exportBaishiTemplate,
    exportDaliTemplate,
    exportCommonTemplate,
  } from "@/api/qualityManagement/rawMaterialInspection.js";
  import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue";
  import dayjs from "dayjs";
@@ -301,6 +334,9 @@
  const quickCheckDia = ref();
  const { proxy } = getCurrentInstance();
  const userStore = useUserStore();
  const templateDialogVisible = ref(false);
  const currentExportRow = ref(null);
  const changeDaterange = value => {
    searchForm.value.entryDateStart = undefined;
    searchForm.value.entryDateEnd = undefined;
@@ -447,21 +483,51 @@
      });
  };
  const downLoadFile = row => {
    downloadQualityInspect({ id: row.id }).then(blobData => {
      const blob = new Blob([blobData], {
    currentExportRow.value = row;
    templateDialogVisible.value = true;
  };
  const closeTemplateDialog = () => {
    templateDialogVisible.value = false;
    currentExportRow.value = null;
  };
  const handleTemplateExport = async (templateType) => {
    if (!currentExportRow.value) {
      proxy.$modal.msgError("请选择要导出的数据");
      return;
    }
    const id = currentExportRow.value.id;
    const fileNameMap = {
      weilong: "伟龙模版检验结果.doc",
      baishi: "百事模版检验结果.doc",
      dali: "达利模版检验结果.doc",
      common: "通用模版检验结果.doc",
    };
    const exportFuncMap = {
      weilong: exportWeilongTemplate,
      baishi: exportBaishiTemplate,
      dali: exportDaliTemplate,
      common: exportCommonTemplate,
    };
    try {
      const response = await exportFuncMap[templateType](id);
      const blob = new Blob([response], {
        type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      });
      const downloadUrl = window.URL.createObjectURL(blob);
      const link = document.createElement("a");
      link.href = downloadUrl;
      link.download = "过程检验报告.docx";
      link.href = URL.createObjectURL(blob);
      link.download = fileNameMap[templateType];
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
      window.URL.revokeObjectURL(downloadUrl);
    });
      URL.revokeObjectURL(link.href);
      proxy.$modal.msgSuccess("导出成功");
      closeTemplateDialog();
    } catch (error) {
      console.error("导出失败", error);
      proxy.$modal.msgError("导出失败");
    }
  };
  // 导出
  const handleOut = () => {
@@ -486,4 +552,64 @@
  });
</script>
<style scoped></style>
<style scoped>
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 20px 10px;
}
.template-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}
.template-item:hover {
  border-color: #409eff;
  box-shadow: 0 2px 12px rgba(64, 158, 255, 0.2);
  transform: translateY(-2px);
}
.template-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 12px;
}
.weilong-icon {
  background: linear-gradient(135deg, #409eff, #1677ff);
}
.baishi-icon {
  background: linear-gradient(135deg, #67c23a, #529b2e);
}
.dali-icon {
  background: linear-gradient(135deg, #e6a23c, #c4860c);
}
.common-icon {
  background: linear-gradient(135deg, #909399, #6d6d6d);
}
.template-name {
  font-size: 15px;
  color: #303133;
  font-weight: 500;
}
</style>
src/views/salesManagement/returnOrder/components/detailDia.vue
@@ -10,7 +10,7 @@
        <el-descriptions-item label="客户名称">{{ detail.customerName }}</el-descriptions-item>
        <el-descriptions-item label="销售单号">{{ detail.salesContractNo }}</el-descriptions-item>
        <el-descriptions-item label="业务员">{{ detail.salesman }}</el-descriptions-item>
        <el-descriptions-item label="关联发货单号">{{ detail.shippingNo }}</el-descriptions-item>
        <el-descriptions-item label="关联批号">{{ detail.shippingNo }}</el-descriptions-item>
        <!-- <el-descriptions-item label="项目名称">{{ detail.projectName }}</el-descriptions-item> -->
        <el-descriptions-item label="制单人">{{ detail.maker }}</el-descriptions-item>
        <el-descriptions-item label="制单时间">{{ detail.makeTime }}</el-descriptions-item>
src/views/salesManagement/returnOrder/components/formDia.vue
@@ -32,8 +32,8 @@
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="关联发货单号:" prop="shippingId">
                <el-select v-model="form.shippingId" filterable placeholder="请选择出库单号" @change="outboundNoChange">
              <el-form-item label="关联批号:" prop="shippingId">
                <el-select v-model="form.shippingId" filterable placeholder="请选择关联批号" @change="outboundNoChange">
                  <el-option
                    v-for="item in outboundOptions"
                    :key="item.value"
src/views/salesManagement/returnOrder/index.vue
@@ -11,8 +11,8 @@
                <el-form-item label="销售单号">
                    <el-input v-model="searchForm.salesContractNo" placeholder="销售单号" clearable />
                </el-form-item>
                <el-form-item label="关联发货单号">
                    <el-input v-model="searchForm.shippingNo" placeholder="关联发货单号" clearable />
                <el-form-item label="关联批号">
                    <el-input v-model="searchForm.shippingNo" placeholder="关联批号" clearable />
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="handleQuery">搜索</el-button>
@@ -118,7 +118,7 @@
  { label: "客户名称", prop: "customerName", minWidth: 220 },
  { label: "销售单号", prop: "salesContractNo", minWidth: 160 },
  { label: "业务员", prop: "salesman", minWidth: 120 },
  { label: "关联发货单号", prop: "shippingNo", minWidth: 170 },
  { label: "关联批号", prop: "shippingNo", minWidth: 170 },
  { label: "项目名称", prop: "projectName", minWidth: 180 },
  { label: "制单人", prop: "maker", minWidth: 120 },
  {