spring
2025-03-05 dc6e972dd90bac99060d1bf48306c634ac55623a
搬迁标准查新、标准方法的变更、方法验证
已添加14个文件
已修改1个文件
3043 ■■■■■ 文件已修改
src/api/cnas/process/method/methodVerification.js 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/method/standardMethodsChange.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/method/standardNoveltyRetrieval.js 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/methodVerification/components/ViewDeviceDialog.vue 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/methodVerification/components/ViewTestRecord.vue 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/methodVerification/components/calibrationsFileDia.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/methodVerification/components/formDIa.vue 470 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/methodVerification/components/viewWorkPermitDia.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/methodVerification/index.vue 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/standardMethodsChange/components/formDIaChange.vue 472 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/standardMethodsChange/index.vue 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/standardNoveltyRetrieval/components/EditFormDia.vue 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/standardNoveltyRetrieval/components/FormDialog.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/method/standardNoveltyRetrieval/index.vue 640 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/sampleDisposal/sampleDisposal.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/method/methodVerification.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,93 @@
// æ–¹æ³•验证相关接口
import request from "@/utils/request";
//标准方法更新验证列表
export function pagesMethodVerify(query) {
  return request({
    url: "/processMethodVerify/pagesMethodVerify",
    method: "get",
    params: query,
  });
}
//删除标准方法更新验证
export function delMethodVerify(query) {
  return request({
    url: "/processMethodVerify/delMethodVerify",
    method: "delete",
    params: query,
  });
}
//导出标准方法更新验证
export function exportMethodVerify(query) {
  return request({
    url: "/processMethodVerify/exportMethodVerify",
    method: "get",
    responseType: "blob",
    params: query,
  });
}
//查询标准方法验证详情
export function getMethodVerifyOne(query) {
  return request({
    url: "/processMethodVerify/getMethodVerifyOne",
    method: "get",
    params: query,
  });
}
// ä¿®æ”¹æ ‡å‡†æ–¹æ³•验证
export function updateMethodVerify(data) {
  return request({
    url: "/processMethodVerify/updateMethodVerify",
    method: "post",
    data: data,
  });
}
// éªŒè¯ç¡®è®¤
export function methodVerifyAffirm(data) {
  return request({
    url: "/processMethodVerify/methodVerifyAffirm",
    method: "post",
    data: data,
  });
}
// æ–°å¢žæ ‡å‡†æ–¹æ³•验证
export function addMethodVerify(data) {
  return request({
    url: "/processMethodVerify/addMethodVerify",
    method: "post",
    data: data,
  });
}
//通过设备分类获取设备列表
export function search(query) {
  return request({
    url: "/deviceScope/search",
    method: "get",
    params: query,
  });
}
//原始记录列表
export function getVerifyMethodFileList(query) {
  return request({
    url: "/processMethodVerify/getVerifyMethodFileList",
    method: "get",
    params: query,
  });
}
//删除验证原始记录列表
export function delVerifyMethodFileList(query) {
  return request({
    url: "/processMethodVerify/delVerifyMethodFileList",
    method: "delete",
    params: query,
  });
}
src/api/cnas/process/method/standardMethodsChange.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
// æ ‡å‡†æ–¹æ³•的变更相关接口
import request from "@/utils/request";
//标准方法更新验证列表
export function pagesMethodVerify(query) {
  return request({
    url: "/processMethodVerify/pagesMethodVerify",
    method: "get",
    params: query,
  });
}
//删除标准方法更新验证
export function delMethodVerify(query) {
  return request({
    url: "/processMethodVerify/delMethodVerify",
    method: "delete",
    params: query,
  });
}
//导出标准方法更新验证
export function exportMethodVerify(query) {
  return request({
    url: "/processMethodVerify/exportMethodVerify",
    method: "get",
    responseType: "blob",
    params: query,
  });
}
//查询标准方法验证详情
export function getMethodVerifyOne(query) {
  return request({
    url: "/processMethodVerify/getMethodVerifyOne",
    method: "get",
    params: query,
  });
}
// ä¿®æ”¹æ ‡å‡†æ–¹æ³•验证
export function updateMethodVerify(data) {
  return request({
    url: "/processMethodVerify/updateMethodVerify",
    method: "post",
    data: data,
  });
}
// æ–°å¢žæ ‡å‡†æ–¹æ³•验证
export function addMethodVerify(data) {
  return request({
    url: "/processMethodVerify/addMethodVerify",
    method: "post",
    data: data,
  });
}
// éªŒè¯ç¡®è®¤
export function methodVerifyAffirm(data) {
  return request({
    url: "/processMethodVerify/methodVerifyAffirm",
    method: "post",
    data: data,
  });
}
src/api/cnas/process/method/standardNoveltyRetrieval.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
// æ ‡å‡†æŸ¥æ–°é¡µé¢ç›¸å…³æŽ¥å£
import request from "@/utils/request";
//标准查新列表
export function pageMethodSearchNew(query) {
  return request({
    url: "/processMethodSearchNew/pageMethodSearchNew",
    method: "get",
    params: query,
  });
}
//删除
export function deleteById(query) {
  return request({
    url: "/processMethodSearchNew/deleteById",
    method: "delete",
    params: query,
  });
}
//导出标准查新
export function exportMethodSearchNew(query) {
  return request({
    url: "/processMethodSearchNew/exportMethodSearchNew",
    method: "get",
    responseType: "blob",
    params: query,
  });
}
// ä¿®æ”¹æ ‡å‡†æŸ¥æ–°
export function updateMethodSearchNew(data) {
  return request({
    url: "/processMethodSearchNew/updateMethodSearchNew",
    method: "post",
    data: data,
  });
}
// æ–°å¢žæ ‡å‡†æŸ¥æ–°
export function addMethodSearchNew(data) {
  return request({
    url: "/processMethodSearchNew/addMethodSearchNew",
    method: "post",
    data: data,
  });
}
src/views/CNAS/process/method/methodVerification/components/ViewDeviceDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,141 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="viewDeviceDialog"
      title="查看设备" width="80%" @close="closeDia">
      <div v-if="!notAllowEdit" style="text-align: right;margin-bottom: 10px">
        <el-button size="small" type="primary" @click="addRow">添加</el-button>
        <el-button size="small" type="danger" @click="clearTable">清空</el-button>
      </div>
      <div>
        <el-table :data="machineAttachmentList" border height="500" style="width: 100%">
          <el-table-column header-align="center" label="名称" prop="machineName" width="200">
            <template slot="header" slot-scope="scope">
              <p>名称</p>
            </template>
            <template slot-scope="scope">
              <el-select v-model="scope.row.machineName" :disabled="notAllowEdit" class="table_input" clearable
                filterable placeholder="设备名称" size="small" @change="(val) => changeMachineName(val, scope.$index)">
                <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.value">
                  {{ item.label + item.value }}
                </el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column header-align="center" label="型号规格" prop="machineSpecification" width="180">
            <template slot="header" slot-scope="scope">
              <p>型号规格</p>
            </template>
            <template slot-scope="{row}">
              <el-input v-model="row.machineSpecification" :disabled="notAllowEdit" size="small" />
            </template>
          </el-table-column>
          <el-table-column :disabled="notAllowEdit" header-align="center" label="测量范围" prop="machineMeasuringRange">
            <template slot="header" slot-scope="scope">
              <p>测量范围</p>
            </template>
            <template slot-scope="{row}">
              <el-input v-model="row.machineMeasuringRange" :disabled="notAllowEdit" size="small" type="textarea" />
            </template>
          </el-table-column>
          <el-table-column header-align="center" label="①扩展不确定度②最大允差③准确度等级" prop="other">
            <template slot="header" slot-scope="scope">
              <p>①扩展不确定度②最大允差③准确度等级</p>
            </template>
            <template slot-scope="{row}">
              <el-input v-model="row.other" :disabled="notAllowEdit" size="small" type="textarea" />
            </template>
          </el-table-column>
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeDia">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="handleDeviceInfo">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  search,
} from '@/api/cnas/process/method/methodVerification.js'
export default {
  props: {
    notAllowEdit: {
      type: Boolean,
      default: false
    }
  },
  name: 'ViewDeviceDialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      viewDeviceDialog: false,
      machineAttachmentList: [],
      equipOptions: [],
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(info) {
      this.viewDeviceDialog = true
      this.machineAttachmentList = info.machineAttachmentList
      this.getEquipOptions()
    },
    // å¢žåŠ è¡¨æ ¼è¡Œæ•°æ®
    addRow() {
      this.machineAttachmentList.push({
        machineName: '',
        machineSpecification: '',
        machineMeasuringRange: '',
        other: '',
      })
    },
    // æ¸…空表格数据
    clearTable() {
      this.machineAttachmentList = []
    },
    // é€‰æ‹©è®¾å¤‡çš„回调
    changeMachineName(val, index) {
      const index1 = this.equipOptions.findIndex(item => item.value === val);
      if (index1 !== -1) {
        this.machineAttachmentList[index].deviceId = this.equipOptions[index1].id;
        this.machineAttachmentList[index].machineName = this.equipOptions[index1].deviceName;
      }
      this.machineAttachmentList[index].machineSpecification = val
    },
    // æäº¤è®¾å¤‡ä¿¡æ¯
    handleDeviceInfo() {
      if (this.machineAttachmentList.length === 0) {
        this.$message.warning('请添加信息')
        return
      }
      this.viewDeviceDialog = false
      this.$emit('handleDeviceInfo', this.machineAttachmentList)
    },
    closeDia() {
      this.viewDeviceDialog = false
      this.$emit('closDeviceDia')
    },
    // èŽ·å–æ‰€æœ‰è®¾å¤‡
    getEquipOptions() {
      this.equipOptions = []
      search({ status: 0 }).then(res => {
        if (res.code === 200 && res.data) {
          this.equipOptions = res.data.map(m => {
            m.value = m.managementNumber
            m.label = m.deviceName
            return m
          })
        }
      }).catch(error => {
        console.error(error)
      })
    },
  }
};
</script>
<style scoped></style>
src/views/CNAS/process/method/methodVerification/components/ViewTestRecord.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,164 @@
<template>
  <div>
    <el-dialog :visible.sync="filesDialogVisible" title="附件上传" width="80%" @closed="closeFilesLook">
      <div v-if="!notAllowEdit" style="display: flex;justify-content: space-between;">
        <el-upload ref='upload' :action="fileAction" :auto-upload="true" :before-upload="fileBeforeUpload"
          :data="{ methodVerifyId: info.methodVerifyId }" :headers="uploadHeader" :on-error="onError"
          :on-success="handleSuccessUp" :show-file-list="false"
          accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' style="width: 80px !important;">
          <el-button size="small" style="height: 38px" type="primary">附件上传</el-button>
        </el-upload>
      </div>
      <div>
        <limsTable ref="yearTable" :column="columnData" :height="'calc(100vh - 47em)'" :highlightCurrentRow="true"
          :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;">
        </limsTable>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import {
  getVerifyMethodFileList,
  delVerifyMethodFileList,
} from '@/api/cnas/process/method/methodVerification.js'
export default {
  props: {
    notAllowEdit: {
      type: Boolean,
      default: false
    }
  },
  name: 'ViewTestRecord',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { limsTable },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      filesDialogVisible: false,
      tableLoading: false,
      filesLookInfo: {},
      columnData: [
        {
          label: '文件名称',
          prop: 'fileName',
          minWidth: '150px'
        },
        {
          dataType: 'action',
          minWidth: '100',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '下载',
              type: 'text',
              clickFun: (row) => {
                this.upload(row)
              }
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.delete(row)
              },
              showHide: () => {
                return !this.notAllowEdit;
              }
            }
          ]
        }
      ],
      tableData: [],
      info: {}
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.filesDialogVisible = true
      this.info = row
      if (this.info === undefined) {
        this.info = {
          methodVerifyId: ''
        }
      }
      this.searchTableList()
    },
    // æŸ¥è¯¢é™„件列表
    searchTableList() {
      this.tableLoading = true
      getVerifyMethodFileList({ methodVerifyId: this.info.methodVerifyId }).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.tableData = res.data
      }).catch(err => {
        this.tableLoading = false
        console.log('err---', err);
      })
    },
    closeFilesLook() {
      this.filesDialogVisible = false
    },
    // ä¸‹è½½
    upload(row) {
      let url = '';
      if (row.type == 1) {
        url = this.javaApi + '/img/' + row.fileUrl
        this.$download.saveAs(url, row.fileName)
      } else {
        url = this.javaApi + '/word/' + row.fileUrl
        this.$download.saveAs(url, row.fileName)
      }
    },
    // åˆ é™¤
    delete(row) {
      this.tableLoading = true
      delVerifyMethodFileList({ methodFileId: row.methodFileId }).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.$message.success('删除成功')
        this.searchTableList()
      }).catch(err => {
        this.tableLoading = false
        console.log('err---', err);
      })
    },
    // ä¸Šä¼ éªŒè¯
    fileBeforeUpload(file) {
      let flag = true
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload.clearFiles()
        flag = false
      }
      if (!flag) {
        return Promise.reject(flag); //正确的终止
      }
    },
    onError(err, file, fileList, type) {
      this.$message.error('上传失败')
      this.$refs.upload.clearFiles()
    },
    handleSuccessUp(response,) {
      this.upLoading = false;
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.searchTableList()
      }
    },
  },
  computed: {
    fileAction() {
      return this.javaApi + '/processMethodVerify/uploadVerifyMethodFile'
    }
  },
};
</script>
<style scoped></style>
src/views/CNAS/process/method/methodVerification/components/calibrationsFileDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
<template>
  <div>
    <el-dialog :visible.sync="filesDialogVisible" title="查看校准证书" width="80%" @closed="closeFilesLook">
      <div>
        <limsTable ref="yearTable" :column="columnData" :height="'calc(100vh - 47em)'" :highlightCurrentRow="true"
          :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;">
        </limsTable>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="lookDialogVisible" fullscreen title="查看附件" top="5vh" width="800px">
      <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="javaApi + '/img/' + currentInfo.fileUrl"
        style="max-height: 90vh;overflow-y: auto;" />
    </el-dialog>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import filePreview from "@/components/Preview/filePreview.vue";
export default {
  name: 'calibrationsFileDia',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { limsTable, filePreview },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      filesDialogVisible: false,
      tableLoading: false,
      filesLookInfo: {},
      columnData: [
        {
          label: '文件名称',
          prop: 'fileName',
          minWidth: '150px'
        },
        {
          label: '设备名称',
          prop: 'deviceName',
          minWidth: '150px'
        },
        {
          label: '设备编号',
          prop: 'managementNumber',
          minWidth: '150px'
        },
        {
          dataType: 'action',
          minWidth: '100',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '预览',
              type: 'text',
              clickFun: (row) => {
                this.handleLook(row)
              }
            },
            {
              name: '下载',
              type: 'text',
              clickFun: (row) => {
                this.upload(row)
              }
            },
          ]
        }
      ],
      tableData: [],
      info: {},
      currentInfo: {},
      lookDialogVisible: false,
    };
  },
  mounted() {
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.filesDialogVisible = true
      this.info = row
      this.tableData = this.info.calibrationsFileList
    },
    closeFilesLook() {
      this.filesDialogVisible = false
    },
    // æŸ¥çœ‹æ–‡ä»¶
    handleLook(row) {
      this.currentInfo = row
      this.lookDialogVisible = true
    },
    // ä¸‹è½½
    upload(row) {
      let url = '';
      if (row.type == 1) {
        url = this.javaApi + '/img/' + row.fileUrl
        this.$download.saveAs(url, row.fileName)
      } else {
        url = this.javaApi + '/word/' + row.fileUrl
        this.$download.saveAs(url, row.fileName)
      }
    },
  }
};
</script>
<style scoped></style>
src/views/CNAS/process/method/methodVerification/components/formDIa.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,470 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
      :title="operationType === 'edit' ? '编辑' : '新增'" :visible.sync="formDia" width="90%" @close="closeDia">
      <div v-if="operationType === 'edit'" style="text-align: right">
        <el-button :disabled="form.confirmDate" size="medium" type="primary" @click="validation">验证确认</el-button>
      </div>
      <table border="1" cellspacing="10" class="tables">
        <tr>
          <td>
            <p>标准方法</p>
          </td>
          <td>
            <p>验证原因</p>
          </td>
          <td>
            <p>主要技术变化</p>
          </td>
          <td>
            <p>涉及方面</p>
          </td>
          <td>
            <p>标准要求</p>
          </td>
          <td>
            <p>准备情况</p>
          </td>
          <td>
            <p>是否满足</p>
          </td>
          <td>
            <p>备注</p>
          </td>
        </tr>
        <tr>
          <td rowspan="9">
            <el-input v-model="form.methodName" :disabled="form.confirmDate" :rows="6" placeholder="请输入内容" size="small"
              type="textarea">
            </el-input>
          </td>
          <td rowspan="9">
            <el-input v-model="form.verifyReason" :disabled="form.confirmDate" :rows="6" placeholder="请输入内容"
              size="small" type="textarea">
            </el-input>
          </td>
          <td rowspan="9">
            <el-input v-model="form.technologyChange" :disabled="form.confirmDate" :rows="6" placeholder="请输入内容"
              size="small" type="textarea">
            </el-input>
          </td>
        </tr>
        <tr>
          <td>人:</td>
          <td>
            <el-input v-model="form.personRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.personReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.personIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-link type="primary" @click="viewWorkPermit">查看上岗证</el-link>
          </td>
        </tr>
        <tr>
          <td>机:</td>
          <td>
            <el-input v-model="form.machineRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.machineReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.machineIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-link type="primary" @click="viewDevice">查看设备</el-link>
          </td>
        </tr>
        <tr>
          <td>料:</td>
          <td>
            <el-input v-model="form.materialRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.materialReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.materialIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-input v-model="form.materialRemark" :disabled="form.confirmDate" size="small"></el-input>
          </td>
        </tr>
        <tr>
          <td>法:</td>
          <td>
            <el-input v-model="form.methodRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.methodReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.methodIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-link type="primary" @click="viewTestRecord">查看检测记录</el-link>
          </td>
        </tr>
        <tr>
          <td>环:</td>
          <td>
            <el-input v-model="form.environmentRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.environmentReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.environmentIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-input v-model="form.traceabilityRemark" :disabled="form.confirmDate" size="small"></el-input>
          </td>
        </tr>
        <tr>
          <td>测量溯源性:</td>
          <td>
            <el-input v-model="form.traceabilityRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.traceabilityReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.traceabilityIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-link type="primary" @click="viewCalibrationsFileDia">查看校准证书</el-link>
          </td>
        </tr>
        <tr>
          <td>样品管理需求:</td>
          <td>
            <el-input v-model="form.managementRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.managementReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.managementIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-input v-model="form.managementRemark" :disabled="form.confirmDate" size="small"></el-input>
          </td>
        </tr>
        <tr>
          <td>其他:</td>
          <td>
            <el-input v-model="form.otherRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.otherReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.otherIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-input v-model="form.otherRemark" :disabled="form.confirmDate" size="small"></el-input>
          </td>
        </tr>
        <tr>
          <td colspan="3">
            <p>是否引用此标准开展检测:</p>
          </td>
          <td colspan="3">可以引用此标准开展检测</td>
          <td>
            <p>确认时间:</p>
          </td>
          <td>{{ form.confirmDate }}</td>
        </tr>
        <tr>
          <td colspan="3">
            <p>参加确认人签名:</p>
          </td>
          <td colspan="5">
            <el-select v-model="form.confirmUser" :disabled="form.confirmDate" multiple placeholder="请选择" size="small"
              style="width: 100%">
              <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </td>
        </tr>
      </table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeDia">取 æ¶ˆ</el-button>
        <el-button :loading="editLoad" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
    <ViewDeviceDialog v-if="viewDeviceDialog" ref="viewDeviceDialog" :notAllowEdit="notAllowEdit"
      @closDeviceDia="closDeviceDia" @handleDeviceInfo="handleDeviceInfo"></ViewDeviceDialog>
    <ViewTestRecord v-if="viewTestRecordDialog" ref="viewTestRecordDialog" :notAllowEdit="notAllowEdit">
    </ViewTestRecord>
    <ViewWorkPermitDia v-if="viewWorkPermitDia" ref="viewWorkPermitDia"></ViewWorkPermitDia>
    <calibrations-file-dia v-if="calibrationsFileDia" ref="calibrationsFileDia"></calibrations-file-dia>
  </div>
