diff --git a/src/background.js b/src/background.js
index b305a53..156120c 100644
--- a/src/background.js
+++ b/src/background.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}` + '/#/')
}
diff --git a/src/store/modules/order.js b/src/store/modules/order.js
index 1f3cb4e..28bfb8a 100644
--- a/src/store/modules/order.js
+++ b/src/store/modules/order.js
@@ -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
diff --git a/src/views/approval/approvalDetails.vue b/src/views/approval/approvalDetails.vue
index 8ab9ee8..605ff47 100644
--- a/src/views/approval/approvalDetails.vue
+++ b/src/views/approval/approvalDetails.vue
@@ -199,6 +199,7 @@
{{ project.name }}
+ {{ project.num }}
{{ project.unit }}
@@ -324,7 +325,7 @@
客户来源:
- {{ customerDetail.fromType || "-" }}
+ {{ getOriginText(customerDetail.fromType) }}
备注:
@@ -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;
}
diff --git a/src/views/customer/add.vue b/src/views/customer/add.vue
index 06858fb..417853c 100644
--- a/src/views/customer/add.vue
+++ b/src/views/customer/add.vue
@@ -1,5 +1,5 @@
-
+
{{customerId == '' ? '客户新增' : '客户编辑'}}
@@ -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))
diff --git a/src/views/customer/index.vue b/src/views/customer/index.vue
index 731bc77..fe5484a 100644
--- a/src/views/customer/index.vue
+++ b/src/views/customer/index.vue
@@ -49,8 +49,8 @@
批量删除
-
@@ -312,6 +312,7 @@ export default {
}
.table-wrapper {
flex: 1;
+ overflow: auto;
// max-height: 600px;
}
diff --git a/src/views/order/category.vue b/src/views/order/category.vue
index 1ff33cc..e60944b 100644
--- a/src/views/order/category.vue
+++ b/src/views/order/category.vue
@@ -13,7 +13,7 @@
-->
-
+
diff --git a/src/views/order/orderAddEdit.vue b/src/views/order/orderAddEdit.vue
index 7fb5967..bdc1331 100644
--- a/src/views/order/orderAddEdit.vue
+++ b/src/views/order/orderAddEdit.vue
@@ -157,7 +157,7 @@
@@ -174,13 +174,13 @@
+/>
@@ -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) {
- // 输入值转数值,非数字则设为0,同步到Vuex
- 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) {
+ //
+ 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("Vuex当前mode (after save add):", this.vuexTemp.mode);
if (this.$refs.orderForm) {
this.$refs.orderForm.clearValidate();
}
diff --git a/src/views/order/orderList.vue b/src/views/order/orderList.vue
index 7f7307a..5ddfe5b 100644
--- a/src/views/order/orderList.vue
+++ b/src/views/order/orderList.vue
@@ -134,7 +134,7 @@
+
@@ -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 {
diff --git a/src/views/order/orderListFinance.vue b/src/views/order/orderListFinance.vue
index fcd46ab..cba188b 100644
--- a/src/views/order/orderListFinance.vue
+++ b/src/views/order/orderListFinance.vue
@@ -99,7 +99,8 @@
prop="monetaryUnit"
width="180"
>
-
+
+
{{ formatNumber(scope.row.sellingPrice) }}
diff --git a/src/views/order/subcategory.vue b/src/views/order/subcategory.vue
index a7371b6..783d6f2 100644
--- a/src/views/order/subcategory.vue
+++ b/src/views/order/subcategory.vue
@@ -29,7 +29,7 @@
diff --git a/src/views/product/add/category.vue b/src/views/product/add/category.vue
index b802109..8806a87 100644
--- a/src/views/product/add/category.vue
+++ b/src/views/product/add/category.vue
@@ -4,7 +4,7 @@
请点击选择产品大类
-
{{item.name}}
@@ -13,7 +13,7 @@
-
+
diff --git a/src/views/product/add/exchangeRate.vue b/src/views/product/add/exchangeRate.vue
index b10f7d0..0959b92 100644
--- a/src/views/product/add/exchangeRate.vue
+++ b/src/views/product/add/exchangeRate.vue
@@ -64,7 +64,8 @@
@@ -545,7 +548,7 @@ export default {
}
.table-wrapper {
flex: 1;
- // max-height: 600px;
+ overflow: auto;
}
}
diff --git a/src/views/product/add/productCostPrice.vue b/src/views/product/add/productCostPrice.vue
index 4087362..58d9aca 100644
--- a/src/views/product/add/productCostPrice.vue
+++ b/src/views/product/add/productCostPrice.vue
@@ -62,7 +62,8 @@
-
+
¥ {{ scope.row.costPriceOld }}
-
+
¥ {{ scope.row.costPrice }}
{{ item.name }}
@@ -30,7 +30,7 @@
@@ -161,7 +161,7 @@ export default {
},
handleAdd() {
this.resetForm();
- this.dialogTitle = '新增小类';
+ this.dialogTitle = '新增小类';
this.addDialog = true
},
submit(){
diff --git a/vue.config.js b/vue.config.js
index 0b85a86..83426c0 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -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': '/'