spring
2025-02-26 904710d226d8dd5253937cbd572ca208be804ea5
Merge branch 'dev' of http://114.132.189.42:9002/r/lims-ruoyi-before into dev
已修改6个文件
已删除2个文件
已添加5个文件
2440 ■■■■■ 文件已修改
src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/demand/demand.js 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/externalService/serviceAndSupplyPro/component/CardPanel.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/externalService/serviceAndSupplyPro/component/index.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/externalService/serviceAndSupplyPro/index.vue 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/AddContracts.vue 465 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/Edit.vue 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/index.vue 878 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue 393 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
import request from '@/utils/request'
// æœåŠ¡å’Œä¾›åº”å“é‡‡è´­
export function procurementSuppliesList(query) {
  return request({
    url: '/procurementSuppliesList/procurementSuppliesList',
    method: 'get',
    params: query
  })
}
src/api/cnas/process/demand/demand.js
@@ -6,55 +6,67 @@
import request from "@/utils/request";
// å§”托单检验分页查询
export const getInspectionOrder = (params) => {
    return request({
        url: "/inspectionOrder/pageInspectionOrder",
        method: "get",
        params: params
    })
export function pageInspectionOrder(query) {
  return request({
    url: '/inspectionOrder/pageInspectionOrder',
    method: 'get',
    params: query
  })
}
// å§”托单查询成品订单
export function getInsOrderOnInspection(query) {
  return request({
    url: '/inspectionOrder/getInsOrderOnInspection',
    method: 'get',
    params: query
  })
}
// å§”托单检验新增
export function addInspectionOrder(query) {
  return request({
    url: '/inspectionOrder/addInspectionOrder',
    method: 'post',
    data: query
  })
}
// å§”托单检验修改
export function updateInspectionOrder(query) {
  return request({
    url: '/inspectionOrder/updateInspectionOrder',
    method: 'post',
    data: query
  })
}
// æ–°å¢žæ—¶æ ¹æ®æˆå“è®¢å•查询委托单详情
export const getInspectionOrderByInsOderId = (params) => {
    return request({
        url: "/inspectionOrder/getInspectionOrderByInsOderId",
        method: "get",
        params: params
    })
export function getInspectionOrderByInsOderId(query) {
  return request({
    url: '/inspectionOrder/getInspectionOrderByInsOderId',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢å¯æ–°å¢žçš„æ£€éªŒå•
export const getInsOrderOnInspection = (data) => {
    return request({
        url: "/inspectionOrder/getInsOrderOnInspection",
        method: "post",
        data: data
    })
// å§”托单检验查看详情
export function getInspectionOrderOne(query) {
  return request({
    url: '/inspectionOrder/getInspectionOrderOne',
    method: 'get',
    params: query
  })
}
// æŸ¥çœ‹å§”托单详情
export const getInspectionOrderOne = (params) => {
    return request({
        url: "/inspectionOrder/getInspectionOrderOne",
        method: "get",
        params: params
    })
// å§”托单检验删除
export function delInspectionOrder(query) {
  return request({
    url: '/inspectionOrder/delInspectionOrder',
    method: 'get',
    params: query
  })
}
// æ–°å¢žæ£€éªŒå•
export const addInspectionOrder = (data) => {
    return request({
        url: "/inspectionOrder/addInspectionOrder",
        method: "post",
        data: data
    })
// å§”托单检验删除
export function exportInspectionOrder(query) {
  return request({
    url: '/inspectionOrder/exportInspectionOrder',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
// ç¼–辑检验单
export const editInspectionOrder = (data) => {
    return request({
        url: "/inspectionOrder/editInspectionOrder",
        method: "post",
        data: data
    })
}
src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js
@@ -24,6 +24,18 @@
  })
}
/**
 * @desc æ ‡å‡†ç‰©è´¨æ¸…单
 */
export function getStandardSubstanceAll(query) {
  return request({
    url: '/feStandardSubstance/getStandardSubstanceAll',
    method: 'get',
    params: query
  })
}
src/views/CNAS/externalService/serviceAndSupplyPro/component/CardPanel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,74 @@
<template>
    <div class="card-container" @click="handleCard">
        <div class="card-panel" :class="[isActive == index ? 'isActive' : '']">
            <el-image
                style="width: 80%; height: 140px"
                :src="javaApi + '/img/' + data.logo"
                fit="fill"
            />
        </div>
        <div class="title">
            {{ data.supplierRef }}
        </div>
    </div>
</template>
<script>
export default {
    props: {
        data: {
            type: Object,
            default: () => {}
        },
        index: {
            type: Number,
            default: -1
        },
        isActive: {
            type: Number,
            default: -1
        }
    },
    data(){
        return {
        }
    },
    mounted() {
      // console.log(1111,this.data)
    },
    methods: {
        handleCard() {
            this.$emit('handleCard', this.data, this.index)
        }
    }
}
</script>
<style scoped>
.card-container  {
    margin: 10px 10px 10px 0;
    text-align: center;
}
.card-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    height: 180px;
    box-shadow: 0px 0px 20px 0px #0000001A;
    cursor: pointer;
    border-radius: 5px;
    border: 1px solid transparent;
}
.card-panel:hover {
    border: 1px solid #409EFF;
    background: #1D56C50D;
}
.isActive {
    border: 1px solid #409EFF;
    background: #1D56C50D;
}
.title {
    margin-top: 15px;
}
</style>
src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,121 @@
<template>
    <div>
        <el-row class="card-box">
            <el-col :span="4" v-for="(item, index) in cardList" :key="index">
                <CardPanel
                    :isActive="isActive"
                    :data="item"
                    :index="index"
                    @handleCard="handleCard"
                />
            </el-col>
            <el-col :span="24" v-if="cardList.length==0" style="color: #909399;font-size: 14px;text-align: center;margin-top: 20px;">暂无数据</el-col>
        </el-row>
        <TableCard title="耗材信息" :showForm="false" style="margin-top: 5px">
            <template v-slot:table>
                <limsTable
                    style="margin-top: 18px; padding: 0 15px;"
                    :height="'20vh'"
                    :column="columns"
                    :table-data="tableData"
                >
                </limsTable>
            </template>
        </TableCard>
    </div>
</template>
<script>
import CardPanel from './CardPanel.vue';
import TableCard from './index.vue';
import { procurementSuppliesList } from "@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro"
import limsTable from '@/components/Table/lims-table.vue'
import axios from "axios";
export default {
    components: { CardPanel, TableCard, limsTable },
    props: {
        contentsId: {
            type: Number,
            default: 0
        }
    },
    data() {
        return {
            isActive: -1,
            columns: [
                {
                    label: "耗材编号",
                    prop: "itemNumber"
                },
                {
                    label: "耗材名称",
                    prop: "consumablesName"
                },
                {
                    label: "耗材类型",
                    prop: "consumablesType"
                },
                {
                    label: "规格",
                      prop: "specifications"
                },
                {
                    label: "单位",
                    prop: "unit"
                },
                {
                    label: "单价",
                    prop: "referencePrice"
                },
                {
                    label: "当前库存",
                    prop: "currentAmount"
                },
                {
                    label: "负责人",
                    prop: "personInChargeName"
                },
                {
                    label: "上次更新时间",
                    prop: "updateTime"
                }
            ],
            cardList: [],
            tableData: []
        }
    },
    watch: {
        contentsId(newVal, oldVal) {
            this.getTableData(newVal)
        }
    },
    mounted() {
        this.getTableData(this.contentsId)
    },
    methods: {
        handleCard(data, index) {
            this.isActive = index
            this.tableData = [data]
        },
        async getTableData(id) {
          procurementSuppliesList({contentsId: id}).then(res => {
            if(res.code == 200) {
              this.cardList = res.data.records.map(m=>{
                m.logo = m.consumablesIcon
                return m
              })
            }
          })
        }
    }
}
</script>
<style scoped>
.card-box {
    width: 100%;
    padding-left: 5px;
    padding-right: 5px;
    height: 30vh;
    overflow-y: auto;
}
</style>
src/views/CNAS/externalService/serviceAndSupplyPro/component/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
<template>
  <div class="table_card">
    <div v-if="showTitle" class="title">
      <span style="font-weight: bold">{{ title }}</span>
    </div>
    <div>
      <slot name="tab"></slot>
    </div>
    <div v-if="showForm" class="table_card_form">
      <slot name="form"></slot>
    </div>
    <div>
      <slot name="table"></slot>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    title: {
      type: String,
      default: '标题'
    },
    showTitle: {
      type: Boolean,
      default: true
    },
    showForm: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {};
  }
};
</script>
<style scoped>
.table_card {
  text-align: left;
}
.title {
  position: relative;
  font-size: 18px;
  color: #333;
  font-weight: 400;
  padding-left: 10px;
  margin-left: 15px;
}
.title::before {
  position: absolute;
  left: 0;
  top: 4px;
  content: '';
  width: 4px;
  height: 18px;
  background-color: #3A7BFA;
  border-radius: 2px;
}
.table_card_form {
  display: flex;
  justify-content: space-between;
  height: 34px;
  padding: 0 15px;
  margin-bottom: 10px;
}
</style>
src/views/CNAS/externalService/serviceAndSupplyPro/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,178 @@
<template>
  <div class="purchase-page">
    <div class="purchase-left">
      <el-input
        v-model="form.nodeName"
        placeholder="请输入节点名称"
        suffix-icon="el-icon-search"
        size="small"
        clearable
        @keyup.enter.native="searchFilter(treeData)"
        @blur="searchFilter(treeData)"
        @clear="searchFilter(treeData)"
      >
      </el-input>
      <el-tree
        ref="tree"
        :data="treeData"
        :props="defaultProps"
        @node-click="handleNodeClick"
        :default-expanded-keys="expandedKeys"
        node-key="id"
      >
      </el-tree>
    </div>
    <div class="purchase-right">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="耗材总览" name="first" :lazy="true">
          <ConsumableOverview v-if="activeName == 'first'" :contentsId="contentsId"></ConsumableOverview>
        </el-tab-pane>
<!--        <el-tab-pane label="耗材列表" name="second" :lazy="true">-->
<!--          <ConsumableList v-if="activeName == 'second'" :contentsId="contentsId"></ConsumableList>-->
<!--        </el-tab-pane>-->
<!--        <el-tab-pane label="耗材入库" name="third" :lazy="true">-->
<!--          <Store v-if="activeName == 'third'" :contentsId="contentsId"></Store>-->
<!--        </el-tab-pane>-->
<!--        <el-tab-pane label="目录维护" name="fourth" :lazy="true">-->
<!--          <Contents-->
<!--            v-if="activeName == 'fourth'"-->
<!--            :id="contentsId"-->
<!--            @contentsUpdate="contentsUpdate"-->
<!--            :treeData="treeData"-->
<!--            from="耗材树"-->
<!--          ></Contents>-->
<!--        </el-tab-pane>-->
      </el-tabs>
    </div>
  </div>
</template>
<script>
// import Contents from "@/components/do/a6.service-and-supply-purchase/contents.vue";
// import Store from "@/components/do/a6.service-and-supply-purchase/store.vue";
import ConsumableOverview from "../serviceAndSupplyPro/component/ConsumableOverview.vue";
// import ConsumableList from "@/components/do/a6.service-and-supply-purchase/ConsumableList.vue"
export default {
  data() {
    return {
      tabsKey: 0,
      contentsId: 0,
      activeName: "first",
      form: {
        nodeName: "",
      },
      treeData: [],
      expandedKeys: [],
      defaultProps: {
        children: "children",
        label: "nodeName",
      },
    };
  },
  components: {
    // Contents,
    // Store,
    ConsumableOverview
    // ConsumableList
  },
  watch: {
    contentsId(newVal, oldVal) {
      if(newVal != oldVal) {
        this.tabsKey = Math.random();
      }
    }
  },
  methods: {
    searchFilter() {
      this.treeData = JSON.parse(JSON.stringify(this.treeData));
      this.expandedKeys = [];
      if(this.form.nodeName == "") {
        return;
      }
      const findNodesWithFiber = (nodes) => {
        nodes.forEach((node) => {
          if (node.nodeName && node.nodeName.includes(this.form.nodeName)) {
            this.expandedKeys.push(node.id);
          }
          if (node.children && node.children.length > 0) {
            findNodesWithFiber(node.children);
          }
        });
      };
      findNodesWithFiber(this.treeData);
    },
    // ç›®å½•维护更新
    contentsUpdate(val, flag = false) {
      if (val) {
        this.getTreeData();
        this.expandedKeys = [];
        if (flag) {
          const findNodesWithFiber = (nodes) => {
            nodes.forEach((item) => {
              if (item.parentId == val) {
                this.expandedKeys.push(item.id);
              }
              if(item.children && item.children.length > 0) {
                findNodesWithFiber(item.children);
              }
            });
          };
          findNodesWithFiber(this.treeData);
          this.expandedKeys = this.expandedKeys.filter((item) => item !== val);
        } else {
          this.expandedKeys.push(val);
        }
      }else {
        this.getTreeData();
      }
    },
    // æŸ¥è¯¢æ‰€æœ‰ç›®å½•
    getTreeData() {
      this.$axios
        .get(this.$api.procurementSuppliesContents.directoryListing)
        .then((res) => {
          this.treeData = res.data;
        });
    },
    // ç‚¹å‡»æ ‘节点
    handleNodeClick(data) {
      this.contentsId = data.id;
    },
    handleClick(tab, event) {
      console.log(tab, event);
    },
  },
  created() {
    this.getTreeData();
  },
};
</script>
<style scoped>
.purchase-left {
  width: 250px;
  height: 100%;
  background: #fff;
  margin-right: 10px;
  border-radius: 16px;
  box-sizing: border-box;
  padding: 10px 16px;
  flex-shrink: 0;
}
.purchase-right {
  background: #fff;
  width: calc(100% - 15em);
  height: 100%;
  border-radius: 16px;
  box-sizing: border-box;
  padding: 10px 16px;
}
.purchase-page {
  display: flex;
  padding-top: 10px;
  padding-bottom: 10px;
  box-sizing: border-box;
  width: 100%;
}
</style>
src/views/CNAS/process/demand/AddContracts.vue
ÎļþÒÑɾ³ý
src/views/CNAS/process/demand/Edit.vue
ÎļþÒÑɾ³ý
src/views/CNAS/process/demand/index.vue
@@ -1,163 +1,737 @@
<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('add')">
                æ–° å¢ž
            </el-button>
        </div>
        <lims-table
            :column="column"
            :tableData="tableData"
            :height="'calc(100vh - 250px)'"
            :page="page"
        />
        <Edit ref="editRef" />
  <div class="app-container">
    <div style="display: flex;justify-content: space-between;">
      <el-form :model="entitySearch" ref="entitySearch" size="small" :inline="true">
        <el-form-item label="试样名称" prop="sampleName">
          <el-input size="small" placeholder="请输入" clearable v-model="entitySearch.sampleName"
                    @keyup.enter.native="refreshTable"></el-input>
        </el-form-item>
        <el-form-item label="委托单位" prop="commissionUnit">
          <el-input v-model="entitySearch.commissionUnit" clearable placeholder="请输入" size="small"
                    @keyup.enter.native="refreshTable()"></el-input>
        </el-form-item>
        <el-form-item label="生产单位" prop="production">
          <el-input v-model="entitySearch.production" clearable placeholder="请输入" size="small"
                    @keyup.enter.native="refreshTable()"></el-input>
        </el-form-item>
        <el-form-item label="委托人" prop="commissionUser">
          <el-input v-model="entitySearch.commissionUser" clearable placeholder="请输入" size="small"
                    @keyup.enter.native="refreshTable()"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button icon="el-icon-refresh" size="mini" @click="refresh">重 ç½®</el-button>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">查 è¯¢</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div style="text-align: right; margin-bottom: 20px">
      <el-button size="medium" type="primary" @click="goAdd">新增</el-button>
    </div>
    <div class="table">
      <el-table v-loading="tableListLoading" :data="tableList" height="530" style="width: 100%">
        <el-table-column align="center" label="序号" type="index" width="60"></el-table-column>
        <el-table-column label="试样名称" prop="sampleName" show-overflow-tooltip width="120"></el-table-column>
        <el-table-column label="委托编号" prop="entrustCode" show-overflow-tooltip width="120"></el-table-column>
        <el-table-column label="委托时间" prop="commissionDate" width="120"></el-table-column>
        <el-table-column label="型号" prop="modelNo"></el-table-column>
        <el-table-column label="委托单位" prop="commissionUnit" show-overflow-tooltip width="120"></el-table-column>
        <el-table-column label="生产单位" prop="production" show-overflow-tooltip width="120"></el-table-column>
        <el-table-column label="委托人" prop="commissionUser"></el-table-column>
        <el-table-column label="样品数量" prop="quantity"></el-table-column>
        <el-table-column label="样品状态" prop="sampleStatus"></el-table-column>
        <el-table-column label="是否留样" prop="isLeave">
          <template slot-scope="scope">
            <span v-if="scope.row.isLeave === 1">是</span>
            <span v-if="scope.row.isLeave === 0">否</span>
          </template>
        </el-table-column>
        <el-table-column label="样品处理方式" prop="processing">
          <template slot-scope="scope">
            <span v-if="scope.row.processing === 1">实验室处理</span>
            <span v-if="scope.row.processing === 0">委托单位取回</span>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作" width="240" fixed="right">
          <template slot-scope="scope">
            <el-button size="mini" type="text" @click="goUpdate(scope.row)">编辑</el-button>
            <el-button size="mini" type="text" @click="handleLook(scope.row)">查看</el-button>
            <el-button size="mini" style="color:#F56C6C" type="text" @click="deleteOrder(scope.row)">删除</el-button>
            <el-button size="mini" type="text" @click="openDownloadDia(scope.row)">下载</el-button>
            <el-upload ref='upload'
                       :action="action"
                       :data="{inspectionOrderId: scope.row.inspectionOrderId}" :headers="uploadHeader"
                       :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false" accept='image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx,.xlsx'
                       name="file" style="background: transparent;display: inline;margin-left: 4px">
              <span style="color: #409EFF">上传</span>
            </el-upload>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination :current-page="1" :page-size="pages.size" :page-sizes="[10, 20, 30, 50, 100]"
                     :total="total1" layout="->,total, sizes, prev, pager, next"
                     style="margin-top: 10px" background
                     @size-change="handleSizeChange1" @current-change="handleCurrentChange1">
      </el-pagination>
    </div>
    <el-dialog
      :close-on-click-modal="false" :close-on-press-escape="false"
      :visible.sync="orderRowsVisible" title="新增检验任务单" width="1000px">
      <div style="display: flex; align-items: center;margin-bottom: 10px">
        <span style="width: 80px">委托编号:</span>
        <el-input v-model="entity.entrustCode" clearable size="small" style="width: 300px;margin-right: 10px"></el-input>
        <el-button size="small" type="primary" @click="searchTableData">查询</el-button>
        <el-button size="small" @click="refreshTableData">重 ç½®</el-button>
      </div>
      <el-table v-loading="tableLoading" :data="tableData" height="550" style="width: 100%">
        <el-table-column align="center" label="序号" type="index" width="60"></el-table-column>
        <el-table-column label="委托编号" prop="entrustCode"></el-table-column>
        <el-table-column label="样品名称" prop="sample"></el-table-column>
        <el-table-column align="center" label="操作">
          <template slot-scope="scope">
            <el-button align="center" size="mini" type="text" @click="goAddOrder(scope.row)">新增委托单</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination :current-page="1" :page-size="tableSearch.size" :page-sizes="[10, 20, 30, 50, 100]"
                     :total="total" layout="->,total, sizes, prev, pager, next"
                     style="margin-top: 10px" background
                     @size-change="handleSizeChange" @current-change="handleCurrentChange">
      </el-pagination>
    </el-dialog>
    <el-dialog
      :class="{downPdf:title=='下载'}" :close-on-click-modal="false"
      :close-on-press-escape="false"
      :modal="title!='下载'" :title="title" :visible.sync="detailDialogVisible" top="20px" width="1200px">
      <div style="max-height: 75vh;overflow-y: auto;">
        <div id="dialogBody">
          <table border="1" cellpadding="10" class="tables heads" style="border: 1px dashed black;">
            <tr>
              <td rowspan="2">
                <img alt="" src="@/assets/logo/ZTTlogo.png" 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 style="display: flex;align-items: center;flex-direction: column;justify-content: center;">
            <span style="font-size: 28px;">检 éªŒ å§” æ‰˜ å•</span>
          </h4>
          <p v-if="operationType !== 'view'" style="margin-left: 560px;display: flex;align-items: center">
            <span style="width: 100px">委托编号:</span>
            <el-input v-model="currentInfo.entrustCode" clearable size="small"></el-input>
          </p>
          <p v-if="operationType === 'view'"  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 v-if="operationType !== 'view'"><el-input v-model="currentInfo.sampleName" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ currentInfo.sampleName }}</td>
              <td>
                <p>委托时间</p>
              </td>
              <td v-if="operationType !== 'view'">
                <el-date-picker
                  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>
              </td>
              <td v-if="operationType === 'view'">{{ currentInfo.commissionDate }}</td>
            </tr>
            <tr>
              <td colspan="2">
                <p>型 å·</p>
              </td>
              <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.modelNo" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ currentInfo.modelNo }}</td>
              <td>
                <p>委托单位</p>
              </td>
              <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUnit" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ currentInfo.commissionUnit }}</td>
            </tr>
            <tr>
              <td colspan="2">
                <p>生产单位</p>
              </td>
              <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.production" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ currentInfo.production }}</td>
              <td>
                <p>委托人</p>
              </td>
              <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUser" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ currentInfo.commissionUser }}</td>
            </tr>
            <tr>
              <td colspan="2">
                <p>样品数量</p>
              </td>
              <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.quantity" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ currentInfo.quantity }}</td>
              <td>
                <p>样品状态</p>
              </td>
              <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.sampleStatus" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ insStateList.find(m=>m.value==currentInfo.sampleStatus)?insStateList.find(m=>m.value==currentInfo.sampleStatus).label:'/' }}</td>
            </tr>
            <tr>
              <td colspan="2">
                <p>是否留样</p>
              </td>
              <td v-if="operationType !== 'view'">
                <el-radio-group v-model="currentInfo.isLeave" v-removeAriaHidden>
                  <el-radio :label="1">是</el-radio>
                  <el-radio :label="0">否</el-radio>
                </el-radio-group>
              </td>
              <td v-if="operationType === 'view'">
                <span v-if="currentInfo.isLeave==1">是</span>
                <span v-else>否</span>
              </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-if="operationType === 'view'">
                <span v-if="currentInfo.processing==0">委托单位取回</span>
                <span v-else>实验室处理</span>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <p>约定完成时间(报告日期)</p>
              </td>
              <td v-if="operationType !== 'view'">
                <el-date-picker
                  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>
              </td>
              <td v-if="operationType === 'view'">{{ currentInfo.appointed }}</td>
              <td>
                <p>报告发送方式</p>
              </td>
              <td v-if="operationType !== 'view'">
                <el-radio-group v-model="currentInfo.send" v-removeAriaHidden>
                  <el-radio :label="1">自取</el-radio>
                  <el-radio :label="0">其他</el-radio>
                </el-radio-group>
              </td>
              <td v-if="operationType === 'view'">
                <span v-if="currentInfo.send==1">自取</span>
                <span v-else>其他</span>
              </td>
            </tr>
            <el-button size="small" type="primary" @click="addOrderDetailList" v-if="operationType !== 'view'">添加</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 v-if="operationType !== 'view'"><el-input v-model="item.sampleNumber" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ item.sampleNumber }}</td>
              <td v-if="operationType !== 'view'"><el-input v-model="item.testItem" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ item.testItem }}</td>
              <td v-if="operationType !== 'view'"><el-input v-model="item.testStandard" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ item.testStandard }}</td>
              <td v-if="operationType !== 'view'"><el-input v-model="item.remark" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ item.remark }}</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-if="operationType === 'view'" 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 v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUser" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">
                {{currentInfo.commissionUser}}
              </td>
              <td>
                <p>委托日期</p>
              </td>
              <td v-if="operationType !== 'view'">
                <el-date-picker
                  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>
              </td>
              <td v-if="operationType === 'view'">{{ currentInfo.commissionDate }}</td>
            </tr>
            <tr>
              <td colspan="2">
                <p>委托人联系电话</p>
              </td>
              <td v-if="operationType !== 'view'" colspan="3"><el-input v-model="currentInfo.commissionPhone" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'" colspan="3">{{ currentInfo.commissionPhone }}</td>
            </tr>
            <tr>
              <td colspan="2">
                <p>综合室签名</p>
              </td>
              <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.generalOfficeUser" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{currentInfo.generalOfficeUser}}</td>
              <td>
                <p>接收日期</p>
              </td>
              <td v-if="operationType !== 'view'">
                <el-date-picker
                  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>
              </td>
              <td v-if="operationType === 'view'">{{ currentInfo.receiptData }}</td>
            </tr>
            <tr>
              <td colspan="2">
                <p>领样员签名</p>
              </td>
              <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.sampleTakerUser" clearable size="small"></el-input></td>
              <td v-if="operationType === 'view'">{{ currentInfo.sampleTakerUser }}</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-if="operationType === 'view'">{{ 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>
      <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>
    <el-dialog :visible.sync="downloadDialog" title="下载" width="600px">
      <span>
        <el-button :loading="outLoading" plain type="primary" @click="orderReportDown">下载委托单</el-button>
        <el-button :loading="outLoading" plain type="primary" @click="orderFormDown">下载委托报告</el-button>
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="downloadDialog = false">取 æ¶ˆ</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  addInspectionOrder, delInspectionOrder, exportInspectionOrder,
  getInsOrderOnInspection, getInspectionOrderByInsOderId, getInspectionOrderOne,
  pageInspectionOrder,
  updateInspectionOrder
} from "@/api/cnas/process/demand/demand";
import limsTable from "@/components/Table/lims-table.vue";
import Edit from './Edit.vue'
import { getInspectionOrder } from "@/api/cnas/process/demand/demand.js"
import {selectUserCondition} from "@/api/business/inspectionTask";
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",
                            clickFun: (row) => {
                                this.$refs.editRef.openAddContracts(row)
                            }
                        }
                    ],
                },
            ],
            tableData: [], // è¡¨æ ¼æ•°æ®
            page: {
                total: 0,
                size: 10,
                current: 1,
            },
        }
    },
    mounted() {
        this.refreshTable()
    },
    methods: {
        /**
         * @desc åˆ·æ–°è¡¨æ ¼
         */
        async refreshTable() {
            await getInspectionOrder({ ...this.page })
  name: "a7-Inspection-Order-Form",
  components: {limsTable},
  data() {
    return {
      title:'检验委托单',
      detailDialogVisible:false,
      addLoading:false,
      outLoading:false,
      currentInfo:{
        orderDetailList: []
      },
      personList:[],
      insStateList:[
        {
          label: '待审核',
          value: 0
        }, {
          label: '待检验',
          value: 1
        },
        /**
         * @desc æ‰“开模态框
         */
        openDialog(type) {
            this.$refs.editRef.open(type)
        }
        {
          label: '已检验',
          value: 4
        },
        {
          label: '退回',
          value: 2
        },
        {
          label: '撤销',
          value: 3
        },
      ],
      operationType: '',
      orderRowsVisible: false,
      tableList: [],
      tableListLoading: false,
      pages: {
        current: 1,
        size: 20,
      },
      tableData: [],
      tableLoading: false,
      tableSearch: {
        current: 1,
        size: 20,
      },
      total: 0,
      total1: 0,
      entity: {
        entrustCode: ''
      },
      entitySearch: {
        sampleName: '',
        commissionUnit: '',
        production: '',
        commissionUser: '',
      },
      buttonLoading: false,
      downloadDialog: false,
      download: {},
    };
  },
  mounted() {
    // this.getPower()
    this.getAuthorizedPerson()
    this.refreshTable()
  },
  computed: {
    action() {
      return this.javaApi + '/inspectionOrder/uploadInspectionOrderFile'
    }
  },
  methods: {
    addOrderDetailList () {
      if (this.currentInfo.orderDetailList == null) {
        this.currentInfo.orderDetailList = []
      }
      this.currentInfo.orderDetailList.push({
        sampleNumber: '',
        testItem: '',
        testStandard: '',
        standardMethodList: '',
        remark: '',
      })
    },
    // æŸ¥è¯¢åˆ—表
    refreshTable() {
      this.tableListLoading = true
      pageInspectionOrder({
        ...this.pages,
        ...this.entitySearch
      }).then(res => {
        this.tableListLoading = false
        this.tableList = res.data.records
        this.total1 = res.data.total
      }).catch(err => {
        this.tableListLoading = false
      })
    },
    // é‡ç½®
    refresh() {
      this.entitySearch = {
        sampleName: '',
        commissionUnit: '',
        production: '',
        commissionUser: '',
      }
      this.pages = {
        current: 1,
        size: 20,
      }
      this.refreshTable()
    },
    // æ‰“开新增弹框
    goAdd () {
      this.operationType = 'add'
      this.title = '新增检验委托单';
      this.orderRowsVisible = true
      this.searchTableData()
    },
    // æŸ¥è¯¢å¯æ–°å¢žçš„æ£€éªŒå•
    searchTableData () {
      this.tableLoading = true
      getInsOrderOnInspection({
        ...this.tableSearch,
        ...this.entity
      }).then(res => {
        this.tableLoading = false
        this.tableData = res.data.records
        this.total = res.data.total
      }).catch(err => {
        this.tableLoading = false
      })
    },
    // é‡ç½®æ£€éªŒå•列表
    refreshTableData () {
      this.entity = {
        entrustCode: ''
      }
      this.tableSearch = {
        current: 1,
        size: 20,
      }
      this.searchTableData()
    },
    // æ£€éªŒå•列表分页
    handleSizeChange(val) {
      this.tableSearch.size = val
      this.searchTableData();
    },
    handleCurrentChange(val) {
      this.tableSearch.current = val
      this.searchTableData();
    },
    // åˆ—表分页
    handleSizeChange1(val) {
      this.pages.size = val
      this.refreshTable();
    },
    handleCurrentChange1(val) {
      this.pages.current = val
      this.refreshTable();
    },
    // æäº¤æ–°å¢ž
    handleAdd () {
      this.buttonLoading = true
      addInspectionOrder(this.currentInfo).then(res => {
        this.buttonLoading = false
        this.$message.success('新增成功')
        this.detailDialogVisible = false
        this.orderRowsVisible = false
        this.refreshTable()
      }).catch(err => {
        this.buttonLoading = false
      })
    },
    // æäº¤ä¿®æ”¹
    handleEdit () {
      this.buttonLoading = true
      updateInspectionOrder(this.currentInfo).then(res => {
        this.buttonLoading = false
        if (res.code === 201) return
        this.$message.success('新增成功')
        this.detailDialogVisible = false
        this.orderRowsVisible = false
        this.refreshTable()
      }).catch(err => {
        this.buttonLoading = false
      })
    },
    // æŸ¥è¯¢éœ€è¦æ–°å¢žçš„委托单详情
    goAddOrder (row) {
      getInspectionOrderByInsOderId({insOrderId: row.id}).then(res => {
        this.currentInfo = res.data
        this.title = '新增检验委托单';
        this.detailDialogVisible = true
      }).catch(err => {
        console.log('err----', err)
      })
    },
    // æ‰“开编辑弹框
    goUpdate (row) {
      this.operationType = 'edit'
      getInspectionOrderOne({inspectionOrderId: row.inspectionOrderId}).then(res => {
        this.currentInfo = res.data
        this.title = '编辑检验委托单';
        this.detailDialogVisible = true
      }).catch(err => {
        console.log('err----', err)
      })
    },
    // æŸ¥çœ‹
    handleLook(row){
      this.operationType = 'view'
      getInspectionOrderOne({inspectionOrderId: row.inspectionOrderId}).then(res => {
        this.currentInfo = res.data
        this.title = '查看检验委托单';
        this.detailDialogVisible = true
      }).catch(err => {
        console.log('err----', err)
      })
    },
    // åˆ é™¤
    deleteOrder (row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        delInspectionOrder({inspectionOrderId: row.inspectionOrderId}).then(res => {
          this.$message.success('删除成功!');
          this.refreshTable();
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // æ‰“开下载弹框
    openDownloadDia (row) {
      this.downloadDialog = true
      this.download = row
    },
    // å§”托单下载
    orderFormDown () {
      let url = this.download.fileUrl;
      const link = document.createElement('a');
      link.href = this.javaApi + url;
      link.target = '_blank';
      document.body.appendChild(link);
      link.click();
    },
    // å§”托报告下载
    orderReportDown () {
      this.outLoading = true;
      exportInspectionOrder({inspectionOrderId: this.download.inspectionOrderId}).then(res => {
        this.outLoading = false;
        const blob = new Blob([res], { type: 'application/octet-stream' });
        this.$download.saveAs(blob, '检验委托单.docx')
        this.$message.success('导出成功');
      }).catch(err => {
        this.outLoading = false;
      })
    },
    // ä¸Šä¼ 
    handleSuccessUp(response, ) {
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.refreshTable()
      }
    },
    beforeUpload(file) {
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload.clearFiles()
        return false;
      } else {
        return true;
      }
    },
    onError(err, file, fileList) {
      this.$message.error('上传失败')
      this.$refs.upload.clearFiles()
    },
    // äººå‘˜åˆ—表
    getAuthorizedPerson() {
      selectUserCondition().then(res => {
        let data = []
        res.data.forEach(a => {
          data.push({
            label: a.name,
            value: a.id
          })
        })
        this.personList = data
      })
    },
  },
}
</script>
</script>
<style scoped>
</style>
src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue
@@ -1,12 +1,12 @@
<template>
    <el-dialog :visible.sync="dialogVisible" title="标准物质验收记录" width="70%">
        <!-- <el-steps :active="currentStep" finish-status="success">
       <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>-->
        </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>
@@ -15,16 +15,16 @@
</template>
<script>
// import Step1 from './Step/Step1.vue'
import Step1 from './Step1.vue'
export default {
    components: {
        // Step1
        Step1
    },
    data() {
        return {
            dialogVisible: false,
            currentStep: 0, // æ­¥éª¤æ¡æ˜¾ç¤ºç¬¬å‡ æ­¥
            // steps: ['提交', '开箱验收复核', '安装验收检查', '安装验收复核', '验收核查', '验收核查审核'],
            steps: ['提交', '开箱验收复核', '安装验收检查', '安装验收复核', '验收核查', '验收核查审核'],
            model: {
                acceptance: {
                    id: undefined,
src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue
@@ -1,201 +1,198 @@
<!--<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>-->
<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>
        <lims-table :tableData="model.list" :column="spareColumns" :height="'calc(100vh - 250px)'">
          <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>
        </lims-table>
      </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';-->
<script>
// import { getStandardSubstanceAll } from "@/assets/api/api";
import axios from 'axios';
import limsTable from '@/components/Table/lims-table.vue'
import {
  getStandardSubstanceAll
} from '@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept'
<!--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>-->
export default {
  components: {
    limsTable
  },
  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}/personBasicInfo/saveCNASFile`
    }
  },
  mounted() {
    this.getStand()
  },
  methods: {
    async getStand() {
      getStandardSubstanceAll().then(res => {
        this.options = res.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>-->
<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
@@ -23,30 +23,6 @@
    </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>
@@ -56,6 +32,7 @@
// import AddRecord from './components/AddRecord.vue';
import limsTable from '@/components/Table/lims-table.vue'
import AddRecord from './component/AddRecord.vue';
import {
  getPageAcceptance,
  updateAcceptanc,
@@ -63,8 +40,8 @@
} from '@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept'
export default {
  components: {
    limsTable
    limsTable,
    AddRecord
  },
  data() {
    return {