From e5454b769d44a34af423bf87ac8a740bf8c20341 Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期二, 29 四月 2025 13:25:29 +0800 Subject: [PATCH] Merge branch 'dev' into dev_tides --- src/views/CNAS/externalService/serviceAndSupplyPro/component/Store.vue | 101 +++++++++++++++++++------------------------------- 1 files changed, 39 insertions(+), 62 deletions(-) diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/Store.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/Store.vue index 1951036..f485eed 100644 --- a/src/views/CNAS/externalService/serviceAndSupplyPro/component/Store.vue +++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/Store.vue @@ -1,33 +1,19 @@ <template> <div> - <div style=" - display: flex; - justify-content: flex-end; - margin-right: 20px; - margin-bottom: 20px; - "> - <el-button icon="el-icon-plus" size="small" type="primary" @click="addOrUpdateStore('add')">娣诲姞 - </el-button> - <el-button icon="el-icon-download" size="small" @click="importExcel"> - 瀵煎嚭excel - </el-button> + <div style="display: flex;justify-content: flex-end;margin-bottom: 10px;"> + <el-button size="small" type="primary" @click="searchList">鍒锋柊</el-button> + <el-button icon="el-icon-plus" size="small" type="primary" @click="addOrUpdateStore('add')">娣诲姞</el-button> + <el-button icon="el-icon-download" size="small" @click="importExcel">瀵煎嚭excel</el-button> </div> <div class="table"> - <limsTable - :column="tableColumn" - :height="'calc(100vh - 20em)'" - :table-data="storageTableData" - :table-loading="tableLoading" - style="padding: 0 10px;margin-bottom: 16px" - :page="page" - @pagination="pagination"> + <limsTable :column="tableColumn" :height="'calc(100vh - 20em)'" :table-data="storageTableData" + :table-loading="tableLoading" :page="page" @pagination="pagination"> </limsTable> </div> <!-- 缂栬緫-鏂板寮规 --> - <el-dialog :before-close="handleClose" :close-on-click-modal="false" - :close-on-press-escape="false" :title="title" - :visible.sync="dialogVisible" width="70%"> + <el-dialog :before-close="handleClose" :close-on-click-modal="false" :close-on-press-escape="false" :title="title" + :visible.sync="dialogVisible" width="70%"> <!-- 鍏ュ簱鍗� --> <div> <div style="display: flex; align-items: center"> @@ -51,19 +37,17 @@ </el-col> <el-col :span="12"> <el-form-item label="鍏ュ簱鏃ユ湡"> - <el-date-picker v-model="form.storageTime" format="yyyy-MM-dd" - placeholder="閫夋嫨鏃ユ湡" - size="small" - style="width: 100%" type="date" value-format="yyyy-MM-dd"></el-date-picker> + <el-date-picker v-model="form.storageTime" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small" + style="width: 100%" type="date" value-format="yyyy-MM-dd"></el-date-picker> </el-form-item> </el-col> - <el-col :span="12"> - <el-form-item label="鍏ュ簱浜�"> - <el-select v-model="form.storageUser" size="small" style="width: 100%"> - <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> + <el-col :span="12"> + <el-form-item label="鍏ュ簱浜�"> + <el-select v-model="form.storageUser" size="small" style="width: 100%"> + <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> <el-col :span="12"> <el-form-item label="鍏ュ簱璇存槑"> <el-input v-model="form.remark" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�" type="textarea"> @@ -106,11 +90,10 @@ </el-input> </div> </div> - <el-button size="mini" type="primary" - @click="addTableData">娣诲姞 + <el-button size="mini" type="primary" @click="addTableData">娣诲姞 </el-button> </div> - <el-table :data="consumables" style="margin-top: 10px"> + <el-table :data="consumables" style="margin-top: 10px" :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border> <el-table-column label="缂栧彿" type="index" width="120px"></el-table-column> <el-table-column label="璐у彿" prop="itemNumber"></el-table-column> <el-table-column label="绫诲埆" prop="type"></el-table-column> @@ -225,7 +208,7 @@ label: '鐧昏浜�', prop: 'registrantName', minWidth: '160' - },{ + }, { label: '鐧昏鏃ユ湡', prop: 'registrantTime', minWidth: '100' @@ -263,12 +246,6 @@ consumableOptions: [], options: [], storageTableData: [], - searchForm: { - orderBy: { - field: "id", - order: "desc", - }, - }, saveLoading: false, }; }, @@ -322,7 +299,7 @@ // 娣诲姞琛ㄦ牸鏁版嵁 addTableData() { this.$nextTick() - console.log('this.consumableOptions',this.consumableOptions) + console.log('this.consumableOptions', this.consumableOptions) this.consumableOptions.forEach(item => { if (item.id === this.formTwo.id) { this.consumables.push({ @@ -343,13 +320,12 @@ this.consumables.splice(index, 1); }, // 鎵撳紑寮规 - addOrUpdateStore(type,row) { + addOrUpdateStore(type, row) { if (type === 'edit') { this.dialogType = "update"; - selectStoreById({id:row.id}).then(res => { - if (res.code === 201) return + selectStoreById({ id: row.id }).then(res => { this.consumables = res.data.consumables - this.form = {...res.data.store} + this.form = { ...res.data.store } }).catch(err => { console.log('err---', err); }) @@ -359,11 +335,11 @@ this.dialogVisible = true; }, // 鏌ヨ鍒楄〃 - searchList () { + searchList() { this.tableLoading = true - storeList({...this.page,...this.searchForm}).then(res => { + storeList({ ...this.page}).then(res => { this.tableLoading = false - if (res.code === 200){ + if (res.code === 200) { this.storageTableData = res.data.records this.page.total = res.data.total } @@ -374,10 +350,9 @@ }, // 瀵煎嚭excel async importExcel() { - exportProcurementSuppliesStoreExcel({parentId:this.contentsId}).then(res => { - const blob = new Blob([res], {type: 'application/octet-stream'}); + exportProcurementSuppliesStoreExcel({ parentId: this.contentsId }).then(res => { + const blob = new Blob([res], { type: 'application/octet-stream' }); this.$download.saveAs(blob, '鑰楁潗鍏ュ簱.xlsx') - this.$message.success('瀵煎嚭鎴愬姛') }) }, handleClose() { @@ -404,11 +379,11 @@ // 鑾峰彇鎵�鏈夌敤鎴� getUserList() { selectUserCondition().then((res) => { - this.users = res.data; - }); + this.users = res.data; + }); }, async fetchListOptions() { - procurementSuppliesList({contentsId: this.contentsId}).then(res => { + procurementSuppliesList({ contentsId: this.contentsId }).then(res => { if (res.code === 200) { this.consumableOptions = res.data.records } @@ -416,20 +391,20 @@ }, // 鍒犻櫎 - deleteStore (row) { + deleteStore(row) { this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { this.tableLoading = true - console.log('row>>>>>>>>>>>>>>s',row) + console.log('row>>>>>>>>>>>>>>s', row) deleteStore({ - id:row.id, - consumablesId:row.consumablesId + id: row.id, + consumablesId: row.consumablesId }).then(res => { this.tableLoading = false - if (res.code === 200){ + if (res.code === 200) { this.$message.success('鍒犻櫎鎴愬姛') this.searchList() } @@ -457,10 +432,12 @@ .el-dialog { margin: 6vh auto 50px !important; } + .el-dialog__body { max-height: 42em; overflow-y: auto; } + .input-form { display: flex; margin: 10px 0; -- Gitblit v1.9.3