</template>
<script>
import { dateFormat } from '@/utils/date'
import ViewDeviceDialog from './ViewDeviceDialog.vue';
import ViewTestRecord from './ViewTestRecord.vue';
import ViewWorkPermitDia from './viewWorkPermitDia.vue';
import CalibrationsFileDia from './calibrationsFileDia.vue';
import {
  getMethodVerifyOne,
  updateMethodVerify,
  methodVerifyAffirm,
  addMethodVerify,
} from '@/api/cnas/process/method/methodVerification.js'
import { selectUserCondition } from "@/api/system/user";
export default {
  name: 'formDIa',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { CalibrationsFileDia, ViewWorkPermitDia, ViewTestRecord, ViewDeviceDialog },
  props: {
    operationType: {
      type: String,
      default: () => ''
    }
  },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      form: {
        methodName: '',
        verifyReason: '',
        technologyChange: '',
        personRequirements: '',
        personReadiness: '',
        personIsSatisfied: '',
        personRemark: '',
        machineRequirements: '',
        machineReadiness: '',
        machineIsSatisfied: '',
        materialRequirements: '',
        materialReadiness: '',
        materialIsSatisfied: '',
        materialRemark: '',
        methodRequirements: '',
        methodReadiness: '',
        methodIsSatisfied: '',
        environmentRequirements: '',
        environmentReadiness: '',
        environmentIsSatisfied: '',
        traceabilityRequirements: '',
        traceabilityReadiness: '',
        traceabilityIsSatisfied: '',
        traceabilityRemark: '',
        managementRequirements: '',
        managementReadiness: '',
        managementIsSatisfied: '',
        managementRemark: '',
        otherRequirements: '',
        otherReadiness: '',
        otherIsSatisfied: '',
        otherRemark: '',
        machineAttachmentList: []
      },
      editLoad: false,
      info: {
        methodVerifyId: ''
      },
      userList: [],
      viewDeviceDialog: false,
      notAllowEdit: false,
      viewTestRecordDialog: false,
      viewWorkPermitDia: false,
      calibrationsFileDia: false,
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.formDia = true
      this.info = row
      this.getUserList()
      if (this.operationType === 'edit') {
        this.searchInfo(row)
      }
    },
    // æŸ¥è¯¢è¯¦æƒ…信息
    searchInfo(row) {
      getMethodVerifyOne({ methodVerifyId: row.methodVerifyId }).then(res => {
        if (res.code === 201) return
        this.form = { ...res.data }
        if (this.form.confirmUser) {
          this.form.confirmUser = this.form.confirmUser.split(',').map(Number)
        }
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // æäº¤
    handleEdit() {
      this.editLoad = true
      const processMethodSearchNews = this.HaveJson(this.form)
      processMethodSearchNews.confirmUser = processMethodSearchNews.confirmUser && processMethodSearchNews.confirmUser.join(',')
      processMethodSearchNews.operationType = 1
      if (this.operationType === 'edit') {
        this.editInfo(processMethodSearchNews)
      } else {
        this.addInfo(processMethodSearchNews)
      }
    },
    // æŸ¥çœ‹ä¸Šå²—证
    viewWorkPermit() {
      this.viewWorkPermitDia = true
      this.$nextTick(() => {
        this.$refs.viewWorkPermitDia.openDia(this.form)
      })
    },
    // æŸ¥çœ‹æ ¡å‡†è¯ä¹¦
    viewCalibrationsFileDia() {
      this.calibrationsFileDia = true
      this.$nextTick(() => {
        this.$refs.calibrationsFileDia.openDia(this.form)
      })
    },
    // æŸ¥çœ‹è®¾å¤‡
    viewDevice() {
      this.viewDeviceDialog = true
      this.$nextTick(() => {
        this.notAllowEdit = !!this.form.confirmDate;
        this.$refs.viewDeviceDialog.openDia(this.form)
      })
    },
    // å…³é—­è®¾å¤‡å¼¹æ¡†
    closDeviceDia() {
      this.viewDeviceDialog = false
    },
    // æäº¤è®¾å¤‡ä¿¡æ¯
    handleDeviceInfo(machineAttachmentList) {
      this.viewDeviceDialog = false
      this.form.machineAttachmentList = machineAttachmentList
    },
    // æŸ¥çœ‹æ£€æµ‹è®°å½•
    viewTestRecord() {
      this.viewTestRecordDialog = true
      this.$nextTick(() => {
        this.notAllowEdit = !!this.form.confirmDate;
        this.$refs.viewTestRecordDialog.openDia(this.info)
      })
    },
    // æäº¤ç¼–辑
    editInfo(processMethodSearchNews) {
      updateMethodVerify(processMethodSearchNews).then(res => {
        this.editLoad = false
        if (res.code === 201) return
        this.$message.success('操作成功')
        this.closeDia()
      }).catch(err => {
        console.log('err---', err);
        this.editLoad = false
      })
    },
    // æäº¤æ–°å¢ž
    addInfo(processMethodSearchNews) {
      addMethodVerify(processMethodSearchNews).then(res => {
        this.editLoad = false
        if (res.code === 201) return
        this.$message.success('操作成功')
        this.closeDia()
      }).catch(err => {
        console.log('err---', err);
        this.editLoad = false
      })
    },
    // éªŒè¯ç¡®è®¤
    validation() {
      methodVerifyAffirm({ methodVerifyId: this.info.methodVerifyId }).then(res => {
        if (res.code === 201) return
        this.form.confirmDate = dateFormat(new Date())
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // å…³é—­å¼¹æ¡†
    closeDia() {
      this.formDia = false
      this.$emit('closeDia');
    },
    getUserList() {
      selectUserCondition().then(res => {
        if (res.code === 201) {
          return
        }
        this.userList = res.data
      })
    },
  }
};
</script>
<style scoped>
>>>.el-dialog {
  margin-top: 2vh !important;
}
>>>.el-dialog__body {
  max-height: 720px;
  overflow-y: auto;
}
.tables {
  table-layout: fixed;
  width: 100%;
  margin-top: 10px;
}
.tables td {
  height: 34px;
  width: 100px;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 4px;
}
</style>
src/views/CNAS/process/method/methodVerification/components/viewWorkPermitDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,105 @@
<template>
  <div>
    <el-dialog :visible.sync="filesDialogVisible" title="查看上岗证" width="80%" @closed="closeFilesLook">
      <div>
        <limsTable ref="yearTable" :column="columnData" :height="'calc(100vh - 400px)'" :highlightCurrentRow="true"
          :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;">
        </limsTable>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="lookDialogVisible" fullscreen title="查看附件" top="5vh" width="800px">
      <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="javaApi + '/img/' + currentInfo.fileUrl"
        style="max-height: 90vh;overflow-y: auto;" />
    </el-dialog>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import filePreview from "@/components/Preview/filePreview.vue";
export default {
  name: 'viewWorkPermitDia',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { filePreview, limsTable },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      filesDialogVisible: false,
      tableLoading: false,
      filesLookInfo: {},
      columnData: [
        {
          label: '文件名称',
          prop: 'fileName',
          minWidth: '150px'
        },
        {
          label: '持有人',
          prop: 'userName',
          minWidth: '150px'
        },
        {
          dataType: 'action',
          minWidth: '100',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '预览',
              type: 'text',
              clickFun: (row) => {
                this.handleLook(row)
              }
            },
            {
              name: '下载',
              type: 'text',
              clickFun: (row) => {
                this.upload(row)
              }
            },
          ]
        }
      ],
      tableData: [],
      info: {},
      currentInfo: {},
      lookDialogVisible: false,
    };
  },
  mounted() {
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.filesDialogVisible = true
      this.info = row
      this.tableData = this.info.workFileList
      console.log('上岗证表格数据', this.tableData);
    },
    closeFilesLook() {
      this.filesDialogVisible = false
    },
    // æŸ¥çœ‹æ–‡ä»¶
    handleLook(row) {
      this.currentInfo = row
      this.lookDialogVisible = true
    },
    // ä¸‹è½½
    upload(row) {
      let url = '';
      if (row.type == 1) {
        url = this.javaApi + '/img/' + row.fileUrl
        this.$download.saveAs(url, row.fileName)
      } else {
        url = this.javaApi + '/word/' + row.fileUrl
        this.$download.saveAs(url, row.fileName)
      }
    },
  },
};
</script>
<style scoped></style>
src/views/CNAS/process/method/methodVerification/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,224 @@
<template>
  <div>
    <div>
      <div class="view-title">
        <span>方法验证</span>
        <span>
          <el-button size="medium" type="primary" @click="openFormDia('add')">新 å¢ž</el-button>
        </span>
      </div>
      <div class="search-background">
        <span class="search-group">
          <span style="width: 120px">标准方法:</span>
          <el-input v-model="searchForm.methodName" clearable size="small"></el-input>
        </span>
        <span class="search-group">
          <el-button size="medium" @click="resetSearchForm">重 ç½®</el-button>
          <el-button size="medium" type="primary" @click="searchList">查 è¯¢</el-button>
        </span>
      </div>
      <div class="table">
        <div>
          <TableCard :showForm="false" :showTitle="false">
            <template v-slot:table>
              <limsTable :column="tableColumn" :height="'calc(100vh - 23em)'" :table-data="tableData"
                :table-loading="tableLoading" style="padding: 0 15px;margin-bottom: 16px" :page="page"
                @pagination="pagination1">
              </limsTable>
            </template>
          </TableCard>
        </div>
      </div>
    </div>
    <formDIa v-if="formDIa" ref="formDIa" :operationType="operationType" @closeDia="closeDia"></formDIa>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import TableCard from '@/components/TableCard/index.vue';
import formDIa from './components/formDIa.vue';
import {
  pagesMethodVerify,
  delMethodVerify,
  exportMethodVerify,
} from '@/api/cnas/process/method/methodVerification.js'
export default {
  name: 'a7-method-verification',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { TableCard, limsTable, formDIa },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      searchForm: {
        methodName: '',
        operationType: 1,
      },
      options: [
        { label: '上半年', value: '1' },
        { label: '下半年', value: '2' },
      ],
      tableColumn: [
        {
          label: '标准方法',
          prop: 'methodName',
          minWidth: '100'
        },
        {
          label: '验证原因',
          prop: 'verifyReason',
          minWidth: '100'
        },
        {
          label: '主要技术变化',
          prop: 'technologyChange',
          minWidth: '100'
        },
        {
          dataType: 'action',
          minWidth: '60',
          label: '操作',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openFormDia('edit', row);
              },
            },
            {
              name: '导出',
              type: 'text',
              clickFun: (row) => {
                this.downLoadPost(row);
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.deleteRow(row);
              },
            }
          ]
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        size: 20,
        current: 1,
        total: 0,
      },
      formDIa: false,
      operationType: '',
    };
  },
  mounted() {
    this.searchList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢åˆ—表
    searchList() {
      const entity = {
        methodName: this.searchForm.methodName,
        operationType: this.searchForm.operationType,
      }
      const page = this.page
      this.tableLoading = true
      pagesMethodVerify({ ...entity, ...page }).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.tableData = res.data.records
        this.page.total = res.data.total
      }).catch(err => {
        console.log('err---', err);
        this.tableLoading = false
      })
    },
    // åˆ é™¤
    deleteRow(row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.tableLoading = true
        delMethodVerify({ methodVerifyId: row.methodVerifyId }).then(res => {
          this.tableLoading = false
          if (res.code === 201) return
          this.$message.success('删除成功')
          this.searchList()
        }).catch(err => {
          this.tableLoading = false
          console.log('err---', err);
        })
      })
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm() {
      this.searchForm.methodName = '';
      this.searchList()
    },
    openFormDia(type, row) {
      this.formDIa = true
      this.operationType = type
      this.$nextTick(() => {
        this.$refs.formDIa.openDia(row)
      })
    },
    // å¯¼å‡º
    downLoadPost(row) {
      exportMethodVerify({ methodVerifyId: row.methodVerifyId }).then(res => {
        this.outLoading = false
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '标准(方法)确认记录.docx')
      })
    },
    // å…³é—­å¼¹æ¡†
    closeDia() {
      this.formDIa = false
      this.searchList()
    },
    // åˆ†é¡µ
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.searchList();
    },
  }
};
</script>
<style scoped>
.view-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding-left: 20px;
}
.search-background {
  width: 100%;
  height: 80px;
  line-height: 80px;
  background-color: #ffffff;
  display: flex;
}
.search-group {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
.table {
  margin-top: 20px;
  background-color: #ffffff;
  padding-top: 20px;
}
</style>
src/views/CNAS/process/method/standardMethodsChange/components/formDIaChange.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,472 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
      :title="operationType === 'edit' ? '编辑' : '新增'" :visible.sync="formDia" width="90%" @close="closeDia">
      <div v-if="operationType === 'edit'" style="text-align: right">
        <el-button :disabled="form.confirmDate !== '' && form.confirmDate !== null && form.confirmDate !== undefined"
          size="medium" type="primary" @click="validation">验证确认</el-button>
      </div>
      <table border="1" cellspacing="10" class="tables">
        <tr>
          <td>
            <p>标准方法</p>
          </td>
          <td>
            <p>验证原因</p>
          </td>
          <td>
            <p>主要技术变化</p>
          </td>
          <td>
            <p>涉及方面</p>
          </td>
          <td>
            <p>标准要求</p>
          </td>
          <td>
            <p>准备情况</p>
          </td>
          <td>
            <p>是否满足</p>
          </td>
          <td>
            <p>备注</p>
          </td>
        </tr>
        <tr>
          <td rowspan="9">
            <el-input v-model="form.methodName" :disabled="form.confirmDate" :rows="6" placeholder="请输入内容" size="small"
              type="textarea">
            </el-input>
          </td>
          <td rowspan="9">
            <el-input v-model="form.verifyReason" :disabled="form.confirmDate" :rows="6" placeholder="请输入内容"
              size="small" type="textarea">
            </el-input>
          </td>
          <td rowspan="9">
            <el-input v-model="form.technologyChange" :disabled="form.confirmDate" :rows="6" placeholder="请输入内容"
              size="small" type="textarea">
            </el-input>
          </td>
        </tr>
        <tr>
          <td>人:</td>
          <td>
            <el-input v-model="form.personRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.personReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.personIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-link type="primary" @click="viewWorkPermit">查看上岗证</el-link>
          </td>
        </tr>
        <tr>
          <td>机:</td>
          <td>
            <el-input v-model="form.machineRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.machineReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.machineIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-link type="primary" @click="viewDevice">查看设备</el-link>
          </td>
        </tr>
        <tr>
          <td>料:</td>
          <td>
            <el-input v-model="form.materialRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.materialReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.materialIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-input v-model="form.materialRemark" :disabled="form.confirmDate" size="small"></el-input>
          </td>
        </tr>
        <tr>
          <td>法:</td>
          <td>
            <el-input v-model="form.methodRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.methodReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.methodIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-link type="primary" @click="viewTestRecord">查看检测记录</el-link>
          </td>
        </tr>
        <tr>
          <td>环:</td>
          <td>
            <el-input v-model="form.environmentRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.environmentReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.environmentIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-input v-model="form.traceabilityRemark" :disabled="form.confirmDate" size="small"></el-input>
          </td>
        </tr>
        <tr>
          <td>测量溯源性:</td>
          <td>
            <el-input v-model="form.traceabilityRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.traceabilityReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.traceabilityIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-link type="primary" @click="viewCalibrationsFileDia">查看校准证书</el-link>
          </td>
        </tr>
        <tr>
          <td>样品管理需求:</td>
          <td>
            <el-input v-model="form.managementRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.managementReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.managementIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-input v-model="form.managementRemark" :disabled="form.confirmDate" size="small"></el-input>
          </td>
        </tr>
        <tr>
          <td>其他:</td>
          <td>
            <el-input v-model="form.otherRequirements" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-input v-model="form.otherReadiness" :disabled="form.confirmDate" size="small"
              type="textarea"></el-input>
          </td>
          <td>
            <el-radio-group v-model="form.otherIsSatisfied" v-removeAriaHidden :disabled="form.confirmDate">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-input v-model="form.otherRemark" :disabled="form.confirmDate" size="small"></el-input>
          </td>
        </tr>
        <tr>
          <td colspan="3">
            <p>是否引用此标准开展检测:</p>
          </td>
          <td colspan="3">可以引用此标准开展检测</td>
          <td>
            <p>确认时间:</p>
          </td>
          <td>{{ form.confirmDate }}</td>
        </tr>
        <tr>
          <td colspan="3">
            <p>参加确认人签名:</p>
          </td>
          <td colspan="5">
            <el-select v-model="form.confirmUser" :disabled="form.confirmDate" multiple placeholder="请选择" size="small"
              style="width: 100%">
              <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </td>
        </tr>
      </table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeDia">取 æ¶ˆ</el-button>
        <el-button :loading="editLoad" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
    <ViewDeviceDialog v-if="viewDeviceDialog" ref="viewDeviceDialog" :notAllowEdit="notAllowEdit"
      @closDeviceDia="closDeviceDia" @handleDeviceInfo="handleDeviceInfo"></ViewDeviceDialog>
    <ViewTestRecord v-if="viewTestRecordDialog" ref="viewTestRecordDialog" :notAllowEdit="notAllowEdit">
    </ViewTestRecord>
    <ViewWorkPermitDia v-if="viewWorkPermitDia" ref="viewWorkPermitDia"></ViewWorkPermitDia>
    <calibrations-file-dia v-if="calibrationsFileDia" ref="calibrationsFileDia"></calibrations-file-dia>
  </div>
</template>
<script>
import { dateFormat } from '@/utils/date'
import ViewTestRecord from '../../methodVerification/components/ViewTestRecord.vue';
import ViewDeviceDialog from '../../methodVerification/components/ViewDeviceDialog.vue';
import ViewWorkPermitDia from '../../methodVerification/components/viewWorkPermitDia.vue';
import CalibrationsFileDia from '../../methodVerification/components/calibrationsFileDia.vue';
import {
  getMethodVerifyOne,
  updateMethodVerify,
  addMethodVerify,
  methodVerifyAffirm,
} from '@/api/cnas/process/method/standardMethodsChange.js'
import { selectUserCondition } from "@/api/system/user";
export default {
  name: 'formDIaChange',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { CalibrationsFileDia, ViewWorkPermitDia, ViewDeviceDialog, ViewTestRecord },
  props: {
    operationType: {
      type: String,
      default: () => ''
    }
  },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      form: {
        methodName: '',
        verifyReason: '',
        technologyChange: '',
        personRequirements: '',
        personReadiness: '',
        personIsSatisfied: '',
        personRemark: '',
        machineRequirements: '',
        machineReadiness: '',
        machineIsSatisfied: '',
        materialRequirements: '',
        materialReadiness: '',
        materialIsSatisfied: '',
        materialRemark: '',
        methodRequirements: '',
        methodReadiness: '',
        methodIsSatisfied: '',
        environmentRequirements: '',
        environmentReadiness: '',
        environmentIsSatisfied: '',
        traceabilityRequirements: '',
        traceabilityReadiness: '',
        traceabilityIsSatisfied: '',
        traceabilityRemark: '',
        managementRequirements: '',
        managementReadiness: '',
        managementIsSatisfied: '',
        managementRemark: '',
        otherRequirements: '',
        otherReadiness: '',
        otherIsSatisfied: '',
        otherRemark: '',
        machineAttachmentList: []
      },
      editLoad: false,
      info: {
        methodVerifyId: ''
      },
      userList: [],
      viewDeviceDialog: false,
      viewTestRecordDialog: false,
      viewWorkPermitDia: false,
      calibrationsFileDia: false,
      notAllowEdit: false,
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.formDia = true
      this.info = row
      this.getUserList()
      if (this.operationType === 'edit') {
        this.searchInfo(row)
      }
    },
    // æŸ¥è¯¢è¯¦æƒ…信息
    searchInfo(row) {
      getMethodVerifyOne({ methodVerifyId: row.methodVerifyId }).then(res => {
        if (res.code === 201) return
        this.form = { ...res.data }
        if (this.form.confirmUser) {
          this.form.confirmUser = this.form.confirmUser.split(',').map(Number)
        }
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // æäº¤
    handleEdit() {
      this.editLoad = true
      const processMethodSearchNews = this.HaveJson(this.form)
      processMethodSearchNews.confirmUser = processMethodSearchNews.confirmUser && processMethodSearchNews.confirmUser.join(',')
      processMethodSearchNews.operationType = 0
      if (this.operationType === 'edit') {
        this.editInfo(processMethodSearchNews)
      } else {
        this.addInfo(processMethodSearchNews)
      }
    },
    // æŸ¥çœ‹ä¸Šå²—证
    viewWorkPermit() {
      this.viewWorkPermitDia = true
      this.$nextTick(() => {
        console.log('上岗证', this.form);
        this.$refs.viewWorkPermitDia.openDia(this.form)
      })
    },
    // æŸ¥çœ‹æ ¡å‡†è¯ä¹¦
    viewCalibrationsFileDia() {
      this.calibrationsFileDia = true
      this.$nextTick(() => {
        this.$refs.calibrationsFileDia.openDia(this.form)
      })
    },
    // æŸ¥çœ‹è®¾å¤‡
    viewDevice() {
      this.viewDeviceDialog = true
      this.$nextTick(() => {
        this.notAllowEdit = !!this.form.confirmDate;
        this.$refs.viewDeviceDialog.openDia(this.form)
      })
    },
    // å…³é—­è®¾å¤‡å¼¹æ¡†
    closDeviceDia() {
      this.viewDeviceDialog = false
    },
    // æäº¤è®¾å¤‡ä¿¡æ¯
    handleDeviceInfo(machineAttachmentList) {
      this.viewDeviceDialog = false
      this.form.machineAttachmentList = machineAttachmentList
    },
    // æŸ¥çœ‹æ£€æµ‹è®°å½•
    viewTestRecord() {
      this.viewTestRecordDialog = true
      this.$nextTick(() => {
        this.notAllowEdit = !!this.form.confirmDate;
        this.$refs.viewTestRecordDialog.openDia(this.info)
      })
    },
    // æäº¤ç¼–辑
    editInfo(processMethodSearchNews) {
      updateMethodVerify(processMethodSearchNews).then(res => {
        this.editLoad = false
        if (res.code === 201) return
        this.$message.success('操作成功')
        this.closeDia()
      }).catch(err => {
        console.log('err---', err);
        this.editLoad = false
      })
    },
    // æäº¤æ–°å¢ž
    addInfo(processMethodSearchNews) {
      addMethodVerify(processMethodSearchNews).then(res => {
        this.editLoad = false
        if (res.code === 201) return
        this.$message.success('操作成功')
        this.closeDia()
      }).catch(err => {
        console.log('err---', err);
        this.editLoad = false
      })
    },
    // éªŒè¯ç¡®è®¤
    validation() {
      methodVerifyAffirm({ methodVerifyId: this.info.methodVerifyId }).then(res => {
        if (res.code === 201) return
        this.form.confirmDate = dateFormat(new Date())
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // å…³é—­å¼¹æ¡†
    closeDia() {
      this.formDia = false
      this.$emit('closeDia');
    },
    getUserList() {
      selectUserCondition().then(res => {
        if (res.code === 201) {
          return
        }
        this.userList = res.data
      })
    },
  }
};
</script>
<style scoped>
>>>.el-dialog {
  margin-top: 2vh !important;
}
>>>.el-dialog__body {
  max-height: 720px;
  overflow-y: auto;
}
.tables {
  table-layout: fixed;
  width: 100%;
  margin-top: 10px;
}
.tables td {
  height: 34px;
  width: 100px;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 4px;
}
</style>
src/views/CNAS/process/method/standardMethodsChange/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,224 @@
<template>
  <div>
    <div>
      <div class="view-title">
        <span>标准方法的变更</span>
        <span>
          <el-button size="medium" type="primary" @click="openFormDia('add')">新 å¢ž</el-button>
        </span>
      </div>
      <div class="search-background">
        <span class="search-group">
          <span style="width: 120px">标准方法:</span>
          <el-input v-model="searchForm.methodName" clearable size="small"></el-input>
        </span>
        <span class="search-group">
          <el-button size="medium" @click="resetSearchForm">重 ç½®</el-button>
          <el-button size="medium" type="primary" @click="searchList">查 è¯¢</el-button>
        </span>
      </div>
      <div class="table">
        <div>
          <TableCard :showForm="false" :showTitle="false">
            <template v-slot:table>
              <limsTable :column="tableColumn" :height="'calc(100vh - 23em)'" :table-data="tableData"
                :table-loading="tableLoading" style="padding: 0 15px;margin-bottom: 16px" :page="page"
                @pagination="pagination">
              </limsTable>
            </template>
          </TableCard>
        </div>
      </div>
    </div>
    <formDIaChange v-if="formDIa" ref="formDIa" :operationType="operationType" @closeDia="closeDia"></formDIaChange>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import TableCard from '@/components/TableCard/index.vue';
import formDIaChange from './components/formDIaChange.vue';
import {
  pagesMethodVerify,
  delMethodVerify,
  exportMethodVerify,
} from '@/api/cnas/process/method/standardMethodsChange.js'
export default {
  name: 'a7-changes-standard-methods',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { formDIaChange, TableCard, limsTable },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      searchForm: {
        methodName: '',
        operationType: 0,
      },
      options: [
        { label: '上半年', value: '1' },
        { label: '下半年', value: '2' },
      ],
      tableColumn: [
        {
          label: '标准方法',
          prop: 'methodName',
          minWidth: '100'
        },
        {
          label: '验证原因',
          prop: 'verifyReason',
          minWidth: '100'
        },
        {
          label: '主要技术变化',
          prop: 'technologyChange',
          minWidth: '100'
        },
        {
          dataType: 'action',
          minWidth: '60',
          label: '操作',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openFormDia('edit', row);
              },
            },
            {
              name: '导出',
              type: 'text',
              clickFun: (row) => {
                this.downLoadPost(row);
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.deleteRow(row);
              },
            }
          ]
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        size: 20,
        current: 1,
        total: 0,
      },
      formDIa: false,
      operationType: '',
    };
  },
  mounted() {
    this.searchList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢åˆ—表
    searchList() {
      const entity = {
        methodName: this.searchForm.methodName,
        operationType: this.searchForm.operationType,
      }
      const page = this.page
      this.tableLoading = true
      pagesMethodVerify({ ...entity, ...page }).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.tableData = res.data.records
        this.page.total = res.data.total
      }).catch(err => {
        console.log('err---', err);
        this.tableLoading = false
      })
    },
    // åˆ é™¤
    deleteRow(row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.tableLoading = true
        delMethodVerify({ methodVerifyId: row.methodVerifyId }).then(res => {
          this.tableLoading = false
          if (res.code === 201) return
          this.$message.success('删除成功')
          this.searchList()
        }).catch(err => {
          this.tableLoading = false
          console.log('err---', err);
        })
      })
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm() {
      this.searchForm.methodName = '';
      this.searchList()
    },
    openFormDia(type, row) {
      this.formDIa = true
      this.operationType = type
      this.$nextTick(() => {
        this.$refs.formDIa.openDia(row)
      })
    },
    // å…³é—­å¼¹æ¡†
    closeDia() {
      this.formDIa = false
      this.searchList()
    },
    // å¯¼å‡º
    downLoadPost(row) {
      exportMethodVerify({ methodVerifyId: row.methodVerifyId }).then(res => {
        this.outLoading = false
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '标准(方法)确认记录.docx')
      })
    },
    // åˆ†é¡µ
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.searchList();
    },
  }
};
</script>
<style scoped>
.view-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding-left: 20px;
}
.search-background {
  width: 100%;
  height: 80px;
  line-height: 80px;
  background-color: #ffffff;
  display: flex;
}
.search-group {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
.table {
  margin-top: 20px;
  background-color: #ffffff;
  padding-top: 20px;
}
</style>
src/views/CNAS/process/method/standardNoveltyRetrieval/components/EditFormDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,146 @@
<template>
  <div>
    <el-dialog :visible.sync="formDia" title="编辑" width="80%" @close="closeDia">
      <el-form ref="form" :model="form" :rules="formRules" label-width="auto">
        <el-col :span="8">
          <el-form-item label="标准名称:" prop="methodName">
            <el-input v-model="form.methodName" size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="标准号:" prop="standardNo">
            <el-input v-model="form.standardNo" size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="文件编号:" prop="fileNo">
            <el-input v-model="form.fileNo" size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="是否是新标准:" prop="isNewStandard">
            <el-radio-group v-model="form.isNewStandard">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="查新记录来源:" prop="searchNewSource">
            <el-radio-group v-model="form.searchNewSource">
              <el-radio :label="0">标准网</el-radio>
              <el-radio :label="1">委托情报</el-radio>
              <el-radio :label="2">标准数</el-radio>
              <el-radio :label="3">其他</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="备注:" prop="remark">
            <el-select v-model="form.remark" clearable size="small">
              <el-option :value="0" label="作废"></el-option>
              <el-option :value="1" label="替换"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col v-if="form.isNewStandard == 1" :span="8">
          <el-form-item label="新标准名称:" prop="newMethodName">
            <el-input v-model="form.newMethodName" size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col v-if="form.isNewStandard == 1" :span="8">
          <el-form-item label="新标准号:" prop="newStandardNo">
            <el-input v-model="form.newStandardNo" size="small"></el-input>
          </el-form-item>
        </el-col>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeDia">取 æ¶ˆ</el-button>
        <el-button :loading="editLoad" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  updateMethodSearchNew,
} from '@/api/cnas/process/method/standardNoveltyRetrieval.js'
export default {
  name: 'FormDialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      form: {
        methodName: '',
        standardNo: '',
        isNewStandard: '',
        newMethodName: '',
        newStandardNo: '',
        searchNewSource: '',
        remark: '',
        fileNo: '',
      },
      formRules: {
        methodName: [{ required: true, message: '请填写标准名称', trigger: 'blur' }],
        standardNo: [{ required: true, message: '请填写标准号', trigger: 'blur' }],
        isNewStandard: [{ required: true, message: '请选择是否是新标准', trigger: 'change' }],
        newMethodName: [{ required: true, message: '请填写新标准名称', trigger: 'blur' }],
        newStandardNo: [{ required: true, message: '请填写新标准号', trigger: 'blur' }],
        searchNewSource: [{ required: true, message: '请选择查新记录来源', trigger: 'change' }],
        fileNo: [{ required: true, message: '请填写文件号', trigger: 'blur' }],
      },
      editLoad: false,
      info: {},
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.formDia = true
      this.form = { ...row }
    },
    handleEdit() {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          this.editLoad = true
          const processMethodSearchNews = this.HaveJson(this.form)
          delete processMethodSearchNews.createTime
          updateMethodSearchNew(processMethodSearchNews).then(res => {
            this.editLoad = false
            if (res.code === 201) return
            this.$message.success('操作成功')
            this.closeDia()
          }).catch(err => {
            console.log('err---', err);
            this.editLoad = false
          })
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    closeDia() {
      this.$refs.form.resetFields();
      this.formDia = false
      this.$emit('closeEditDia');
    },
  }
};
</script>
<style scoped>
.form-info {
  display: inline-block;
  max-height: 600px;
  overflow-y: auto;
}
>>>.el-dialog {
  margin: 6vh auto 50px !important;
}
</style>
src/views/CNAS/process/method/standardNoveltyRetrieval/components/FormDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,138 @@
<template>
  <div>
    <el-dialog :visible.sync="formDia" title="新增" width="80%" @close="closeDia">
      <el-form ref="form" :model="form" :rules="formRules" label-width="auto">
        <el-button size="small" type="primary" @click="addBtn">添加一条</el-button>
        <div class="form-info">
          <div v-for="(items, index) in form.taskRel" :key="index">
            <el-col :span="12">
              <el-form-item :prop="`taskRel.${index}.newMethodName`"
                :rules="{ required: true, message: '请填写标准名称', trigger: 'blur', }" label="新标准名称:">
                <el-input v-model="items.newMethodName" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item :prop="`taskRel.${index}.newStandardNo`"
                :rules="{ required: true, message: '请填写标准号', trigger: 'blur', }" label="新标准号:">
                <el-input v-model="items.newStandardNo" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item :prop="`taskRel.${index}.searchNewSource`"
                :rules="{ required: true, message: '请选择查新记录来源', trigger: 'change', }" label="查新记录来源:">
                <el-radio-group v-model="items.searchNewSource">
                  <el-radio :label="0">标准网</el-radio>
                  <el-radio :label="1">委托情报</el-radio>
                  <el-radio :label="2">标准数</el-radio>
                  <el-radio :label="3">其他</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item :prop="`taskRel.${index}.remark`"
                :rules="{ required: false, message: '请选择备注', trigger: 'change', }" label="备注:">
                <el-select v-model="items.remark" :prop="`taskRel.${index}.remark`"
                  :rules="{ required: false, message: '请选择备注', trigger: 'change', }" clearable size="small">
                  <el-option :value="0" label="作废"></el-option>
                  <el-option :value="1" label="替换"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-button v-if="index !== 0" circle icon="el-icon-delete" size="small" type="danger"
                @click="deleteHeaderRow(index)"></el-button>
            </el-col>
            <el-col :span="24">
              <el-divider></el-divider>
            </el-col>
          </div>
        </div>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeDia">取 æ¶ˆ</el-button>
        <el-button :loading="editLoad" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  addMethodSearchNew,
} from '@/api/cnas/process/method/standardNoveltyRetrieval.js'
export default {
  name: 'FormDialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      form: {
        taskRel: [
          {
            newMethodName: '',
            newStandardNo: '',
            searchNewSource: '',
            remark: '',
          }
        ]
      },
      formRules: {},
      editLoad: false,
      info: {},
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.formDia = true
    },
    // æ·»åŠ ä¸€æ¡
    addBtn() {
      this.form.taskRel.push({ newMethodName: '', newStandardNo: '', searchNewSource: '', remark: '' });
    },
    // åˆ é™¤ä¸€æ¡
    deleteHeaderRow(index) {
      this.form.taskRel.splice(index, 1);
    },
    handleEdit() {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          this.editLoad = true
          const processMethodSearchNews = this.HaveJson(this.form.taskRel)
          addMethodSearchNew(processMethodSearchNews).then(res => {
            this.editLoad = false
            if (res.code === 201) return
            this.$message.success('操作成功')
            this.closeDia()
          }).catch(err => {
            console.log('err---', err);
            this.editLoad = false
          })
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    closeDia() {
      this.$refs.form.resetFields();
      this.formDia = false
      this.$emit('closeDia');
    },
  }
};
</script>
<style scoped>
.form-info {
  display: inline-block;
  max-height: 42em;
  overflow-y: auto;
}
>>>.el-dialog {
  margin: 6vh auto 50px !important;
}
</style>
src/views/CNAS/process/method/standardNoveltyRetrieval/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,640 @@
<template>
  <div>
    <div>
      <div class="view-title">
        <span>标准查新</span>
        <span style="display: flex; align-items: center;">
          <el-button size="medium" type="primary" @click="openHandleOut">导 å‡º</el-button>
          <el-upload ref='upload' :action="action" :before-upload="beforeUpload" :headers="uploadHeader"
            :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false"
            accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
            style="display: inline-block; margin-left: 10px;">
            <el-button :loading="upLoading" size="medium" type="primary">导入</el-button>
          </el-upload>
          <el-button size="medium" style="margin-left: 10px;" type="primary" @click="openFormDia">新 å¢ž</el-button>
        </span>
      </div>
      <div class="search-background">
        <span v-if="tabIndex == 1" class="search-group">
          <span>年份:</span>
          <el-date-picker v-model="searchForm.year" format="yyyy" placeholder="选择年" type="year" value-format="yyyy">
          </el-date-picker>
        </span>
        <span class="search-group">
          <span>时间:</span>
          <el-select v-model="searchForm.date" clearable placeholder="请选择">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </span>
        <span class="search-group">
          <el-button size="medium" @click="resetSearchForm">重 ç½®</el-button>
          <el-button size="medium" type="primary" @click="searchList">查 è¯¢</el-button>
        </span>
      </div>
      <div class="table">
        <div class="table-tab">
          <el-radio-group v-model="tabIndex" @change="searchList">
            <el-radio-button label="0">今年标准记录</el-radio-button>
            <el-radio-button label="1">历史标准记录</el-radio-button>
          </el-radio-group>
        </div>
        <div v-if="tabIndex === '0'">
          <TableCard :showForm="false" :showTitle="false">
            <template v-slot:table>
              <limsTable :column="tableColumn" :height="'calc(100vh - 26em)'" :table-data="tableData"
                :table-loading="tableLoading" style="padding: 0 15px;margin-bottom: 16px" :page="page"
                @pagination="pagination">
              </limsTable>
            </template>
          </TableCard>
          <el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]" :total="total"
            layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
            @current-change="handleCurrentChange">
          </el-pagination>
        </div>
        <div v-if="tabIndex === '1'">
          <TableCard :showForm="false" :showTitle="false">
            <template v-slot:table>
              <limsTable :column="oldTableColumn" :height="'calc(100vh - 27em)'" :table-data="oldTableData"
                :table-loading="oldTableLoading" style="padding: 0 15px;margin-bottom: 16px" :page="oldPage"
                @pagination="oldPagination">
              </limsTable>
            </template>
          </TableCard>
        </div>
      </div>
      <el-dialog :visible.sync="ratifyDialog" title="导出" width="30%" @close="ratifyDialog = false">
        <span>编制人:
          <el-select v-model="ratifyInfo.writeUserId" placeholder="请选择" size="small" style="width: 100%">
            <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
          </el-select>
        </span>
        <span>编制日期:
          <el-date-picker v-model="ratifyInfo.writeDate" format="yyyy-MM-dd" placeholder="选择日期" size="small"
            style="width:100%" type="date" value-format="yyyy-MM-dd">
          </el-date-picker>
        </span>
        <span>批准人:
          <el-select v-model="ratifyInfo.ratifyUserId" placeholder="请选择" size="small" style="width: 100%">
            <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
          </el-select>
        </span>
        <span>批准日期:
          <el-date-picker v-model="ratifyInfo.ratifyDate" format="yyyy-MM-dd" placeholder="选择日期" size="small"
            style="width:100%" type="date" value-format="yyyy-MM-dd">
          </el-date-picker>
        </span>
        <span slot="footer" class="dialog-footer">
          <el-button @click="ratifyDialog = false">取 æ¶ˆ</el-button>
          <el-button :loading="outLoading" type="primary" @click="handleOut">ç¡® è®¤</el-button>
        </span>
      </el-dialog>
      <FormDialog v-if="formDialog" ref="formDialog" @closeDia="closeDia"></FormDialog>
      <EditFormDia v-if="editFormDialog" ref="editFormDialog" @closeEditDia="closeEditDia"></EditFormDia>
    </div>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import TableCard from '@/components/TableCard/index.vue';
