商务审批简单实例
This commit is contained in:
parent
1ba23463f0
commit
0bfc101bb1
10
pages.json
10
pages.json
@ -70,6 +70,16 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览文本"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/work/yonghu/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商务审批"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/work/yonghu/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商务审批详情"
|
||||
}
|
||||
}],
|
||||
"tabBar": {
|
||||
"color": "#000000",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<view class="content">
|
||||
<image class="logo" src="@/static/logo.png"></image>
|
||||
<view class="text-area">
|
||||
<text class="title">Hello RuoYi</text>
|
||||
<text class="title">大冢APS Ultra管理平台</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -15,10 +15,10 @@
|
||||
<uni-section title="系统管理" type="line"></uni-section>
|
||||
<view class="grid-body">
|
||||
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
|
||||
<uni-grid-item>
|
||||
<uni-grid-item @click="gotoshangwu">
|
||||
<view class="grid-item-box" >
|
||||
<uni-icons type="person-filled" size="30"></uni-icons>
|
||||
<text class="text">用户管理</text>
|
||||
<text class="text">商务审批</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item>
|
||||
@ -91,7 +91,11 @@
|
||||
}
|
||||
|
||||
function changeGrid(e) {
|
||||
proxy.$modal.showToast('模块建设中~')
|
||||
// proxy.$modal.showToast('模块建设中~')
|
||||
}
|
||||
|
||||
function gotoshangwu(e) {
|
||||
proxy.$tab.navigateTo('/pages/work/yonghu/index')
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
49
pages/work/yonghu/data.js
Normal file
49
pages/work/yonghu/data.js
Normal file
@ -0,0 +1,49 @@
|
||||
// staticData.js
|
||||
export const contractData = {
|
||||
"total": 2,
|
||||
"rows": [
|
||||
{
|
||||
"saleid": 999822,
|
||||
"adddate": "2025-08-20 09:05:26",
|
||||
"contractcode": "Z-CQ-000120",
|
||||
"contractmoney": 5767.4700,
|
||||
"usernames": "重庆医药集团医贸药品有限公司",
|
||||
"businessManagerName": "商务经理名字-西区",
|
||||
"transport": "汽运",
|
||||
"areaName": "重庆",
|
||||
"warehouseName": "临安GSP库",
|
||||
"companyName": "浙江大冢制药有限公司",
|
||||
"stateText": "待商务审批",
|
||||
"bigAreaName": "西区"
|
||||
},
|
||||
{
|
||||
"saleid": 999833,
|
||||
"adddate": "2025-08-20 09:05:26",
|
||||
"contractcode": "Z-CQ-000120",
|
||||
"contractmoney": 5767.4700,
|
||||
"usernames": "重庆医药集团医贸药品有限公司",
|
||||
"businessManagerName": "商务经理名字-西区",
|
||||
"transport": "汽运",
|
||||
"areaName": "重庆",
|
||||
"warehouseName": "临安GSP库",
|
||||
"companyName": "浙江大冢制药有限公司",
|
||||
"stateText": "待商务审批",
|
||||
"bigAreaName": "西区"
|
||||
},
|
||||
{
|
||||
"saleid": 166314,
|
||||
"adddate": "2025-07-08 15:09:20",
|
||||
"contractcode": "G-SC-40861",
|
||||
"contractmoney": 109296.0000,
|
||||
"usernames": "国药集团西南医药有限公司",
|
||||
"transport": "汽运",
|
||||
"areaName": "四川",
|
||||
"warehouseName": "广东三方(上药)",
|
||||
"companyName": "广东大冢制药有限公司",
|
||||
"stateText": "待商务审批",
|
||||
"bigAreaName": "西区"
|
||||
}
|
||||
],
|
||||
"code": 200,
|
||||
"msg": "查询成功"
|
||||
};
|
||||
34
pages/work/yonghu/detail.vue
Normal file
34
pages/work/yonghu/detail.vue
Normal file
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
详情{{saleid}}
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
const saleid = ref('')
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.saleid) {
|
||||
saleid.value = options.saleid
|
||||
// 这里可以根据saleid请求详情数据
|
||||
console.log('加载合同详情,ID:', saleid.value)
|
||||
// loadContractDetail(saleid.value)
|
||||
}
|
||||
})
|
||||
|
||||
function loadContractDetail(id) {
|
||||
// 根据saleid请求详情数据的逻辑
|
||||
console.log('加载合同详情,ID:', id)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
padding: 10px;
|
||||
background-color: #f5f7fa;
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
192
pages/work/yonghu/index.vue
Normal file
192
pages/work/yonghu/index.vue
Normal file
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="example">
|
||||
<uni-forms ref="baseForm" :modelValue="baseFormData" label-width="20vw">
|
||||
<uni-forms-item label="支付方式">
|
||||
<uni-data-select
|
||||
v-model="paymentValue"
|
||||
:localdata="paymentOptions"
|
||||
@change="filterContracts"
|
||||
></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="生产单位">
|
||||
<uni-data-select
|
||||
v-model="companyValue"
|
||||
:localdata="companyOptions"
|
||||
@change="filterContracts"
|
||||
></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<view v-if="filteredContracts.length === 0" class="no-data">
|
||||
<text>暂无匹配的合同数据</text>
|
||||
</view>
|
||||
|
||||
<view v-else>
|
||||
<uni-card
|
||||
v-for="(contract, index) in filteredContracts"
|
||||
:key="contract.saleid"
|
||||
:title="contract.usernames"
|
||||
@click="gotoDetail(contract)"
|
||||
:class="index % 2 === 0 ? 'card-even' : 'card-odd'"
|
||||
>
|
||||
<uni-row class="demo-uni-row">
|
||||
<uni-col :span="12">
|
||||
<view class="demo-uni-col dark">生产单位: {{ contract.companyName }}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="demo-uni-col light">合同编号: {{ contract.contractcode }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row class="demo-uni-row">
|
||||
<uni-col :span="12">
|
||||
<view class="demo-uni-col dark">制单日期: {{ formatDate(contract.adddate) }}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="demo-uni-col light">订单金额: {{ contract.contractmoney.toFixed(2) }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row class="demo-uni-row">
|
||||
<uni-col :span="12">
|
||||
<view class="demo-uni-col dark">状态: {{ contract.stateText }}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="demo-uni-col light">区域: {{ contract.areaName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-card>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import { ref, reactive, onMounted, computed,getCurrentInstance } from "vue"
|
||||
import { contractData } from "./data.js" // 根据实际路径调整
|
||||
const { proxy } = getCurrentInstance()
|
||||
// 表单数据
|
||||
const baseFormData = ref({})
|
||||
const paymentValue = ref(0)
|
||||
const companyValue = ref(0)
|
||||
|
||||
// 筛选选项
|
||||
const paymentOptions = ref([
|
||||
{ value: 0, text: "全部支付方式" },
|
||||
{ value: 1, text: "账期支付" },
|
||||
{ value: 2, text: "预付款" }
|
||||
])
|
||||
|
||||
const companyOptions = ref([
|
||||
{ value: 0, text: "全部生产单位" },
|
||||
{ value: 1, text: "浙江大冢制药有限公司" },
|
||||
{ value: 2, text: "广东大冢制药有限公司" }
|
||||
])
|
||||
|
||||
// 合同数据
|
||||
const contracts = ref([])
|
||||
|
||||
// 过滤后的合同数据
|
||||
const filteredContracts = computed(() => {
|
||||
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
|
||||
})
|
||||
|
||||
// 初始化数据
|
||||
onMounted(() => {
|
||||
contracts.value = contractData.rows
|
||||
})
|
||||
|
||||
// 格式化日期
|
||||
function formatDate(dateString) {
|
||||
if (!dateString) return '未知日期'
|
||||
return dateString.split(' ')[0]
|
||||
}
|
||||
|
||||
// 筛选合同
|
||||
function filterContracts(e) {
|
||||
console.log("筛选条件变化:", e)
|
||||
// 计算属性会自动更新,无需额外操作
|
||||
}
|
||||
|
||||
// 跳转到详情页
|
||||
function gotoDetail(contract) {
|
||||
console.log("查看合同详情:", contract)
|
||||
// proxy.$tab.navigateTo('/pages/work/yonghu/detail')
|
||||
proxy.$tab.navigateTo(`/pages/work/yonghu/detail?saleid=${contract.saleid}`)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
padding: 10px;
|
||||
background-color: #f5f7fa;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.example {
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 15px;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
:deep(.uni-section .uni-section-header) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.uni-card) {
|
||||
padding: 0 !important;
|
||||
margin: 10px 0 !important;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
:deep(.uni-card__content) {
|
||||
padding: 12px !important;
|
||||
}
|
||||
|
||||
.demo-uni-row {
|
||||
padding: 5px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.demo-uni-col {
|
||||
padding: 2px 0;
|
||||
|
||||
&.dark {
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&.light {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.card-even {
|
||||
border-left: 4px solid #2979ff;
|
||||
}
|
||||
|
||||
.card-odd {
|
||||
border-left: 4px solid #19be6b;
|
||||
}
|
||||
|
||||
.no-data {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
color: #999;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
BIN
static/logo.png
BIN
static/logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 9.2 KiB |
Loading…
x
Reference in New Issue
Block a user