From 551e8f6756abbb1277566dd1225a14422c774d6f Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期四, 26 十二月 2024 14:33:08 +0800 Subject: [PATCH] 完成标准物质领用迁移 --- src/components/view/a6-standard-material-requisition.vue | 286 ++++++++++++++++++++++++++++++++------------------------ src/assets/api/controller.js | 9 + 2 files changed, 172 insertions(+), 123 deletions(-) diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js index 03ba2aa..7e33442 100644 --- a/src/assets/api/controller.js +++ b/src/assets/api/controller.js @@ -69,6 +69,7 @@ foreignRegister, feCalibrationSchedule, feStandardSubstance, + feStandardSubstanceRecord, } } @@ -912,3 +913,11 @@ removeStandardSubstance:'/feStandardSubstance/removeStandardSubstance',//鍒犻櫎鏍囧噯鐗╄川娓呭崟 exportOfStandardSubstanceList: '/feStandardSubstance/exportOfStandardSubstanceList', // 鏍囧噯鐗╄川娓呭崟 瀵煎嚭 } + +// 6.5鏍囧噯鐗╄川娓呭崟-棰嗙敤鍊熺敤褰掕繕 +const feStandardSubstanceRecord = { + getSubstanceRecord:'/feStandardSubstanceRecord/getSubstanceRecord',// 鏍囧噯鐗╄川娓呭崟棰嗙敤鏌ヨ + borrowSubstance:'/feStandardSubstanceRecord/borrowSubstance',//鏍囧噯鐗╄川娓呭崟鍊熺敤 + returnSubstance:'/feStandardSubstanceRecord/returnSubstance',//鏍囧噯鐗╄川娓呭崟褰掕繕 + getPageSubstanceRecord: '/feStandardSubstanceRecord/getPageSubstanceRecord', // 鍒嗛〉鏌ヨ +} diff --git a/src/components/view/a6-standard-material-requisition.vue b/src/components/view/a6-standard-material-requisition.vue index b4089c4..773a9a8 100644 --- a/src/components/view/a6-standard-material-requisition.vue +++ b/src/components/view/a6-standard-material-requisition.vue @@ -1,147 +1,187 @@ -<style scoped> - .title { - height: 60px; - line-height: 60px; - } - - .search { - background-color: #fff; - height: 80px; - display: flex; - align-items: center; - } - .search_thing { - display: flex; - align-items: center; - height: 50px; - } - .search_label { - width: 120px; - font-size: 14px; - text-align: right; - } - - .search_input { - width: calc(100% - 120px); - } - .table { - margin-top: 10px; - background-color: #fff; - width: calc(100% - 40px); - height: calc(100% - 60px - 80px - 10px - 40px); - padding: 20px; - } - -</style> <template> - <div class="below-standard-main"> - <div style="width: 100%;height: 100%;"> - <div> - <el-row class="title"> - <el-col :span="12" style="padding-left: 20px;text-align: left;">鏍囧噯鐗╄川棰嗙敤</el-col> - <el-col :span="12" style="text-align: right;"> - <el-button size="medium" type="primary" @click="$refs['ValueTable'].openAddDia('鏂板鎺ュ彛')" v-if="addPower">鏂� 澧�</el-button> - <el-button size="medium" @click="$refs['ValueTable'].openDownDia()">瀵� 鍑�</el-button> - </el-col> - </el-row> + <div> + <div> + <div class="view-title"> + <span>鏍囧噯鐗╄川棰嗙敤</span> </div> - <div class="search"> - <div class="search_thing"> - <div class="search_label">鍚嶇О锛�</div> - <div class="search_input"> - <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.model" - @keyup.enter.native="refreshTable()"></el-input></div> - </div> - <div class="search_thing"> - <div class="search_label">绠$悊缂栫爜锛�</div> - <div class="search_input"> - <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.sample" - @keyup.enter.native="refreshTable()"></el-input> - </div> - </div> - <div class="search_thing"> - <div class="search_label">鐘舵�侊細</div> - <div class="search_input"> - <el-select size="small" v-model="componentData.entity.state" style="width: 100%;" @change="refreshTable()"> - <el-option v-for="(a, i) in stateList" :key="i" :label="a.label" :value="a.value"></el-option> - </el-select> - </div> - </div> - <div class="search_thing" style="padding-left: 30px;"> - <el-button size="small" @click="refresh()">閲� 缃�</el-button> - <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button> - </div> + <div class="search-background"> + <span class="search-group"> + <span style="width: 180px">鏍囧噯鐗╄川鍚嶇О锛�</span> + <el-input v-model="searchForm.name" clearable size="small"></el-input> + </span> + <span class="search-group"> + <span style="width: 120px">瑙勬牸鍨嬪彿锛�</span> + <el-input v-model="searchForm.model" clearable size="small"></el-input> + </span> + <span class="search-group"> + <el-button size="medium" @click="resetSearchForm">閲� 缃�</el-button> + <el-button size="medium" type="primary" @click="searchList">鏌� 璇�</el-button> + </span> </div> <div class="table"> - <ValueTable ref="ValueTable" :url="$api.unPass.pageInsUnPass" :componentData="componentData" - :key="upIndex" /> + <div> + <TableCard :showForm="false" :showTitle="false"> + <template v-slot:table> + <ZTTable + :column="tableColumn" + :height="'calc(100vh - 23em)'" + :table-data="tableData" + :table-loading="tableLoading" + style="padding: 0 15px;margin-bottom: 16px"> + </ZTTable> + </template> + </TableCard> + <el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]" + :total="total" layout="->,total, sizes, prev, pager, next, jumper" + @size-change="handleSizeChange" + @current-change="handleCurrentChange"> + </el-pagination> + </div> </div> </div> </div> </template> <script> - import ValueTable from '../tool/value-table.vue' - import { - convertToHtml - } from 'mammoth'; +import ZTTable from '../caorui/ZTTable/index.vue'; +import TableCard from '../caorui/TableCard/index.vue'; export default { components: { - ValueTable, + TableCard, + ZTTable, }, data() { return { - componentData: { - entity: { - sample: null, - model: null, - orderBy: { - field: 'id', - order: 'asc' - } - }, - isIndex: true, - showSelect: false, - select: false, - do: [ - { - id: '', - font: '褰掕繕', - type: 'text', - method: 'handleBack', - // disabFun: (row, index) => { - // return row.userId == null || row.insState == 3 || row.insState == 5 - // } - }, - ], - tagField: [], - selectField: [], - requiredAdd: ['model','sample',], - requiredUp: [] + searchForm: { + name: '', + factoryManufacturer: '', + }, + tableColumn: [ + { + label: '鏍囧噯鐗╄川鍚嶇О', + prop: 'name', + minWidth: '120' }, - entityCopy: {}, - upIndex: 0, - stateList: [], - addPower:true, - } + { + 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: { + size: 20, + current: 1, + }, + total: 0, + formDia: false, + borrowDia: false, + returnDia: false, + } }, mounted() { - this.entityCopy = this.HaveJson(this.componentData.entity) - this.getPower() + this.searchList() }, methods :{ - refreshTable() { - this.$refs['ValueTable'].selectList() - }, - refresh() { - this.componentData.entity = this.HaveJson(this.entityCopy) - this.upIndex++ - }, - // 鏉冮檺鍒嗛厤 - getPower(radio) { - let power = JSON.parse(sessionStorage.getItem('power')) + // 鏌ヨ鍒楄〃 + searchList () { + const entity = this.searchForm + const page = this.page + this.tableLoading = true + this.$axios.post(this.$api.feStandardSubstanceRecord.getPageSubstanceRecord, { ...entity, ...page }, { + headers: { + "Content-Type": "application/json" + }, + noQs: true + }).then(res => { + this.tableLoading = false + if (res.code === 201) return + this.tableData = res.data.records + this.total = res.data.total + }).catch(err => { + this.tableLoading = false + }) }, - handleBack(row){} + // 閲嶇疆鏌ヨ鏉′欢 + resetSearchForm () { + this.searchForm.name = ''; + this.searchForm.model = ''; + this.searchList() + }, + // 鍒嗛〉 + handleSizeChange(val) { + this.page.size = val; + this.searchList(); + }, + handleCurrentChange(val) { + this.page.current = val; + this.searchList(); + }, } } </script> +<style scoped> +.view-title { + display: flex; + justify-content: space-between; + align-items: center; + height: 60px; + padding-left: 20px; +} + +.search-background { + width: 100%; + height: 80px; + line-height: 80px; + background-color: #ffffff; + display: flex; +} + +.search-group { + display: flex; + align-items: center; + margin: 0 20px; +} + +.table { + margin-top: 20px; + background-color: #ffffff; + padding-top: 20px; +} +</style> -- Gitblit v1.9.3