import FormDialog from './components/FormDialog.vue';
import EditFormDia from './components/EditFormDia.vue';
import { selectUserCondition } from "@/api/system/user";
import {
  pageMethodSearchNew,
  deleteById,
  exportMethodSearchNew,
} from '@/api/cnas/process/method/standardNoveltyRetrieval.js'
export default {
  name: 'a7-standard-novelty-retrieval',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { FormDialog, TableCard, limsTable, EditFormDia },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      searchForm: {
        year: '',
        date: '',
      },
      options: [
        { label: '上半年', value: '1' },
        { label: '下半年', value: '2' },
      ],
      tableColumn: [
        {
          label: '标准名称',
          prop: 'methodName',
          minWidth: '100'
        },
        {
          label: '标准号',
          prop: 'standardNo',
          minWidth: '100'
        },
        {
          label: '文件编号',
          prop: 'fileNo',
          minWidth: '100'
        },
        {
          dataType: 'tag',
          label: '是否是新标准',
          prop: 'isNewStandard',
          minWidth: '100',
          formatData: (params) => {
            if (params == 0) {
              return '否';
            } else if (params == 1) {
              return '是';
            } else {
              return null
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return 'danger';
            } else if (params == 1) {
              return 'success';
            } else {
              return null
            }
          }
        },
        {
          label: '新标准名称',
          prop: 'newMethodName',
          minWidth: '100'
        },
        {
          label: '新标准号',
          prop: 'newStandardNo',
          minWidth: '100'
        },
        {
          dataType: 'tag',
          label: '查询记录来源',
          prop: 'searchNewSource',
          minWidth: '100',
          formatData: (params) => {
            if (params == 0) {
              return '标准网';
            } else if (params == 1) {
              return '委托情报';
            } else if (params == 2) {
              return '标准数';
            } else if (params == 3) {
              return '其他';
            } else {
              return null
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return 'success';
            } else if (params == 1) {
              return 'danger';
            } else if (params == 2) {
              return 'warning';
            } else if (params == 3) {
              return 'info';
            } else {
              return null
            }
          }
        },
        {
          dataType: 'tag',
          label: '备注',
          prop: 'remark',
          minWidth: '100',
          formatData: (params) => {
            if (params == 0) {
              return '作废';
            } else if (params == 1) {
              return '替换';
            } else {
              return null
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return 'danger';
            } else if (params == 1) {
              return 'success';
            } else {
              return null
            }
          }
        },
        {
          label: '创建时间',
          prop: 'createTime',
          minWidth: '100'
        },
        {
          dataType: 'action',
          minWidth: '80',
          label: '操作',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openEditFormDia(row);
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.delete(row)
              },
            }
          ]
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        size: 20,
        current: 1,
        total: 0,
      },
      total: 0,
      oldTotal: 0,
      oldPage: {
        size: 20,
        current: 1,
        total: 0,
      },
      oldTableColumn: [
        {
          label: '标准名称',
          prop: 'methodName',
          minWidth: '100'
        },
        {
          label: '标准号',
          prop: 'standardNo',
          minWidth: '100'
        },
        {
          label: '文件编号',
          prop: 'fileNo',
          minWidth: '100'
        },
        {
          dataType: 'tag',
          label: '是否是新标准',
          prop: 'isNewStandard',
          minWidth: '100',
          formatData: (params) => {
            if (params == 0) {
              return '否';
            } else if (params == 1) {
              return '是';
            } else {
              return null
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return 'danger';
            } else if (params == 1) {
              return 'success';
            } else {
              return null
            }
          }
        },
        {
          label: '新标准名称',
          prop: 'newMethodName',
          minWidth: '100'
        },
        {
          label: '新标准号',
          prop: 'newStandardNo',
          minWidth: '100'
        },
        {
          dataType: 'tag',
          label: '查询记录来源',
          prop: 'searchNewSource',
          minWidth: '100',
          formatData: (params) => {
            if (params == 0) {
              return '标准网';
            } else if (params == 1) {
              return '委托情报';
            } else if (params == 2) {
              return '标准数';
            } else if (params == 3) {
              return '其他';
            } else {
              return null
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return 'success';
            } else if (params == 1) {
              return 'danger';
            } else if (params == 2) {
              return 'warning';
            } else if (params == 3) {
              return 'info';
            } else {
              return null
            }
          }
        },
        {
          dataType: 'tag',
          label: '备注',
          prop: 'remark',
          minWidth: '100',
          formatData: (params) => {
            if (params == 0) {
              return '作废';
            } else if (params == 1) {
              return '替换';
            } else {
              return null
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return 'danger';
            } else if (params == 1) {
              return 'success';
            } else {
              return null
            }
          }
        },
        {
          label: '创建时间',
          prop: 'createTime',
          minWidth: '100'
        },
      ],
      oldTableData: [],
      oldTableLoading: false,
      tabIndex: '0',
      formDialog: false,
      editFormDialog: false,
      upLoading: false,
      outLoading: false,
      ratifyDialog: false,
      ratifyInfo: {
        writeUserId: '',
        ratifyUserId: '',
        writeDate: '',
        ratifyDate: '',
      },
      userList: []
    };
  },
  mounted() {
    this.searchList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢åˆ—表
    searchList() {
      let beginDate = ''
      let endDate = ''
      const currentYear = new Date().getFullYear()
      if (this.searchForm.year && this.searchForm.date) {
        if (this.searchForm.date === '1') {
          beginDate = this.searchForm.year + '-' + '01-01' + ' ' + '00:00:00'
          endDate = this.searchForm.year + '-' + '06-30' + ' ' + '23:59:59'
        } else {
          beginDate = this.searchForm.year + '-' + '07-01' + ' ' + '00:00:00'
          endDate = this.searchForm.year + '-' + '12-31' + ' ' + '23:59:59'
        }
      } else if (!this.searchForm.year && this.searchForm.date) {
        if (this.searchForm.date === '1') {
          beginDate = currentYear + '-' + '01-01' + ' ' + '00:00:00'
          endDate = currentYear + '-' + '06-30' + ' ' + '23:59:59'
        } else {
          beginDate = currentYear + '-' + '07-01' + ' ' + '00:00:00'
          endDate = currentYear + '-' + '12-31' + ' ' + '23:59:59'
        }
      } else if (this.searchForm.year && !this.searchForm.date) {
        beginDate = this.searchForm.year + '-' + '01-01' + ' ' + '00:00:00'
        endDate = this.searchForm.year + '-' + '12-31' + ' ' + '23:59:59'
      }
      if (this.tabIndex === '0' && !this.searchForm.date) {
        beginDate = currentYear + '-' + '01-01' + ' ' + '00:00:00'
        endDate = currentYear + '-' + '12-31' + ' ' + '23:59:59'
      }
      const entity = {
        beginDate: beginDate,
        endDate: endDate,
      }
      this.tableLoading = true
      this.oldTableLoading = true
      const page = this.tabIndex === '0' ? this.page : this.oldPage
      pageMethodSearchNew({ ...entity, ...page }).then(res => {
        this.tableLoading = false
        this.oldTableLoading = false
        if (res.code === 201) return
        if (this.tabIndex === '0') {
          this.tableData = res.data.records
          this.page.total = res.data.total
        } else {
          this.oldTableData = res.data.records
          this.oldPage.total = res.data.total
        }
      }).catch(err => {
        console.log('err---', err);
        this.tableLoading = false
        this.oldTableLoading = false
      })
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm() {
      this.searchForm.year = '';
      this.searchForm.date = '';
      this.searchList()
    },
    // æ“ä½œæ–°å¢žæ¡†
    openFormDia(row) {
      this.formDialog = true
      this.$nextTick(() => {
        this.$refs.formDialog.openDia(row)
      })
    },
    // å…³é—­æ–°å¢žå¼¹æ¡†
    closeDia() {
      this.formDialog = false
      this.searchList()
    },
    // æ‰“开修改弹框
    openEditFormDia(row) {
      this.editFormDialog = true
      this.$nextTick(() => {
        this.$refs.editFormDialog.openDia(row)
      })
    },
    //
    closeEditDia() {
      this.editFormDialog = false
      this.searchList()
    },
    delete(row) {
      this.$confirm('此操作将删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteById({ methodSearchNewId: row.methodSearchNewId }).then(res => {
          if (res.code == 200) {
            this.$message.success('删除成功')
            this.searchList()
          }
        })
      }).catch(() => {
      });
    },
    // æ‰“开导出弹框选择编制人、批准人
    openHandleOut() {
      this.ratifyDialog = true
      this.getUserList()
    },
    // å¯¼å‡º
    handleOut() {
      let beginDate = ''
      let endDate = ''
      const currentYear = new Date().getFullYear()
      if (this.searchForm.year && this.searchForm.date) {
        if (this.searchForm.date === '1') {
          beginDate = this.searchForm.year + '-' + '01-01' + ' ' + '00:00:00'
          endDate = this.searchForm.year + '-' + '06-30' + ' ' + '23:59:59'
        } else {
          beginDate = this.searchForm.year + '-' + '07-01' + ' ' + '00:00:00'
          endDate = this.searchForm.year + '-' + '12-31' + ' ' + '23:59:59'
        }
      } else if (!this.searchForm.year && this.searchForm.date) {
        if (this.searchForm.date === '1') {
          beginDate = currentYear + '-' + '01-01' + ' ' + '00:00:00'
          endDate = currentYear + '-' + '06-30' + ' ' + '23:59:59'
        } else {
          beginDate = currentYear + '-' + '07-01' + ' ' + '00:00:00'
          endDate = currentYear + '-' + '12-31' + ' ' + '23:59:59'
        }
      } else if (this.searchForm.year && !this.searchForm.date) {
        beginDate = this.searchForm.year + '-' + '01-01' + ' ' + '00:00:00'
        endDate = this.searchForm.year + '-' + '12-31' + ' ' + '23:59:59'
      }
      const entity = {
        beginDate: beginDate,
        endDate: endDate,
        writeUserId: this.ratifyInfo.writeUserId,
        ratifyUserId: this.ratifyInfo.ratifyUserId,
        writeDate: this.ratifyInfo.writeDate,
        ratifyDate: this.ratifyInfo.ratifyDate,
      }
      this.outLoading = true
      exportMethodSearchNew(entity).then(res => {
        this.outLoading = false
        const blob = new Blob([res], { type: 'application/octet-stream' });
        this.$download.saveAs(blob, '标准查新导出.xlsx')
      })
    },
    // å¯¼å…¥
    beforeUpload(file) {
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload.clearFiles()
        return false;
      } else {
        this.upLoading = true;
        return true;
      }
    },
    onError(err, file, fileList) {
      this.$message.error('上传失败')
      this.$refs.upload.clearFiles()
    },
    handleSuccessUp(response) {
      this.upLoading = false;
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.searchList()
      }
    },
    // åˆ†é¡µ
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.searchList();
    },
    // åˆ†é¡µ
    oldPagination({ page, limit }) {
      this.oldPage.current = page;
      this.oldPage.size = limit;
      this.searchList();
    },
    //
    getUserList() {
      selectUserCondition().then(res => {
        if (res.code === 201) {
          return
        }
        this.userList = res.data
      })
    },
  },
  // ç”¨äºŽä¸Šä¼ æ–‡ä»¶çš„信息
  computed: {
    action() {
      return this.javaApi + '/processMethodSearchNew/importMethodSearchNew'
    }
  },
};
</script>
<style scoped>
.view-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding-left: 20px;
}
.search-background {
  width: 100%;
  height: 80px;
  line-height: 80px;
  background-color: #ffffff;
  display: flex;
}
.search-group {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
.table {
  margin-top: 20px;
  background-color: #ffffff;
  padding-top: 10px;
}
.table-tab {
  margin: 0 10px 10px 14px;
}
.inline-upload {
  display: inline-block;
  vertical-align: middle;
}
</style>
src/views/CNAS/process/sampleDisposal/sampleDisposal.vue
@@ -519,7 +519,8 @@
          delProcessDeal({ id: row.id }).then((res) => {
            if (res.code == 201) return;
            this.$message.success("删除成功");
            this.refresh();
            this.page.current = 0;
            this.getList();
          });
        })
        .catch(() => { });