Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
2026-03-12 14:29:40 +08:00
9 changed files with 250 additions and 48 deletions

View File

@@ -1,5 +1,23 @@
import request from '@/utils/request' import request from '@/utils/request'
function parseDate(date) {
// 修复1参数名和内部变量名冲突改用tempDate
// 修复2如果传入的date为空/无效,默认使用当前时间
const tempDate = date ? new Date(date) : new Date();
// 获取年、月、日、时、分、秒(补零处理,确保是两位数)
const year = tempDate.getFullYear();
// 月份从0开始所以要+1不足两位补0
const month = String(tempDate.getMonth() + 1).padStart(2, '0');
const day = String(tempDate.getDate()).padStart(2, '0');
const hours = String(tempDate.getHours()).padStart(2, '0');
const minutes = String(tempDate.getMinutes()).padStart(2, '0');
const seconds = String(tempDate.getSeconds()).padStart(2, '0');
// 格式化为YYYY-mm-dd HH:mm:ss并返回
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
// 查询钢卷待操作列表 // 查询钢卷待操作列表
export function listPendingAction(query) { export function listPendingAction(query) {
return request({ return request({
@@ -44,19 +62,33 @@ export function getPendingAction(actionId) {
// 新增钢卷待操作 // 新增钢卷待操作
export function addPendingAction(data) { export function addPendingAction(data) {
const payload = { ...data }
if (payload.processTime) {
payload.processTime = parseDate(payload.processTime)
}
if (payload.completeTime) {
payload.completeTime = parseDate(payload.completeTime)
}
return request({ return request({
url: '/wms/coilPendingAction', url: '/wms/coilPendingAction',
method: 'post', method: 'post',
data: data data: payload
}) })
} }
// 修改钢卷待操作 // 修改钢卷待操作
export function updatePendingAction(data) { export function updatePendingAction(data) {
const payload = { ...data }
if (payload.processTime) {
payload.processTime = parseDate(payload.processTime)
}
if (payload.completeTime) {
payload.completeTime = parseDate(payload.completeTime)
}
return request({ return request({
url: '/wms/coilPendingAction', url: '/wms/coilPendingAction',
method: 'put', method: 'put',
data: data data: payload
}) })
} }

View File

@@ -20,7 +20,7 @@
<el-dialog title="选择钢卷" :visible.sync="dialogVisible" :width="dialogWidth" :close-on-click-modal="false" <el-dialog title="选择钢卷" :visible.sync="dialogVisible" :width="dialogWidth" :close-on-click-modal="false"
@close="handleClose" append-to-body :fullscreen="orderBy"> @close="handleClose" append-to-body :fullscreen="orderBy">
<!-- 搜索区域 --> <!-- 搜索区域 -->
<el-form v-if="!rangeMode" :model="queryParams" class="search-form"> <el-form v-if="!rangeMode" inline :model="queryParams" class="search-form">
<!-- <el-form-item label="类型"> <!-- <el-form-item label="类型">
<el-select v-model="queryParams.selectType" placeholder="请选择类型" size="small"> <el-select v-model="queryParams.selectType" placeholder="请选择类型" size="small">
<el-option label="成品" value="product" /> <el-option label="成品" value="product" />
@@ -62,12 +62,13 @@
</el-form-item> </el-form-item>
<el-form-item label="实际库区" v-if="orderBy"> <el-form-item label="实际库区" v-if="orderBy">
<actual-warehouse-select v-model="queryParams.actualWarehouseId" placeholder="请选择实际库区" canSelectLevel2 <actual-warehouse-select v-model="queryParams.actualWarehouseId" placeholder="请选择实际库区" canSelectLevel2
canSelectDisabled @select="handleWarehouseChange" /> canSelectDisabled :clearInput="false" clearable />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
<el-checkbox style="margin-left: 10px;" v-model="showCoilMap" size="small">显示钢卷地图</el-checkbox>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -122,8 +123,13 @@
</div> </div>
<!-- 一个可以拖拽和调节大小的浮层 --> <!-- 一个可以拖拽和调节大小的浮层 -->
<DragResizeBox v-if="selectedNodeId" @size-change="handleSizeChange"> <DragResizeBox v-if="showCoilMap" @size-change="handleSizeChange" storageKey="coil-map">
<div style="height: 100%; width: 100%; overflow-y: scroll;"> <div style="height: 100%; width: 100%; overflow-y: scroll; display: flex; background-color: #fff;">
<div style="min-width: 150px; position: sticky; top: 0;" v-loading="treeLoading">
<el-tree ref="warehouseTreeRef" :data="warehouseTree" :props="treeProps" node-key="actualWarehouseId"
@node-click="handleNodeClick" :expand-on-click-node="false" highlight-current class="warehouse-tree">
</el-tree>
</div>
<warehouse-bird-mini ref="warehouseBirdMini" v-loading="warehouseLoading" :warehouseList="warehouseList" :id="selectedNodeId" <warehouse-bird-mini ref="warehouseBirdMini" v-loading="warehouseLoading" :warehouseList="warehouseList" :id="selectedNodeId"
:canToggle="false" :canRelease="false" /> :canToggle="false" :canRelease="false" />
</div> </div>
@@ -135,6 +141,7 @@
<script> <script>
import { listMaterialCoil } from '@/api/wms/coil'; import { listMaterialCoil } from '@/api/wms/coil';
import { listActualWarehouse } from "@/api/wms/actualWarehouse"; import { listActualWarehouse } from "@/api/wms/actualWarehouse";
import { treeActualWarehouseTwoLevel } from "@/api/wms/actualWarehouse";
import MemoInput from '@/components/MemoInput/index.vue'; import MemoInput from '@/components/MemoInput/index.vue';
import MutiSelect from '@/components/MutiSelect/index.vue'; import MutiSelect from '@/components/MutiSelect/index.vue';
import { defaultColumns } from './data'; import { defaultColumns } from './data';
@@ -216,6 +223,7 @@ export default {
}, },
data() { data() {
return { return {
showCoilMap: false,
loading: false, loading: false,
coilList: [], coilList: [],
total: 0, total: 0,
@@ -242,6 +250,9 @@ export default {
warehouseList: [], warehouseList: [],
selectedNodeId: null, selectedNodeId: null,
warehouseLoading: false, warehouseLoading: false,
warehouseTree: [],
treeProps: { label: "actualWarehouseName", children: "children" },
treeLoading: false,
}; };
}, },
computed: { computed: {
@@ -323,6 +334,9 @@ export default {
if (this.initialCoil) { if (this.initialCoil) {
this.selectedCoil = this.initialCoil; this.selectedCoil = this.initialCoil;
} }
if (this.orderBy) {
this.getWarehouseTree();
}
}, },
methods: { methods: {
// 获取库位列表 // 获取库位列表
@@ -336,6 +350,22 @@ export default {
this.warehouseLoading = false; this.warehouseLoading = false;
}); });
}, },
handleNodeClick(data) {
console.log('data', data);
if (data.actualWarehouseType != 2) {
return;
}
this.selectedNodeId = data.actualWarehouseId;
this.getWarehouseList(data.actualWarehouseId);
},
// 获取树形数据
getWarehouseTree() {
this.treeLoading = true;
treeActualWarehouseTwoLevel()
.then((res) => { this.warehouseTree = res.data || []; })
.catch((err) => { this.$message.error("获取仓库树形数据失败:" + err.message); })
.finally(() => { this.treeLoading = false; });
},
// 处理大小变化 // 处理大小变化
handleSizeChange(size) { handleSizeChange(size) {
console.log('size', size); console.log('size', size);
@@ -587,13 +617,6 @@ export default {
margin-top: 4px; margin-top: 4px;
} }
.search-form {
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 16px;
}
::v-deep .el-dialog__body { ::v-deep .el-dialog__body {
padding: 20px; padding: 20px;
max-height: calc(100vh - 200px); max-height: calc(100vh - 200px);

View File

@@ -48,6 +48,11 @@ export default {
minSize: { minSize: {
type: Object, type: Object,
default: () => ({ width: 100, height: 80 }) default: () => ({ width: 100, height: 80 })
},
// 用于localStorage存储的唯一标识
storageKey: {
type: String,
default: ''
} }
}, },
data() { data() {
@@ -67,9 +72,8 @@ export default {
}; };
}, },
mounted() { mounted() {
// 初始化位置和尺寸 // 初始化位置和尺寸优先从localStorage读取
this.position = { ...this.initPosition }; this.initFromStorage();
this.size = { ...this.initSize };
// 监听全局鼠标移动和松开事件 // 监听全局鼠标移动和松开事件
document.addEventListener('mousemove', this.handleMouseMove); document.addEventListener('mousemove', this.handleMouseMove);
document.addEventListener('mouseup', this.handleMouseUp); document.addEventListener('mouseup', this.handleMouseUp);
@@ -83,6 +87,68 @@ export default {
window.removeEventListener('resize', this.updateScreenSize); window.removeEventListener('resize', this.updateScreenSize);
}, },
methods: { methods: {
/**
* 从localStorage初始化位置和尺寸
* 有key时优先读取存储值无则使用props传入的初始值
*/
initFromStorage() {
if (this.storageKey) {
try {
const storageKey = `dnd-ps-${this.storageKey}`;
const storedData = localStorage.getItem(storageKey);
if (storedData) {
const { position, size } = JSON.parse(storedData);
// 验证存储的数据是否合法,防止异常值
const isValidPosition = position && typeof position.x === 'number' && typeof position.y === 'number';
const isValidSize = size && typeof size.width === 'number' && typeof size.height === 'number';
if (isValidPosition && isValidSize) {
// 使用存储的位置和尺寸(确保不小于最小尺寸)
this.position = {
x: Math.max(0, position.x),
y: Math.max(0, position.y)
};
this.size = {
width: Math.max(this.minSize.width, size.width),
height: Math.max(this.minSize.height, size.height)
};
return;
}
}
} catch (error) {
console.warn('读取拖拽元素存储数据失败,使用默认值:', error);
}
}
// 无存储数据或存储异常时使用props初始值
this.position = { ...this.initPosition };
this.size = { ...this.initSize };
},
/**
* 将当前位置和尺寸保存到localStorage
*/
saveToStorage() {
if (this.storageKey) {
try {
const storageKey = `dnd-ps-${this.storageKey}`;
const saveData = {
position: { ...this.position },
size: { ...this.size },
updateTime: new Date().getTime()
};
console.log('saveData', saveData);
localStorage.setItem(storageKey, JSON.stringify(saveData));
// 触发存储成功事件
this.$emit('save-success', saveData);
} catch (error) {
console.error('保存拖拽元素数据失败:', error);
this.$emit('save-fail', error);
}
}
},
/** /**
* 更新屏幕尺寸(窗口大小变化时) * 更新屏幕尺寸(窗口大小变化时)
*/ */
@@ -174,6 +240,9 @@ export default {
// 恢复鼠标样式 // 恢复鼠标样式
document.body.style.cursor = 'default'; document.body.style.cursor = 'default';
// 保存当前状态到localStorage有key时
this.saveToStorage();
// 触发结束事件 // 触发结束事件
this.$emit('drag-end', { position: { ...this.position }, size: { ...this.size } }); this.$emit('drag-end', { position: { ...this.position }, size: { ...this.size } });
} }
@@ -203,6 +272,7 @@ export default {
overflow: hidden; overflow: hidden;
pointer-events: auto; /* 元素本身响应鼠标事件 */ pointer-events: auto; /* 元素本身响应鼠标事件 */
z-index: 9999; /* 确保元素在最上层 */ z-index: 9999; /* 确保元素在最上层 */
background-color: #ffffff; /* 添加背景色,提升可视性 */
} }
/* 元素内容区 */ /* 元素内容区 */

View File

@@ -26,6 +26,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterialQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterialQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetMaterialQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetMaterialQuery">重置</el-button>
<el-button type="success" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -259,7 +260,7 @@
<label-render :content="labelRender.data" :labelType="labelRender.type" /> <label-render :content="labelRender.data" :labelType="labelRender.type" />
</el-dialog> </el-dialog>
<el-dialog title="钢卷信息修正" :visible.sync="correctVisible" width="600px"> <el-dialog :title="title" :visible.sync="correctVisible" width="600px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="入场钢卷号" prop="enterCoilNo"> <el-form-item label="入场钢卷号" prop="enterCoilNo">
<el-input v-model="form.enterCoilNo" placeholder="请输入入场钢卷号" :disabled="form.coilId" /> <el-input v-model="form.enterCoilNo" placeholder="请输入入场钢卷号" :disabled="form.coilId" />
@@ -340,11 +341,11 @@
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" /> <el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="创建时间" prop="createTime" v-if="form.coilId">
<el-date-picker v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" <el-date-picker v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择创建时间" style="width: 100%;" /> placeholder="请选择创建时间" style="width: 100%;" />
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="createBy"> <el-form-item label="创建人" prop="createBy" v-if="form.coilId">
<el-select v-model="form.createBy" placeholder="请选择创建人" style="width: 100%;" clearable filterable> <el-select v-model="form.createBy" placeholder="请选择创建人" style="width: 100%;" clearable filterable>
<el-option v-for="item in userList" :key="item.userName" :label="item.nickName" :value="item.userName" /> <el-option v-for="item in userList" :key="item.userName" :label="item.nickName" :value="item.userName" />
</el-select> </el-select>
@@ -360,7 +361,7 @@
</template> </template>
<script> <script>
import { listMaterialCoil, updateMaterialCoilSimple, checkCoilNo, delMaterialCoil, restoreMaterialCoil } from '@/api/wms/coil' import { listMaterialCoil, updateMaterialCoilSimple, checkCoilNo, delMaterialCoil, restoreMaterialCoil, addMaterialCoil } from '@/api/wms/coil'
import { listUser } from '@/api/system/user' import { listUser } from '@/api/system/user'
import { listPendingAction, startProcess, cancelAction, delPendingAction } from '@/api/wms/pendingAction' import { listPendingAction, startProcess, cancelAction, delPendingAction } from '@/api/wms/pendingAction'
import { parseTime } from '@/utils/klp' import { parseTime } from '@/utils/klp'
@@ -397,6 +398,7 @@ export default {
}, },
data() { data() {
return { return {
title: '钢卷信息修正',
// 物料列表相关 // 物料列表相关
materialLoading: false, materialLoading: false,
materialCoilList: [], materialCoilList: [],
@@ -591,6 +593,42 @@ export default {
}, },
methods: { methods: {
parseTime, parseTime,
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.correctVisible = true;
this.title = "添加钢卷物料";
},
// 表单重置
reset() {
this.form = {
coilId: undefined,
enterCoilNo: undefined,
currentCoilNo: undefined,
supplierCoilNo: undefined,
dataType: 1,
warehouseId: undefined,
nextWarehouseId: undefined,
qrcodeRecordId: undefined,
actualWarehouseId: undefined,
team: undefined,
hasMergeSplit: undefined,
parentCoilNos: undefined,
itemId: undefined,
itemType: undefined,
status: undefined,
remark: undefined,
delFlag: undefined,
createTime: undefined,
createBy: undefined,
updateTime: undefined,
updateBy: undefined,
materialType: '原料',
temperGrade: undefined,
coatingType: undefined,
};
this.resetForm("form");
},
getBorderStyle(row) { getBorderStyle(row) {
// console.log(row); // console.log(row);
// 已发货 // 已发货
@@ -727,7 +765,8 @@ export default {
handleCorrectMaterial(row) { handleCorrectMaterial(row) {
this.form = { this.form = {
...row, ...row,
} };
this.title = "钢卷信息修正";
this.correctVisible = true this.correctVisible = true
}, },
cancel() { cancel() {
@@ -741,13 +780,25 @@ export default {
return return
} }
this.buttonLoading = true; this.buttonLoading = true;
updateMaterialCoilSimple(this.form).then(_ => { if (this.form.coilId) {
this.$modal.msgSuccess("修正成功"); // 更新
this.correctVisible = false; updateMaterialCoilSimple(this.form).then(_ => {
this.getMaterialCoil(); this.$modal.msgSuccess("修正成功");
}).finally(() => { this.correctVisible = false;
this.buttonLoading = false; this.getMaterialCoil();
}); }).finally(() => {
this.buttonLoading = false;
});
} else {
// 新增
addMaterialCoil(this.form).then(_ => {
this.$modal.msgSuccess("新增成功");
this.correctVisible = false;
this.getMaterialCoil();
}).finally(() => {
this.buttonLoading = false;
});
}
}) })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */

View File

@@ -50,10 +50,16 @@ export const actionStrategies = {
handler: async (coil, action) => { handler: async (coil, action) => {
// 更新操作记录状态 actionStatus: 2 // 更新操作记录状态 actionStatus: 2
// 并行执行更新操作记录和更新钢卷状态 // 并行执行更新操作记录和更新钢卷状态
// 将日期格式化为yyyy-MM-dd HH:mm:ss
const completeTime = new Date()
function parseDate(date) {
return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds()
}
await Promise.all([ await Promise.all([
updatePendingAction({ updatePendingAction({
...action, ...action,
actionStatus: 2, actionStatus: 2,
completeTime: parseDate(completeTime),
}), }),
updateMaterialCoilSimple({ updateMaterialCoilSimple({
...coil, ...coil,

View File

@@ -56,9 +56,9 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8" v-if="showControl"> <el-row :gutter="10" class="mb8" v-if="showControl">
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button> <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
@click="handleCheck">修正</el-button> @click="handleCheck">修正</el-button>
@@ -75,7 +75,8 @@
@click="handleBatchPrintLabel">批量打印标签</el-button> @click="handleBatchPrintLabel">批量打印标签</el-button>
</el-col> </el-col>
<el-col :span="1.5" v-if="showOrderBy"> <el-col :span="1.5" v-if="showOrderBy">
<el-checkbox v-model="queryParams.orderBy" v-loading="loading" @change="getList" label="orderBy">按实际库区排序</el-checkbox> <el-checkbox v-model="queryParams.orderBy" v-loading="loading" @change="getList"
label="orderBy">按实际库区排序</el-checkbox>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@@ -412,6 +413,7 @@ import {
returnCoil, returnCoil,
} from "@/api/wms/coil"; } from "@/api/wms/coil";
import { listBoundCoil } from "@/api/wms/deliveryWaybillDetail"; import { listBoundCoil } from "@/api/wms/deliveryWaybillDetail";
import { addPendingAction } from "@/api/wms/pendingAction";
import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import QRCode from "../../print/components/QRCode.vue"; import QRCode from "../../print/components/QRCode.vue";
import * as XLSX from 'xlsx' import * as XLSX from 'xlsx'
@@ -1046,6 +1048,20 @@ export default {
handleExportCoil(row) { handleExportCoil(row) {
exportCoil(row.coilId).then(response => { exportCoil(row.coilId).then(response => {
this.$modal.msgSuccess("发货成功"); this.$modal.msgSuccess("发货成功");
// 2. 插入一条已完成的待操作记录
addPendingAction({
coilId: row.coilId,
currentCoilNo: row.currentCoilNo,
actionType: 402, // 402=发货
actionStatus: 2, // 直接标记为完成状态
scanTime: new Date(),
// scanDevice: ,
priority: 0, // 0=普通
sourceType: 'scan',
warehouseId: row.warehouseId,
processTime: new Date(),
completeTime: new Date()
});
this.getList(); this.getList();
}).catch(error => { }).catch(error => {
this.$modal.msgError("发货失败"); this.$modal.msgError("发货失败");

View File

@@ -34,8 +34,8 @@
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.principal }}</div> <div class="editable-input transparent-input" contenteditable>{{ localWaybill.principal }}</div>
</div> </div>
<div class="header-right"> <div class="header-right">
<span class="label">电话</span> <span class="label">订单号</span>
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.principalPhone }}</div> <div class="editable-input transparent-input" contenteditable>{{ localWaybill.orderId ? localWaybill.orderCode : localWaybill.principalPhone }}</div>
</div> </div>
<div class="header-right"> <div class="header-right">
<span class="label">合同号</span> <span class="label">合同号</span>
@@ -239,6 +239,8 @@ export default {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
this.localWaybill = { this.localWaybill = {
orderId: newVal.orderId || '',
orderCode: newVal.orderCode || '',
consigneeUnit: newVal.consigneeUnit || '', consigneeUnit: newVal.consigneeUnit || '',
senderUnit: newVal.senderUnit || '', senderUnit: newVal.senderUnit || '',
deliveryYear: this.getYearFromDate(newVal.deliveryTime) || '', deliveryYear: this.getYearFromDate(newVal.deliveryTime) || '',
@@ -499,12 +501,12 @@ export default {
[ [
`负责人:${this.localWaybill.principal || ''}`, `负责人:${this.localWaybill.principal || ''}`,
undefined, undefined, undefined, undefined,
`电话${this.localWaybill.principalPhone || ''}`, `订单号${this.localWaybill.orderId ? this.localWaybill.orderCode : this.localWaybill.principalPhone || ''}`,
undefined, undefined, undefined, undefined,
`合同号:${this.localWaybill.contractCode || ''}`, `合同号:${this.localWaybill.contractCode || ''}`,
undefined, undefined, undefined, undefined,
`车牌:${this.localWaybill.licensePlate || ''}` `车牌:${this.localWaybill.licensePlate || ''}`
], // 负责人/电话/合同号/车牌行r=2 ], // 负责人/订单号/合同号/车牌行r=2
["品名", '切边', '包装', '仓库位置', '结算', '原料厂家', '卷号', '规格', '材质', '重量(t)', '单价', '备注'], // 表格表头r=3 ["品名", '切边', '包装', '仓库位置', '结算', '原料厂家', '卷号', '规格', '材质', '重量(t)', '单价', '备注'], // 表格表头r=3
]; ];
@@ -558,7 +560,7 @@ export default {
{ s: { c: 4, r: headerRow1Idx }, e: { c: 7, r: headerRow1Idx } }, // 日期E2-H2 { s: { c: 4, r: headerRow1Idx }, e: { c: 7, r: headerRow1Idx } }, // 日期E2-H2
{ s: { c: 8, r: headerRow1Idx }, e: { c: 11, r: headerRow1Idx } }, // 发货单位I2-L2 { s: { c: 8, r: headerRow1Idx }, e: { c: 11, r: headerRow1Idx } }, // 发货单位I2-L2
{ s: { c: 0, r: headerRow2Idx }, e: { c: 2, r: headerRow2Idx } }, // 负责人A3-C3 { s: { c: 0, r: headerRow2Idx }, e: { c: 2, r: headerRow2Idx } }, // 负责人A3-C3
{ s: { c: 3, r: headerRow2Idx }, e: { c: 5, r: headerRow2Idx } }, // 电话D3-F3 { s: { c: 3, r: headerRow2Idx }, e: { c: 5, r: headerRow2Idx } }, // 订单号D3-F3
{ s: { c: 6, r: headerRow2Idx }, e: { c: 8, r: headerRow2Idx } }, // 合同号G3-I3 { s: { c: 6, r: headerRow2Idx }, e: { c: 8, r: headerRow2Idx } }, // 合同号G3-I3
{ s: { c: 9, r: headerRow2Idx }, e: { c: 11, r: headerRow2Idx } }, // 车牌J3-L3 { s: { c: 9, r: headerRow2Idx }, e: { c: 11, r: headerRow2Idx } }, // 车牌J3-L3
{ s: { c: 0, r: remarkRowIdx }, e: { c: 11, r: remarkRowIdx } }, // 备注跨列合并A*_L* { s: { c: 0, r: remarkRowIdx }, e: { c: 11, r: remarkRowIdx } }, // 备注跨列合并A*_L*
@@ -747,9 +749,9 @@ export default {
date: `${this.localWaybill.deliveryYear || ''}${this.localWaybill.deliveryMonth || ''}${this.localWaybill.deliveryDay || ''}`, date: `${this.localWaybill.deliveryYear || ''}${this.localWaybill.deliveryMonth || ''}${this.localWaybill.deliveryDay || ''}`,
sender: `发货单位:${this.localWaybill.senderUnit || ''}` sender: `发货单位:${this.localWaybill.senderUnit || ''}`
}; };
const header2 = { // 负责人+电话+合同号+车牌 const header2 = { // 负责人+订单号+合同号+车牌
principal: `负责人:${this.localWaybill.principal || ''}`, principal: `负责人:${this.localWaybill.principal || ''}`,
phone: `电话${this.localWaybill.principalPhone || ''}`, phone: `订单号${this.localWaybill.orderId ? this.localWaybill.orderCode : this.localWaybill.principalPhone || ''}`,
contract: `合同号:${this.localWaybill.contractCode || ''}`, contract: `合同号:${this.localWaybill.contractCode || ''}`,
license: `车牌:${this.localWaybill.licensePlate || ''}` license: `车牌:${this.localWaybill.licensePlate || ''}`
}; };
@@ -797,7 +799,7 @@ export default {
worksheet.getCell(`G${rowIdx}`).value = header2.contract; worksheet.getCell(`G${rowIdx}`).value = header2.contract;
worksheet.getCell(`J${rowIdx}`).value = header2.license; worksheet.getCell(`J${rowIdx}`).value = header2.license;
worksheet.mergeCells(`A${rowIdx}:C${rowIdx}`); // 负责人A3-C3 worksheet.mergeCells(`A${rowIdx}:C${rowIdx}`); // 负责人A3-C3
worksheet.mergeCells(`D${rowIdx}:F${rowIdx}`); // 电话D3-F3 worksheet.mergeCells(`D${rowIdx}:F${rowIdx}`); // 订单号D3-F3
worksheet.mergeCells(`G${rowIdx}:I${rowIdx}`); // 合同号G3-I3 worksheet.mergeCells(`G${rowIdx}:I${rowIdx}`); // 合同号G3-I3
worksheet.mergeCells(`J${rowIdx}:L${rowIdx}`); // 车牌J3-L3 worksheet.mergeCells(`J${rowIdx}:L${rowIdx}`); // 车牌J3-L3
// 3.4 表格表头第4行 // 3.4 表格表头第4行

View File

@@ -34,8 +34,8 @@
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.principal }}</div> <div class="editable-input transparent-input" contenteditable>{{ localWaybill.principal }}</div>
</div> </div>
<div class="header-right"> <div class="header-right">
<span class="label">电话</span> <span class="label">订单号</span>
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.principalPhone }}</div> <div class="editable-input transparent-input" contenteditable>{{ localWaybill.orderId ? localWaybill.orderCode : localWaybill.principalPhone }}</div>
</div> </div>
<div class="header-right"> <div class="header-right">
<span class="label">合同号</span> <span class="label">合同号</span>
@@ -239,6 +239,8 @@ export default {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
this.localWaybill = { this.localWaybill = {
orderId: newVal.orderId || '',
orderCode: newVal.orderCode || '',
consigneeUnit: newVal.consigneeUnit || '', consigneeUnit: newVal.consigneeUnit || '',
senderUnit: newVal.senderUnit || '', senderUnit: newVal.senderUnit || '',
deliveryYear: this.getYearFromDate(newVal.deliveryTime) || '', deliveryYear: this.getYearFromDate(newVal.deliveryTime) || '',
@@ -499,12 +501,12 @@ export default {
[ [
`负责人:${this.localWaybill.principal || ''}`, `负责人:${this.localWaybill.principal || ''}`,
undefined, undefined, undefined, undefined,
`电话${this.localWaybill.principalPhone || ''}`, `订单号${this.localWaybill.orderId ? this.localWaybill.orderCode : this.localWaybill.principalPhone || ''}`,
undefined, undefined, undefined, undefined,
`合同号:${this.localWaybill.contractCode || ''}`, `合同号:${this.localWaybill.contractCode || ''}`,
undefined, undefined,
`车牌:${this.localWaybill.licensePlate || ''}` `车牌:${this.localWaybill.licensePlate || ''}`
], // 负责人/电话/合同号/车牌行r=2 ], // 负责人/订单号/合同号/车牌行r=2
["品名", '切边', '包装', '仓库位置', '结算', '原料厂家', '卷号', '规格', '材质', '重量(t)', '备注'], // 表格表头r=311列 ["品名", '切边', '包装', '仓库位置', '结算', '原料厂家', '卷号', '规格', '材质', '重量(t)', '备注'], // 表格表头r=311列
]; ];
@@ -557,7 +559,7 @@ export default {
{ s: { c: 4, r: headerRow1Idx }, e: { c: 6, r: headerRow1Idx } }, // 日期4-7 { s: { c: 4, r: headerRow1Idx }, e: { c: 6, r: headerRow1Idx } }, // 日期4-7
{ s: { c: 8, r: headerRow1Idx }, e: { c: 10, r: headerRow1Idx } }, // 发货单位8-10无多余 { s: { c: 8, r: headerRow1Idx }, e: { c: 10, r: headerRow1Idx } }, // 发货单位8-10无多余
{ s: { c: 0, r: headerRow2Idx }, e: { c: 2, r: headerRow2Idx } }, // 负责人0-2 { s: { c: 0, r: headerRow2Idx }, e: { c: 2, r: headerRow2Idx } }, // 负责人0-2
{ s: { c: 3, r: headerRow2Idx }, e: { c: 5, r: headerRow2Idx } }, // 电话3-5 { s: { c: 3, r: headerRow2Idx }, e: { c: 5, r: headerRow2Idx } }, // 订单号3-5
{ s: { c: 6, r: headerRow2Idx }, e: { c: 7, r: headerRow2Idx } }, // 合同号6-8 { s: { c: 6, r: headerRow2Idx }, e: { c: 7, r: headerRow2Idx } }, // 合同号6-8
{ s: { c: 9, r: headerRow2Idx }, e: { c: 10, r: headerRow2Idx } }, // 车牌9-10无多余 { s: { c: 9, r: headerRow2Idx }, e: { c: 10, r: headerRow2Idx } }, // 车牌9-10无多余
{ s: { c: 0, r: remarkRowIdx }, e: { c: 10, r: remarkRowIdx } }, // 备注合并0-10列 { s: { c: 0, r: remarkRowIdx }, e: { c: 10, r: remarkRowIdx } }, // 备注合并0-10列
@@ -738,9 +740,9 @@ export default {
date: `${this.localWaybill.deliveryYear || ''}${this.localWaybill.deliveryMonth || ''}${this.localWaybill.deliveryDay || ''}`, date: `${this.localWaybill.deliveryYear || ''}${this.localWaybill.deliveryMonth || ''}${this.localWaybill.deliveryDay || ''}`,
sender: `发货单位:${this.localWaybill.senderUnit || ''}` sender: `发货单位:${this.localWaybill.senderUnit || ''}`
}; };
const header2 = { // 负责人+电话+合同号+车牌 const header2 = { // 负责人+订单号+合同号+车牌
principal: `负责人:${this.localWaybill.principal || ''}`, principal: `负责人:${this.localWaybill.principal || ''}`,
phone: `电话${this.localWaybill.principalPhone || ''}`, phone: `订单号${this.localWaybill.orderId ? this.localWaybill.orderCode : this.localWaybill.principalPhone || ''}`,
contract: `合同号:${this.localWaybill.contractCode || ''}`, contract: `合同号:${this.localWaybill.contractCode || ''}`,
license: `车牌:${this.localWaybill.licensePlate || ''}` license: `车牌:${this.localWaybill.licensePlate || ''}`
}; };
@@ -788,7 +790,7 @@ export default {
worksheet.getCell(`G${rowIdx}`).value = header2.contract; worksheet.getCell(`G${rowIdx}`).value = header2.contract;
worksheet.getCell(`J${rowIdx}`).value = header2.license; worksheet.getCell(`J${rowIdx}`).value = header2.license;
worksheet.mergeCells(`A${rowIdx}:C${rowIdx}`); // 负责人A3-C3 worksheet.mergeCells(`A${rowIdx}:C${rowIdx}`); // 负责人A3-C3
worksheet.mergeCells(`D${rowIdx}:F${rowIdx}`); // 电话D3-F3 worksheet.mergeCells(`D${rowIdx}:F${rowIdx}`); // 订单号D3-F3
worksheet.mergeCells(`G${rowIdx}:I${rowIdx}`); // 合同号G3-I3 worksheet.mergeCells(`G${rowIdx}:I${rowIdx}`); // 合同号G3-I3
worksheet.mergeCells(`J${rowIdx}:K${rowIdx}`); // 车牌J3-L3 worksheet.mergeCells(`J${rowIdx}:K${rowIdx}`); // 车牌J3-L3
// 3.4 表格表头第4行 // 3.4 表格表头第4行

View File

@@ -89,7 +89,7 @@ export default {
methods: { methods: {
// 处理分列数据调整 // 处理分列数据调整
resize() { resize() {
this.$refs.warehouseInterlaced.handleResize(); this.$refs.warehouseInterlaced?.handleResize();
}, },
handleSplitWarehouse(warehouse) { handleSplitWarehouse(warehouse) {
this.$emit('split-warehouse', warehouse); this.$emit('split-warehouse', warehouse);