面包屑问题

main
wangmeng 2 months ago
parent 9034aac86e
commit 5db2eb6dd6
  1. 2
      src/api/order/orderList.js
  2. 10
      src/views/order/AddtoTemplate.vue
  3. 29
      src/views/order/category.vue
  4. 21
      src/views/order/orderAddEdit.vue
  5. 2
      src/views/order/orderChangeLog.vue
  6. 12
      src/views/order/orderList.vue
  7. 155
      src/views/product/add/productCostPrice.vue

@ -13,7 +13,7 @@ export const fetchOrderList = (params) => {
// 2. 获取客户列表(下拉选项)
export const getCustomerList = (params) =>{
return request({
url:'/api/jinchao/customer/search',
url:'/api/jinchao/customer/selectList',
method:'get',
params
})

@ -402,9 +402,13 @@ export default {
},
//
handleSelectProduct() {
let arr = [ {name:'工作台',url:'/wel'}]
this.$store.commit('SET_ROUTE_DATA', [ ...arr])
let arr = [{ name: '工作台', url: '/wel' }]
const routeDataN = this.routeData.filter(item => {
return !['/order/category', '/order/subcategory'].includes(item.url);
});
// const routeDataN = this.routeData
// console.log("routeDataN",routeDataN)
this.$store.commit('SET_ROUTE_DATA', [ ...routeDataN])
this.$router.push({
path: "/order/category",
query: {

@ -76,17 +76,23 @@ export default {
...mapGetters(["routeData"])
},
mounted(){
console.log('this.$route---------------',this.$route)
console.log('this.routeData---------------',this.routeData)
// let arr = [
// {name:'',url:'/wel'}
// ]
// this.$store.commit('SET_ROUTE_DATA',arr)
console.log('this.$route-------大',this.$route)
console.log('this.routeData------------大', this.routeData)
const routeDataN = (this.routeData || []).filter(item => {
return !['/order/category', '/order/subcategory'].includes(item.url);
});
console.log("routeDataN",routeDataN)
let arr = [
...routeDataN,
]
this.$store.commit('SET_ROUTE_DATA', arr)
this.getCategoryList()
//
document.addEventListener('click', this.closeContextMenu)
},
methods:{
methods: {
getCategoryList(){
getCategory({
parentId:0,
@ -206,8 +212,15 @@ export default {
},
changePage(val){
// const routeDataN = this.routeData
// /order/category /order/subcategory
const routeDataN = (this.routeData || []).filter(item => {
return !['/order/category', '/order/subcategory'].includes(item.url);
});
console.log("routeDataN",routeDataN)
let arr = [
...this.routeData,
...routeDataN,
{name:val.name,url:'/order/category',categoryId:val.id}
]
this.$store.commit('SET_ROUTE_DATA', arr)

@ -645,9 +645,9 @@ formatDiscountAmount() {
//
async loadCustomerList() {
try {
const res = await getCustomerList({ current: 1, size: 10000000 });
const res = await getCustomerList();
if (res.data && res.data.code === 200) {
this.customerList = res.data.data.records || [];
this.customerList = res.data.data || [];
} else {
this.$message.error("加载客户列表失败:" + (res.msg || "未知错误"));
}
@ -917,6 +917,15 @@ formatDiscountAmount() {
})
this.$store.commit('SET_ROUTE_DATA', [...this.routeData, ...arr])
if (!this.vuexTemp.form.customerCode) {
this.$message.warning("请先选择客户名称");
return;
}
// console.log("row.sort111111111111",row.sort)
this.saveTempOrderInfo({
sort: row.sort,
customerId: this.vuexTemp.form.customerCode,
});
this.$router.push({
path: "/order/ProjectProductEdit",
query: {
@ -976,7 +985,7 @@ formatDiscountAmount() {
async initPageData() {
const currentRouteData = this.routeData || [];
console.log("当前面包屑数据routeData:", currentRouteData)
// console.log("routeData", currentRouteData)
const targetCrumb = currentRouteData.find(item => item.url === '/order/addEdit') || {};
const crumbMode = targetCrumb.mode ; // mode
const crumbOrderId = targetCrumb.orderId ; // orderId
@ -991,9 +1000,9 @@ formatDiscountAmount() {
const initRouteOrderId = this.$route.query.id || this.$route.query.orderId || "";
const hasEchoParams = this.$route.query.queryData || this.$route.query.temData || this.$route.query.noClear;
// mode
console.log("路由mode参数:", this.$route.query.mode);
console.log("初始化mode:", initRouteMode);
console.log("initRouteOrderId):", initRouteOrderId);
// console.log("mode", this.$route.query.mode);
// console.log("mode", initRouteMode);
// console.log("initRouteOrderId):", initRouteOrderId);
const finalMode = crumbMode || initRouteMode;
const finalOrderId = crumbOrderId || initRouteOrderId;
// Vuexadd

@ -183,7 +183,7 @@
</div>
<div class="info-item">
<span class="label">项目单位:</span>
<span class="value changed" :class="{changed: system.after.unit !== system.before.unit}">{{ system.after.unit }}</span>
<span class="value" :class="{changed: system.after.unit !== system.before.unit}">{{ system.after.unit }}</span>
</div>
<div class="info-item">
<span class="label">产品总指导价:</span>

@ -147,8 +147,8 @@
<el-table-column label="订单名称" prop="name" width="180" />
<el-table-column label="客户公司名称" prop="customerName" width="220" />
<el-table-column label="交货日期" prop="deliveryDate" width="160" />
<el-table-column label="销售价(元)" prop="sellingPrice" width="180"/>
<el-table-column label="分成金额(元)" prop="splitPrice" width="180"/>
<el-table-column label="销售价(元)" prop="sellingPrice" width="200"/>
<el-table-column label="分成金额(元)" prop="splitPrice" width="220"/>
<el-table-column label="合同价" prop="contractPrice" width="150"/>
<el-table-column label="已汇金额" prop="remittedAmount" width="150" />
<el-table-column label="待汇金额" prop="unremittedAmount" width="150"/>
@ -536,12 +536,10 @@ export default {
return "";
},
loadCustomerList() {
getCustomerList({
current: 1,
size: 10000000,
}).then((res) => {
getCustomerList().then((res) => {
// this.tableData = res.data.data.records
this.customerList = res.data.data.records || [];
console.log("res.data.data.records",res.data.data)
this.customerList = res.data.data || [];
});
},
async handleFinish(row) {

@ -45,8 +45,43 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24" style="display: flex; justify-content: flex-end">
<el-col :span="6">
<el-form-item style="margin-right: 5px" label="产品大类">
<el-select
v-model="searchForm.catalogOne"
placeholder="请选择产品大类"
@change="handleCatalogOneChange"
clearable
style="width: 100%"
>
<el-option
v-for="item in catalogOneList"
:key="item.id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- 产品小类联动下拉框未选大类时禁用 -->
<el-col :span="6">
<el-form-item style="margin-right: 5px" label="产品小类">
<el-select
v-model="searchForm.catalogTwo"
placeholder="请先选择产品大类"
clearable
style="width: 100%"
>
<el-option
v-for="item in catalogTwoList"
:key="item.id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" style="display: flex; justify-content: flex-end">
<el-button size="small" type="primary" @click="handleSearch" class="el-button--big"
>搜索</el-button
>
@ -68,35 +103,39 @@
cell-style="text-align: center;"
fit
>
<el-table-column label="序号" type="index" width="130"></el-table-column>
<el-table-column label="序号" type="index" width="90"></el-table-column>
<el-table-column
label="产品编号"
prop="code"
width="240"
></el-table-column>
<el-table-column
label="产品大类"
prop="catalogOne"
width="240"
></el-table-column>
<el-table-column
label="产品小类"
prop="catalogTwo"
width="240"
></el-table-column>
<el-table-column
label="产品名称"
prop="nameCn"
width="260"
></el-table-column>
<el-table-column
label="产品规格"
prop="specCn"
width="240"
></el-table-column>
<el-table-column label="当前成本价">
<template #default="scope"> {{ scope.row.costPrice }} </template>
<el-table-column label="当前成本价" width="260">
<template #default="scope"> {{ formatPrice(scope.row.costPrice) }} </template>
</el-table-column>
<el-table-column
@ -104,7 +143,7 @@
prop="updateTime"
width="280"
></el-table-column>
<el-table-column label="操作" width="270" >
<el-table-column label="操作" width="270" fixed="right">
<template slot-scope="scope">
<div style="display: flex; justify-content: center">
<el-link type="primary" @click="openEditDialog(scope.row)"
@ -144,7 +183,7 @@
ref="ruleForm"
>
<el-form-item label="当前价格:" prop="currentCost">
<span style="font-size: 28px;">¥ {{ editForm.currentCost }}</span>
<span style="font-size: 28px;">¥{{ formatPrice(editForm.currentCost) }}</span>
</el-form-item>
<el-form-item label="新价格:" prop="costPrice">
<el-input
@ -152,6 +191,7 @@
placeholder="请输入"
style="width: 200px"
type="number"
@blur="formatPriceToTwoDecimal"
></el-input>
<span style="margin-left: 5px"></span>
</el-form-item>
@ -186,10 +226,10 @@
fit
>
<el-table-column label="修改前价格" prop="costPriceOld" width="180">
<template #default="scope">¥ {{ scope.row.costPriceOld }}</template>
<template #default="scope">¥ {{ formatPrice(scope.row.costPriceOld) }}</template>
</el-table-column>
<el-table-column label="修改后价格" prop="costPrice" width="180">
<template #default="scope">¥ {{ scope.row.costPrice }}</template>
<template #default="scope">¥ {{ formatPrice(scope.row.costPrice) }}</template>
</el-table-column>
<el-table-column
label="修改人"
@ -230,6 +270,7 @@ import {
updateProductCost,
getProductHistory,
} from "@/api/product/productCost";
import {getCategory } from '@/api/product/product'
export default {
components: {
@ -237,7 +278,9 @@ export default {
},
data() {
return {
searchForm: {},
searchForm: {
},
tableData: [],
total: 0,
current: 1,
@ -263,13 +306,91 @@ export default {
historySize: 10, //
historyTotal: 0, //
currentProductId: "", // ID
loading: true
loading: true,
productArr: [],
catalogOneId: '', // ID
catalogTwoId: '' , // ID
catalogOneList: [], // parentId=0
catalogTwoList: [], //
allCategoryList: [], //
};
},
mounted() {
this.getCategoryList()
this.searchList();
},
methods: {
async getCategoryList() {
try {
const res = await getCategory({ parentId: 0, size: 9999, current: 1 });
if (res.data.code === 200) {
this.catalogOneList = res.data.data.records || [];
}
} catch (error) {
console.error('加载产品大类失败:', error);
this.$message.error('加载产品大类失败,请重试');
} finally {
}
},
// ID
async getCategoryTwoList(parentId) {
if (!parentId) return;
try {
const res = await getCategory({ parentId, size: 9999, current: 1 });
this.catalogTwoList = res.data.data.records || [];
} catch (error) {
console.error('加载产品小类失败:', error);
this.$message.error('加载产品小类失败,请重试');
} finally {
}
},
//
handleCatalogOneChange(selectedName) {
// 1.
this.searchForm.catalogTwo = '';
// 2. IDfilterfind
const targetCategory = this.catalogOneList.find(item => item.name === selectedName);
if (targetCategory && targetCategory.id) {
// 3. ID
this.getCategoryTwoList(targetCategory.id);
} else {
this.catalogTwoList = []; //
}
},
//
formatPrice(price) {
// 0
if (!price || isNaN(Number(price))) {
return "0.00";
}
//
return Number(price).toFixed(2);
},
formatPriceToTwoDecimal() {
//
if (!this.editForm.costPrice) {
return;
}
//
const price = Number(this.editForm.costPrice);
//
if (isNaN(price)) {
this.$message.warning("请输入有效的数字");
this.editForm.costPrice = "";
return;
}
//
this.editForm.costPrice = price.toFixed(2);
},
//
handleHistory(row) {
@ -367,8 +488,16 @@ export default {
this.searchList();
},
handleReset() {
this.searchForm = {};
this.searchForm = {
code: '',
nameCn: '',
specCn: '',
updateTime: '',
catalogOne: '',
catalogTwo: ''
};
this.current = 1;
this.catalogTwoList = []; //
this.searchList();
},
//

Loading…
Cancel
Save