This commit is contained in:
qsh
2024-06-18 15:16:04 +08:00
parent 1c37dbc5f8
commit e3c85cbaae
13 changed files with 801 additions and 164 deletions

View File

@@ -1,146 +1,28 @@
<template>
<div>
<!-- 搜索工作栏 -->
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
<template #actionMore>
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button>
<el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button>
</template>
</Search>
<!-- 列表 -->
<SSTable
v-if="!loading"
class="mt-20px"
v-model:tableObject="tableObject"
:tableColumns="allSchemas.tableColumns"
@get-list="getTableList"
>
<el-table-column
v-for="item in allSchemas.tableColumns"
:key="item.field"
:prop="item.field"
:label="item.label"
min-width="120px"
/>
<el-table-column label="操作" width="200px" fixed="right">
<template #default="scope">
<el-button
type="primary"
class="mr-10px"
link
style="padding: 0; margin-left: 0"
v-hasPermi="['clue:order:after-sale']"
@click="sellAfter(scope.row)"
>
售后
</el-button>
<el-button
type="primary"
class="mr-10px"
link
style="padding: 0; margin-left: 0"
v-hasPermi="['clue:order:after-sale-audit']"
>
售后审核
</el-button>
<el-button
type="primary"
class="mr-10px"
link
style="padding: 0; margin-left: 0"
v-hasPermi="['clue:order:send']"
>
发货(进销存)
</el-button>
<el-button
type="primary"
class="mr-10px"
link
style="padding: 0; margin-left: 0"
v-hasPermi="['clue:order:return']"
@click="feeBack(scope.row)"
>
回款
</el-button>
<el-button
type="primary"
class="mr-10px"
link
style="padding: 0; margin-left: 0"
v-hasPermi="['clue:order:return-audit']"
>
回款确认
</el-button>
</template>
</el-table-column>
</SSTable>
</div>
<el-tabs v-model="tabName">
<el-tab-pane label="成交列表" name="list">
<OrderList v-if="tabName == 'list'" />
</el-tab-pane>
<el-tab-pane label="回款申请" name="commission">
<Reback v-if="tabName == 'commission'" />
</el-tab-pane>
<el-tab-pane label="售后申请" name="aftersale">
<AfterSales v-if="tabName == 'aftersale'" />
</el-tab-pane>
<el-tab-pane label="发货列表" name="delivery" v-if="appStore.getAppInfo?.instanceType == 2">
<OrderList v-if="tabName == 'delivery'" />
</el-tab-pane>
</el-tabs>
</template>
<script setup name="ClueOrder">
import { getSimpleFieldList } from '@/api/clue/orderField'
import * as SignApi from '@/api/clue/sign'
import { useAppStore } from '@/store/modules/app'
import OrderList from './Comp/OrderList.vue'
import Reback from './Comp/Reback.vue'
import AfterSales from './Comp/AfterSales.vue'
import { removeNullField } from '@/utils'
const allSchemas = ref({})
const searchRef = ref()
const tableObject = ref({
tableList: [],
loading: false,
total: 1,
pageSize: 20,
currentPage: 1
})
function resetQuery() {
searchRef.value.reset()
tableObject.value.currentPage = 1
getTableList()
}
// 查询
async function getTableList() {
// 查询
tableObject.value.loading = true
try {
const queryParams = await searchRef.value.getFormModel()
const params = {
...queryParams,
pageNo: tableObject.value.currentPage,
pageSize: tableObject.value.pageSize
}
const data = await SignApi.getSignPage(removeNullField(params))
tableObject.value.tableList = data.list.map((it) => ({ ...it, ...it.diyParams }))
tableObject.value.total = data.total
} finally {
tableObject.value.loading = false
}
}
const loading = ref(true)
async function getCurdSchemas() {
loading.value = true
try {
const data = await getSimpleFieldList()
allSchemas.value = useCrudSchemas(data).allSchemas
} finally {
loading.value = false
nextTick(() => {
getTableList()
})
}
}
// 售后
function sellAfter() {
// 方法体
}
onMounted(() => {
getCurdSchemas()
})
const appStore = useAppStore()
const tabName = ref('list')
</script>
<style lang="scss" scoped></style>