feat(PlanDetailForm): 添加订单明细选择功能以快速录入成品信息
在成品信息组中添加选择订单明细按钮,点击可打开对话框选择订单明细并自动填充表单字段。移除未使用的订单类型列并优化附件查看按钮的样式。
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
:type="formData.orderId ? 'success' : 'default'">
|
:type="formData.orderId ? 'success' : 'default'">
|
||||||
{{ formData.orderId ? formData.contractCode : '选择订单' }}
|
{{ formData.orderId ? formData.contractCode : '选择订单' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<div v-if="formData.orderId" @click.stop="openOrderAttachmentDialog" style="margin-left: 10px; cursor: pointer; color: #409eff;"
|
<div v-if="formData.orderId" @click.stop="openOrderAttachmentDialog"
|
||||||
type="primary">
|
style="margin-left: 10px; cursor: pointer; color: #409eff;" type="primary">
|
||||||
查看附件
|
查看附件
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -68,6 +68,12 @@
|
|||||||
|
|
||||||
<!-- 成品信息组 -->
|
<!-- 成品信息组 -->
|
||||||
<el-collapse-item title="成品信息" name="3">
|
<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-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="成品名称" prop="productName">
|
<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 v-loading="orderLoading" :data="orderList" style="width: 100%" @row-click="handleOrderSelect">
|
||||||
<el-table-column type="selection" width="55" />
|
<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="contractCode" label="合同号" width="150" />
|
||||||
<el-table-column prop="signTime" label="签订时间" width="150" />
|
<el-table-column prop="signTime" label="签订时间" width="150" />
|
||||||
<el-table-column prop="signLocation" label="签订地点" />
|
<el-table-column prop="signLocation" label="签订地点" />
|
||||||
@@ -254,6 +258,37 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</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>
|
<el-dialog title="合同附件" :visible.sync="attachmentOpen" width="50%" append-to-body>
|
||||||
<div class="attachment-section" v-loading="loading">
|
<div class="attachment-section" v-loading="loading">
|
||||||
<!-- <div class="attachment-item">
|
<!-- <div class="attachment-item">
|
||||||
@@ -275,7 +310,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listOrder, getOrder } from '@/api/crm/order';
|
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'
|
import FileList from '@/components/FileList'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -347,6 +382,11 @@ export default {
|
|||||||
attachmentOpen: false,
|
attachmentOpen: false,
|
||||||
contract: {},
|
contract: {},
|
||||||
loading: false,
|
loading: false,
|
||||||
|
orderItem: {
|
||||||
|
loading: false,
|
||||||
|
open: false,
|
||||||
|
list: []
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -365,6 +405,34 @@ export default {
|
|||||||
// 加载订单列表
|
// 加载订单列表
|
||||||
this.getOrderList();
|
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() {
|
async openOrderAttachmentDialog() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.attachmentOpen = true;
|
this.attachmentOpen = true;
|
||||||
@@ -375,12 +443,6 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const order = await getOrder(this.formData.orderId);
|
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;
|
this.contract = order.data;
|
||||||
} catch {
|
} catch {
|
||||||
this.$message.error('获取合同附件失败')
|
this.$message.error('获取合同附件失败')
|
||||||
@@ -388,12 +450,6 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 获取合同列表 */
|
|
||||||
// getContractList() {
|
|
||||||
// listContract().then(response => {
|
|
||||||
// this.contractList = response.rows;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
/** 获取订单列表 */
|
/** 获取订单列表 */
|
||||||
getOrderList() {
|
getOrderList() {
|
||||||
this.orderLoading = true;
|
this.orderLoading = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user