优化
This commit is contained in:
parent
15ddc0094b
commit
b2b75a670d
@ -145,3 +145,14 @@ export function getInvoiceList(saleid) {
|
||||
}
|
||||
|
||||
|
||||
// 获取商业公司列表
|
||||
export function getBusinessList(data) {
|
||||
return request({
|
||||
url: '/system/user/list_business',
|
||||
method: 'post',
|
||||
data:data,
|
||||
isEncrypt: false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,9 +3,9 @@ export default {
|
||||
// baseUrl: 'https://vue.ruoyi.vip/prod-api', //
|
||||
// baseUrl: '/prod-api', //前后端分离版的接口地址,转发代理 设置在了manifest.json文件中
|
||||
// baseUrl: 'http://192.168.99.25:18090', //--慎用--慎用--慎用前后端分离版的接口地址--大冢服务器--慎用
|
||||
baseUrl: 'http://106.15.139.36:18090', //前后端分离版的接口地址
|
||||
// baseUrl: 'http://106.15.139.36:18090', //前后端分离版的接口地址
|
||||
|
||||
// baseUrl: '/prod-api', //前后端分离版的接口地址
|
||||
baseUrl: '/prod-api', //前后端分离版的接口地址
|
||||
//测试提交
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<uni-forms-item label="支付方式">
|
||||
<DictSelect v-model="queryParams.isPayNow" dict="dazhong_paytype" @change="handleQuery"/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="生产单位">
|
||||
<uni-forms-item label="货主">
|
||||
<ProductionUnit v-model="queryParams.companyId" @change="handleQuery"/>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<view class="container">
|
||||
<MBCard>
|
||||
<uni-forms ref="baseForm" :modelValue="queryParams">
|
||||
<uni-forms-item label="生产单位">
|
||||
<uni-forms-item label="货主">
|
||||
<ProductionUnit v-model="queryParams.companyId" @change="handleQuery"/>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
<template>
|
||||
<view>
|
||||
<template v-if="items && items.length > 0">
|
||||
<uni-card
|
||||
v-for="(item,index) in items"
|
||||
:key="item.saleid"
|
||||
:class="index % 2 === 0 ? 'card-even' : 'card-odd'"
|
||||
:extra="item.contractcode"
|
||||
:title="item.usernames"
|
||||
:title="`${index + 1}. ${item.usernames}`"
|
||||
style="margin: 0;margin-bottom: 20px"
|
||||
@click="handleDetail(item)"
|
||||
>
|
||||
@ -20,7 +22,7 @@
|
||||
<view class="label">
|
||||
<text>订单类型:</text>
|
||||
<view>
|
||||
<dict-tag :options="orderTypeList" :value="item.type"/>
|
||||
<dict-tag :options="props.orderTypeList" :value="item.type"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="label">
|
||||
@ -105,6 +107,11 @@
|
||||
</view>
|
||||
</uni-card>
|
||||
</template>
|
||||
<view v-else class="no-data">
|
||||
<text>暂无数据</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {defineOptions, defineProps, getCurrentInstance,computed,onMounted, ref} from 'vue'
|
||||
@ -125,43 +132,43 @@ defineOptions({
|
||||
name: 'ListItem'
|
||||
})
|
||||
|
||||
const userType = ref()
|
||||
|
||||
const props = defineProps(['items'])
|
||||
|
||||
const stateList = ref([])
|
||||
const orderTypeList = ref([])
|
||||
// 定义 props - 从父组件接收所有需要的数据
|
||||
const props = defineProps({
|
||||
items: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
orderTypeList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
userType: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['refresh'])
|
||||
// 初始化数据
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await getDictData()
|
||||
await getUser()
|
||||
|
||||
} finally {
|
||||
}
|
||||
})
|
||||
function getUser() {
|
||||
getUserProfile().then(response => {
|
||||
userType.value = response.data.userType
|
||||
})
|
||||
}
|
||||
const Edit = async (row) => {
|
||||
try {
|
||||
console.log(row,'当前行数据')
|
||||
//具体逻辑
|
||||
const params = {
|
||||
companyId: row.companyId,
|
||||
saleid: row.saleid,
|
||||
userid: row.userid,
|
||||
}
|
||||
// 序列化为JSON字符串,再编码
|
||||
const paramsStr = encodeURIComponent(JSON.stringify(params))
|
||||
proxy.$tab.navigateTo(`/pages/work/OrderManager/components/EditData?data=${paramsStr}`)
|
||||
|
||||
} catch (error) {
|
||||
console.error('失败:', error)
|
||||
}
|
||||
}
|
||||
const emit = defineEmits(['refresh'])
|
||||
// 删除
|
||||
const deleteData = async (row) => {
|
||||
uni.showModal({
|
||||
@ -187,7 +194,7 @@ const deleteData = async (row) => {
|
||||
})
|
||||
|
||||
// 触发父组件刷新
|
||||
proxy.$emit('refresh')
|
||||
emit('refresh')
|
||||
|
||||
} catch (error) {
|
||||
uni.hideLoading()
|
||||
@ -202,37 +209,11 @@ const deleteData = async (row) => {
|
||||
})
|
||||
}
|
||||
|
||||
//获取字典数据
|
||||
const getDictData = async () => {
|
||||
try {
|
||||
const [stateRes, typeRes] = await Promise.all([
|
||||
getDicts("order_state"),
|
||||
getDicts("dazhong_dingdan_type")
|
||||
])
|
||||
|
||||
stateList.value = stateRes.data.map(item => {
|
||||
return {
|
||||
value: item.dictValue,
|
||||
text: item.dictLabel
|
||||
}
|
||||
})
|
||||
orderTypeList.value = typeRes.data
|
||||
} catch (error) {
|
||||
console.error('获取字典数据失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
const handleDetail = (row) => {
|
||||
console.log(userType.value,'userType')
|
||||
if(userType.value == '01' || userType.value == '02'){
|
||||
console.log(props.userType,'userType')
|
||||
if(props.userType == '01' || props.userType == '02'){
|
||||
proxy.$tab.navigateTo(`/pages/work/OrderManager/components/LookDataSY?id=${row.saleid}`)
|
||||
}else{
|
||||
// uni.showToast({
|
||||
// title: '内部用户查看还在开发完善中!!',
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// })
|
||||
// return false;
|
||||
proxy.$tab.navigateTo(`/pages/work/OrderManager/components/LookDataNB?id=${row.saleid}`)
|
||||
}
|
||||
}
|
||||
@ -253,4 +234,13 @@ const handleDetail = (row) => {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.no-data {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
||||
@ -4,7 +4,7 @@
|
||||
<view class="info-section">
|
||||
<uni-row class="info-grid">
|
||||
<uni-col class="flex-row">
|
||||
<view class="label">生产单位: </view>
|
||||
<view class="label">货主: </view>
|
||||
<uni-data-select
|
||||
v-model="form.companyId"
|
||||
:localdata="companyOptions"
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<MBCard style="border-radius: 0;">
|
||||
<view class="" style="margin-bottom: 10px;">
|
||||
<view class="label">
|
||||
<text>生产单位:</text>
|
||||
<text>货主:</text>
|
||||
<text>{{ companyName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<view class="info-section">
|
||||
<uni-row class="info-grid">
|
||||
<uni-col class="flex-row">
|
||||
<view class="label">生产单位: </view>
|
||||
<view class="label">货主: </view>
|
||||
<uni-data-select
|
||||
v-model="form.companyId"
|
||||
:localdata="companyOptions"
|
||||
|
||||
@ -28,11 +28,15 @@
|
||||
@confirm="getTableData"/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="商业公司" v-if="userType === '00'" >
|
||||
<input
|
||||
v-model="queryParams.businessCompany"
|
||||
class="uni-input custom-input"
|
||||
<uni-data-select
|
||||
v-model="queryParams.userid"
|
||||
placeholder="请输入商业公司"
|
||||
@confirm="getTableData"/>
|
||||
:clear="true"
|
||||
:localdata="businessCompanyList"
|
||||
text-field="value"
|
||||
value-field="label"
|
||||
@change="getTableData"
|
||||
></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<button
|
||||
@ -46,7 +50,7 @@
|
||||
|
||||
<MBLoading v-if="loading"/>
|
||||
<view v-else>
|
||||
<ListItem :items="tableData" @refresh="getTableData" />
|
||||
<ListItem :items="tableData" @refresh="getTableData" :order-type-list="orderTypeList" :user-type="userType" />
|
||||
<MBPagination
|
||||
v-if="total > 0"
|
||||
v-model:limit="paging.pageSize"
|
||||
@ -59,7 +63,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {listproductList, listsalemain} from "../../../api/orderManager/index.js"
|
||||
import {listproductList, listsalemain,getBusinessList} from "../../../api/orderManager/index.js"
|
||||
import {computed, getCurrentInstance, onMounted, ref} from "vue"
|
||||
import {getDicts} from "../../../api/system/dict/data.js"
|
||||
import {useOrderManagerStore} from "../../../store/modules/orderManager.js"
|
||||
@ -100,7 +104,7 @@ const queryParams = ref({
|
||||
|
||||
const stateList = ref([])
|
||||
const companyOptions = ref([])
|
||||
|
||||
const businessCompanyList = ref([])
|
||||
// 合同数据
|
||||
const tableData = ref([])
|
||||
|
||||
@ -110,6 +114,7 @@ onMounted(async () => {
|
||||
loading.value = true
|
||||
await getDictData()
|
||||
await getDeptLists()
|
||||
await getBussinessLists()
|
||||
await getUser()
|
||||
await getTableData()
|
||||
} finally {
|
||||
@ -161,7 +166,7 @@ const getTableData = async () => {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取货主
|
||||
const getDeptLists = async () => {
|
||||
try {
|
||||
const res = await listproductList()
|
||||
@ -175,7 +180,38 @@ const getDeptLists = async () => {
|
||||
console.error('获取部门列表失败:', error)
|
||||
}
|
||||
}
|
||||
// 获取所有商业公司
|
||||
const getBussinessLists = async () => {
|
||||
try {
|
||||
const res = await getBusinessList({
|
||||
isUnit: 0,
|
||||
queryParam:{
|
||||
areaId: 0,
|
||||
}
|
||||
})
|
||||
businessCompanyList.value = res.data.map(item => {
|
||||
return {
|
||||
value: item.userid,
|
||||
text: item.businessname
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('获取商业公司列表失败:', error)
|
||||
}
|
||||
}
|
||||
// 添加一个新变量来存储选中的文本
|
||||
const selectedCompanyText = ref('')
|
||||
|
||||
// 处理公司选择
|
||||
const handleCompanySelect = (text) => {
|
||||
selectedCompanyText.value = text
|
||||
|
||||
// 找到对应的公司ID
|
||||
const company = businessCompanyList.value.find(item => item.text === text)
|
||||
queryParams.value.userid = company ? company.value : ''
|
||||
|
||||
getTableData()
|
||||
}
|
||||
// 筛选合同
|
||||
function filtertableData(e) {
|
||||
console.log("筛选条件变化:", e)
|
||||
|
||||
@ -23,19 +23,19 @@
|
||||
</uni-grid-item>
|
||||
<uni-grid-item @click="gotoOrder">
|
||||
<view class="grid-item-box">
|
||||
<uni-icons size="30" type="person-filled"></uni-icons>
|
||||
<uni-icons size="30" type="compose"></uni-icons>
|
||||
<text class="text">订单审核</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item @click="gotoFinalcial">
|
||||
<view class="grid-item-box">
|
||||
<uni-icons size="30" type="person-filled"></uni-icons>
|
||||
<uni-icons size="30" type="list"></uni-icons>
|
||||
<text class="text">财务审批</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item @click="gotoBusiness">
|
||||
<view class="grid-item-box">
|
||||
<uni-icons size="30" type="person-filled"></uni-icons>
|
||||
<uni-icons size="30" type="staff"></uni-icons>
|
||||
<text class="text">商务审批</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user