¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!--<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>--> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |