优化样式等

main
wangmeng 2 months ago
parent a5e2f85d5c
commit e5f2bc7d78
  1. 3
      src/background.js
  2. 4
      src/store/modules/order.js
  3. 48
      src/views/approval/approvalDetails.vue
  4. 64
      src/views/customer/add.vue
  5. 5
      src/views/customer/index.vue
  6. 2
      src/views/order/category.vue
  7. 75
      src/views/order/orderAddEdit.vue
  8. 26
      src/views/order/orderList.vue
  9. 3
      src/views/order/orderListFinance.vue
  10. 2
      src/views/order/subcategory.vue
  11. 4
      src/views/product/add/category.vue
  12. 7
      src/views/product/add/exchangeRate.vue
  13. 18
      src/views/product/add/productCostPrice.vue
  14. 6
      src/views/product/add/subcategory.vue
  15. 3
      vue.config.js

@ -48,7 +48,7 @@ async function createWindow() {
})
// 移除菜单栏(关键代码)
Menu.setApplicationMenu(null)
Menu.setApplicationMenu(null)
// if (process.env.WEBPACK_DEV_SERVER_URL) {
// // Load the url of the dev server if in development mode
@ -61,6 +61,7 @@ async function createWindow() {
// win.loadURL(`file://${__dirname}/index.html`)
// }
createProtocol('app')
// win.webContents.openDevTools({ mode: 'right' });
// Load the index.html when not in development
win.loadURL(`${winURL}` + '/#/')
}

@ -19,7 +19,7 @@ const order = {
standardPrice: "",
sellingPrice: "",
splitPrice: "",
discountAmount: 0.00 // 初始化为0.00,解决优惠金额显示问题
discountAmount: "0.00" // 初始化为0.00,解决优惠金额显示问题
},
projectList: [],
isTemporaryLeave: false
@ -143,7 +143,7 @@ const order = {
standardPrice: "",
sellingPrice: "",
splitPrice: "",
discountAmount: 0 // 保持0.00,解决优惠金额显示
discountAmount:"0.00" // 保持0.00,解决优惠金额显示
},
projectList: [],
isTemporaryLeave: false

