莳松crm管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ss-crm-manage-web/src/views/MiniMall/Purchase/index.vue

95 lines
2.8 KiB

1 year ago
<template>
<div>
<!-- 搜索工作栏 -->
<Search
:schema="allSchemas.searchSchema"
labelWidth="0"
expand
expand-field="supplier"
@search="setSearchParams"
@reset="setSearchParams"
>
<template #actionMore>
<el-button type="primary" @click="handleAdd">发起采购</el-button>
</template>
</Search>
<!-- 列表 -->
<SSTable
class="mt-20px"
v-model:tableObject="tableObject"
:tableColumns="allSchemas.tableColumns"
@get-list="getTableList"
>
<el-table-column
v-for="item in allSchemas.tableColumns"
:key="item.table?.field || item.field"
:prop="item.table?.field || item.field"
:label="item.label"
:fixed="item.fixed"
min-width="150px"
showOverflowTooltip
/>
<el-table-column label="操作" width="150px" fixed="right">
<template #default="{ row }">
<el-button type="primary" v-if="row.status == 1" link @click="handleAudit(row)"
>采购审核</el-button
>
<el-button v-else type="primary" link @click="purchaseAgain(row)">再次采购</el-button>
<el-button type="primary" link @click="handleDetail(row)">详情</el-button>
</template>
</el-table-column>
</SSTable>
<DialogAdd ref="creatPurchase" />
<DialogAudit ref="auditPurchase" />
</div>
</template>
<script setup>
import { allSchemas } from './index.data.js'
import DialogAdd from './Comp/DialogAdd.vue'
import DialogAudit from './Comp/DialogAudit.vue'
const creatPurchase = ref()
const auditPurchase = ref()
const tableObject = ref({
tableList: [],
loading: false,
total: 1,
pageSize: 20,
currentPage: 1
})
const setSearchParams = function () {
tableObject.value.tableList = [
{ name: '测试', status: 1, statusName: '审核中', supplier: '林氏木业', purchaseCount: 10 },
{ name: '测试2', status: 2, statusName: '已通过', supplier: '张氏木业', purchaseCount: 1 },
{ name: '测试3', status: 3, statusName: '已驳回', supplier: '周氏木业', purchaseCount: 5 }
]
}
function getTableList() {
tableObject.value.tableList = [
{ name: '测试', status: 1, statusName: '审核中', supplier: '林氏木业', purchaseCount: 10 },
{ name: '测试2', status: 2, statusName: '已通过', supplier: '张氏木业', purchaseCount: 1 },
{ name: '测试3', status: 3, statusName: '已驳回', supplier: '周氏木业', purchaseCount: 5 }
]
}
function purchaseAgain(row) {
creatPurchase.value.open({ ...row })
}
function handleAudit(row) {
auditPurchase.value.open({ ...row }, true)
}
function handleAdd() {
creatPurchase.value.open(null)
}
function handleDetail(row) {
auditPurchase.value.open({ ...row }, false)
}
</script>
<style lang="scss" scoped></style>