优化样式等

main
wangmeng 2 months ago
parent 0c37e65eec
commit a5e2f85d5c
  1. 4
      src/page/login/userlogin.vue
  2. 2
      src/router/axios.js
  3. 8
      src/router/views/index.js
  4. 186
      src/store/modules/order.js
  5. 71
      src/views/approval/approvalDetails.vue
  6. 12
      src/views/approval/approvalRecord.vue
  7. 15
      src/views/customer/add.vue
  8. 4
      src/views/customer/index.vue
  9. 406
      src/views/order/AddtoTemplate.vue
  10. 358
      src/views/order/ProjectProductEdit.vue
  11. 2
      src/views/order/bankReceiptDetail.vue
  12. 8
      src/views/order/category.vue
  13. 88
      src/views/order/month.vue
  14. 966
      src/views/order/orderAddEdit.vue
  15. 12
      src/views/order/orderChangeLog.vue
  16. 21
      src/views/order/orderList.vue
  17. 8
      src/views/order/subcategory.vue
  18. 4
      src/views/order/year.vue
  19. 29
      src/views/product/add/add.vue
  20. 28
      src/views/product/add/edit.vue
  21. 23
      src/views/product/add/exchangeRate.vue
  22. 3
      src/views/product/add/subcategory.vue
  23. 2
      src/views/wel/components/ApprovalTip.vue
  24. 4
      src/views/wel/index.vue

@ -100,9 +100,9 @@
roleId: "", roleId: "",
// //
// username: "admin", // username: "admin",
username:'jinchao', username:'',
// //
password: "123456", password: "",
// password: "admin", // password: "admin",
// //
type: "account", type: "account",

@ -50,7 +50,7 @@ axios.interceptors.request.use(config => {
config.url = baseUrl + config.url; config.url = baseUrl + config.url;
} }
if(config.url.indexOf('/api') != -1){ if(config.url.indexOf('/api') != -1){
config.url = config.url.replace('/api','http://192.168.0.220:8090') config.url = config.url.replace('/api','http://192.168.1.5:8091')
} }
// else{ // else{
// config.url = "http://192.168.0.220:8090" + config.url // config.url = "http://192.168.0.220:8090" + config.url

