spring
2025-02-25 0d85df4a7ef4d4692d58325b6c6785fe28a5a732
Merge branch 'dev' of http://114.132.189.42:9002/r/lims-ruoyi-before into dev
已修改11个文件
已添加29个文件
19076 ■■■■■ 文件已修改
pnpm-lock.yaml 12829 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/business/finishedProductSampling.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/business/insReport.js 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/business/sample.js 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/business/unpass.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/business/unqualifiedHandler.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/externalService/supplierManage/supplierManage.js 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/demand/demand.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/resourceDemand/standardMaterailRequistion/standardMaterailRequistion.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/resourceDemand/standardMaterial/standardMaterial.js 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/styles/element-ui.scss 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Table/lims-table.vue 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Table/value-table.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/externalService/supplierManage/component/formDia.vue 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/externalService/supplierManage/index.vue 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/AddContracts.vue 418 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/Edit.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/index.vue 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterailRequistion/index.vue 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterial/component/borrowDia.vue 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterial/component/formDia.vue 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterial/component/returnDia.vue 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterial/index.vue 290 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/finishedProductSampling/components/addQuarterItem.vue 296 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/finishedProductSampling/index.vue 448 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionReview/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionTask/index.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/materialOrder/customsInspection.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/reportPreparation/index.vue 953 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/sample/components/detail.vue 197 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/sample/index.vue 704 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/unpass/components/OAProcess.vue 250 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/unpass/index-manage.vue 324 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/unpass/index.vue 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/structural/premises/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pnpm-lock.yaml
¶Ô±ÈÐÂÎļþ
ÎļþÌ«´ó
src/api/business/finishedProductSampling.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
// æˆå“æŠ½æ ·è¯¦æƒ…页面相关接口
import request from '@/utils/request'
// åŽŸææ–™æ ¹æ®id报检
export function getIfsStock(query) {
  return request({
    url: '/finishProductSpotCheck/getIfsStock',
    method: 'post',
    data: query
  })
}
// å­£åº¦æŠ½æ£€æŸ¥çœ‹è¯¦æƒ…
export function getQuarter(query) {
  return request({
    url: '/finishProductSpotCheck/getQuarter',
    method: 'get',
    params: query
  })
}
// æäº¤å­£åº¦æŠ½æ ·
export function addQuarter(query) {
  return request({
    url: '/finishProductSpotCheck/addQuarter',
    method: 'post',
    data: query
  })
}
// ç¼–辑季度检验
export function updateQuarterOnOrder(query) {
  return request({
    url: '/finishProductSpotCheck/updateQuarterOnOrder',
    method: 'post',
    data: query
  })
}
src/api/business/insReport.js
@@ -1,7 +1,7 @@
// æŠ¥å‘Šç¼–制页面相关接口
import request from '@/utils/request'
// æŸ¥è¯¢åŽŸææ–™ä¸‹å•-待下单
// æŠ¥å‘Šè¿˜åŽŸ
export function upReportUrl(query) {
  return request({
    url: '/insReport/upReportUrl',
@@ -9,3 +9,51 @@
    data: query
  })
}
// æŸ¥è¯¢æ£€éªŒæŠ¥å‘Šæ•°æ®
export function pageInsReport(query) {
  return request({
    url: '/insReport/pageInsReport',
    method: 'get',
    params: query
  })
}
// æŠ¥å‘Šæ‰¹é‡ä¸‹è½½
export function downAll(query) {
  return request({
    url: '/insReport/downAll',
    method: 'get',
    params: query
  })
}
// æŠ¥å‘Šé€€å›žåˆ°æ£€éªŒä»»åŠ¡
export function sendBackTask(query) {
  return request({
    url: '/insReport/sendBackTask',
    method: 'post',
    data: query
  })
}
// æŠ¥å‘Šå®¡æ ¸
export function examineReport(query) {
  return request({
    url: '/insReport/examineReport',
    method: 'post',
    data: query
  })
}
// æŠ¥å‘Šæäº¤
export function writeReport(query) {
  return request({
    url: '/insReport/writeReport',
    method: 'post',
    data: query
  })
}
// æŠ¥å‘Šæ‰¹å‡†
export function ratifyReport(query) {
  return request({
    url: '/insReport/ratifyReport',
    method: 'post',
    data: query
  })
}
src/api/business/sample.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,90 @@
// æ ·å“ç®¡ç†é¡µé¢ç›¸å…³æŽ¥å£
import request from '@/utils/request'
// æŸ¥è¯¢ä»“库
export function selectWarehouse() {
  return request({
    url: '/warehouse/selectWarehouse',
    method: 'get'
  })
}
// æ ·å“å…¥åº“
export function inWarehouse(query) {
  return request({
    url: '/warehouse/inWarehouse',
    method: 'post',
    data: query
  })
}
// æ ·å“å‡ºåº“
export function outWarehouse(query) {
  return request({
    url: '/warehouse/outWarehouse',
    method: 'post',
    data: query
  })
}
// ä¿®æ”¹ä»“库
export function upWarehouse(query) {
  return request({
    url: '/warehouse/upWarehouse',
    method: 'post',
    data: query
  })
}
// æ·»åŠ ä»“åº“
export function addWarehouse(query) {
  return request({
    url: '/warehouse/addWarehouse',
    method: 'post',
    data: query
  })
}
// ä¿®æ”¹è´§æž¶
export function upShelf(query) {
  return request({
    url: '/warehouse/upShelf',
    method: 'post',
    data: query
  })
}
// æ·»åŠ è´§æž¶
export function addShelf(query) {
  return request({
    url: '/warehouse/addShelf',
    method: 'post',
    data: query
  })
}
// åˆ é™¤ä»“库
export function delWarehouse(query) {
  return request({
    url: '/warehouse/delWarehouse',
    method: 'delete',
    params: query
  })
}
// åˆ é™¤è´§æž¶
export function delShelf(query) {
  return request({
    url: '/warehouse/delShelf',
    method: 'delete',
    params: query
  })
}
// æŸ¥è¯¢è´§æž¶ä¸‹çš„存放信息
export function getWarehouse(query) {
  return request({
    url: '/warehouse/getWarehouse',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢è´§æž¶ä¸‹çš„存放信息
export function searchSampleId(query) {
  return request({
    url: '/warehouse/searchSampleId',
    method: 'post',
    data: query
  })
}
src/api/business/unpass.js
@@ -1,5 +1,4 @@
// ä¸åˆæ ¼ç®¡ç†ç›¸å…³æŽ¥å£
import request from "@/utils/request";
//查询进货验证信息
@@ -73,3 +72,11 @@
    data: data,
  });
}
// æŸ¥è¯¢ä¸åˆæ ¼æ ·å“æ•°æ®
export function pageInsUnPass(data) {
  return request({
    url: "/unPass/pageInsUnPass",
    method: "post",
    data: data,
  });
}
src/api/business/unqualifiedHandler.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
// ä¸åˆæ ¼å¤„理相关接口
import request from "@/utils/request";
//查询不合格处理
export function page(query) {
  return request({
    url: "/unqualifiedHandler/page",
    method: "get",
    params: query,
  });
}
//删除不合格处理
export function deleteUnqualifiedHandler(query) {
  return request({
    url: "/unqualifiedHandler/deleteUnqualifiedHandler",
    method: "delete",
    params: query,
  });
}
//删除不合格处理
export function pushOA(query) {
  return request({
    url: "/unqualifiedHandler/pushOA",
    method: "delete",
    params: query,
  });
}
src/api/cnas/externalService/supplierManage/supplierManage.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,52 @@
import request from '@/utils/request'
// åˆ†é¡µæŸ¥è¯¢
export function selectQualifiedSupplierManagementPage(query) {
  return request({
    url: '/supplierManagement/selectQualifiedSupplierManagementPage',
    method: 'get',
    params: query
  })
}
// ç¼–辑供应商
export function updateSupplierManagement(query) {
  return request({
    url: '/supplierManagement/updateSupplierManagement',
    method: 'post',
    data: query
  })
}
// æ–°å¢žä¾›åº”商
export function addSupplierManagement(query) {
  return request({
    url: '/supplierManagement/addSupplierManagement',
    method: 'post',
    data: query
  })
}
// å¯¼å‡ºä¾›åº”商
export function exportSupplierManagement(query) {
  return request({
    url: "/supplierManagement/exportSupplierManagement",
    method: "get",
    responseType: "blob",
    params: query,
  });
}
// åˆ é™¤ä¾›åº”商
export function delSupplierManagement(query) {
  return request({
    url: '/supplierManagement/delSupplierManagement',
    method: 'delete',
    params: query
  })
}
src/api/cnas/process/demand/demand.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
// å®žéªŒå®¤çš„æ£€æµ‹èƒ½åŠ›æ¡£æ¡ˆç›¸å…³æŽ¥å£
import request from "@/utils/request";
// å§”托单检验分页查询
export const getInspectionOrder = (params) => {
    return request({
        url: "/inspectionOrder/pageInspectionOrder",
        method: "get",
        params: params
    })
}
src/api/cnas/resourceDemand/standardMaterailRequistion/standardMaterailRequistion.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
import request from '@/utils/request'
// åˆ†é¡µæŸ¥è¯¢
export function getPageSubstanceRecord(query) {
  return request({
    url: '/feStandardSubstanceRecord/getPageSubstanceRecord',
    method: 'get',
    params: query
  })
}
src/api/cnas/resourceDemand/standardMaterial/standardMaterial.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
import request from '@/utils/request'
// èŽ·å–å®žéªŒå®¤åç§°
export function getPageStandardSubstance(query) {
  return request({
    url: '/feStandardSubstance/getPageStandardSubstance',
    method: 'get',
    params: query
  })
}
//标准物质清单新增编辑
export function addStandardSubstance(query) {
  return request({
    url: '/feStandardSubstance/addStandardSubstance',
    method: 'post',
    data: query
  })
}
//删除标准物质清单
export function removeStandardSubstance(query) {
  return request({
    url: '/feStandardSubstance/removeStandardSubstance',
    method: 'delete',
    params: query
  })
}
// æ–‡ä»¶å˜æ›´-导出
export function exportOfStandardSubstanceList(query) {
  return request({
    url: "/feStandardSubstance/exportOfStandardSubstanceList",
    method: "get",
    responseType: "blob",
    params: query,
  });
}
//标准物质清单借用
export function borrowSubstance(query) {
  return request({
    url: '/feStandardSubstanceRecord/borrowSubstance',
    method: 'post',
    data: query
  })
}
//标准物质清单归还
export function returnSubstance(query) {
  return request({
    url: '/feStandardSubstanceRecord/returnSubstance',
    method: 'post',
    data: query
  })
}
src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
import request from '@/utils/request'
export function getPageAcceptance(query) {
  return request({
    url: '/feStandardSubstanceAcceptance/getPageAcceptance',
    method: 'get',
    params: query
  })
}
export function updateAcceptanc(query) {
  return request({
    url: '/feStandardSubstanceAcceptance/updateAcceptanc',
    method: 'post',
    data: query
  })
}
export function addAcceptance(query) {
  return request({
    url: '/feStandardSubstanceAcceptance/addAcceptance',
    method: 'post',
    data: query
  })
}
src/assets/styles/element-ui.scss
@@ -106,10 +106,10 @@
  content: "";
  display: inline-block;
  width: 4px;
  height: 28px;
  height: 16px;
  background: #3a7bfa;
  border-radius: 10px;
  margin-left: 32px;
  margin-left: 20px;
  margin-right: 8.5px;
}
@@ -117,7 +117,7 @@
  content: "";
  display: inline-block;
  width: 4px;
  height: 28px;
  height: 16px;
  background: #3a7bfa;
  border-radius: 10px;
  margin-left: 20px;
src/components/Table/lims-table.vue
@@ -12,7 +12,7 @@
      <el-table-column v-for="(item, index) in column" :key="index" :column-key="item.columnKey"
        :filter-method="item.filterHandler" :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue"
        :filters="item.filters" :fixed="item.fixed" :label="item.label" :min-width="item.minWidth" :prop="item.prop"
        :show-overflow-tooltip="item.dataType === 'action' ? false : true" :sortable="item.sortable ? true : false"
        :show-overflow-tooltip="item.dataType === 'action' || item.dataType === 'slot' ? false : true" :sortable="item.sortable ? true : false"
        :type="item.type" :width="item.dataType === 'action' ? getWidth(item.operation) : item.width
          " align="center">
        <!-- <div class="123" v-if="item.type == ''"> -->
@@ -64,19 +64,29 @@
          <!-- æŒ‰é’® -->
          <div v-else-if="item.dataType == 'action'">
            <template v-for="(o, key) in item.operation">
              <el-button v-if="o.type != 'upload'" size="mini" v-show="o.showHide ? o.showHide(scope.row) : true"
              <el-button v-show="o.type != 'upload'" size="mini"
                         v-if="o.showHide ? o.showHide(scope.row) : true"
                :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain"
                :style="{ color: o.name === '删除' ? '#f56c6c' : o.color }" :type="o.type | typeFn(scope.row)"
                @click="o.clickFun(scope.row)" :key="key">
                {{ o.name }}
              </el-button>
              <el-upload action="#" size="mini" :on-change="(file, fileList) => o.clickFun(scope.row, file, fileList)
                " :multiple="o.multiple ? o.multiple : false" :limit="o.limit ? o.limit : 1"
              <el-upload
                :action="javaApi + o.url +'?id=' +(o.uploadIdFun ? o.uploadIdFun(scope.row): scope.row.id) "
                size="mini"
                ref="upload"
                :multiple="o.multiple ? o.multiple : false"
                :limit="1"
                :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept
                  ? o.accept
                  : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
                  " v-if="o.type == 'upload'" style="display: inline-block; width: 50px"
                v-show="o.showHide ? o.showHide(scope.row) : true" :auto-upload="false" :on-exceed="onExceed"
                  "
                v-if="o.type == 'upload'" style="display: inline-block; width: 50px"
                v-show="o.showHide ? o.showHide(scope.row) : true"
                :headers="uploadHeader"
                :on-error="onError"
                :on-exceed="onExceed"
                :on-success="handleSuccessUp"
                :show-file-list="false" :key="key">
                <el-button :size="o.size ? o.size : 'small'" type="text"
                  :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button>
@@ -297,6 +307,22 @@
    setCurrent(row) {
      this.$refs.multipleTable.setCurrentRow();
    },
    handleSuccessUp(response, label) {
      if (typeof label === "string") {
        if (response.code == 200) {
          this.upData[label] = response.data.url;
        }
      } else {
        if (response.code == 200) {
          this.$message.success("上传成功");
        }
      }
    },
    onError(err, file, fileList) {
      this.$message.error("上传失败");
      this.$refs.upload.clearFiles();
      this.uploading = false;
    },
    onExceed() {
      this.$message.warning("超出文件个数");
    },
src/components/Table/value-table.vue
@@ -243,14 +243,7 @@
                v-else
                ref="upload"
                :accept="a.uploadConfig.accept"
                :action="
                  javaApi +
                  a.uploadConfig.url +
                  '?id=' +
                  (a.uploadConfig.uploadIdFun
                    ? a.uploadConfig.uploadIdFun(scope.row)
                    : scope.row.id)
                "
                :action="javaApi + a.uploadConfig.url +'?id=' +(a.uploadConfig.uploadIdFun ? a.uploadConfig.uploadIdFun(scope.row): scope.row.id)"
                :disabled="
                  a.disabFun ? a.disabFun(scope.row, scope.$index) : false
                "
src/views/CNAS/externalService/supplierManage/component/formDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,188 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
               :title="operationType === 'edit' ? '编辑' : '新增'"
               :visible.sync="formDia"
               width="90%" @close="closeDia">
      <el-form :model="model" ref="modelForm" label-width="150px" :rules="rules">
        <el-row>
          <el-col :span="12">
            <el-form-item label="供应商" prop="supplierName">
              <el-input v-model="model.supplierName" placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="编号" prop="supplierRef">
              <el-input v-model="model.supplierRef" placeholder="请输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="供应商物品服务名称" prop="supplierItemServiceName">
              <el-input v-model="model.supplierItemServiceName" placeholder="请输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="邮编">
              <el-input v-model="model.postalCode" placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="地址">
              <el-input v-model="model.adress" placeholder="请输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="联系人">
              <el-input v-model="model.contacts" placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="联系电话">
              <el-input v-model="model.phone" placeholder="请输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="户名">
              <el-input v-model="model.householdName" placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="传真">
              <el-input v-model="model.fax" placeholder="请输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="开户行">
              <el-input v-model="model.openingName" placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="网址">
              <el-input v-model="model.website" placeholder="请输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="账号">
              <el-input v-model="model.accountName" placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="Email">
              <el-input v-model="model.email" placeholder="请输入" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer">
            <el-button @click="closeDia">取 æ¶ˆ</el-button>
            <el-button type="primary" @click="submit" :loading="editLoad">保 å­˜</el-button>
        </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  addSupplierManagement,
  updateSupplierManagement
} from '@/api/cnas/externalService/supplierManage/supplierManage'
export default {
  name: "formDia",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      operationType: '',
      formDia: false,
      model: {
        supplierName: '',
        supplierRef: '',
        supplierItemServiceName: '',
        postalCode: '',
        adress: '',
        contacts: '',
        phone: '',
        householdName: '',
        fax: '',
        openingName: '',
        website: '',
        accountName: '',
        email: '',
        supplierManagementId: '',
      },
      rules: {
        supplierName: [{ required: true, message: '请输入供应商', trigger: 'blur' }],
        supplierRef: [{ required: true, message: '请输入供应商编号', trigger: 'blur' }],
      },
      editLoad: false,
    }
  },
  mounted() {
  },
  // æ–¹æ³•集合
  methods: {
    openDialog (type, row) {
      this.operationType = type
      this.formDia = true
      if (this.operationType === 'edit') {
        this.model = this.HaveJson(row)
      }
    },
    // æäº¤è¡¨å•
    submit () {
      this.$refs.modelForm.validate((valid) => {
        if (valid) {
          this.editLoad = true
          if (this.operationType === 'edit') {
            updateSupplierManagement(this.model).then(res => {
              this.editLoad = false
              if (res.code === 200){
                this.$message.success('修改成功')
                this.closeDia()
              }
            }).catch(err => {
              console.log('err---', err);
              this.editLoad = false
            })
          } else {
            addSupplierManagement(this.model).then(res => {
              this.editLoad = false
              if (res.code === 200){
                this.$message.success('新增成功')
                this.closeDia()
              }
            }).catch(err => {
              console.log('err---', err);
              this.editLoad = false
            })
          }
        }
      })
    },
    closeDia () {
      this.$refs.modelForm.resetFields()
      this.formDia = false
      this.$emit('closeDia')
    }
  },
}
</script>
<style scoped>
</style>
src/views/CNAS/externalService/supplierManage/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,189 @@
<template>
  <div class="capacity-scope">
    <div class="search">
      <div>
        <el-form :model="searchForm" ref="searchForm" size="small" :inline="true">
          <el-form-item label="名称" prop="supplierName">
            <el-input v-model="searchForm.supplierName" clearable size="small"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="getTableData">查 è¯¢</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetSearchForm">重 ç½®</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-button size="medium" @click="exportExcel">导 å‡º</el-button>
        <el-button size="medium" type="primary" @click="showDialog('add')">新 å¢ž</el-button>
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <form-dia ref="formDia" v-if="formDia" @closeDia="closeDia"></form-dia>
  </div>
