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