* 'main' of http://106.15.139.36:30000/bestunion/Otsuka-APP:
  更新 readme.txt
  订单管理列表
  订单管理
This commit is contained in:
lonewolfyx 2026-02-10 17:02:42 +08:00
commit 56db1ccfb7
9 changed files with 924 additions and 729 deletions

View File

@ -8,6 +8,16 @@ export function listsalemain(data,query) {
})
}
// 新增订单时获取货主/system/dept/productListWithUserId
export function productListWithUserId() {
return request({
url: '/system/dept/productListWithUserId',
method: 'get',
isEncrypt: false
})
}
// 查询s生产单位列表
export function listproductList(data,query) {
return request({
@ -35,6 +45,16 @@ export function getsalemaincheckAmount(queryParams) {
// isEncrypt: false
})
}
// 获取当前商业用户票扣列表
// 相当于补差
export function salemainpiAoKouList(data) {
return request({
url: '/bussiness/salemain/piAoKouLiSt',
method: 'post',
data: data,
isEncrypt: false
})
}
// 新增
export function addsalemain(data) {
return request({
@ -73,7 +93,6 @@ export function businessManagerReviewGoodsList(salemainId) {
}
// 删除
export function delsalemain(id) {
return request({

View File

@ -1,6 +1,6 @@
{
"dependencies": {
"pinia-plugin-persistedstate": "^4.5.0",
"pinia-plugin-persistedstate": "^4.7.1",
"radash": "^12.1.1"
}
}

View File

@ -0,0 +1,178 @@
<template>
<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"
style="margin: 0;margin-bottom: 20px"
@click="handleDetail(item)"
>
<view class="context">
<view class="label">
<text>货主:</text>
<text>{{ item.companyName }}</text>
</view>
<view class="label">
<text>金额:</text>
<text>{{ formatPrice(item.contractmoney) }}</text>
</view>
<view class="label">
<text>订单类型:</text>
<view>
<dict-tag :options="orderTypeList" :value="item.type"/>
</view>
</view>
<view class="label">
<text>制单日期:</text>
<text>{{ formatDate(item.adddate, 'yyyy-MM-dd') }}</text>
</view>
<view class="label">
<text>状态:</text>
<text>
<text>{{ item.stateText }}</text>
</text>
</view>
<view class="label">
<text>操作:</text>
<view class="action-buttons">
<button type='primary' :plain="true" @click="Edit(item)" class="btn">编辑</button>
<button type='warn'
plain='true'
@click="deleteData(item)"
class="btn"
v-if="item.state == 1 || item.state == -1 || item.state == -2"
>删除</button>
</view>
</view>
</view>
</uni-card>
</template>
<script setup>
import {defineOptions, defineProps, getCurrentInstance,computed,onMounted, ref} from 'vue'
import UniCard from "../../../uni_modules/uni-card/components/uni-card/uni-card.vue";
import {formatDate} from "../../../uni_modules/uni-dateformat/components/uni-dateformat/date-format";
import {formatPrice} from "../../../utils/utils";
import DictTag from "../../../components/dict-tag/dict-tag.vue";
import {delsalemain} from "../../../api/orderManager/index.js"
const {proxy} = getCurrentInstance()
// const {order_state, dazhong_dingdan_type} = proxy.useDict(['order_state', 'dazhong_dingdan_type'])
import {getDicts} from "../../../api/system/dict/data.js"
defineOptions({
name: 'ListItem'
})
const props = defineProps(['items'])
const stateList = ref([])
const orderTypeList = ref([])
//
onMounted(async () => {
try {
await getDictData()
} finally {
}
})
const Edit = async (row) => {
try {
console.log(row,'当前行数据')
//
} catch (error) {
console.error('失败:', error)
}
}
//
const deleteData = async (row) => {
uni.showModal({
title: '删除确认',
content: `确定删除合同 ${row.contractcode || ''} 吗?`,
confirmText: '确定',
cancelText: '取消',
confirmColor: '#DD524D',
success: async (res) => {
if (res.confirm) {
try {
uni.showLoading({
title: '删除中...',
mask: true
})
await delsalemain(row.saleid)
uni.hideLoading()
uni.showToast({
title: '删除成功',
icon: 'success'
})
//
proxy.$emit('refresh')
} catch (error) {
uni.hideLoading()
console.error('删除失败:', error)
uni.showToast({
title: '删除失败',
icon: 'error'
})
}
}
}
})
}
//
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) => {
proxy.$tab.navigateTo(`/pages/work/OrderManager/components/EditData?id=${row.saleid}`)
}
</script>
<style lang="scss" scoped>
:deep().uni-app-tag-span{
font-size:12px
}
button{font-size: 12px;margin:0 5px;}
.btn{
padding-left:6px;
padding-right: 6px;
line-height:2;
}
/* 操作按钮 */
.action-buttons {
display: flex;
justify-content: center;
}
</style>

View File

@ -740,7 +740,7 @@ const toShowBucha = () => {
.goods-header {
background: #409eff;
color: white;
padding: 10px 16px;
padding: 5px 8px;
display: flex;
align-items: center;
gap: 12px;

View File

@ -448,7 +448,7 @@ const goCancel = () => {
.goods-header {
background: #409eff;
color: white;
padding: 10px 16px;
padding: 5px 8px;
display: flex;
align-items: center;
gap: 12px;

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,16 @@ export default {
piaokoutype: "运费补差",
shortname: "MPT20",
goodsname: "盐酸丙卡特罗片(美普清)20",
piaokou: 8.00
piaokou: 10000.01
},
{
piaokouid: 102,
goodsid: 3, // 对应盐酸丙卡特罗片(美普清)20
applydate: "2024-01-17",
piaokoutype: "运费补差",
shortname: "MPT20",
goodsname: "盐酸丙卡特罗片(美普清)20",
piaokou: 20000.02
},
{
piaokouid: 3,

View File

@ -1,9 +1,8 @@
<template>
<view class="container">
<view class="example">
<uni-forms ref="baseForm" :modelValue="baseFormData" label-width="20vw">
<uni-forms-item label="生产单位">
<MBCard>
<uni-forms ref="baseForm" :modelValue="queryParams">
<uni-forms-item label="货主">
<uni-data-select
v-model="queryParams.CompanyId"
:clear="true"
@ -11,7 +10,6 @@
text-field="deptName"
value-field="deptId"
@change="getTableData"
/>
</uni-forms-item>
<uni-forms-item label="状态">
@ -29,53 +27,27 @@
placeholder="请输入合同编号"
@confirm="getTableData"/>
</uni-forms-item>
<!-- <uni-forms-item label="合同编号" >
<view class="uni-form-item uni-column">
<input class="uni-input" focus placeholder="自动获得焦点" />
</view>
</uni-forms-item> -->
</uni-forms>
<button type="primary" @click="gotoNewAdd">新增</button>
</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"
:class="index % 2 === 0 ? 'card-even' : 'card-odd'"
:title="contract.usernames"
@click="gotoDetail(contract)"
<button
type="primary"
@click="gotoNewAdd"
v-if="userType === '01' || userType === '02'"
>
<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" style="display: flex;">
<view class="demo-uni-col light">订单类型:</view>
<dict-tag :options="orderTypeList" :value="contract.type" style="color: red;"/>
</uni-col>
</uni-row>
</uni-card>
新增
</button>
</MBCard>
<MBLoading v-if="loading"/>
<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"
/>
</view>
</view>
</template>
@ -84,9 +56,17 @@
import {listproductList, listsalemain} from "../../../api/orderManager/index.js"
import {computed, getCurrentInstance, onMounted, ref} from "vue"
import {getDicts} from "../../../api/system/dict/data.js"
// import DictTag from '@/components/dict-tag/dict-tag.vue';
import {useOrderManagerStore} from "../../../store/modules/orderManager.js"
// import { log } from "console"
import MBCard from "../../../components/MB/MBCard.vue";
import MBPagination from "../../../components/MB/MBPagination.vue";
import MBLoading from "../../../components/MB/MBLoading.vue";
import ListItem from "./ListItem.vue";
import { getUserProfile } from "@/api/system/user"
const userType = ref()
const {proxy} = getCurrentInstance()
//
const baseFormData = ref({})
@ -94,11 +74,15 @@ const baseFormData = ref({})
const orderTypeList = ref([])
const paymentValue = ref(0)
const companyValue = ref(0)
//
const loading = ref(true)
const total = ref(0)
const paging = ref({
//
pageNum: 1,
//
pageSize: 999,
pageSize: 2,
isAsc: 'descending',
orderByColumn: 'adddate'
})
@ -107,47 +91,30 @@ const queryParams = ref({
state: "0,1,-1,2,-2,3,-3,9,10,11,12,-12,13,-13,14,15,16",
}
})
//
// const stateList = ref([
// { value: '0', text: "" },
// { value: '1', text: "" },
// { value: '-1', text: "退" },
// { value: '2', text: "" },
// { value: '-2', text: "退" },
// { value:'3', text: "" },
// { value: '-3', text: "退" },
// { value: '9', text: "" },
// { value: '10', text: "" },
// { value: '11', text: "" },
// ])
const stateList = ref([])
const companyOptions = ref([])
//
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
})
const tableData = ref([])
//
onMounted(() => {
getDictData()
getTableData()
getDeptLists()
onMounted(async () => {
try {
loading.value = true
await getDictData()
await getDeptLists()
await getUser()
await getTableData()
} finally {
loading.value = false
}
})
function getUser() {
getUserProfile().then(response => {
userType.value = response.data.userType
})
}
//
function formatDate(dateString) {
@ -156,49 +123,55 @@ function formatDate(dateString) {
}
//
const getDictData = () => {
getDicts("order_state").then(res => {
console.log('order_state', res.data)
stateList.value = res.data.map(item => {
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
}
})
})
getDicts("dazhong_dingdan_type").then(res => {
console.log('dazhong_dingdan_type', res.data)
orderTypeList.value = res.data
})
orderTypeList.value = typeRes.data
} catch (error) {
console.error('获取字典数据失败:', error)
}
}
//
const getTableData = () => {
console.log(queryParams.value)
listsalemain(queryParams.value, paging.value).then(res => {
contracts.value = res.rows
// total.value = res.total;
});
const getTableData = async () => {
try {
loading.value = true
const data = await listsalemain(queryParams.value, paging.value)
total.value = data.total
tableData.value = data.rows
} catch (error) {
console.error('获取数据失败:', error)
} finally {
loading.value = false
}
}
const getDeptLists = () => {
listproductList().then(res => {
const getDeptLists = async () => {
try {
const res = await listproductList()
companyOptions.value = res.data.map(item => {
return {
value: item.deptId,
text: item.deptName
}
})
console.log('companyOptions.value', companyOptions.value)
});
} catch (error) {
console.error('获取部门列表失败:', error)
}
}
//
function filterContracts(e) {
function filtertableData(e) {
console.log("筛选条件变化:", e)
//
}
@ -211,9 +184,6 @@ const handleInput = (e) => {
//
function gotoDetail(contract) {
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/OrderManager/OrderDetail')
//pinia
useOrderManagerStore().addOrder(contract)
console.log('数据', useOrderManagerStore().orders)
@ -226,7 +196,6 @@ function gotoDetail(contract) {
url: "/pages/work/OrderManager/components/LookData"
});
}
}
const gotoNewAdd = () => {
@ -234,14 +203,43 @@ const gotoNewAdd = () => {
url: "/pages/work/OrderManager/components/NewAdd"
});
}
const handleQuery = async () => {
try {
loading.value = true
const data = await listsalemain(queryParams.value, paging.value)
total.value = data.total
tableData.value = data.rows
} catch (error) {
console.error('获取数据失败:', error)
} finally {
loading.value = false
}
}
</script>
<style lang="scss" scoped>
/* 加载动画容器 */
.loading-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 40px 0;
min-height: 300px;
}
.loading-text {
margin-top: 10px;
color: #666;
font-size: 14px;
}
.custom-input {
border: 1px solid #ccc;
border-radius: 4px;
padding: 5px;
height: 35px;
font-size: 12px;
}
.container {

View File

@ -1 +1 @@
第一次vue3提交提交提交。我从git上修改了
第一次vue3提交提交提交。我从git上修改了,测试修改一下