优化样式等

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: "",
//
// username: "admin",
username:'jinchao',
username:'',
//
password: "123456",
password: "",
// password: "admin",
//
type: "account",

@ -50,7 +50,7 @@ axios.interceptors.request.use(config => {
config.url = baseUrl + config.url;
}
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{
// config.url = "http://192.168.0.220:8090" + config.url

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

@ -2,47 +2,205 @@ const order = {
namespaced: true,
state: {
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: [],
isTemporaryLeave: false
isTemporaryLeave: false
},
productSelectState: {
customerId: '',
subcategoryId: '',
selectedSubcategoryIds: [],
leftTableData: [],
rightTableData: [],
}
},
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: {
// 保存临时订单信息(支持部分更新)
saveTempOrderInfo({ commit }, data) {
commit('SET_TEMP_ORDER_INFO', data);
},
// 清空临时订单信息
clearTempOrderInfo({ commit }) {
commit('CLEAR_TEMP_ORDER_INFO');
},
// 设置临时离开标记
setTemporaryLeave({ commit }, 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: {
// 修复:保存数据时继承原有isTemporaryLeave标记,不丢失
// 修复:安全合并临时订单信息,避免null/undefined
SET_TEMP_ORDER_INFO(state, data) {
state.tempOrderInfo = {
...state.tempOrderInfo, // 保留原有所有属性(包括标记)
form: { ...state.tempOrderInfo.form, ...(data.form || {}) },
projectList: Array.isArray(data.projectList) ? JSON.parse(JSON.stringify(data.projectList)) : []
};
// 1. 校验传入的data是否为合法对象
if (!data || typeof data !== 'object' || Array.isArray(data)) {
return;
}
// 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) {
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: [],
isTemporaryLeave: false
};
// 同时清空产品选择状态
state.productSelectState = {
customerId: '',
subcategoryId: '',
selectedSubcategoryIds: [],
leftTableData: [],
rightTableData: []
};
},
// 修复:正确给tempOrderInfo内部的标记赋值
// 设置临时离开标记
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
>
</span>
</div>
<div class="info-item">
<span class="label">货币单位:</span>
<span class="value">{{ getMonetaryUnitText(orderData.monetaryUnit) }}</span>
</div>
<div class="info-item">
<span class="label">交货时间:</span>
@ -50,17 +54,17 @@
<el-col :span="12">
<div class="info-item">
<span class="label">公司指导价:</span>
<span class="value">{{ orderData.standardPrice || "" }}</span>
<span class="value">{{ orderData.standardPrice || "" }}</span>
</div>
<div class="info-item">
<span class="label">销售价:</span>
<span class="value">{{ orderData.sellingPrice || "" }}</span>
<span class="value">{{ orderData.sellingPrice || "" }}</span>
</div>
<!-- 分成金额 -->
<div class="info-item formula">
<span class="label">分成金额:</span>
<span class="value">
<span class="value">{{ orderData.splitPrice || "" }}</span>
<span class="value">{{ orderData.splitPrice || "" }}</span>
</span>
</div>
<div class="info-item">
@ -69,9 +73,9 @@
<el-input
v-model="orderData.discountAmount"
:disabled="isDisabled"
style="width: 7vw"
style="width: 10vw"
placeholder="请输入"
/>
/>
</span>
</div>
<!-- 提成金额 -->
@ -80,10 +84,10 @@
<span class="value">
<el-input
v-model="orderData.commissionPrice"
:disabled="isDisabled"
style="width: 7vw"
disabled
style="width: 10vw"
placeholder="请输入"
/>
/>
</span>
</div>
<div class="info-item">
@ -92,7 +96,7 @@
<el-input
v-model="orderData.commissionRate"
placeholder="请输入"
style="width: 7vw"
style="width: 10vw"
:disabled="isDisabled"
@input="calcCommissionPrice"
/>%
@ -107,7 +111,7 @@
v-model="orderData.exchangeRate"
:disabled="isDisabled"
placeholder="请输入"
style="width: 150px"
style="width: 10vw"
/>
</span>
</div>
@ -338,7 +342,9 @@ import {
getExchangeRateList
} from "@/api/approval/approvalDetails.js";
import { searchData } from "@/api/customer/customer.js";
import {
getCurrencyList,
} from "@/api/order/orderAddEdit";
export default {
components: {
basicCrumb,
@ -364,6 +370,7 @@ export default {
this.getOrderDetail(orderId);
this.orderId = orderId;
}
this.loadCurrencyList();
},
methods: {
@ -395,6 +402,25 @@ export default {
//
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() {
@ -415,27 +441,20 @@ export default {
},
//
calcCommissionPrice() {
// 1.
const standardPrice = Number(this.orderData.standardPrice || 0); //
let commissionRate = this.orderData.commissionRate ? this.orderData.commissionRate.toString().trim() : ''; //
const standardPrice = Number(this.orderData.standardPrice || 0);
let commissionRate = this.orderData.commissionRate ? this.orderData.commissionRate.toString().trim() : '';
// 2. /
if (!/^\d+(\.\d+)?$/.test(commissionRate)) {
this.orderData.commissionPrice = '';
this.orderData.commissionPrice = "0.00"; // 0.00
return;
}
// 3. 10 0.1 = × ()
const rate = Number(commissionRate) / 100;
let commissionPrice = standardPrice * rate;
// 4. 2
commissionPrice = commissionPrice.toFixed(2);
// .00
this.orderData.commissionPrice = commissionPrice.endsWith('.00') ? commissionPrice.split('.')[0] : commissionPrice;
this.orderData.commissionPrice = commissionPrice.toFixed(2); //
},
getContactValue(key) {
// contacts
// contacts
if (
this.customerDetail.contacts &&
Array.isArray(this.customerDetail.contacts) &&
@ -529,6 +548,7 @@ calcCommissionPrice() {
}
try {
const requestData = {
...this.orderData,
id: this.orderData.id,
commissionRate: this.orderData.commissionRate,
exchangeRate: this.orderData.exchangeRate,
@ -633,6 +653,9 @@ calcCommissionPrice() {
margin-bottom: 10px;
// line-height: 32px;
font-size: $font-size-26;
height: 2vw;
display: flex;
align-items: center;
.label {
width: 9.478vw !important;
@ -867,7 +890,7 @@ calcCommissionPrice() {
// width: 110px;
// font-weight: 500;
color: #606266;
text-align: right;
text-align: left;
padding-right: 15px;
font-size: $font-size-24;
width: 10vw;

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

@ -354,10 +354,14 @@ export default {
this.$message.error('请检查手机号或邮箱格式是否正确');
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 = {
...this.addForm,
contacts:this.tableData
contacts: this.tableData,
countryName: countryName,
}
addCustomer(params).then(res =>{
if(res.data.code == 200){
@ -365,10 +369,13 @@ export default {
this.$router.push('/customer')
}
})
}else{
} else {
let params = {
...this.addForm,
contacts:this.tableData
contacts: this.tableData,
countryName: countryName,
}
editCustomer(params).then(res =>{
if(res.data.code == 200){

@ -50,10 +50,10 @@
</div>
<div class="table-wrapper" >
<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' }">
<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="countryValue" width="150"></el-table-column>
<el-table-column label="客户来源" prop="fromTypeValue" width="150"></el-table-column>

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

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

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

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

@ -55,14 +55,24 @@ export default {
};
},
computed: {
...mapGetters(["routeData"]),
...mapGetters(["routeData"]),
// Vuex
...mapGetters("order", [
"getProductSelectState", //
"getProductSelectCustomerId", // ID
"getSelectedSubcategoryIds", // ID
"getTempOrderInfo",
"getOrderProductEdit",
"getOrderMode",
"getCurrentOrderId",
]),
},
mounted() {
// year
this.year = this.$route.query.year;
this.getTemplateDataFromApi();
//
this.$store.commit("SET_ROUTE_DATA", [{ name: "工作台", url: "/wel" }]);
// this.$store.commit("SET_ROUTE_DATA", [{ name: "", url: "/wel" }]);
},
methods: {
async getTemplateDataFromApi() {
@ -148,8 +158,8 @@ export default {
path: "/order/addEdit",
query: {
temData: JSON.stringify(selectedTemplates),
mode: this.$route.query.mode ? this.$route.query.mode : "",
orderId: this.$route.query.orderId ? this.$route.query.orderId : "",
mode: this.getOrderMode,
orderId: this.getCurrentOrderId,
},
});
},
@ -178,7 +188,7 @@ export default {
//
.btn-group {
display: flex;
justify-content: end;
justify-content: flex-end;
}
//
@ -194,7 +204,7 @@ export default {
}
//
.prodct_list{
.product_list{
display: flex;
flex-wrap: wrap;
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>

File diff suppressed because it is too large Load Diff

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save