Merge remote-tracking branch 'gitee/0.8.X' into 0.8.X
This commit is contained in:
@@ -49,4 +49,10 @@ export const defaultColumns = [
|
||||
width: '120',
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
align: 'center',
|
||||
prop: 'remark',
|
||||
showOverflowTooltip: true
|
||||
}
|
||||
]
|
||||
157
klp-ui/src/views/crm/bind/index.vue
Normal file
157
klp-ui/src/views/crm/bind/index.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="发货单名称" prop="waybillName">
|
||||
<el-input v-model="queryParams.waybillName" placeholder="请输入发货单名称" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收货单位" prop="consigneeUnit">
|
||||
<el-input v-model="queryParams.consigneeUnit" placeholder="请输入收货单位" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" :disabled="!selectedPlan"
|
||||
title="请先选择发货计划">新增</el-button> -->
|
||||
<el-button type="success" plain icon="el-icon-refresh" size="mini" @click="handleQuery">刷新</el-button>
|
||||
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" border :data="deliveryWaybillList" highlight-current-row>
|
||||
<el-table-column label="发货单唯一ID" align="center" prop="waybillId" v-if="false" />
|
||||
<el-table-column label="发货单名称" align="center" prop="waybillName" />
|
||||
<el-table-column label="车牌" align="center" prop="licensePlate" width="100" />
|
||||
<el-table-column label="发货单位" align="center" prop="senderUnit" />
|
||||
<el-table-column label="发货时间" align="center" prop="deliveryTime" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="负责人" align="center" prop="principal" />
|
||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" width="100" />
|
||||
<el-table-column label="完成状态" align="center" prop="status" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" type="success" v-if="scope.row.status === 1">已发货</el-tag>
|
||||
<el-tag size="mini" type="info" v-else>未发货</el-tag>
|
||||
<!-- <el-select v-model="scope.row.status" placeholder="请选择完成状态" @change="handleStatusChange(scope.row)">
|
||||
<el-option label="已发货" :value="1" />
|
||||
<el-option label="未发货" :value="0" />
|
||||
</el-select> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单合同号" align="center" prop="contractCode" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-paperclip" @click.stop="handleBind(scope.row)">绑定订单</el-button>
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-edit" :disabled="scope.row.status === 1" title="已发货的发货单不能修改"
|
||||
@click.stop="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" :disabled="scope.row.status === 1"
|
||||
title="已发货的发货单不能删除" @click.stop="handleDelete(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<el-dialog title="选择订单" :visible.sync="dialogVisible" width="80%">
|
||||
<order-table ref="orderTable" @row-click="submitBind" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDeliveryWaybill, updateDeliveryWaybill } from "@/api/wms/deliveryWaybill";
|
||||
import OrderTable from "../components/OrderTable.vue";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
deliveryWaybillList: [],
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
waybillName: '',
|
||||
consigneeUnit: ''
|
||||
},
|
||||
dialogVisible: false,
|
||||
currentWaybill: {},
|
||||
currentWaybillDetails: [],
|
||||
loading: false,
|
||||
showSearch: true,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
OrderTable,
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 完成状态改变时的处理 */
|
||||
handleStatusChange(row) {
|
||||
// 确保在更新状态时包含waybillId
|
||||
updateDeliveryWaybillStatus({
|
||||
waybillId: row.waybillId,
|
||||
status: row.status
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("状态更新成功");
|
||||
this.getList(); // 刷新列表
|
||||
});
|
||||
},
|
||||
/** 查询发货单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 确保查询参数包含planId
|
||||
const params = {
|
||||
...this.queryParams,
|
||||
// 如果选中了计划,传递planId,否则不传递该参数
|
||||
planId: this.selectedPlan ? this.selectedPlan.planId : undefined
|
||||
};
|
||||
listDeliveryWaybill(params).then(response => {
|
||||
this.deliveryWaybillList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleBind(row) {
|
||||
this.dialogVisible = true;
|
||||
this.currentWaybill = row;
|
||||
},
|
||||
submitBind(order) {
|
||||
this.loading = true;
|
||||
this.dialogVisible = false;
|
||||
updateDeliveryWaybill({
|
||||
...this.currentWaybill,
|
||||
orderId: order.orderId,
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.$modal.msgSuccess("绑定成功");
|
||||
this.getList();
|
||||
}).catch(() => {
|
||||
this.$modal.msgError("绑定失败");
|
||||
this.dialogVisible = true;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/deliveryWaybill/export', {
|
||||
...this.queryParams
|
||||
}, `deliveryWaybill_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -2,22 +2,35 @@
|
||||
<div>
|
||||
<el-empty v-if="!orderId || orderId == ''" description="未选中订单" />
|
||||
|
||||
<!-- <el-empty v-else-if="!orderItemList.length" description="暂无订单明细" /> -->
|
||||
|
||||
<div v-else>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-if="editable">新增</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-if="editable">新增</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-printer" size="mini" @click="handlePrint">打印</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-refresh" size="mini" @click="getList">刷新</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderItemList">
|
||||
<el-table-column label="产品类型" align="center" prop="productType" />
|
||||
<el-table-column label="规格要求" align="center" prop="specRequire" />
|
||||
<el-table-column label="产品数量" align="center" prop="productNum" />
|
||||
<el-table-column label="特殊要求" align="center" prop="specialRequire" />
|
||||
<el-table-column label="明细金额" align="center" prop="itemAmount" />
|
||||
<el-table-column label="原料规格" align="center" prop="rawMaterialSpec" />
|
||||
<el-table-column label="成品规格" align="center" prop="finishedProductSpec" />
|
||||
<el-table-column label="材质" align="center" prop="material" />
|
||||
<el-table-column label="等级" align="center" prop="grade" />
|
||||
<el-table-column label="重量" align="center" prop="weight" />
|
||||
<el-table-column label="合同定价" align="center" prop="contractPrice" />
|
||||
<el-table-column label="金额(元)" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.weight * scope.row.contractPrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="定制人" align="center" prop="customizer" />
|
||||
<el-table-column label="发货人" align="center" prop="shipper" />
|
||||
<el-table-column label="排产批次" align="center" prop="productionBatch" />
|
||||
<!-- <el-table-column label="产品数量" align="center" prop="productNum" /> -->
|
||||
<!-- <el-table-column label="特殊要求" align="center" prop="specialRequire" /> -->
|
||||
<!-- <el-table-column label="明细金额" align="center" prop="itemAmount" /> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="editable">
|
||||
<template slot-scope="scope">
|
||||
@@ -37,19 +50,40 @@
|
||||
<el-form-item label="产品类型" prop="productType">
|
||||
<el-input v-model="form.productType" placeholder="请输入产品类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品数量" prop="productNum">
|
||||
<!-- <el-form-item label="产品数量" prop="productNum">
|
||||
<el-input v-model="form.productNum" placeholder="请输入产品数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="明细金额" prop="itemAmount">
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="明细金额" prop="itemAmount">
|
||||
<el-input size="mini" v-model="form.itemAmount" placeholder="请输入明细金额" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="原料规格" prop="rawMaterialSpec">
|
||||
<el-input v-model="form.rawMaterialSpec" placeholder="请输入原料规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格要求" prop="specRequire">
|
||||
<el-input v-model="form.specRequire" placeholder="请输入规格要求" />
|
||||
<el-form-item label="成品规格" prop="finishedProductSpec">
|
||||
<el-input v-model="form.finishedProductSpec" placeholder="请输入成品规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="特殊要求" prop="specialRequire">
|
||||
<el-input v-model="form.specialRequire" type="textarea" placeholder="请输入内容" />
|
||||
<el-form-item label="材质" prop="material">
|
||||
<el-input v-model="form.material" placeholder="请输入材质" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="等级" prop="grade">
|
||||
<el-input v-model="form.grade" placeholder="请输入等级" />
|
||||
</el-form-item>
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-input v-model="form.weight" placeholder="请输入重量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同定价" prop="contractPrice">
|
||||
<el-input v-model="form.contractPrice" placeholder="请输入合同定价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="定制人" prop="customizer">
|
||||
<el-input v-model="form.customizer" placeholder="请输入定制人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发货人" prop="shipper">
|
||||
<el-input v-model="form.shipper" placeholder="请输入发货人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排产批次" prop="productionBatch">
|
||||
<el-input v-model="form.productionBatch" placeholder="请输入排产批次" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
@@ -59,12 +93,22 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="打印结算单" :loading="orderLoading" :visible.sync="orderOpen" width="1000px" append-to-body>
|
||||
<OrderPrinter ref="printer" :orderContent="orderContent" :orderList="orderItemList" />
|
||||
|
||||
<el-button slot="footer">
|
||||
<el-button :loading="buttonLoading" @click="printOrder">打印</el-button>
|
||||
</el-button>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrderItem, getOrderItem, delOrderItem, addOrderItem, updateOrderItem } from "@/api/crm/orderItem";
|
||||
import { actions, ORDER_ACTIONS } from "../js/actions";
|
||||
import { getOrder } from "@/api/crm/order";
|
||||
import OrderPrinter from "./OrderPrinter.vue";
|
||||
|
||||
export default {
|
||||
name: "OrderItem",
|
||||
@@ -77,6 +121,9 @@ export default {
|
||||
default: true
|
||||
},
|
||||
},
|
||||
components: {
|
||||
OrderPrinter
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
@@ -120,26 +167,51 @@ export default {
|
||||
productNum: [
|
||||
{ required: true, message: "请输入产品数量", trigger: "blur" }
|
||||
],
|
||||
itemAmount: [
|
||||
{ required: true, message: "请输入明细金额", trigger: "blur" },
|
||||
// 必须是数字,最多两位小数,使用自定义的校验规则
|
||||
{ validator: (rule, value, callback) => {
|
||||
if (!/^\d+(\.\d{1,2})?$/.test(value)) {
|
||||
callback(new Error("请输入最多两位小数的数字"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: "input" }
|
||||
rawMaterialSpec: [
|
||||
{ required: true, message: "请输入原料规格", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
finishedProductSpec: [
|
||||
{ required: true, message: "请输入成品规格", trigger: "blur" }
|
||||
],
|
||||
// 重量和合同定价不能为空,且必须是数字,最多两位小数
|
||||
weight: [
|
||||
{ required: true, message: "请输入重量", trigger: "blur" },
|
||||
// 必须是数字,最多两位小数,使用自定义的校验规则
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!/^\d+(\.\d{1,2,3})?$/.test(value)) {
|
||||
callback(new Error("请输入最多三位小数的数字"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: "change"
|
||||
}
|
||||
],
|
||||
contractPrice: [
|
||||
{ required: true, message: "请输入合同定价", trigger: "blur" },
|
||||
// 必须是数字,最多两位小数,使用自定义的校验规则
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!/^\d+(\.\d{1,2,3})?$/.test(value)) {
|
||||
callback(new Error("请输入最多三位小数的数字"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: "change"
|
||||
}
|
||||
],
|
||||
},
|
||||
orderContent: {},
|
||||
orderLoading: false,
|
||||
orderOpen: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
orderId: {
|
||||
handler(newVal, oldVal) {
|
||||
// if (newVal !== oldVal) {
|
||||
this.queryParams.orderId = newVal;
|
||||
this.getList();
|
||||
this.queryParams.orderId = newVal;
|
||||
this.getList();
|
||||
// }
|
||||
},
|
||||
immediate: true
|
||||
@@ -147,7 +219,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
/** 查询正式订单明细列表 */
|
||||
getList() {
|
||||
getList() {
|
||||
if (!this.queryParams.orderId) {
|
||||
this.orderItemList = [];
|
||||
this.total = 0;
|
||||
@@ -171,7 +243,15 @@ export default {
|
||||
itemId: undefined,
|
||||
orderId: this.orderId,
|
||||
productType: undefined,
|
||||
specRequire: undefined,
|
||||
rawMaterialSpec: undefined,
|
||||
finishedProductSpec: undefined,
|
||||
material: undefined,
|
||||
grade: undefined,
|
||||
weight: undefined,
|
||||
contractPrice: undefined,
|
||||
customizer: undefined,
|
||||
shipper: undefined,
|
||||
productionBatch: undefined,
|
||||
productNum: undefined,
|
||||
specialRequire: undefined,
|
||||
itemAmount: undefined,
|
||||
@@ -189,6 +269,20 @@ export default {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 打印按钮操作 */
|
||||
handlePrint() {
|
||||
// 正在准备打印内容
|
||||
this.orderLoading = true;
|
||||
this.orderOpen = true;
|
||||
getOrder(this.orderId).then(response => {
|
||||
this.orderContent = response.data;
|
||||
this.orderLoading = false;
|
||||
});
|
||||
},
|
||||
printOrder() {
|
||||
this.$refs["printer"].print();
|
||||
this.orderOpen = false;
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
|
||||
@@ -48,6 +48,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同号" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同号"></el-input>
|
||||
</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" />
|
||||
|
||||
365
klp-ui/src/views/crm/components/OrderPrinter.vue
Normal file
365
klp-ui/src/views/crm/components/OrderPrinter.vue
Normal file
@@ -0,0 +1,365 @@
|
||||
<template>
|
||||
<div ref="printContainer" class="printContainer">
|
||||
<div class="waybill-content">
|
||||
<!-- 单据标题 -->
|
||||
<div class="title">销售合同 - 业务结算单</div>
|
||||
|
||||
<!-- 订单主信息头部 -->
|
||||
<div class="waybill-header">
|
||||
<div class="header-left">
|
||||
<div class="header-item"><span class="label-sm">订单编号:</span>{{ orderContent.orderCode || '' }}</div>
|
||||
<div class="header-item"><span class="label-sm">业务员:</span>{{ orderContent.salesman || '' }}</div>
|
||||
<div class="header-item"><span class="label-sm">制单人:</span>{{ orderContent.createBy || '' }}</div>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<!-- <div class="header-item"><span class="label-sm">客户公司:</span>{{ orderContent.companyName || '' }}</div> -->
|
||||
<!-- <div class="header-item"><span class="label-sm">联系人:</span>{{ orderContent.contactName || '' }}</div> -->
|
||||
<div class="header-item"><span class="label-sm">交货日期:</span>{{ orderContent.deliveryDate ? orderContent.deliveryDate.split(' ')[0] : '' }}</div>
|
||||
<div class="header-item"><span class="label-sm">订单金额:</span>¥{{ orderContent.orderAmount || '0.00' }}</div>
|
||||
<div class="header-item"><span class="label-sm">制单时间:</span>{{ orderContent.createTime || '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 订单明细表格 -->
|
||||
<table class="waybill-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>产品类型</th>
|
||||
<th>原料规格</th>
|
||||
<th>成品规格</th>
|
||||
<th>材质</th>
|
||||
<th>等级</th>
|
||||
<th>重量(吨)</th>
|
||||
<th>合同单价(元)</th>
|
||||
<th>金额(元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, index) in orderList" :key="item.itemId || index">
|
||||
<td>{{ item.productType || '' }}</td>
|
||||
<td>{{ item.rawMaterialSpec || '' }}</td>
|
||||
<td>{{ item.finishedProductSpec || '' }}</td>
|
||||
<td>{{ item.material || '' }}</td>
|
||||
<td>{{ item.level || '' || '' }}</td>
|
||||
<td>{{ item.weight || '0.000' }}</td>
|
||||
<td>¥{{ item.contractPrice || '0.00' }}</td>
|
||||
<td>¥{{ item.amount || '0.00' }}</td>
|
||||
</tr>
|
||||
<!-- 无明细数据占位 -->
|
||||
<tr v-if="orderList.length === 0">
|
||||
<td colspan="6" class="no-data">暂无订单明细</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 合计区域 -->
|
||||
<div class="total-area">
|
||||
<div class="total-item">
|
||||
<span class="total-label">明细总重量:</span>
|
||||
<span>{{ calcTotalWeight() }} kg</span>
|
||||
</div>
|
||||
<div class="total-item">
|
||||
<span class="total-label">明细总金额:</span>
|
||||
<span>¥{{ calcTotalAmount() }}</span>
|
||||
</div>
|
||||
<div class="total-item">
|
||||
<span class="total-label">订单未付金额:</span>
|
||||
<span>¥{{ orderContent.unpaidAmount || '0.00' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部备注/状态信息 -->
|
||||
<div class="footer-info">
|
||||
<div class="info-item"><span class="label-sm">更新人:</span>{{ orderContent.updateBy || '' }}</div>
|
||||
<div class="info-item"><span class="label-sm">更新时间:</span>{{ orderContent.updateTime || '' }}</div>
|
||||
<div class="info-item"><span class="label-sm">订单状态:</span>{{ getOrderStatusText(orderContent.orderStatus) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
|
||||
export default {
|
||||
name: "OrderPrinter",
|
||||
props: {
|
||||
// 订单主数据
|
||||
orderContent: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
// 订单明细列表
|
||||
orderList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 计算明细总重量(保留3位小数)
|
||||
calcTotalWeight() {
|
||||
if (!this.orderList.length) return '0.000';
|
||||
const total = this.orderList.reduce((sum, item) => {
|
||||
const weight = Number(item.weight) || 0;
|
||||
return sum + weight;
|
||||
}, 0);
|
||||
return total.toFixed(3);
|
||||
},
|
||||
// 计算明细总金额(重量×单价,保留2位小数)
|
||||
calcTotalAmount() {
|
||||
if (!this.orderList.length) return '0.00';
|
||||
const total = this.orderList.reduce((sum, item) => {
|
||||
const weight = Number(item.weight) || 0;
|
||||
const price = Number(item.contractPrice) || 0;
|
||||
return sum + (weight * price);
|
||||
}, 0);
|
||||
return total.toFixed(2);
|
||||
},
|
||||
// 订单状态转文本(0-未处理/1-已审核/2-已发货/3-已完成,可根据业务扩展)
|
||||
getOrderStatusText(status) {
|
||||
const statusMap = {
|
||||
0: '未处理',
|
||||
1: '已审核',
|
||||
2: '已发货',
|
||||
3: '已完成'
|
||||
};
|
||||
return statusMap[status] || '未知状态';
|
||||
},
|
||||
// 打印订单(生成PDF后打印/下载)
|
||||
async print() {
|
||||
const node = this.$refs.printContainer;
|
||||
// 241mm热敏纸规格(宽×高)
|
||||
const paperWidthMm = 241;
|
||||
const paperHeightMm = 140;
|
||||
// 打印机安全边距(避免内容被裁剪)
|
||||
const safeRightMarginMm = 45;
|
||||
const safeLeftPaddingMm = 6;
|
||||
const safeTopShiftMm = 15;
|
||||
const safeContentWidthMm = paperWidthMm - safeRightMarginMm - safeLeftPaddingMm;
|
||||
|
||||
// 单位转换:mm → px/pt(96DPI/72DPI)
|
||||
const mmToPx = (mm) => (mm * 96) / 25.4;
|
||||
const mmToPt = 72 / 25.4;
|
||||
const pageWidthPt = paperWidthMm * mmToPt;
|
||||
const pageHeightPt = paperHeightMm * mmToPt;
|
||||
const pageWidthPx = Math.round(mmToPx(paperWidthMm));
|
||||
const pageHeightPx = Math.round(mmToPx(paperHeightMm));
|
||||
|
||||
// 创建PDF文档
|
||||
const pdfDoc = await PDFDocument.create();
|
||||
// 保存原样式,避免修改影响页面展示
|
||||
const originalStyle = { width: node.style.width, overflow: node.style.overflow };
|
||||
const contentEl = node.querySelector('.waybill-content');
|
||||
const originalContentCssText = contentEl ? contentEl.style.cssText : '';
|
||||
|
||||
// 强制容器完整展示内容,方便html2canvas截图
|
||||
node.style.width = 'auto';
|
||||
node.style.overflow = 'visible';
|
||||
// 设置内容缩放和边距,适配打印机不可打印区
|
||||
if (contentEl) {
|
||||
contentEl.style.setProperty('--content-width-mm', String(safeContentWidthMm));
|
||||
contentEl.style.setProperty('--offset-x-mm', String(safeLeftPaddingMm));
|
||||
contentEl.style.setProperty('--offset-y-mm', String(safeTopShiftMm));
|
||||
}
|
||||
|
||||
try {
|
||||
await this.$nextTick(); // 等待DOM更新
|
||||
// 生成截图(3倍缩放保证打印清晰度)
|
||||
const canvas = await html2canvas(node, {
|
||||
backgroundColor: '#ffffff',
|
||||
scale: 3,
|
||||
useCORS: true,
|
||||
willReadFrequently: true,
|
||||
width: pageWidthPx,
|
||||
height: pageHeightPx,
|
||||
windowWidth: pageWidthPx,
|
||||
windowHeight: pageHeightPx,
|
||||
scrollX: 0,
|
||||
scrollY: 0
|
||||
});
|
||||
// 将截图嵌入PDF
|
||||
const png = canvas.toDataURL('image/png');
|
||||
const imgPng = await pdfDoc.embedPng(png);
|
||||
const pdfPage = pdfDoc.addPage([pageWidthPt, pageHeightPt]);
|
||||
pdfPage.drawImage(imgPng, {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: pageWidthPt,
|
||||
height: pageHeightPt
|
||||
});
|
||||
} finally {
|
||||
// 恢复原样式
|
||||
node.style.width = originalStyle.width;
|
||||
node.style.overflow = originalStyle.overflow;
|
||||
if (contentEl) contentEl.style.cssText = originalContentCssText;
|
||||
}
|
||||
|
||||
// 生成PDF并处理打印/下载
|
||||
const pdfBytes = await pdfDoc.save();
|
||||
const blob = new Blob([pdfBytes], { type: 'application/pdf' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
// 优先新窗口打开打印
|
||||
const win = window.open(url, '_blank');
|
||||
if (!win) {
|
||||
// 新窗口被拦截则触发下载
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `订单打印单_${this.orderContent.orderCode || this.orderContent.orderId || new Date().getTime()}.pdf`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
}
|
||||
// 释放URL对象
|
||||
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 主容器:适配241mm热敏纸 */
|
||||
.printContainer {
|
||||
width: 241mm;
|
||||
height: 140mm;
|
||||
margin: 0 auto;
|
||||
background: #fff;
|
||||
font-family: SimSun, "宋体", monospace;
|
||||
color: #000;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 单据标题 */
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 3mm;
|
||||
padding-bottom: 1mm;
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
|
||||
/* 内容容器:适配打印机边距,自动缩放 */
|
||||
.waybill-content {
|
||||
--paper-width-mm: 241;
|
||||
--content-width-mm: 241;
|
||||
--offset-x-mm: 0;
|
||||
--offset-y-mm: 0;
|
||||
--scale: calc(var(--content-width-mm) / var(--paper-width-mm));
|
||||
width: calc(var(--paper-width-mm) * 1mm);
|
||||
transform-origin: top left;
|
||||
transform: translate(calc(var(--offset-x-mm) * 1mm), calc(var(--offset-y-mm) * 1mm)) scale(var(--scale));
|
||||
}
|
||||
|
||||
/* 订单头部信息 */
|
||||
.waybill-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 12px;
|
||||
margin-bottom: 3mm;
|
||||
line-height: 4mm;
|
||||
}
|
||||
.header-left, .header-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.header-item {
|
||||
display: flex;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.label-sm {
|
||||
font-weight: bold;
|
||||
margin-right: 2mm;
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
/* 明细表格:边框合并,固定布局 */
|
||||
.waybill-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 3mm;
|
||||
font-size: 11px;
|
||||
table-layout: fixed;
|
||||
}
|
||||
.waybill-table th, .waybill-table td {
|
||||
border: 0.5px solid #000;
|
||||
padding: 0.5mm;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
line-height: 3.5mm;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.waybill-table th {
|
||||
background-color: #f5f5f5;
|
||||
font-weight: bold;
|
||||
}
|
||||
.no-data {
|
||||
height: 20mm;
|
||||
line-height: 20mm;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 合计区域 */
|
||||
.total-area {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 5mm;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 3mm;
|
||||
padding-right: 2mm;
|
||||
line-height: 4mm;
|
||||
}
|
||||
.total-label {
|
||||
margin-right: 1mm;
|
||||
}
|
||||
|
||||
/* 底部信息 */
|
||||
.footer-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 12px;
|
||||
line-height: 4mm;
|
||||
padding-top: 1mm;
|
||||
border-top: 1px dashed #ccc;
|
||||
}
|
||||
.info-item {
|
||||
display: flex;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 打印样式适配:打印机不可打印区处理 */
|
||||
@page {
|
||||
size: 241mm 140mm;
|
||||
margin: 0;
|
||||
}
|
||||
@media print {
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #fff;
|
||||
}
|
||||
.printContainer {
|
||||
width: 241mm;
|
||||
height: 140mm;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
.waybill-content {
|
||||
--content-width-mm: 196; /* 右侧预留45mm不可打印区 */
|
||||
--offset-x-mm: 6; /* 左侧内边距6mm */
|
||||
--offset-y-mm: 15; /* 顶部偏移15mm */
|
||||
}
|
||||
/* 打印时允许表格内容换行,避免裁剪 */
|
||||
.waybill-table th, .waybill-table td {
|
||||
white-space: normal !important;
|
||||
overflow: visible !important;
|
||||
text-overflow: clip !important;
|
||||
height: auto !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
64
klp-ui/src/views/crm/components/OrderTable.vue
Normal file
64
klp-ui/src/views/crm/components/OrderTable.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="orderList" height="400px" highlight-current-row @row-click="handleRowClick">
|
||||
<el-table-column label="订单编号" align="center" prop="orderCode" />
|
||||
<el-table-column label="客户" align="center" prop="companyName" />
|
||||
<el-table-column label="总金额" align="center" prop="orderAmount" />
|
||||
<el-table-column label="销售员" align="center" prop="salesman" />
|
||||
<el-table-column label="合同号" align="center" prop="contractCode" />
|
||||
|
||||
<el-table-column label="交货日期" align="center" prop="deliveryDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.deliveryDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="orderType">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.orderType === 0" class="text-primary">未审核</span>
|
||||
<span v-else-if="scope.row.orderType === 1">已审核</span>
|
||||
<span v-else>未知状态</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrder } from "@/api/crm/order";
|
||||
|
||||
export default {
|
||||
name: 'OrderTable',
|
||||
data() {
|
||||
return {
|
||||
orderList: [],
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderNo: '',
|
||||
customerName: '',
|
||||
},
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listOrder(this.queryParams).then(res => {
|
||||
this.orderList = res.rows
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleRowClick(row) {
|
||||
this.$emit('row-click', row)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -70,14 +70,14 @@
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="应收ID" align="center" prop="receivableId" v-if="false"/>
|
||||
<!-- <el-table-column label="客户" align="center" prop="customerName" /> -->
|
||||
<el-table-column label="到期日" align="center" prop="dueDate" width="180">
|
||||
<el-table-column label="收款日期" align="center" prop="dueDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.dueDate, '{y}-{m}-{d}') }}</span>
|
||||
<el-tag v-if="new Date(scope.row.dueDate) < new Date()" type="danger">过期</el-tag>
|
||||
<el-tag v-else-if="new Date(scope.row.dueDate) > new Date()" type="success">还剩{{ parseInt((new Date(scope.row.dueDate) - new Date()) / (1000 * 60 * 60 * 24)) }}天</el-tag>
|
||||
<!-- <el-tag v-if="new Date(scope.row.dueDate) < new Date()" type="danger">过期</el-tag>
|
||||
<el-tag v-else-if="new Date(scope.row.dueDate) > new Date()" type="success">还剩{{ parseInt((new Date(scope.row.dueDate) - new Date()) / (1000 * 60 * 60 * 24)) }}天</el-tag> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="应收金额" align="center" prop="amount" />
|
||||
<el-table-column label="收款金额" align="center" prop="amount" />
|
||||
<!-- <el-table-column label="已收金额" align="center" prop="paidAmount" /> -->
|
||||
<!-- <el-table-column label="未收金额" align="center" prop="balanceAmount" /> -->
|
||||
<!-- <el-table-column label="状态" align="center" prop="status" /> -->
|
||||
@@ -122,7 +122,7 @@
|
||||
v-model="form.dueDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择到期日">
|
||||
placeholder="请选择收款日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="收款金额" prop="amount">
|
||||
@@ -247,7 +247,8 @@ export default {
|
||||
// 收款表单参数
|
||||
receiveForm: {},
|
||||
// 是否显示收款弹出层
|
||||
receiveOpen: false
|
||||
receiveOpen: false,
|
||||
isFirst: true,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -258,6 +259,10 @@ export default {
|
||||
this.receivableList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
if (this.isFirst) {
|
||||
this.isFirst = false;
|
||||
return;
|
||||
}
|
||||
updateOrder({
|
||||
orderId: this.orderId,
|
||||
unpaidAmount: this.unreceivedAmount,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!-- 客户列表区域 -->
|
||||
<el-col :span="5" style="border-right: 1px solid #e4e7ed;">
|
||||
<el-col :span="6" style="border-right: 1px solid #e4e7ed;">
|
||||
<div style="font-weight: 900;">客户列表</div>
|
||||
<!-- 搜索区域 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px; margin-top: 10px;">
|
||||
@@ -55,7 +55,9 @@
|
||||
listKey="customerId"
|
||||
:loading="customerLoading"
|
||||
field1="customerCode"
|
||||
field4="companyName"
|
||||
field2="companyName"
|
||||
field4="contactPerson"
|
||||
field5="contactWay"
|
||||
@item-click="handleItemClick"
|
||||
>
|
||||
<template slot="actions" slot-scope="{ item }">
|
||||
@@ -66,7 +68,7 @@
|
||||
</el-col>
|
||||
|
||||
<!-- 右侧内容区域 -->
|
||||
<el-col :span="19">
|
||||
<el-col :span="18">
|
||||
<el-tabs v-model="activeTab" type="border-card" v-if="currentCustomer && currentCustomer.customerId">
|
||||
<!-- 客户详情标签页 -->
|
||||
<el-tab-pane label="客户详情" name="detail">
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
<el-input style="flex: 1;" prefix-icon="el-icon-search" placeholder="输入订单编号搜索"
|
||||
v-model="queryParams.orderCode"></el-input>
|
||||
<el-button icon="el-icon-search" @click="toggleQuery"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" style="margin-left: 0;" @click="handleAdd" v-hasPermi="['crm:order:add']"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" style="margin-left: 0;" @click="handleAdd"
|
||||
v-hasPermi="['crm:order:add']"></el-button>
|
||||
</div>
|
||||
<div v-show="showQuery"
|
||||
style="display: flex; align-items: center; gap: 5px; margin-top: 10px; flex-wrap: wrap;">
|
||||
@@ -29,10 +30,11 @@
|
||||
</div>
|
||||
<div>
|
||||
<!-- 列表区域 -->
|
||||
<KLPList :listData="orderList" listKey="orderId" :loading="orderLoading" field1="orderCode" field4="salesman"
|
||||
@item-click="handleOrderClick">
|
||||
<KLPList :listData="orderList" listKey="orderId" :loading="orderLoading" field1="orderCode" field2="salesman"
|
||||
field4="companyName" field5="contactPerson" @item-click="handleOrderClick">
|
||||
<template slot="actions" slot-scope="{ item }">
|
||||
<el-button type="danger" size="mini" @click="handleDelete(item)" icon="el-icon-delete" v-hasPermi="['crm:order:add']"></el-button>
|
||||
<el-button type="danger" size="mini" @click="handleDelete(item)" icon="el-icon-delete"
|
||||
v-hasPermi="['crm:order:add']"></el-button>
|
||||
</template>
|
||||
</KLPList>
|
||||
</div>
|
||||
@@ -46,8 +48,12 @@
|
||||
<!-- 订单详情内容 -->
|
||||
<el-descriptions :column="2" :border="true" title="订单基本信息" style="margin-bottom: 20px;">
|
||||
<el-descriptions-item label="订单编号">{{ form.orderCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="客户">{{ form.customerId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="销售员">{{ form.salesman }}</el-descriptions-item>
|
||||
<el-descriptions-item label="交货日期">{{ form.deliveryDate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合同号">{{ form.contractCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="客户公司">{{ form.companyName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人">{{ form.contactPerson }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ form.contactWay }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ form.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
@@ -107,6 +113,9 @@
|
||||
<el-form-item label="销售员" prop="salesman">
|
||||
<el-input v-model="form.salesman" placeholder="请输入销售员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同号" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同号" />
|
||||
</el-form-item>
|
||||
<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="请选择交货日期">
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<el-table v-loading="loading" :data="orderList" height="400px" highlight-current-row @row-click="handleRowClick">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="订单编号" align="center" prop="orderCode" />
|
||||
<el-table-column label="客户" align="center" prop="customerId" />
|
||||
<el-table-column label="客户" align="center" prop="companyName" />
|
||||
<el-table-column label="总金额" align="center" prop="orderAmount" />
|
||||
<el-table-column label="销售员" align="center" prop="salesman" />
|
||||
<el-table-column label="交货日期" align="center" prop="deliveryDate" width="180">
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<div class="table-title">检验历史列表</div>
|
||||
<KLPTable ref="historyTable" height="300px" highlight-current-row v-loading="loading" :data="checkTaskList" @row-click="handleRowClick" row-class-name="tableRowClassName">
|
||||
<el-table-column label="任务名称" align="center" prop="taskName" />
|
||||
<el-table-column label="钢卷号" align="center" prop="currentCoilNo" />
|
||||
<el-table-column label="工段" align="center" prop="workshopSection" />
|
||||
<el-table-column label="工序" align="center" prop="process" />
|
||||
<el-table-column label="机组" align="center" prop="unitGroup" />
|
||||
@@ -144,7 +145,13 @@ export default {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listHistoryCheckTask(this.queryParams).then(response => {
|
||||
this.checkTaskList = response.rows
|
||||
this.checkTaskList = response.rows.map(item => ({
|
||||
...item,
|
||||
verifyTarget: JSON.parse(item.verifyTarget),
|
||||
entryCoilNo: item.coilList?.[0]?.entryCoilNo || '',
|
||||
currentCoilNo: item.coilList?.[0]?.currentCoilNo || '',
|
||||
weight: item.coilList?.[0]?.netWeight || 0,
|
||||
}))
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
@@ -39,16 +39,16 @@
|
||||
<KLPTable ref="checkTaskTable" height="300px" highlight-current-row v-loading="loading" :data="checkTaskList"
|
||||
@row-click="handleRowClick">
|
||||
<el-table-column label="任务名称" align="center" prop="taskName" />
|
||||
<el-table-column label="钢卷号" align="center" prop="verifyTarget.coilId" />
|
||||
<el-table-column label="钢卷号" align="center" prop="currentCoilNo" />
|
||||
<el-table-column label="工段" align="center" prop="workshopSection" />
|
||||
<el-table-column label="工序" align="center" prop="process" />
|
||||
<el-table-column label="机组" align="center" prop="unitGroup" />
|
||||
<el-table-column label="钢卷号" align="center" prop="verifyTarget.coilId" />
|
||||
<el-table-column label="原料卷号" align="center" prop="verifyTarget.rawCoilId" />
|
||||
<!-- <el-table-column label="钢卷号" align="center" prop="verifyTarget.coilId" /> -->
|
||||
<el-table-column label="原料卷号" align="center" prop="entryCoilNo" />
|
||||
<el-table-column label="厂家" align="center" prop="verifyTarget.vendor" />
|
||||
<el-table-column label="宽度" align="center" prop="verifyTarget.width" />
|
||||
<el-table-column label="厚度" align="center" prop="verifyTarget.thickness" />
|
||||
<el-table-column label="重量" align="center" prop="verifyTarget.weight" />
|
||||
<el-table-column label="重量" align="center" prop="weight" />
|
||||
<el-table-column label="检验结果" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
@@ -136,13 +136,11 @@
|
||||
<el-form-item label="检查项" prop="itemId" v-if="!form.taskId">
|
||||
<CheckItemSelect v-model="form.itemId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="钢卷号">
|
||||
<el-input v-model="form.verifyTarget.coilId" placeholder="请输入钢卷号" />
|
||||
<coil-selector v-model="form.coilIds" @select="handleCoilChange" :filters="{ selectType: 'raw_material', itemType: 'raw_material' }"></coil-selector>
|
||||
<!-- <el-input v-model="form.verifyTarget.coilId" placeholder="请输入钢卷号" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="原料卷号">
|
||||
<!-- <el-form-item label="原料卷号">
|
||||
<el-input v-model="form.verifyTarget.rawCoilId" placeholder="请输入原料卷号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家">
|
||||
@@ -156,7 +154,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="重量">
|
||||
<el-input v-model="form.verifyTarget.weight" placeholder="请输入重量" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="工段" prop="workshopSection">
|
||||
<el-input v-model="form.workshopSection" placeholder="请输入工段" />
|
||||
</el-form-item>
|
||||
@@ -166,13 +164,16 @@
|
||||
<el-form-item label="机组" prop="unitGroup">
|
||||
<el-input v-model="form.unitGroup" placeholder="请输入机组" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验结果" prop="inspectionResult">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="检验结果" prop="inspectionResult">
|
||||
<el-select v-model="form.inspectionResult" placeholder="请选择检验结果">
|
||||
<el-option label="未检验" :value="0" />
|
||||
<el-option label="合格" :value="1" />
|
||||
<el-option label="不合格" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -187,6 +188,7 @@
|
||||
import { listCheckTask, getCheckTask, delCheckTask, addCheckTask, updateCheckTask } from '@/api/mes/qc/checkTask'
|
||||
import { updateCheckTaskItemStatus, updateCheckTaskItem } from '@/api/mes/qc/checkTaskItem'
|
||||
import CheckItemSelect from '@/components/KLPService/CheckItemSelect/index'
|
||||
import CoilSelector from '@/components/CoilSelector/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'CheckTask',
|
||||
@@ -245,7 +247,8 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
components: {
|
||||
CheckItemSelect
|
||||
CheckItemSelect,
|
||||
CoilSelector
|
||||
},
|
||||
methods: {
|
||||
/** 查询检查任务列表 */
|
||||
@@ -254,12 +257,27 @@ export default {
|
||||
listCheckTask(this.queryParams).then(response => {
|
||||
this.checkTaskList = response.rows.map(item => ({
|
||||
...item,
|
||||
verifyTarget: JSON.parse(item.verifyTarget)
|
||||
verifyTarget: JSON.parse(item.verifyTarget),
|
||||
entryCoilNo: item.coilList?.[0]?.entryCoilNo || '',
|
||||
currentCoilNo: item.coilList?.[0]?.currentCoilNo || '',
|
||||
weight: item.coilList?.[0]?.netWeight || 0,
|
||||
}));
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleCoilChange(coil) {
|
||||
const [thickness, width] = coil.specification.split('*')
|
||||
console.log(thickness, width, coil.netWeight)
|
||||
this.form.verifyTarget = {
|
||||
coilId: coil.coilId,
|
||||
rawCoilId: coil.rawCoilId,
|
||||
factory: coil.manufacturer,
|
||||
thickness: thickness,
|
||||
width: width,
|
||||
weight: coil.netWeight,
|
||||
}
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@@ -383,6 +401,7 @@ export default {
|
||||
// 对象转json
|
||||
const payload = {
|
||||
...this.form,
|
||||
itemId: this.form.itemId.split(','),
|
||||
verifyTarget: JSON.stringify(this.form.verifyTarget)
|
||||
}
|
||||
if (this.form.taskId != null) {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<KLPTable ref="checkTaskTable" height="300px" highlight-current-row v-loading="loading" :data="checkTaskList"
|
||||
@row-click="handleRowClick">
|
||||
<el-table-column label="任务名称" align="center" prop="taskName" />
|
||||
<el-table-column label="钢卷号" align="center" prop="verifyTarget.coilId" />
|
||||
<el-table-column label="钢卷号" align="center" prop="coilList[0].currentCoilNo" />
|
||||
<el-table-column label="工段" align="center" prop="workshopSection" />
|
||||
<el-table-column label="工序" align="center" prop="process" />
|
||||
<el-table-column label="机组" align="center" prop="unitGroup" />
|
||||
@@ -127,15 +127,13 @@
|
||||
<el-form-item label="任务名称" prop="taskName">
|
||||
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="钢卷号">
|
||||
<!-- <el-input v-model="form.verifyTarget.coilId" placeholder="请输入钢卷号" /> -->
|
||||
<coil-selector v-model="form.coilIds" @select="handleCoilChange"></coil-selector>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查项" prop="itemId" v-if="!form.taskId">
|
||||
<CheckItemSelect v-model="form.itemId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="钢卷号">
|
||||
<el-input v-model="form.verifyTarget.coilId" placeholder="请输入钢卷号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工段" prop="workshopSection">
|
||||
<el-input v-model="form.workshopSection" placeholder="请输入工段" />
|
||||
</el-form-item>
|
||||
@@ -145,13 +143,16 @@
|
||||
<el-form-item label="机组" prop="unitGroup">
|
||||
<el-input v-model="form.unitGroup" placeholder="请输入机组" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验结果" prop="inspectionResult">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="检验结果" prop="inspectionResult">
|
||||
<el-select v-model="form.inspectionResult" placeholder="请选择检验结果">
|
||||
<el-option label="未检验" :value="0" />
|
||||
<el-option label="合格" :value="1" />
|
||||
<el-option label="不合格" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -166,6 +167,8 @@
|
||||
import { listCheckTask, getCheckTask, delCheckTask, addCheckTask, updateCheckTask } from '@/api/mes/qc/checkTask'
|
||||
import { updateCheckTaskItemStatus, updateCheckTaskItem } from '@/api/mes/qc/checkTaskItem'
|
||||
import CheckItemSelect from '@/components/KLPService/CheckItemSelect/index'
|
||||
import CoilSelector from '@/components/CoilSelector/index.vue'
|
||||
|
||||
|
||||
export default {
|
||||
name: 'CheckTask',
|
||||
@@ -219,7 +222,8 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
components: {
|
||||
CheckItemSelect
|
||||
CheckItemSelect,
|
||||
CoilSelector
|
||||
},
|
||||
methods: {
|
||||
/** 查询检查任务列表 */
|
||||
@@ -234,13 +238,16 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleCoilChange(coil) {
|
||||
this.form.verifyTarget.coilId = coil.coilId
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
handleBlur(row) {
|
||||
updateCheckTaskItem({...row, itemId: row.checkTaskItemId}).then(response => {
|
||||
handleBlur(row) {
|
||||
updateCheckTaskItem({ ...row, itemId: row.checkTaskItemId }).then(response => {
|
||||
this.$message({
|
||||
message: '更新成功',
|
||||
type: 'success'
|
||||
@@ -352,6 +359,7 @@ export default {
|
||||
// 对象转json
|
||||
const payload = {
|
||||
...this.form,
|
||||
itemId: this.form.itemId.split(','),
|
||||
verifyTarget: JSON.stringify(this.form.verifyTarget)
|
||||
}
|
||||
if (this.form.taskId != null) {
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
<!-- <el-tag type="info" size="small">{{ scope.row.currentCoilNo }}</el-tag> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="厂家卷号" align="center" prop="supplierCoilNo" />
|
||||
|
||||
<el-table-column label="新增时间" align="center" prop="createTime" width="150" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
|
||||
@@ -119,11 +119,11 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" v-if="!showExportTime" align="center" prop="updateByName" />
|
||||
<el-table-column label="二维码" v-if="qrcode">
|
||||
<!-- <el-table-column label="二维码">
|
||||
<template slot-scope="scope">
|
||||
<QRCode :content="scope.row.qrcodeRecordId" :size="50" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="关联信息" align="center" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.parentCoilNos && scope.row.hasMergeSplit === 1 && scope.row.dataType === 1">
|
||||
@@ -146,6 +146,7 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<el-table-column label="数量" align="center" prop="quantity" />
|
||||
<el-table-column label="重量" align="center" prop="weight" />
|
||||
<!-- <el-table-column label="单价" align="center" prop="unitPrice" /> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
@@ -106,7 +106,7 @@
|
||||
<el-form-item label="单价" prop="unitPrice">
|
||||
<el-input v-model="form.unitPrice" placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-form-item label="备注" prop="remark" >
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -4,37 +4,43 @@
|
||||
<div class="waybill-container" ref="waybillRef">
|
||||
<div class="waybill-content">
|
||||
<!-- 头部信息 -->
|
||||
<!-- 标题信息 -->
|
||||
<div class="title">科伦普发货单</div>
|
||||
<div class="waybill-header">
|
||||
<div class="header-left">
|
||||
<span class="label">收货单位:</span>
|
||||
<input type="text" class="editable-input transparent-input" v-model="localWaybill.consigneeUnit" />
|
||||
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.consigneeUnit }}</div>
|
||||
</div>
|
||||
<div class="header-center">
|
||||
<input type="text" class="editable-input date-input transparent-input" v-model="localWaybill.deliveryYear" />
|
||||
<div class="editable-input date-input transparent-input" contenteditable>{{ localWaybill.deliveryYear }}</div>
|
||||
<span class="label date-label">年</span>
|
||||
<input type="text" class="editable-input date-input transparent-input" v-model="localWaybill.deliveryMonth" />
|
||||
<div class="editable-input date-input transparent-input" contenteditable>{{ localWaybill.deliveryMonth }}</div>
|
||||
<span class="label date-label">月</span>
|
||||
<input type="text" class="editable-input date-input transparent-input" v-model="localWaybill.deliveryDay" />
|
||||
<div class="editable-input date-input transparent-input" contenteditable>{{ localWaybill.deliveryDay }}</div>
|
||||
<span class="label date-label">日</span>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<span class="label">发货单位:</span>
|
||||
<input type="text" class="editable-input transparent-input" v-model="localWaybill.senderUnit" />
|
||||
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.senderUnit }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="waybill-header">
|
||||
<div class="header-left">
|
||||
<span class="label">负责人:</span>
|
||||
<input type="text" class="editable-input transparent-input" v-model="localWaybill.principal" />
|
||||
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.principal }}</div>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<span class="label">电话:</span>
|
||||
<input type="text" class="editable-input transparent-input" v-model="localWaybill.principalPhone" />
|
||||
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.principalPhone }}</div>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<span class="label">合同号:</span>
|
||||
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.contractCode }}</div>
|
||||
</div>
|
||||
<div class="header-center">
|
||||
<span class="label">车牌:</span>
|
||||
<input type="text" class="editable-input transparent-input" v-model="localWaybill.licensePlate" />
|
||||
<div class="editable-input transparent-input" contenteditable>{{ localWaybill.licensePlate }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -51,10 +57,10 @@
|
||||
<th>卷号</th>
|
||||
<th>规格</th>
|
||||
<th>材质</th>
|
||||
<th>数量(件)</th>
|
||||
<th>重量(T)</th>
|
||||
<!-- <th>数量(件)</th> -->
|
||||
<th>重量(t)</th>
|
||||
<th>单价</th>
|
||||
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -68,27 +74,38 @@
|
||||
</tr>
|
||||
<!-- 明细数据 -->
|
||||
<tr v-for="(item, index) in displayWaybillDetails" :key="index">
|
||||
<td><input type="text" class="transparent-input" v-model="item.productName" /></td>
|
||||
<td><input type="text" class="table-input transparent-input" v-model="item.edgeType" />
|
||||
</td>
|
||||
<td><input type="text" class="table-input transparent-input" v-model="item.packageType" />
|
||||
</td>
|
||||
<td><input type="text" class="table-input transparent-input" v-model="item.actualWarehouseName" />
|
||||
</td>
|
||||
<td><input type="text" class="table-input transparent-input" v-model="item.settlementType" />
|
||||
</td>
|
||||
<td><input type="text" class="table-input transparent-input" v-model="item.rawMaterialFactory" />
|
||||
</td>
|
||||
<td><input type="text" class="table-input transparent-input" v-model="item.coilNumber" /></td>
|
||||
<td><input type="text" class="table-input transparent-input" v-model="item.specification" /></td>
|
||||
<td><input type="text" class="table-input transparent-input" v-model="item.material" />
|
||||
</td>
|
||||
<td><input type="number" class="table-input transparent-input" v-model.number="item.quantity"
|
||||
placeholder="0" /></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.productName }}</div></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.edgeType }}</div></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.packageType }}</div></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.actualWarehouseName }}</div></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.settlementType }}</div></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.rawMaterialFactory }}</div></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.coilNumber }}</div></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.specification }}</div></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.material }}</div></td>
|
||||
<!-- <td><input type="number" class="table-input transparent-input" v-model.number="item.quantity"
|
||||
placeholder="0" /></td> -->
|
||||
<td><input type="number" class="table-input transparent-input" v-model.number="item.weight"
|
||||
placeholder="0.00" /></td>
|
||||
<td><input type="text" class="table-input transparent-input" v-model="item.unitPrice" /></td>
|
||||
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.unitPrice }}</div></td>
|
||||
<td><div class="table-input transparent-input" contenteditable>{{ item.remark }}</div></td>
|
||||
</tr>
|
||||
<!-- 加粗最后一行的线 -->
|
||||
<tr style="height: 0;">
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
<!-- <td><input type="number" class="table-input transparent-input" v-model.number="item.quantity"
|
||||
placeholder="0" /></td> -->
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
<td style="height: 0;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -104,7 +121,7 @@
|
||||
|
||||
<div class="waybill-pickup-location">
|
||||
<!-- <div class="pickup-location-item inline"> -->
|
||||
<span class="label">取货地点:</span>
|
||||
<span style="font-size: 18px; font-weight: bold;">取货地点:</span>
|
||||
<input type="text" class="editable-input full-input transparent-input" v-model="localWaybill.pickupLocation" />
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
@@ -113,15 +130,19 @@
|
||||
<div class="waybill-footer">
|
||||
<div class="footer-item inline">
|
||||
<span class="label">销售:</span>
|
||||
<input type="text" class="editable-input signature-input transparent-input" />
|
||||
<div class="editable-input signature-input transparent-input" contenteditable>{{ localWaybill.salesman }}</div>
|
||||
</div>
|
||||
<div class="footer-item inline">
|
||||
<span class="label">发货:</span>
|
||||
<input type="text" class="editable-input signature-input transparent-input" />
|
||||
<div class="editable-input signature-input transparent-input" contenteditable>{{ localWaybill.deliveryman }}</div>
|
||||
</div>
|
||||
<div class="footer-item inline">
|
||||
<span class="label">司机:</span>
|
||||
<div class="editable-input signature-input transparent-input" contenteditable>{{ localWaybill.driver }}</div>
|
||||
</div>
|
||||
<div class="footer-item inline">
|
||||
<span class="label">磅房:</span>
|
||||
<input type="text" class="editable-input signature-input transparent-input" />
|
||||
<div class="editable-input signature-input transparent-input" contenteditable>{{ localWaybill.weightRoom }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -159,7 +180,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
currentPage: 1,
|
||||
perPage: 10,
|
||||
perPage: 7,
|
||||
totalPages: 1,
|
||||
// 本地可编辑的发货单数据
|
||||
localWaybill: {
|
||||
@@ -193,7 +214,8 @@ export default {
|
||||
principal: newVal.principal || '',
|
||||
principalPhone: newVal.principalPhone || '',
|
||||
licensePlate: newVal.licensePlate || '',
|
||||
pickupLocation: newVal.pickupLocation || ''
|
||||
pickupLocation: newVal.pickupLocation || '',
|
||||
contractCode: newVal.contractCode || ''
|
||||
};
|
||||
}
|
||||
},
|
||||
@@ -423,9 +445,18 @@ export default {
|
||||
box-shadow: none;
|
||||
font-family: SimSun, "Courier New", monospace;
|
||||
overflow: hidden;
|
||||
color: #000 !important;
|
||||
font-weight: 900 !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.waybill-content {
|
||||
--paper-width-mm: 241;
|
||||
--content-width-mm: 241;
|
||||
@@ -466,7 +497,8 @@ export default {
|
||||
.label {
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
width: 100px;
|
||||
font-size: 18px;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -480,10 +512,12 @@ export default {
|
||||
padding: 4px 8px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
font-family: SimSun, serif;
|
||||
outline: none;
|
||||
transition: all 0.2s;
|
||||
line-height: 18px;
|
||||
border-bottom: 1px dashed #dcdfe6;
|
||||
}
|
||||
|
||||
@@ -492,7 +526,7 @@ export default {
|
||||
}
|
||||
|
||||
.date-input {
|
||||
width: 30px;
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
margin-right: 5px;
|
||||
}
|
||||
@@ -525,6 +559,8 @@ export default {
|
||||
line-height: 6mm;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-size: 16px;
|
||||
font-weight: 900;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
@@ -533,7 +569,7 @@ export default {
|
||||
/* 表格列宽设置 */
|
||||
.waybill-table th:nth-child(1),
|
||||
.waybill-table td:nth-child(1) {
|
||||
width: 80px;
|
||||
width: 70px;
|
||||
/* 品名 */
|
||||
}
|
||||
|
||||
@@ -545,62 +581,70 @@ export default {
|
||||
|
||||
.waybill-table th:nth-child(3),
|
||||
.waybill-table td:nth-child(3) {
|
||||
width: 40px;
|
||||
width: 50px;
|
||||
/* 包装 */
|
||||
}
|
||||
|
||||
.waybill-table th:nth-child(4),
|
||||
.waybill-table td:nth-child(4) {
|
||||
width: 80px;
|
||||
width: 90px;
|
||||
/* 仓库位置 */
|
||||
}
|
||||
|
||||
.waybill-table th:nth-child(5),
|
||||
.waybill-table td:nth-child(5) {
|
||||
width: 40px;
|
||||
width: 60px;
|
||||
/* 结算 */
|
||||
}
|
||||
|
||||
.waybill-table th:nth-child(6),
|
||||
.waybill-table td:nth-child(6) {
|
||||
width: 80px;
|
||||
width: 70px;
|
||||
/* 原料厂家 */
|
||||
}
|
||||
|
||||
.waybill-table th:nth-child(7),
|
||||
.waybill-table td:nth-child(7) {
|
||||
width: 100px;
|
||||
width: 110px;
|
||||
/* 卷号 */
|
||||
}
|
||||
|
||||
.waybill-table th:nth-child(8),
|
||||
.waybill-table td:nth-child(8) {
|
||||
width: 80px;
|
||||
width: 90px;
|
||||
/* 规格 */
|
||||
}
|
||||
|
||||
.waybill-table th:nth-child(9),
|
||||
.waybill-table td:nth-child(9) {
|
||||
width: 40px;
|
||||
width: 80px;
|
||||
/* 材质 */
|
||||
}
|
||||
|
||||
.waybill-table th:nth-child(10),
|
||||
/* 数量(件) */
|
||||
/* .waybill-table th:nth-child(10),
|
||||
.waybill-table td:nth-child(10) {
|
||||
width: 60px;
|
||||
/* 数量(件) */
|
||||
|
||||
} */
|
||||
|
||||
/* 重量(kg) */
|
||||
.waybill-table th:nth-child(10),
|
||||
.waybill-table td:nth-child(10) {
|
||||
width: 70px;
|
||||
|
||||
}
|
||||
|
||||
/* 单价 */
|
||||
.waybill-table th:nth-child(11),
|
||||
.waybill-table td:nth-child(11) {
|
||||
width: 80px;
|
||||
/* 重量(kg) */
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
/* 备注 */
|
||||
.waybill-table th:nth-child(12),
|
||||
.waybill-table td:nth-child(12) {
|
||||
width: 40px;
|
||||
/* 单价 */
|
||||
/* width: 40px; */
|
||||
}
|
||||
|
||||
|
||||
@@ -623,10 +667,10 @@ export default {
|
||||
border: none;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
/* font-family: inherit; */
|
||||
font-size: 16px;
|
||||
line-height: 6mm;
|
||||
text-align: inherit;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
@@ -645,7 +689,7 @@ export default {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
line-height: 6mm !important;
|
||||
height: 6mm !important;
|
||||
height: 6mm;
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
|
||||
@@ -695,8 +739,10 @@ export default {
|
||||
/* 备注样式 */
|
||||
.waybill-remarks {
|
||||
margin-bottom: 30px;
|
||||
font-size: 14px;
|
||||
font-size: 18px;
|
||||
line-height: 1.5;
|
||||
/* font-weight: 600; */
|
||||
font-weight: bold;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
@@ -710,20 +756,23 @@ export default {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
font-size: 16px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.waybill-pickup-location {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
font-size: 16px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.waybill-pickup-location label {
|
||||
font-size: 14px;
|
||||
margin-right: 10px;
|
||||
font-size: 18px;
|
||||
/* margin-right: 10px; */
|
||||
text-align: left !important;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
@@ -742,7 +791,7 @@ export default {
|
||||
}
|
||||
|
||||
.footer-item .label {
|
||||
font-size: 14px;
|
||||
font-size: 18px;
|
||||
margin-right: 10px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
229
klp-ui/src/views/wms/report/zha_.vue
Normal file
229
klp-ui/src/views/wms/report/zha_.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="app-container" v-loading="loading">
|
||||
<el-row>
|
||||
<el-form label-width="80px" inline>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeStart" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeEnd" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="入场钢卷号" prop="endTime">
|
||||
<el-input style="width: 200px; display: inline-block;" v-model="queryParams.enterCoilNo"
|
||||
placeholder="请输入入场钢卷号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前钢卷号" prop="endTime">
|
||||
<el-input style="width: 200px;" v-model="queryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="逻辑库位" prop="endTime">
|
||||
<warehouse-select v-model="queryParams.warehouseId" placeholder="请选择仓库/库区/库位"
|
||||
style="width: 100%; display: inline-block; width: 200px;" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="endTime">
|
||||
<el-input style="width: 200px;" v-model="queryParams.itemName" placeholder="请输入产品名称" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="endTime">
|
||||
<memo-input style="width: 200px;" v-model="queryParams.itemSpecification" storageKey="coilSpec"
|
||||
placeholder="请选择规格" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="材质" prop="endTime">
|
||||
<muti-select style="width: 200px;" v-model="queryParams.itemMaterial" :options="dict.type.coil_material"
|
||||
placeholder="请选择材质" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家" prop="endTime">
|
||||
<muti-select style="width: 200px;" v-model="queryParams.itemManufacturer"
|
||||
:options="dict.type.coil_manufacturer" placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="收货计划" prop="planId">
|
||||
<el-select style="width: 200px;" v-model="queryParams.planId" placeholder="请输入计划名称搜索收货计划" filterable remote
|
||||
:remote-method="remoteMethod">
|
||||
<el-option v-for="item in planList" :key="item.planId" :label="item.planName" :value="item.planId" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item prop="endTime">
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
<el-descriptions title="统计信息" :column="3" border>
|
||||
<el-descriptions-item label="总钢卷数量">{{ summary.totalCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总重">{{ summary.totalWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="均重">{{ summary.avgWeight }}t</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="250">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="出库状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCoilWithIds } from "@/api/wms/coil";
|
||||
import {
|
||||
listPendingAction,
|
||||
} from '@/api/wms/pendingAction';
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ProductInfo,
|
||||
RawMaterialInfo,
|
||||
CoilNo,
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect,
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
// 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05)
|
||||
const addZero = (num) => num.toString().padStart(2, '0')
|
||||
|
||||
const now = new Date() // 当前本地北京时间
|
||||
// 核心:获取【昨天】的日期对象(自动处理跨月/跨年,无边界问题)
|
||||
const yesterday = new Date(now)
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
|
||||
// 昨天的年、月、日(补零格式化)
|
||||
const yesYear = yesterday.getFullYear()
|
||||
const yesMonth = addZero(yesterday.getMonth() + 1)
|
||||
const yesDay = addZero(yesterday.getDate())
|
||||
|
||||
// 今天的年、月、日(补零格式化)
|
||||
const nowYear = now.getFullYear()
|
||||
const nowMonth = addZero(now.getMonth() + 1)
|
||||
const nowDay = addZero(now.getDate())
|
||||
|
||||
// ✅ 目标时间区间:昨天早上6点 至 今天早上6点
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00`
|
||||
return {
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
// status: 1,
|
||||
byCreateTimeStart: startTime,
|
||||
byCreateTimeEnd: endTime,
|
||||
selectType: 'raw_material',
|
||||
enterCoilNo: '',
|
||||
currentCoilNo: '',
|
||||
warehouseId: '',
|
||||
productName: '',
|
||||
itemSpecification: '',
|
||||
itemMaterial: '',
|
||||
itemManufacturer: '',
|
||||
planId: '',
|
||||
},
|
||||
planList: [],
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
summary() {
|
||||
// 总钢卷数量、总重、均重
|
||||
const totalCount = this.list.length
|
||||
const totalWeight = this.list.reduce((acc, cur) => acc + parseFloat(cur.netWeight), 0)
|
||||
const avgWeight = totalCount > 0 ? (totalWeight / totalCount).toFixed(2) : 0
|
||||
return {
|
||||
totalCount,
|
||||
totalWeight: totalWeight.toFixed(2),
|
||||
avgWeight,
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
remoteMethod(query) {
|
||||
listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 5, planType: 1 }).then(res => {
|
||||
this.planList = res.rows
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
listPendingAction({
|
||||
// actionStatus: 2,
|
||||
warehouseId: this.queryParams.planId,
|
||||
// actionType: 401,
|
||||
actionType: 11, // 酸轧工序
|
||||
pageSize: 999,
|
||||
pageNum: 1,
|
||||
startTime: this.queryParams.byCreateTimeStart,
|
||||
endTime: this.queryParams.byCreateTimeEnd,
|
||||
}).then(res => {
|
||||
const actions = res.rows
|
||||
const coilIds = actions.map(item => item.coilId).join(',')
|
||||
console.log(coilIds)
|
||||
if (!coilIds) {
|
||||
this.$message({
|
||||
message: '暂无数据',
|
||||
type: 'warning',
|
||||
})
|
||||
this.list = []
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
listCoilWithIds({
|
||||
...this.queryParams,
|
||||
coilIds: coilIds,
|
||||
}).then(res => {
|
||||
this.list = res.rows
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
// 导出
|
||||
exportData() {
|
||||
this.download('wms/materialCoil/export', {
|
||||
coilIds: this.list.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.remoteMethod('')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
229
klp-ui/src/views/wms/report/zinc_.vue
Normal file
229
klp-ui/src/views/wms/report/zinc_.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="app-container" v-loading="loading">
|
||||
<el-row>
|
||||
<el-form label-width="80px" inline>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeStart" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeEnd" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="入场钢卷号" prop="endTime">
|
||||
<el-input style="width: 200px; display: inline-block;" v-model="queryParams.enterCoilNo"
|
||||
placeholder="请输入入场钢卷号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前钢卷号" prop="endTime">
|
||||
<el-input style="width: 200px;" v-model="queryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="逻辑库位" prop="endTime">
|
||||
<warehouse-select v-model="queryParams.warehouseId" placeholder="请选择仓库/库区/库位"
|
||||
style="width: 100%; display: inline-block; width: 200px;" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="endTime">
|
||||
<el-input style="width: 200px;" v-model="queryParams.itemName" placeholder="请输入产品名称" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="endTime">
|
||||
<memo-input style="width: 200px;" v-model="queryParams.itemSpecification" storageKey="coilSpec"
|
||||
placeholder="请选择规格" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="材质" prop="endTime">
|
||||
<muti-select style="width: 200px;" v-model="queryParams.itemMaterial" :options="dict.type.coil_material"
|
||||
placeholder="请选择材质" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家" prop="endTime">
|
||||
<muti-select style="width: 200px;" v-model="queryParams.itemManufacturer"
|
||||
:options="dict.type.coil_manufacturer" placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="收货计划" prop="planId">
|
||||
<el-select style="width: 200px;" v-model="queryParams.planId" placeholder="请输入计划名称搜索收货计划" filterable remote
|
||||
:remote-method="remoteMethod">
|
||||
<el-option v-for="item in planList" :key="item.planId" :label="item.planName" :value="item.planId" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item prop="endTime">
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
<el-descriptions title="统计信息" :column="3" border>
|
||||
<el-descriptions-item label="总钢卷数量">{{ summary.totalCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总重">{{ summary.totalWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="均重">{{ summary.avgWeight }}t</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="250">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="出库状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCoilWithIds } from "@/api/wms/coil";
|
||||
import {
|
||||
listPendingAction,
|
||||
} from '@/api/wms/pendingAction';
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ProductInfo,
|
||||
RawMaterialInfo,
|
||||
CoilNo,
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect,
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
// 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05)
|
||||
const addZero = (num) => num.toString().padStart(2, '0')
|
||||
|
||||
const now = new Date() // 当前本地北京时间
|
||||
// 核心:获取【昨天】的日期对象(自动处理跨月/跨年,无边界问题)
|
||||
const yesterday = new Date(now)
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
|
||||
// 昨天的年、月、日(补零格式化)
|
||||
const yesYear = yesterday.getFullYear()
|
||||
const yesMonth = addZero(yesterday.getMonth() + 1)
|
||||
const yesDay = addZero(yesterday.getDate())
|
||||
|
||||
// 今天的年、月、日(补零格式化)
|
||||
const nowYear = now.getFullYear()
|
||||
const nowMonth = addZero(now.getMonth() + 1)
|
||||
const nowDay = addZero(now.getDate())
|
||||
|
||||
// ✅ 目标时间区间:昨天早上6点 至 今天早上6点
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00`
|
||||
return {
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
// status: 1,
|
||||
byCreateTimeStart: startTime,
|
||||
byCreateTimeEnd: endTime,
|
||||
selectType: 'raw_material',
|
||||
enterCoilNo: '',
|
||||
currentCoilNo: '',
|
||||
warehouseId: '',
|
||||
productName: '',
|
||||
itemSpecification: '',
|
||||
itemMaterial: '',
|
||||
itemManufacturer: '',
|
||||
planId: '',
|
||||
},
|
||||
planList: [],
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
summary() {
|
||||
// 总钢卷数量、总重、均重
|
||||
const totalCount = this.list.length
|
||||
const totalWeight = this.list.reduce((acc, cur) => acc + parseFloat(cur.netWeight), 0)
|
||||
const avgWeight = totalCount > 0 ? (totalWeight / totalCount).toFixed(2) : 0
|
||||
return {
|
||||
totalCount,
|
||||
totalWeight: totalWeight.toFixed(2),
|
||||
avgWeight,
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
remoteMethod(query) {
|
||||
listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 5, planType: 1 }).then(res => {
|
||||
this.planList = res.rows
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
listPendingAction({
|
||||
// actionStatus: 2,
|
||||
warehouseId: this.queryParams.planId,
|
||||
// actionType: 401,
|
||||
actionType: 501, // 镀锌工序
|
||||
pageSize: 999,
|
||||
pageNum: 1,
|
||||
startTime: this.queryParams.byCreateTimeStart,
|
||||
endTime: this.queryParams.byCreateTimeEnd,
|
||||
}).then(res => {
|
||||
const actions = res.rows
|
||||
const coilIds = actions.map(item => item.coilId).join(',')
|
||||
console.log(coilIds)
|
||||
if (!coilIds) {
|
||||
this.$message({
|
||||
message: '暂无数据',
|
||||
type: 'warning',
|
||||
})
|
||||
this.list = []
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
listCoilWithIds({
|
||||
...this.queryParams,
|
||||
coilIds: coilIds,
|
||||
}).then(res => {
|
||||
this.list = res.rows
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
// 导出
|
||||
exportData() {
|
||||
this.download('wms/materialCoil/export', {
|
||||
coilIds: this.list.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.remoteMethod('')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
Reference in New Issue
Block a user