莳松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

125 lines
3.4 KiB

1 year ago
<template>
<div>
<!-- 搜索工作栏 -->
1 year ago
<Search :schema="allSchemas.searchSchema" labelWidth="0">
1 year ago
<template #actionMore>
1 year ago
<el-button @click="getList" v-hasPermi="['mall:purchase:search']"> 搜索 </el-button>
<el-button @click="resetQuery" v-hasPermi="['mall:purchase:reset']"> 重置 </el-button>
<el-button type="primary" @click="handleAdd" v-hasPermi="['mall:purchase:add']">
发起采购
</el-button>
1 year ago
</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 }">
1 year ago
<el-button
type="primary"
v-if="row.status == 1"
link
@click="handleAudit(row)"
v-hasPermi="['mall:purchase:audit']"
>
采购审核
</el-button>
<el-button
v-else
type="primary"
link
@click="purchaseAgain(row)"
v-hasPermi="['mall:purchase:readd']"
>
再次采购
</el-button>
<el-button
type="primary"
link
@click="handleDetail(row)"
v-hasPermi="['mall:purchase:detail']"
1 year ago
>
1 year ago
详情
</el-button>
1 year ago
</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
})
1 year ago
function resetQuery() {
queryParams.value = {
productName: undefined,
productBrand: undefined,
productCategory: undefined,
pageNo: 1,
pageSize: 10
}
getList()
}
const getList = function () {
1 year ago
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>