修复采购和集成酸轧细节
This commit is contained in:
@@ -132,19 +132,12 @@ export function refreshArrival(planId) {
|
||||
})
|
||||
}
|
||||
|
||||
// 某计划的到货上传批次(每次上传一条)
|
||||
export function listDeliveryBatches(planId) {
|
||||
// 厂商历史记忆(手填自动补全)
|
||||
export function listManufacturers(keyword) {
|
||||
return request({
|
||||
url: `/erp/purchasePlan/${planId}/deliveryBatches`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 某批次的到货明细
|
||||
export function listDeliveryByBatch(batchId) {
|
||||
return request({
|
||||
url: `/erp/purchasePlan/deliveryBatch/${batchId}`,
|
||||
method: 'get'
|
||||
url: '/erp/purchasePlan/manufacturers',
|
||||
method: 'get',
|
||||
params: { keyword }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<section class="pa-detail">
|
||||
<div v-if="!current.planId" class="pa-placeholder">
|
||||
<i class="el-icon-s-check"></i>
|
||||
<p>从左侧选择一条采购计划进行审核</p>
|
||||
<p>从左侧选择一条采购合同进行审核</p>
|
||||
</div>
|
||||
|
||||
<div v-else class="pa-view">
|
||||
@@ -80,29 +80,21 @@
|
||||
</div>
|
||||
|
||||
<div class="pa-meta">
|
||||
<div class="pa-meta-i"><label>供货商</label><span>{{ current.supplier || '—' }}</span></div>
|
||||
<div class="pa-meta-i"><label>出卖方</label><span>{{ current.supplier || '—' }}</span></div>
|
||||
<div class="pa-meta-i"><label>采购日期</label><span>{{ current.purchaseDate || '—' }}</span></div>
|
||||
<div class="pa-meta-i"><label>计划重量</label><span>{{ current.planWeight }} T</span></div>
|
||||
<div class="pa-meta-i"><label>要求总重量</label><span>{{ current.planWeight }} T</span></div>
|
||||
<div class="pa-meta-i"><label>审核人</label><span>{{ current.auditor || '—' }}</span></div>
|
||||
<div class="pa-meta-i"><label>审核时间</label><span>{{ current.auditTime || '—' }}</span></div>
|
||||
<div class="pa-meta-i"><label>关联合同</label><span>{{ (current.contractCodes || []).join('、') || '—' }}</span></div>
|
||||
<div class="pa-meta-i"><label>关联销售合同</label><span>{{ (current.contractCodes || []).join('、') || '—' }}</span></div>
|
||||
</div>
|
||||
|
||||
<div class="pa-section">采购明细<span class="pa-section-hint" v-if="current.items && current.items.length">共 {{ current.items.length }} 行</span></div>
|
||||
<div class="pa-section">采购要求<span class="pa-section-hint" v-if="current.items && current.items.length">共 {{ current.items.length }} 项</span></div>
|
||||
<el-table :data="current.items || []" border size="mini" max-height="320" class="pa-table">
|
||||
<el-table-column label="#" type="index" width="40" align="center" />
|
||||
<el-table-column label="产品" prop="productType" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="材质" prop="material" width="100" show-overflow-tooltip />
|
||||
<el-table-column label="牌号" prop="grade" width="90" />
|
||||
<el-table-column label="卷号" prop="coilNo" width="100" show-overflow-tooltip />
|
||||
<el-table-column label="宽度" prop="width" width="90" />
|
||||
<el-table-column label="厚度" prop="thickness" width="90" />
|
||||
<el-table-column label="宽公差" prop="widthTolerance" width="80" />
|
||||
<el-table-column label="厚公差" prop="thicknessTolerance" width="80" />
|
||||
<el-table-column label="重量(T)" prop="weight" width="90" align="right" />
|
||||
<el-table-column label="数量" prop="quantity" width="64" align="right" />
|
||||
<el-table-column label="供货商" prop="supplier" width="100" show-overflow-tooltip />
|
||||
<template slot="empty"><span>无明细</span></template>
|
||||
<el-table-column label="#" type="index" width="44" align="center" />
|
||||
<el-table-column label="规格" prop="spec" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="总重量(T)" prop="weight" min-width="110" align="right" />
|
||||
<el-table-column label="厂商" prop="manufacturer" min-width="180" show-overflow-tooltip />
|
||||
<template slot="empty"><span>无采购要求</span></template>
|
||||
</el-table>
|
||||
|
||||
<div class="pa-section">申请 / 审核意见</div>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="pd-wb">
|
||||
<div class="pd-main">
|
||||
<!-- 左:审核通过的计划 -->
|
||||
<!-- 左:审核通过的采购合同 -->
|
||||
<aside class="pd-col pd-plans">
|
||||
<div class="pd-col-tool">
|
||||
<el-input
|
||||
v-model="queryParams.keyword"
|
||||
size="small"
|
||||
clearable
|
||||
placeholder="搜索计划号 / 合同号 / 供货商"
|
||||
placeholder="搜索合同号 / 出卖方"
|
||||
prefix-icon="el-icon-search"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@clear="handleQuery"
|
||||
@@ -26,14 +26,14 @@
|
||||
<span class="pd-no">{{ p.planNo }}</span>
|
||||
<span class="pd-pct" :class="{ done: Number(p.progress) >= 100 }">{{ (Number(p.progress) || 0).toFixed(0) }}%</span>
|
||||
</div>
|
||||
<div class="pd-li-r2">{{ (p.contractCodes || []).join('、') || '无合同号' }}</div>
|
||||
<div class="pd-li-r2">{{ p.supplier || '—' }}</div>
|
||||
<el-progress :percentage="Number(p.progress) || 0" :stroke-width="4" :show-text="false" :color="progressColor" />
|
||||
<div class="pd-li-r3">
|
||||
<span>{{ p.supplier || '—' }}</span>
|
||||
<span>{{ p.arrivedCount || 0 }}/{{ p.planQty || 0 }} 卷<i v-if="p.planStatus === '1'" class="pd-arch">已齐</i></span>
|
||||
<span>已到 {{ p.arrivedCount || 0 }} · 在途 {{ p.inTransitCount || 0 }}</span>
|
||||
<span v-if="p.planStatus === '1'" class="pd-arch">已到齐</span>
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="!loading && !planList.length" class="pd-empty">暂无审核通过的计划</li>
|
||||
<li v-if="!loading && !planList.length" class="pd-empty">暂无审核通过的合同</li>
|
||||
</ul>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
@@ -50,7 +50,7 @@
|
||||
<section class="pd-col pd-detail">
|
||||
<div v-if="!current.planId" class="pd-placeholder">
|
||||
<i class="el-icon-truck"></i>
|
||||
<p>从左侧选择一条审核通过的计划,上传到货表格按卷号比对</p>
|
||||
<p>从左侧选择一条采购合同</p>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
@@ -75,89 +75,51 @@
|
||||
</div>
|
||||
|
||||
<div class="pd-meta">
|
||||
<div class="pd-meta-i"><label>合同号</label><span>{{ (current.contractCodes || []).join('、') || '—' }}</span></div>
|
||||
<div class="pd-meta-i"><label>供货商</label><span>{{ current.supplier || '—' }}</span></div>
|
||||
<div class="pd-meta-i"><label>已到货 / 要求</label><span>{{ current.arrivedCount || 0 }} / {{ current.planQty || 0 }} 卷 · {{ fmt(current.arrivedWeight) }} / {{ fmt(current.planWeight) }} T</span></div>
|
||||
<div class="pd-meta-i"><label>出卖方</label><span>{{ current.supplier || '—' }}</span></div>
|
||||
<div class="pd-meta-i"><label>关联销售合同</label><span>{{ (current.contractCodes || []).join('、') || '—' }}</span></div>
|
||||
<div class="pd-meta-i"><label>要求总重量</label><span>{{ fmt(current.planWeight) }} T</span></div>
|
||||
<div class="pd-meta-i"><label>已到 / 在途</label><span>{{ current.arrivedCount || 0 }} 卷({{ fmt(current.arrivedWeight) }} T) / {{ current.inTransitCount || 0 }} 卷</span></div>
|
||||
<div class="pd-meta-i wide">
|
||||
<label>到货百分比(按重量)</label>
|
||||
<label>到货进度(按重量)</label>
|
||||
<el-progress
|
||||
:percentage="Number(current.progress) || 0"
|
||||
:stroke-width="14" :text-inside="true" :color="progressColor"
|
||||
:format="p => p.toFixed(1) + '%'"
|
||||
/>
|
||||
</div>
|
||||
<div class="pd-meta-i wide">
|
||||
<label>到货百分比(按卷数)</label>
|
||||
<el-progress
|
||||
:percentage="Number(current.progressQty) || 0"
|
||||
:stroke-width="14" :text-inside="true" color="#3a8a4d"
|
||||
:format="p => p.toFixed(1) + '%'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="pd-tabs">
|
||||
<el-tab-pane name="items">
|
||||
<span slot="label">采购要求(到货 重量{{ (Number(current.progress) || 0).toFixed(0) }}% / 卷数{{ (Number(current.progressQty) || 0).toFixed(0) }}%)</span>
|
||||
<p class="pd-req-tip">采购要求只说明买什么、买多少;到货按上传表格的卷号在钢卷表确认,进度见上方与「到货记录」。</p>
|
||||
<el-tab-pane label="采购要求" name="items">
|
||||
<el-table :data="current.items" border size="mini" max-height="420">
|
||||
<el-table-column label="#" type="index" width="40" align="center" />
|
||||
<el-table-column label="产品" prop="productType" min-width="70" show-overflow-tooltip />
|
||||
<el-table-column label="材质" prop="material" min-width="78" show-overflow-tooltip />
|
||||
<el-table-column label="牌号" prop="grade" min-width="72" />
|
||||
<el-table-column label="宽度" prop="width" min-width="68" />
|
||||
<el-table-column label="厚度" prop="thickness" min-width="68" />
|
||||
<el-table-column label="宽公差" prop="widthTolerance" min-width="70" />
|
||||
<el-table-column label="厚公差" prop="thicknessTolerance" min-width="70" />
|
||||
<el-table-column label="重量(T)" prop="weight" min-width="76" align="right" />
|
||||
<el-table-column label="数量" prop="quantity" min-width="58" align="right" />
|
||||
<el-table-column label="供货商" prop="supplier" min-width="88" show-overflow-tooltip />
|
||||
<template slot="empty"><span>无采购明细</span></template>
|
||||
<el-table-column label="#" type="index" width="44" align="center" />
|
||||
<el-table-column label="规格" prop="spec" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="总重量(T)" prop="weight" min-width="110" align="right" />
|
||||
<el-table-column label="厂商" prop="manufacturer" min-width="180" show-overflow-tooltip />
|
||||
<template slot="empty"><span>无采购要求</span></template>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane name="batches">
|
||||
<span slot="label">到货记录({{ batches.length }} 次上传)</span>
|
||||
<div class="pd-batch-wrap">
|
||||
<el-table
|
||||
:data="batches"
|
||||
border size="mini" max-height="200" v-loading="batchLoading"
|
||||
highlight-current-row @row-click="viewBatch"
|
||||
>
|
||||
<el-table-column label="上传时间" prop="createTime" width="150" align="center" />
|
||||
<el-table-column label="文件" prop="fileName" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="行数" prop="rowCount" width="64" align="center" />
|
||||
<el-table-column label="匹配卷数" prop="matchedCount" width="84" align="center" />
|
||||
<el-table-column label="上传后到货%" width="110" align="center">
|
||||
<template slot-scope="s">{{ (Number(s.row.arrivedPercent) || 0).toFixed(0) }}%</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="录入人" prop="createBy" width="90" align="center" />
|
||||
<el-table-column label="操作" width="64" align="center">
|
||||
<template slot-scope="s"><el-button type="text" size="mini" @click.stop="viewBatch(s.row)">查看</el-button></template>
|
||||
</el-table-column>
|
||||
<template slot="empty"><span>暂无上传记录,点右上角「上传到货表格」</span></template>
|
||||
</el-table>
|
||||
|
||||
<div class="pd-batch-rows" v-if="currentBatch.batchId">
|
||||
<div class="pd-sub-title">「{{ currentBatch.fileName }}」到货明细(卷号在钢卷表确认到货的高亮为已到货)</div>
|
||||
<el-table :data="batchRows" border stripe size="mini" max-height="300" v-loading="batchRowsLoading"
|
||||
:row-class-name="rowClass">
|
||||
<el-table-column label="日期" prop="arrivalDate" width="100" align="center" />
|
||||
<el-table-column label="牌号" prop="grade" width="78" align="center" />
|
||||
<el-table-column label="规格" prop="spec" width="105" align="center" />
|
||||
<el-table-column label="卷号" prop="coilNo" width="120" align="center" />
|
||||
<el-table-column label="单卷(T)" prop="coilWeight" width="78" align="right" />
|
||||
<el-table-column label="车号" prop="truckNo" width="95" align="center" />
|
||||
<el-table-column label="销售" prop="salesCode" width="80" align="center" />
|
||||
<el-table-column label="到货" width="72" align="center">
|
||||
<template slot-scope="s">
|
||||
<span class="pd-mtag" :class="s.row.arrived === 1 ? 'yes' : 'no'">{{ s.row.arrived === 1 ? '已到货' : '未到' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template slot="empty"><span>该批次无明细</span></template>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<el-tab-pane :label="'到货明细(' + deliveryList.length + ')'" name="delivery">
|
||||
<el-table
|
||||
:data="deliveryList" border stripe size="mini" max-height="420"
|
||||
v-loading="deliveryLoading" :row-class-name="rowClass"
|
||||
>
|
||||
<el-table-column label="日期" prop="arrivalDate" width="100" align="center" />
|
||||
<el-table-column label="牌号" prop="grade" width="78" align="center" />
|
||||
<el-table-column label="规格" prop="spec" width="105" align="center" />
|
||||
<el-table-column label="卷号" prop="coilNo" width="120" align="center" />
|
||||
<el-table-column label="单卷(T)" prop="coilWeight" width="78" align="right" />
|
||||
<el-table-column label="车号" prop="truckNo" width="95" align="center" />
|
||||
<el-table-column label="件数" prop="pieceCount" width="56" align="center" />
|
||||
<el-table-column label="销售" prop="salesCode" width="80" align="center" />
|
||||
<el-table-column label="状态" width="76" align="center">
|
||||
<template slot-scope="s">
|
||||
<span class="pd-mtag" :class="statusClass(s.row)">{{ statusText(s.row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template slot="empty"><span>暂无到货记录,点右上角「上传到货表格」</span></template>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -170,8 +132,7 @@
|
||||
import {
|
||||
getPurchasePlan,
|
||||
listDeliveryPlans,
|
||||
listDeliveryBatches,
|
||||
listDeliveryByBatch,
|
||||
listDelivery,
|
||||
refreshArrival
|
||||
} from '@/api/erp/purchasePlan'
|
||||
import { getToken } from '@/utils/auth'
|
||||
@@ -186,11 +147,8 @@ export default {
|
||||
queryParams: { pageNum: 1, pageSize: 20, keyword: undefined },
|
||||
current: {},
|
||||
activeTab: 'items',
|
||||
batches: [],
|
||||
batchLoading: false,
|
||||
currentBatch: {},
|
||||
batchRows: [],
|
||||
batchRowsLoading: false,
|
||||
deliveryList: [],
|
||||
deliveryLoading: false,
|
||||
refreshing: false,
|
||||
upload: { headers: { Authorization: 'Bearer ' + getToken() } },
|
||||
progressColor: '#5b8db8'
|
||||
@@ -224,9 +182,8 @@ export default {
|
||||
selectPlan(p) {
|
||||
this.activeTab = 'items'
|
||||
this.current = { ...p }
|
||||
this.currentBatch = {}
|
||||
this.batchRows = []
|
||||
// 打开即静默复核一次 WMS 到货状态,保证看到的是最新
|
||||
this.deliveryList = []
|
||||
// 打开即静默按钢卷表复核一次到货状态
|
||||
const planId = p.planId
|
||||
refreshArrival(planId).catch(() => {}).finally(() => {
|
||||
if (this.current.planId === planId) this.refreshDetail()
|
||||
@@ -236,7 +193,8 @@ export default {
|
||||
const planId = this.current.planId
|
||||
if (!planId) return
|
||||
getPurchasePlan(planId).then(res => { this.current = { ...this.current, ...(res.data || {}) } })
|
||||
this.loadBatches()
|
||||
this.deliveryLoading = true
|
||||
listDelivery(planId).then(res => { this.deliveryList = res.data || [] }).finally(() => { this.deliveryLoading = false })
|
||||
},
|
||||
doRefreshArrival() {
|
||||
if (!this.current.planId) return
|
||||
@@ -244,23 +202,23 @@ export default {
|
||||
refreshArrival(this.current.planId).then(() => {
|
||||
this.$modal.msgSuccess('已按钢卷表刷新到货状态')
|
||||
this.refreshDetail()
|
||||
if (this.currentBatch.batchId) this.viewBatch(this.currentBatch)
|
||||
this.getList(true)
|
||||
}).finally(() => { this.refreshing = false })
|
||||
},
|
||||
loadBatches() {
|
||||
this.batchLoading = true
|
||||
listDeliveryBatches(this.current.planId).then(res => {
|
||||
this.batches = res.data || []
|
||||
}).finally(() => { this.batchLoading = false })
|
||||
},
|
||||
viewBatch(b) {
|
||||
this.currentBatch = { ...b }
|
||||
this.batchRowsLoading = true
|
||||
listDeliveryByBatch(b.batchId).then(res => { this.batchRows = res.data || [] }).finally(() => { this.batchRowsLoading = false })
|
||||
},
|
||||
rowClass({ row }) {
|
||||
return row.arrived === 1 ? 'pd-row-matched' : ''
|
||||
if (row.arrived === 1) return 'pd-row-arrived'
|
||||
if (row.inTransit === 1) return 'pd-row-transit'
|
||||
return ''
|
||||
},
|
||||
statusText(row) {
|
||||
if (row.arrived === 1) return '已到货'
|
||||
if (row.inTransit === 1) return '在途'
|
||||
return '未到'
|
||||
},
|
||||
statusClass(row) {
|
||||
if (row.arrived === 1) return 'yes'
|
||||
if (row.inTransit === 1) return 'transit'
|
||||
return 'no'
|
||||
},
|
||||
handleUploadSuccess(res) {
|
||||
if (res.code === 200) {
|
||||
@@ -270,7 +228,7 @@ export default {
|
||||
} else {
|
||||
this.$modal.msgSuccess(res.msg || '导入成功')
|
||||
}
|
||||
this.activeTab = 'batches'
|
||||
this.activeTab = 'delivery'
|
||||
this.refreshDetail()
|
||||
this.getList(true)
|
||||
} else {
|
||||
@@ -311,7 +269,7 @@ $sub: #909399;
|
||||
.pd-pct { font-size: 12px; font-weight: 600; color: $sub; &.done { color: #3a8a4d; } }
|
||||
.pd-li-r2 { font-size: 12px; color: $sub; margin: 4px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pd-li-r3 { display: flex; justify-content: space-between; font-size: 11px; color: $sub; margin-top: 4px; }
|
||||
.pd-arch { font-style: normal; color: #3a8a4d; margin-left: 6px; }
|
||||
.pd-arch { font-style: normal; color: #3a8a4d; }
|
||||
.pd-empty { text-align: center; color: $sub; padding: 36px 12px; font-size: 13px; }
|
||||
|
||||
.pd-placeholder {
|
||||
@@ -326,26 +284,20 @@ $sub: #909399;
|
||||
font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 2px; border: 1px solid #dcdfe6; color: $sub; background: #fafafa;
|
||||
&.p1 { color: #3a8a4d; border-color: #b7d9bf; background: #f0f9f1; }
|
||||
}
|
||||
.pd-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 24px; padding: 16px 18px; }
|
||||
.pd-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; padding: 16px 18px; }
|
||||
.pd-meta-i {
|
||||
display: flex; flex-direction: column; font-size: 13px;
|
||||
label { color: $sub; font-size: 12px; margin-bottom: 3px; }
|
||||
span { color: $ink; }
|
||||
&.wide { grid-column: span 3; }
|
||||
&.wide { grid-column: span 2; }
|
||||
}
|
||||
.pd-tabs { padding: 0 18px 18px; }
|
||||
.pd-nocoil { color: #c0c4cc; }
|
||||
.pd-req-tip { font-size: 12px; color: #909399; margin: 0 0 10px; line-height: 1.6; }
|
||||
.pd-istat {
|
||||
font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 2px; border: 1px solid #dcdfe6; color: $sub;
|
||||
&.s2 { color: #3a8a4d; border-color: #b7d9bf; background: #f0f9f1; }
|
||||
}
|
||||
.pd-batch-rows { margin-top: 14px; }
|
||||
.pd-sub-title { font-size: 13px; font-weight: 600; color: $ink; border-left: 3px solid $accent; padding-left: 8px; margin: 6px 0 10px; }
|
||||
.pd-mtag {
|
||||
font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 2px; border: 1px solid #dcdfe6; color: $sub;
|
||||
&.yes { color: #3a8a4d; border-color: #b7d9bf; background: #f0f9f1; }
|
||||
&.transit { color: #d6a256; border-color: #ecd4a6; background: #fdf6ec; }
|
||||
&.no { color: $sub; }
|
||||
}
|
||||
::v-deep .pd-row-matched { background: #f3f9f4; }
|
||||
::v-deep .pd-row-arrived { background: #f3f9f4; }
|
||||
::v-deep .pd-row-transit { background: #fdf9f0; }
|
||||
</style>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<span>{{ (Number(p.progress) || 0).toFixed(0) }}%<i v-if="p.planStatus === '1'" class="pp-arch">已归档</i></span>
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="!loading && !planList.length" class="pp-empty">暂无采购计划</li>
|
||||
<li v-if="!loading && !planList.length" class="pp-empty">暂无采购合同</li>
|
||||
</ul>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
@@ -63,13 +63,13 @@
|
||||
<section class="pp-col pp-detail">
|
||||
<div v-if="mode === 'empty'" class="pp-placeholder">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<p>从左侧选择一条采购计划,或点击「新增」按销售合同创建</p>
|
||||
<p>从左侧选择一条采购合同,或点击「新增」</p>
|
||||
</div>
|
||||
|
||||
<!-- 编辑 / 新增 -->
|
||||
<div v-else-if="mode === 'edit'" class="pp-edit">
|
||||
<div class="pp-d-head">
|
||||
<span class="pp-d-title">{{ form.planId ? '编辑采购计划' : '新增采购计划' }}</span>
|
||||
<span class="pp-d-title">{{ form.planId ? '编辑采购合同' : '新增采购合同' }}</span>
|
||||
<div>
|
||||
<el-button size="small" @click="cancelEdit">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="buttonLoading" @click="submitForm">保存</el-button>
|
||||
@@ -78,12 +78,20 @@
|
||||
<el-form :model="form" :rules="rules" ref="form" label-width="80px" class="pp-form" size="small">
|
||||
<div class="pp-section">基本信息</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划号" prop="planNo">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出卖方" prop="supplier">
|
||||
<div class="pp-inline-pick">
|
||||
<el-input v-model="form.supplier" placeholder="选择供应商" />
|
||||
<el-button icon="el-icon-search" @click="openSupplierPicker">选择</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同号" prop="planNo">
|
||||
<el-input v-model="form.planNo" placeholder="留空自动生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购日期" prop="purchaseDate">
|
||||
<el-date-picker v-model="form.purchaseDate" type="date" value-format="yyyy-MM-dd" style="width:100%" placeholder="选择日期" />
|
||||
</el-form-item>
|
||||
@@ -110,42 +118,28 @@
|
||||
</div>
|
||||
|
||||
<div class="pp-section">
|
||||
采购明细
|
||||
采购要求
|
||||
<el-button type="text" size="mini" icon="el-icon-plus" class="pp-section-act" @click="addItem">加行</el-button>
|
||||
<el-button type="text" size="mini" icon="el-icon-magic-stick" class="pp-section-act" @click="openBatchFill">批量填充</el-button>
|
||||
<span class="pp-section-hint" v-if="form.items.length">共 {{ form.items.length }} 行 · 计 {{ itemsWeight }} T</span>
|
||||
<span class="pp-section-hint" v-if="form.items.length">共 {{ form.items.length }} 项 · 计 {{ itemsWeight }} T</span>
|
||||
</div>
|
||||
<el-table :data="form.items" border size="mini" max-height="300">
|
||||
<el-table-column label="#" type="index" width="40" align="center" />
|
||||
<el-table-column label="产品" min-width="70">
|
||||
<template slot-scope="s"><el-input v-model="s.row.productType" size="mini" placeholder="热轧卷板" /></template>
|
||||
<el-table :data="form.items" border size="mini" max-height="340">
|
||||
<el-table-column label="#" type="index" width="44" align="center" />
|
||||
<el-table-column label="规格" min-width="220">
|
||||
<template slot-scope="s"><el-input v-model="s.row.spec" size="mini" placeholder="如 3.00×1230" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材质" min-width="80">
|
||||
<template slot-scope="s"><el-input v-model="s.row.material" size="mini" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="牌号" min-width="75">
|
||||
<template slot-scope="s"><el-input v-model="s.row.grade" size="mini" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度" min-width="75">
|
||||
<template slot-scope="s"><el-input v-model="s.row.width" size="mini" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="厚度" min-width="75">
|
||||
<template slot-scope="s"><el-input v-model="s.row.thickness" size="mini" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽公差" min-width="75">
|
||||
<template slot-scope="s"><el-input v-model="s.row.widthTolerance" size="mini" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="厚公差" min-width="75">
|
||||
<template slot-scope="s"><el-input v-model="s.row.thicknessTolerance" size="mini" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重量(T)" min-width="80">
|
||||
<el-table-column label="总重量(T)" min-width="120">
|
||||
<template slot-scope="s"><el-input v-model="s.row.weight" size="mini" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" min-width="65">
|
||||
<template slot-scope="s"><el-input v-model="s.row.quantity" size="mini" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供货商" min-width="90">
|
||||
<template slot-scope="s"><el-input v-model="s.row.supplier" size="mini" /></template>
|
||||
<el-table-column label="厂商" min-width="200">
|
||||
<template slot-scope="s">
|
||||
<el-autocomplete
|
||||
v-model="s.row.manufacturer"
|
||||
:fetch-suggestions="queryManufacturer"
|
||||
size="mini"
|
||||
placeholder="手填厂商"
|
||||
style="width:100%"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="64" align="center" fixed="right">
|
||||
<template slot-scope="s">
|
||||
@@ -153,7 +147,7 @@
|
||||
<i class="el-icon-delete pp-del" title="删除" @click="removeItem(s.$index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template slot="empty"><span>点「加行」添加,或在上方选择销售合同载入明细</span></template>
|
||||
<template slot="empty"><span>点「加行」添加采购要求</span></template>
|
||||
</el-table>
|
||||
|
||||
<el-form-item label="备注" prop="remark" style="margin-top:14px">
|
||||
@@ -183,10 +177,10 @@
|
||||
</div>
|
||||
|
||||
<div class="pp-meta">
|
||||
<div class="pp-meta-i"><label>供货商</label><span>{{ current.supplier || '—' }}</span></div>
|
||||
<div class="pp-meta-i"><label>出卖方</label><span>{{ current.supplier || '—' }}</span></div>
|
||||
<div class="pp-meta-i"><label>采购日期</label><span>{{ current.purchaseDate || '—' }}</span></div>
|
||||
<div class="pp-meta-i"><label>关联合同</label><span>{{ (current.contractCodes || []).join('、') || '—' }}</span></div>
|
||||
<div class="pp-meta-i"><label>计划重量</label><span>{{ current.planWeight }} T</span></div>
|
||||
<div class="pp-meta-i"><label>关联销售合同</label><span>{{ (current.contractCodes || []).join('、') || '—' }}</span></div>
|
||||
<div class="pp-meta-i"><label>要求总重量</label><span>{{ current.planWeight }} T</span></div>
|
||||
<div class="pp-meta-i"><label>已到货</label><span>{{ current.arrivedWeight }} T</span></div>
|
||||
<div class="pp-meta-i wide">
|
||||
<label>到货进度</label>
|
||||
@@ -215,22 +209,14 @@
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="pp-tabs">
|
||||
<el-tab-pane label="采购明细" name="items">
|
||||
<el-tab-pane label="采购要求" name="items">
|
||||
<el-table :data="current.items" border size="mini" max-height="340">
|
||||
<el-table-column label="#" type="index" width="40" align="center" />
|
||||
<el-table-column label="产品" prop="productType" min-width="70" show-overflow-tooltip />
|
||||
<el-table-column label="材质" prop="material" min-width="80" show-overflow-tooltip />
|
||||
<el-table-column label="牌号" prop="grade" min-width="75" />
|
||||
<el-table-column label="宽度" prop="width" min-width="70" />
|
||||
<el-table-column label="厚度" prop="thickness" min-width="70" />
|
||||
<el-table-column label="宽公差" prop="widthTolerance" min-width="72" />
|
||||
<el-table-column label="厚公差" prop="thicknessTolerance" min-width="72" />
|
||||
<el-table-column label="重量(T)" prop="weight" min-width="78" align="right" />
|
||||
<el-table-column label="数量" prop="quantity" min-width="60" align="right" />
|
||||
<el-table-column label="供货商" prop="supplier" min-width="90" show-overflow-tooltip />
|
||||
<template slot="empty"><span>无明细</span></template>
|
||||
<el-table-column label="#" type="index" width="44" align="center" />
|
||||
<el-table-column label="规格" prop="spec" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="总重量(T)" prop="weight" min-width="110" align="right" />
|
||||
<el-table-column label="厂商" prop="manufacturer" min-width="180" show-overflow-tooltip />
|
||||
<template slot="empty"><span>无采购要求</span></template>
|
||||
</el-table>
|
||||
<p class="pp-deliv-hint" v-if="current.auditStatus === '1'">到货上传与卷号比对请到「到货记录」页面</p>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -321,38 +307,6 @@
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 批量填充明细:设一次,一键填满所有行(留空不覆盖) -->
|
||||
<el-dialog title="批量填充明细" :visible.sync="batchFillOpen" width="560px" append-to-body>
|
||||
<p class="pp-batch-tip">下面填了值的字段会写入<b>全部明细行</b>,留空的不覆盖。常用于整批同产品/材质/规格。</p>
|
||||
<el-form :model="batchFill" label-width="72px" size="small">
|
||||
<el-row :gutter="14">
|
||||
<el-col :span="12"><el-form-item label="产品"><el-input v-model="batchFill.productType" placeholder="如 热轧卷板" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="材质"><el-input v-model="batchFill.material" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="牌号"><el-input v-model="batchFill.grade" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="宽度"><el-input v-model="batchFill.width" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="厚度"><el-input v-model="batchFill.thickness" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="宽公差"><el-input v-model="batchFill.widthTolerance" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="厚公差"><el-input v-model="batchFill.thicknessTolerance" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="重量(T)"><el-input v-model="batchFill.weight" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="数量"><el-input v-model="batchFill.quantity" /></el-form-item></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供货商">
|
||||
<div class="pp-inline-pick">
|
||||
<el-input v-model="batchFill.supplier" placeholder="选择或输入" />
|
||||
<el-button icon="el-icon-search" @click="openSupplierPicker">选择</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="pp-batch-footer">
|
||||
<el-checkbox v-model="batchFillNewRow">设为「加行」默认值</el-checkbox>
|
||||
<span class="pp-batch-gen">生成 <el-input v-model="batchRows" size="mini" style="width:64px" /> 行</span>
|
||||
<el-button @click="batchFillOpen = false">取消</el-button>
|
||||
<el-button @click="applyBatchFill">应用到现有行</el-button>
|
||||
<el-button type="primary" @click="generateRows">生成行并填充</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -361,12 +315,12 @@ import {
|
||||
listPurchasePlan,
|
||||
purchasePlanStatistics,
|
||||
getPurchasePlan,
|
||||
getItemsByOrders,
|
||||
addPurchasePlan,
|
||||
updatePurchasePlan,
|
||||
delPurchasePlan,
|
||||
submitPurchasePlan,
|
||||
listContracts
|
||||
listContracts,
|
||||
listManufacturers
|
||||
} from '@/api/erp/purchasePlan'
|
||||
import { listSupplier } from '@/api/erp/purchase'
|
||||
|
||||
@@ -383,16 +337,12 @@ export default {
|
||||
current: {},
|
||||
activeTab: 'items',
|
||||
form: {},
|
||||
rules: {},
|
||||
rules: {
|
||||
supplier: [{ required: true, message: '请选择出卖方', trigger: 'change' }]
|
||||
},
|
||||
buttonLoading: false,
|
||||
submitLoading: false,
|
||||
selectedContracts: [],
|
||||
// 批量填充
|
||||
batchFillOpen: false,
|
||||
batchFillNewRow: true,
|
||||
batchRows: 0,
|
||||
batchFill: { productType: '热轧卷板', material: '', grade: '', width: '', thickness: '', widthTolerance: '', thicknessTolerance: '', weight: '', quantity: '', supplier: '' },
|
||||
newRowDefaults: null,
|
||||
// 合同选择器
|
||||
pickerOpen: false,
|
||||
pickerLoading: false,
|
||||
@@ -450,9 +400,6 @@ export default {
|
||||
resetForm() {
|
||||
this.form = { planId: null, planNo: '', supplier: '', purchaseDate: '', remark: '', items: [], orderIds: [], contractCodes: [] }
|
||||
this.selectedContracts = []
|
||||
this.newRowDefaults = null
|
||||
this.batchFill = { productType: '热轧卷板', material: '', grade: '', width: '', thickness: '', widthTolerance: '', thicknessTolerance: '', weight: '', quantity: '', supplier: '' }
|
||||
this.batchRows = 0
|
||||
},
|
||||
handleAdd() {
|
||||
this.resetForm()
|
||||
@@ -514,12 +461,10 @@ export default {
|
||||
this.form.orderIds = this.pickerSelection.map(c => c.orderId)
|
||||
this.form.contractCodes = []
|
||||
this.pickerOpen = false
|
||||
this.deriveItems(this.form.orderIds)
|
||||
},
|
||||
removeContract(orderId) {
|
||||
this.selectedContracts = this.selectedContracts.filter(c => c.orderId !== orderId)
|
||||
this.form.orderIds = this.form.orderIds.filter(id => id !== orderId)
|
||||
this.deriveItems(this.form.orderIds)
|
||||
},
|
||||
// ---- 供应商选择器 ----
|
||||
openSupplierPicker() {
|
||||
@@ -540,39 +485,23 @@ export default {
|
||||
})
|
||||
},
|
||||
chooseSupplier(row) {
|
||||
// 供应商选择器服务于「批量填充」对话框
|
||||
this.batchFill.supplier = row.name
|
||||
// 出卖方 = 供应商
|
||||
this.form.supplier = row.name
|
||||
this.supplierPickerOpen = false
|
||||
},
|
||||
deriveItems(orderIds) {
|
||||
if (!orderIds || !orderIds.length) { this.form.items = []; return }
|
||||
getItemsByOrders(orderIds).then(res => {
|
||||
this.form.items = (res.data || []).map(it => ({
|
||||
productType: it.productType || '热轧卷板',
|
||||
material: it.material || '',
|
||||
grade: it.grade || '',
|
||||
width: it.width || '',
|
||||
thickness: it.thickness || '',
|
||||
widthTolerance: it.widthTolerance || '0',
|
||||
thicknessTolerance: it.thicknessTolerance || '0',
|
||||
weight: it.weight,
|
||||
quantity: it.quantity,
|
||||
supplier: this.form.supplier || ''
|
||||
}))
|
||||
this.$modal.msgSuccess(`已载入 ${this.form.items.length} 条明细,可继续编辑`)
|
||||
})
|
||||
queryManufacturer(queryString, cb) {
|
||||
listManufacturers(queryString).then(res => {
|
||||
cb((res.data || []).map(v => ({ value: v })))
|
||||
}).catch(() => cb([]))
|
||||
},
|
||||
blankItem() {
|
||||
return { productType: '热轧卷板', material: '', grade: '', width: '', thickness: '', widthTolerance: '0', thicknessTolerance: '0', weight: '', quantity: '', supplier: '' }
|
||||
return { spec: '', weight: '', manufacturer: '' }
|
||||
},
|
||||
addItem() {
|
||||
// 优先用批量默认值,其次继承上一行,最后空行;重量每行不同故清空
|
||||
// 新行继承上一行的厂商(同批多为同厂),规格/重量留空
|
||||
const last = this.form.items[this.form.items.length - 1]
|
||||
let row
|
||||
if (this.newRowDefaults) row = { ...this.newRowDefaults }
|
||||
else if (last) row = { ...last }
|
||||
else row = this.blankItem()
|
||||
row.weight = ''
|
||||
const row = this.blankItem()
|
||||
if (last) row.manufacturer = last.manufacturer || ''
|
||||
this.form.items.push(row)
|
||||
},
|
||||
copyItem(index) {
|
||||
@@ -581,50 +510,10 @@ export default {
|
||||
removeItem(index) {
|
||||
this.form.items.splice(index, 1)
|
||||
},
|
||||
openBatchFill() {
|
||||
this.batchFillOpen = true
|
||||
},
|
||||
batchFillKeys() {
|
||||
const f = this.batchFill
|
||||
const keys = ['productType', 'material', 'grade', 'width', 'thickness', 'widthTolerance', 'thicknessTolerance', 'weight', 'quantity', 'supplier']
|
||||
return keys.filter(k => f[k] !== '' && f[k] != null)
|
||||
},
|
||||
applyBatchFill() {
|
||||
const f = this.batchFill
|
||||
const filled = this.batchFillKeys()
|
||||
if (!filled.length) { this.$modal.msgWarning('请至少填写一个要填充的字段'); return }
|
||||
if (!this.form.items.length) { this.$modal.msgWarning('当前没有明细行,请用右侧「生成行并填充」'); return }
|
||||
this.form.items.forEach(it => { filled.forEach(k => { it[k] = f[k] }) })
|
||||
if (f.supplier) this.form.supplier = f.supplier
|
||||
this.saveNewRowDefaults(filled)
|
||||
this.batchFillOpen = false
|
||||
this.$modal.msgSuccess(`已填充 ${this.form.items.length} 行`)
|
||||
},
|
||||
generateRows() {
|
||||
const n = parseInt(this.batchRows, 10) || 0
|
||||
if (n <= 0) { this.$modal.msgWarning('请填写要生成的行数'); return }
|
||||
const f = this.batchFill
|
||||
const filled = this.batchFillKeys()
|
||||
for (let i = 0; i < n; i++) {
|
||||
const row = this.blankItem()
|
||||
filled.forEach(k => { row[k] = f[k] })
|
||||
this.form.items.push(row)
|
||||
}
|
||||
if (f.supplier) this.form.supplier = f.supplier
|
||||
this.saveNewRowDefaults(filled)
|
||||
this.batchFillOpen = false
|
||||
this.$modal.msgSuccess(`已生成 ${n} 行`)
|
||||
},
|
||||
saveNewRowDefaults(filled) {
|
||||
if (!this.batchFillNewRow) return
|
||||
const def = this.blankItem()
|
||||
filled.forEach(k => { def[k] = this.batchFill[k] })
|
||||
this.newRowDefaults = def
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (!valid) return
|
||||
if (!this.form.orderIds.length) { this.$modal.msgWarning('请先选择销售合同'); return }
|
||||
if (!this.form.items.length) { this.$modal.msgWarning('请至少添加一条采购要求'); return }
|
||||
this.buttonLoading = true
|
||||
const api = this.form.planId ? updatePurchasePlan : addPurchasePlan
|
||||
const editedId = this.form.planId
|
||||
@@ -644,7 +533,7 @@ export default {
|
||||
})
|
||||
},
|
||||
submitForAudit() {
|
||||
const tip = this.current.auditStatus === '2' ? '确认重新送审该计划?将再次进入审核' : '确认送审该计划?送审后将出现在采购审核页'
|
||||
const tip = this.current.auditStatus === '2' ? '确认重新送审该合同?将再次进入审核' : '确认送审该合同?送审后将出现在采购审核页'
|
||||
this.$modal.confirm(tip).then(() => {
|
||||
this.submitLoading = true
|
||||
return submitPurchasePlan(this.current.planId)
|
||||
@@ -655,7 +544,7 @@ export default {
|
||||
}).catch(() => {}).finally(() => { this.submitLoading = false })
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('确认删除采购计划「' + row.planNo + '」?').then(() => {
|
||||
this.$modal.confirm('确认删除采购合同「' + row.planNo + '」?').then(() => {
|
||||
return delPurchasePlan(row.planId)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
@@ -666,9 +555,6 @@ export default {
|
||||
},
|
||||
auditText(s) {
|
||||
return { '0': '待审核', '1': '已通过', '2': '已驳回', '3': '待送审' }[s] || '—'
|
||||
},
|
||||
itemStatusText(s) {
|
||||
return s === '2' ? '已到货' : '未到货'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,11 +96,6 @@
|
||||
|
||||
<!-- ─── 成品厚度偏差 ─── -->
|
||||
<template v-if="hasGauge">
|
||||
<div class="chart-title">
|
||||
成品厚度偏差
|
||||
<span class="chart-subtitle">产出厚度 - {{ rv('EXIT_THICK') }} [mm]</span>
|
||||
</div>
|
||||
<div ref="chartThick1" class="rpt-chart" />
|
||||
<div class="chart-title">末架出口厚度 [mm]</div>
|
||||
<div ref="chartThick4" class="rpt-chart" />
|
||||
</template>
|
||||
@@ -186,15 +181,24 @@ function calcYRange(vals) {
|
||||
return { min: parseFloat((min - pad).toFixed(4)), max: parseFloat((max + pad).toFixed(4)) }
|
||||
}
|
||||
|
||||
function lineOpt(title, xData, series, yName) {
|
||||
const allVals = series.flatMap(s => s.data)
|
||||
const range = calcYRange(allVals)
|
||||
function lineOpt(title, xData, series, yName, decimals, xStep) {
|
||||
const isValueX = xStep != null
|
||||
const yVals = isValueX
|
||||
? series.flatMap(s => s.data.map(d => Array.isArray(d) ? d[1] : d))
|
||||
: series.flatMap(s => s.data)
|
||||
const range = calcYRange(yVals)
|
||||
const tooltipExtra = decimals != null
|
||||
? { valueFormatter: v => v == null ? '—' : Number(v).toFixed(decimals) }
|
||||
: {}
|
||||
const xAxisCfg = isValueX
|
||||
? { type: 'value', name: '带钢长度[m]', min: 0, interval: xStep, nameTextStyle: { fontSize: 9 }, axisLabel: { fontSize: 9 } }
|
||||
: { type: 'category', data: xData, name: '带钢长度[m]', nameTextStyle: { fontSize: 9 }, axisLabel: { fontSize: 9, interval: 'auto' } }
|
||||
return {
|
||||
title: { text: title, textStyle: { fontSize: 12, fontWeight: 'normal', color: '#1a365d' }, top: 4, left: 8 },
|
||||
legend: { top: 4, right: 6, textStyle: { fontSize: 9 }, itemWidth: 12, itemHeight: 8 },
|
||||
tooltip: { trigger: 'axis', confine: true },
|
||||
tooltip: { trigger: 'axis', confine: true, ...tooltipExtra },
|
||||
grid: { top: 38, bottom: 28, left: 10, right: 10, containLabel: true },
|
||||
xAxis: { type: 'category', data: xData, name: '带钢长度[m]', nameTextStyle: { fontSize: 9 }, axisLabel: { fontSize: 9, interval: 'auto' } },
|
||||
xAxis: xAxisCfg,
|
||||
yAxis: { type: 'value', name: yName, nameTextStyle: { fontSize: 9 }, axisLabel: { fontSize: 9 }, min: range.min, max: range.max },
|
||||
series: series.map((s, i) => ({
|
||||
name: s.name, type: 'line', smooth: false, symbol: 'none',
|
||||
@@ -386,39 +390,21 @@ export default {
|
||||
const posLim = parseFloat(getV(this.row, 'EXIT_POS_DEV')) || 0.03
|
||||
const negLim = Math.abs(parseFloat(getV(this.row, 'EXIT_NEG_DEV'))) || 0.03
|
||||
|
||||
// THICK1 偏差图 (1架出口 vs 目标)
|
||||
const t1 = colData(rows, 'THICK1')
|
||||
const t1Ref = colData(rows, 'THICK1REF')
|
||||
if (t1.some(v => v != null)) {
|
||||
const c = this.initChart('chartThick1', 180)
|
||||
if (c) {
|
||||
const series = [{ name: '1架出口厚度', data: t1, color: PALETTE[0] }]
|
||||
if (t1Ref.some(v => v != null)) series.push({ name: '目标', data: t1Ref, color: '#909399', dash: true })
|
||||
if (target) {
|
||||
const up = rows.map(() => parseFloat((target + posLim).toFixed(4)))
|
||||
const lo = rows.map(() => parseFloat((target - negLim).toFixed(4)))
|
||||
series.push({ name: '上限', data: up, color: '#F56C6C', dash: true })
|
||||
series.push({ name: '下限', data: lo, color: '#67C23A', dash: true })
|
||||
}
|
||||
c.setOption(lineOpt('1架出口厚度 [mm]', x, series, 'mm'))
|
||||
}
|
||||
}
|
||||
|
||||
// THICK5 末架出口
|
||||
// THICK5 末架出口(value 轴,横坐标步长 500)
|
||||
const xNum = rows.map(r => { const v = getRowVal(r, 'XLOCATION'); return v == null ? null : parseFloat(v) })
|
||||
const t4 = colData(rows, 'THICK5')
|
||||
const t4Ref = colData(rows, 'THICK5REF')
|
||||
const t4Pairs = t4.map((y, i) => [xNum[i], y])
|
||||
if (t4.some(v => v != null)) {
|
||||
const c = this.initChart('chartThick4', 180)
|
||||
if (c) {
|
||||
const series = [{ name: '末架出口厚度', data: t4, color: PALETTE[0] }]
|
||||
if (t4Ref.some(v => v != null)) series.push({ name: '目标', data: t4Ref, color: '#909399', dash: true })
|
||||
const series = [{ name: '末架出口厚度', data: t4Pairs, color: PALETTE[0] }]
|
||||
if (target) {
|
||||
const up = rows.map(() => parseFloat((target + posLim).toFixed(4)))
|
||||
const lo = rows.map(() => parseFloat((target - negLim).toFixed(4)))
|
||||
series.push({ name: '上限', data: up, color: '#F56C6C', dash: true })
|
||||
series.push({ name: '下限', data: lo, color: '#67C23A', dash: true })
|
||||
const upPairs = t4Pairs.map(([xi]) => [xi, parseFloat((target + posLim).toFixed(4))])
|
||||
const loPairs = t4Pairs.map(([xi]) => [xi, parseFloat((target - negLim).toFixed(4))])
|
||||
series.push({ name: '上限', data: upPairs, color: '#F56C6C', dash: true })
|
||||
series.push({ name: '下限', data: loPairs, color: '#67C23A', dash: true })
|
||||
}
|
||||
c.setOption(lineOpt('末架出口厚度 [mm]', x, series, 'mm'))
|
||||
c.setOption(lineOpt('末架出口厚度 [mm]', null, series, 'mm', 3, 500))
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user