Browse Source

修改:采购报价mapper.xml新增,获取每个供应商分组最新增通过的报价信息。

dev
zhangsiqi 3 months ago
parent
commit
7f8fec8a00
  1. 23
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml
  2. 25
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskModifyApply.html

23
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml

@ -190,4 +190,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
quoteChild.material_code = #{material} and quoteChild.del_flag = '0';
</select>
<select id="findLatestAuditPassedGroups" parameterType="String" resultMap="PurchaseQuoteChildResult">
<!-- 子查询找出每个供应商分组的最大审计日期 -->
WITH max_audit_dates AS (
SELECT
purchase_quote_code,
MAX(audit_date) AS max_audit_date
FROM purchase_quote
WHERE audit_status = '1' AND use_status = '1'
GROUP BY purchase_quote_code
)
<!-- 主查询获取每个供应商分组最大审计日期的记录 -->
SELECT pc.*,pq.*
FROM purchase_quote_child AS pc
LEFT JOIN
purchase_quote AS pq ON pq.purchase_quote_code = pc.purchase_quote_code
LEFT JOIN
max_audit_dates AS mad ON pq.purchase_quote_code = mad.purchase_quote_code AND pq.audit_date = mad.max_audit_date
WHERE
pq.audit_status = '1' AND pq.use_status = '1' AND
pc.material_code = #{material} AND pc.del_flag = '0'
</select>
</mapper>

25
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskModifyApply.html

@ -230,8 +230,29 @@
},
{title:'最新报价',field: 'materialSole',align: 'center',},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: true,},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable: true,},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',
editable:{
type: 'text',
validate: function(v) {
if (!v) return '输入不能为空';
if (isNaN(v)) return '输入错误';
if (v < 0) return '单价可以为0';
//正则金额保留两位小数
if (!/^\d+(\.\d{1,2})?$/.test(v)) return '金额保留两位小数';
}
}
},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable:{
type: 'text',
validate: function(v) {
if (!v) return '输入不能为空';
if (isNaN(v)) return '输入错误';
if (v < 0) return '单价可以为0';
//正则金额保留两位小数
if (!/^\d+(\.\d{1,2})?$/.test(v)) return '金额保留两位小数';
}
}
},
{title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false},

Loading…
Cancel
Save