订单管理
This commit is contained in:
parent
da443dc7ed
commit
6afc735e7e
@ -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生产单位列表
|
// 查询s生产单位列表
|
||||||
export function listproductList(data,query) {
|
export function listproductList(data,query) {
|
||||||
return request({
|
return request({
|
||||||
@ -35,6 +45,16 @@ export function getsalemaincheckAmount(queryParams) {
|
|||||||
// isEncrypt: false
|
// isEncrypt: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 获取当前商业用户票扣列表
|
||||||
|
// 相当于补差
|
||||||
|
export function salemainpiAoKouList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/bussiness/salemain/piAoKouLiSt',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
isEncrypt: false
|
||||||
|
})
|
||||||
|
}
|
||||||
// 新增
|
// 新增
|
||||||
export function addsalemain(data) {
|
export function addsalemain(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -73,7 +93,6 @@ export function businessManagerReviewGoodsList(salemainId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
export function delsalemain(id) {
|
export function delsalemain(id) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pinia-plugin-persistedstate": "^4.5.0",
|
"pinia-plugin-persistedstate": "^4.7.1",
|
||||||
"radash": "^12.1.1"
|
"radash": "^12.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -740,7 +740,7 @@ const toShowBucha = () => {
|
|||||||
.goods-header {
|
.goods-header {
|
||||||
background: #409eff;
|
background: #409eff;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 10px 16px;
|
padding: 5px 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|||||||
@ -448,7 +448,7 @@ const goCancel = () => {
|
|||||||
.goods-header {
|
.goods-header {
|
||||||
background: #409eff;
|
background: #409eff;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 10px 16px;
|
padding: 5px 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -26,8 +26,17 @@ export default {
|
|||||||
piaokoutype: "运费补差",
|
piaokoutype: "运费补差",
|
||||||
shortname: "MPT20",
|
shortname: "MPT20",
|
||||||
goodsname: "盐酸丙卡特罗片(美普清)20",
|
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,
|
piaokouid: 3,
|
||||||
goodsid: 5, // 对应瑞巴派特片(膜固思达)24
|
goodsid: 5, // 对应瑞巴派特片(膜固思达)24
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="example">
|
<MBCard>
|
||||||
<uni-forms ref="baseForm" :modelValue="baseFormData" label-width="20vw">
|
<uni-forms ref="baseForm" :modelValue="queryParams">
|
||||||
|
<uni-forms-item label="货主">
|
||||||
<uni-forms-item label="生产单位">
|
|
||||||
<uni-data-select
|
<uni-data-select
|
||||||
v-model="queryParams.CompanyId"
|
v-model="queryParams.CompanyId"
|
||||||
:clear="true"
|
:clear="true"
|
||||||
@ -11,71 +10,44 @@
|
|||||||
text-field="deptName"
|
text-field="deptName"
|
||||||
value-field="deptId"
|
value-field="deptId"
|
||||||
@change="getTableData"
|
@change="getTableData"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="状态">
|
<uni-forms-item label="状态">
|
||||||
<uni-data-select
|
<uni-data-select
|
||||||
v-model="queryParams.state"
|
v-model="queryParams.state"
|
||||||
:clear="true"
|
:clear="true"
|
||||||
:localdata="stateList"
|
:localdata="stateList"
|
||||||
@change="getTableData"
|
@change="getTableData"
|
||||||
></uni-data-select>
|
></uni-data-select>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="合同编号">
|
<uni-forms-item label="合同编号">
|
||||||
<input
|
<input
|
||||||
v-model="queryParams.contractcode"
|
v-model="queryParams.contractcode"
|
||||||
class="uni-input custom-input"
|
class="uni-input custom-input"
|
||||||
placeholder="请输入合同编号"
|
placeholder="请输入合同编号"
|
||||||
@confirm="getTableData"/>
|
@confirm="getTableData"/>
|
||||||
</uni-forms-item>
|
</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>
|
</uni-forms>
|
||||||
<button type="primary" @click="gotoNewAdd">新增</button>
|
|
||||||
</view>
|
<button
|
||||||
|
type="primary"
|
||||||
<view v-if="filteredContracts.length === 0" class="no-data">
|
@click="gotoNewAdd"
|
||||||
<text>暂无匹配的合同数据</text>
|
v-if="userType === '01' || userType === '02'"
|
||||||
</view>
|
>
|
||||||
|
新增
|
||||||
|
</button>
|
||||||
|
</MBCard>
|
||||||
|
|
||||||
|
<MBLoading v-if="loading"/>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<uni-card
|
<ListItem :items="tableData" />
|
||||||
v-for="(contract, index) in filteredContracts"
|
<MBPagination
|
||||||
:key="contract.saleid"
|
v-if="total > 0"
|
||||||
:class="index % 2 === 0 ? 'card-even' : 'card-odd'"
|
v-model:limit="paging.pageSize"
|
||||||
:title="contract.usernames"
|
v-model:page="paging.pageNum"
|
||||||
@click="gotoDetail(contract)"
|
:total="total"
|
||||||
>
|
@pagination="handleQuery"
|
||||||
<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>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -84,9 +56,17 @@
|
|||||||
import {listproductList, listsalemain} from "../../../api/orderManager/index.js"
|
import {listproductList, listsalemain} 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 DictTag from '@/components/dict-tag/dict-tag.vue';
|
|
||||||
import {useOrderManagerStore} from "../../../store/modules/orderManager.js"
|
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 {proxy} = getCurrentInstance()
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const baseFormData = ref({})
|
const baseFormData = ref({})
|
||||||
@ -94,11 +74,15 @@ const baseFormData = ref({})
|
|||||||
const orderTypeList = ref([])
|
const orderTypeList = ref([])
|
||||||
const paymentValue = ref(0)
|
const paymentValue = ref(0)
|
||||||
const companyValue = ref(0)
|
const companyValue = ref(0)
|
||||||
|
|
||||||
|
// 添加加载状态
|
||||||
|
const loading = ref(true)
|
||||||
|
const total = ref(0)
|
||||||
const paging = ref({
|
const paging = ref({
|
||||||
// 页码
|
// 页码
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
// 分页数量
|
// 分页数量
|
||||||
pageSize: 999,
|
pageSize: 2,
|
||||||
isAsc: 'descending',
|
isAsc: 'descending',
|
||||||
orderByColumn: 'adddate'
|
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",
|
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 stateList = ref([])
|
||||||
const companyOptions = ref([])
|
const companyOptions = ref([])
|
||||||
|
|
||||||
// 合同数据
|
// 合同数据
|
||||||
const contracts = ref([])
|
const tableData = 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(() => {
|
onMounted(async () => {
|
||||||
getDictData()
|
try {
|
||||||
getTableData()
|
loading.value = true
|
||||||
getDeptLists()
|
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) {
|
function formatDate(dateString) {
|
||||||
@ -156,49 +123,55 @@ function formatDate(dateString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取字典数据
|
//获取字典数据
|
||||||
const getDictData = () => {
|
const getDictData = async () => {
|
||||||
getDicts("order_state").then(res => {
|
try {
|
||||||
console.log('order_state', res.data)
|
const [stateRes, typeRes] = await Promise.all([
|
||||||
stateList.value = res.data.map(item => {
|
getDicts("order_state"),
|
||||||
|
getDicts("dazhong_dingdan_type")
|
||||||
|
])
|
||||||
|
stateList.value = stateRes.data.map(item => {
|
||||||
return {
|
return {
|
||||||
value: item.dictValue,
|
value: item.dictValue,
|
||||||
text: item.dictLabel
|
text: item.dictLabel
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
getDicts("dazhong_dingdan_type").then(res => {
|
orderTypeList.value = typeRes.data
|
||||||
console.log('dazhong_dingdan_type', res.data)
|
} catch (error) {
|
||||||
orderTypeList.value = res.data
|
console.error('获取字典数据失败:', error)
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取列表数据
|
//获取列表数据
|
||||||
const getTableData = () => {
|
const getTableData = async () => {
|
||||||
|
try {
|
||||||
console.log(queryParams.value)
|
loading.value = true
|
||||||
listsalemain(queryParams.value, paging.value).then(res => {
|
const data = await listsalemain(queryParams.value, paging.value)
|
||||||
|
total.value = data.total
|
||||||
contracts.value = res.rows
|
tableData.value = data.rows
|
||||||
// total.value = res.total;
|
} 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 => {
|
companyOptions.value = res.data.map(item => {
|
||||||
return {
|
return {
|
||||||
value: item.deptId,
|
value: item.deptId,
|
||||||
text: item.deptName
|
text: item.deptName
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log('companyOptions.value', companyOptions.value)
|
} catch (error) {
|
||||||
});
|
console.error('获取部门列表失败:', error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 筛选合同
|
// 筛选合同
|
||||||
function filterContracts(e) {
|
function filtertableData(e) {
|
||||||
console.log("筛选条件变化:", e)
|
console.log("筛选条件变化:", e)
|
||||||
// 计算属性会自动更新,无需额外操作
|
// 计算属性会自动更新,无需额外操作
|
||||||
}
|
}
|
||||||
@ -211,9 +184,6 @@ const handleInput = (e) => {
|
|||||||
// 跳转到详情页
|
// 跳转到详情页
|
||||||
function gotoDetail(contract) {
|
function gotoDetail(contract) {
|
||||||
console.log("查看合同详情:", 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
|
//存储要传的值到pinia
|
||||||
useOrderManagerStore().addOrder(contract)
|
useOrderManagerStore().addOrder(contract)
|
||||||
console.log('数据', useOrderManagerStore().orders)
|
console.log('数据', useOrderManagerStore().orders)
|
||||||
@ -226,7 +196,6 @@ function gotoDetail(contract) {
|
|||||||
url: "/pages/work/OrderManager/components/LookData"
|
url: "/pages/work/OrderManager/components/LookData"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const gotoNewAdd = () => {
|
const gotoNewAdd = () => {
|
||||||
@ -234,14 +203,43 @@ const gotoNewAdd = () => {
|
|||||||
url: "/pages/work/OrderManager/components/NewAdd"
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<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 {
|
.custom-input {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user