200 lines
4.9 KiB
Vue
Raw Normal View History

2025-08-20 13:59:17 +08:00
<template>
2026-02-05 15:13:59 +08:00
<view class="container">
<MBCard>
<uni-forms ref="baseForm" :modelValue="queryParams">
2026-02-05 15:13:59 +08:00
<uni-forms-item label="支付方式">
<DictSelect v-model="queryParams.isPayNow" dict="dazhong_paytype" @change="handleQuery"/>
2026-02-05 15:13:59 +08:00
</uni-forms-item>
<uni-forms-item label="生产单位">
<ProductionUnit v-model="queryParams.companyId" @change="handleQuery"/>
2026-02-05 15:13:59 +08:00
</uni-forms-item>
</uni-forms>
</MBCard>
2026-02-05 15:13:59 +08:00
<MBLoading v-if="loading"/>
2026-02-05 15:13:59 +08:00
<view v-else>
<ListItem :items="tableData"/>
<MBPagination
v-if="total > 0"
v-model:limit="paging.pageSize"
v-model:page="paging.pageNum"
:total="total"
@pagination="handleQuery"
/>
2026-02-05 15:13:59 +08:00
</view>
</view>
2025-08-20 13:59:17 +08:00
</template>
<script setup>
2026-02-05 15:13:59 +08:00
import {computed, getCurrentInstance, onMounted, ref} from "vue"
import {contractData} from "./data.js"
import UniForms from "../../../uni_modules/uni-forms/components/uni-forms/uni-forms.vue";
import UniFormsItem from "../../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue";
import DictSelect from "../../../components/DictSelect/DictSelect.vue";
import ProductionUnit from "../../../components/ProductionUnit/ProductionUnit.vue";
import MBCard from "../../../components/MB/MBCard.vue";
import {mangerList} from "../../../api/BusinessApproval";
import MBPagination from "../../../components/MB/MBPagination.vue";
import MBLoading from "../../../components/MB/MBLoading.vue";
import ListItem from "./ListItem.vue";
2026-02-05 15:13:59 +08:00
const {proxy} = getCurrentInstance()
const queryParams = ref({
state: '1',
isPayNow: '',
companyId: ''
})
const loading = ref(true)
const total = ref(0)
const paging = ref({
pageNum: 1,
pageSize: 10,
isAsc: 'descending',
orderByColumn: 'adddate'
})
const tableData = ref([])
const handleQuery = async () => {
loading.value = true
const data = await mangerList(queryParams.value, paging.value)
total.value = data.total
tableData.value = data.rows
loading.value = false
}
onMounted(async () => {
await handleQuery()
})
// ===========================================================================================
2025-08-20 13:59:17 +08:00
// 表单数据
const baseFormData = ref({})
const paymentValue = ref('')
2025-08-20 13:59:17 +08:00
const companyValue = ref(0)
// 筛选选项
const paymentOptions = ref([
2026-02-05 15:13:59 +08:00
{value: 0, text: "全部支付方式"},
{value: 1, text: "账期支付"},
{value: 2, text: "预付款"}
2025-08-20 13:59:17 +08:00
])
const companyOptions = ref([
2026-02-05 15:13:59 +08:00
{value: 0, text: "全部生产单位"},
{value: 1, text: "浙江大冢制药有限公司"},
{value: 2, text: "广东大冢制药有限公司"}
2025-08-20 13:59:17 +08:00
])
// 合同数据
const contracts = ref([])
// 过滤后的合同数据
const filteredContracts = computed(() => {
2026-02-05 15:13:59 +08:00
let result = contracts.value
// 根据生产单位筛选
if (companyValue.value === 1) {
result = result.filter(contract => contract.companyName.includes('浙江'))
} else if (companyValue.value === 2) {
result = result.filter(contract => contract.companyName.includes('广东'))
}
// 可以根据支付方式添加更多筛选逻辑
return result
2025-08-20 13:59:17 +08:00
})
// 初始化数据
onMounted(() => {
2026-02-05 15:13:59 +08:00
contracts.value = contractData.rows
2025-08-20 13:59:17 +08:00
})
// 格式化日期
function formatDate(dateString) {
2026-02-05 15:13:59 +08:00
if (!dateString) return '未知日期'
return dateString.split(' ')[0]
2025-08-20 13:59:17 +08:00
}
// 筛选合同
function filterContracts(e) {
2026-02-05 15:13:59 +08:00
console.log("筛选条件变化:", e)
// 计算属性会自动更新,无需额外操作
2025-08-20 13:59:17 +08:00
}
// 跳转到详情页
function gotoDetail(contract) {
2026-02-05 15:13:59 +08:00
console.log("查看合同详情:", contract)
// proxy.$tab.navigateTo('/pages/work/yonghu/detail')
// proxy.$tab.navigateTo(`/pages/work/yonghu/detail?saleid=${contract.saleid}`)
proxy.$tab.navigateTo('/pages/work/BusinessApproval/OrderDetail')
2025-08-20 13:59:17 +08:00
}
</script>
<style lang="scss" scoped>
.container {
2026-02-05 15:13:59 +08:00
padding: 10px;
background-color: #f5f7fa;
min-height: 100vh;
2025-08-20 13:59:17 +08:00
}
.example {
2026-02-05 15:13:59 +08:00
padding: 10px;
background: #fff;
border-radius: 8px;
margin-bottom: 15px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
2025-08-20 13:59:17 +08:00
}
:deep(.uni-section .uni-section-header) {
2026-02-05 15:13:59 +08:00
padding: 0;
2025-08-20 13:59:17 +08:00
}
:deep(.uni-card) {
2026-02-05 15:13:59 +08:00
padding: 0 !important;
margin: 10px 0 !important;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
2025-08-20 13:59:17 +08:00
}
:deep(.uni-card__content) {
2026-02-05 15:13:59 +08:00
padding: 12px !important;
2025-08-20 13:59:17 +08:00
}
.demo-uni-row {
2026-02-05 15:13:59 +08:00
padding: 5px 0;
font-size: 14px;
2025-08-20 13:59:17 +08:00
}
.demo-uni-col {
2026-02-05 15:13:59 +08:00
padding: 2px 0;
&.dark {
color: #333;
font-weight: 500;
}
&.light {
color: #666;
}
2025-08-20 13:59:17 +08:00
}
.card-even {
2026-02-05 15:13:59 +08:00
border-left: 4px solid #2979ff;
2025-08-20 13:59:17 +08:00
}
.card-odd {
2026-02-05 15:13:59 +08:00
border-left: 4px solid #19be6b;
2025-08-20 13:59:17 +08:00
}
.no-data {
2026-02-05 15:13:59 +08:00
text-align: center;
padding: 40px 0;
color: #999;
font-size: 16px;
2025-08-20 13:59:17 +08:00
}
</style>