feat(wms): 添加库位分割合并功能并优化仓库展示

refactor(warehouse): 重构仓库组件为按列展示模式
- 将分层展示改为分列展示,每列包含上下两层库位
- 添加右键菜单支持分割、合并操作
- 优化库位格子样式和交互

feat(crm): 新增订单编辑组件并实现自动保存
- 添加OrderEdit组件支持订单信息编辑
- 实现2秒延迟自动保存功能
- 优化订单详情页面布局

fix(delivery): 在查询参数中添加当前用户ID
- 在mycoil列表查询中添加saleId参数

style(preOrder): 注释掉审核人和审核时间列
- 隐藏预订单列表中的审核信息列

chore(warehouse): 移除仓库实体的导入导出按钮
- 注释掉仓库管理页面的模板下载和导入功能
This commit is contained in:
砂糖
2025-12-19 18:06:55 +08:00
parent a178ee4f5e
commit c821a2f7b9
10 changed files with 703 additions and 202 deletions

View File

@@ -0,0 +1,156 @@
<template>
<div>
<!-- 客户编号和保存按钮 -->
<div class="save-btn-container">
<input class="customer-code-input" type="text" v-model="form.orderCode" placeholder="请输入订单编号" />
<el-button class="save-btn" type="primary" @click="manualSave">
保存变更
</el-button>
</div>
<el-form label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="客户名称" prop="customerId">
<el-select v-model="form.customerId" placeholder="请选择客户名称">
<el-option v-for="item in customerList" :key="item.customerId" :label="item.customerCode"
:value="item.customerId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="订单金额" prop="orderAmount">
<el-input v-model="form.orderAmount" placeholder="请输入订单金额"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销售员" prop="salesman">
<el-input v-model="form.salesman" placeholder="请输入销售员"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="交货日期" prop="deliveryDate">
<el-date-picker clearable v-model="form.deliveryDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择交货日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" :rows="4" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
export default {
name: 'OrderEdit',
props: {
initValue: {
type: Object,
default: () => ({})
},
customerList: {
type: Array,
default: () => []
}
},
data() {
return {
form: {
...this.initValue
},
// 防抖计时器标识
debounceTimer: null
}
},
watch: {
// 深度监听form对象的所有属性变化
form: {
deep: true,
handler() {
// 每次编辑时先清除之前的计时器
if (this.debounceTimer) {
clearTimeout(this.debounceTimer);
}
// 重新设置2秒后的保存回调
this.debounceTimer = setTimeout(() => {
this.$emit('save', { ...this.form }); // 传递表单副本,避免外部修改影响内部
}, 2000); // 2秒延迟
}
}
},
beforeDestroy() {
// 组件销毁时清除计时器,防止内存泄漏
if (this.debounceTimer) {
clearTimeout(this.debounceTimer);
}
},
methods: {
// 可选:手动触发保存的方法(如需主动保存时调用)
manualSave() {
if (this.debounceTimer) {
clearTimeout(this.debounceTimer);
}
this.$emit('save', { ...this.form });
}
}
}
</script>
<style scoped>
/* 客户编号输入框样式 */
.customer-code-input {
width: 300px;
height: 36px;
padding: 0 15px;
border: 1px solid #dcdfe6;
font-size: 14px;
color: #606266;
background-color: transparent;
transition: border-color 0.2s, background-color 0.2s;
outline: none;
box-sizing: border-box;
}
/* 输入框 hover 状态 */
.customer-code-input:hover {
border-color: #c0c4cc;
background-color: #f5f7fa;
}
/* 输入框 focus 状态 */
.customer-code-input:focus {
border-color: #409eff;
background-color: #fff;
}
/* 禁用状态 */
.customer-code-input:disabled {
background-color: #f5f7fa;
color: #c0c4cc;
cursor: not-allowed;
}
/* 保存变更按钮容器 */
.save-btn-container {
margin-bottom: 20px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
/* 保存按钮自定义样式 */
.save-btn {
padding: 8px 20px;
font-size: 14px;
}
</style>

View File

@@ -57,6 +57,8 @@
</el-tab-pane>
<el-tab-pane label="订单编辑" name="edit">
<div class="order-detail" v-if="activeTab === 'edit'">
<OrderEdit :initValue="currentOrder" :customerList="customerList" @save="handleOrderSave" />
<el-descriptions title="订单明细" />
<OrderDetail :orderId="currentOrder.orderId" />
</div>
</el-tab-pane>
@@ -122,16 +124,18 @@
<script>
import KLPList from '@/components/KLPUI/KLPList/index.vue'
import { listOrder, addOrder, delOrder } from "@/api/crm/order";
import { listOrder, addOrder, delOrder, updateOrder } from "@/api/crm/order";
import { listCustomer } from "@/api/crm/customer";
import { ORDER_STATUS, ORDER_TYPE } from '../js/enum'
import OrderDetail from '../components/OrderDetail.vue';
import OrderEdit from '../components/OrderEdit.vue';
export default {
name: 'OrderPage',
components: {
KLPList,
OrderDetail
OrderDetail,
OrderEdit
},
dicts: ['customer_level', 'customer_industry'],
data() {
@@ -249,28 +253,34 @@ export default {
});
});
},
handleOrderSave(form) {
this.form = form;
console.log('保存订单:', form, this)
const that = this;
that.submitForm()
},
/** 提交按钮 */
submitForm() {
async submitForm() {
if (this.form.orderId) {
updateOrder(this.form).then(_ => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
return;
}
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.orderId != null) {
updateOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addOrder(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
addOrder(this.form).then(_ => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
});
},

View File

@@ -84,12 +84,12 @@
<span v-else>未知状态</span>
</template>
</el-table-column>
<el-table-column label="审核人" align="center" prop="auditUser" />
<!-- <el-table-column label="审核人" align="center" prop="auditUser" />
<el-table-column label="审核时间" align="center" prop="auditTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button