master
lion 1 month ago
parent fca01c0445
commit c9f3dcf7f4

@ -8,7 +8,49 @@
<div>
<el-tabs v-model="activeTab">
<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
type="primary"
size="small"
@ -272,8 +314,12 @@
</template>
<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 {
departmentListNoAuth,
userListNoAuth
} from '@/api/common.js'
export default {
name: 'PayList',
components: {
@ -281,10 +327,17 @@ export default {
},
data() {
return {
departments: [],
users: [],
waitList: [],
receiveList: [],
confirmList: [],
activeTab: 'pending',
pendingQuery: {
creator_department_id: '',
created_by: '',
keywords: '',
},
pendingRows: [],
isShowPay: false,
processingRows: [],
@ -303,6 +356,33 @@ export default {
},
},
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 },
isApplyNumInvalid(row) {
const applyNum = row.applyNum === null || row.applyNum === undefined ? null : Number(row.applyNum)
@ -554,12 +634,25 @@ export default {
this.$message.error('取消收货失败')
}
},
handlePendingQueryChange() {
this.getWaitList()
},
async getWaitList() {
try {
const res = await waitList({
const params = {
page: 1,
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.pendingRows = (res.data || []).map(item => ({
@ -669,6 +762,15 @@ export default {
this.receivedPageSize = 10
}
//
if (newTab === 'pending') {
this.pendingQuery = {
creator_department_id: '',
created_by: '',
keywords: '',
}
}
// 使 nextTick
this.$nextTick(() => {
this.$nextTick(() => {
@ -696,7 +798,9 @@ export default {
},
},
mounted() {
this.getDepartmentList()
this.getWaitList()
this.getUserList()
},
}
</script>

Loading…
Cancel
Save