</template>
<script>
// import ZTTable from "../caorui/ZTTable/index.vue";
// import TableCard from "../caorui/TableCard/index.vue";
// import axios from "axios";
import FormDia from "../supplierManage/component/formDia.vue";
import limsTable from '@/components/Table/lims-table.vue'
import {
  selectQualifiedSupplierManagementPage,
  exportSupplierManagement,
  delSupplierManagement
} from '@/api/cnas/externalService/supplierManage/supplierManage'
export default {
  name: "a6-supplier-manage-new",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {
    limsTable,
    FormDia
  },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      searchForm: {
        supplierName: ''
      },
      tableLoading: false,
      tableColumn: [
        {
          label: "供应商编号",
          prop: "supplierRef"
        },
        {
          label: "供应商",
          prop: "supplierName"
        },
        {
          label: "供应物品(服务)名称",
          prop: "supplierItemServiceName"
        },
        {
          label: "地址",
          prop: "adress"
        },
        {
          label: "联系电话",
          prop: "phone"
        },
        {
          dataType: 'action',
          fixed: "right",
          minWidth: '60',
          label: '操作',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.showDialog('edit', row);
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.deleteRow(row);
              },
            }
          ]
        }
      ],
      tableData: [],
      page: {
        total: 0,
        size: 10,
        current: 1
      },
      formDia: false,
    }
  },
  mounted() {
    this.getTableData()
  },
  // æ–¹æ³•集合
  methods: {
    // èŽ·å–è¡¨æ ¼æ•°æ®
    async getTableData() {
      this.tableLoading = true;
      selectQualifiedSupplierManagementPage(this.searchForm).then(res => {
          this.tableLoading = false;
          if(res.code === 200) {
            this.tableData = res.data.records;
            this.page.total = res.data.total
          }
      }).catch(err => {
        this.tableLoading = false
      })
    },
    // é‡ç½®
    resetSearchForm () {
      this.pagination.current = 1
      this.pagination.pageSize = 20
      this.searchForm.supplierName = ''
      this.getTableData()
    },
    // åˆ†é¡µåˆ‡æ¢
    pagination(page) {
      this.page.size = page.limit
      this.getTableData();
    },
    // æ‰“开新增弹框
    showDialog(type, row) {
      this.formDia = true
      this.$nextTick(() => {
        this.$refs.formDia.openDialog(type, row)
      })
    },
    // å…³é—­å¼¹æ¡†
    closeDia () {
      this.formDia = false
      this.getTableData()
    },
    // åˆ é™¤è®°å½•
    deleteRow (row) {
      this.$confirm('此操作将永久删除该文件, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        delSupplierManagement({supplierManagementId:row.supplierManagementId}).then(res => {
          if (res.code === 200) {
            this.$message.success('删除成功!')
            this.getTableData()
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // å¯¼å‡ºexcel
    async exportExcel() {
      exportSupplierManagement({deviceId:this.clickNodeVal.value}).then(res => {
        const blob = new Blob([res], { type: 'application/octet-stream' });
        this.$download.saveAs(blob, '合格供应商.xlsx')
        this.$message.success('导出成功')
      })
    }
  },
}
</script>
<style scoped>
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
</style>
src/views/CNAS/process/demand/AddContracts.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,418 @@
<template>
    <el-dialog title="新增检验委托单" :visible.sync="visible" width="1200px">
        <div id="dialogBody">
            <div style="max-height: 75vh;overflow-y: auto;">
                <div id="dialogBody">
                    <table border="1" cellpadding="10" class="tables heads">
                        <tr>
                            <td rowspan="2">
                                <img alt="" :src="ZTTLogo" style="width: 80%;">
                            </td>
                            <td>
                                <p>记录名称:检验委托单</p>
                            </td>
                            <td>
                                <p>保存期限:6å¹´</p>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p>记录编号: ZTT/QR-16-04-a</p>
                            </td>
                            <td>
                                <p>归档部门:综合室</p>
                            </td>
                        </tr>
                    </table>
                    <h4 class="table_h4">
                        æ£€ éªŒ å§” æ‰˜ å•
                    </h4>
                    <p
                        v-if="operationType !== 'view'"
                        style="margin-left: 560px;display: flex;align-items: center">
                        <span style="width: 100px">委托编号:</span>
                        <el-input clearable size="small"></el-input>
                    </p>
                    <p v-else  style="margin-top: 16px;margin-left: 600px;">
                        å§”托编号:{{ currentInfo.entrustCode }}
                    </p>
                    <table border="1" cellpadding="10" class="tables">
                        <tr>
                            <td colspan="2">
                                <p>试样名称</p>
                            </td>
                            <td >
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.sampleName" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.sampleName }}</span>
                            </td>
                            <td>
                                <p>委托时间</p>
                            </td>
                            <td>
                                <el-date-picker
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.commissionDate"
                                    clearable
                                    format="yyyy-MM-dd"
                                    placeholder="选择日期"
                                    size="small"
                                    style="width: 100%"
                                    type="date"
                                    value-format="yyyy-MM-dd">
                                </el-date-picker>
                                <span v-else>{{ currentInfo.commissionDate }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>型 å·</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.modelNo" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.modelNo }}</span>
                            </td>
                            <td>
                                <p>委托单位</p>
                            </td>
                            <td>
                                <el-input  v-if="operationType !== 'view'" v-model="currentInfo.commissionUnit" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.commissionUnit }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>生产单位</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.production" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.production }}</span>
                            </td>
                            <td>
                                <p>委托人</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionUser" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.commissionUser }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>样品数量</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.quantity" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.quantity }}</span>
                            </td>
                            <td>
                                <p>样品状态</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.sampleStatus" clearable size="small"></el-input>
                                <span v-else>{{ insStateList.find(m=>m.value==currentInfo.sampleStatus)?insStateList.find(m=>m.value==currentInfo.sampleStatus).label:'/' }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>是否留样</p>
                            </td>
                            <td>
                                <el-radio-group
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.isLeave"
                                    v-removeAriaHidden
                                >
                                    <el-radio :label="1">是</el-radio>
                                    <el-radio :label="0">否</el-radio>
                                </el-radio-group>
                                <div v-else>
                                    <span v-if="currentInfo.isLeave==1">是</span>
                                    <span v-else>否</span>
                                </div>
                            </td>
                            <td>
                                <p>样品处理方式</p>
                            </td>
                            <td v-if="operationType !== 'view'">
                                <el-radio-group v-model="currentInfo.processing" v-removeAriaHidden>
                                    <el-radio :label="0">委托单位取回</el-radio>
                                    <el-radio :label="1">实验室处理</el-radio>
                                </el-radio-group>
                            </td>
                            <td v-else>
                                <span v-if="currentInfo.processing==0">委托单位取回</span>
                                <span v-else>实验室处理</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>约定完成时间(报告日期)</p>
                            </td>
                            <td>
                                <el-date-picker
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.appointed"
                                    clearable
                                    format="yyyy-MM-dd"
                                    placeholder="选择日期"
                                    size="small"
                                    style="width: 100%"
                                    type="date"
                                    value-format="yyyy-MM-dd">
                                </el-date-picker>
                                <span v-else>
                                    {{ currentInfo.appointed }}
                                </span>
                            </td>
                            <td>
                                <p>报告发送方式</p>
                            </td>
                            <td >
                                <el-radio-group
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.send" v-removeAriaHidden
                                >
                                    <el-radio :label="1">自取</el-radio>
                                    <el-radio :label="0">其他</el-radio>
                                </el-radio-group>
                                <div v-else>
                                    <span v-if="currentInfo.send==1">自取</span>
                                    <span v-else>其他</span>
                                </div>
                            </td>
                        </tr>
                        <el-button class="add_btn" size="small" type="primary" @click="addOrderDetailList">添加</el-button>
                        <tr>
                            <td>
                                <p>序号</p>
                            </td>
                            <td>
                                <p>样品编号</p>
                            </td>
                            <td>
                                <p>试验项目</p>
                            </td>
                            <td>
                                <p>检验依据</p>
                            </td>
                            <td>
                                <p>备注</p>
                            </td>
                        </tr>
                        <tr v-for="(item,index) in currentInfo.orderDetailList" :key="index" >
                            <td>{{ index+1 }}</td>
                            <td>
                                <el-input  v-if="operationType !== 'view'" v-model="item.sampleNumber" clearable size="small"></el-input>
                                <span v-else>{{ item.sampleNumber }}</span>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'"v-model="item.testItem" clearable size="small"></el-input>
                                <span v-else>{{ item.testItem }}</span>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="item.testStandard" clearable size="small"></el-input>
                                <span v-else>{{ item.testStandard }}</span>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="item.remark" clearable size="small"></el-input>
                                <span v-else>{{ item.remark }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>判定规则</p>
                            </td>
                            <td v-if="operationType !== 'view'" colspan="3">
                                <el-radio-group v-model="currentInfo.criterionRule" v-removeAriaHidden>
                                    <el-radio :label="0">不考虑不确定度</el-radio>
                                    <el-radio :label="1">考虑不确定度</el-radio>
                                </el-radio-group>
                                <span v-if="currentInfo.criterionRule === 1">
                                    <el-input v-model="currentInfo.criterionRuleRemark" clearable size="small" style="width: 60px"></el-input>
                                    %
                                </span>
                            </td>
                            <td v-else colspan="3">
                                <span v-if="currentInfo.criterionRule===0">不考虑不确定度</span>
                                <span v-if="currentInfo.criterionRule===1">考虑不确定度</span>
                                <span v-if="currentInfo.criterionRule===1">{{ currentInfo.criterionRuleRemark + '%' }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>委托人签名</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionUser" clearable size="small"></el-input>
                                <span v-else>{{currentInfo.commissionUser}}</span>
                            </td>
                            <td>
                                <p>委托日期</p>
                            </td>
                            <td>
                                <el-date-picker
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.commissionDate"
                                    clearable
                                    format="yyyy-MM-dd"
                                    placeholder="选择日期"
                                    size="small"
                                    style="width: 100%"
                                    type="date"
                                    value-format="yyyy-MM-dd">
                                </el-date-picker>
                                <span v-else>{{ currentInfo.commissionDate }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>委托人联系电话</p>
                            </td>
                            <td colspan="3">
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionPhone" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.commissionPhone }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>综合室签名</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.generalOfficeUser" clearable size="small"></el-input>
                                <span v-else>{{currentInfo.generalOfficeUser}}</span>
                            </td>
                            <td>
                                <p>接收日期</p>
                            </td>
                            <td>
                                <el-date-picker
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.receiptData"
                                    clearable
                                    format="yyyy-MM-dd"
                                    placeholder="选择日期"
                                    size="small"
                                    style="width: 100%"
                                    type="date"
                                    value-format="yyyy-MM-dd">
                                </el-date-picker>
                                <span v-else>{{ currentInfo.receiptData }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>领样员签名</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.sampleTakerUser" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.sampleTakerUser }}</span>
                            </td>
                            <td>
                                <p>领样日期</p>
                            </td>
                            <td v-if="operationType !== 'view'">
                                <el-date-picker
                                v-model="currentInfo.sampleData"
                                clearable
                                format="yyyy-MM-dd"
                                placeholder="选择日期"
                                size="small"
                                style="width: 100%"
                                type="date"
                                value-format="yyyy-MM-dd">
                                </el-date-picker>
                            </td>
                            <td v-else>{{ currentInfo.sampleData }}</td>
                        </tr>
                        <tr>
                            <td colspan="2" rowspan="3">
                                <p>检测机构信息</p>
                            </td>
                            <td colspan="3">
                                <p>江苏中天科技股份有限公司检测中心</p>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <p>地址:江苏省南通市经济技术开发区新开南路 19 å·</p>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <p>电话:0513-89059043</p>
                            </td>
                        </tr>
                    </table>
                    <p style="margin-top: 10px;margin-left: 20px;">注:本检验委托单一式二份,一份综合室归档,一份委托单位留存。</p>
                </div>
            </div>
        </div>
        <span v-if="operationType !== 'view'" slot="footer" class="dialog-footer">
            <el-button @click="detailDialogVisible = false">取 æ¶ˆ</el-button>
            <el-button v-if="operationType === 'add'" :loading="buttonLoading" type="primary" @click="handleAdd">
                ç¡® å®š
            </el-button>
            <el-button v-if="operationType === 'edit'" :loading="buttonLoading" type="primary" @click="handleEdit">
                ç¡® å®š
            </el-button>
        </span>
    </el-dialog>
</template>
<script>
import ZTTLogo from "@/assets/logo/ZTTlogo.png"
export default {
    name: 'AddContracts',
    data() {
        return {
            ZTTLogo,
            visible: false,
            operationType: '',
            currentInfo:{
                orderDetailList: []
            },
        }
    },
    methods: {
        open() {
            this.visible = true
        }
    }
}
</script>
<style lang="scss" scoped>
.tables {
  table-layout: fixed;
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse; /* å…³é”®å±žæ€§ï¼šåˆå¹¶è¾¹æ¡† */
  td {
    height: 40px;
    width: 100px;
    text-align: center;
    font-size: 14px;
    word-wrap: break-word;
    white-space: normal;
    p {
        margin: unset
    }
  }
}
.heads {
    td {
        border: 1px dashed black; /* å•元格的虚线 */
        padding: 8px;
        text-align: left;
    }
}
.table_h4 {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    margin: 10px 0 10px 0;
}
.add_btn {
    margin: 10px 0 10px 10px;
}
</style>
src/views/CNAS/process/demand/Edit.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
<template>
    <div>
        <el-dialog title="新增检验任务单" :visible.sync="visible">
            <el-form :model="search" :inline="true">
                <el-form-item label="委托编号:">
                    <el-input placeholder="请输入委托编号"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary">查 è¯¢</el-button>
                    <el-button>重 ç½®</el-button>
                </el-form-item>
            </el-form>
            <lims-table
                :column="column"
                :tableData="tableData"
                :page="page"
            />
        </el-dialog>
        <AddContracts ref="addContractsRef" />
    </div>
</template>
<script>
    import limsTable from "@/components/Table/lims-table.vue";
    import AddContracts from "./AddContracts.vue";
    export default {
        name: 'EditDemand',
        components: {
            limsTable,
            AddContracts
        },
        data() {
            return {
                visible: false,
                search: {},
                column: [
                    { label: '序号', minWidth: '100px' },
                    { label: '委托编号', minWidth: '100px' },
                    { label: '样品名称', minWidth: '100px' },
                    {
                        dataType: "action",
                        fixed: "right",
                        label: "操作",
                        operation: [
                            {
                                name: "新增委托单",
                                type: "text",
                                clickFun: (row) => {
                                    this.$refs.addContractsRef.open()
                                }
                            }
                        ],
                    },
                ],
                tableData: [{}],
                page: {
                    total: 0,
                    size: 10,
                    current: 1,
                },
            }
        },
        methods: {
            open() {
                this.visible = true
            }
        }
    }
</script>
src/views/CNAS/process/demand/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,160 @@
<style lang="scss" scoped>
.standard_method {
    padding: 20px;
}
.search {
  background-color: #fff;
  height: 80px;
  display: flex;
  align-items: center;
}
.search_thing {
//   width: 350px;
  display: flex;
  align-items: center;
}
.search_label {
  width: 110px;
  font-size: 14px;
  text-align: right;
}
.search_input {
  width: calc(100% - 110px);
}
.table {
  margin-top: 10px;
  background-color: #fff;
  width: calc(100% - 40px);
  height: calc(100% - 60px - 80px - 10px - 40px);
  padding: 20px;
}
</style>
<template>
    <div class="standard_method">
        <el-form :model="model" :inline="true" label-width="auto">
            <el-form-item label="试样名称:">
                <el-input size="small"
                    placeholder="请输入"
                    clearable
                    @change="refreshTable()"
                />
            </el-form-item>
            <el-form-item label="委托单位:">
                <el-input size="small"
                    placeholder="请输入"
                    clearable
                    @change="refreshTable()"
                />
            </el-form-item>
            <el-form-item label="生产单位:">
                <el-input size="small"
                    placeholder="请输入"
                    clearable
                    @change="refreshTable()"
                />
            </el-form-item>
            <el-form-item label="委托人:">
                <el-input size="small"
                    placeholder="请输入"
                    clearable
                    @change="refreshTable()"
                />
            </el-form-item>
            <el-form-item>
                <el-button size="small">
                    é‡ ç½®
                </el-button>
                <el-button size="small" type="primary">
                    æŸ¥ è¯¢
                </el-button>
            </el-form-item>
        </el-form>
        <div style="margin-bottom: 10px">
            <el-button size="small" type="primary" icon="el-icon-plus" @click="openDialog">
                æ–° å¢ž
            </el-button>
        </div>
        <lims-table
            :column="column"
            :tableData="tableData"
            :height="'calc(100vh - 250px)'"
            :page="page"
        />
        <Edit ref="editRef" />
    </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import Edit from './Edit.vue'
import { getInspectionOrder } from "@/api/cnas/process/demand/demand.js"
export default {
    name: 'Demand',
    components: {
        limsTable,
        Edit
    },
    data() {
        return {
            queryParams: {
                code: ''
            },
            model: {},
            column: [
                { label: '序号', minWidth: '100px' },
                { label: '试样名称', minWidth: '100px' },
                { label: '委托编号' },
                { label: '委托时间' },
                { label: '型号' },
                { label: '委托单位' },
                { label: '生产单位' },
                { label: '委托人' },
                { label: '样品数量' },
                { label: '样品状态' },
                { label: '是否留样' },
                { label: '样品处理方式' },
                {
                    dataType: "action",
                    fixed: "right",
                    label: "操作",
                    operation: [
                        {
                            name: "编 è¾‘",
                            type: "text"
                        }
                    ],
                },
            ],
            tableData: [], // è¡¨æ ¼æ•°æ®
            page: {
                total: 0,
                size: 10,
                current: 1,
            },
        }
    },
    mounted() {
        this.refreshTable()
    },
    methods: {
        /**
         * @desc åˆ·æ–°è¡¨æ ¼
         */
        async refreshTable() {
            await getInspectionOrder({ ...this.page })
        },
        /**
         * @desc æ‰“开模态框
         */
        openDialog() {
            this.$refs.editRef.open()
        }
    }
}
</script>
src/views/CNAS/resourceDemand/standardMaterailRequistion/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,146 @@
<template>
  <div class="capacity-scope">
    <div class="search">
      <div>
        <el-form :model="searchForm" ref="searchForm" size="small" :inline="true">
          <el-form-item label="标准物质名称" prop="name">
            <el-input size="small" placeholder="请输入" clearable v-model="searchForm.name"
                      @keyup.enter.native="searchList"></el-input>
          </el-form-item>
          <el-form-item label="规格型号" prop="factoryManufacturer">
            <el-input size="small" placeholder="请输入" clearable v-model="searchForm.model"
                      @keyup.enter.native="searchList"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button size="medium"  @click="resetSearchForm">重 ç½®</el-button>
            <el-button size="medium" type="primary" @click="searchList">查 è¯¢</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
  </div>
</template>
<script>
import limsTable from '@/components/Table/lims-table.vue'
import {
  getPageSubstanceRecord
} from '@/api/cnas/resourceDemand/standardMaterailRequistion/standardMaterailRequistion'
export default {
  components: {
    limsTable
    // TableCard,
    // ZTTable,
  },
  data() {
    return {
      searchForm: {
        name: '',
        factoryManufacturer: '',
      },
      tableColumn: [
        {
          label: '标准物质名称',
          prop: 'name',
          minWidth: '120'
        },
        {
          label: '规格型号',
          prop: 'model',
          minWidth: '100'
        },
        {
          label: '出厂编号',
          prop: 'factoryNum',
          minWidth: '100'
        },
        {
          label: '数量',
          prop: 'factoryNum',
          minWidth: '100'
        },
        {
          label: '领用人',
          prop: 'borrowUser',
          minWidth: '100'
        },
        {
          label: '领用日期',
          prop: 'borrowDate',
          minWidth: '100'
        },
        {
          label: '归还人',
          prop: 'returnIntegrity',
          minWidth: '100'
        },
        {
          label: '归还日期',
          prop: 'returnDate',
          minWidth: '100'
        },
        {
          label: '归还时状态',
          prop: 'returnIntegrity',
          minWidth: '100'
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        total: 0,
        size: 10,
        current: 1
      },
      total: 0,
      formDia: false,
      borrowDia: false,
      returnDia: false,
    }
  },
  mounted() {
    this.searchList()
  },
  methods :{
    // æŸ¥è¯¢åˆ—表
    searchList () {
      this.tableLoading = true
      getPageSubstanceRecord({
        ...this.page,
        ...this.searchForm
      }).then(res => {
        this.tableLoading = false
        if (res.code === 200){
          this.tableData = res.data.records
          this.page.total = res.data.total
        }
      }).catch(err => {
        this.tableLoading = false
      })
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm () {
      this.searchForm.name = '';
      this.searchForm.model = '';
      this.searchList()
    },
    // åˆ†é¡µåˆ‡æ¢
    pagination(page) {
      this.page.size = page.limit
      this.searchList();
    },
  }
}
</script>
<style scoped>
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
</style>
src/views/CNAS/resourceDemand/standardMaterial/component/borrowDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,148 @@
<template>
  <div>
    <el-dialog v-loading="diaLoading" :close-on-click-modal="false"
               :close-on-press-escape="false"
               :visible.sync="formDia"
               title="标准物质借用"
               width="80%" @close="closeBorrowDia">
      <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="标准物质名称">
              <el-input v-model="form.name" disabled size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="型号">
              <el-input v-model="form.model" disabled size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="完好性" prop="integrity">
              <el-input v-model="form.integrity" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="借用人" prop="borrowUser">
              <el-input v-model="form.borrowUser" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="联系方式" prop="phone">
              <el-input v-model="form.phone" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="借出日期" prop="borrowDate">
              <el-date-picker
                v-model="form.borrowDate"
                clearable
                format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"
                size="small" style="width: 100%"
                type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="约定归还日期" prop="borrowReturnDate">
              <el-date-picker
                v-model="form.borrowReturnDate"
                clearable
                format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"
                size="small" style="width: 100%"
                type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="借出人" prop="lender">
              <el-input v-model="form.lender" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeBorrowDia">取 æ¶ˆ</el-button>
        <el-button :loading="loading" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  borrowSubstance
} from "@/api/cnas/resourceDemand/standardMaterial/standardMaterial";
export default {
  name: 'borrowDia',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      diaLoading: false,
      loading: false,
      form: {
        name: '',
        model: '',
        integrity: '',
        borrowUser: '',
        phone: '',
        borrowDate: '',
        borrowReturnDate: '',
        lender: '',
        substanceId: ''
      },
      rules: {
        integrity: [{required: true, message: '请填写完好性',trigger: 'blur'}],
        borrowUser: [{required: true, message: '请填写借用人',trigger: 'blur'}],
        phone: [{required: true, message: '请填写联系方式',trigger: 'blur'}],
        borrowDate: [{required: true, message: '请选择借出日期',trigger: 'change'}],
        borrowReturnDate: [{required: true, message: '请选择约定归还日期',trigger: 'change'}],
        lender: [{required: true, message: '请选择lender',trigger: 'blur'}],
      },
    };
  },
  mounted() {
  },
  // æ–¹æ³•集合
  methods: {
    // æ‰“开弹框
    openDia (row) {
      this.formDia = true
      this.form.name = row.name
      this.form.model = row.model
      this.form.substanceId = row.id
    },
    // æäº¤å¼¹æ¡†æ•°æ®
    handleEdit () {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          this.loading = true
          this.form.status = '0';
          borrowSubstance(this.form).then(res =>{
            this.loading = false
            if (res.code === 200) {
              this.$message.success('操作成功')
              this.closeBorrowDia()
            }
          })
        } else {
          return false;
        }
      });
    },
    closeBorrowDia () {
      this.$refs.form.resetFields();
      this.formDia = false
      this.$emit('closeBorrowDia')
    },
  }
};
</script>
<style scoped>
</style>
src/views/CNAS/resourceDemand/standardMaterial/component/formDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,182 @@
<template>
  <div>
    <el-dialog v-loading="diaLoading" :close-on-click-modal="false"
               :close-on-press-escape="false"
               :visible.sync="formDia"
               title="标准物质"
               width="80%" @close="closeYearDia">
      <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="标准物质名称" prop="name">
              <el-input v-model="form.name" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="规格型号" prop="model">
              <el-input v-model="form.model" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="生产厂家" prop="factoryManufacturer">
              <el-input v-model="form.factoryManufacturer" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出厂编号" prop="factoryNum">
              <el-input v-model="form.factoryNum" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="管理编号" prop="manageNum">
              <el-input v-model="form.manageNum" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="不确定度" prop="uncertainty">
              <el-input v-model="form.uncertainty" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="数量" prop="quantity">
              <el-input v-model="form.quantity" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="购置日期" prop="acquisitionDate">
              <el-date-picker
                v-model="form.acquisitionDate"
                clearable
                format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"
                size="small" style="width: 100%"
                type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="有效期" prop="effectiveDate">
              <el-date-picker
                v-model="form.effectiveDate"
                clearable
                format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"
                size="small" style="width: 100%"
                type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="档案编号" prop="fileNum">
              <el-input v-model="form.fileNum" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="存放位置" prop="position">
              <el-input v-model="form.position" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeYearDia">取 æ¶ˆ</el-button>
        <el-button :loading="loading" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  addStandardSubstance
} from "@/api/cnas/resourceDemand/standardMaterial/standardMaterial";
export default {
  name: 'formDia',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      diaLoading: false,
      loading: false,
      form: {
        name: '',
        model: '',
        factoryManufacturer: '',
        factoryNum: '',
        manageNum: '',
        uncertainty: '',
        quantity: '',
        acquisitionDate: '',
        effectiveDate: '',
        fileNum: '',
        position: '',
        remark: '',
        id: '',
      },
      rules: {
        name: [{required: true, message: '请填写标准物质名称',trigger: 'blur'}],
        model: [{required: true, message: '请填写规格型号',trigger: 'blur'}],
        factoryManufacturer: [{required: true, message: '请填写生产厂家',trigger: 'blur'}],
        factoryNum: [{required: true, message: '请填写出厂编号',trigger: 'blur'}],
        manageNum: [{required: true, message: '请填写管理编号',trigger: 'blur'}],
        uncertainty: [{required: true, message: '请填写不确定度',trigger: 'blur'}],
        quantity: [{required: true, message: '请填写数量',trigger: 'blur'}],
        acquisitionDate: [{required: true, message: '请选择购置日期',trigger: 'change'}],
        effectiveDate: [{required: true, message: '请选择有效期',trigger: 'change'}],
        fileNum: [{required: true, message: '请填写档案编号',trigger: 'blur'}],
        position: [{required: true, message: '请填写存放位置',trigger: 'blur'}],
      },
      operationType: '',
    };
  },
  mounted() {
  },
  // æ–¹æ³•集合
  methods: {
    // æ‰“开弹框
    openDia (type, row) {
      this.formDia = true
      this.operationType = type
      if (type !== 'add') {
        this.form = row
      }
    },
    // æäº¤å¼¹æ¡†æ•°æ®
    handleEdit () {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          this.loading = true
          addStandardSubstance(this.form).then(res => {
            this.loading = false
            if (res.code === 201) return
            this.$message.success('操作成功')
            this.closeYearDia()
          }).catch(err => {
            console.log('err---', err);
            this.loading = false
          })
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    closeYearDia () {
      this.$refs.form.resetFields();
      this.formDia = false
      this.$emit('closeYearDia')
    },
  }
};
</script>
<style scoped>
</style>
src/views/CNAS/resourceDemand/standardMaterial/component/returnDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,125 @@
<template>
  <div>
    <el-dialog v-loading="diaLoading" :close-on-click-modal="false"
               :close-on-press-escape="false"
               :visible.sync="formDia"
               title="标准物质归还"
               width="80%" @close="closeReturnDia">
      <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="标准物质名称" prop="name">
              <el-input v-model="form.name" disabled size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="型号" prop="model">
              <el-input v-model="form.model" disabled size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="归还日期" prop="returnDate">
              <el-date-picker
                v-model="form.returnDate"
                clearable
                format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"
                size="small" style="width: 100%"
                type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="归还人" prop="returnedPerson">
              <el-input v-model="form.returnedPerson" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="完好性" prop="returnIntegrity">
              <el-input v-model="form.returnIntegrity" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检查人" prop="rummager">
              <el-input v-model="form.rummager" clearable size="small"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeReturnDia">取 æ¶ˆ</el-button>
        <el-button :loading="loading" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  returnSubstance
} from "@/api/cnas/resourceDemand/standardMaterial/standardMaterial";
export default {
  name: 'returnDia',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      diaLoading: false,
      loading: false,
      form: {
        name: '',
        model: '',
        returnedPerson: '',
        returnDate: '',
        returnIntegrity: '',
        rummager: '',
      },
      rules: {
      },
    };
  },
  mounted() {
  },
  // æ–¹æ³•集合
  methods: {
    // æ‰“开弹框
    openDia (row) {
      this.formDia = true
      this.form.name = row.name
      this.form.model = row.model
      this.form.substanceId = row.id
    },
    // æäº¤å¼¹æ¡†æ•°æ®
    handleEdit () {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          this.loading = true
          this.form.status = '1';
          returnSubstance(this.form).then(res => {
            this.loading = false
            if (res.code === 200) {
              this.$message.success('操作成功')
              this.closeReturnDia()
            }
          })
          let internalReport = this.HaveJson(this.form)
        } else {
          return false;
        }
      });
    },
    closeReturnDia () {
      this.$refs.form.resetFields();
      this.formDia = false
      this.$emit('closeReturnDia')
    },
  }
};
</script>
<style scoped>
</style>
src/views/CNAS/resourceDemand/standardMaterial/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,290 @@
<template>
  <div class="capacity-scope">
    <div class="search">
      <div>
        <el-form :model="searchForm" ref="searchForm" size="small" :inline="true">
          <el-form-item label="标准物质名称" prop="name">
            <el-input size="small" placeholder="请输入" clearable v-model="searchForm.name"
                      @keyup.enter.native="searchList"></el-input>
          </el-form-item>
          <el-form-item label="生产厂家" prop="factoryManufacturer">
            <el-input size="small" placeholder="请输入" clearable v-model="searchForm.factoryManufacturer"
                      @keyup.enter.native="searchList"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="searchList">查 è¯¢</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetSearchForm">重 ç½®</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-button size="medium" @click="exportFun">导 å‡º</el-button>
        <el-button size="medium" type="primary" @click="openFormDia('add')">新 å¢ž</el-button>
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <form-dia v-if="formDia" ref="formDia" @closeYearDia="closeYearDia"></form-dia>
    <borrow-dia v-if="borrowDia" ref="borrowDia" @closeYearDia="closeBorrowDia"></borrow-dia>
    <return-dia v-if="returnDia" ref="returnDia" @closeYearDia="closeReturnDia"></return-dia>
  </div>
