chenrui
2025-02-24 3aa0f70b9639cfd7a4520a2bd47ae793a6a4a291
标准物质领用
已添加3个文件
577 ■■■■■ 文件已修改
src/views/CNAS/resourceDemand/standardMaterailRequistion/index.vue 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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/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>