@ -231,7 +231,7 @@ export default [{
name: '订单编辑', name: '订单编辑',
meta: { meta: {
i18n: 'order', i18n: 'order',
keepAlive:true // keepAlive:true
}, },
component: () => component: () =>
import( /* webpackChunkName: "views" */ '@/views/order/orderAddEdit') import( /* webpackChunkName: "views" */ '@/views/order/orderAddEdit')
@ -241,7 +241,7 @@ export default [{
name: '项目产品编辑', name: '项目产品编辑',
meta: { meta: {
i18n: 'edit', i18n: 'edit',
keepAlive: true // keepAlive: true
}, },
component: () => component: () =>
import( /* webpackChunkName: "views" */ '@/views/order/ProjectProductEdit') import( /* webpackChunkName: "views" */ '@/views/order/ProjectProductEdit')
@ -271,7 +271,7 @@ export default [{
meta: { meta: {
i18n: 'add', i18n: 'add',
title: '选择产品', title: '选择产品',
keepAlive: true // keepAlive: true
}, },
component: () => component: () =>
import( /* webpackChunkName: "views" */ '@/views/order/AddtoTemplate') import( /* webpackChunkName: "views" */ '@/views/order/AddtoTemplate')
@ -281,7 +281,6 @@ export default [{
name: '选择', name: '选择',
meta: { meta: {
i18n: 'order', i18n: 'order',
// keepAlive:true
}, },
component: () => component: () =>
import( /* webpackChunkName: "views" */ '@/views/order/year') import( /* webpackChunkName: "views" */ '@/views/order/year')
@ -291,7 +290,6 @@ export default [{
name: '选择', name: '选择',
meta: { meta: {
i18n: 'order', i18n: 'order',
// keepAlive:true
}, },
component: () => component: () =>
import( /* webpackChunkName: "views" */ '@/views/order/month') import( /* webpackChunkName: "views" */ '@/views/order/month')

@ -2,47 +2,205 @@ const order = {
namespaced: true, namespaced: true,
state: { state: {
tempOrderInfo: { tempOrderInfo: {
form: {}, mode: "add", // 页面模式:add/edit/view
orderId: "", // 当前订单ID
customerId: "", // 当前选中的客户ID
sort: "", // 当前操作的项目序号
originalOrderStatus: null, // 原始订单状态
type: "", // 回显类型:queryData/temData
productList: [], // 临时产品列表
productEdit: false, // 新增:标记是否在产品编辑页面
form: { // 初始化所有字段,避免undefined
id: "",
name: "",
customerCode: "",
deliveryDate: "",
monetaryUnit: "",
standardPrice: "",
sellingPrice: "",
splitPrice: "",
discountAmount: 0.00 // 初始化为0.00,解决优惠金额显示问题
},
projectList: [], projectList: [],
isTemporaryLeave: false isTemporaryLeave: false
},
productSelectState: {
customerId: '',
subcategoryId: '',
selectedSubcategoryIds: [],
leftTableData: [],
rightTableData: [],
} }
}, },
getters: { getters: {
getTempOrderInfo: (state) => state.tempOrderInfo // 基础getter:获取完整临时订单信息
getTempOrderInfo: (state) => state.tempOrderInfo,
// 快捷getter
getOrderMode: (state) => state.tempOrderInfo.mode,
isOrderViewMode: (state) => state.tempOrderInfo.mode === "view",
isOrderEditMode: (state) => state.tempOrderInfo.mode === "edit",
hasOrderId: (state) => !!state.tempOrderInfo.orderId,
getCurrentOrderId: (state) => state.tempOrderInfo.orderId,
// 新增:获取productEdit标识
getOrderProductEdit: (state) => state.tempOrderInfo.productEdit,
// 产品选择相关getter
getProductSelectState: (state) => state.productSelectState,
getProductSelectCustomerId: (state) => state.productSelectState.customerId,
getSelectedSubcategoryIds: (state) => state.productSelectState.selectedSubcategoryIds,
getOrderProductList: (state) => state.tempOrderInfo.productList,
}, },
actions: { actions: {
// 保存临时订单信息(支持部分更新)
saveTempOrderInfo({ commit }, data) { saveTempOrderInfo({ commit }, data) {
commit('SET_TEMP_ORDER_INFO', data); commit('SET_TEMP_ORDER_INFO', data);
}, },
// 清空临时订单信息
clearTempOrderInfo({ commit }) { clearTempOrderInfo({ commit }) {
commit('CLEAR_TEMP_ORDER_INFO'); commit('CLEAR_TEMP_ORDER_INFO');
}, },
// 设置临时离开标记
setTemporaryLeave({ commit }, val) { setTemporaryLeave({ commit }, val) {
commit('SET_TEMPORARY_LEAVE', val); commit('SET_TEMPORARY_LEAVE', val);
},
// 更新项目列表
updateProjectList({ commit }, newProjectList) {
commit('UPDATE_PROJECT_LIST', newProjectList);
},
// 更新产品选择状态
updateProductSelectState({ commit }, payload) {
commit('UPDATE_PRODUCT_SELECT_STATE', payload);
},
// 清空产品选择状态
clearProductSelectState({ commit }) {
commit('CLEAR_PRODUCT_SELECT_STATE');
},
// 添加已选小类ID
addSelectedSubcategoryId({ commit }, subcategoryId) {
commit('ADD_SELECTED_SUBCATEGORY_ID', subcategoryId);
},
// 清空产品列表(只清空productList)
clearOrderProductList({ commit }) {
commit('CLEAR_ORDER_PRODUCT_LIST');
},
// 新增:单独设置productEdit标识
setOrderProductEdit({ commit }, val) {
commit('SET_ORDER_PRODUCT_EDIT', val);
} }
}, },
mutations: { mutations: {
// 修复:保存数据时继承原有isTemporaryLeave标记,不丢失 // 修复:安全合并临时订单信息,避免null/undefined
SET_TEMP_ORDER_INFO(state, data) { SET_TEMP_ORDER_INFO(state, data) {
state.tempOrderInfo = { // 1. 校验传入的data是否为合法对象
...state.tempOrderInfo, // 保留原有所有属性(包括标记) if (!data || typeof data !== 'object' || Array.isArray(data)) {
form: { ...state.tempOrderInfo.form, ...(data.form || {}) }, return;
projectList: Array.isArray(data.projectList) ? JSON.parse(JSON.stringify(data.projectList)) : [] }
};
// Debug log
console.log('SET_TEMP_ORDER_INFO called with data:', data);
console.log('Before update - state.tempOrderInfo.mode:', state.tempOrderInfo.mode);
// 2. 安全合并form:先确保form是对象,再合并
if (data.form && typeof data.form === 'object' && !Array.isArray(data.form)) {
// 初始化state.tempOrderInfo.form(防止被意外置空)
state.tempOrderInfo.form = state.tempOrderInfo.form || {};
Object.assign(state.tempOrderInfo.form, data.form);
}
// 3. 安全更新项目列表:深拷贝保证响应式
if (Array.isArray(data.projectList)) {
state.tempOrderInfo.projectList = JSON.parse(JSON.stringify(data.projectList));
}
// 4. 合并其他属性(排除form和projectList)
const otherData = { ...data };
delete otherData.form;
delete otherData.projectList;
// 确保合并的目标对象存在
if (typeof state.tempOrderInfo === 'object') {
Object.assign(state.tempOrderInfo, otherData);
}
// Debug log
console.log('After update - state.tempOrderInfo.mode:', state.tempOrderInfo.mode);
}, },
// 修复:清空缓存时重置所有属性,包括标记 // 修复:重置时保证form字段完整初始化
CLEAR_TEMP_ORDER_INFO(state) { CLEAR_TEMP_ORDER_INFO(state) {
state.tempOrderInfo = { state.tempOrderInfo = {
form: {}, mode: "add",
orderId: "",
customerId: "",
sort: "",
originalOrderStatus: null,
type: "",
productList: [],
productEdit: false, // 重置为false
form: { // 完整初始化,避免字段缺失
id: "",
name: "",
customerCode: "",
deliveryDate: "",
monetaryUnit: "",
standardPrice: "",
sellingPrice: "",
splitPrice: "",
discountAmount: 0 // 保持0.00,解决优惠金额显示
},
projectList: [], projectList: [],
isTemporaryLeave: false isTemporaryLeave: false
}; };
// 同时清空产品选择状态
state.productSelectState = {
customerId: '',
subcategoryId: '',
selectedSubcategoryIds: [],
leftTableData: [],
rightTableData: []
};
}, },
// 修复:正确给tempOrderInfo内部的标记赋值 // 设置临时离开标记
SET_TEMPORARY_LEAVE(state, val) { SET_TEMPORARY_LEAVE(state, val) {
state.tempOrderInfo.isTemporaryLeave = val; state.tempOrderInfo.isTemporaryLeave = !!val; // 转布尔值,避免非预期值
},
// 更新项目列表
UPDATE_PROJECT_LIST(state, newProjectList) {
state.tempOrderInfo.projectList = Array.isArray(newProjectList)
? JSON.parse(JSON.stringify(newProjectList))
: [];
},
// 更新产品选择状态
UPDATE_PRODUCT_SELECT_STATE(state, payload) {
if (payload && typeof payload === 'object') {
state.productSelectState = {
...state.productSelectState,
...payload
};
}
},
// 清空产品选择状态
CLEAR_PRODUCT_SELECT_STATE(state) {
state.productSelectState = {
customerId: '',
subcategoryId: '',
selectedSubcategoryIds: [],
leftTableData: [],
rightTableData: []
};
},
// 添加已选小类ID(去重)
ADD_SELECTED_SUBCATEGORY_ID(state, subcategoryId) {
if (subcategoryId && !state.productSelectState.selectedSubcategoryIds.includes(subcategoryId)) {
state.productSelectState.selectedSubcategoryIds.push(subcategoryId);
}
},
// 清空产品列表,保留其他临时订单信息
CLEAR_ORDER_PRODUCT_LIST(state) {
state.tempOrderInfo.productList = [];
},
// 新增:单独设置productEdit标识
SET_ORDER_PRODUCT_EDIT(state, val) {
state.tempOrderInfo.productEdit = !!val; // 确保是布尔值
} }
} }
}; };
export default order; export default order;

@ -32,6 +32,10 @@
>{{ orderData.customerName || "-" }}</span >{{ orderData.customerName || "-" }}</span
> >
</span> </span>
</div>
<div class="info-item">
<span class="label">货币单位:</span>
<span class="value">{{ getMonetaryUnitText(orderData.monetaryUnit) }}</span>
</div> </div>
<div class="info-item"> <div class="info-item">
<span class="label">交货时间:</span> <span class="label">交货时间:</span>
@ -50,17 +54,17 @@
<el-col :span="12"> <el-col :span="12">
<div class="info-item"> <div class="info-item">
<span class="label">公司指导价:</span> <span class="label">公司指导价:</span>
<span class="value">{{ orderData.standardPrice || "" }}</span> <span class="value">{{ orderData.standardPrice || "" }}</span>
</div> </div>
<div class="info-item"> <div class="info-item">
<span class="label">销售价:</span> <span class="label">销售价:</span>
<span class="value">{{ orderData.sellingPrice || "" }}</span> <span class="value">{{ orderData.sellingPrice || "" }}</span>
</div> </div>
<!-- 分成金额 --> <!-- 分成金额 -->
<div class="info-item formula"> <div class="info-item formula">
<span class="label">分成金额:</span> <span class="label">分成金额:</span>
<span class="value"> <span class="value">
<span class="value">{{ orderData.splitPrice || "" }}</span> <span class="value">{{ orderData.splitPrice || "" }}</span>
</span> </span>
</div> </div>
<div class="info-item"> <div class="info-item">
@ -69,9 +73,9 @@
<el-input <el-input
v-model="orderData.discountAmount" v-model="orderData.discountAmount"
:disabled="isDisabled" :disabled="isDisabled"
style="width: 7vw" style="width: 10vw"
placeholder="请输入" placeholder="请输入"
/> />
</span> </span>
</div> </div>
<!-- 提成金额 --> <!-- 提成金额 -->
@ -80,10 +84,10 @@
<span class="value"> <span class="value">
<el-input <el-input
v-model="orderData.commissionPrice" v-model="orderData.commissionPrice"
:disabled="isDisabled" disabled
style="width: 7vw" style="width: 10vw"
placeholder="请输入" placeholder="请输入"
/> />
</span> </span>
</div> </div>
<div class="info-item"> <div class="info-item">
@ -92,7 +96,7 @@
<el-input <el-input
v-model="orderData.commissionRate" v-model="orderData.commissionRate"
placeholder="请输入" placeholder="请输入"
style="width: 7vw" style="width: 10vw"
:disabled="isDisabled" :disabled="isDisabled"
@input="calcCommissionPrice" @input="calcCommissionPrice"
/>% />%
@ -107,7 +111,7 @@
v-model="orderData.exchangeRate" v-model="orderData.exchangeRate"
:disabled="isDisabled" :disabled="isDisabled"
placeholder="请输入" placeholder="请输入"
style="width: 150px" style="width: 10vw"
/> />
</span> </span>
</div> </div>
@ -338,7 +342,9 @@ import {
getExchangeRateList getExchangeRateList
} from "@/api/approval/approvalDetails.js"; } from "@/api/approval/approvalDetails.js";
import { searchData } from "@/api/customer/customer.js"; import { searchData } from "@/api/customer/customer.js";
import {
getCurrencyList,
} from "@/api/order/orderAddEdit";
export default { export default {
components: { components: {
basicCrumb, basicCrumb,
@ -364,6 +370,7 @@ export default {
this.getOrderDetail(orderId); this.getOrderDetail(orderId);
this.orderId = orderId; this.orderId = orderId;
} }
this.loadCurrencyList();
}, },
methods: { methods: {
@ -395,6 +402,25 @@ export default {
// //
this.loading = false; this.loading = false;
} }
},
getMonetaryUnitText(code) {
// 1.
if (!code) return "-";
// 2.
const unitItem = this.monetaryUnitList.find(item => item.dictKey === code);
// 3.
return unitItem ? unitItem.dictValue : code;
},
//
async loadCurrencyList() {
try {
const res = await getCurrencyList();
if (res.data.code === 200) {
this.monetaryUnitList = res.data.data || [];
}
} catch (err) {
this.$message.error("网络异常,无法加载货币单位列表");
}
}, },
// //
getExchangeRateList() { getExchangeRateList() {
@ -415,27 +441,20 @@ export default {
}, },
// //
calcCommissionPrice() { calcCommissionPrice() {
// 1. const standardPrice = Number(this.orderData.standardPrice || 0);
const standardPrice = Number(this.orderData.standardPrice || 0); // let commissionRate = this.orderData.commissionRate ? this.orderData.commissionRate.toString().trim() : '';
let commissionRate = this.orderData.commissionRate ? this.orderData.commissionRate.toString().trim() : ''; //
// 2. /
if (!/^\d+(\.\d+)?$/.test(commissionRate)) { if (!/^\d+(\.\d+)?$/.test(commissionRate)) {
this.orderData.commissionPrice = ''; this.orderData.commissionPrice = "0.00"; // 0.00
return; return;
} }
// 3. 10 0.1 = × ()
const rate = Number(commissionRate) / 100; const rate = Number(commissionRate) / 100;
let commissionPrice = standardPrice * rate; let commissionPrice = standardPrice * rate;
this.orderData.commissionPrice = commissionPrice.toFixed(2); //
// 4. 2
commissionPrice = commissionPrice.toFixed(2);
// .00
this.orderData.commissionPrice = commissionPrice.endsWith('.00') ? commissionPrice.split('.')[0] : commissionPrice;
}, },
getContactValue(key) { getContactValue(key) {
// contacts // contacts
if ( if (
this.customerDetail.contacts && this.customerDetail.contacts &&
Array.isArray(this.customerDetail.contacts) && Array.isArray(this.customerDetail.contacts) &&
@ -529,6 +548,7 @@ calcCommissionPrice() {
} }
try { try {
const requestData = { const requestData = {
...this.orderData,
id: this.orderData.id, id: this.orderData.id,
commissionRate: this.orderData.commissionRate, commissionRate: this.orderData.commissionRate,
exchangeRate: this.orderData.exchangeRate, exchangeRate: this.orderData.exchangeRate,
@ -633,6 +653,9 @@ calcCommissionPrice() {
margin-bottom: 10px; margin-bottom: 10px;
// line-height: 32px; // line-height: 32px;
font-size: $font-size-26; font-size: $font-size-26;
height: 2vw;
display: flex;
align-items: center;
.label { .label {
width: 9.478vw !important; width: 9.478vw !important;
@ -867,7 +890,7 @@ calcCommissionPrice() {
// width: 110px; // width: 110px;
// font-weight: 500; // font-weight: 500;
color: #606266; color: #606266;
text-align: right; text-align: left;
padding-right: 15px; padding-right: 15px;
font-size: $font-size-24; font-size: $font-size-24;
width: 10vw; width: 10vw;

@ -32,7 +32,6 @@
v-for="(item, index) in approvalList" v-for="(item, index) in approvalList"
:key="index" :key="index"
class="approval-item clickable-item" class="approval-item clickable-item"
@click="handleOperate(item)" @click="handleOperate(item)"
> >
<!-- 左侧内容区域 --> <!-- 左侧内容区域 -->
@ -54,7 +53,7 @@
<!-- 加载更多按钮无更多数据时隐藏 --> <!-- 加载更多按钮无更多数据时隐藏 -->
<div class="load-more-btn" v-if="hasMore"> <div class="load-more-btn" v-if="hasMore">
<el-button type="primary" @click="handleLoadMore" :loading="loadMoreLoading">加载更多</el-button> <el-button type="primary" @click="handleLoadMore" :loading="loadMoreLoading" class="el-button--big">加载更多</el-button>
</div> </div>
<!-- <div class="load-more-btn" v-else> <!-- <div class="load-more-btn" v-else>
<span>已加载全部数据</span> <span>已加载全部数据</span>
@ -210,12 +209,11 @@ export default {
handleOperate(item) { handleOperate(item) {
if (item.status === 2) { if (item.status === 2) {
if(!this.isSuperAdmin){
return
}
let arr = [...this.routeData, { name: "审批记录", url: "/approval/approvalRecord" }]; let arr = [...this.routeData, { name: "审批记录", url: "/approval/approvalRecord" }];
this.$store.commit("SET_ROUTE_DATA", arr); this.$store.commit("SET_ROUTE_DATA", arr);
this.$router.push({ path: "/approval/approvalDetails", query: { id: item.id } });
this.$router.push({ path: "/approval/approvalDetails", query: { id: item.id ,mode:!this.isSuperAdmin?'view':'edit'} });
}else{ }else{
this.$router.push({ path: "/approval/approvalDetails", query: { id: item.id ,mode:'view'} }); this.$router.push({ path: "/approval/approvalDetails", query: { id: item.id ,mode:'view'} });
let arr = [...this.routeData, { name: "审批记录", url: "/approval/approvalRecord" }]; let arr = [...this.routeData, { name: "审批记录", url: "/approval/approvalRecord" }];

@ -354,10 +354,14 @@ export default {
this.$message.error('请检查手机号或邮箱格式是否正确'); this.$message.error('请检查手机号或邮箱格式是否正确');
return; return;
} }
if(this.customerId == '' || this.customerId == undefined){ const selectedCountry = this.countryList.find(item => item.dictKey === this.addForm.country);
const countryName = selectedCountry ? selectedCountry.dictValue : '';
if (this.customerId == '' || this.customerId == undefined) {
let params = { let params = {
...this.addForm, ...this.addForm,
contacts:this.tableData contacts: this.tableData,
countryName: countryName,
} }
addCustomer(params).then(res =>{ addCustomer(params).then(res =>{
if(res.data.code == 200){ if(res.data.code == 200){
@ -365,10 +369,13 @@ export default {
this.$router.push('/customer') this.$router.push('/customer')
} }
}) })
}else{ } else {
let params = { let params = {
...this.addForm, ...this.addForm,
contacts:this.tableData contacts: this.tableData,
countryName: countryName,
} }
editCustomer(params).then(res =>{ editCustomer(params).then(res =>{
if(res.data.code == 200){ if(res.data.code == 200){

@ -50,10 +50,10 @@
</div> </div>
<div class="table-wrapper" > <div class="table-wrapper" >
<el-table :data="tableData" border width="100%" <el-table :data="tableData" border width="100%"
height="500px" @selection-change="selectionChange" :header-cell-style="{ 'text-align': 'center', }" max-height="400px" @selection-change="selectionChange" :header-cell-style="{ 'text-align': 'center', }"
: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 type="selection" fixed="left" width="80"></el-table-column>
<!-- <el-table-column label="编号" prop="code" width="100"></el-table-column> --> <el-table-column label="编号" prop="code" width="170"></el-table-column>
<el-table-column label="客户公司名称" prop="companyName" width="250"></el-table-column> <el-table-column label="客户公司名称" prop="companyName" width="250"></el-table-column>
<el-table-column label="所属国家" prop="countryValue" width="150"></el-table-column> <el-table-column label="所属国家" prop="countryValue" width="150"></el-table-column>
<el-table-column label="客户来源" prop="fromTypeValue" width="150"></el-table-column> <el-table-column label="客户来源" prop="fromTypeValue" width="150"></el-table-column>

@ -64,12 +64,6 @@
width="80" width="80"
align="center" align="center"
></el-table-column> ></el-table-column>
<!-- <el-table-column
prop="standardPrice"
label="公司指导价"
width="150"
align="center"
></el-table-column> -->
<el-table-column <el-table-column
prop="remarkCn" prop="remarkCn"
label="备注" label="备注"
@ -94,7 +88,6 @@
size="medium" size="medium"
@click="transferToLeft" @click="transferToLeft"
:disabled="rightSelectedRows.length === 0" :disabled="rightSelectedRows.length === 0"
></el-button> ></el-button>
</div> </div>
@ -142,12 +135,6 @@
width="80" width="80"
align="center" align="center"
></el-table-column> ></el-table-column>
<!-- <el-table-column
prop="standardPrice"
label="公司指导价"
width="150"
align="center"
></el-table-column> -->
<el-table-column <el-table-column
fixed="right" fixed="right"
prop="remarkCn" prop="remarkCn"
@ -163,8 +150,8 @@
<script> <script>
import basicCrumb from "@/components/basic-crumb/main"; import basicCrumb from "@/components/basic-crumb/main";
import { getProduct } from "@/api/product/product"; import { getProduct } from "@/api/product/product";
// import { saveSelectedProduct } from "@/api/product/AddtoTemplate"; import { mapGetters, mapActions } from "vuex";
import { mapGetters } from "vuex";
export default { export default {
name: "ProductSelect", name: "ProductSelect",
components: { components: {
@ -172,133 +159,142 @@ export default {
}, },
data() { data() {
return { return {
leftTableData: [], // //
rightTableData: [], // currentLeftRow: null, //
currentLeftRow: null, // currentRightRow: null, //
loading: false, // loading: false, //
productId: "", // id leftSelectedRows: [], //
leftSelectedRows: [], // rightSelectedRows: [], //
rightSelectedRows: [], //
subcategoryId: "", //id
currentRightRow: null,
customerId:''
}; };
}, },
activated() { computed: {
// 1. id ...mapGetters(["routeData"]),
const newSubcategoryId = this.$route.query.subcategoryId || ""; // Vuex
// console.log("ID", newSubcategoryId, "ID", this.subcategoryId); ...mapGetters("order", [
// 2. IDID "getProductSelectState", //
// if (newSubcategoryId && newSubcategoryId !== this.subcategoryId) { "getProductSelectCustomerId", // ID
// this.subcategoryId = newSubcategoryId; // IDID "getSelectedSubcategoryIds", // ID
// this.fetchProductList(); // "getTempOrderInfo",
// } "getOrderProductEdit",
this.subcategoryId = newSubcategoryId; // IDID "getOrderMode",
this.fetchProductList(); // "getOrderId",
if (!newSubcategoryId || this.$route.query.isClear==true) { ]),
this.resetComponentState(); //
} customerId() {
}, return this.getTempOrderInfo.customerId ;
computed: { },
...mapGetters(["routeData"]) // ID
newSubcategoryId() {
return this.$route.query.subcategoryId || "";
}, },
mounted(){ leftTableData() {
// this.customerId = this.$route.query.customerId ? this.$route.query.customerId:'' return this.getProductSelectState.leftTableData || [];
}, },
rightTableData() {
return this.getProductSelectState.rightTableData || [];
}
},
mounted() {
//
this.initPage();
// ID
this.$watch(
() => this.$route.query.subcategoryId,
(newId) => {
if (newId) {
this.appendNewSubcategoryData(newId); //
}
},
{ immediate: true } //
);
},
methods: { methods: {
// async fetchProductList() { ...mapActions("order", [
// // id "updateProductSelectState", //
// if (!this.subcategoryId) { "clearProductSelectState", //
// this.$message.warning("ID"); "addSelectedSubcategoryId" // ID
// return; ]),
// } //
// try { initPage() {
// this.loading = true; // 1. IDVuex
// // id if (!this.customerId && this.$route.query.customerId) {
// const res = await getProduct({ this.updateProductSelectState({
// catalogId: this.subcategoryId, customerId: this.$route.query.customerId
// size: 9999, });
// current: 1, }
// }); },
// const data = res.data.data.records || []; //
// console.log("data", data); async appendNewSubcategoryData(newSubcategoryId) {
// // index // ID
// this.leftTableData = data.map((item, idx) => ({ if (!newSubcategoryId || this.getSelectedSubcategoryIds.includes(newSubcategoryId)) {
// ...item,
// index: idx + 1, // 1
// }));
// } catch (error) {
// console.error("", error);
// this.$message.error("");
// } finally {
// this.loading = false;
// }
// },
async fetchProductList() {
if (!this.subcategoryId) {
this.$message.warning("缺少小类ID,无法获取产品列表");
return; return;
} }
try { try {
this.loading = true; this.loading = true;
// 1.
const res = await getProduct({ const res = await getProduct({
catalogId: this.subcategoryId, catalogId: newSubcategoryId,
size: 9999, size: 9999,
current: 1, current: 1,
customerId:this.$route.query.customerId ? this.$route.query.customerId:'', customerId: this.customerId,
}); });
const newData = res.data.data.records || []; const newProductData = res.data.data.records || [];
console.log("新获取的小类产品数据:", newData); console.log("新获取的小类产品数据:", newProductData);
if (newData.length === 0) {
this.$message.info("该小类下暂无产品"); if (newProductData.length === 0) {
this.$message.info(`小类ID:${newSubcategoryId} 下暂无产品`);
//
this.addSelectedSubcategoryId(newSubcategoryId);
return; return;
} }
// 1. id // 2. /
const existLeftIds = this.leftTableData.map(item => item.id); // id const existLeftIds = this.leftTableData.map(item => item.id);
const existRightIds = this.rightTableData.map(item => item.id); // id const existRightIds = this.rightTableData.map(item => item.id);
const uniqueNewData = newData.filter(item => { const uniqueNewProducts = newProductData.filter(item => {
// &&
return !existLeftIds.includes(item.id) && !existRightIds.includes(item.id); return !existLeftIds.includes(item.id) && !existRightIds.includes(item.id);
}); });
// 2.
this.leftTableData = [...this.leftTableData, ...uniqueNewData]; // 3. Vuex
// 3. const newLeftTableData = [...this.leftTableData, ...uniqueNewProducts];
await this.updateProductSelectState({
leftTableData: newLeftTableData,
subcategoryId: newSubcategoryId // ID
});
// 4.
this.addSelectedSubcategoryId(newSubcategoryId);
// 5.
this.resetIndex(); this.resetIndex();
// this.$message.success(` ${uniqueNewData.length} `); // this.$message.success(` ${uniqueNewProducts.length} `);
} catch (error) { } catch (error) {
console.error("请求产品列表失败:", error); console.error("追加小类产品失败:", error);
this.$message.error("网络异常,获取产品列表失败"); this.$message.error("网络异常,获取新小类产品失败");
} finally { } finally {
this.loading = false; this.loading = false;
} }
},
resetComponentState() {
this.leftTableData = [];
this.rightTableData = [];
this.subcategoryId = "";
this.clearSelectionAndCurrentRow();
}, },
// //
handleLeftRowClick(row) { handleLeftRowClick(row) {
this.currentLeftRow = row; this.currentLeftRow = row;
}, },
// //
clearSelectionAndCurrentRow() { clearSelectionAndCurrentRow() {
if (this.$refs.leftTable) { if (this.$refs.leftTable) {
this.$refs.leftTable.clearSelection(); this.$refs.leftTable.clearSelection();
this.$refs.leftTable.setCurrentRow(null); this.$refs.leftTable.setCurrentRow(null);
} }
if (this.$refs.rightTable) { if (this.$refs.rightTable) {
this.$refs.rightTable.clearSelection(); this.$refs.rightTable.clearSelection();
this.$refs.rightTable.setCurrentRow(null); this.$refs.rightTable.setCurrentRow(null);
} }
this.leftSelectedRows = []; this.leftSelectedRows = [];
this.rightSelectedRows = []; this.rightSelectedRows = [];
this.currentLeftRow = null; this.currentLeftRow = null;
this.currentRightRow = null; this.currentRightRow = null;
}, },
// //
handleRightRowClick(row) { handleRightRowClick(row) {
this.currentRightRow = row; this.currentRightRow = row;
@ -307,22 +303,18 @@ export default {
handleLeftSelectionChange(val) { handleLeftSelectionChange(val) {
this.leftSelectedRows = val; this.leftSelectedRows = val;
}, },
// //
handleRightSelectionChange(val) { handleRightSelectionChange(val) {
this.rightSelectedRows = val; this.rightSelectedRows = val;
}, },
// //
leftTableRowClass({ rowIndex }) { leftTableRowClass({ rowIndex }) {
return rowIndex % 2 === 0 ? "" : "row-gray"; return rowIndex % 2 === 0 ? "" : "row-gray";
}, },
// //
rightTableRowClass({ rowIndex }) { rightTableRowClass({ rowIndex }) {
return rowIndex % 2 === 0 ? "" : "row-gray"; return rowIndex % 2 === 0 ? "" : "row-gray";
}, },
// //
transferToRight() { transferToRight() {
if (this.leftSelectedRows.length === 0) { if (this.leftSelectedRows.length === 0) {
@ -330,27 +322,33 @@ export default {
return; return;
} }
// // 1. Vuex
let newLeftData = [...this.leftTableData];
let newRightData = [...this.rightTableData];
// 2.
this.leftSelectedRows.forEach((row) => { this.leftSelectedRows.forEach((row) => {
const leftIdx = this.leftTableData.findIndex( const leftIdx = newLeftData.findIndex(item => item.id === row.id);
(item) => item.id === row.id
);
if (leftIdx > -1) { if (leftIdx > -1) {
const [movedRow] = this.leftTableData.splice(leftIdx, 1); const [movedRow] = newLeftData.splice(leftIdx, 1);
// //
const { remark, ...rightRow } = movedRow; const { remark, ...rightRow } = movedRow;
console.log("remark",remark) newRightData.push(rightRow);
this.rightTableData.push(rightRow);
} }
}); });
// // 3. Vuex
this.$refs.leftTable.clearSelection(); this.updateProductSelectState({
leftTableData: newLeftData,
rightTableData: newRightData
});
// 4.
if (this.$refs.leftTable) {
this.$refs.leftTable.clearSelection();
}
this.leftSelectedRows = []; this.leftSelectedRows = [];
//
this.resetIndex();
}, },
// //
transferToLeft() { transferToLeft() {
if (this.rightSelectedRows.length === 0) { if (this.rightSelectedRows.length === 0) {
@ -358,34 +356,50 @@ export default {
return; return;
} }
// // 1. Vuex
let newLeftData = [...this.leftTableData];
let newRightData = [...this.rightTableData];
// 2.
this.rightSelectedRows.forEach((row) => { this.rightSelectedRows.forEach((row) => {
const rightIdx = this.rightTableData.findIndex( const rightIdx = newRightData.findIndex(item => item.id === row.id);
(item) => item.id === row.id
);
if (rightIdx > -1) { if (rightIdx > -1) {
const [movedRow] = this.rightTableData.splice(rightIdx, 1); const [movedRow] = newRightData.splice(rightIdx, 1);
// //
this.leftTableData.push({ newLeftData.push({
...movedRow, ...movedRow,
remarkCn: movedRow.remarkCn || "", remarkCn: movedRow.remarkCn || "",
}); });
} }
}); });
// // 3. Vuex
this.$refs.rightTable.clearSelection(); this.updateProductSelectState({
leftTableData: newLeftData,
rightTableData: newRightData
});
// 4.
if (this.$refs.rightTable) {
this.$refs.rightTable.clearSelection();
}
this.rightSelectedRows = []; this.rightSelectedRows = [];
//
this.resetIndex();
}, },
// //
resetIndex() { resetIndex() {
this.leftTableData.forEach((item, idx) => (item.index = idx + 1)); const newLeftData = this.leftTableData.map((item, idx) => ({
this.rightTableData.forEach((item, idx) => (item.index = idx + 1)); ...item,
index: idx + 1
}));
const newRightData = this.rightTableData.map((item, idx) => ({
...item,
index: idx + 1
}));
this.updateProductSelectState({
leftTableData: newLeftData,
rightTableData: newRightData
});
}, },
// //
handleSelectProduct() { handleSelectProduct() {
let arr = [ {name:'工作台',url:'/wel'}] let arr = [ {name:'工作台',url:'/wel'}]
@ -397,11 +411,12 @@ export default {
sort: this.$route.query.sort, sort: this.$route.query.sort,
mode: this.$route.query.mode ? this.$route.query.mode:'', mode: this.$route.query.mode ? this.$route.query.mode:'',
orderId:this.$route.query.orderId ? this.$route.query.orderId:'', orderId:this.$route.query.orderId ? this.$route.query.orderId:'',
customerId:this.$route.query.customerId ? this.$route.query.customerId:'', customerId: this.customerId,
} // ID便
selectedSubcategoryIds: JSON.stringify(this.getSelectedSubcategoryIds)
}
}); });
}, },
// ID // ID
async handleSave() { async handleSave() {
if (this.rightTableData.length === 0) { if (this.rightTableData.length === 0) {
@ -422,38 +437,36 @@ export default {
name: item.nameCn, // name: item.nameCn, //
spec: item.specCn, // spec: item.specCn, //
unit: item.unitCn, // unit: item.unitCn, //
standardPrice: item.standardPrice, // standardPrice: item.standardPrice, //
remarks: item.remarkCn, // remarks: item.remarkCn, //
multiple:item.multiple ,// multiple:item.multiple ,//
num: item.multiple, // num: item.multiple, //
})), })),
}; };
// Vuex
await this.clearProductSelectState();
if ( if (
this.$route.query.productEdit && this.getOrderProductEdit
this.$route.query.productEdit == true
) { ) {
this.resetComponentState();
this.$router.push({ this.$router.push({
path: "/order/ProjectProductEdit", path: "/order/ProjectProductEdit",
query: { query: {
queryData: JSON.stringify(queryData), queryData: JSON.stringify(queryData),
mode: this.$route.query.mode ? this.$route.query.mode:'', // mode: this.$route.query.mode ? this.$route.query.mode:'',
orderId:this.$route.query.orderId ? this.$route.query.orderId:'', // orderId:this.$route.query.orderId ? this.$route.query.orderId:'',
customerId:this.$route.query.customerId ? this.$route.query.customerId:'', // customerId: this.customerId,
sort:this.$route.query.sort, // sort:this.$route.query.sort,
}, },
}); });
} else { } else {
this.resetComponentState();
this.$router.push({ this.$router.push({
path: "/order/addEdit", path: "/order/addEdit",
query: { query: {
queryData: JSON.stringify(queryData), queryData: JSON.stringify(queryData),
mode: this.$route.query.mode ? this.$route.query.mode:'', mode: this.getOrderMode,
orderId:this.$route.query.orderId ? this.$route.query.orderId:'', orderId: this.getOrderId,
customerId:this.$route.query.customerId ? this.$route.query.customerId:'', // customerId: this.customerId,
}, },
}); });
} }
@ -462,21 +475,18 @@ export default {
this.$message.error("网络异常,保存产品失败"); this.$message.error("网络异常,保存产品失败");
} }
}, },
// //
handleCancel() { handleCancel() {
// Vuex
this.$router.push({ this.clearProductSelectState();
path: "/order/addEdit", this.$router.push({
query: { path: "/order/addEdit",
noClear: true, query: {
mode: this.$route.query.mode ? this.$route.query.mode:'', noClear: true,
orderId:this.$route.query.orderId ? this.$route.query.orderId:'', mode: this.$route.query.mode ? this.$route.query.mode:'',
// customerId:this.customerId||'', orderId:this.$route.query.orderId ? this.$route.query.orderId:'',
}, },
}); });
this.resetComponentState();
}, },
}, },
}; };
@ -491,13 +501,12 @@ export default {
margin: 0 auto; margin: 0 auto;
margin-top: 8px; margin-top: 8px;
padding: 20px !important; padding: 20px !important;
.pageTitle{ .pageTitle{
// font-size: 26px; font-size:$font-size-title;
font-size:$font-size-title; margin-bottom: 10px;
margin-bottom: 10px; width: 100%;
width: 100%; text-align: center;
text-align: center; }
}
} }
.page-title { .page-title {
@ -526,7 +535,6 @@ export default {
align-items: center; align-items: center;
padding: 0 20px; padding: 0 20px;
.transfer-btn { .transfer-btn {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -556,44 +564,28 @@ export default {
background-color: #f5f7fa !important; background-color: #f5f7fa !important;
} }
//
::v-deep .el-table {
// --el-table-row-hover-bg-color: #e6f7ff;
// .el-table__cell {
// padding: 8px 0;
// font-size: 14px;
// color: #606266;
// }
// .el-table__header-wrapper th {
// font-weight: 500;
// color: #303133;
// }
}
::v-deep .el-button + .el-button { ::v-deep .el-button + .el-button {
margin-left: 0 !important; // margin-left: 0 !important; //
} }
// //
::v-deep .el-table .el-checkbox__inner { ::v-deep .el-table .el-checkbox__inner {
width: 30px; width: 30px;
height: 30px; height: 30px;
border-width: 2px; // border-width: 2px; //
} }
// //
::v-deep .el-table .el-checkbox__inner::after { ::v-deep .el-table .el-checkbox__inner::after {
border-width: 2px; // 线1px border-width: 2px; // 线1px
transform: rotate(45deg) scaleY(1); // transform: rotate(45deg) scaleY(1); //
} }
// //
::v-deep .el-table .el-table-column--selection .cell { ::v-deep .el-table .el-table-column--selection .cell {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 0; padding: 0;
height: 100%; // height: 100%; //
} }
</style> </style>

@ -1,26 +1,26 @@
<template> <template>
<div class="project-product-edit"> <div class="project-product-edit">
<basic-crumb></basic-crumb>
<div class="pageTitle">{{ isViewMode ? '项目产品查看' : "项目产品编辑" }}</div> <div class="pageTitle">{{ isViewMode ? '项目产品查看' : "项目产品编辑" }}</div>
<div class="btn-group"> <div class="btn-group">
<el-row> <el-row>
<el-col span="20"> <el-col span="15">
<el-button <el-button
type="primary" type="primary"
class="el-button--big" class="el-button--big"
@click="handleselectPro()" @click="handleselectPro()"
v-if="!isViewMode" v-if="!isViewMode"
style="margin:0 40px " style="margin:0 40px "
> >
选择产品 选择产品
</el-button> </el-button>
</el-col> </el-col>
<el-col span="4" style="text-align: right"> <el-col span="9" style="text-align: right">
<el-button <el-button
type="primary" type="primary"
@click="handleSave" @click="handleSave"
class="el-button--big" class="el-button--big"
v-if="!isViewMode" v-if="!isViewMode"
> >
保存 保存
</el-button> </el-button>
@ -36,16 +36,17 @@
</el-row> </el-row>
</div> </div>
<!-- 核心修复1表格数据绑定到 productForm.productList和表单model一致 -->
<el-form <el-form
ref="productForm" ref="productForm"
:model="productList" :model="productForm"
:rules="formRules" :rules="formRules"
label-width="0" label-width="0"
> >
<el-table <el-table
:data="productList" :data="productForm.productList"
border border
height="600" height="70vh"
width="100%" width="100%"
:cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
:header-cell-style="{ :header-cell-style="{
@ -53,22 +54,22 @@
'background-color': '#f5f7fa', 'background-color': '#f5f7fa',
}" }"
> >
<el-table-column prop="code" label="产品编号" width="150" /> <el-table-column prop="code" label="产品编号" width="190" />
<el-table-column prop="catalogOne" label="产品大类" /> <el-table-column prop="catalogOne" label="产品大类" />
<el-table-column prop="catalogTwo" label="产品小类" /> <el-table-column prop="catalogTwo" label="产品小类" />
<el-table-column prop="name" label="产品名称" /> <el-table-column prop="name" label="产品名称" />
<el-table-column prop="spec" label="规格说明" width="120" /> <el-table-column prop="spec" label="规格说明" width="170" />
<el-table-column prop="unit" label="单位" width="80" /> <el-table-column prop="unit" label="单位" width="80" />
<el-table-column prop="standardPrice" label="公司指导价" width="150" /> <el-table-column prop="standardPrice" label="公司指导价" width="180" />
<!-- <el-table-column prop="multiple" label="倍率" width="100" /> -->
<el-table-column prop="num" label="数量" width="160"> <el-table-column prop="num" label="数量" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item <el-form-item
:prop="`${scope.$index}.num`" :prop="`productList[${scope.$index}].num`"
:rules="!isViewMode ? formRules.num : []" :rules="!isViewMode ? formRules.num : []"
> >
<!-- 核心修复2输入框绑定到 productForm.productList 的行数据 -->
<el-input <el-input
v-model.number="scope.row.num" v-model.number="productForm.productList[scope.$index].num"
placeholder="请输入" placeholder="请输入"
:disabled="isViewMode" :disabled="isViewMode"
style="width: 120px" style="width: 120px"
@ -77,20 +78,21 @@
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="sellingPrice" label="销售价" width="180"> <el-table-column prop="sellingPrice" label="销售价" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item <el-form-item
:prop="`${scope.$index}.sellingPrice`" :prop="`productList[${scope.$index}].sellingPrice`"
:rules="!isViewMode ? formRules.sellingPrice : []" :rules="!isViewMode ? formRules.sellingPrice : []"
> >
<!-- 核心修复2输入框绑定到 productForm.productList 的行数据 -->
<el-input <el-input
:disabled="isViewMode" :disabled="isViewMode"
v-model.number="scope.row.sellingPrice" v-model.number="productForm.productList[scope.$index].sellingPrice"
placeholder="请输入" placeholder="请输入"
style="width: 140px" style="width: 160px"
type="number" type="number"
step="1" step="1"
min="1" min="1"
@blur="handlePriceChange(scope.row, scope.$index)" @blur="handlePriceChange(scope.row, scope.$index)"
/> />
</el-form-item> </el-form-item>
@ -99,46 +101,50 @@
<el-table-column prop="splitPrice" label="分成金额" width="180"> <el-table-column prop="splitPrice" label="分成金额" width="180">
<div class="tip">=(销售价-指导价)/2*数量</div> <div class="tip">=(销售价-指导价)/2*数量</div>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.splitPrice }}</span> <span>{{ scope.row.splitPrice || '0.00' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remarks" label="备注" fixed="right" /> <el-table-column prop="remarks" label="备注" />
</el-table> </el-table>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters, mapActions } from "vuex";
import basicCrumb from "@/components/basic-crumb/main"; import basicCrumb from "@/components/basic-crumb/main";
import { mapGetters } from "vuex";
export default { export default {
name: "ProjectProductEdit", name: "ProjectProductEdit",
components: { components: {
basicCrumb, basicCrumb
}, },
data() { data() {
// //
const validateSellingPrice = (rule, value, callback) => { const validateSellingPrice = (rule, value, callback) => {
const rowIndex = rule.field.split(".")[0]; const rowIndex = rule.field.replace(/productList\[(\d+)\]\.sellingPrice/, '$1');
const row = this.productList[rowIndex]; const row = this.productForm.productList[rowIndex];
if (!row) return callback();
const standardPrice = Number(row.standardPrice) || 0; const standardPrice = Number(row.standardPrice) || 0;
if (value === undefined || value === null || value === "") { if (value === undefined || value === null || value === "") {
callback(new Error("销售价不能为空")); callback(new Error("销售价不能为空"));
} else if (value <= standardPrice) { } else if (value <= standardPrice) {
callback(new Error(`销售价必须大于指导价(${standardPrice})`)); callback(new Error(`销售价必须大于指导价(${standardPrice})`));
} else { } else {
callback(); // callback();
} }
}; };
// 1
const validateNum = (rule, value, callback) => { // 1
const rowIndex = rule.field.split(".")[0]; const validateNum = (rule, value, callback) => {
const row = this.productList[rowIndex]; const rowIndex = rule.field.replace(/productList\[(\d+)\]\.num/, '$1');
const multiple = Number(row.multiple) || 1; // 1 const row = this.productForm.productList[rowIndex];
if (!row) return callback();
const multiple = Number(row.multiple) || 1;
if (value === undefined || value === null || value === "" || value < 1) { if (value === undefined || value === null || value === "" || value < 1) {
callback(new Error("数量至少为1")); callback(new Error("数量至少为1"));
} else if (value % multiple !== 0) { } else if (value % multiple !== 0) {
//
callback(new Error(`请填写${multiple}的倍数`)); callback(new Error(`请填写${multiple}的倍数`));
} else { } else {
callback(); callback();
@ -146,166 +152,248 @@ export default {
}; };
return { return {
productList: [], productForm: { productList: [] }, //
isViewMode: false,
showNumError: false, showNumError: false,
currentClickRow: null, currentClickRow: null,
formRules: { formRules: {
num: [{ validator: validateNum, trigger: "blur" }], num: [{ validator: validateNum, trigger: "blur" }],
sellingPrice: [{ validator: validateSellingPrice, trigger: "blur" }], sellingPrice: [{ validator: validateSellingPrice, trigger: "blur" }]
}, },
}; };
}, },
computed: { computed: {
// Vuexgetter
...mapGetters("order", [
"getOrderProductList",
"getOrderMode",
"getOrderSort",
"getCurrentOrderId",
"getCustomerId"
]),
...mapGetters(["routeData"]), ...mapGetters(["routeData"]),
// productListVuex
vuexProductList: {
get() {
return this.getOrderProductList || [];
},
set(val) {
this.saveTempOrderInfo({ productList: val });
}
},
isViewMode() {
return this.getOrderMode === "view";
},
}, },
methods: { methods: {
resetPageState() { // Vuexaction
this.productList = []; // ...mapActions("order", [
this.$nextTick(() => { "saveTempOrderInfo",
if (this.$refs.productForm) { "clearOrderProductList",
this.$refs.productForm.clearValidate(); // "setOrderProductEdit"
} ]),
})},
//
resetPageState() {
this.clearOrderProductList();
this.setOrderProductEdit(false);
this.productForm.productList = [];
this.$nextTick(() => {
if (this.$refs.productForm) {
this.$refs.productForm.clearValidate();
}
});
},
//
handleCancel() { handleCancel() {
this.resetPageState(); this.resetPageState();
this.$router.push({ this.$router.push({
path: "/order/addEdit", path: "/order/addEdit",
query: { query: {
noClear: true, noClear: true,
mode: this.$route.query.mode ? this.$route.query.mode : "", mode: this.getOrderMode,
orderId: this.$route.query.orderId ? this.$route.query.orderId : "", orderId: this.getCurrentOrderId,
}, },
}); });
}, },
//
handleSave() { handleSave() {
this.$refs.productForm.validate((valid) => { this.$refs.productForm.validate((valid) => {
if (!valid) return; if (!valid) {
let arr = []; this.$message.warning("请修正表单中的错误后再保存!");
arr.push({ name: "工作台", url: "/wel" }, { name: "订单管理", url: "/order" }); return;
}
//
let arr = [
{ name: "工作台", url: "/wel" },
{ name: "订单管理", url: "/order" }
];
this.$store.commit("SET_ROUTE_DATA", [...this.routeData, ...arr]); this.$store.commit("SET_ROUTE_DATA", [...this.routeData, ...arr]);
// Vuex
this.vuexProductList = [...this.productForm.productList];
// productEditfalse
this.setOrderProductEdit(false);
//
const queryData = { const queryData = {
productList: this.productList, productList: this.productForm.productList,
sort: this.$route.query.sort,
}; };
this.resetPageState();
//
this.$router.push({ this.$router.push({
path: "/order/addEdit", path: "/order/addEdit",
query: { query: {
queryData: JSON.stringify(queryData), queryData: encodeURIComponent(JSON.stringify(queryData)),
mode: this.$route.query.mode ? this.$route.query.mode : "", mode: this.getOrderMode,
orderId: this.$route.query.orderId ? this.$route.query.orderId : "", orderId: this.getCurrentOrderId,
}, },
}); });
}); });
}, },
handleselectPro(row) {
this.currentClickRow = row; //
handleselectPro() {
// Vuex
this.vuexProductList = [...this.productForm.productList];
// productEdittrue
this.setOrderProductEdit(true);
this.$router.push({ this.$router.push({
path: "/order/category", path: "/order/category",
query: { query: {
sort: this.$route.query.sort, sort: this.getOrderSort,
productEdit: true, productEdit: true,
mode: this.$route.query.mode ? this.$route.query.mode : "", mode: this.getOrderMode,
orderId: this.$route.query.orderId ? this.$route.query.orderId : "", orderId: this.getOrderId,
customerId:this.$route.query.customerId ? this.$route.query.customerId:'', customerId: this.getCustomerId,
}, },
}); });
}, },
// 1 - +
//
handleQuantityChange(row, index) { handleQuantityChange(row, index) {
if (this.isViewMode) return; if (this.isViewMode) return;
// this.$refs.productForm.validateField(`productList[${index}].num`, (err) => {
this.$refs.productForm.validateField(`${index}.num`, (err) => { if (!err) {
if (!err) { // this.calculateCommission(index);
this.calculateCommission(row, index);
} }
}); });
}, },
// 2 - +
//
handlePriceChange(row, index) { handlePriceChange(row, index) {
if (this.isViewMode) return; if (this.isViewMode) return;
// this.$refs.productForm.validateField(`productList[${index}].sellingPrice`, (err) => {
this.$refs.productForm.validateField(`${index}.sellingPrice`, (err) => { if (!err) {
if (!err) { // this.calculateCommission(index);
this.calculateCommission(row, index);
} }
}); });
}, },
// 3 -
calculateCommission(row, index) { // productForm
// Numberundefined/null/NaN calculateCommission(index) {
const row = this.productForm.productList[index];
if (!row) return;
const standardPrice = Number(row.standardPrice) || 0; const standardPrice = Number(row.standardPrice) || 0;
const sellingPrice = Number(row.sellingPrice) || 0; const sellingPrice = Number(row.sellingPrice) || 0;
const num = Number(row.num) || 1; const num = Number(row.num) || 1;
// 2 const commission = Math.max(0, (sellingPrice - standardPrice) / 2) * num;
const commission = ((sellingPrice - standardPrice) / 2) * num; const splitPrice = commission.toFixed(2);
const splitPrice = Number(commission).toFixed(2);
// this.$set(this.productForm.productList, index, {
this.$set(this.productList, index, { ...row,
...this.productList[index],
splitPrice: splitPrice === "NaN" ? "0.00" : splitPrice, splitPrice: splitPrice === "NaN" ? "0.00" : splitPrice,
}); });
}, },
//
initProductData() { initProductData() {
this.productList.forEach((row, index) => { if (!Array.isArray(this.productForm.productList)) return;
this.productForm.productList.forEach((row, index) => {
//
if (!row.num || row.num < 1) { if (!row.num || row.num < 1) {
row.num = 1; this.$set(this.productForm.productList, index, {
...row,
num: 1
});
} }
if (row.sellingPrice) { //
this.calculateCommission(row, index); // if (row.sellingPrice && row.standardPrice) {
this.calculateCommission(index);
} else { } else {
row.splitPrice = "0.00"; // this.$set(this.productForm.productList, index, {
...row,
splitPrice: "0.00"
});
} }
}); });
}, },
onlyCalculateSplitPrice(row) {
const standardPrice = Number(row.standardPrice) || 0; //
const sellingPrice = Number(row.sellingPrice) || 0;
const num = Number(row.num) || 1;
const splitPrice = ((sellingPrice - standardPrice) / 2) * num;
row.splitPrice = Number(splitPrice).toFixed(2);
},
parseRouteParams() { parseRouteParams() {
const { queryData } = this.$route.query; const { queryData, productList } = this.$route.query;
if (queryData) { // queryData
if (queryData && !this.productForm.productList.length) {
try { try {
const parseData = JSON.parse(queryData); const parseData = JSON.parse(decodeURIComponent(queryData));
const newProductList = parseData.productList || []; const newProductList = parseData.productList || [];
if (newProductList.length === 0) return; if (newProductList.length > 0) {
// const existProductIds = this.productList.map(item => item.productId || item.id); this.productForm.productList = [...this.productForm.productList, ...newProductList]; //
// const uniqueNewList = newProductList.filter(item => { // Vuex
// const itemId = item.productId || item.id; this.vuexProductList = [...this.productForm.productList];
// return !existProductIds.includes(itemId); }
// });
this.productList = [...this.productList, ...newProductList];
} catch (e) { } catch (e) {
console.error("解析queryData失败:", e); console.error("解析queryData失败:", e);
this.$message.error("产品数据解析失败,请重新操作"); this.$message.error("产品数据解析失败,请重新操作");
} }
} }
this.initProductData(); // productList
else if (productList && !this.productForm.productList.length) {
try {
const newProductList = JSON.parse(decodeURIComponent(productList));
this.productForm.productList = [...newProductList];
// Vuex
this.vuexProductList = [...newProductList];
} catch (e) {
console.error("解析productList失败:", e);
}
}
}, },
},
mounted() {
}, // Vuex
activated() { initVuexData() {
if(this.$route.query.addEdit){ let initProductList = [];
this.productList = this.$route.query.productList if (this.$route.query.addEdit && this.$route.query.productList) {
? JSON.parse(this.$route.query.productList) try {
: []; initProductList = JSON.parse(decodeURIComponent(this.$route.query.productList));
} catch (e) {
initProductList = [];
}
}
//
this.productForm.productList = [...initProductList];
// Vuex
this.vuexProductList = [...initProductList];
} }
},
// 4/ //
this.isViewMode = this.$route.query.mode === "view"; mounted() {
this.initProductData(); this.initVuexData();
this.parseRouteParams(); this.parseRouteParams();
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.productForm) { this.initProductData();
this.$refs.productForm.clearValidate(); // if (this.$refs.productForm) {
} this.$refs.productForm.clearValidate();
}) }
});
}, },
}; };
</script> </script>
@ -320,13 +408,12 @@ export default {
padding: 20px !important; padding: 20px !important;
box-sizing: border-box; box-sizing: border-box;
.pageTitle{ .pageTitle{
// font-size: 26px; font-size:$font-size-title;
font-size:$font-size-title; margin-bottom: 10px;
margin-bottom: 10px; width: 100%;
width: 100%; text-align: center;
text-align: center; }
}
.btn-group { .btn-group {
gap: 10px; gap: 10px;
@ -338,23 +425,26 @@ export default {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
margin-top: 4px; margin-top: 4px;
text-align: center;
} }
::v-deep .el-form-item { ::v-deep .el-form-item {
margin-bottom: 10px !important; // margin-bottom: 10px !important;
width: 100%; // width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; // align-items: center;
} }
::v-deep .el-form-item__error {
position: static !important; // ::v-deep .el-form-item__error {
position: static !important;
padding: 0 !important; padding: 0 !important;
margin-top: 2px !important; // margin-top: 2px !important;
font-size: 18px !important; // font-size: 12px !important;
line-height: 1.2 !important; line-height: 1.2 !important;
white-space: nowrap; // white-space: nowrap;
text-align: center; // text-align: center;
color: #f56c6c;
} }
} }
</style> </style>

@ -558,7 +558,7 @@ export default {
margin-left: 25px; margin-left: 25px;
margin-right: 10px; margin-right: 10px;
display: flex; display: flex;
align-items: end; align-items: flex-end;
.delete-btn { .delete-btn {
display: flex; display: flex;

@ -78,10 +78,10 @@ export default {
mounted(){ mounted(){
console.log('this.$route---------------',this.$route) console.log('this.$route---------------',this.$route)
console.log('this.routeData---------------',this.routeData) console.log('this.routeData---------------',this.routeData)
let arr = [ // let arr = [
{name:'工作台',url:'/wel'} // {name:'',url:'/wel'}
] // ]
this.$store.commit('SET_ROUTE_DATA',arr) // this.$store.commit('SET_ROUTE_DATA',arr)
this.getCategoryList() this.getCategoryList()
// //
document.addEventListener('click', this.closeContextMenu) document.addEventListener('click', this.closeContextMenu)

@ -55,14 +55,24 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(["routeData"]), ...mapGetters(["routeData"]),
// Vuex
...mapGetters("order", [
"getProductSelectState", //
"getProductSelectCustomerId", // ID
"getSelectedSubcategoryIds", // ID
"getTempOrderInfo",
"getOrderProductEdit",
"getOrderMode",
"getCurrentOrderId",
]),
}, },
mounted() { mounted() {
// year // year
this.year = this.$route.query.year; this.year = this.$route.query.year;
this.getTemplateDataFromApi(); this.getTemplateDataFromApi();
// //
this.$store.commit("SET_ROUTE_DATA", [{ name: "工作台", url: "/wel" }]); // this.$store.commit("SET_ROUTE_DATA", [{ name: "", url: "/wel" }]);
}, },
methods: { methods: {
async getTemplateDataFromApi() { async getTemplateDataFromApi() {
@ -148,8 +158,8 @@ export default {
path: "/order/addEdit", path: "/order/addEdit",
query: { query: {
temData: JSON.stringify(selectedTemplates), temData: JSON.stringify(selectedTemplates),
mode: this.$route.query.mode ? this.$route.query.mode : "", mode: this.getOrderMode,
orderId: this.$route.query.orderId ? this.$route.query.orderId : "", orderId: this.getCurrentOrderId,
}, },
}); });
}, },
@ -178,7 +188,7 @@ export default {
// //
.btn-group { .btn-group {
display: flex; display: flex;
justify-content: end; justify-content: flex-end;
} }
// //
@ -194,7 +204,7 @@ export default {
} }
// //
.prodct_list{ .product_list{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 15px; margin-top: 15px;
@ -225,6 +235,72 @@ export default {
} }
} }
} }
//
.product_list {
display: flex;
flex-wrap: wrap;
margin-top: 15px;
// padding auto
padding: 0;
//
margin: 15px auto 0;
// 5+
width: calc( (10.42vw + 5vw) * 5 - 5vw );
//
justify-content: flex-start;
gap: 5vw;
//
.product_item {
width: 10.42vw;
height: 10.42vw;
border-radius: 2.08vw;
background: #f1ab46;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 2.5vw;
text-align: center;
cursor: pointer;
&:hover {
background: #ecb76c;
}
position: relative;
padding: 0 0.5vw;
box-sizing: border-box;
//
&.selected {
background: #e0a860;
}
.item-name {
width: 100%;
height: 80%;
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
//
.item-check {
position: absolute;
bottom: 10px;
right: 10px;
width: 1.5vw;
height: 1.5vw;
background: #1890ff;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 1vw;
border-radius: 6px;
}
}
}
} }
} }
</style> </style>

File diff suppressed because it is too large Load Diff

@ -1,5 +1,5 @@
<template> <template>
<div class="box"> <div class="box" v-if="!loading">
<basic-crumb></basic-crumb> <basic-crumb></basic-crumb>
<!-- 页面标题 --> <!-- 页面标题 -->
<div class="page-title">订单修改记录</div> <div class="page-title">订单修改记录</div>
@ -175,19 +175,19 @@
<div class="card-title">修改后的信息</div> <div class="card-title">修改后的信息</div>
<div class="info-item"> <div class="info-item">
<span class="label">项目名称:</span> <span class="label">项目名称:</span>
<span class="value changed">{{ system.after.name }}</span> <span class="value" :class="{changed: system.after.name !== system.before.name}">{{ system.after.name }}</span>
</div> </div>
<div class="info-item"> <div class="info-item">
<span class="label">项目数量:</span> <span class="label">项目数量:</span>
<span class="value changed">{{ system.after.num }}</span> <span class="value" :class="{changed: system.after.num !== system.before.num}">{{ system.after.num }}</span>
</div> </div>
<div class="info-item"> <div class="info-item">
<span class="label">项目单位:</span> <span class="label">项目单位:</span>
<span class="value changed">{{ system.after.unit }}</span> <span class="value changed" :class="{changed: system.after.unit !== system.before.unit}">{{ system.after.unit }}</span>
</div> </div>
<div class="info-item"> <div class="info-item">
<span class="label">产品总指导价:</span> <span class="label">产品总指导价:</span>
<span class="value changed">{{ <span class="value" :class="{changed: system.after.standardPrice !== system.before.standardPrice}">{{
system.after.standardPrice system.after.standardPrice
}}</span> }}</span>
</div> </div>
@ -252,6 +252,7 @@ export default {
orderList: [], orderList: [],
recordData: null, recordData: null,
activeSystem: ["1"], activeSystem: ["1"],
}; };
}, },
components: { components: {
@ -265,7 +266,6 @@ export default {
try { try {
this.loading = true; this.loading = true;
const code = this.$route.query.code; const code = this.$route.query.code;
//
const res = await getcodeList({ code: code }); const res = await getcodeList({ code: code });
const orderList = res.data.data ; const orderList = res.data.data ;

@ -116,7 +116,7 @@
生成发货明细表 生成发货明细表
</el-button> --> </el-button> -->
</el-col> </el-col>
<el-col :span="6" style="display: flex; justify-content: end"> <el-col :span="6" style="display: flex; justify-content: flex-end">
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@ -134,12 +134,12 @@
<div class="table-wrapper"> <div class="table-wrapper">
<el-table <el-table
:data="orderTableData" :data="orderTableData"
border max-height="450px"
width: 100% border
height= "500px" :style="{ width: '100%'}"
:loading="isLoading" :loading="isLoading"
:header-cell-style="{ 'text-align': 'center', }" :header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
@selection-change="selectionChange" @selection-change="selectionChange"
> >
@ -174,7 +174,7 @@
<el-link type="primary" @click="handleEditOrder(scope.row)" <el-link type="primary" @click="handleEditOrder(scope.row)"
>修改</el-link >修改</el-link
> >
<el-link type="primary" @click="handleViewChangeLog(scope.row)" <el-link type="primary" @click="handleViewChangeLog(scope.row)" v-if="isSuperAdmin"
>修改记录</el-link >修改记录</el-link
> >
<el-link type="primary" @click="handleSubmitReview(scope.row)" <el-link type="primary" @click="handleSubmitReview(scope.row)"
@ -816,11 +816,6 @@ export default {
// max-height: 600px; // max-height: 600px;
} }
::v-deep .el-table {
}
.english_box { .english_box {
width: 98%; width: 98%;
padding: 10px 10px 0 10px; padding: 10px 10px 0 10px;

@ -150,10 +150,10 @@ export default {
query: { query: {
categoryId: this.categoryId, categoryId: this.categoryId,
subcategoryId: val.id, subcategoryId: val.id,
sort: this.$route.query.sort ? this.$route.query.sort : '', // sort: this.$route.query.sort ? this.$route.query.sort : '',
productEdit: this.$route.query.productEdit ? this.$route.query.productEdit : '', // productEdit: this.$route.query.productEdit ? this.$route.query.productEdit : '',
mode: this.$route.query.mode ? this.$route.query.mode:'', // mode: this.$route.query.mode ? this.$route.query.mode:'',
orderId:this.$route.query.orderId ? this.$route.query.orderId:'', // orderId:this.$route.query.orderId ? this.$route.query.orderId:'',
customerId:this.$route.query.customerId ? this.$route.query.customerId:'', customerId:this.$route.query.customerId ? this.$route.query.customerId:'',
} }
}) })

@ -44,8 +44,8 @@ export default {
mounted() { mounted() {
console.log("this.$route---------------", this.$route); console.log("this.$route---------------", this.$route);
console.log("this.routeData---------------", this.routeData); console.log("this.routeData---------------", this.routeData);
let arr = [{ name: "工作台", url: "/wel" }]; // let arr = [{ name: "", url: "/wel" }];
this.$store.commit("SET_ROUTE_DATA", arr); // this.$store.commit("SET_ROUTE_DATA", arr);
this.getYearList(); this.getYearList();
}, },
methods: { methods: {

@ -53,8 +53,8 @@
</div> </div>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column label="#" type="index" width="50" align="center"></el-table-column> <el-table-column label="#" type="index" width="70" align="center"></el-table-column>
<el-table-column prop="code" label="编号" align="center" width="190"> <el-table-column prop="code" label="编号" align="center" width="240">
<!-- <template #header> <!-- <template #header>
<span><i style="color:red">*</i>物料编号</span> <span><i style="color:red">*</i>物料编号</span>
</template> --> </template> -->
@ -94,7 +94,7 @@
:disabled="scope.row.bizType == 2 || (scope.row.id && !scope.row.isEditing)"></el-input> :disabled="scope.row.bizType == 2 || (scope.row.id && !scope.row.isEditing)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="standardPrice" label="公司指导价" align="center" width="150"> <el-table-column prop="standardPrice" label="公司指导价" align="center" width="200">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.standardPrice" v-if="scope.row.bizType == 1 || !scope.row.bizType" <el-input v-model="scope.row.standardPrice" v-if="scope.row.bizType == 1 || !scope.row.bizType"
@input="handlePrice(scope.row.standardPrice, scope.$index)" @input="handlePrice(scope.row.standardPrice, scope.$index)"
@ -120,7 +120,7 @@
<el-input v-if="scope.row.bizType == 1 || !scope.row.bizType" v-model="scope.row.remarkCn" <el-input v-if="scope.row.bizType == 1 || !scope.row.bizType" v-model="scope.row.remarkCn"
:disabled="scope.row.bizType == 2 || (scope.row.id && !scope.row.isEditing)"></el-input> :disabled="scope.row.bizType == 2 || (scope.row.id && !scope.row.isEditing)"></el-input>
<el-input v-if="scope.row.bizType == 2" v-model="scope.row.bizRemark" <el-input v-if="scope.row.bizType == 2" v-model="scope.row.bizRemark"
:disabled="scope.row.bizType == 2"></el-input> :disabled="scope.row.bizType == 2 "></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="250"> <el-table-column fixed="right" label="操作" align="center" width="250">
@ -214,6 +214,18 @@ export default {
// this.getCustomerData() // this.getCustomerData()
}, },
methods: { methods: {
scrollTableToTop() {
if (this.$refs.multipleTable) {
const scrollContainer = this.$refs.multipleTable.bodyWrapper;
if (scrollContainer) {
//
scrollContainer.scrollTo({
top: 0,
behavior: 'smooth' //
});
}
}
},
handleCancle() { handleCancle() {
this.$router.push({ this.$router.push({
path:'/wel' path:'/wel'
@ -389,9 +401,10 @@ blurBizPrice(value, index) {
// ========== ========== // ========== ==========
handleSearch() { handleSearch() {
this.getProductList(this.$route.query.subcategoryId ) this.getProductList(this.$route.query.subcategoryId )
this.$nextTick(() => {
this.scrollTableToTop();
});
}, },
// ========== ========== // ========== ==========
@ -403,7 +416,9 @@ blurBizPrice(value, index) {
this.$refs.searchForm.resetFields() this.$refs.searchForm.resetFields()
} }
this.getProductList(this.$route.query.subcategoryId ) this.getProductList(this.$route.query.subcategoryId )
this.$nextTick(() => {
this.scrollTableToTop();
});
}, },

@ -15,7 +15,7 @@
<el-form <el-form
ref="addForm" ref="addForm"
:model="addForm" :model="addForm"
label-width="120px" label-width="8vw"
:rules="formRules" :rules="formRules"
> >
<el-row> <el-row>
@ -206,18 +206,20 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() =>{ }).then(() => {
if(row.id){ this.tableData.splice(index, 1);
deletePro({ids:row.id}).then(res =>{ this.$message.success('删除成功')
if(res.data.code == 200){ // if(row.id){
this.$message.success('删除成功') // deletePro({ids:row.id}).then(res =>{
this.tableData.splice(index,1) // if(res.data.code == 200){
} // this.$message.success('')
}) // this.tableData.splice(index,1)
}else{ // }
this.tableData.splice(index, 1); // })
this.$message.success('删除成功') // }else{
} // this.tableData.splice(index, 1);
// this.$message.success('')
// }
}) })
}, },
getDetail(id){ getDetail(id){

@ -172,7 +172,7 @@
<el-dialog <el-dialog
title="修改明细" title="修改明细"
:visible.sync="historyDialogVisible" :visible.sync="historyDialogVisible"
width="1000px" width="1100px"
append-to-body append-to-body
> >
<el-table <el-table
@ -182,12 +182,19 @@
cell-style="text-align: center;" cell-style="text-align: center;"
min-height="200px" min-height="200px"
> >
<el-table-column label="修改前汇率" prop="rateOld" width="160"> <!-- 修改前汇率单独设置单元格右对齐 -->
<template #default="scope">{{ scope.row.rateOld }}</template> <el-table-column label="修改前汇率" prop="rateOld">
</el-table-column> <template #default="scope">
<el-table-column label="修改后汇率" prop="newPrice" width="160"> <div style="text-align: right; padding-right: 10px;">{{ scope.row.rateOld }}</div>
<template #default="scope"> {{ scope.row.rate }}</template> </template>
</el-table-column> </el-table-column>
<!-- 修改后汇率单独设置单元格右对齐 -->
<el-table-column label="修改后汇率" prop="newPrice">
<template #default="scope">
<div style="text-align: right; padding-right: 10px;">{{ scope.row.rate }}</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="修改人" label="修改人"
prop="createUserName" prop="createUserName"
@ -201,7 +208,7 @@
<el-table-column <el-table-column
label="备注" label="备注"
prop="remarks" prop="remarks"
width="160"
></el-table-column> ></el-table-column>
<!-- <el-table-column <!-- <el-table-column
label="修改后汇率" label="修改后汇率"

@ -160,7 +160,8 @@ export default {
}, },
handleAdd() { handleAdd() {
this.resetForm(); this.resetForm();
this.dialogTitle = '新增小类';
this.addDialog = true this.addDialog = true
}, },
submit(){ submit(){

@ -70,7 +70,7 @@ export default {
width: 100%; width: 100%;
.tip-close{ .tip-close{
display: flex; display: flex;
justify-content: end; justify-content: flex-end;
} }
.tip-alert{ .tip-alert{
display: flex ; display: flex ;

@ -301,7 +301,7 @@ import { resetRouter } from '@/router/router';
border-radius: 15px; border-radius: 15px;
margin: 0 auto; margin: 0 auto;
margin-top: 20px; margin-top: 20px;
padding: 2vw 0; // padding: 2vw 0;
.title_box{ .title_box{
margin-top: 15px; margin-top: 15px;
@ -315,7 +315,7 @@ import { resetRouter } from '@/router/router';
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 15px; margin-top: 15px;
padding: 0; padding: 1vw 0;
// //
margin: 0px auto 0; margin: 0px auto 0;
// 5+ // 5+

Loading…
Cancel
Save