</template>
<script>
// import FormDia from '../do/a6-standard-material-list/formDia.vue';
// import BorrowDia from '../do/a6-standard-material-list/borrowDia.vue';
// import ReturnDia from '../do/a6-standard-material-list/returnDia.vue';
import limsTable from '@/components/Table/lims-table.vue'
import {
  getPageStandardSubstance,
  removeStandardSubstance,
  exportOfStandardSubstanceList
} from '@/api/cnas/resourceDemand/standardMaterial/standardMaterial'
import FormDia from '../standardMaterial/component/formDia.vue';
import BorrowDia from '../standardMaterial/component/borrowDia.vue';
import ReturnDia from '../standardMaterial/component/returnDia.vue';
export default {
  components: {
    limsTable,
    FormDia,
    BorrowDia,
    ReturnDia
  },
  data() {
    return {
      searchForm: {
        name: '',
        factoryManufacturer: '',
      },
      tableColumn: [
        {
          label: '标准物质名称',
          prop: 'name',
          minWidth: '120'
        },
        {
          label: '规格型号',
          prop: 'model',
          minWidth: '100'
        },
        {
          label: '生产厂家',
          prop: 'factoryManufacturer',
          minWidth: '100'
        },
        {
          label: '出厂编号',
          prop: 'factoryNum',
          minWidth: '100'
        },
        {
          label: '管理编号',
          prop: 'manageNum',
          minWidth: '100'
        },
        {
          label: '不确定度',
          prop: 'uncertainty',
          minWidth: '100'
        },
        {
          label: '数量',
          prop: 'quantity',
          minWidth: '100'
        },
        {
          label: '购置日期',
          prop: 'acquisitionDate',
          minWidth: '150'
        },
        {
          label: '有效期',
          prop: 'effectiveDate',
          minWidth: '150'
        },
        {
          label: '档案编号',
          prop: 'fileNum',
          minWidth: '100'
        },
        {
          label: '存放位置',
          prop: 'position',
          minWidth: '100'
        },
        {
          label: '备注',
          prop: 'remark',
          minWidth: '100'
        },
        // {
        //   label: '创建人',
        //   prop: 'createUser',
        //   minWidth: '100'
        // },
        {
          label: '创建时间',
          prop: 'createTime',
          minWidth: '150'
        },
        {
          dataType: 'action',
          fixed: 'right',
          minWidth: '180',
          label: '操作',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openFormDia('edit', row);
              },
            },
            {
              name: '借用',
              type: 'text',
              clickFun: (row) => {
                this.borrow(row);
              },
            },
            {
              name: '归还',
              type: 'text',
              clickFun: (row) => {
                this.return(row);
              }
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.delPlan(row)
              },
            }
          ]
        }
      ],
      tableData: [],
      tableLoading: false,
      page: {
        total: 0,
        size: 10,
        current: 1
      },
      total: 0,
      formDia: false,
      borrowDia: false,
      returnDia: false,
    }
  },
  mounted() {
    this.searchList()
  },
  methods :{
    exportFun() {
      this.outLoading = true
      exportOfStandardSubstanceList(this.searchForm).then(res =>{
        this.outLoading = false
        const blob = new Blob([res], {type: 'application/octet-stream'},false);
        this.$download.saveAs(blob, '标准物质清单.xlsx')
        this.$message.success('导出成功')
      })
    },
    // æŸ¥è¯¢åˆ—表
    searchList () {
      this.tableLoading = true
      getPageStandardSubstance({
        ...this.page,
        ...this.searchForm
      }).then(res => {
        this.tableLoading = false
        if (res.code === 200){
          this.tableData = res.data.records
          this.page.total = res.data.total
        }
      })
    },
    // åˆ é™¤
    delPlan (row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.tableLoading = true
        removeStandardSubstance({id:row.id}).then(res => {
          this.tableLoading = false
          if (res.code === 200) {
            this.$message.success('删除成功')
            this.searchList()
          }
        }).catch(err => {
          this.tableLoading = false
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // æ–°å¢žï¼Œç¼–辑,批准弹框
    openFormDia (type, row) {
      this.formDia = true
      this.$nextTick(() => {
        this.$refs.formDia.openDia(type, row)
      })
    },
    closeYearDia () {
      this.formDia = false
      this.searchList()
    },
    // å€Ÿç”¨
    borrow (row) {
      this.borrowDia = true
      this.$nextTick(() => {
        this.$refs.borrowDia.openDia(row)
      })
    },
    closeBorrowDia () {
      this.borrowDia = false
      this.searchList()
    },
    // å½’还
    return (row) {
      this.returnDia = true
      this.$nextTick(() => {
        this.$refs.returnDia.openDia(row)
      })
    },
    closeReturnDia () {
      this.returnDia = false
      this.searchList()
    },
    // é‡ç½®æŸ¥è¯¢æ¡ä»¶
    resetSearchForm () {
      this.searchForm.name = '';
      this.searchForm.factoryManufacturer = '';
      this.searchList()
    },
    // åˆ†é¡µåˆ‡æ¢
    pagination(page) {
      this.page.size = page.limit
      this.searchList();
    },
    // åˆ†é¡µ
  }
}
</script>
<style scoped>
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
</style>
src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,103 @@
<template>
    <el-dialog :visible.sync="dialogVisible" title="标准物质验收记录" width="70%">
        <!-- <el-steps :active="currentStep" finish-status="success">
            <el-step class="cursor-pointer" v-for="(item, index) in steps" :key="index" :title="item">
            </el-step>
        </el-steps> -->
<!--        <el-form :model="model" label-width="140px" size="small">-->
<!--            <Step1 :model.sync="model"></Step1>-->
<!--        </el-form>-->
        <span slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
            <el-button type="primary" @click="submit">保 å­˜</el-button>
        </span>
    </el-dialog>
</template>
<script>
// import Step1 from './Step/Step1.vue'
export default {
    components: {
        // Step1
    },
    data() {
        return {
            dialogVisible: false,
            currentStep: 0, // æ­¥éª¤æ¡æ˜¾ç¤ºç¬¬å‡ æ­¥
            // steps: ['提交', '开箱验收复核', '安装验收检查', '安装验收复核', '验收核查', '验收核查审核'],
            model: {
                acceptance: {
                    id: undefined,
                    producer: undefined, // åŽ‚å®¶ä»£è¡¨
                    file: undefined,   // ç›¸å…³é™„ä»¶
                    recipient: undefined,   // æŽ¥æ”¶äºº
                    signature: undefined,   // æŽ¥å—签字
                    situation: undefined,   // éªŒæ”¶æƒ…况
                    installation: undefined,    // å®‰è£…调试情况
                    substanceId: undefined, // æ¸…单
                    arriveDate: undefined,   // åˆ°è´§æ—¥æœŸ
                    maintenanceUnit: undefined,   // ç»´ä¿®å•位
                },
                list: []
            }
        }
    },
    watch: {
        model(newVal) {
            this.model = newVal
        }
    },
    methods: {
        clearForm() {
            this.model.acceptance.id = undefined
            this.model.acceptance.producer = undefined
            this.model.acceptance.file = undefined
            this.model.acceptance.recipient = undefined
            this.model.acceptance.signature = undefined
            this.model.acceptance.situation = undefined
            this.model.acceptance.installation = undefined
            this.model.acceptance.substanceId = undefined
            this.model.acceptance.arriveDate = undefined
            this.model.acceptance.maintenanceUnit = undefined
            this.model.list = []
        },
        openDialog(form) {
            console.log(form)
            if(form) {
                this.model.acceptance.id = form.acceptance.id
                this.model.acceptance.producer = form.acceptance.producer
                this.model.acceptance.file = form.acceptance.file
                this.model.acceptance.recipient = form.acceptance.recipient
                this.model.acceptance.signature = form.acceptance.signature
                this.model.acceptance.situation = form.acceptance.situation
                this.model.acceptance.installation = form.acceptance.installation
                this.model.acceptance.substanceId = form.acceptance.substanceId
                this.model.acceptance.arriveDate = form.acceptance.arriveDate
                this.model.acceptance.maintenanceUnit = form.acceptance.maintenanceUnit
                this.model.list = form.list
            } else {
                this.clearForm()
            }
            this.dialogVisible = true
        },
        closeDialog() {
            this.dialogVisible = false
        },
        submit() {
          if (!this.model.acceptance.substanceId) {
            this.$message.warning('请选择清单')
            return
          }
            this.$emit('submit', this.model)
            this.closeDialog()
        }
    }
}
</script>
<style scoped>
.cursor-pointer {
    cursor: pointer;
}
</style>
src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,201 @@
<!--<template>-->
<!--    <el-card class="card">-->
<!--        <el-col :span="12">-->
<!--            <el-form-item label="厂家代表">-->
<!--                <el-input v-model="model.acceptance.producer"></el-input>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--            <el-form-item label="相关附件">-->
<!--                <div class="table-between">-->
<!--                    <el-input v-model="model.acceptance.file" style="width: 82%;"></el-input>-->
<!--                    <el-upload-->
<!--                        ref="upload"-->
<!--                        style="float: left; margin: 0 12px 0 20px;"-->
<!--                        :action="action"-->
<!--                        :show-file-list="false"-->
<!--                        :on-success="onSuccess"-->
<!--                    >-->
<!--                        <el-button type="primary">-->
<!--                            é™„件上传-->
<!--                        </el-button>-->
<!--                    </el-upload>-->
<!--                </div>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--            <el-form-item label="接收人">-->
<!--                <el-input v-model="model.acceptance.recipient"></el-input>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--            <el-form-item label="接受签字">-->
<!--                <el-input v-model="model.acceptance.signature"></el-input>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--            <el-form-item label="验收情况">-->
<!--                <el-input v-model="model.acceptance.situation"></el-input>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--            <el-form-item label="安装调试情况">-->
<!--                <el-input v-model="model.acceptance.installation"></el-input>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--            <el-form-item label="清单" prop="substanceId" required>-->
<!--                <el-select v-model="model.acceptance.substanceId" placeholder="请选择" style="width: 100%">-->
<!--                    <el-option-->
<!--                        v-for="item in options"-->
<!--                        :key="item.value"-->
<!--                        :label="item.name"-->
<!--                        :value="item.id">-->
<!--                    </el-option>-->
<!--                </el-select>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--            <el-form-item label="到货日期">-->
<!--                <el-date-picker-->
<!--                    v-model="model.acceptance.arriveDate"-->
<!--                    align="right"-->
<!--                    type="date"-->
<!--                    placeholder="选择日期"-->
<!--                    style="width: 100%"-->
<!--                    value-format="yyyy-MM-dd"-->
<!--                >-->
<!--                </el-date-picker>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--            <el-form-item label="维修单位">-->
<!--                <el-input v-model="model.acceptance.maintenanceUnit"></el-input>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="24">-->
<!--            <el-form-item label="备件确认">-->
<!--                <el-button type="primary" style="float: right;" @click="addSpareTable">增加行</el-button>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--        <el-col :span="24">-->
<!--            <el-form-item>-->
<!--                <ZTTable-->
<!--                    style="margin-bottom: 20px;"-->
<!--                    :column="spareColumns"-->
<!--                    :table-data="model.list"-->
<!--                >-->
<!--                    <template slot="name" slot-scope="{ row, index }">-->
<!--                        <el-input v-if="row.isEdit" size="small" v-model="row.name"></el-input>-->
<!--                        <span v-else>{{ row.name }}</span>-->
<!--                    </template>-->
<!--                    <template slot="number" slot-scope="{ row, index }">-->
<!--                        <el-input v-if="row.isEdit" size="small" v-model="row.number"></el-input>-->
<!--                        <span v-else>{{ row.number }}</span>-->
<!--                    </template>-->
<!--                    <template slot="action" slot-scope="{ row, index }">-->
<!--                        <div v-if="row.isEdit">-->
<!--                            <el-button type="text" @click="save(index)">保存</el-button>-->
<!--                            <el-button type="text">取消</el-button>-->
<!--                        </div>-->
<!--                        <div v-else>-->
<!--                            <el-button type="text" @click="edit(index)">修改</el-button>-->
<!--                        </div>-->
<!--                    </template>-->
<!--                </ZTTable>-->
<!--            </el-form-item>-->
<!--        </el-col>-->
<!--    </el-card>-->
<!--</template>-->
<!--<script>-->
<!--import ZTTable from '@/components/caorui/ZTTable/index.vue';-->
<!--import { getStandardSubstanceAll } from "@/assets/api/api";-->
<!--import axios from 'axios';-->
<!--export default {-->
<!--    components: {-->
<!--        ZTTable-->
<!--    },-->
<!--    props: {-->
<!--        model: {-->
<!--            type: Object,-->
<!--            default: () => {}-->
<!--        }-->
<!--    },-->
<!--    data() {-->
<!--        return {-->
<!--            spareColumns: [-->
<!--                {-->
<!--                    label: "名称",-->
<!--                    prop: "name",-->
<!--                    align: "center",-->
<!--                    dataType: "slot",-->
<!--                    slot: "name",-->
<!--                }, {-->
<!--                    label: "数量",-->
<!--                    prop: "number",-->
<!--                    align: "center",-->
<!--                    dataType: "slot",-->
<!--                    slot: "number",-->
<!--                }, {-->
<!--                    label: "操作",-->
<!--                    align: "center",-->
<!--                    dataType: "slot",-->
<!--                    slot: "action",-->
<!--                    width: 150-->
<!--                }-->
<!--            ],-->
<!--            options: []-->
<!--        }-->
<!--    },-->
<!--    computed: {-->
<!--        action() {-->
<!--            return `${this.javaApi}/${this.$api.personnel.saveCNASFile}`-->
<!--        }-->
<!--    },-->
<!--    mounted() {-->
<!--        this.getStand()-->
<!--    },-->
<!--    methods: {-->
<!--        async getStand() {-->
<!--            const { code, data } = await axios({-->
<!--                url: getStandardSubstanceAll,-->
<!--                method: 'get'-->
<!--            })-->
<!--            this.options = data-->
<!--        },-->
<!--        addSpareTable() {-->
<!--            this.model.list.push({-->
<!--                acceptanceId: this.model.acceptance.id,-->
<!--                name: '',-->
<!--                number: '',-->
<!--                isEdit: true-->
<!--            })-->
<!--        },-->
<!--        onSuccess(response) {-->
<!--            this.model.acceptance.file = response.data-->
<!--            this.$emit('update:model', this.model)-->
<!--        },-->
<!--        save(index) {-->
<!--            this.model.list[index].isEdit = false-->
<!--            this.$emit('update:model', this.model)-->
<!--        },-->
<!--        edit(index) {-->
<!--            this.model.list[index].isEdit = true-->
<!--        }-->
<!--    }-->
<!--}-->
<!--</script>-->
<!--<style scoped>-->
<!--.card {-->
<!--    margin-top: 1em;-->
<!--    height: 56vh;-->
<!--    overflow-y: scroll;-->
<!--}-->
<!--.table-between {-->
<!--    display: flex;-->
<!--    justify-content: space-between;-->
<!--}-->
<!--</style>-->
src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,230 @@
<template>
  <div class="capacity-scope">
    <div class="search">
      <div>
        <el-form :model="form" ref="form" size="small" :inline="true">
          <el-form-item label="物质名称">
            <el-input v-model="form.search"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button @click="reset">重 ç½®</el-button>
            <el-button type="primary" @click="getTableData">查 è¯¢</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-button icon="el-icon-plus" size="small" type="primary" @click="openDialog">添加验收</el-button>
        <el-button size="small" type="primary" @click="exportExcel">导出</el-button>
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="columns" :height="'calc(100vh - 250px)'" @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <AddRecord ref="addRecordRef" @submit="submit"></AddRecord>
  </div>
<!--    <div class="tables">-->
<!--      <ZTTable-->
<!--        :column="columns"-->
<!--        :table-data="tableData"-->
<!--      >-->
<!--        <template slot="action" slot-scope="{ row }">-->
<!--          <el-button type="text" @click="edit(row)">编辑</el-button>-->
<!--        </template>-->
<!--      </ZTTable>-->
<!--      <div class="pagination">-->
<!--        <div></div>-->
<!--        <el-pagination-->
<!--          :page-size="pagination.pageSize"-->
<!--          :page-sizes="[10, 20, 30, 40]"-->
<!--          :total="pagination.total"-->
<!--          layout="total, sizes, prev, pager, next, jumper"-->
<!--          @current-change="handleCurrent"-->
<!--          @size-change="handleSize"-->
<!--        >-->
<!--        </el-pagination>-->
<!--      </div>-->
<!--    </div>-->
<!--    <AddRecord ref="addRecordRef" @submit="submit"></AddRecord>-->
</template>
<script>
// import axios from "axios";
// import { getPageAcceptance, addAcceptance, updateAcceptance, getAcceptanceDetails, exportAcceptance } from "@/assets/api/api";
// import ZTTable from '@/components/caorui/ZTTable/index.vue';
// import AddRecord from './components/AddRecord.vue';
import limsTable from '@/components/Table/lims-table.vue'
import {
  getPageAcceptance,
  updateAcceptanc,
  addAcceptance
} from '@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept'
export default {
  components: {
    limsTable
  },
  data() {
    return {
      form: {
        search: undefined
      },
      columns: [
        {
          label: "出场编号",
          prop: "factoryNum"
        },
        {
          label: "有效期",
          prop: "effectiveDate"
        },
        {
          label: "生产厂家",
          prop: "factoryManufacturer"
        },
        {
          label: "文档编号",
          prop: "fileNum"
        },
        {
          label: "标准物质名称",
          prop: "name"
        },
        {
          label: "规格型号",
          prop: "model"
        },
        {
          label: "管理编号",
          prop: "manageNum"
        },
        {
          label: "存放位置",
          prop: "position"
        },
        // {
        //     label: "序列号",
        //     prop: "manageNum"
        // },
        {
          label: "提交日期",
          prop: "acquisitionDate"
        },
        {
          label: "数量",
          prop: "quantity"
        },
        {
          fixed: "right",
          label: "操作",
          align: "center",
          dataType: "slot",
          slot: "action",
        },
      ],
      tableData: [],
      page: {
        total: 0,
        size: 10,
        current: 1
      },
      tableLoading: false,
    }
  },
  mounted() {
    this.getTableData()
  },
  methods: {
    async getTableData() {
      const res = await  getPageAcceptance(this.form);
      if(res.code === 200){
        this.tableData = res.data.records;
        this.page.total = res.data.total;
      }
    },
    openDialog() {
      this.$refs.addRecordRef.openDialog()
    },
    async submit(form) {
      const {code} = await form.acceptance.id ? updateAcceptanc(this.form):addAcceptance((this.form));
      if(code == 200) {
        this.$message.success(`${form.acceptance.id ? '编辑':'添加'}成功`)
        this.getTableData()
      }
    },
    async edit(row) {
      const res = await this.getDetail(row.id)
      this.$refs.addRecordRef.openDialog({
        acceptance: res.acceptance,
        list: res.list
      })
    },
    async getDetail(id) {
      const { code, data } = await axios({
        method: 'get',
        url: getAcceptanceDetails,
        params: { id }
      })
      if(code == 200) {
        return data;
      }
    },
    reset() {
      this.form.search = undefined
      this.getTableData()
    },
    async exportExcel() {
      const res = await axios({
        method: "get",
        url: `${exportAcceptance}`,
        responseType: "blob"
      })
      const blob = new Blob([res], {type: 'application/octet-stream'});
      //将Blob å¯¹è±¡è½¬æ¢æˆå­—符串
      let reader = new FileReader();
      reader.readAsText(blob, 'utf-8');
      reader.onload = () => {
        try {
          let result = JSON.parse(reader.result);
          if (result.message) {
            this.$message.error(result.message);
          } else {
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = '标准物质验收.xlsx';
            link.click();
            this.$message.success('导出成功')
          }
        } catch (err) {
          console.log(err);
          const url = URL.createObjectURL(blob);
          const link = document.createElement('a');
          link.href = url;
          link.download = '标准物质验收.xlsx';
          link.click();
          this.$message.success('导出成功')
        }
      }
    },
    // åˆ†é¡µåˆ‡æ¢
    pagination(page) {
      this.page.size = page.limit
      this.getTableData()
    },
  }
}
</script>
<style scoped>
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
</style>
src/views/business/finishedProductSampling/components/addQuarterItem.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,296 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="quarterSampleDia" title="季度抽样" width="90%" @close="quarterSampleDia = false">
      <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px">
        <div style="width: 30%;display: flex;align-items: center;" >
          <span style="width: 50px">编号:</span>
          <el-input v-model="quarterSampleForm.quarterNo" :disabled="operationType !== 'add'" size="small"></el-input>
        </div>
        <div v-if="operationType === 'add'">
          <el-button size="small" type="primary" @click="addQuarter">添加</el-button>
          <el-button size="small" type="danger" @click="clearTable">清空</el-button>
        </div>
      </div>
      <div>
        <el-table v-loading="tableLoading" :data="quarterItems" border height="420" style="width: 100%">
          <el-table-column label="产品类型" prop="productType" width="200">
            <template slot-scope="{row}">
              <template>
                <el-input v-model="row.productType" size="small"/>
              </template>
            </template>
          </el-table-column>
          <el-table-column label="责任人" prop="dutyUser" width="100"></el-table-column>
          <el-table-column label="型号" prop="productModel" width="120">
            <template slot-scope="{row}">
              <template>
                <el-input v-model="row.productModel" size="small" :disabled="operationType === 'view'"/>
              </template>
            </template>
          </el-table-column>
          <el-table-column label="抽样数量" min-width="340" prop="spotCheckNumber">
            <template slot-scope="{row}">
              <template>
                <el-input v-model="row.spotCheckNumber" size="small" :disabled="operationType === 'view'"/>
              </template>
            </template>
          </el-table-column>
          <el-table-column v-if="operationType === 'add'" label="数量" min-width="120" prop="number">
            <template slot-scope="{row}">
              <template>
                <el-input v-model="row.number" size="small" :disabled="operationType === 'view'"/>
              </template>
            </template>
          </el-table-column>
          <el-table-column v-if="operationType !== 'add'" label="抽样时间" prop="spotCheckTime" width="160">
            <template slot-scope="{row}">
              <template>
                <el-date-picker v-model="row.spotCheckTime"
                                format="yyyy-MM-dd"
                                :disabled="operationType === 'view'"
                                placeholder="选择日期"
                                size="small"
                                clearable
                                style="width:100%"
                                type="date"
                                value-format="yyyy-MM-dd">
                </el-date-picker>
              </template>
            </template>
          </el-table-column>
          <el-table-column v-if="operationType !== 'add'" label="试样结论" prop="result" width="130">
            <template v-slot="scope">
              <el-select v-model="scope.row.result" placeholder="请选择" size="small" clearable :disabled="operationType === 'view'">
                <el-option label="合格" value="合格"></el-option>
                <el-option label="不合格" value="不合格"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column v-if="operationType !== 'add'" label="取样人员" prop="samplingUser" width="120">
            <template slot-scope="{row}">
              <template>
                <el-input v-model="row.samplingUser" size="small" :disabled="operationType === 'view'"/>
              </template>
            </template>
          </el-table-column>
          <el-table-column label="备注" prop="itemRemark" width="200">
            <template slot-scope="{row}">
              <template>
                <el-input v-model="row.itemRemark" size="small" :disabled="operationType === 'view'"/>
              </template>
            </template>
          </el-table-column>
          <el-table-column v-if="operationType !== 'view'" fixed="right" label="操作" width="100">
            <template slot-scope="scope">
              <el-button size="small" style="color: #f56c6c" type="text" @click="deleteScope(scope.$index)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div style="display: flex;align-items: center;margin: 10px 0">
        <span style="width: 70px">备注:</span>
        <el-input v-model="quarterSampleForm.remark" :disabled="operationType === 'view'" size="small" style="width: 43%" type="textarea"></el-input>
      </div>
      <div v-if="operationType !== 'add'">
        <el-form ref="form" :model="editForm" label-width="70px">
          <el-col :span="12">
            <el-form-item label="编制人:">
              <el-select v-model="editForm.writeUser" :disabled="operationType !=='edit'" 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>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="会签人:">
              <el-select v-model="editForm.countersignUser" :disabled="operationType !=='edit'" 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>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="审核人:">
              <el-select v-model="editForm.examineUser" :disabled="operationType !=='edit'" 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>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="批准人:">
              <el-select v-model="editForm.ratifyUser" :disabled="operationType !=='edit'" 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>
            </el-form-item>
          </el-col>
        </el-form>
      </div>
      <span v-if="operationType !== 'view'" slot="footer" class="dialog-footer">
        <el-button v-if="operationType !== 'add'" @click="quarterSampleDia = false">取 æ¶ˆ</el-button>
        <el-button v-if="operationType === 'add'" @click="quarterSampleDia = false">保 å­˜</el-button>
        <el-button type="primary" @click="handleSample">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {addQuarter, getQuarter, updateQuarterOnOrder} from "@/api/business/finishedProductSampling";
import {selectUserCondition} from "@/api/business/inspectionTask";
import {mapGetters} from "vuex";
export default {
  name: "addQuarterItem",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      tableLoading: false,
      quarterSampleDia: false, // å­£åº¦æŠ½æ ·å¼¹æ¡†
      quarterSampleForm: {
        quarterNo: '', // ç¼–号
      },
      quarterItems: [],
      quarterTemItems: [],
      operationType: '',
      editForm: {
        quarterId: '',
        writeUser: '', // ç¼–制人
        countersignUser: [], // ä¼šç­¾äºº
        examineUser: '', // å®¡æ ¸äºº
        ratifyUser: '', // æ‰¹å‡†äºº
      },
      userList: [],
      quarterRow: {},
    }
  },
  computed: {
    ...mapGetters(["nickName"]),
  },
  mounted() {
    this.getUserList()
  },
  // æ–¹æ³•集合
  methods: {
    openDia (quarterTemItems, type) {
      this.quarterSampleDia = true
      this.operationType = type
      if (type === 'add') {
        if (quarterTemItems.length > 0) {
          this.quarterItems = quarterTemItems
        }
        this.quarterSampleForm.quarterNo = getCurrentMonthTwoDigits()
      } else {
        this.tableLoading = true
        this.quarterRow = quarterTemItems
        getQuarter({quarterId: quarterTemItems.quarterId}).then(res => {
          this.tableLoading = false
          if (res.code === 200) {
            this.quarterItems = res.data.quarterItems
            this.quarterSampleForm.quarterNo = res.data.quarterNo
            this.quarterSampleForm.remark = res.data.remark
            this.editForm.quarterId = res.data.quarterId
            this.editForm.writeUser = res.data.writeUser
            this.editForm.examineUser = res.data.examineUser
            this.editForm.ratifyUser = res.data.ratifyUser
            if (res.data.countersignUser) {
              this.editForm.countersignUser = res.data.countersignUser.split(",").map(Number)
            }
          }
        }).catch(err => {
          this.tableLoading = false
        })
      }
    },
    // æ‰‹åŠ¨æ·»åŠ 
    addQuarter () {
      this.quarterItems.push({
        productType: '',
        dutyUser: this.nickName,
        productModel: '',
        spotCheckNumber: '',
        number: '',
        spotCheckTime: '',
        result: '',
        samplingUser: '',
        itemRemark: '',
      })
    },
    // æäº¤å­£åº¦æŠ½æ ·
    handleSample () {
      this.$confirm('是否提交该数据', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        if (this.operationType === 'add') {
          this.quarterSampleForm.quarterItems = JSON.parse(JSON.stringify(this.quarterItems))
          this.quarterSampleForm.quarterItems.forEach(item => {
            item.spotCheckNumber = item.spotCheckNumber + ' ' + (item.number == null ? "" : item.number)
          })
          addQuarter(this.quarterSampleForm).then(res => {
            if (res.code == 200) {
              this.$message.success('提交成功')
              this.quarterItems = []
              this.$parent.quarterTemItems = []
              this.closeQuarterSampleDia()
            }
          })
        } else {
          const params = {...this.editForm}
          if (params.countersignUser.length > 0) {
            params.countersignUser = params.countersignUser.join(',')
          } else {
            params.countersignUser = ''
          }
          params.quarterItems = JSON.parse(JSON.stringify(this.quarterItems))
          updateQuarterOnOrder(params).then(res => {
            if (res.code == 200) {
              this.$message.success('提交成功')
              this.quarterItems = []
              this.closeQuarterSampleDia()
            }
          })
        }
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消'
        });
      });
    },
    // æ¸…空抽样计划
    clearTable () {
      this.quarterItems = []
      this.$parent.quarterTemItems = []
    },
    // æ‰‹åŠ¨åˆ é™¤
    deleteScope (index) {
      this.quarterItems.splice(index, 1)
    },
    // å…³é—­å­£åº¦æŠ½æ ·å¼¹æ¡†
    closeQuarterSampleDia () {
      this.quarterSampleDia = false
      if (this.operationType === 'add') {
        this.$parent.handleStockList()
      } else {
        this.$parent.refreshTable('page')
      }
    },
    getUserList(){
      selectUserCondition({ type: 0 }).then((res) => {
        this.userList = res.data;
      })
    },
  },
}
function getCurrentMonthTwoDigits() {
  const currentDate = new Date();
  const year = currentDate.getFullYear();
  const currentMonth = currentDate.getMonth() + 1;
  return year + currentMonth.toString().padStart(2, '0');
}
</script>
<style scoped>
</style>
src/views/business/finishedProductSampling/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,448 @@
<!--成品抽样页面-->
<template>
  <div style="padding: 10px 0">
    <div class="card">
      <div class="title">
        <el-button size="small" type="primary" @click="addTemQuarter">新增</el-button>
        <el-button size="small" type="primary" @click="quarterSample">季度抽样</el-button>
        <el-button size="small" type="primary" @click="handleStockList">刷新</el-button>
      </div>
      <el-table
        ref="finishedproducttransferTable"
        v-loading="tableLoading"
        :data="stockList"
        :header-cell-style="lineSideWarehouseTableHeaderCellStyle"
        :row-class-name="lineSideWarehouseTableRowClassName"
        class="finishedproducttransfer-table"
        height="calc(100vh - 240px)"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="45"></el-table-column>
        <el-table-column
          :show-overflow-tooltip="true"
          align="center"
          label="客户订单编号"
          prop="customerOrderNo"
          width="140"
        >
          <template slot="header" slot-scope="scope">
            <div style="line-height: 14px;margin-bottom: 6px">客户订单编号</div>
            <div class="th" @click.stop>
              <el-input
                v-model="queryParamOne.customerOrderNo"
                clearable
                size="mini"
                type="text"
                @clear="handleStockList"
                @keyup.enter.native="handleStockList"
              ></el-input>
            </div>
          </template>
          <template slot-scope="scope">
            <span>{{ scope.row.customerOrderNo }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="成品零件号"
          prop="partNo"
          width="140"
        >
          <template slot="header" slot-scope="scope">
            <div style="line-height: 14px;margin-bottom: 6px">成品零件号</div>
            <div class="th" @click.stop>
              <el-input
                v-model="queryParamOne.partNo"
                clearable
                size="mini"
                type="text"
                @clear="handleStockList"
                @keyup.enter.native="handleStockList"
              ></el-input>
            </div>
          </template>
          <template slot-scope="scope">
            <span>{{ scope.row.partNo }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="零件名称"
          prop="partName"
          width="140"
        >
          <template slot="header" slot-scope="scope">
            <div style="line-height: 14px;margin-bottom: 6px">零件名称</div>
            <div class="th" @click.stop>
              <el-input
                v-model="queryParamOne.partName"
                clearable
                size="mini"
                type="text"
                @clear="handleStockList"
                @keyup.enter.native="handleStockList"
              ></el-input>
            </div>
          </template>
          <template slot-scope="scope">
            <span>{{ scope.row.partName }}</span>
          </template>
        </el-table-column>
        <el-table-column
          :show-overflow-tooltip="true"
          align="center"
          label="仓库"
          prop="warehouseName"
          width="140"
        >
          <template slot="header" slot-scope="scope">
            <div style="line-height: 14px;margin-bottom: 6px">仓库</div>
            <div class="th" @click.stop>
              <el-input
                v-model="queryParamOne.warehouseName"
                clearable
                size="mini"
                type="text"
                @clear="handleStockList"
                @keyup.enter.native="handleStockList"
              ></el-input>
            </div>
          </template>
          <template slot-scope="scope">
            <span>{{ scope.row.warehouseName }}</span>
          </template>
        </el-table-column>
        <el-table-column
          :show-overflow-tooltip="true"
          align="center"
          label="库位号"
          prop="locationNo"
          width="140"
        >
          <template slot="header" slot-scope="scope">
            <div style="line-height: 14px;margin-bottom: 6px">库位号</div>
            <div class="th" @click.stop>
              <el-input
                v-model="queryParamOne.locationNo"
                clearable
                size="mini"
                type="text"
                @clear="handleStockList"
                @keyup.enter.native="handleStockList"
              ></el-input>
            </div>
          </template>
          <template slot-scope="scope">
            <span>{{ scope.row.locationNo }}</span>
          </template>
        </el-table-column>
        <el-table-column
          :show-overflow-tooltip="true"
          align="center"
          label="库位名称"
          prop="locationName"
          width="140"
        >
          <template slot="header" slot-scope="scope">
            <div style="line-height: 14px;margin-bottom: 6px">库位名称</div>
            <div class="th" @click.stop>
              <el-input
                v-model="queryParamOne.locationName"
                clearable
                size="mini"
                type="text"
                @clear="handleStockList"
                @keyup.enter.native="handleStockList"
              ></el-input>
            </div>
          </template>
          <template slot-scope="scope">
            <span>{{ scope.row.locationName }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="批次号"
          prop="partBatchNo"
          width="140"
        >
          <template slot="header" slot-scope="scope">
            <div style="line-height: 14px;margin-bottom: 6px">批次号</div>
            <div class="th" @click.stop>
              <el-input
                v-model="queryParamOne.partBatchNo"
                clearable
                size="mini"
                type="text"
                @clear="handleStockList"
                @keyup.enter.native="handleStockList"
              ></el-input>
            </div>
          </template>
          <template slot-scope="scope">
            <span>{{ scope.row.partBatchNo }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="入库来源"
          prop="inSource"
          width="140"
        >
          <template slot="header" slot-scope="scope">
            <div style="line-height: 14px;margin-bottom: 6px">入库来源</div>
            <div class="th" @click.stop>
              <el-input
                v-model="queryParamOne.inSource"
                clearable
                size="mini"
                type="text"
                @clear="handleStockList"
                @keyup.enter.native="handleStockList"
              ></el-input>
            </div>
          </template>
          <template slot-scope="scope">
            <span>{{ scope.row.inSource }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="外护颜色"
          prop="outerColor"
          width="140"
        >
          <template slot="header" slot-scope="scope">
            <div style="line-height: 14px;margin-bottom: 6px">外护颜色</div>
            <div class="th" @click.stop>
              <el-input
                v-model="queryParamOne.outerColor"
                clearable
                size="mini"
                type="text"
                @clear="handleStockList"
                @keyup.enter.native="handleStockList"
              ></el-input>
            </div>
          </template>
          <template slot-scope="scope">
            <span>{{ scope.row.outerColor }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="库存数量"
          prop="stockQuantity"
          width="140"
        >
        </el-table-column>
        <el-table-column
          align="center"
          label="可用库存数量"
          prop="availableStockQuantity"
          width="140"
        >
          <template slot-scope="scope">
            <span>{{ scope.row.availableStockQuantity }}</span>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagin-page" style="margin-top: 0;margin-bottom: 0;">
        <el-pagination
          background
          :current-page="queryReport.current"
          :page-size="queryReport.size"
          :page-sizes="[10, 15, 20, 50, 100]"
          :total="queryReport.total"
          layout="total, sizes, prev, pager, next, jumper"
          style="text-align:right;padding: 20px 16px;"
          @size-change="handleSizeChangeReport"
          @current-change="handleCurrentChangeReport"
        >
        </el-pagination>
      </div>
    </div>
    <add-quarter-item ref="addQuarterItem"></add-quarter-item>
  </div>
</template>
<script>
import AddQuarterItem from "./components/addQuarterItem.vue";
import {getIfsStock} from "@/api/business/finishedProductSampling";
import {mapGetters} from "vuex";
export default {
  data() {
    return {
      stockList: [],
      queryParamOne: {
        partNo: null,
        partName: null,
        warehouseName: null,
        locationName: null,
        locationNo: null,
        partBatchNo: null,
        stockQuantity: null,
        availableStockQuantity: null,
        outerColor: null,
        customerOrderNo: null,
        inSource: null,
      },
      queryReport: {
        current: 1,
        size: 20,
        total: 0
      },
      tableLoading: false,
      multipleSelection: [], // table所选中的对象
      showEditForm: false,
      showMoveForm: false,
      showMoveAllForm: false,
      erpfinishstock: {},
      isAvaliable: false,
      isPackage: false,
      quarterTemItems: [],
      operationType: ''
    }
  },
  components: {AddQuarterItem},
  mounted() {
    this.getIfsStock()
  },
  updated() {
    this.$nextTick(() => {
      this.$refs.finishedproducttransferTable.doLayout()
    })
  },
  computed: {
    ...mapGetters(["nickName"]),
  },
  methods: {
    // å­£åº¦æŠ½æ ·
    quarterSample () {
      this.$refs.addQuarterItem.openDia(this.quarterTemItems, 'add')
    },
    addTemQuarter () {
      if (this.multipleSelection.length > 0) {
        const multipleSelection = JSON.parse(JSON.stringify(this.multipleSelection))
        if (multipleSelection.length > 0) {
          multipleSelection.forEach(item => {
            if (item.partName.includes(' ')) {
              const list = item.partName.match(/^(\S+)\s(.*)/).slice(1)
              console.log('list', list)
              item.productType = list[0]
              item.spotCheckNumber = list[1]
            }
            item.dutyUser = this.nickName
            item.itemRemark = item.partBatchNo;
            this.quarterTemItems.push(item)
          })
        }
        this.$message.success('暂存成功')
        this.$refs.finishedproducttransferTable.clearSelection()
      } else {
        this.$message.warning('请选择数据')
      }
    },
    // èŽ·å–æ•°æ®åˆ—è¡¨
    getIfsStock() {
      this.tableLoading = true
      this.stockList = []
      const newReqParam = this.getFinalParam()
      getIfsStock(newReqParam)
        .then((response) => {
          const resData = response.data
          this.queryReport.total = resData.total
          const resStockList = resData.data
          resStockList.forEach((item) => {
            this.stockList.push({
              partNo: item.PART_NO,
              partName: item.PART_DESC,
              warehouseName: item.WAREHOUSE_ID,
              locationName: item.LOCATION_DESC,
              locationNo: item.LOCATION_NO,
              partBatchNo: item.LOT_BATCH_NO,
              stockQuantity: item.QTY_ONHAND,
              availableStockQuantity: item.QTY_AVAILABLE,
              outerColor: item.ATTR4,
              customerOrderNo: item.ATTR6,
              inSource: item.ATTR23,
            })
          })
          this.tableLoading = false
        })
        .catch(() => {
          this.tableLoading = false
        })
    },
    getFinalParam() {
      const newReqParam = {
        partNo: this.queryParamOne.partNo,
        partDescription: this.queryParamOne.partName,
        warehouse: this.queryParamOne.warehouseName
          ? this.queryParamOne.warehouseName + '%'
          : null,
        locDesc: this.queryParamOne.locationName,
        locNo: this.queryParamOne.locationNo,
        lotBatchNo: this.queryParamOne.partBatchNo,
        quantityFlag: this.queryParamOne.stockQuantity,
        outerColor: this.queryParamOne.outerColor,
        otcOrderNo: this.queryParamOne.customerOrderNo,
        availableStockQuantity: this.queryParamOne.availableStockQuantity,
        inSource: this.queryParamOne.inSource,
        page: this.queryReport.current,
        limit: this.queryReport.size
      }
      return newReqParam
    },
    lineSideWarehouseTableHeaderCellStyle({row, column, rowIndex, columnIndex}) {
      let headerStyle = 'background:#FAFAFA;color:#666;'
      if (columnIndex === 0) {
        headerStyle += 'border-radius: 6px 0px 0px 0px;'
      } else if (columnIndex === 13) {
        headerStyle += 'border-radius: 0px 6px 0px 0px;'
      }
      return headerStyle
    },
    lineSideWarehouseTableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 === 1) {
        return 'stripe-row'
      } else {
        return ''
      }
    },
    handleSizeChangeReport(val) {
      this.queryReport.size = val
      this.queryReport.current = 1
      this.getIfsStock()
    },
    handleCurrentChangeReport(val) {
      this.queryReport.current = val
      this.getIfsStock()
    },
    handleStockList() {
      this.queryReport.current = 1
      this.getIfsStock()
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    }
  }
}
</script>
<style scoped>
>>>.el-table__header {
  height: 70px;
}
.card {
  height: calc(100% - 40px);
  background: #ffffff;
  padding: 10px;
}
.title {
  text-align: right;
  margin-bottom: 10px;
}
</style>
src/views/business/inspectionReview/index.vue
@@ -179,10 +179,12 @@
            },
            {
              name: "上传",
              type: "text",
              clickFun: (row) => {
                this.handleUpload(row);
              },
              type: "upload",
              accept: '.doc,.docx',
              url: '/insReport/inReport',
              uploadIdFun: (row) => {
                return row.insReportId
              }
            },
            {
              name: "还原",
@@ -355,7 +357,7 @@
      })
    },
    // ä¸Šä¼ æŠ¥å‘Š
    handleUpload () {
    handleUpload (row) {
    },
    // ä¸‹è½½æŠ¥å‘Š
src/views/business/inspectionTask/index.vue
@@ -567,7 +567,6 @@
  },
  mounted() {
    this.queryParams.userId = this.userId;
    // this.getPower();
    this.refreshTable();
  },
  methods: {
@@ -626,40 +625,6 @@
    handleDataLook(row) {
      this.lookInfo = row;
      this.getLookList();
    },
    // æƒé™åˆ†é…
    getPower(radio) {
      let power = JSON.parse(sessionStorage.getItem("power"));
      let inspection = false;
      let connect = false;
      let review = false;
      let claim = false;
      for (var i = 0; i < power.length; i++) {
        if (power[i].menuMethod == "doInsOrder") {
          inspection = true;
        }
        if (power[i].menuMethod == "upPlanUser") {
          connect = true;
        }
        if (power[i].menuMethod == "verifyPlan") {
          review = true;
        }
        if (power[i].menuMethod == "claimInsOrderPlan") {
          claim = true;
        }
      }
      if (!claim) {
        this.componentData.do.splice(3, 1);
      }
      if (!review) {
        this.componentData.do.splice(2, 1);
      }
      if (!connect) {
        this.componentData.do.splice(1, 1);
      }
      if (!inspection) {
        this.componentData.do.splice(0, 1);
      }
    },
    changeCheckBox(val) {
      this.queryParams.userId = val ? 0 : null;
src/views/business/materialOrder/customsInspection.vue
@@ -451,10 +451,6 @@
  dicts: ['check_type', 'urgency_level'],
  components: {},
  props: {
    isReport: {
      type: Number,
      default: () => null
    }
  },
  data() {
    return {
@@ -462,6 +458,7 @@
      orderType: '',
      active: 0,
      currentId: 0,
      isReport: '',
      editTable:[], // åŒºé—´ç‰¹æ®Šå€¼å¡«å†™
      template: null,
      saveLoad: false, // ä¿å­˜æŒ‰é’®loading
@@ -640,6 +637,7 @@
    this.active = this.$route.query.active
    this.orderType = this.$route.query.orderType
    this.currentId = this.$route.query.currentId
    this.isReport = this.$route.query.isReport
    this.customsInspection = this.$route.query.customsInspection
    this.getUserNowList() // èŽ·å–å½“å‰ç”¨æˆ·ä¿¡æ¯
    this.selectStandardMethods() // èŽ·å–æ£€éªŒæ ‡å‡†ä¸‹æ‹‰æ¡†æ•°æ®
@@ -698,7 +696,7 @@
          orderId = this.dataIndex === 0 ? this.customsInspection.enterOrderId : this.customsInspection.quarterOrderId
        } else if (!this.customsInspection.enterOrderId && !this.customsInspection.quarterOrderId) {
          this.isShowTab = false
          orderId = this.isReport === 1 ? this.customsInspection.insOrderId : this.customsInspection.id
          orderId = this.isReport == 1 ? this.customsInspection.insOrderId : this.customsInspection.id
        }
        // æŸ¥çœ‹
        // è¯·æ±‚接口,回显数据
src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
@@ -175,7 +175,7 @@
      this.upLoading = false;
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.$refs.fileList.selectList()
        this.getFileList()
      }
    },
    beforeUpload(file) {
src/views/business/reportPreparation/index.vue
@@ -1,138 +1,67 @@
<template>
  <div class="inspection_order">
    <div v-show="activeFace === 0 && state===0" style="width: 100%;height: 100%;">
      <div>
        <el-row class="title">
          <el-col :span="12" style="padding-left: 20px;text-align: left;">报告编制</el-col>
        </el-row>
      </div>
      <div class="search" style="position: relative;">
        <div class="search_thing">
          <div class="search_label">报告编号:</div>
          <div class="search_input"><el-input v-model="componentData.entity.code" clearable placeholder="请输入"
                                              size="small" @keyup.enter.native="refreshTable()"></el-input></div>
  <div class="app-container">
    <div>
      <el-form :model="entity" ref="entity" size="small" :inline="true">
        <el-form-item label="报告编号" prop="code">
          <el-input v-model="entity.code" clearable placeholder="请输入"
                    size="small" @keyup.enter.native="refreshTable()"></el-input>
        </el-form-item>
        <el-form-item label="状态" prop="queryStatus">
          <el-select v-model="entity.queryStatus" clearable size="small" @change="refreshTable()">
            <el-option v-for="(a, i) in queryStatusList" :key="i" :label="a.label" :value="a.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="下单类别" prop="typeSource">
          <el-select v-model="entity.typeSource" clearable size="small" @change="refreshTable()">
            <el-option v-for="(a, i) in typeSourceList" :key="i" :label="a.label" :value="a.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="检验类别" prop="orderType">
          <el-select v-model="entity.orderType" clearable size="small" @change="refreshTable()">
            <el-option v-for="(a, i) in orderTypeList" :key="i" :label="a.label" :value="a.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button size="mini" @click="refresh()">重置</el-button>
          <el-button size="mini" type="primary" @click="refreshTable()">查询</el-button>
          <el-button :loading="outLoading" size="mini" type="primary" @click="handleDowns">批量下载</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div>
      <lims-table :tableData="valueTableData" :column="column" :page="page" :tableLoading="tableLoading"
                  :isSelection="true" :handleSelectionChange="handleChange"
                  :height="'calc(100vh - 290px)'" @pagination="pagination" key="valueTableData">
        <div slot="action" slot-scope="scope">
          <el-button size="small" type="text" @click="viewIssued(scope.row)">查看报告</el-button>
          <el-upload ref='upload1'
                     style="display: inline;margin: 0 6px"
                     :action="fileAction1 +'?id='+ scope.row.id"
                     :auto-upload="true"
                     :before-upload="fileBeforeUpload1"
                     :headers="uploadHeader" :on-error="onError1"
                     :on-success="handleSuccessUp1"
                     :show-file-list="false"
                     accept='.doc,.docx'>
            <el-button size="small" type="text" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName">上传</el-button>
          </el-upload>
          <el-button type="text" size="small" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName" @click="handleRestore(scope.row)">还原</el-button>
          <el-button type="text" size="small" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName" @click="sendBackTask(scope.row)">退回任务</el-button>
          <el-button type="text" size="small" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName" @click="handle(scope.row)">提交</el-button>
          <el-button type="text" size="small" :disabled="scope.row.state == null || scope.row.state == 0 ||scope.row.isExamine == 1 || userName !== scope.row.examineUser" @click="handleIssued(scope.row)">审核</el-button>
          <el-button type="text" size="small" :disabled="scope.row.state == null || scope.row.state == 0 || scope.row.isExamine == 0 || scope.row.isExamine == null || scope.row.isRatify == 1 || userName !== scope.row.ratifyUser" @click="handleApprove(scope.row)">批准</el-button>
          <el-popover placement="bottom" trigger="hover" style="margin-left: 6px">
            <template #reference>
              <el-button link type="text" size="small">更多</el-button>
            </template>
            <div>
              <el-button style="margin-left: 10px" type="text" size="small" @click="download(scope.row)">下载</el-button>
              <el-button type="text" size="small" @click="viewInspectInfo(scope.row)">原始记录</el-button>
              <el-button type="text" size="small" @click="handleFileLook(scope.row)">附件上传</el-button>
            </div>
          </el-popover>
        </div>
        <div class="search_thing">
          <div class="search_label">状态:</div>
          <div class="search_input">
            <el-select v-model="componentData.entity.queryStatus" clearable size="small" style="width: 100%;" @change="refreshTable()">
              <el-option v-for="(a, i) in queryStatusList" :key="i" :label="a.label" :value="a.value"></el-option>
            </el-select>
          </div>
        </div>
        <div class="search_thing">
          <div class="search_label">下单类别:</div>
          <div class="search_input">
            <el-select v-model="componentData.entity.typeSource" clearable size="small" style="width: 100%;" @change="refreshTable()">
              <el-option v-for="(a, i) in typeSourceList" :key="i" :label="a.label" :value="a.value"></el-option>
            </el-select>
          </div>
        </div>
        <div class="search_thing">
          <div class="search_label">检验类别:</div>
          <div class="search_input">
            <el-select v-model="componentData.entity.orderType" clearable size="small" style="width: 100%;" @change="refreshTable()">
              <el-option v-for="(a, i) in orderTypeList" :key="i" :label="a.label" :value="a.value"></el-option>
            </el-select>
          </div>
        </div>
        <div class="search_thing" style="padding-left: 30px;">
          <el-button size="small" @click="refresh()">重 ç½®</el-button>
          <el-button size="small" type="primary" @click="refreshTable()">查 è¯¢</el-button>
          <el-button :loading="outLoading" size="small" style="margin-right: 16px;" type="primary" @click="handleDowns">批量下载</el-button>
        </div>
      </div>
      <!-- <input id="input" type="file" accept=".doc,.docx"></input> -->
      <div class="table">
        <el-table @selection-change="handleChange" :data="valueTableData" style="width: 100%" height="calc(100vh - 21em)" v-loading="tableLoading">
          <!-- è¡¨æ ¼åˆ— -->
          <el-table-column type="selection" width="55"></el-table-column>
          <el-table-column header-align="center" align="center" width="70" prop="prop" label="序号" type="index"></el-table-column>
          <el-table-column prop="code" label="报告编号" min-width="180">
            <template slot-scope="scope">
              <el-button type="text" @click="selectAllByOne(scope.row)">{{scope.row.code}}</el-button>
            </template>
          </el-table-column>
          <el-table-column prop="typeSource" label="下单类别" min-width="120">
            <template slot-scope="scope">
              <el-tag type="info" v-if="scope.row.typeSource === 1" disable-transitions>原材料下单</el-tag>
              <el-tag type="info" v-if="scope.row.typeSource === 0" disable-transitions>成品下单</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="orderType" label="检验类别" min-width="150">
            <template slot-scope="scope">
              <el-tag type="success" v-if="scope.row.orderType === 'Customer-ordered test'" disable-transitions>委托试验</el-tag>
              <el-tag v-if="scope.row.orderType === '抽检'" disable-transitions>抽检</el-tag>
              <el-tag type="info" v-if="scope.row.orderType === '进厂检验'" disable-transitions>进厂检验</el-tag>
              <el-tag type="warning" v-if="scope.row.orderType === 'Quarterly inspection'" disable-transitions>季度检验</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="createTime" label="创建时间" min-width="150"></el-table-column>
          <el-table-column prop="writeUserName" label="提交人" min-width="110"></el-table-column>
          <el-table-column prop="writeTime" label="提交时间" min-width="150"></el-table-column>
          <el-table-column prop="state" label="提交状态" min-width="110">
            <template slot-scope="scope">
              <el-tag type="danger" v-if="scope.row.state === 0" disable-transitions>待提交</el-tag>
              <el-tag type="success" v-if="scope.row.state === 1" disable-transitions>已提交</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="examineUser" label="审核人" width="110"></el-table-column>
          <el-table-column prop="examineTime" label="审核时间" width="180"></el-table-column>
          <el-table-column prop="isExamine" label="审核状态" width="110">
            <template slot-scope="scope">
              <el-tag type="danger" v-if="scope.row.isExamine === 0" disable-transitions>不通过</el-tag>
              <el-tag type="success" v-if="scope.row.isExamine === 1" disable-transitions>通过</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="examineTell" label="审核备注" width="180"></el-table-column>
          <el-table-column prop="ratifyUser" label="批准人" width="110"></el-table-column>
          <el-table-column prop="ratifyTime" label="批准时间" width="180"></el-table-column>
          <el-table-column prop="isRatify" label="批准状态" width="110">
            <template slot-scope="scope">
              <el-tag type="danger" v-if="scope.row.isRatify === 0" disable-transitions>不批准</el-tag>
              <el-tag type="success" v-if="scope.row.isRatify === 1" disable-transitions>批准</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="ratifyTell" label="批准备注" width="180"></el-table-column>
          <!-- æ“ä½œæŒ‰é’® -->
          <el-table-column label="操作" fixed="right" min-width="360" align="center">
            <template slot-scope="scope">
              <el-button size="small" type="text" @click="viewIssued(scope.row)">查看报告</el-button>
              <el-upload ref='upload1'
                         style="display: inline"
                         :action="fileAction1 +'?id='+ scope.row.id"
                         :auto-upload="true"
                         :before-upload="fileBeforeUpload1"
                         :headers="headers" :on-error="onError1"
                         :on-success="handleSuccessUp1"
                         :show-file-list="false"
                         accept='.doc,.docx'>
                <el-button size="small" type="text" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName">上传</el-button>
                <!--                <span>上传</span>-->
              </el-upload>
              <el-button type="text" size="small" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName" @click="handleRestore(scope.row)">还原</el-button>
              <el-button type="text" size="small" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName" @click="sendBackTask(scope.row)">退回任务</el-button>
              <el-button type="text" size="small" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName" @click="handle(scope.row)">提交</el-button>
              <el-button type="text" size="small" :disabled="scope.row.state == null || scope.row.state == 0 ||scope.row.isExamine == 1 || userName !== scope.row.examineUser" @click="handleIssued(scope.row)">审核</el-button>
              <el-button type="text" size="small" :disabled="scope.row.state == null || scope.row.state == 0 || scope.row.isExamine == 0 || scope.row.isExamine == null || scope.row.isRatify == 1 || userName !== scope.row.ratifyUser" @click="handleApprove(scope.row)">批准</el-button>
              <el-popover placement="bottom" :width="170" trigger="hover">
                <template #reference>
                  <el-button link type="text" size="small">更多</el-button>
                </template>
                <div>
                  <el-button style="margin-left: 10px" type="text" size="small" @click="download(scope.row)">下载</el-button>
                  <el-button type="text" size="small" @click="viewInspectInfo(scope.row)">原始记录</el-button>
                  <el-button type="text" size="small" @click="handleFileLook(scope.row)">附件上传</el-button>
                </div>
              </el-popover>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.current"
                       style="margin-right: 5%;" :page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size"
                       layout="->,total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
      </div>
      </lims-table>
    </div>
    <el-dialog :fullscreen="fullscreen" :modal-append-to-body="false" :visible.sync="claimVisible" title="在线编制"
               width="22cm">
@@ -229,17 +158,8 @@
        <el-button :loading="loadingVerify" type="primary" @click="handleSubmit">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <div v-if="activeFace >0 && isCopper === null" style="width: 100%;height: 100%;">
      <Add :active="activeFace" :currentId="currentId" :examine="examine"/>
    </div>
    <div v-if="activeFace >0 && isCopper === 0" style="width: 100%;height: 100%;">
      <CustomsInspection :active="activeFace" :currentId="currentId" :customsInspection="customsInspection" :isReport="isReport"/>
    </div>
    <div v-if="activeFace >0 && isCopper === 1" style="width: 100%;height: 100%;">
      <CopperOrder :active="activeFace" :currentId="currentId"></CopperOrder>
    </div>
    <!--产业链信息查看-->
    <ShowInfo v-if="showInfoDialog" ref="showInfoDialog" :showInfoDialog="showInfoDialog"></ShowInfo>
<!--    <ShowInfo v-if="showInfoDialog" ref="showInfoDialog" :showInfoDialog="showInfoDialog"></ShowInfo>-->
    <!--报告查看-->
    <el-dialog :fullscreen="fullscreen" :modal-append-to-body="false" :visible.sync="viewIssuedVisible" title="报告查看"
               width="80vw">
@@ -251,33 +171,22 @@
        <onlyoffice ref="onlyoffice" :options="option" style="width: 100%;height: 100%;" />
      </div>
    </el-dialog>
    <!--检验任务信息查看-->
    <Inspection v-if="state>0" :key="InspectionKey" :inspectorList="inspectorList" :orderId="orderId"
                :sonLaboratory="sonLaboratory" :state="state"
                :typeSource="typeSource"
                @goback="goback" @refreshView="refreshView"/>
    <!--附件查看-->
    <el-dialog :visible.sync="filesDialogVisible" title="附件查看" width="80%" @closed="closeFilesLook">
      <div style="display: flex;justify-content: space-between;">
      <div style="margin-bottom: 10px">
        <el-upload ref='upload'
                   :action="fileAction"
                   :auto-upload="true"
                   :before-upload="fileBeforeUpload" :data="{orderId: filesLookInfo.insOrderId}"
                   :headers="headers" :on-error="onError"
                   :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 v-if="filesDialogVisible" style="height: 70vh;overflow-y: auto;">-->
<!--        <ValueTable :key="upIndex"-->
<!--                    ref="fileList"-->
<!--                    :componentData="fileComponentData"-->
<!--                    :delUrl="$api.insOrderPlan.delfile"-->
<!--                    :url="$api.insOrderPlan.getFileList"-->
<!--                    class="value-table"/>-->
<!--      </div>-->
      <lims-table :tableData="tableDataFile" :column="columnFile" @pagination="paginationFile" height="500px"
                  key="tableDataFile" :page="pageFile" :tableLoading="tableLoadingFile"></lims-table>
    </el-dialog>
  </div>
</template>
@@ -286,206 +195,33 @@
import onlyoffice from "@/components/Onlyoffice/onlyoffice.vue";
// import ShowInfo from "../do/b1-material-ins-order/showInfo.vue";
import file from "@/utils/file";
import {
  downAll,
  examineReport,
  pageInsReport,
  ratifyReport,
  sendBackTask,
  upReportUrl,
  writeReport
} from "@/api/business/insReport";
import {mapGetters} from "vuex";
import {selectUserCondition} from "@/api/business/inspectionTask";
import limsTable from "@/components/Table/lims-table.vue";
import {delfile, downFile, getFileList} from "@/api/business/rawMaterialOrder";
export default {
  components: {onlyoffice},
  components: {limsTable, onlyoffice},
  data() {
    return {
      componentData: {
        entity: {
          queryStatus: null,
          code: null,
          typeSource: null,
          orderBy: {
            field: 'id',
            order: 'desc'
          }
        },
        isIndex: true,
        showSelect: true,
        select: true,
        selectMethod: 'handleChange',
        do: [
          {
            id: '',
            font: '查看报告',
            type: 'text',
            method: 'viewIssued',
          },
          {
            id: 'download',
            font: '下载',
            type: 'text',
            method: 'download'
          }, {
            id: 'handleUpload',
            font: '上传',
            type: 'upload',
            uploadConfig: {
              url: this.$api.insReport.inReport,
              accept: '.docx'
            },
            method: 'handleUpload',
            disabFun: (row, index) => {
              return row.state != 0 || userName != row.writeUserName
            }
          },
          {
            id: 'handleRestore',
            font: '还原',
            type: 'text',
            method: 'handleRestore',
            disabFun: (row, index) => {
              return row.state != 0 || JSON.parse(localStorage.getItem("user")).name != row.writeUserName
            }
          },
          {
            id: 'sendBackTask',
            font: '退回任务',
            type: 'text',
            method: 'sendBackTask',
            disabFun: (row, index) => {
              return row.state != 0 || JSON.parse(localStorage.getItem("user")).name != row.writeUserName
            }
          },
          {
            id: 'handle',
            font: '提交',
            type: 'text',
            method: 'handle',
            disabFun: (row, index) => {
              return row.state != 0 || JSON.parse(localStorage.getItem("user")).name != row.writeUserName
            }
          },
          {
            id: 'handleIssued',
            font: '审核',
            type: 'text',
            method: 'handleIssued',
            disabFun: (row, index) => {
              return row.state == null || row.state == 0 || row.isExamine == 1 || JSON.parse(localStorage.getItem("user")).name != row.examineUser
            }
          }, {
            id: 'handleApprove',
            font: '批准',
            type: 'text',
            method: 'handleApprove',
            disabFun: (row, index) => {
              return row.state == null || row.state == 0 || row.isExamine == 0 || row.isExamine == null || row.isRatify == 1 || JSON.parse(localStorage.getItem("user")).name != row.ratifyUser
            }
          },
          {
            id: '',
            font: '原始记录',
            type: 'text',
            method: 'viewInspectInfo',
          },
          {
            id: '',
            font: '附件上传',
            type: 'text',
            method: 'handleFileLook',
          }
        ],
        linkEvent: {
          code: {
            method: 'selectAllByOne'
          }
        },
        tagField: {
          isRatify: {
            select: [{
              value: 0,
              type: 'danger',
              label: '不批准'
            }, {
              value: 1,
              type: 'success',
              label: '批准'
            }]
          },
          isExamine: {
            select: [{
              value: 0,
              type: 'danger',
              label: '不通过'
            }, {
              value: 1,
              type: 'success',
              label: '通过'
            }]
          },
          state: {
            select: [{
              value: 0,
              type: 'danger',
              label: '待提交'
            }, {
              value: 1,
              type: 'success',
              label: '已提交'
            }]
          },
          typeSource: {
            select: [{
              value: 0,
              label: '成品下单',
              type: 'info'
            },{
              value: 1,
              label: '原材料下单',
              type: 'info'
            }]
          },
          queryStatus: {
            select: [{
              value: 0,
              label: '待提交',
              type: 'info'
            },{
              value: 1,
              label: '待审核',
              type: 'info'
            },{
              value: 2,
              label: '待批准',
              type: 'info'
            }]
          },
          orderType: {
            select: [{
              value: 'Customer-ordered test',
              label: '委托试验',
              type: 'success',
              effect: 'plain'
            },{
              value: '抽检',
              label: '抽检',
              type: '',
              effect: 'plain'
            },{
              value: '进厂检验',
              label: '进厂检验',
              type: 'info',
              effect: 'plain'
            },{
              value: 'Quarterly inspection',
              label: '季度检验',
              type: 'warning',
              effect: 'plain'
            }]
          }
        },
        selectField: {},
        requiredAdd: [],
        needSort: ['createTime', 'state', 'writeTime', 'isExamine', 'examineTime', 'ratifyTime'],
        requiredUp: []
      entity: {
        queryStatus: null,
        code: null,
        typeSource: null,
      },
      page: {
        current: 1,
        size: 20,
        total: 0
      },
      total: null,
      entityCopy: {},
      upIndex: 0,
      statusList: [],
      claimVisible: false,
@@ -542,78 +278,214 @@
      sonLaboratory: '', // è¯•验室
      filesDialogVisible: false,
      filesLookInfo: {},
      fileComponentData: {
        entity: {
          insOrderId:''
        },
        isIndex: true,
        showSelect: false,
        select: false,
        sort: false,
        init:false,
        do: [
          {
            id: 'parent',
            font: '下载',
            type: 'text',
            method: 'handleDown'
          },{
            id: 'delete',
            font: '删除',
            type: 'text',
            method: 'doDiy',
      tableDataFile: [],
      tableLoadingFile: false,
      columnFile: [
        {
          dataType: 'tag',
          label: '类型',
          prop: 'type',
          formatData: (params) => {
            if (params == 1) {
              return '图片'
            } else if (params == 2) {
              return '文件'
            } else {
              return ''
            }
          },
          formatType: (params) => {
            if (params == 1) {
              return 'success'
            } else if (params == 2) {
              return 'warning'
            } else {
              return ''
            }
          }
        ],
        isPage: false,
        linkEvent: {},
        tagField: {
          type:{
            select:[
              {
                value: 1,
                label: '图片'
              },
              {
                value: 2,
                label: '文件'
        },
        { label: '附件名称', prop: 'fileName' },
        { label: '上传人', prop: 'name' },
        { label: '上传时间', prop: 'createTime' },
        {
          dataType: 'action',
          fixed: 'right',
          label: '操作',
          width: '170px',
          operation: [
            {
              name: '下载',
              type: 'text',
              clickFun: (row) => {
                this.handleDown(row);
              }
            ]
          }
        },
        currentId: '',
        selectField: {},
        requiredAdd: [],
        requiredUp: []
            },
            {
              name: '删除',
              type: 'text',
              clickFun: (row) => {
                this.delete(row);
              }
            },
          ]
        }
      ],
      pageFile: {
        total: 0,
        size: 10,
        current: 1
      },
      isCopper: null,
      tableLoading: false,
      valueTableData: [],
      userName: ''
      column: [
        {
          label: "报告编号",
          prop: "code",
          width: "160px",
          dataType: "link",
          linkMethod: "selectAllByOne",
        },
        {
          label: "下单类别",
          prop: "typeSource",
          width: "100px",
          dataType: "tag",
          formatData: (params) => {
            if (params == 0) {
              return "成品下单";
            } else {
              return "原材料下单";
            }
          },
        },
        {
          label: "检验类型",
          prop: "orderType",
          width: "100px",
          dataType: "tag",
          formatData: (params) => {
            return this.orderTypeList.find((m) => m.value == params).label;
          },
          formatType: (params) => {
            return this.orderTypeList.find((m) => m.value == params).type;
          },
        },
        { label: "创建时间", prop: "createTime" },
        { label: "提交人", prop: "writeUserName" },
        { label: "提交时间", prop: "writeTime" },
        {
          label: "提交状态",
          prop: "state",
          width: "100px",
          dataType: "tag",
          formatData: (params) => {
            if (params == 0) {
              return "待提交";
            } else {
              return "已提交";
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return "danger";
            } else {
              return "success";
            }
          },
        },
        { label: "审核人", prop: "examineUser" },
        { label: "审核时间", prop: "examineTime" },
        {
          label: "审核状态",
          prop: "isExamine",
          width: "100px",
          dataType: "tag",
          formatData: (params) => {
            if (params == 0) {
              return "不通过";
            } else {
              return "通过";
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return "danger";
            } else {
              return "success";
            }
          },
        },
        { label: "审核备注", prop: "examineTell" },
        { label: "批准人", prop: "ratifyUser" },
        { label: "批准时间", prop: "ratifyTime" },
        {
          label: "批准状态",
          prop: "isRatify",
          width: "100px",
          dataType: "tag",
          formatData: (params) => {
            if (params == 0) {
              return "不批准";
            } else {
              return "批准";
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return "danger";
            } else {
              return "success";
            }
          },
        },
        { label: "批准备注", prop: "ratifyTell" },
        {
          fixed: "right",
          dataType: "slot",
          slot: "action",
          width: '360px',
          label: "操作"
        }
      ],
      userName: '',
    }
  },
  computed: {
    headers() {
      return {
        'token': sessionStorage.getItem('token')
      }
    },
    ...mapGetters(["nickName", "userId"]),
    action() {
      return this.javaApi + this.$api.insReport.upAll
      return this.javaApi + '/insReport/upAll'
    },
    fileAction() {
      return this.javaApi + this.$api.insOrderPlan.uploadFile
      return this.javaApi + '/unqualifiedHandler/uploadFileByUnqualified'
    },
    fileAction1() {
      return this.javaApi + this.$api.insReport.inReport
      return this.javaApi + '/insReport/inReport'
    }
  },
  mounted() {
    this.entityCopy = this.HaveJson(this.componentData.entity)
    this.userName = JSON.parse(localStorage.getItem("user")).name
    this.getPower()
    this.refreshTable()
  },
  methods: {
    refreshTable() {
      this.tableLoading = true
      pageInsReport({
        ...this.page,...this.entity
      }).then(res => {
        this.tableLoading = false
        this.page.total = res.data.body.total
        this.valueTableData = res.data.body.records
      })
    },
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.refreshTable();
    },
    refresh() {
      this.resetForm('entity')
      this.refreshTable();
    },
    handleChange(arr){
      this.mutiList = arr
    },
@@ -624,27 +496,40 @@
      if(row.userName){
        inspectorList = row.userName.split(',')
      }
      let user = JSON.parse(localStorage.getItem('user'))
      if(user){
        inspectorList.push(user.name)
      }
      this.inspectorList = inspectorList
      this.state = 3;
      this.typeSource = row.typeSource
      this.orderId = row.insOrderId
      this.sonLaboratory = row.sonLaboratory
      inspectorList.push(this.nickName)
      this.$router.push({
        path: "/inspectionTask/inspection",
        query: {
          sonLaboratory: row.sonLaboratory,
          state: 3,
          typeSource: row.typeSource,
          orderId: row.insOrderId,
          inspectorList: inspectorList,
        },
      })
    },
    goback() {
      this.state = 0
      this.refreshTable('page')
    },
    // æ‰“开查看附件弹框
    handleFileLook (row) {
      this.filesLookInfo = row
      this.filesDialogVisible = true
      this.fileComponentData.entity.insOrderId = row.insOrderId
      this.$nextTick(() => {
        this.$refs['fileList'].selectList()
      this.getFileList()
    },
    // æŸ¥è¯¢é™„件查看列表回调
    getFileList() {
      this.tableLoadingFile = true
      getFileList({insOrderId: this.filesLookInfo.insOrderId}).then(res => {
        this.tableLoadingFile = false
        if (res.code === 200) {
          this.tableDataFile = res.data.records
          this.pageFile.total = res.data.total
        }
      }).catch(err => {
        this.tableLoadingFile = false
      })
    },
    paginationFile(page) {
      this.pageFile.size = page.limit
      this.getFileList()
    },
    closeFilesLook () {
      this.filesDialogVisible = false
@@ -653,7 +538,7 @@
      this.upLoading = false;
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.$refs.fileList.selectList()
        this.getFileList()
      }
    },
    handleSuccessUp1(response, ) {
@@ -661,8 +546,9 @@
        this.$message.success('上传成功');
      }
    },
    // ä¸‹è½½é™„件的文件
    handleDown(row){
      this.$axios.post(this.$api.insOrderPlan.downFile, {
      downFile({
        id: row.id,
      }).then(res => {
        if (res.code === 200) {
@@ -682,9 +568,23 @@
      })
    },
    // åˆ·æ–°é¡µé¢
    refreshView () {
      this.InspectionKey++
    // åˆ é™¤é™„件文件
    delete(row) {
      this.$confirm('是否删除当前数据?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        delfile({ id: row.id }).then(res => {
          if (res.code === 500) {
            return
          }
          this.$message.success('删除成功')
          this.getList()
        }).catch(e => {
          this.$message.error('删除失败')
        })
      }).catch(() => { })
    },
    // æŸ¥çœ‹äº§ä¸šé“¾ä¿¡æ¯
    openInfoDialog (row) {
@@ -700,7 +600,7 @@
      }
      let str = this.mutiList.map(m=>m.id).join(',')
      this.outLoading = true
      this.$axios.get(this.$api.insReport.downAll+'?ids='+str).then(res => {
      downAll({ids: str}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        // const blob = new Blob([res],{ type: 'application/octet-stream' });
@@ -765,118 +665,48 @@
      this.$message.error('上传失败')
      this.$refs.upload1.clearFiles()
    },
    refreshTable(e) {
      this.tableLoading = false
      this.$axios.post(this.$api.insReport.pageInsReport, {
        page: this.page,
        entity: this.componentData.entity
      }, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        this.tableLoading = false
        if (res.code === 201) {
          return
        }
        this.total = res.data.body.total
        this.valueTableData = res.data.body.records
      })
    },
    handleSizeChange(val) {
      this.page.size = val
      this.refreshTable();
    },
    handleCurrentChange(val) {
      this.page.current = val
      this.refreshTable();
    },
    refresh() {
      this.componentData.entity = this.HaveJson(this.entityCopy)
      this.refreshTable();
    },
    async handleWeave(row) {
      let fileName = (row.urlS===null||row.urlS==='')?row.url:row.urlS
      fileName = fileName.replace('/word/','')
      const userName = JSON.parse(localStorage.getItem("user")).name;
      //参考vabOnlyOffice组件参数配置
      const { href } = this.$router.resolve({
        path: `/wordEdit`,
        query: {
          url: this.javaApi + "/word/" + fileName,
          isEdit: true,
          fileType: "docx",
          title: fileName,
          lang: 'zh-CN',
          isPrint: true,
          user_id: 1,
          user_name: userName,
          editUrl: this.javaApi + "/insReport/onlyOffice/save?fileName=" + fileName
        }
      })
      window.open(href, '_blank');
    },
    // æƒé™åˆ†é…
    getPower(radio) {
      let power = JSON.parse(sessionStorage.getItem('power'))
      let edit = false
      let up = false
      let res = false
      let sub = false
      let issued = true
      let approve = true
      for (var i = 0; i < power.length; i++) {
        if (power[i].menuMethod == 'upReportFile') {
          edit = true
        }
        if (power[i].menuMethod == 'inReport') {
          up = true
        }
        if (power[i].menuMethod == 'upReportUrl') {
          res = true
        }
        if (power[i].menuMethod == 'writeReport') {
          sub = true
        }
        if (power[i].menuMethod == 'ratifyReport') {
          approve = true
        }
        if (power[i].menuMethod == 'examineReport') {
          issued = true
        }
      }
      if (!approve) {
        this.componentData.do.splice(6, 1)
      }
      if (!issued) {
        this.componentData.do.splice(5, 1)
      }
      if (!sub) {
        this.componentData.do.splice(4, 1)
      }
      if (!res) {
        this.componentData.do.splice(3, 1)
      }
      if (!up) {
        this.componentData.do.splice(2, 1)
      }
      if (!edit) {
        this.componentData.do.splice(0, 1)
      }
    },
    confirmClaim() {
      // console.log(this.$refs.Word.getValue())
    },
    playOrder(num) {
      this.activeFace = num
    },
    async selectAllByOne(row) {
    selectAllByOne(row) {
      this.isCopper = row.isCopper
      this.customsInspection = row
      this.activeFace = 2;
      this.examine = 1;
      this.isReport = 1
      this.currentId = parseInt(row.insOrderId)
      switch (row.isCopper) {
        case 0:
          // åŽŸææ–™
          this.$router.push({
            path: "/materialOrder/customsInspection", query: {
              customsInspection: row,
              active: this.activeFace,
              currentId: row.insOrderId,
              isReport: this.isReport
            }
          });
          break;
        case null:
          // æˆå“
          this.$router.push({
            path: "/productOrder/add", query: {
              examine: this.examine,
              active: this.activeFace,
              currentId: row.insOrderId
            }
          });
          break;
        case 1:
          // é“œæ
          this.$router.push({
            path: "/materialOrder/copperOrder", query: {
              active: this.activeFace,
              currentId: row.insOrderId
            }
          });
          break;
      }
    },
    download(row) {
      let url = row.urlS ? row.urlS : row.url;
@@ -888,7 +718,7 @@
    },
    // è¿˜åŽŸæ“ä½œ
    handleRestore(row) {
      this.$axios.post(this.$api.insReport.upReportUrl, {
      upReportUrl({
        id: row.id
      }).then(res => {
        if (res.code === 200) {
@@ -907,7 +737,7 @@
        fileType = "pdf"
      }
      fileName = fileName.replace('/word/','')
      const userName = JSON.parse(localStorage.getItem("user")).name;
      const userName = this.nickName
      this.option = {
        url: this.javaApi + "/word/" + fileName,
        isEdit: false,
@@ -921,19 +751,6 @@
      }
      this.issuedVisible = true;
    },
    // æŸ¥çœ‹pdf报告
    viewIssuedPdf(row) {
      this.currentInfo = row;
      let url = row.tempUrlPdf
      if(url){
        url = url.split('.')[0]+'.pdf'
        const link = document.createElement('a');
        link.href = this.javaApi + url;
        link.target = '_blank';
        document.body.appendChild(link);
        link.click();
      }
    },
    // æŸ¥çœ‹æŠ¥å‘Š
    viewIssued(row) {
      this.currentInfo = row;
@@ -944,7 +761,7 @@
        fileType = "pdf"
      }
      fileName = fileName.replace('/word/','')
      const userName = JSON.parse(localStorage.getItem("user")).name;
      const userName = this.nickName
      this.option = {
        url: this.javaApi + "/word/" + fileName,
        isEdit: false,
@@ -966,11 +783,8 @@
        type: 'warning'
      }).then(() => {
        this.upLoad = true
        this.$axios.post(this.$api.insReport.sendBackTask+'?id='+row.id).then(res => {
        sendBackTask({id: row.id}).then(res => {
          this.upLoad = false
          if (res.code === 201) {
            return
          }
          this.$message.success('退回成功!')
          this.refreshTable('page')
        }).catch(err => {
@@ -990,15 +804,12 @@
        return
      }
      this.loadingIssued = true;
      this.$axios.post(this.$api.insReport.examineReport, {
      examineReport({
        id: this.currentInfo.id,
        userId: this.approver,
        isExamine: 1
      }).then(res => {
        this.loadingIssued = false;
        if (res.code === 201) {
          return
        }
        this.$message.success('提交成功')
        this.refreshTable('page')
        this.currentInfo = null;
@@ -1020,18 +831,15 @@
    },
    // èŽ·å–äººå‘˜åˆ—è¡¨
    getAuthorizedPerson() {
      this.$axios.get(this.$api.user.selectQualityUserList).then(res => {
        let data = []
        let userName = JSON.parse(localStorage.getItem("user")).name;
        res.data.forEach(a => {
          // if(a.name !== userName) {
      selectUserCondition({ type: 0 }).then((res) => {
        let data = [];
        res.data.forEach((a) => {
          data.push({
            label: a.name,
            value: a.id
          })
          // }
        })
        this.approverList = data
            value: a.id,
          });
        });
        this.approverList = data;
      })
    },
    // æ‰¹å‡†æŒ‰é’®
@@ -1044,7 +852,7 @@
        fileType = "pdf"
      }
      fileName = fileName.replace('/word/','')
      const userName = JSON.parse(localStorage.getItem("user")).name;
      const userName = this.nickName
      this.option = {
        url: this.javaApi + "/word/" + fileName,
        isEdit: false,
@@ -1061,15 +869,11 @@
    // æ‰¹å‡†é€šè¿‡
    subApprove() {
      this.loadingApprove = true;
      this.$axios.post(this.$api.insReport.ratifyReport, {
      ratifyReport({
        id: this.currentInfo.id,
        isRatify: 1
      }).then(res => {
        this.loadingApprove = false;
        if (res.code == 201) {
          this.$message.error('批准失败')
          return
        }
        this.$message.success('已批准')
        this.refreshTable('page')
        this.currentInfo = null;
@@ -1084,14 +888,11 @@
    // æäº¤å®¡æ ¸äººæ“ä½œ
    handleSubmit(row) {
      this.loadingVerify = true
      this.$axios.post(this.$api.insReport.writeReport, {
      writeReport({
        id: this.currentInfo.id,
        userId: this.verifyUser,
      }).then(res => {
        this.loadingVerify = false
        if (res.code === 201) {
          return
        }
        this.addVerifyDia = false
        this.$message.success('提交成功')
        this.refreshTable('page')
@@ -1110,15 +911,12 @@
        return this.$message.error('请输入原因')
      }
      this.loadingIssuedReason = true;
      this.$axios.post(this.$api.insReport.examineReport, {
      examineReport({
        id: this.currentInfo.id,
        isExamine: 0,
        examineTell: this.reason
      }).then(res => {
        this.loadingIssuedReason = false;
        if (res.code === 201) {
          return
        }
        this.$message.success('操作成功')
        this.refreshTable('page')
        this.currentInfo = null;
@@ -1136,15 +934,12 @@
        return this.$message.error('请输入原因')
      }
      this.loadingApproveReason = true
      this.$axios.post(this.$api.insReport.ratifyReport, {
      ratifyReport({
        id: this.currentInfo.id,
        isRatify: 0,
        examineTell: this.reason
      }).then(res => {
        this.loadingApproveReason = false
        if (res.code === 201) {
          return
        }
        this.$message.success('操作成功')
        this.refreshTable('page')
        this.currentInfo = null;
src/views/business/sample/components/detail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,197 @@
<template>
  <div style="width: 100%;height: 100%;overflow-y: auto;" class="detail">
    <div>
      <el-row class="title">
        <el-col :span="12" style="padding-left: 20px;text-align: left;">样品详情</el-col>
        <el-col :span="12" style="text-align: right;">
          <el-button size="small" @click="hanldeBack">返回</el-button>
        </el-col>
      </el-row>
    </div>
    <div class="search">
      <div class="search_thing">
        <div class="search_label">样品编号:</div>
        <div class="search_input">
          <el-input size="small" placeholder="请输入" clearable
                            v-model="entity.sampleCode" disabled></el-input>
        </div>
      </div>
      <div class="search_thing">
        <div class="search_label">样品名称:</div>
        <div class="search_input">
          <el-input size="small" placeholder="请输入" clearable
                            v-model="entity.sample" disabled></el-input>
        </div>
      </div>
      <div class="search_thing">
        <div class="search_label">样品数量:</div>
        <div class="search_input">
          <el-input size="small" placeholder="请输入" clearable
                            v-model="entity.num" disabled></el-input>
        </div>
      </div>
      <div class="search_thing">
        <div class="search_label">单位:</div>
        <div class="search_input">
          <el-input size="small" placeholder="请输入" clearable
                            v-model="entity.unit" disabled></el-input>
        </div>
      </div>
      <div class="search_thing">
        <div class="search_label">入库时间:</div>
        <div class="search_input">
          <el-input size="small" placeholder="请输入" clearable
                            v-model="entity.date" disabled></el-input>
        </div>
      </div>
      <div class="search_thing">
        <div class="search_label">入库人:</div>
        <div class="search_input">
          <el-input size="small" placeholder="请输入" clearable
                            v-model="entity.user" disabled></el-input>
        </div>
      </div>
      <div class="search_thing" >
        <div class="search_label">库位号:</div>
        <div class="search_input">
          <el-input size="small" placeholder="请输入" clearable
                            v-model="entity.code" disabled style="min-width: 230px;"></el-input>
        </div>
      </div>
    </div>
    <h4>检验项目</h4>
    <div class="table">
      <el-table class="el-table" ref="productTable" :data="products" height="380px" tooltip-effect="dark" border>
                <el-table-column type="index" align="center" label="序号" width="70" :key="Math.random()">
                </el-table-column>
                <el-table-column prop="inspectionItem" label="检验项" min-width="100"
                    show-overflow-tooltip></el-table-column>
                <el-table-column prop="inspectionItemSubclass" label="检验项分类" min-width="100" show-overflow-tooltip v-if="PROJECT=='装备电缆'"></el-table-column>
                <el-table-column prop="laboratory" label="实验室" min-min-width="100" show-overflow-tooltip></el-table-column>
                <el-table-column prop="unit" label="单位" min-width="100" show-overflow-tooltip></el-table-column>
                <el-table-column prop="equipValue" label="设备" min-width="100" show-overflow-tooltip>
          <template slot-scope="scope">
            {{handleData(scope.row.equipValue)}}
          </template>
        </el-table-column>
                <el-table-column prop="entrustCode" label="委托编号" min-width="100" show-overflow-tooltip></el-table-column>
                <el-table-column prop="updateUserName" label="检验人" min-width="100" show-overflow-tooltip></el-table-column>
                <el-table-column prop="updateTime" label="检验时间" min-width="100" show-overflow-tooltip></el-table-column>
                <el-table-column prop="insResult" label="结论" min-width="100">
                    <template slot-scope="scope">
            <el-tag
              :type="scope.row.insResult==1?'success':'danger'" size="medium">{{scope.row.insResult==1?'合格':'不合格'}}</el-tag>
                    </template>
                </el-table-column>
            </el-table>
    </div>
    <h4>出入库历史</h4>
    <div class="table" style="margin-bottom: 20px;">
      <el-table class="el-table" ref="productTable" :data="histories" height="380px" tooltip-effect="dark" border>
                <el-table-column type="index" align="center" label="序号" width="70" :key="Math.random()">
                </el-table-column>
                <el-table-column prop="state" label="类型"
                    show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag :type="scope.row.state==1?'success':'danger'">{{ scope.row.state==1?'入库':'出库' }}</el-tag>
          </template>
        </el-table-column>
                <el-table-column prop="createUserName" label="操作人"  show-overflow-tooltip></el-table-column>
                <el-table-column prop="createTime" label="操作时间"  show-overflow-tooltip></el-table-column>
                <el-table-column prop="warehouseCode" label="库位号" show-overflow-tooltip></el-table-column>
                <!-- <el-table-column prop="price" label="存放周期(h)" show-overflow-tooltip></el-table-column> -->
            </el-table>
    </div>
  </div>
</template>
<script>
export default {
  props:['id'],
  data(vm) {
      return{
        entity:{
          num:1,
        },
        products:[],
        histories:[]
      }
  },
  mounted(){
    this.getInfo()
  },
  methods:{
    hanldeBack(){
      this.$emit('hanldeBack')
    },
    getInfo(){
      this.$axios.post(this.$api.warehouse.getSampleRecord, {
        id: this.id
      }).then(res => {
        let {histories,insSample,sampleHistory,products} = res.data;
        this.entity = {num:1,...insSample,...sampleHistory};
        this.histories = histories;
        this.products = products;
      })
    },
    handleData(e){
      let info = ''
      if(e){
        info = JSON.parse(e).map(item => {
        return item.v;
      }).join(',')
      }
      return info
    }
  }
}
</script>
<style scoped>
    .detail::-webkit-scrollbar{
        width: 0;
    }
    .title {
        height: 60px;
        line-height: 60px;
    }
    .search {
        background-color: #fff;
        height: 120px;
        display: flex;
        align-items: center;
    flex-wrap: wrap;
    }
    .search_thing {
        display: flex;
        align-items: center;
        height: 40px;
    }
    .search_label {
        width: 120px;
        font-size: 14px;
        text-align: right;
    }
    .search_input {
        width: calc(100% - 120px);
    }
    .table {
        margin-top: 10px;
        background-color: #fff;
        width: calc(100% - 40px);
        padding: 20px;
    }
  h4{
    font-size: 16px;
    font-weight: normal;
    margin-top: 10px;
    margin-left: 20px;
  }
</style>
src/views/business/sample/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,704 @@
<template>
  <div class="capacity-scope">
    <div v-if="!isDetail">
      <div style="display: flex;justify-content: space-between">
        <el-form :model="entity" ref="entity" size="small" :inline="true">
          <el-form-item label="仓库名称" prop="warehouseId">
            <el-select v-model="entity.warehouseId" placeholder="选择仓库" size="small" @change="warehouseChange">
              <el-option v-for="item in warehouse" :key="item.id" :label="item.name" :value="item.id">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="货架" prop="shelfId">
            <el-select v-model="entity.shelfId" placeholder="选择货架" size="small" @change="handleShelf">
              <el-option v-for="item in shelf" :key="item.id" :label="item.name" :value="item.id">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="样品编号" prop="searchSampleCode">
            <el-input placeholder="请输入样品编号" v-model="searchSampleCode" size="small">
              <el-button slot="append" icon="el-icon-search" @click="handleSearch"></el-button>
            </el-input>
          </el-form-item>
          <el-form-item>
            <el-button size="small" style="color:#3A7BFA" @click="keepVisible=true">维护</el-button>
            <el-button size="small" style="color:#3A7BFA" @click="warehouseVisible=true,isEdit=false">添加仓库</el-button>
            <el-button size="small" style="color:#3A7BFA" @click="shelvesVisible=true,isEdit=false"
                       :disabled="entity.warehouseId==null">添加货架</el-button>
          </el-form-item>
        </el-form>
        <div>
          <el-button size="small" type="primary" @click="storageVisible=true">入库</el-button>
          <el-button size="small" type="primary" @click="exportVisible=true">出库</el-button>
        </div>
      </div>
      <div class="table" v-loading="tableLoading">
        <table border="1" class="tables" cellpadding="10" style="table-layout:fixed;" v-if="tableList.length>0">
          <tbody>
          <tr v-for="(item,index) in tableList" :key="index">
            <td v-for="(m,i) in item" :key="i" class="content">
              <h4 v-if="m.row!=undefined">{{ m.row }} - {{ m.col }}</h4>
              <ul>
                <el-tooltip
                  effect="dark"
                  placement="top"
                  v-for="(n,j) in m.samples"
                  :key="j" :disabled="`${n.sample}${n.model}`.length<10">
                  <div slot="content"><span>{{ n.sample }}</span>
                    <span>&nbsp;({{ n.model }})&nbsp;[{{ n.sampleCode }}]</span></div>
                  <li class="green"
                      @click="handelDetail(n)">
                    <i></i>
                    <span>{{ n.sample }}</span>
                    <span>&nbsp;({{ n.model }})&nbsp;[{{ n.sampleCode }}]</span>
                    <!-- <span class="num">&nbsp;x{{ n.num }}</span> -->
                  </li>
                </el-tooltip>
              </ul>
            </td>
          </tr>
          <tr>
            <td v-for="(item,index) in rowList" :key="index" style="background: ghostwhite;height: 20px;">{{ item }}
            </td>
          </tr>
          </tbody>
        </table>
        <span v-else style="color: rgb(144, 147, 153);display: inline-block;position: absolute;top: 60%;left: 50%;transform: translate(-50%,-50%);">暂无数据</span>
      </div>
    </div>
    <Detail v-else @hanldeBack="isDetail=false" :id="currentId" />
    <el-dialog title="样品入库" :visible.sync="storageVisible" width="350px">
      <el-row>
        <el-col class="search_thing" :span="24">
          <div class="search_label"><span class="required-span">* </span>样品编号:</div>
          <div class="search_input">
            <el-input v-model="sampleCode" size="small"></el-input>
          </div>
        </el-col>
      </el-row>
      <el-tree :data="storageList" ref="tree" :props="{ children: 'warehouseShelfList', label: 'name' }" node-key="id"
               :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen"
               @node-collapse="nodeClose" :default-expanded-keys="expandedKeys" v-if="storageVisible"
               empty-text="暂无数据">
        <div class="custom-tree-node" slot-scope="{ node, data }">
          <el-row>
            <el-col :span="24">
              <span><i
                :class="`node_i ${data.warehouseShelfList != undefined ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
                {{ data.name }}</span>
            </el-col>
          </el-row>
        </div>
      </el-tree>
      <span slot="footer" class="dialog-footer">
        <el-button @click="storageVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="confirmStorage" :loading="upLoadStorage">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <el-dialog title="样品出库" :visible.sync="exportVisible" width="350px">
      <!-- <div class="shaoma">
        <img src="../../../static/img/扫码.svg" alt="" style="margin-right: 5px;">
        <span>扫码出库</span>
      </div> -->
      <el-row>
        <el-col class="search_thing" :span="24">
          <div class="search_label"><span class="required-span">* </span>样品编号:</div>
          <div class="search_input">
            <el-input v-model="sampleCode" size="small"></el-input>
          </div>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="exportVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="confirmExport" :loading="upLoadExport">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <el-dialog title="库位维护" :visible.sync="keepVisible" width="350px" :append-to-body="true">
      <el-tree :data="warehouse" ref="tree" :props="{ children: 'warehouseShelfList', label: 'name' }" node-key="id"
               :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen"
               @node-collapse="nodeClose" :default-expanded-keys="expandedKeys" v-if="keepVisible"
               empty-text="暂无数据">
        <div class="custom-tree-node" style="width: 100%;" slot-scope="{ node, data }">
          <el-row style="width: 100%;display: flex;align-items: center;">
            <el-col :span="20">
              <span><i
                :class="`node_i ${node.level<2 ? 'el-icon-folder-opened': 'el-icon-tickets'}`"></i>
                {{ data.name }}</span>
            </el-col>
            <el-col :span="4" v-if="node.level<3">
              <el-button type="text" size="mini" icon="el-icon-edit" @click.stop="handleEdit(data,node.level)">
              </el-button>
              <el-button type="text" size="mini" icon="el-icon-delete" @click.stop="handleDelete(data,node.level)">
              </el-button>
            </el-col>
          </el-row>
        </div>
      </el-tree>
      <span slot="footer" class="dialog-footer">
        <el-button @click="keepVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="keepVisible = false" >ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <el-dialog :title="isEdit?'仓库修改':'仓库新增'" :visible.sync="warehouseVisible" width="350px">
      <el-row>
        <el-col class="search_thing" :span="24">
          <div class="search_label"><span class="required-span">* </span>仓库名称:</div>
          <div class="search_input">
            <el-input v-model="name" size="small" @keyup.enter.native="confirmWarehouse"></el-input>
          </div>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="warehouseVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="confirmWarehouse" :loading="upLoadWarehouse">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <el-dialog :title="isEdit?'货架修改':'货架新增'" :visible.sync="shelvesVisible" width="350px">
      <el-row>
        <el-col class="search_thing" :span="24">
          <div class="search_label"><span class="required-span">* </span>货架名称:</div>
          <div class="search_input">
            <el-input v-model="shelves.name" size="small"></el-input>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col class="search_thing" :span="24">
          <div class="search_label"><span class="required-span">* </span>货架层数:</div>
          <div class="search_input">
            <el-input v-model="shelves.row" size="small"></el-input>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col class="search_thing" :span="24">
          <div class="search_label"><span class="required-span">* </span>货架列数:</div>
          <div class="search_input">
            <el-input v-model="shelves.col" size="small"></el-input>
          </div>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="shelvesVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="confirmShelves" :loading="upLoadShelves">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import Detail from './components/detail.vue'
import {
  addShelf,
  addWarehouse, delShelf, delWarehouse, getWarehouse,
  inWarehouse,
  outWarehouse, searchSampleId,
  selectWarehouse,
  upShelf,
  upWarehouse
} from "@/api/business/sample";
export default {
  components: {
    Detail
  },
  data() {
    return {
      entity: {
        warehouseId: null,
        shelfId: null
      },
      warehouse: [],
      shelf: [],
      storageList:[],
      storageVisible: false,
      exportVisible: false,
      keepVisible: false,
      warehouseVisible: false,
      shelvesVisible: false,
      upLoadStorage: false,
      upLoadExport: false,
      upLoadWarehouse: false,
      upLoadShelves: false,
      tableList: [],
      rowList: [],
      value: '',
      name:'',
      shelves:{},
      selectTree: [],
      expandedKeys: [],
      isEdit: false, //弹框--是否是修改,默认为false
      isDetail: false, //详情--是否展示为详情页面,默认为false
      currentEdit:null,//当前要维护的信息
      tableLoading:false,
      sampleCode:'',
      currentId:null,
      searchSampleCode:''
    }
  },
  mounted() {
    this.selectList()
  },
  methods: {
    selectList() {
      selectWarehouse().then(res => {
        this.warehouse = res.data
        if(res.data.length==0){
          this.entity.warehouseId = '';
          this.entity.shelfId = '';
          this.tableList = []
        }
        this.storageList = this.HaveJson(res.data).map(item=>{
          item.warehouseShelfList&&item.warehouseShelfList.length>0&&item.warehouseShelfList.map(m=>{
            let warehouseShelfList = [];
            for (let i=1;i<m.row+1;i++){
              let warehouseShelfList0 = []
              for (let j=1;j<m.col+1;j++){
                warehouseShelfList0.push({
                  name:j+' åˆ—',
                  id:j,
                })
              }
              warehouseShelfList.push({
                name:i+' å±‚',
                id:i,
                warehouseShelfList:warehouseShelfList0
              })
            }
            m.warehouseShelfList = warehouseShelfList;
            return m;
          })
          return item;
        })
        if(!this.entity.warehouseId&&this.warehouse.length>0){
          this.entity.warehouseId = this.warehouse[0].id
          this.warehouseChange(this.entity.warehouseId)
          if(this.shelf.length>0){
            this.entity.shelfId = this.shelf[0].id
            this.handleShelf(this.entity.shelfId)
          }else{
            this.tableList = []
          }
        }else if(this.warehouse.length>0){
          this.warehouseChange(this.entity.warehouseId)
          if(this.shelf.length>0){
            this.entity.shelfId = this.shelf[0].id
            this.handleShelf(this.entity.shelfId)
          }else{
            this.tableList = []
          }
        }
      })
    },
    // å…¥åº“
    confirmStorage() {
      if (!this.sampleCode) {
        this.$message.error('请填写样品编号')
        return
      }
      if (this.selectTree.length < 4) {
        this.$message.error('请选择样品入库位置')
        return
      }
      this.upLoadStorage = true;
      inWarehouse({
        trees: this.selectTree.join('-'),
        sampleCode:this.sampleCode
      }).then(res => {
        this.upLoadStorage = false;
        this.storageVisible = false
        this.sampleCode = '';
        this.selectTree = []
        this.$message.success('入库成功')
        this.handleShelf(this.entity.shelfId)
      }).catch(err => {
        this.upLoadStorage = false;
      })
    },
    // å‡ºåº“
    confirmExport() {
      if (!this.sampleCode) {
        this.$message.error('请填写样品编号')
        return
      }
      this.upLoadExport = true;
      outWarehouse({
        sampleCode:this.sampleCode
      }).then(res => {
        this.upLoadExport = false;
        this.exportVisible = false
        this.sampleCode = '';
        this.$message.success('出库成功')
        this.handleShelf(this.entity.shelfId)
      }).catch(err => {
        this.upLoadExport = false;
      })
    },
    // æ·»åŠ /修改仓库
    confirmWarehouse() {
      if (!this.name) {
        this.$message.error('请填写仓库名称')
        return
      }
      this.upLoadWarehouse = true;
      if(this.currentEdit&&this.currentEdit.id){
        // ä¿®æ”¹ä»“库
        upWarehouse({
          name: this.name,
          id:this.currentEdit.id
        }).then(res => {
          this.upLoadWarehouse = false;
          this.warehouseVisible = false
          // this.keepVisible = false
          this.currentEdit = null;
          this.$message.success('修改成功')
          this.selectList()
          this.name = ''
          this.warehouseChange(this.entity.warehouseId)
        }).catch(err => {
          this.upLoadWarehouse = false;
        })
      }else{
        // æ–°å¢žä»“库
        addWarehouse({
          name: this.name
        }).then(res => {
          this.upLoadWarehouse = false;
          this.warehouseVisible = false
          this.$message.success('添加成功')
          this.selectList()
          this.name = ''
          this.warehouseChange(this.entity.warehouseId)
        }).catch(err => {
          this.upLoadWarehouse = false;
        })
      }
    },
    // æ·»åŠ /修改货架
    confirmShelves() {
      if (!this.shelves.name) {
        this.$message.error('请填写货架名称')
        return
      }
      if (!this.shelves.row) {
        this.$message.error('请填写货架层数')
        return
      }
      if (!this.shelves.col) {
        this.$message.error('请填写货架列数')
        return
      }
      this.upLoadShelves = true;
      if(this.currentEdit&&this.currentEdit.id){
        // ä¿®æ”¹
        upShelf({
          id:this.currentEdit.id,...this.shelves
        }).then(res => {
          this.upLoadShelves = false;
          this.shelvesVisible = false
          this.$message.success('修改成功')
          this.selectList()
          this.currentEdit ={};
        }).catch(err => {
          this.upLoadShelves = false;
        })
      }else{
        // æ–°å¢ž
        addShelf({
          warehouseId: this.entity.warehouseId,...this.shelves
        }).then(res => {
          this.upLoadShelves = false;
          this.shelvesVisible = false
          this.$message.success('添加成功')
          this.selectList()
          this.shelves = {}
        }).catch(err => {
          this.upLoadShelves = false;
        })
      }
      this.warehouseChange(this.entity.warehouseId)
    },
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    handleNodeClick(val, node, el) { //树的值
      this.selectTree[node.level-1] = val.id;
    },
    nodeOpen(data, node, el) {
      $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
      this.selectTree[node.level-1] = data.id;
    },
    nodeClose(data, node, el) {
      $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')
    },
    handleDelete(row, level) {
      this.$confirm('是否当前数据?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        if (level == 1) {
          // åˆ é™¤ä»“库
          delWarehouse({
            id: row.id
          }).then(res => {
            this.$message.success('成功')
            this.selectList()
          }).catch(e => {
            this.$message.error('失败')
          })
        }else{
          // åˆ é™¤è´§æž¶
          delShelf({
            id: row.id
          }).then(res => {
            this.$message.success('成功')
            this.selectList()
          }).catch(e => {
            this.$message.error('失败')
          })
        }
        this.warehouseChange(this.entity.warehouseId)
      }).catch(() => {})
    },
    handleEdit(data, level) {
      this.isEdit = true;
      // åˆ¤æ–­æ˜¯ç¬¬å‡ å±‚级,第一层级,修改仓库,第二层级修改货架
      if (level == 1) {
        this.warehouseVisible = true;
        this.currentEdit = data;
        this.name = data.name
      } else {
        this.shelvesVisible = true;
        this.currentEdit = data;
        this.shelves = {
          name:data.name,
          row:data.row,
          col:data.col,
          warehouseId:data.warehouseId
        }
      }
    },
    // æŸ¥çœ‹è¯¦æƒ…
    handelDetail(row) {
      this.currentId = row.id;
      this.isDetail = true;
    },
    warehouseChange(val) {
      this.tableList = []
      let map = this.warehouse.find(a => {
        return a.id === val ? a : null
      })
      this.shelf = map.warehouseShelfList;
      this.entity.shelfId = '';
    },
    handleShelf(e){
      if(e){
        this.tableLoading = true;
        getWarehouse({shelfId: e}).then(res => {
          this.tableLoading = false;
          let data = res.data;
          let set =new Set()
          this.tableList = [];
          let arr = []
          data.forEach(m=>{
            set.add(m.col)
            if(arr.length>0){
              if(arr.find(n=>n.row==m.row)){
                arr.push(m)
              }else{
                this.tableList.push(arr)
                arr = []
                arr.push(m)
              }
            }else{
              arr.push(m)
            }
          })
          this.tableList.push(arr)
          this.rowList = [];
          for(let i=0;i<set.size;i++){
            this.rowList.push(`${i+1} åˆ—`)
          }
        }).catch(e=>{
          this.tableLoading = false;
        })
      }
    },
    handleSearch(){
      if(!this.searchSampleCode){
        this.$message.error('请输入样品编号')
        return;
      }
      searchSampleId({sampleCode: this.searchSampleCode}).then(res => {
        if(res.code==200){
          this.currentId = res.data;
          this.isDetail = true;
        }
      })
    }
  }
}
</script>
<style scoped>
.title {
  height: 60px;
  line-height: 60px;
}
.search {
  background-color: #fff;
  height: 80px;
  display: flex;
  align-items: center;
  position: relative;
}
.search_thing {
  display: flex;
  align-items: center;
  height: 50px;
}
.search_label {
  width: 90px;
  font-size: 14px;
  text-align: right;
}
.search_input {
  width: calc(100% - 120px);
}
.table {
  margin-top: 10px;
  background-color: #fff;
  width: calc(100% - 40px);
  height: calc(100% - 60px - 80px - 10px - 40px);
  padding: 20px;
  overflow-y: auto;
}
.el-form-item {
  margin-bottom: 16px;
}
.btns {
  position: absolute;
  right: 10px;
  top: 25px;
  display: flex;
  align-items: center;
  z-index: 9;
}
.tables {
  width: 100%;
  height: 100%;
  border-bottom: none;
}
.tables th {
  font-size: 14px;
}
.tables td {
  font-size: 12px;
  text-align: center;
  vertical-align: top;
  border-color: rgb(192, 191, 191) !important;
  padding: 5px;
  box-sizing: border-box;
  height: 120px;
}
.tables ul {
  list-style-type: none;
}
.tables ul li {
  border-radius: 3px;
  padding: 4px 10px;
  box-sizing: border-box;
  margin-bottom: 5px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: start;
  color: #333333;
  cursor: pointer;
  overflow: hidden; /*超出部分隐藏*/
  white-space: nowrap; /*禁止换行*/
  text-overflow: ellipsis; /*省略号*/
}
.tables h4 {
  color: #999999;
  font-size: 14px;
  font-weight: 400;
  padding: 6px 0;
}
.tables i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
li:hover {
  background: rgba(58, 123, 250, 0.18);
}
li:hover i {
  background: #3A7BFA;
}
li:hover .num {
  color: #3A7BFA;
}
.green {
  background: #E0F6EA;
}
.green i {
  background: #34BD66;
}
.green .num {
  color: #34BD66;
}
.el-dialog {
  position: relative;
}
.shaoma {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #3A7BFA;
  position: absolute;
  top: 23px;
  right: 54px;
  cursor: pointer;
}
.node_i {
  color: orange;
  font-size: 18px;
}
.custom-tree-node .el-button {
  opacity: 0;
}
.custom-tree-node:hover .el-button {
  opacity: 1;
}
>>>.el-loading-mask {
  z-index: 10;
}
</style>
src/views/business/unpass/components/OAProcess.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,250 @@
<template>
  <div>
    <el-dialog :close-on-press-escape="false" :visible.sync="isShow" title="不合格处理"
               width="1040px"
               @close="$emit('closeOAProcess')">
      <table :border='true' class="table">
        <tr>
          <th class="th-title">1检验员</th>
          <th class="th-titleSec">处理结果</th>
          <th class="th-info1">{{oneOperation}}</th>
          <th class="th-titleSec">处理意见</th>
          <th class="th-info" colspan="3">{{oneInfo}}</th>
          <th style="display:none;"></th>
          <th style="display:none;"></th>
          <th >{{oneName}}<span v-if="oneName">:</span>{{oneTime}}</th>
        </tr>
        <tr>
          <th class="th-title">2检测主管确认</th>
          <th class="th-titleSec">处理结果</th>
          <th class="th-info1">{{twoOperation}}</th>
          <th class="th-titleSec">处理意见</th>
          <th class="th-info" colspan="3">{{twoInfo}}</th>
          <th style="display:none;"></th>
          <th style="display:none;"></th>
          <th >{{twoName}}<span v-if="twoName">:</span>{{twoTime}}</th>
        </tr>
        <tr>
          <th class="th-title">3物流部确认</th>
          <th class="th-titleSec">处理结果</th>
          <th class="th-info1">{{threeOperation}}</th>
          <th class="th-titleSec">处理意见</th>
          <th class="th-info" colspan="3">{{threeInfo}}</th>
          <th style="display:none;"></th>
          <th style="display:none;"></th>
          <th >{{threeName}}<span v-if="threeName">:</span>{{threeTime}}</th>
        </tr>
        <tr>
          <th class="th-title">4产品工程师处理意见</th>
          <th class="th-titleSec">处理结果</th>
          <th class="th-info1">{{fourOperation}}</th>
          <th class="th-titleSec">处理意见</th>
          <th class="th-info" colspan="3">{{fourInfo}}</th>
          <th style="display:none;"></th>
          <th style="display:none;"></th>
          <th >{{fourName}}<span v-if="fourName">:</span>{{fourTime}}</th>
        </tr>
        <tr>
          <th class="th-title">5.总工或者副经理的处理意见</th>
          <th class="th-titleSec">处理结果</th>
          <th class="th-info1">{{fiveOperation}}</th>
          <th class="th-titleSec">处理意见</th>
          <th class="th-info" colspan="3">{{fiveInfo}}</th>
          <th style="display:none;"></th>
          <th style="display:none;"></th>
          <th >{{fiveName}}<span v-if="fiveName">:</span>{{fiveTime}}</th>
        </tr>
        <tr>
          <th class="th-title">6质量部</th>
          <th class="th-titleSec">处理结果</th>
          <th class="th-info1">{{sixOperation}}</th>
          <th class="th-titleSec">处理意见</th>
          <th class="th-info" colspan="3">{{sixInfo}}</th>
          <th style="display:none;"></th>
          <th style="display:none;"></th>
          <th >{{sixName}}<span v-if="sixName">:</span>{{sixTime}}</th>
        </tr>
        <tr>
          <th class="th-title">7质量部经理</th>
          <th class="th-titleSec">处理结果</th>
          <th class="th-info1">{{sevenOperation}}</th>
          <th class="th-titleSec">处理意见</th>
          <th class="th-info" colspan="3">{{sevenInfo}}</th>
          <th style="display:none;"></th>
          <th style="display:none;"></th>
          <th >{{sevenName}}<span v-if="sevenName">:</span>{{sevenTime}}</th>
        </tr>
        <tr>
          <th class="th-title">8核算员</th>
          <th class="th-titleSec">处理结果</th>
          <th class="th-info1">{{eightOperation}}</th>
          <th class="th-titleSec">处理意见</th>
          <th class="th-info" colspan="3">{{eightInfo}}</th>
          <th style="display:none;"></th>
          <th style="display:none;"></th>
          <th >{{eightName}}<span v-if="eightName">:</span>{{eightTime}}</th>
        </tr>
        <tr>
          <th class="th-title">9物流部索赔结果</th>
          <th class="th-titleSec">处理结果</th>
          <th class="th-info1">{{nineOperation}}</th>
          <th class="th-titleSec">处理意见</th>
          <th class="th-info" colspan="3">{{nineInfo}}</th>
          <th style="display:none;"></th>
          <th style="display:none;"></th>
          <th >{{nineName}}<span v-if="nineName">:</span>{{nineTime}}</th>
        </tr>
      </table>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: "OAProcess",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  props: {
    OAProcess: {
      type: Boolean,
      default: () => false
    },
  },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      isShow: this.OAProcess,
      oneInfo: '',
      twoInfo: '',
      threeInfo: '',
      fourInfo: '',
      fiveInfo: '',
      sixInfo: '',
      sevenInfo: '',
      eightInfo: '',
      nineInfo: '',
      oneTime: '',
      twoTime: '',
      threeTime: '',
      fourTime: '',
      fiveTime: '',
      sixTime: '',
      sevenTime: '',
      eightTime: '',
      nineTime: '',
      oneName: '',
      twoName: '',
      threeName: '',
      fourName: '',
      fiveName: '',
      sixName: '',
      sevenName: '',
      eightName: '',
      nineName: '',
      oneOperation: '',
      twoOperation: '',
      threeOperation: '',
      fourOperation: '',
      fiveOperation: '',
      sixOperation: '',
      sevenOperation: '',
      eightOperation: '',
      nineOperation: '',
    }
  },
  // æ–¹æ³•集合
  methods: {
    getInfo (id) {
      this.$axios.post(this.$api.unqualifiedHandler.getOaFlow, {
        id: id
      }).then(res => {
        if (res.code === 200) {
          const data = res.data
          if (data.length > 0) {
            data.forEach(item => {
              if (item.nodeName === '1检验员') {
                this.oneInfo = item.approvalOpinion
                this.oneTime = item.approvalDate
                this.oneName = item.approver
                this.oneOperation = item.operation
              } else if (item.nodeName === '2检测主管确认') {
                this.twoInfo = item.approvalOpinion
                this.twoTime = item.approvalDate
                this.twoName = item.approver
                this.twoOperation = item.operation
              } else if (item.nodeName === '3物流部确认') {
                this.threeInfo = item.approvalOpinion
                this.threeTime = item.approvalDate
                this.threeName = item.approver
                this.threeOperation = item.operation
              } else if (item.nodeName === '4产品工程师处理意见') {
                this.fourInfo = item.approvalOpinion
                this.fourTime = item.approvalDate
                this.fourName = item.approver
                this.fourOperation = item.operation
              } else if (item.nodeName === '5.总工或者副经理的处理意见') {
                this.fiveInfo = item.approvalOpinion
                this.fiveTime = item.approvalDate
                this.fiveName = item.approver
                this.fiveOperation = item.operation
              } else if (item.nodeName === '6质量部') {
                this.sixInfo = item.approvalOpinion
                this.sixTime = item.approvalDate
                this.sixName = item.approver
                this.sixOperation = item.operation
              } else if (item.nodeName === '7质量部经理') {
                this.sevenInfo = item.approvalOpinion
                this.sevenTime = item.approvalDate
                this.sevenName = item.approver
                this.sevenOperation = item.operation
              } else if (item.nodeName === '8核算员') {
                this.eightInfo = item.approvalOpinion
                this.eightTime = item.approvalDate
                this.eightName = item.approver
                this.eightOperation = item.operation
              } else if (item.nodeName === '9物流部索赔结果') {
                this.nineInfo = item.approvalOpinion
                this.nineTime = item.approvalDate
                this.nineName = item.approver
                this.nineOperation = item.operation
              }
            })
          }
        }
      }).catch(err => {
        this.submitDeclareLoading = false
        console.log(err)
      })
    }
  },
}
</script>
<style scoped>
.table {
  width: 100%;
  height: 500px;
}
.th-title {
  width: 160px;
  text-align: left;
  background-color: #e0eaf5;
  font-size: 16px;
}
.th-titleSec {
  width: 70px;
  background-color: #e0eaf5;
  font-size: 16px;
}
.th-info {
  width: 210px;
  text-align: left;
  font-size: 16px;
}
.th-info1 {
  width: 100px;
  text-align: center;
  font-size: 16px;
}
</style>
src/views/business/unpass/index-manage.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,324 @@
<template>
  <div class="capacity-scope">
    <div class="search">
      <div>
        <el-form :model="entity" ref="entity" size="small" :inline="true">
          <el-form-item label="规格型号" prop="model">
            <el-input size="small" placeholder="请输入" clearable v-model="entity.model"
                      @keyup.enter.native="refreshTable()"></el-input>
          </el-form-item>
          <el-form-item label="样品名称" prop="sample">
            <el-input size="small" placeholder="请输入" clearable v-model="entity.sample"
                      @keyup.enter.native="refreshTable()"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">查 è¯¢</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="refresh">重 ç½®</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
    <div>
      <lims-table :tableData="tableData" :column="column"
                  :height="'calc(100vh - 250px)'" @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <el-dialog
      title="提交"
      :show-close="false"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
      :visible.sync="dialogVisible"
      width="30%">
      <span>是否确认提交OA?</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="submitOA" :loading="submitOALoading">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="删除"
      :show-close="false"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
      :visible.sync="deleteVisible"
      width="30%">
      <span>是否确认<span style="color: #FF4902">删除</span>OA?</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="deleteVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="cancelOA" :loading="cancelOALoading">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <UnPassDialog ref="unPassDialog" v-if="unPassDialog"
                  :orderId="orderId"
                  @resetForm="resetForm1"
                  :unPassDialog="unPassDialog"></UnPassDialog>
    <OAProcess ref="OAProcess"
               :OAProcess="OAProcess"
               @closeOAProcess="closeOAProcess"
               v-if="OAProcess"></OAProcess>
  </div>
</template>
<script>
import UnPassDialog from "./components/unPassDialog.vue";
import OAProcess from "./components/OAProcess.vue";
import limsTable from "@/components/Table/lims-table.vue";
import {deleteUnqualifiedHandler, page, pushOA} from "@/api/business/unqualifiedHandler";
import ValueTable from "@/components/Table/value-table.vue";
export default {
  components: {
    limsTable,
    OAProcess,
    UnPassDialog,
    ValueTable
  },
  data() {
    return {
      handlerId: null,
      entity: {
        sample: null,
        model: null,
      },
      tableData: [],
      tableLoading: false,
      column: [
        { label: '编号', prop: 'no' },
        {
          label: "OA审核状态",
          prop: "oaState",
          width: "100px",
          dataType: "tag",
          formatData: (params) => {
            if (params == 1) {
              return "待审核";
            } else if(params == 2) {
              return "审核中";
            }  else if(params == 3) {
              return "通过";
            } else {
              return "驳回";
            }
          },
          formatType: (params) => {
            if (params == 1) {
              return "warning";
            } else if(params == 2) {
              return "info";
            }  else if(params == 3) {
              return "success";
            } else {
              return "danger";
            }
          },
        },
        { label: '订单号', prop: 'orderNo' },
        {
          label: "零件号",
          prop: "partNo",
          width: "160px",
          dataType: "link",
          linkMethod: "openUnPassDialog",
        },
        { label: '零件描述', prop: 'partDesc' },
        { label: '物料名称', prop: 'materialName' },
        { label: '生产批次', prop: 'productionBatch' },
        { label: '到货数量', prop: 'cargoQuantity' },
        { label: '规格型号', prop: 'specsModels' },
        { label: '报检日期', prop: 'inspectTime' },
        { label: '状态', prop: 'statusDB' },
        { label: '反馈人', prop: 'feedbackUser' },
        { label: '要检验的采购数量', prop: 'qtyToInspect' },
        { label: '反馈日期', prop: 'feedbackTime' },
        {
          label: "分类",
          prop: "classification",
          width: "100px",
          dataType: "tag",
          formatData: (params) => {
            if (params == 0) {
              return "一类不合格";
            } else if(params == 1) {
              return "二类不合格";
            } else {
              return null
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return "warning";
            } else if(params == 1) {
              return "info";
            } else {
              return "null";
            }
          },
        },
        { label: '供应商名称', prop: 'supplierName' },
        {
          label: "不合格归属",
          prop: "offGradeAscription",
          width: "100px",
          dataType: "tag",
          formatData: (params) => {
            if (params == 0) {
              return "生产反馈不合格";
            } else if(params == 1) {
              return "检测不合格";
            } else {
              return null
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return "warning";
            } else if(params == 1) {
              return "info";
            } else {
              return "null";
            }
          },
        },
        { label: '不合格描述', prop: 'unqualifiedDesc' },
        {
          dataType: 'action',
          fixed: 'right',
          label: '操作',
          width: '180px',
          operation: [
            {
              name: '提交OA',
              type: 'text',
              clickFun: (row) => {
                this.openOA(row);
              },
              disabled: (row, index) => {
                return row.requestId !== null  // æœ‰requestId说明已经提交过OA,不可再次提交
              }
            },
            {
              name: '查看OA流程',
              type: 'text',
              clickFun: (row) => {
                this.OAView(row);
              },
            },
            {
              name: '删除',
              type: 'text',
              clickFun: (row) => {
                this.deleteOA(row);
              },
              disabled: (row, index) => {
                return row.requestId !== null  // æœ‰requestId说明已经提交过OA,不可再次提交
              }
            },
          ]
        }
      ],
      page: {
        total: 0,
        size: 10,
        current: 1
      },
      statusList: [],
      dialogVisible: false, // ç¡®è®¤æäº¤OA弹框
      unPassDialog: false, // ä¸åˆæ ¼å¤„理弹框
      orderId: '',
      OAProcess: false, // OA流程弹框
      submitOALoading: false, // OA流程弹框提交按钮loading
      deleteVisible: false, // OA流程删除弹框
      cancelOALoading: false, // OA流程删除弹框提交按钮loading
    };
  },
  mounted() {
    this.refreshTable()
  },
  methods: {
    refreshTable() {
      this.tableLoading = true
      page({ ...this.page, ...this.entity }).then(res => {
        this.tableLoading = false
        this.tableData = res.data.records
        this.page.total = res.data.total
      }).catch(err => {
        this.tableLoading = false
      })
    },
    // é‡ç½®
    refresh() {
      this.resetForm('entity')
      this.refreshTable()
    },
    // åˆ†é¡µåˆ‡æ¢
    pagination(page) {
      this.page.size = page.limit
      this.refreshTable()
    },
    // æ‰“开不合格处理弹框
    openUnPassDialog (row) {
      this.unPassDialog = true
      this.$nextTick(() => {
        this.$refs.unPassDialog.getInsOrder('view', row)
      })
    },
    // å…³é—­ä¸åˆæ ¼å¤„理弹框
    resetForm1 () {
      this.$refs.unPassDialog.$refs['unPassForm'].resetFields();
      this.unPassDialog = false
    },
    // æ‰“开删除OA确认弹框
    deleteOA (row) {
      this.handlerId = row.handlerId
      this.deleteVisible = true
    },
    // æäº¤åˆ é™¤ç”³è¯·
    cancelOA () {
      this.de = true
      deleteUnqualifiedHandler({id: this.handlerId,}).then(res => {
        this.cancelOALoading = false
        if (res.code === 200) {
          this.deleteVisible = false
          this.$message.success('删除成功')
          this.refreshTable('page')
        }
      }).catch(error => {
        this.cancelOALoading = false
        console.error(error);
      });
    },
    // æŸ¥çœ‹æäº¤OA的数据
    openOA (row) {
      this.handlerId = row.handlerId
      this.dialogVisible = true
    },
    // æŸ¥çœ‹OA流程
    OAView (row) {
      this.OAProcess = true
      this.$nextTick(() => {
        this.$refs.OAProcess.getInfo(row.handlerId)
      })
    },
    // å…³é—­æŸ¥çœ‹OA流程的弹框
    closeOAProcess () {
      this.OAProcess = false
    },
    //提交OA
    submitOA(row) {
      // æäº¤OA
      this.submitOALoading = true
      pushOA({handlerId: this.handlerId,}).then(res => {
        this.submitOALoading = false
        if (res.code === 200) {
          this.dialogVisible = false
          this.$message.success('提交成功')
          this.refreshTable('page')
        }
      }).catch(error => {
        this.submitOALoading = false
        console.error(error);
      });
    }
  }
};
</script>
src/views/business/unpass/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,135 @@
<template>
  <div class="capacity-scope">
    <div class="search">
      <div>
        <el-form :model="entity" ref="entity" size="small" :inline="true">
          <el-form-item label="规格型号" prop="model">
            <el-input size="small" placeholder="请输入" clearable v-model="entity.model"
                      @keyup.enter.native="refreshTable()"></el-input>
          </el-form-item>
          <el-form-item label="样品名称" prop="sample">
            <el-input size="small" placeholder="请输入" clearable v-model="entity.sample"
                      @keyup.enter.native="refreshTable()"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">查 è¯¢</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="refresh">重 ç½®</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
    <div>
      <lims-table :tableData="tableData" :column="column"
                  :height="'calc(100vh - 250px)'" @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import {pageInsUnPass} from "@/api/business/unpass";
export default {
  components: {limsTable},
  data() {
    return {
      entity: {
        sample: null,
        model: null,
      },
      tableData: [],
      tableLoading: false,
      column: [
        { label: '编号', prop: 'no' },
        {
          label: "OA审核状态",
          prop: "oaState",
          width: "100px",
          dataType: "tag",
          formatData: (params) => {
            if (params == 0) {
              return "否";
            } else {
              return "是";
            }
          },
          formatType: (params) => {
            if (params == 0) {
              return "danger";
            } else {
              return "primary";
            }
          },
        },
        {
          dataType: 'action',
          fixed: 'right',
          label: '操作',
          width: '180px',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openAdd('edit', row);
              },
            },
            {
              name: '删除',
              type: 'text',
              clickFun: (row) => {
                this.delete(row);
              },
            },
            {
              name: '印章管理',
              type: 'text',
              clickFun: (row) => {
                this.fileManagement(row);
              },
            },
          ]
        }
      ],
      page: {
        total: 0,
        size: 10,
        current: 1
      },
    }
  },
  mounted() {
    this.refreshTable()
  },
  methods :{
    refreshTable() {
      this.tableLoading = true
      pageInsUnPass({ ...this.page, ...this.entity }).then(res => {
        this.tableLoading = false
        this.tableData = res.data.records
        this.page.total = res.data.total
      }).catch(err => {
        this.tableLoading = false
      })
    },
    // é‡ç½®
    refresh() {
      this.resetForm('entity')
      this.refreshTable()
    },
    // åˆ†é¡µåˆ‡æ¢
    pagination(page) {
      this.page.size = page.limit
      this.refreshTable()
    },
  }
}
</script>
<style scoped>
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
</style>
src/views/structural/premises/index.vue
@@ -22,8 +22,9 @@
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="column" :height="'calc(100vh - 250px)'" @pagination="pagination"
        :page="page" :tableLoading="tableLoading"></lims-table>
      <lims-table :tableData="tableData" :column="column"
                  :height="'calc(100vh - 250px)'" @pagination="pagination"
                  :page="page" :tableLoading="tableLoading"></lims-table>
    </div>
    <!--    æ–°å¢žå®žéªŒå®¤-->
    <el-dialog :title="formTitle" :visible.sync="addDia" width="450px">