Commit ba25d719 by 张立顺

fix bug

1 parent cb011310
...@@ -50,7 +50,7 @@ export function getAllGroupByCategory(data) { ...@@ -50,7 +50,7 @@ export function getAllGroupByCategory(data) {
return request(data); return request(data);
} }
// 升级品下拉:merchantGoodsInfo.rule.selectList,扁平 list(upgradeGoodsId / goodsShowName / merchantGoodsCode) // 升级品下拉:merchantGoodsInfo.rule.selectList,扁平 list(upgradeGoodsId / goodsShowName / packageName / merchantGoodsCode)
export function getAllGoodsList(data) { export function getAllGoodsList(data) {
data.method = `${path}merchantGoodsInfo.rule.selectList`; data.method = `${path}merchantGoodsInfo.rule.selectList`;
return request(data, "post"); return request(data, "post");
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</el-row> </el-row>
</section> </section>
<section class="detail-card"> <section class="detail-card detail-card--staff">
<h3 class="detail-card__title">施工信息</h3> <h3 class="detail-card__title">施工信息</h3>
<div class="staff-cards"> <div class="staff-cards">
<div <div
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<div class="staff-card__avatar">{{ nameInitial(p.name) }}</div> <div class="staff-card__avatar">{{ nameInitial(p.name) }}</div>
<div class="staff-card__meta"> <div class="staff-card__meta">
<div class="staff-card__name">{{ p.name }}</div> <div class="staff-card__name">{{ p.name }}</div>
<el-tag size="small" type="info" class="staff-card__tag">{{ p.roleLabel }}</el-tag> <span class="staff-card__tag">{{ p.roleLabel }}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -71,6 +71,8 @@ ...@@ -71,6 +71,8 @@
<span class="suborder-mcode">物料编码{{ so.materialCode }}</span> <span class="suborder-mcode">物料编码{{ so.materialCode }}</span>
</div> </div>
<div class="suborder-list__right"> <div class="suborder-list__right">
<span class="suborder-outbound">出库 {{ so.outboundQty }}</span>
<span class="suborder-divider" />
<span <span
:class="['suborder-pill', 'suborder-pill--' + (so.statusTone || 'grey')]" :class="['suborder-pill', 'suborder-pill--' + (so.statusTone || 'grey')]"
>{{ so.tag1 }}</span> >{{ so.tag1 }}</span>
...@@ -226,6 +228,12 @@ export default { ...@@ -226,6 +228,12 @@ export default {
margin: 0 0 14px 0; margin: 0 0 14px 0;
} }
.detail-card--staff .detail-card__title {
padding-bottom: 12px;
margin-bottom: 14px;
border-bottom: 1px solid #ebeef5;
}
.detail-row { .detail-row {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 14px; font-size: 14px;
...@@ -248,31 +256,54 @@ export default { ...@@ -248,31 +256,54 @@ export default {
.staff-card { .staff-card {
display: flex; display: flex;
align-items: center; align-items: center;
background: #f0f7ff; background: #f5f7fa;
border: 1px solid #d9ecff; border: 1px solid #eceef5;
border-radius: 4px; border-radius: 8px;
padding: 8px 12px; padding: 12px;
min-width: 200px; min-width: 200px;
box-sizing: border-box;
} }
.staff-card__avatar { .staff-card__avatar {
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 50%; border-radius: 50%;
background: #409eff; background: #e1e7f2;
color: #fff; color: #2a58ad;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 16px; font-size: 16px;
font-weight: 500;
margin-right: 10px; margin-right: 10px;
flex-shrink: 0; flex-shrink: 0;
} }
.staff-card__meta {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 6px;
min-width: 0;
}
.staff-card__name { .staff-card__name {
font-size: 14px; font-size: 14px;
color: #303133; color: #303133;
margin-bottom: 4px; line-height: 1.4;
}
.staff-card__tag {
display: inline-block;
box-sizing: border-box;
padding: 2px 8px;
font-size: 12px;
line-height: 1.5;
color: #2a58ad;
border: 1px solid #2a58ad80;
border-radius: 12px;
background: #fff;
white-space: nowrap;
} }
.m-t-16 { .m-t-16 {
...@@ -343,6 +374,12 @@ export default { ...@@ -343,6 +374,12 @@ export default {
color: #606266; color: #606266;
} }
.suborder-outbound {
color: #606266;
font-size: 13px;
white-space: nowrap;
}
.suborder-list__right { .suborder-list__right {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -66,15 +66,26 @@ function formatTechnicianText(row) { ...@@ -66,15 +66,26 @@ function formatTechnicianText(row) {
} }
/** /**
* 单条服务明细的实际出库展示(与列表「实际出库数量(米/件)」列同一规则) * 实际出库数量展示(列表/详情「米/件」;取自 subOrderList[].materialsUsed)
* @param {*} materialsUsed
* @returns {string}
*/
export function formatMaterialsUsedDisplay(materialsUsed) {
if (materialsUsed == null || materialsUsed === '') return '-'
const num = Number(materialsUsed)
const formatted = Number.isFinite(num) ? num.toFixed(2) : String(materialsUsed).trim()
if (formatted === '') return '-'
return `${formatted}米/件`
}
/**
* 兼容:serviceItemsDetailList 项上的 useNum(新逻辑请以 formatMaterialsUsedDisplay 为准)
* @param {Object} d - serviceItemsDetailList 项 * @param {Object} d - serviceItemsDetailList 项
* @returns {string} * @returns {string}
*/ */
export function formatServiceDetailOutboundLine(d) { export function formatServiceDetailOutboundLine(d) {
if (!d || d.useNum == null || d.useNum === '') return '-' if (!d) return '-'
const num = Number(d.useNum) return formatMaterialsUsedDisplay(d.useNum)
const formatted = Number.isFinite(num) ? num.toFixed(2) : String(d.useNum).trim()
return `${formatted}米/件`
} }
/** 施工状态 0-待施工(橙) 1-已施工(绿) 2-客户返工(红),与列表 statusDotClass 一致 */ /** 施工状态 0-待施工(橙) 1-已施工(绿) 2-客户返工(红),与列表 statusDotClass 一致 */
...@@ -94,21 +105,26 @@ export function constructionInnerPillTone(s) { ...@@ -94,21 +105,26 @@ export function constructionInnerPillTone(s) {
return 'grey' return 'grey'
} }
/** 服务项目行与实际出库行同源、同序(与有名称的服务明细一一对应) */ /** 列表「服务项目」列(来自 serviceItemsDetailList;无则占位一行 `-`) */
function serviceItemsAndOutboundLinesForTable(row) { function serviceLinesForTable(row) {
const serviceLines = [] const serviceLines = []
const actualOutLines = []
;(row.serviceItemsDetailList || []).forEach((d) => { ;(row.serviceItemsDetailList || []).forEach((d) => {
if (!d) return if (!d) return
const n = d.serviceItemsName const n = d.serviceItemsName
if (n == null || String(n).trim() === '') return if (n == null || String(n).trim() === '') return
serviceLines.push({ name: String(n).trim() }) serviceLines.push({ name: String(n).trim() })
actualOutLines.push(formatServiceDetailOutboundLine(d))
}) })
if (!serviceLines.length) { if (!serviceLines.length) {
return { serviceLines: [{ name: '-' }], actualOutLines: ['-'] } return { serviceLines: [{ name: '-' }] }
} }
return { serviceLines, actualOutLines } return { serviceLines }
}
/** 列表「实际出库数量」列:与 subOrderList 一一对应 */
function actualOutLinesFromSubOrders(subList) {
const list = subList || []
if (!list.length) return ['-']
return list.map((s) => formatMaterialsUsedDisplay(s && s.materialsUsed))
} }
/** /**
...@@ -126,7 +142,15 @@ export function mapConstructionListRow(row, index) { ...@@ -126,7 +142,15 @@ export function mapConstructionListRow(row, index) {
const pictureUrl = constructionPhotoUrls[0] || '' const pictureUrl = constructionPhotoUrls[0] || ''
const cst = toIntOrNull(row.constructionStatus) const cst = toIntOrNull(row.constructionStatus)
const ist = toIntOrNull(row.constructionInnerStatus) const ist = toIntOrNull(row.constructionInnerStatus)
const { serviceLines, actualOutLines } = serviceItemsAndOutboundLinesForTable(row) let { serviceLines } = serviceLinesForTable(row)
const actualOutLines = actualOutLinesFromSubOrders(subList)
if (serviceLines.length === 1 && serviceLines[0].name === '-' && subList.length) {
serviceLines = subList.map((s) => {
const gn = s && s.upgradeGoodsName
const name = gn != null && String(gn).trim() !== '' ? String(gn).trim() : '-'
return { name }
})
}
return { return {
...row, ...row,
_rowKey: row.id != null ? row.id : (row.constructionCode || `idx-${index}`), _rowKey: row.id != null ? row.id : (row.constructionCode || `idx-${index}`),
...@@ -203,6 +227,7 @@ export function mapApiRowToDetailForm(row) { ...@@ -203,6 +227,7 @@ export function mapApiRowToDetailForm(row) {
return { return {
productName: s.upgradeGoodsName || '-', productName: s.upgradeGoodsName || '-',
materialCode: s.materialCode || '-', materialCode: s.materialCode || '-',
outboundQty: formatMaterialsUsedDisplay(s.materialsUsed),
tag1, tag1,
tag2, tag2,
statusTone: constructionStatusPillTone(statusVal), statusTone: constructionStatusPillTone(statusVal),
...@@ -224,6 +249,7 @@ export function mapApiRowToDetailForm(row) { ...@@ -224,6 +249,7 @@ export function mapApiRowToDetailForm(row) {
{ {
productName: '-', productName: '-',
materialCode: '-', materialCode: '-',
outboundQty: '-',
tag1: '-', tag1: '-',
tag2: '-', tag2: '-',
statusTone: 'grey', statusTone: 'grey',
......
...@@ -900,7 +900,8 @@ export default { ...@@ -900,7 +900,8 @@ export default {
feeCategoryType: 1, feeCategoryType: 1,
applicationSceneType: this.routerInfo.scene, applicationSceneType: this.routerInfo.scene,
orderBy: 2, orderBy: 2,
pageSize: 100000 pageSize: 100000,
baseSceneCodeList: [resolveBaseSceneCodeFromRouter(this.routerInfo)]
}).then((result) => { }).then((result) => {
result = result.list result = result.list
// console.log(result, 'result') // console.log(result, 'result')
......
...@@ -1020,7 +1020,8 @@ export default { ...@@ -1020,7 +1020,8 @@ export default {
const base = { const base = {
feeCategoryType: 2, feeCategoryType: 2,
applicationSceneType: scene, applicationSceneType: scene,
pageSize pageSize,
baseSceneCodeList: [resolveBaseSceneCodeFromRouter(this.routerInfo)]
} }
const emptyThree = () => { const emptyThree = () => {
this.queryFeeCategoryByTypeFlow = [] this.queryFeeCategoryByTypeFlow = []
......
/** /**
* merchantGoodsInfo.rule.selectList 返回的扁平 list(可与 merchantGoodsCode 独立的 commodityCode) * merchantGoodsInfo.rule.selectList 返回的扁平 list(可与 merchantGoodsCode 独立的 commodityCode)
* → 分账「具体商品」下拉统一结构 * → 分账「具体商品」下拉统一结构
* @param {Array<{upgradeGoodsId?: *, goodsShowName?: *, merchantGoodsCode?: *, commodityCode?: *}>|undefined} list * @param {Array<{upgradeGoodsId?: *, goodsShowName?: *, packageName?: *, merchantGoodsCode?: *, commodityCode?: *}>|undefined} list
* @returns {Array<{upgradeGoodsId: *, upgradeGoodsName: string, commodityCode: string, merchantGoodsCode: string}>} * @returns {Array<{upgradeGoodsId: *, upgradeGoodsName: string, commodityCode: string, merchantGoodsCode: string}>}
*/ */
export function mapProductSearchListToUpgradeGoodsOptions(list) { export function mapProductSearchListToUpgradeGoodsOptions(list) {
return (list || []) return (list || [])
.map((row) => { .map((row) => {
const upgradeGoodsId = row && row.upgradeGoodsId const upgradeGoodsId = row && row.upgradeGoodsId
const upgradeGoodsName = const goodsName =
row && row.goodsShowName != null ? String(row.goodsShowName) : "" row && row.goodsShowName != null ? String(row.goodsShowName) : ""
let pkg = ""
if (row && row.packageName != null) {
const t = String(row.packageName).trim()
if (t !== "" && t !== "null" && t !== "undefined") pkg = t
}
const upgradeGoodsName = pkg ? `${pkg}-${goodsName}` : goodsName
const rawCode = row && row.merchantGoodsCode const rawCode = row && row.merchantGoodsCode
const merchantGoodsCode = const merchantGoodsCode =
rawCode != null && String(rawCode).trim() !== "" rawCode != null && String(rawCode).trim() !== ""
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!