Compare commits
4 Commits
da1813e65a
...
0.8.X
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ad3fd2fee | |||
| 79ee9d572d | |||
| c9742b08cf | |||
| 6bd5d2ded3 |
@@ -93,6 +93,30 @@ public class CrmOrderItem extends BaseEntity {
|
||||
* 排产批次
|
||||
*/
|
||||
private String productionBatch;
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
private String edgeCuttingReq;
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String packagingReq;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private BigDecimal thickness;
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
private String purpose;
|
||||
/**
|
||||
* 删除标识 0正常 2删除
|
||||
*/
|
||||
|
||||
@@ -108,5 +108,34 @@ public class CrmOrderItemBo extends BaseEntity {
|
||||
*/
|
||||
private String productionBatch;
|
||||
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
private String edgeCuttingReq;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String packagingReq;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private BigDecimal thickness;
|
||||
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
private String purpose;
|
||||
|
||||
}
|
||||
|
||||
@@ -131,5 +131,40 @@ public class CrmOrderItemVo {
|
||||
@ExcelProperty(value = "排产批次")
|
||||
private String productionBatch;
|
||||
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
@ExcelProperty(value = "表面处理")
|
||||
private String surfaceTreatment;
|
||||
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
@ExcelProperty(value = "切边要求")
|
||||
private String edgeCuttingReq;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
@ExcelProperty(value = "包装要求")
|
||||
private String packagingReq;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
@ExcelProperty(value = "宽度")
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
@ExcelProperty(value = "厚度")
|
||||
private BigDecimal thickness;
|
||||
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
@ExcelProperty(value = "用途")
|
||||
private String purpose;
|
||||
|
||||
}
|
||||
|
||||
@@ -101,6 +101,12 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomizer()), CrmOrderItem::getCustomizer, bo.getCustomizer());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getShipper()), CrmOrderItem::getShipper, bo.getShipper());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductionBatch()), CrmOrderItem::getProductionBatch, bo.getProductionBatch());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceTreatment()), CrmOrderItem::getSurfaceTreatment, bo.getSurfaceTreatment());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEdgeCuttingReq()), CrmOrderItem::getEdgeCuttingReq, bo.getEdgeCuttingReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPackagingReq()), CrmOrderItem::getPackagingReq, bo.getPackagingReq());
|
||||
lqw.eq(bo.getWidth() != null, CrmOrderItem::getWidth, bo.getWidth());
|
||||
lqw.eq(bo.getThickness() != null, CrmOrderItem::getThickness, bo.getThickness());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPurpose()), CrmOrderItem::getPurpose, bo.getPurpose());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="customizer" column="customizer"/>
|
||||
<result property="shipper" column="shipper"/>
|
||||
<result property="productionBatch" column="production_batch"/>
|
||||
<result property="surfaceTreatment" column="surface_treatment"/>
|
||||
<result property="edgeCuttingReq" column="edge_cutting_req"/>
|
||||
<result property="packagingReq" column="packaging_req"/>
|
||||
<result property="width" column="width"/>
|
||||
<result property="thickness" column="thickness"/>
|
||||
<result property="purpose" column="purpose"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@@ -50,6 +56,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
customizer,
|
||||
shipper,
|
||||
production_batch,
|
||||
surface_treatment,
|
||||
edge_cutting_req,
|
||||
packaging_req,
|
||||
width,
|
||||
thickness,
|
||||
purpose,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
:type="formData.orderId ? 'success' : 'default'">
|
||||
{{ formData.orderId ? formData.contractCode : '选择订单' }}
|
||||
</el-button>
|
||||
<div v-if="formData.orderId" @click.stop="openOrderAttachmentDialog" style="margin-left: 10px; cursor: pointer; color: #409eff;"
|
||||
type="primary">
|
||||
<div v-if="formData.orderId" @click.stop="openOrderAttachmentDialog"
|
||||
style="margin-left: 10px; cursor: pointer; color: #409eff;" type="primary">
|
||||
查看附件
|
||||
</div>
|
||||
</template>
|
||||
@@ -68,6 +68,12 @@
|
||||
|
||||
<!-- 成品信息组 -->
|
||||
<el-collapse-item title="成品信息" name="3">
|
||||
<template slot="title">
|
||||
<!-- 如果已经绑定了订单,可以在这里选择订单明细来快速录入要生产的成品信息 -->
|
||||
<span>成品信息</span>
|
||||
<el-button type="primary" plain v-if="formData.orderId" style="margin-left: 10px;"
|
||||
@click.stop="openOrderItemDialog">选择订单明细</el-button>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成品名称" prop="productName">
|
||||
@@ -228,8 +234,6 @@
|
||||
<!-- 订单列表 -->
|
||||
<el-table v-loading="orderLoading" :data="orderList" style="width: 100%" @row-click="handleOrderSelect">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<!-- <el-table-column prop="orderCode" label="订单号" width="150" /> -->
|
||||
<el-table-column prop="orderType" label="订单类型" width="100" />
|
||||
<el-table-column prop="contractCode" label="合同号" width="150" />
|
||||
<el-table-column prop="signTime" label="签订时间" width="150" />
|
||||
<el-table-column prop="signLocation" label="签订地点" />
|
||||
@@ -254,6 +258,37 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="选择订单明细" :visible.sync="orderItem.open" width="80%" append-to-body>
|
||||
<el-table v-loading="orderItem.loading" :data="orderItem.list" @row-click="selectOrderItem">
|
||||
<el-table-column label="产品类型" align="center" prop="productType" />
|
||||
<el-table-column label="成品宽度" align="center" prop="width" />
|
||||
<el-table-column label="成品厚度" align="center" prop="thickness" />
|
||||
<el-table-column label="成品规格" align="center" prop="finishedProductSpec" />
|
||||
<el-table-column label="宽度公差" align="center" prop="widthTolerance" />
|
||||
<el-table-column label="厚度公差" align="center" prop="thicknessTolerance" />
|
||||
|
||||
<el-table-column label="材质" align="center" prop="material" />
|
||||
<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="itemAmount" /> -->
|
||||
<el-table-column label="卷数" align="center" prop="productNum" />
|
||||
<el-table-column label="表面处理" align="center" prop="surfaceTreatment" />
|
||||
<el-table-column label="包装要求" align="center" prop="packagingReq" />
|
||||
<el-table-column label="切边要求" align="center" prop="edgeCuttingReq" />
|
||||
<el-table-column label="用途" align="center" prop="purpose" />
|
||||
|
||||
|
||||
<el-table-column label="特殊要求" align="center" prop="specialRequire" />
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="合同附件" :visible.sync="attachmentOpen" width="50%" append-to-body>
|
||||
<div class="attachment-section" v-loading="loading">
|
||||
<!-- <div class="attachment-item">
|
||||
@@ -275,7 +310,7 @@
|
||||
|
||||
<script>
|
||||
import { listOrder, getOrder } from '@/api/crm/order';
|
||||
import { listContract, getContract } from '@/api/crm/contract';
|
||||
import { listOrderItem } from '@/api/crm/orderItem'
|
||||
import FileList from '@/components/FileList'
|
||||
|
||||
export default {
|
||||
@@ -347,6 +382,11 @@ export default {
|
||||
attachmentOpen: false,
|
||||
contract: {},
|
||||
loading: false,
|
||||
orderItem: {
|
||||
loading: false,
|
||||
open: false,
|
||||
list: []
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -365,6 +405,34 @@ export default {
|
||||
// 加载订单列表
|
||||
this.getOrderList();
|
||||
},
|
||||
openOrderItemDialog() {
|
||||
this.orderItem.open = true;
|
||||
this.orderItem.loading = true;
|
||||
listOrderItem({ orderId: this.formData.orderId }).then(res => {
|
||||
this.orderItem.list = res.rows;
|
||||
this.orderItem.loading = false;
|
||||
})
|
||||
},
|
||||
selectOrderItem(row) {
|
||||
this.formData = {
|
||||
...this.formData,
|
||||
productName: row.productType,
|
||||
productMaterial: row.material,
|
||||
productWidth: row.width,
|
||||
rollingThick: row.thickness,
|
||||
markCoatThick: row.thickness,
|
||||
tonSteelLengthRange: 0,
|
||||
planQty: row.productNum,
|
||||
planWeight: row.weight,
|
||||
surfaceTreatment: row.surfaceTreatment,
|
||||
productPackaging: row.packagingReq,
|
||||
widthReq: row.edgeCuttingReq,
|
||||
productEdgeReq: row.widthTolerance,
|
||||
usageReq: row.purpose,
|
||||
}
|
||||
this.orderItem.open = false;
|
||||
// this.formData.orderItemId = row.orderItemId;
|
||||
},
|
||||
async openOrderAttachmentDialog() {
|
||||
this.loading = true;
|
||||
this.attachmentOpen = true;
|
||||
@@ -375,12 +443,6 @@ export default {
|
||||
return;
|
||||
}
|
||||
const order = await getOrder(this.formData.orderId);
|
||||
// if (!order.data.contractId) {
|
||||
// this.$message.error('未找到合同')
|
||||
// return;
|
||||
// }
|
||||
// 根据合同id拿到合同详情
|
||||
// const contract = await getContract(order.data.contractId);
|
||||
this.contract = order.data;
|
||||
} catch {
|
||||
this.$message.error('获取合同附件失败')
|
||||
@@ -388,12 +450,6 @@ export default {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
/** 获取合同列表 */
|
||||
// getContractList() {
|
||||
// listContract().then(response => {
|
||||
// this.contractList = response.rows;
|
||||
// });
|
||||
// },
|
||||
/** 获取订单列表 */
|
||||
getOrderList() {
|
||||
this.orderLoading = true;
|
||||
|
||||
@@ -14,8 +14,10 @@
|
||||
|
||||
<el-table v-loading="loading" :data="orderItemList">
|
||||
<el-table-column label="产品类型" align="center" prop="productType" />
|
||||
<el-table-column label="成品宽度" align="center" prop="width" />
|
||||
<el-table-column label="成品厚度" align="center" prop="thickness" />
|
||||
<el-table-column label="成品规格" align="center" prop="finishedProductSpec" />
|
||||
<el-table-column label="原料规格" align="center" prop="rawMaterialSpec" />
|
||||
<!-- <el-table-column label="原料规格" align="center" prop="rawMaterialSpec" /> -->
|
||||
<el-table-column label="宽度公差" align="center" prop="widthTolerance" />
|
||||
<el-table-column label="厚度公差" align="center" prop="thicknessTolerance" />
|
||||
|
||||
@@ -29,6 +31,12 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="无税单价(元/吨)" align="center" prop="itemAmount" />
|
||||
<el-table-column label="卷数" align="center" prop="productNum" />
|
||||
<el-table-column label="表面处理" align="center" prop="surfaceTreatment" />
|
||||
<el-table-column label="包装要求" align="center" prop="packagingReq" />
|
||||
<el-table-column label="切边要求" align="center" prop="edgeCuttingReq" />
|
||||
<el-table-column label="用途" align="center" prop="purpose" />
|
||||
|
||||
|
||||
<el-table-column label="特殊要求" align="center" prop="specialRequire" />
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
@@ -50,18 +58,15 @@
|
||||
<el-form-item label="产品类型" prop="productType">
|
||||
<el-input v-model="form.productType" placeholder="请输入产品类型" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="产品数量" prop="productNum">
|
||||
<el-input v-model="form.productNum" placeholder="请输入产品数量" />
|
||||
</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="finishedProductSpec">
|
||||
<el-input v-model="form.finishedProductSpec" placeholder="请输入成品规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成品宽度" prop="width">
|
||||
<el-input v-model="form.width" placeholder="请输入宽度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成品厚度" prop="thickness">
|
||||
<el-input v-model="form.thickness" placeholder="请输入厚度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宽度公差" prop="widthTolerance">
|
||||
<el-input v-model="form.widthTolerance" placeholder="请输入宽度公差" />
|
||||
</el-form-item>
|
||||
@@ -71,23 +76,34 @@
|
||||
<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 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 label="无税单价(元/吨)" prop="itemAmount">
|
||||
<el-input v-model="form.itemAmount" placeholder="请输入无税单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发货人" prop="shipper">
|
||||
<el-input v-model="form.shipper" placeholder="请输入发货人" />
|
||||
|
||||
<el-form-item label="卷数" prop="productNum">
|
||||
<el-input v-model="form.productNum" placeholder="请输入卷数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排产批次" prop="productionBatch">
|
||||
<el-input v-model="form.productionBatch" placeholder="请输入排产批次" />
|
||||
<el-form-item label="表面处理" prop="surfaceTreatment">
|
||||
<el-input v-model="form.surfaceTreatment" placeholder="请输入表面处理" />
|
||||
</el-form-item>
|
||||
<el-form-item label="包装要求" prop="packagingReq">
|
||||
<el-input v-model="form.packagingReq" placeholder="请输入包装要求" />
|
||||
</el-form-item>
|
||||
<el-form-item label="切边要求" prop="edgeCuttingReq">
|
||||
<el-input v-model="form.edgeCuttingReq" placeholder="请输入切边要求" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用途" prop="purpose">
|
||||
<el-input v-model="form.purpose" placeholder="请输入用途" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="特殊要求" prop="specialRequire">
|
||||
<el-input v-model="form.specialRequire" placeholder="请输入特殊要求" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
@@ -170,29 +186,29 @@ export default {
|
||||
productType: [
|
||||
{ required: true, message: "请输入产品类型", trigger: "blur" }
|
||||
],
|
||||
productNum: [
|
||||
{ required: true, message: "请输入产品数量", trigger: "blur" }
|
||||
],
|
||||
rawMaterialSpec: [
|
||||
{ required: true, message: "请输入原料规格", trigger: "blur" }
|
||||
],
|
||||
finishedProductSpec: [
|
||||
{ required: true, message: "请输入成品规格", trigger: "blur" }
|
||||
],
|
||||
// productNum: [
|
||||
// { required: true, message: "请输入产品数量", trigger: "blur" }
|
||||
// ],
|
||||
// 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"
|
||||
}
|
||||
],
|
||||
// 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" },
|
||||
// 必须是数字,最多两位小数,使用自定义的校验规则
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
|
||||
<div style="margin-top: 20px;">
|
||||
<h4 style="margin-bottom: 10px; color: #606266;">一、产品内容</h4>
|
||||
<ProductContent v-model="contract.productContent" readonly />
|
||||
<OrderDetail :orderId="contract.orderId" :remark="contract.remark" readonly />
|
||||
<!-- <ProductContent v-model="contract.productContent" readonly /> -->
|
||||
<!-- <div v-html="contract.productContent" style="border: 1px solid #e4e7ed; padding: 10px; border-radius: 4px;"></div> -->
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<!-- <h4 style="margin-bottom: 10px; color: #606266;">合同内容</h4> -->
|
||||
<div v-html="contract.contractContent" style="border: 1px solid #e4e7ed; padding: 10px; border-radius: 4px;"></div>
|
||||
</div>
|
||||
|
||||
@@ -61,11 +61,13 @@
|
||||
|
||||
<script>
|
||||
import ProductContent from './ProductContent.vue';
|
||||
import OrderDetail from './OrderDetail.vue';
|
||||
|
||||
export default {
|
||||
name: "ContractPreview",
|
||||
components: {
|
||||
ProductContent
|
||||
ProductContent,
|
||||
OrderDetail
|
||||
},
|
||||
props: {
|
||||
contract: {
|
||||
|
||||
307
klp-ui/src/views/crm/contract/components/OrderDetail.vue
Normal file
307
klp-ui/src/views/crm/contract/components/OrderDetail.vue
Normal file
@@ -0,0 +1,307 @@
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<!-- 网格布局实现的表格,共8列 -->
|
||||
<div class="product-content">
|
||||
<!-- 第一行合并所有八个单元格,内容为:嘉祥科伦普重工有限公司 -->
|
||||
<div class="table-row table-header">
|
||||
<div class="table-cell" colspan="3">
|
||||
<div class="company-name">产品名称:{{ productName }}</div>
|
||||
</div>
|
||||
<div class="table-cell" colspan="5">
|
||||
<div class="company-name">生产厂家:嘉祥科伦普重工有限公司</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 第二行为表头 -->
|
||||
<div class="table-row">
|
||||
<div class="table-cell">序号</div>
|
||||
<div class="table-cell">规格(mm)</div>
|
||||
<div class="table-cell">材质</div>
|
||||
<div class="table-cell">数量(吨)</div>
|
||||
<div class="table-cell">含税单价(元/吨)</div>
|
||||
<div class="table-cell">不含税单价(元/吨)</div>
|
||||
<div class="table-cell">含税总额(元)</div>
|
||||
<div class="table-cell">备注</div>
|
||||
</div>
|
||||
|
||||
<!-- 产品行 -->
|
||||
<div
|
||||
v-for="(item, index) in products"
|
||||
:key="index"
|
||||
class="table-row"
|
||||
:class="{ 'table-row-hover': !readonly }"
|
||||
>
|
||||
<div class="table-cell">
|
||||
<div class="serial-number">
|
||||
<span>{{ index + 1 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.finishedProductSpec }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.material }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.weight }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.contractPrice }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.itemAmount }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.contractPrice * item.weight }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.remark }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 合计行 -->
|
||||
<div class="table-row table-total-row">
|
||||
<div class="table-cell" colspan="3">合计</div>
|
||||
<div class="table-cell">{{ totalQuantity }}</div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell">{{ totalTaxTotal }}</div>
|
||||
<div class="table-cell"></div>
|
||||
</div>
|
||||
|
||||
<!-- 合计人民币(大写) -->
|
||||
<div class="table-row">
|
||||
<div class="table-cell" colspan="8">
|
||||
<span>合计人民币(大写):</span>
|
||||
<span>{{ totalAmountInWords }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 备注 -->
|
||||
<div class="table-row">
|
||||
<div class="table-cell" colspan="8">
|
||||
<span>备注:</span>
|
||||
<pre>{{ remark }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrderItem } from '@/api/crm/orderItem'
|
||||
|
||||
export default {
|
||||
name: 'ProductContent',
|
||||
props: {
|
||||
orderId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
remark: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
products: [],
|
||||
productName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 计算总数量(吨)
|
||||
totalQuantity() {
|
||||
return this.products.reduce((sum, item) => sum + (Number(item.weight) || 0), 0)
|
||||
},
|
||||
// 计算含税总额(元)
|
||||
totalTaxTotal() {
|
||||
return this.products.reduce((sum, item) => sum + (Number(item.contractPrice) || 0) * (Number(item.weight) || 0), 0)
|
||||
},
|
||||
// 计算合计人民币(大写)
|
||||
totalAmountInWords() {
|
||||
const amount = this.totalTaxTotal
|
||||
if (amount === 0) return '零元整'
|
||||
|
||||
const digits = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
|
||||
const units = ['', '拾', '佰', '仟']
|
||||
const bigUnits = ['', '万', '亿']
|
||||
|
||||
let integerPart = Math.floor(amount)
|
||||
let decimalPart = Math.round((amount - integerPart) * 100)
|
||||
|
||||
let result = ''
|
||||
let unitIndex = 0
|
||||
let bigUnitIndex = 0
|
||||
|
||||
if (integerPart === 0) {
|
||||
result = '零'
|
||||
} else {
|
||||
while (integerPart > 0) {
|
||||
let section = integerPart % 10000
|
||||
if (section > 0) {
|
||||
let sectionResult = ''
|
||||
let sectionUnitIndex = 0
|
||||
|
||||
while (section > 0) {
|
||||
let digit = section % 10
|
||||
if (digit > 0) {
|
||||
sectionResult = digits[digit] + units[sectionUnitIndex] + sectionResult
|
||||
} else if (sectionResult && !sectionResult.startsWith('零')) {
|
||||
sectionResult = '零' + sectionResult
|
||||
}
|
||||
section = Math.floor(section / 10)
|
||||
sectionUnitIndex++
|
||||
}
|
||||
|
||||
result = sectionResult + bigUnits[bigUnitIndex] + result
|
||||
}
|
||||
integerPart = Math.floor(integerPart / 10000)
|
||||
bigUnitIndex++
|
||||
}
|
||||
}
|
||||
|
||||
result += '元'
|
||||
|
||||
if (decimalPart === 0) {
|
||||
result += '整'
|
||||
} else {
|
||||
const jiao = Math.floor(decimalPart / 10)
|
||||
const fen = decimalPart % 10
|
||||
if (jiao > 0) {
|
||||
result += digits[jiao] + '角'
|
||||
}
|
||||
if (fen > 0) {
|
||||
result += digits[fen] + '分'
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听 orderId 变化,重新获取订单商品列表
|
||||
orderId: {
|
||||
handler(newVal) {
|
||||
if (newVal) {
|
||||
this.getOrderItems()
|
||||
} else {
|
||||
this.products = []
|
||||
this.productName = ''
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取订单商品列表
|
||||
async getOrderItems() {
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await listOrderItem({
|
||||
orderId: this.orderId
|
||||
})
|
||||
if (res.code === 200) {
|
||||
this.products = res.rows || []
|
||||
this.productName = res.rows[0]?.productType || ''
|
||||
} else {
|
||||
this.products = []
|
||||
this.productName = ''
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取订单商品列表失败:', error)
|
||||
this.products = []
|
||||
this.productName = ''
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.product-content {
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table-header {
|
||||
background-color: #f5f7fa;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table-row {
|
||||
display: grid;
|
||||
grid-template-columns: 80px 150px 120px 100px 140px 150px 120px 1fr;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.table-row-hover:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.table-header-row {
|
||||
background-color: #f5f7fa;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table-total-row {
|
||||
background-color: #f5f7fa;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table-cell {
|
||||
padding: 8px;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.table-cell:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.table-cell[colspan="3"] {
|
||||
grid-column: span 3;
|
||||
}
|
||||
|
||||
.table-cell[colspan="5"] {
|
||||
grid-column: span 5;
|
||||
}
|
||||
|
||||
.table-cell[colspan="8"] {
|
||||
grid-column: span 8;
|
||||
}
|
||||
|
||||
.serial-number {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
opacity: 0;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.serial-number:hover .delete-btn {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -81,9 +81,9 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="产品内容">
|
||||
<!-- <el-form-item label="产品内容">
|
||||
<ProductContent v-model="form.productContent" :readonly="false" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="合同内容">
|
||||
<editor v-model="form.contractContent" :min-height="192" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -292,9 +292,9 @@ import { getCoilTagPrintType } from '@/views/wms/coil/js/coilPrint'
|
||||
|
||||
export default {
|
||||
name: 'DoPage',
|
||||
dicts: ['action_type', 'coil_abnormal_code', 'coil_abnormal_position', 'coil_abnormal_degree', 'coil_quality_status'],
|
||||
dicts: ['action_type', 'coil_abnormal_code', 'coil_abnormal_position', 'coil_abnormal_degree', 'coil_quality_status', 'coil_business_purpose'],
|
||||
props: {
|
||||
label: {
|
||||
label: {
|
||||
type: String,
|
||||
default: () => '酸连轧工序'
|
||||
},
|
||||
@@ -314,7 +314,6 @@ export default {
|
||||
RawMaterialSelect,
|
||||
CoilTraceResult,
|
||||
},
|
||||
dicts: ['coil_business_purpose'],
|
||||
data() {
|
||||
return {
|
||||
traceOpen: false,
|
||||
|
||||
@@ -118,7 +118,7 @@ export default {
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
pageSize: 99999,
|
||||
status: 1,
|
||||
dataType: 1,
|
||||
byExportTimeStart: startTime,
|
||||
@@ -170,7 +170,7 @@ export default {
|
||||
}).then(res => {
|
||||
this.list = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
@@ -256,7 +256,7 @@ export default {
|
||||
]);
|
||||
this.lossList = lossRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
@@ -186,7 +186,7 @@ export default {
|
||||
// actionStatus: 2,
|
||||
warehouseId: this.queryParams.planId,
|
||||
actionType: 401,
|
||||
pageSize: 9999,
|
||||
pageSize: 99999,
|
||||
pageNum: 1,
|
||||
startTime: this.queryParams.byCreateTimeStart,
|
||||
endTime: this.queryParams.byCreateTimeEnd,
|
||||
@@ -209,7 +209,7 @@ export default {
|
||||
}).then(res => {
|
||||
this.list = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
@@ -267,7 +267,7 @@ export default {
|
||||
});
|
||||
this.outList = outRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
Reference in New Issue
Block a user