master
lion 1 month ago
parent fca01c0445
commit c9f3dcf7f4

@ -8,7 +8,49 @@
<div> <div>
<el-tabs v-model="activeTab"> <el-tabs v-model="activeTab">
<el-tab-pane :label="`待采购${pendingBadgeCount ? '' + pendingBadgeCount + '' : ''}`" name="pending"> <el-tab-pane :label="`待采购${pendingBadgeCount ? '' + pendingBadgeCount + '' : ''}`" name="pending">
<div style="margin-bottom: 10px; display: flex; justify-content: flex-start;"> <div style="margin-bottom: 10px; display: flex; justify-content: flex-start; align-items: center; gap: 10px;">
<el-select
v-model="pendingQuery.creator_department_id"
placeholder="科室"
size="small"
clearable
style="width: 150px"
>
<el-option
v-for="item in departments"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-select
v-model="pendingQuery.created_by"
placeholder="采购负责人"
size="small"
clearable
filterable
style="width: 150px"
>
<el-option
v-for="item in users"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-input
v-model="pendingQuery.keywords"
placeholder="关键词"
size="small"
clearable
style="width: 200px"
/>
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="handlePendingQueryChange"
>查询</el-button>
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
@ -89,7 +131,7 @@
</el-table> </el-table>
<div style="margin-top: 10px; display: flex; justify-content: center; color: #666;"> <div style="margin-top: 10px; display: flex; justify-content: center; color: #666;">
{{ pendingRows.length }} 条记录 · 1 / 1 {{ pendingRows.length }} 条记录 · 1 / 1
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="采购中" name="processing"> <el-tab-pane label="采购中" name="processing">
@ -100,7 +142,7 @@
icon="el-icon-check" icon="el-icon-check"
@click="handleBatchConfirm" @click="handleBatchConfirm"
>批量确认</el-button> >批量确认</el-button>
</div> </div>
<el-table ref="processingTable" :data="processingRows" border style="width: 100%"> <el-table ref="processingTable" :data="processingRows" border style="width: 100%">
<el-table-column type="selection" width="50"></el-table-column> <el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="申请人" width="120" align="center"> <el-table-column label="申请人" width="120" align="center">
@ -161,7 +203,7 @@
<el-table-column label="操作" width="120" align="center"> <el-table-column label="操作" width="120" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="primary" size="mini" @click="confirmReceiveVue(row)"> <el-button type="primary" size="mini" @click="confirmReceiveVue(row)">
<i class="el-icon-check icon-space"></i>确认收货 <i class="el-icon-check icon-space"></i>确认收货
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -186,7 +228,7 @@
icon="el-icon-close" icon="el-icon-close"
@click="handleBatchCancel" @click="handleBatchCancel"
>批量取消</el-button> >批量取消</el-button>
</div> </div>
<el-table ref="receivedTable" :data="receivedRows" border style="width: 100%"> <el-table ref="receivedTable" :data="receivedRows" border style="width: 100%">
<el-table-column type="selection" width="50"></el-table-column> <el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="申请人" width="120" align="center"> <el-table-column label="申请人" width="120" align="center">
@ -272,8 +314,12 @@
</template> </template>
<script> <script>
import { waitList, receiveList, confirmList,getFundLog,detailContract, } from '@/api/flow/pay' import { waitList, receiveList, confirmList, getFundLog, detailContract } from '@/api/flow/pay'
import payMx from './components/payMx.vue' import payMx from './components/payMx.vue'
import {
departmentListNoAuth,
userListNoAuth
} from '@/api/common.js'
export default { export default {
name: 'PayList', name: 'PayList',
components: { components: {
@ -281,10 +327,17 @@ export default {
}, },
data() { data() {
return { return {
departments: [],
users: [],
waitList: [], waitList: [],
receiveList: [], receiveList: [],
confirmList: [], confirmList: [],
activeTab: 'pending', activeTab: 'pending',
pendingQuery: {
creator_department_id: '',
created_by: '',
keywords: '',
},
pendingRows: [], pendingRows: [],
isShowPay: false, isShowPay: false,
processingRows: [], processingRows: [],
@ -303,6 +356,33 @@ export default {
}, },
}, },
methods: { methods: {
async getDepartmentList() {
try {
const res = await departmentListNoAuth()
console.log(res)
const arr = res
this.departments = arr
this.departments.unshift({
id: '',
name: '全部'
})
} catch (err) {
console.error(err)
}
},
async getUserList() {
try {
const res = await userListNoAuth({
page:1,
rows:9999,
})
console.log(res)
const arr = res.data
this.users = arr
} catch (err) {
console.error(err)
}
},
switchTab(tab) { this.activeTab = tab }, switchTab(tab) { this.activeTab = tab },
isApplyNumInvalid(row) { isApplyNumInvalid(row) {
const applyNum = row.applyNum === null || row.applyNum === undefined ? null : Number(row.applyNum) const applyNum = row.applyNum === null || row.applyNum === undefined ? null : Number(row.applyNum)
@ -554,12 +634,25 @@ export default {
this.$message.error('取消收货失败') this.$message.error('取消收货失败')
} }
}, },
handlePendingQueryChange() {
this.getWaitList()
},
async getWaitList() { async getWaitList() {
try { try {
const res = await waitList({ const params = {
page: 1, page: 1,
page_size: 999, page_size: 999,
}) }
if (this.pendingQuery.creator_department_id) {
params.creator_department_id = this.pendingQuery.creator_department_id
}
if (this.pendingQuery.created_by) {
params.created_by = this.pendingQuery.created_by
}
if (this.pendingQuery.keywords) {
params.keywords = this.pendingQuery.keywords
}
const res = await waitList(params)
this.waitList = res.data || [] this.waitList = res.data || []
// //
this.pendingRows = (res.data || []).map(item => ({ this.pendingRows = (res.data || []).map(item => ({
@ -669,6 +762,15 @@ export default {
this.receivedPageSize = 10 this.receivedPageSize = 10
} }
//
if (newTab === 'pending') {
this.pendingQuery = {
creator_department_id: '',
created_by: '',
keywords: '',
}
}
// 使 nextTick // 使 nextTick
this.$nextTick(() => { this.$nextTick(() => {
this.$nextTick(() => { this.$nextTick(() => {
@ -696,7 +798,9 @@ export default {
}, },
}, },
mounted() { mounted() {
this.getDepartmentList()
this.getWaitList() this.getWaitList()
this.getUserList()
}, },
} }
</script> </script>

Loading…
Cancel
Save