feat(bid): add pending delivery order management feature

1. 新增待发订单路由页面与菜单权限
2. 新增发货单生成功能,可从已采纳报价单创建发货单
3. 扩展发货单实体与Mapper,增加物料数量统计字段
4. 实现待发订单列表、详情、编辑、发货确认与删除功能
This commit is contained in:
2026-06-11 22:45:31 +08:00
parent 93785be505
commit 91f29d36ee
5 changed files with 294 additions and 1 deletions

View File

@@ -124,6 +124,8 @@
@click="handleAccept(s.row)" v-if="s.row.status==='submitted' && !isSupplier">采纳</el-button>
<el-button size="mini" type="text" style="color:#F56C6C" icon="el-icon-close"
@click="handleReject(s.row)" v-if="s.row.status==='submitted' && !isSupplier">拒绝</el-button>
<el-button size="mini" type="text" style="color:#4A6FA5" icon="el-icon-s-order"
@click="handleCreateDelivery(s.row)" v-if="s.row.status==='accepted'">生成发货单</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" style="color:#f56c6c"
@click="handleDelete(s.row)" v-if="s.row.status==='draft'">删除</el-button>
</template>
@@ -369,6 +371,7 @@ import { listQuotation, getQuotation, addQuotation, updateQuotation,
submitQuotation, acceptQuotation, rejectQuotation, delQuotation } from "@/api/bid/quotation";
import { listRfq, getRfqItems } from "@/api/bid/rfq";
import { listSupplier } from "@/api/bid/supplier";
import { addDelivery } from "@/api/bid/delivery";
import logoImg from "@/assets/logo/logo.png";
import html2canvas from "html2canvas";
import jsPDF from "jspdf";
@@ -504,6 +507,47 @@ export default {
this.$modal.confirm("确认删除?").then(() => delQuotation(row.quotationId))
.then(() => { this.$modal.msgSuccess("删除成功"); this.getList(); });
},
handleCreateDelivery(row) {
this.$modal.confirm("确认基于此报价单生成发货单?").then(() => {
return getQuotation(row.quotationId);
}).then(res => {
const q = res.data;
if (!q || !q.items || q.items.length === 0) {
throw new Error("该报价单无明细,无法生成发货单");
}
// 计算交货期 = 今天 + 报价单中的交期天数
let deliveryDate = ""
if (q.deliveryDays) {
const d = new Date()
d.setDate(d.getDate() + q.deliveryDays)
deliveryDate = d.toISOString().slice(0, 10)
}
const doPayload = {
rfqId: q.rfqId,
quotationId: q.quotationId,
supplierId: q.supplierId,
totalAmount: q.totalAmount,
deliveryDate: deliveryDate,
deliveryStatus: "pending",
items: q.items.map(it => ({
materialId: it.materialId || 0,
materialName: it.materialName,
spec: it.spec || "",
unit: it.unit || "",
quantity: it.quantity || 0,
unitPrice: it.unitPrice || 0,
totalPrice: it.totalPrice || ((it.quantity || 0) * (it.unitPrice || 0)),
remark: it.remark || ""
}))
};
return addDelivery(doPayload);
}).then(() => {
this.$modal.msgSuccess("发货单已生成");
this.getList();
}).catch(e => {
if (e.message) this.$modal.msgError(e.message);
});
},
submitForm(mode) {
this.$refs.form.validate(valid => {
if (!valid) return;