@ -199,6 +199,7 @@
<!-- {{project}} -->
<!-- <span class="system-code">{{ project.code }}</span> -->
<span class="system-name">{{ project.name }}</span>
<span class="system-num">{{ project.num }}</span>
<span class="system-name">{{ project.unit }}</span>
@ -324,7 +325,7 @@
</div>
<div class="detail-item">
<span class="detail-label">客户来源:</span>
<span class="detail-value">{{ customerDetail.fromType || "-" }}</span>
<span class="detail-value">{{ getOriginText(customerDetail.fromType) }}</span>
</div>
<div class="detail-item">
<span class="detail-label">备注:</span>
@ -345,6 +346,7 @@ import { searchData } from "@/api/customer/customer.js";
import {
getCurrencyList,
} from "@/api/order/orderAddEdit";
import {getOrigin} from '@/api/customer/customer'
export default {
components: {
basicCrumb,
@ -358,7 +360,8 @@ export default {
expandProjectIndex: -1,
// approveRemarks: "", //
orderId: "",
isDisabled:""
isDisabled: "",
originList:[],
};
},
@ -371,9 +374,34 @@ export default {
this.orderId = orderId;
}
this.loadCurrencyList();
this.getOriginData()
},
methods: {
//
getOriginText(originCode) {
if (!originCode) return "-";
const originItem = this.originList.find(item => item.dictKey === originCode);
return originItem ? originItem.dictValue : originCode;
},
getOriginData(){
getOrigin().then(res =>{
this.originList = res.data.data || []
}).catch(err => {
console.error('获取客户来源列表失败:', err)
this.originList = []
})
},
//
formatToTwoDecimal(num) {
// /
if (!num || isNaN(Number(num))) {
return "0.00";
}
//
return Number(num).toFixed(2);
},
async getOrderDetail(orderId) {
try {
//
@ -383,6 +411,7 @@ export default {
//
if (res.data.code === 200) {
this.orderData = res.data.data; //
this.orderData.discountAmount = this.formatToTwoDecimal(this.orderData.discountAmount);
if(this.$route.query.mode !== 'view' && this.orderData.targetCurrency !== 'CNY'){
this.getExchangeRateList()
}
@ -561,7 +590,7 @@ calcCommissionPrice() {
type: item.type,
price: item.price,
})),
discountAmount:this.orderData.discountAmount,
discountAmount:this.formatToTwoDecimal(this.orderData.discountAmount),
};
console.log("requestData1111",requestData)
//
@ -630,6 +659,11 @@ calcCommissionPrice() {
font-weight: 500;
}
.approval-action-bar {
position: fixed !important; //
bottom: 0; //
left: 0; //
right: 0; //
z-index: 999; //
::v-deep .el-input .el-input__inner {
height: 3vw !important;
line-height: 3vw !important;
@ -769,13 +803,17 @@ calcCommissionPrice() {
justify-content: space-between;
.system-code {
margin-right: 8px;
margin-right: 12px;
color: #606266;
font-size: $font-size-22;
}
.system-name {
margin-right: 8px;
margin-right: 12px;
font-weight: 500;
font-size: $font-size-22;
}
.system-num {
font-weight: 500;
font-size: $font-size-22;
}

@ -1,5 +1,5 @@
<template>
<div class="container">
<div class="container" v-if="!loading">
<div class="pageTitle">{{customerId == '' ? '客户新增' : '客户编辑'}}</div>
<div class="scroll-box">
<div class="english_box">
@ -184,7 +184,16 @@ export default {
};
return{
addForm:{},
addForm: {
code: '', //
companyName: '', //
country: '', //
fromType: '', //
address1: '', // 1
address2: '', // 2
remark: '' //
},
formRules:{
companyName:[{required:true,message:'请输入客户公司名称',trigger:'blur'}],
// country:[{required:true,message:'',trigger:'blur'}],
@ -193,7 +202,8 @@ export default {
tableData:[],
countryList:[],
originList:[],
customerId:'',
customerId: '',
loading:true,
//
rowRules: {
phone: [
@ -209,14 +219,29 @@ export default {
}
},
mounted(){
this.customerId = this.$route.query.customerId ? this.$route.query.customerId : ''
if(this.customerId != ''){
this.getCustomerDetail()
}
this.getCountryData()
this.getOriginData()
this.customerId = this.$route.query.customerId ? this.$route.query.customerId : ''
this.initPageData()
},
methods:{
methods: {
async initPageData() {
try {
// 1. +
await Promise.all([this.getCountryData(), this.getOriginData()]);
// 2.
if(this.customerId != ''){
await this.getCustomerDetail();
}
// 3.
this.loading = false;
} catch (err) {
console.error('页面初始化失败:', err);
this.$message.error('数据加载失败,请刷新页面重试');
this.loading = false; // 使
}
},
//
validateRowName(row, index) {
if (!row.name) {
@ -314,15 +339,24 @@ export default {
},
getCountryData(){
getCountry().then(res =>{
this.countryList = res.data.data
this.countryList = res.data.data || []
this.addForm.country = this.countryList.length != 0 ? this.countryList[0].dictKey : ''
}).catch(err => {
console.error('获取国家列表失败:', err)
this.countryList = []
})
},
getOriginData(){
getOrigin().then(res =>{
this.originList = res.data.data
this.addForm.fromType = this.originList.length != 0 ? this.originList[0].dictKey : ''
})
getOrigin().then(res =>{
this.originList = res.data.data || []
//
if (this.originList.length > 0 && (this.customerId === '' || this.customerId === undefined)) {
this.$set(this.addForm, 'fromType', this.originList[0].dictKey)
}
}).catch(err => {
console.error('获取客户来源列表失败:', err)
this.originList = []
})
},
addColumn() {
let arr = JSON.parse(JSON.stringify(this.tableData))

@ -49,8 +49,8 @@
<el-button type="danger" @click="handleDelete" class="el-button--big">批量删除</el-button>
</div>
<div class="table-wrapper" >
<el-table :data="tableData" border width="100%"
max-height="400px" @selection-change="selectionChange" :header-cell-style="{ 'text-align': 'center', }"
<el-table :data="tableData" border width="100%" height="100%"
@selection-change="selectionChange" :header-cell-style="{ 'text-align': 'center', }"
:cell-style="{ 'text-align': 'center' }">
<el-table-column type="selection" fixed="left" width="80"></el-table-column>
<el-table-column label="编号" prop="code" width="170"></el-table-column>
@ -312,6 +312,7 @@ export default {
}
.table-wrapper {
flex: 1;
overflow: auto;
// max-height: 600px;
}

@ -13,7 +13,7 @@
</div> -->
</div>
<el-dialog append-to-body :title="dialogTitle" :visible.sync="formDialog" width="550px">
<el-form ref="addForm" :model="formData" label-width="80px" :rules="formRules">
<el-form ref="addForm" :model="formData" label-width="5vw" :rules="formRules">
<el-form-item label="大类" prop="name">
<el-input placeholder="请输入大类名称" v-model="formData.name"></el-input>
</el-form-item>

@ -157,7 +157,7 @@
<!-- 订单分成价 -->
<el-col :span="8">
<el-form-item
label="订单分成价:"
label="订单分成价"
label-width="200px"
prop="splitPrice"
>
@ -174,13 +174,13 @@
<el-col :span="8">
<el-form-item label="申请优惠金额" label-width="200px">
<el-input
v-model="formattedDiscountAmount"
placeholder="请输入优惠金额"
style="width: 100%"
:disabled="isViewMode"
v-model="discountAmount"
placeholder="请输入优惠金额"
style="width: 100%"
:disabled="isViewMode"
min="0"
/>
/>
</el-form-item>
</el-col>
</el-row>
@ -382,33 +382,30 @@ export default {
],),
...mapGetters({
routeData: "routeData"
}),
}),
// Vuex
formattedDiscountAmount: {
//
orderName: {
get() {
// 0
const num = Number(this.vuexTemp.form.discountAmount);
const validNum = isNaN(num) ? 0 : num;
// validNum
return validNum.toFixed(2);
return this.vuexTemp.form.name;
},
set(val) {
// 0Vuex
const num = Number(val);
this.saveTempOrderInfo({
form: { discountAmount: isNaN(num) ? 0 : num }
form: { name: val }
});
},
},
//
orderName: {
},
//
discountAmount: {
get() {
return this.vuexTemp.form.name;
// /NaN
return this.vuexTemp.form.discountAmount || "0.00";
},
set(val) {
// Vuex
this.saveTempOrderInfo({
form: { name: val }
form: { discountAmount: val }
});
},
},
@ -462,7 +459,6 @@ export default {
productList: temp.productList || [],
form: {
...form,
discountAmount: form.discountAmount === undefined ? 0 : form.discountAmount
},
projectList: temp.projectList || [],
isTemporaryLeave: temp.isTemporaryLeave || false
@ -605,11 +601,19 @@ export default {
const res = await getOrderDetail(this.vuexParams.orderId);
if (res.data.code === 200) {
const data = res.data.data;
console.log("data",data)
// const formattedDiscount = data.discountAmount
// ? this.formatTwoDecimals(Number(data.discountAmount))
// : "0.00";
// Vuex
this.saveTempOrderInfo({
form: data || {},
form: {
...data || {},
// discountAmount: formattedDiscount //
},
projectList: data.projectList || [],
originalOrderStatus: data.status,
});
} else {
this.$message.error("加载订单详情失败:" + (res.msg || "未知错误"));
@ -664,9 +668,14 @@ export default {
const selectedCustomer = this.customerList.find(
(item) => item.id === this.vuexTemp.form.customerCode
);
//
const formattedDiscount = this.formatTwoDecimals(
Number(this.vuexTemp.form.discountAmount) || 0
);
const customerName = selectedCustomer && selectedCustomer.companyName ? selectedCustomer.companyName : "";
const queryData = {
...this.vuexTemp.form,
discountAmount: formattedDiscount,
customerName,
projectList,
};
@ -680,7 +689,7 @@ export default {
// /
// !this.vuexParams.orderId
console.log("this.vuexParams.orderId",this.vuexParams.orderId)
console.log("this.vuexTemp",this.vuexTemp)
if (!this.vuexParams.orderId && operateType === "add") {
const res = await saveOrder(queryData);
if (res.data.code === 200) {
@ -688,16 +697,19 @@ export default {
this.$router.push("/order");
}
} else {
const res = await updateOrder(queryData);
if (res.data.code === 200) {
const res = await updateOrder(queryData);
if (res.data.code === 200) {
console.log("res1111111",res.data.code)
console.log("this.originalOrderStatus",this.originalOrderStatus)
if (operateType !== "submit") {
this.$message.success("订单更新成功");
} else {
if (this.originalOrderStatus === STATUS.DRAFT) {
// <!-- 1-稿 2- 3- 4- 5- 6- -->
if (this.vuexTemp.originalOrderStatus == 1) {
this.$message.success(
"订单提交审批成功!订单状态由草稿变成审批中"
);
} else if (this.originalOrderStatus === STATUS.REJECTED) {
} else if (this.vuexTemp.originalOrderStatus == 2) {
this.$message.success(
"订单提交审批成功!订单状态由被驳回变成审批中"
);
@ -711,7 +723,7 @@ export default {
console.error("保存订单失败:", err);
}
} finally {
this.$loading().close();
// this.$loading().close();
}
},
// Vuex
@ -925,8 +937,9 @@ export default {
this.saveTempOrderInfo({
mode: "add",
orderId: "",
form: { discountAmount: "0.00" }
});
console.log("Vuex当前mode (after save add):", this.vuexTemp.mode);
// console.log("Vuexmode (after save add):", this.vuexTemp.mode);
if (this.$refs.orderForm) {
this.$refs.orderForm.clearValidate();
}

@ -134,7 +134,7 @@
<div class="table-wrapper">
<el-table
:data="orderTableData"
max-height="450px"
height="100%"
border
:style="{ width: '100%'}"
:loading="isLoading"
@ -147,6 +147,7 @@
<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="contractPrice" width="150"/>
<el-table-column label="销售价" prop="sellingPrice" width="150"/>
<el-table-column label="分成金额" prop="splitPrice" width="150"/>
<el-table-column label="已汇金额" prop="remittedAmount" width="150" />
@ -731,12 +732,21 @@ export default {
//
async handleResubmitReview(row) {
this.$router.push({
path: "/approval/approvalDetails",
query: {
orderId: row.id,
},
});
try {
await this.$confirm("确定将订单重新提交吗?", "提示", {
type: "danger",
});
const res = await updateOrder({
id: row.id,
status: 2,
});
if (res.data.code === 200) {
this.$message.success("订单重新提交成功");
this.loadOrderList(); //
} else {
this.$message.error("订单重新提交失败");
}
} catch (err) {}
},
//
@ -801,6 +811,7 @@ export default {
padding: 20px !important;
display: flex;
flex-direction: column;
overflow: hidden;
//
@ -814,6 +825,7 @@ export default {
.table-wrapper {
flex: 1;
// max-height: 600px;
overflow: auto;
}
.english_box {

@ -99,7 +99,8 @@
prop="monetaryUnit"
width="180"
></el-table-column>
<el-table-column label="销售价" prop="sellingPrice" width="180">
<!-- sellingPrice -->
<el-table-column label="销售价" prop="contractPrice" width="180">
<template slot-scope="scope">
<span class="text-right">
{{ formatNumber(scope.row.sellingPrice) }}

@ -29,7 +29,7 @@
<el-form
ref="addForm"
:model="addForm"
label-width="80px"
label-width="5vw"
:rules="formRules"
>
<el-form-item label="小类" prop="name">

@ -4,7 +4,7 @@
<!-- 产品新增-大类 -->
<div class="title">请点击选择产品大类</div>
<div class="prodct_list">
<div class="prodct_item" @click="changePage(item)" @contextmenu.prevent="openContextMenu($event, item)"
<div class="prodct_item" @click="changePage(item)" @contextmenu.prevent="isSuperAdmin && openContextMenu($event, item)"
v-for="item in productArr" :key="item.id">
{{item.name}}
</div>
@ -13,7 +13,7 @@
</div>
</div>
<el-dialog append-to-body :title="dialogTitle" :visible.sync="formDialog" width="600px">
<el-form ref="addForm" :model="formData" label-width="4vw" :rules="formRules">
<el-form ref="addForm" :model="formData" label-width="5vw" :rules="formRules">
<el-form-item label="大类" prop="name">
<el-input placeholder="请输入大类名称" v-model="formData.name"></el-input>
</el-form-item>

@ -64,7 +64,8 @@
<el-table
:data="tableData"
border
style="width: 100%; height: 400px"
width="100%"
height="100%"
header-cell-style="text-align: center;"
cell-style="text-align: center;"
max-height="400px"
@ -174,6 +175,7 @@
:visible.sync="historyDialogVisible"
width="1100px"
append-to-body
top="5vh"
>
<el-table
:data="historyData"
@ -181,6 +183,7 @@
header-cell-style="text-align: center;"
cell-style="text-align: center;"
min-height="200px"
max-height="680px"
>
<!-- 修改前汇率单独设置单元格右对齐 -->
<el-table-column label="修改前汇率" prop="rateOld">
@ -545,7 +548,7 @@ export default {
}
.table-wrapper {
flex: 1;
// max-height: 600px;
overflow: auto;
}
}

@ -62,7 +62,8 @@
<el-table
:data="tableData"
border
style="width: 100%; "
height="100%"
width="100%"
header-cell-style="text-align: center;"
cell-style="text-align: center;"
max-height="400px"
@ -173,21 +174,22 @@
<el-dialog
:title="`产品成本价变更历史--${historyDialogTitle}`"
:visible.sync="historyDialogVisible"
width="1000px"
width="1100px"
append-to-body
top="5vh"
>
<el-table
:data="historyData"
border
header-cell-style="text-align: center;"
cell-style="text-align: center;"
:style="{ minHeight: '300px',overflowY: 'auto' ,maxHeight: '1000px',width:'100%'}"
:style="{ minHeight: '300px',overflowY: 'auto' ,maxHeight: '720px',width:'100%'}"
fit
>
<el-table-column label="修改前价格" prop="costPriceOld" width="170">
<el-table-column label="修改前价格" prop="costPriceOld" width="180">
<template #default="scope">¥ {{ scope.row.costPriceOld }}</template>
</el-table-column>
<el-table-column label="修改后价格" prop="costPrice" width="170">
<el-table-column label="修改后价格" prop="costPrice" width="180">
<template #default="scope">¥ {{ scope.row.costPrice }}</template>
</el-table-column>
<el-table-column
@ -198,12 +200,12 @@
<el-table-column
label="修改时间"
prop="updateTime"
width="240"
width="300"
></el-table-column>
<el-table-column
label="备注"
prop="remarks"
width="220"
></el-table-column>
</el-table>
<el-pagination
@ -477,7 +479,7 @@ export default {
}
.table-wrapper {
flex: 1;
// max-height: 600px;
overflow: auto;
}
::v-deep .el-link {

@ -14,7 +14,7 @@
@click="changePage(item)"
v-for="item in productArr"
:key="item.id"
@contextmenu.prevent="openContextMenu($event, item)"
@contextmenu.prevent="isSuperAdmin && openContextMenu($event, item)"
>
{{ item.name }}
</div>
@ -30,7 +30,7 @@
<el-form
ref="addForm"
:model="addForm"
label-width="4vw"
label-width="5vw"
:rules="formRules"
>
<el-form-item label="小类" prop="name">
@ -161,7 +161,7 @@ export default {
},
handleAdd() {
this.resetForm();
this.dialogTitle = '新增小类';
this.dialogTitle = '新增小类';
this.addDialog = true
},
submit(){

@ -79,7 +79,8 @@ module.exports = {
// target: 'http://localhost',
//远程演示服务地址,可用于直接启动项目
// target: 'https://saber.bladex.cn/api',
target:'http://192.168.0.220:8090/',
// target:'http://192.168.0.220:8090/',
target:'http://192.168.1.5:8091/',
ws: true,
pathRewrite: {
'^/api': '/'

Loading…
Cancel
Save