ahdevicemgt-ui/src/views/purchase/binding/index.vue

93 lines
2.4 KiB
Vue
Raw Normal View History

<template>
2024-08-22 10:13:27 +08:00
<!-- 新购绑定页面 -->
<div class="app-container">
2024-08-22 10:13:27 +08:00
<PageHeader
v-if="isShowComponent !== 'Index'"
:pageContent="pageContent"
@goBack="goBack"
/>
<!-- 列表 -->
<TableModel
:formLabel="formLabel"
:columnsList="columnsList"
2024-08-22 10:13:27 +08:00
:request-api="queryPurchaseBindListApi"
ref="tableRef"
2024-08-22 10:13:27 +08:00
v-if="isShowComponent === 'Index'"
>
2024-08-22 14:08:36 +08:00
<template slot="btn" slot-scope="{ queryParams }">
2024-08-22 10:13:27 +08:00
<el-button @click="handleExportData(queryParams, 'base/customer/export', '新购绑定清单')"
>导出</el-button
>
</template>
<template slot="handle" slot-scope="{ data }">
2024-08-22 10:13:27 +08:00
<el-button
type="primary"
size="mini"
@click="handleEditData(data)"
2024-08-22 10:13:27 +08:00
>查看</el-button
>
<el-button
type="danger"
size="mini"
2024-08-22 10:13:27 +08:00
@click="toggleBinding(data)"
>绑定</el-button
>
</template>
2024-08-22 10:13:27 +08:00
2024-08-22 14:08:36 +08:00
<template slot="purchaseNum" slot-scope="{ data }">
{{ data.purchaseNum / 1000 }}
</template>
</TableModel>
2024-08-22 10:13:27 +08:00
<list-binding
v-if="isShowComponent === 'list-binding'"
:sendParams='sendParams'
>
2024-08-22 10:13:27 +08:00
</list-binding>
</div>
</template>
<script>
2024-08-22 10:13:27 +08:00
import PageHeader from '@/components/pageHeader'
import { columnsList, dialogConfig, formLabel } from './config'
import { commonMixin } from '../mixins/common'
2024-08-22 10:13:27 +08:00
import ListBinding from './components/list-binding.vue'
import {
2024-08-22 10:13:27 +08:00
queryPurchaseBindListApi
} from '@/api/purchase/binding'
export default {
name: 'arrivalBindingManage',
mixins: [commonMixin], // 混入公共方法和数据
2024-08-22 10:13:27 +08:00
components: { ListBinding, PageHeader },
methods: {
2024-08-22 10:13:27 +08:00
queryPurchaseBindListApi,
goBack() {
this.isShowComponent = 'Index'
},
toggleBinding(data) {
this.sendParams = {taskId:data.id}
console.log(data)
this.isShowComponent = 'list-binding'
}
},
data() {
return {
formLabel,
columnsList,
dialogConfig,
2024-08-22 10:13:27 +08:00
isShowComponent: 'Index',
2024-08-22 14:08:36 +08:00
pageContent: '新购绑定物资列表',
2024-08-22 10:13:27 +08:00
sendParams: {}
}
},
}
</script>