排产模块优化 / 排产单页面优化,排产模块优化 / 订单跟踪页面优化
This commit is contained in:
@@ -44,21 +44,29 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="aps-sch-item-actions">
|
||||
<el-button type="text" size="small" style="color:#52c41a;" @click.stop="handleAccept(sch)">接收</el-button>
|
||||
<el-button type="text" size="small" style="color:#ff4d4f;" @click.stop="handleReject(sch)">驳回</el-button>
|
||||
<el-button type="text" size="mini" style="color:#52c41a;" @click.stop="handleAccept(sch)">接收</el-button>
|
||||
<el-button type="text" size="mini" style="color:#ff4d4f;" @click.stop="handleReject(sch)">驳回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 产需单完整信息表 -->
|
||||
<table class="req-info-table">
|
||||
<colgroup>
|
||||
<col style="width: 88px;">
|
||||
<col>
|
||||
<col style="width: 88px;">
|
||||
<col>
|
||||
<col style="width: 88px;">
|
||||
<col>
|
||||
<col style="width: 88px;">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="req-td-label">排产单号</td>
|
||||
<td class="req-td-value">{{ sch.scheduleNo }}</td>
|
||||
<td class="req-td-label">生产日期</td>
|
||||
<td class="req-td-value">{{ sch.prodDate }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">排产状态</td>
|
||||
<td class="req-td-value">
|
||||
<span class="aps-status-tag" :class="'status-' + (sch.scheduleStatus || 1)">{{ statusMap[sch.scheduleStatus] || '未知' }}</span>
|
||||
@@ -67,28 +75,20 @@
|
||||
<td class="req-td-value">{{ sch.businessUser }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">联系电话</td>
|
||||
<td class="req-td-value">{{ sch.businessPhone }}</td>
|
||||
<td class="req-td-label">订货单位</td>
|
||||
<td class="req-td-value">{{ sch.customerName }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">联系电话</td>
|
||||
<td class="req-td-value">{{ sch.businessPhone }}</td>
|
||||
<td class="req-td-label">交货期(天)</td>
|
||||
<td class="req-td-value">{{ sch.deliveryCycle }}</td>
|
||||
<td class="req-td-label">产品用途</td>
|
||||
<td class="req-td-value">{{ sch.usePurpose }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">品名</td>
|
||||
<td class="req-td-value" colspan="3">{{ sch.productType }}</td>
|
||||
<td class="req-td-value">{{ sch.productType }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">厚度公差</td>
|
||||
<td class="req-td-value">{{ sch.thicknessTolerance }}</td>
|
||||
<td class="req-td-label">宽度公差</td>
|
||||
<td class="req-td-value">{{ sch.widthTolerance }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">表面质量</td>
|
||||
<td class="req-td-value">{{ sch.surfaceQuality }}</td>
|
||||
<td class="req-td-label">表面处理</td>
|
||||
@@ -99,8 +99,6 @@
|
||||
<td class="req-td-value">{{ sch.innerDiameter }}</td>
|
||||
<td class="req-td-label">外径要求</td>
|
||||
<td class="req-td-value">{{ sch.outerDiameter }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">包装要求</td>
|
||||
<td class="req-td-value">{{ sch.packReq }}</td>
|
||||
<td class="req-td-label">切边要求</td>
|
||||
@@ -111,22 +109,24 @@
|
||||
<td class="req-td-value">{{ sch.singleCoilWeight }}</td>
|
||||
<td class="req-td-label">交货重量偏差</td>
|
||||
<td class="req-td-value">{{ sch.weightDeviation }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">其他技术要求</td>
|
||||
<td class="req-td-value" colspan="3">{{ sch.otherTechReq }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">付款情况说明</td>
|
||||
<td class="req-td-value" colspan="3">{{ sch.paymentDesc }}</td>
|
||||
<td class="req-td-label">产品用途</td>
|
||||
<td class="req-td-value" colspan="3">{{ sch.usePurpose || '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">备注</td>
|
||||
<td class="req-td-value" colspan="3">{{ sch.remark }}</td>
|
||||
<td class="req-td-value" colspan="7">{{ sch.remark || '-' }}</td>
|
||||
</tr>
|
||||
<tr v-if="sch.otherTechReq">
|
||||
<td class="req-td-label">其他技术要求</td>
|
||||
<td class="req-td-value" colspan="7">{{ sch.otherTechReq }}</td>
|
||||
</tr>
|
||||
<tr v-if="sch.paymentDesc">
|
||||
<td class="req-td-label">付款情况说明</td>
|
||||
<td class="req-td-value" colspan="7">{{ sch.paymentDesc }}</td>
|
||||
</tr>
|
||||
<tr v-if="sch.returnReason">
|
||||
<td class="req-td-label" style="color:#e74c3c;">驳回原因</td>
|
||||
<td class="req-td-value" colspan="3" style="color:#e74c3c;background:#fdecea;">{{ sch.returnReason }}</td>
|
||||
<td class="req-td-value" colspan="7" style="color:#e74c3c;background:#fdecea;">{{ sch.returnReason }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -156,7 +156,7 @@
|
||||
<div v-else class="aps-sch-item-empty">暂无明细</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="!loading" style="padding:40px;text-align:center;color:#909399;">
|
||||
<div v-else-if="!loading" style="padding:24px;text-align:center;color:#909399;">
|
||||
{{ hasQueried ? '该日期暂无待审核产需单' : '请选择日期查询' }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -184,53 +184,78 @@
|
||||
</div>
|
||||
|
||||
<table class="req-info-table">
|
||||
<colgroup>
|
||||
<col style="width: 88px;">
|
||||
<col>
|
||||
<col style="width: 88px;">
|
||||
<col>
|
||||
<col style="width: 88px;">
|
||||
<col>
|
||||
<col style="width: 88px;">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="req-td-label">排产单号</td><td class="req-td-value">{{ sch.scheduleNo }}</td>
|
||||
<td class="req-td-label">生产日期</td><td class="req-td-value">{{ sch.prodDate }}</td>
|
||||
<td class="req-td-label">排产单号</td>
|
||||
<td class="req-td-value">{{ sch.scheduleNo }}</td>
|
||||
<td class="req-td-label">生产日期</td>
|
||||
<td class="req-td-value">{{ sch.prodDate }}</td>
|
||||
<td class="req-td-label">排产状态</td>
|
||||
<td class="req-td-value">
|
||||
<span class="aps-status-tag status-2">已接收</span>
|
||||
</td>
|
||||
<td class="req-td-label">业务员</td>
|
||||
<td class="req-td-value">{{ sch.businessUser }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">业务员</td><td class="req-td-value">{{ sch.businessUser }}</td>
|
||||
<td class="req-td-label">联系电话</td><td class="req-td-value">{{ sch.businessPhone }}</td>
|
||||
<td class="req-td-label">订货单位</td>
|
||||
<td class="req-td-value">{{ sch.customerName }}</td>
|
||||
<td class="req-td-label">联系电话</td>
|
||||
<td class="req-td-value">{{ sch.businessPhone }}</td>
|
||||
<td class="req-td-label">交货期(天)</td>
|
||||
<td class="req-td-value">{{ sch.deliveryCycle }}</td>
|
||||
<td class="req-td-label">品名</td>
|
||||
<td class="req-td-value">{{ sch.productType }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">订货单位</td><td class="req-td-value">{{ sch.customerName }}</td>
|
||||
<td class="req-td-label">交货期(天)</td><td class="req-td-value">{{ sch.deliveryCycle }}</td>
|
||||
<td class="req-td-label">厚度公差</td>
|
||||
<td class="req-td-value">{{ sch.thicknessTolerance }}</td>
|
||||
<td class="req-td-label">宽度公差</td>
|
||||
<td class="req-td-value">{{ sch.widthTolerance }}</td>
|
||||
<td class="req-td-label">表面质量</td>
|
||||
<td class="req-td-value">{{ sch.surfaceQuality }}</td>
|
||||
<td class="req-td-label">表面处理</td>
|
||||
<td class="req-td-value">{{ sch.surfaceTreatment }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">品名</td><td class="req-td-value" colspan="3">{{ sch.productType }}</td>
|
||||
<td class="req-td-label">内径尺寸</td>
|
||||
<td class="req-td-value">{{ sch.innerDiameter }}</td>
|
||||
<td class="req-td-label">外径要求</td>
|
||||
<td class="req-td-value">{{ sch.outerDiameter }}</td>
|
||||
<td class="req-td-label">包装要求</td>
|
||||
<td class="req-td-value">{{ sch.packReq }}</td>
|
||||
<td class="req-td-label">切边要求</td>
|
||||
<td class="req-td-value">{{ sch.cutEdgeReq }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">产品用途</td><td class="req-td-value" colspan="3">{{ sch.usePurpose }}</td>
|
||||
<td class="req-td-label">单件重量</td>
|
||||
<td class="req-td-value">{{ sch.singleCoilWeight }}</td>
|
||||
<td class="req-td-label">交货重量偏差</td>
|
||||
<td class="req-td-value">{{ sch.weightDeviation }}</td>
|
||||
<td class="req-td-label">产品用途</td>
|
||||
<td class="req-td-value" colspan="3">{{ sch.usePurpose || '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">厚度公差</td><td class="req-td-value">{{ sch.thicknessTolerance }}</td>
|
||||
<td class="req-td-label">宽度公差</td><td class="req-td-value">{{ sch.widthTolerance }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">表面质量</td><td class="req-td-value">{{ sch.surfaceQuality }}</td>
|
||||
<td class="req-td-label">表面处理</td><td class="req-td-value">{{ sch.surfaceTreatment }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">内径尺寸</td><td class="req-td-value">{{ sch.innerDiameter }}</td>
|
||||
<td class="req-td-label">外径要求</td><td class="req-td-value">{{ sch.outerDiameter }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">包装要求</td><td class="req-td-value">{{ sch.packReq }}</td>
|
||||
<td class="req-td-label">切边要求</td><td class="req-td-value">{{ sch.cutEdgeReq }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="req-td-label">单件重量</td><td class="req-td-value">{{ sch.singleCoilWeight }}</td>
|
||||
<td class="req-td-label">交货重量偏差</td><td class="req-td-value">{{ sch.weightDeviation }}</td>
|
||||
<td class="req-td-label">备注</td>
|
||||
<td class="req-td-value" colspan="7">{{ sch.remark || '-' }}</td>
|
||||
</tr>
|
||||
<tr v-if="sch.otherTechReq">
|
||||
<td class="req-td-label">其他技术要求</td><td class="req-td-value" colspan="3">{{ sch.otherTechReq }}</td>
|
||||
<td class="req-td-label">其他技术要求</td>
|
||||
<td class="req-td-value" colspan="7">{{ sch.otherTechReq }}</td>
|
||||
</tr>
|
||||
<tr v-if="sch.paymentDesc">
|
||||
<td class="req-td-label">付款情况说明</td><td class="req-td-value" colspan="3">{{ sch.paymentDesc }}</td>
|
||||
</tr>
|
||||
<tr v-if="sch.remark">
|
||||
<td class="req-td-label">备注</td><td class="req-td-value" colspan="3">{{ sch.remark }}</td>
|
||||
<td class="req-td-label">付款情况说明</td>
|
||||
<td class="req-td-value" colspan="7">{{ sch.paymentDesc }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -254,7 +279,7 @@
|
||||
<div v-else class="aps-sch-item-empty">暂无明细</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="!acceptedLoading" style="padding:40px;text-align:center;color:#909399;">
|
||||
<div v-else-if="!acceptedLoading" style="padding:24px;text-align:center;color:#909399;">
|
||||
{{ hasQueried ? '该日期暂无已接收产需单' : '请选择日期查询' }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -284,64 +309,66 @@
|
||||
{{ tab }}
|
||||
<span class="aps-step-tab-count">{{ scheduledItemList.filter(i => normalizeStepName(i.stepName) === tab).length }}</span>
|
||||
</span>
|
||||
<div class="aps-step-tabs-right">
|
||||
<el-button size="mini" class="aps-btn-red" :disabled="!scheduledSortDirty" :loading="saveSortLoading" @click="handleSaveScheduledSort">保存排序</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
ref="scheduledTable"
|
||||
:data="currentStepItems"
|
||||
border
|
||||
size="small"
|
||||
class="aps-table"
|
||||
>
|
||||
<el-table-column label="排产单号" prop="scheduleNo" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="生产日期" prop="prodDate" width="110" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="工序步骤" prop="stepName" width="120" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="排产状态" width="115" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.scheduleStatus"
|
||||
size="mini"
|
||||
:loading="scope.row._statusLoading"
|
||||
@change="val => handleInlineStatusChange(scope.row, val)"
|
||||
@click.stop.native
|
||||
>
|
||||
<el-option v-for="(label, val) in statusMap" :key="val" :label="label" :value="Number(val)" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" prop="spec" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="材质" prop="material" width="90" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="排产吨数" prop="scheduleWeight" width="100" align="right" show-overflow-tooltip />
|
||||
<el-table-column label="品名项" prop="productItem" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="品名" prop="productType" min-width="90" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="订货单位" prop="customerName" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="业务员" prop="businessUser" width="90" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="联系电话" prop="businessPhone" width="110" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="交货期(天)" prop="deliveryCycle" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="产品用途" prop="usePurpose" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="厚度公差" prop="thicknessTolerance" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="宽度公差" prop="widthTolerance" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="表面质量" prop="surfaceQuality" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="表面处理" prop="surfaceTreatment" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="内径尺寸" prop="innerDiameter" width="90" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="外径要求" prop="outerDiameter" width="90" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="包装要求" prop="packReq" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="切边要求" prop="cutEdgeReq" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="单件重量" prop="singleCoilWeight" width="90" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="交货重量偏差" prop="weightDeviation" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column label="其他技术要求" prop="otherTechReq" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column label="付款情况说明" prop="paymentDesc" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column label="单行排产备注" prop="rowRemark" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<div style="display:flex; justify-content:center; gap:0;">
|
||||
<el-button type="text" size="small" style="color:#409EFF;padding:0 6px;" @click="handleEditScheduled(scope.row)">编辑</el-button>
|
||||
<el-button type="text" size="small" style="color:#ff4d4f;padding:0 6px;" @click="handleDeleteScheduled(scope.row)">删除</el-button>
|
||||
<div class="aps-scheduled-cards">
|
||||
<draggable v-model="scheduledStepItems" ghost-class="aps-drag-ghost" handle=".aps-drag-handle" @end="handleScheduledDragEnd">
|
||||
<div v-for="row in scheduledStepItems" :key="row.scheduleId" class="aps-scheduled-card">
|
||||
<div class="aps-scheduled-card-header">
|
||||
<div class="aps-scheduled-card-title">
|
||||
<i class="el-icon-rank aps-drag-handle"></i>
|
||||
<span class="aps-scheduled-no">{{ row.scheduleNo }}</span>
|
||||
<span class="aps-scheduled-step">{{ row.stepName }}</span>
|
||||
</div>
|
||||
<div class="aps-scheduled-card-actions">
|
||||
<el-select
|
||||
v-model="row.scheduleStatus"
|
||||
size="mini"
|
||||
:loading="row._statusLoading"
|
||||
@change="val => handleInlineStatusChange(row, val)"
|
||||
@click.stop.native
|
||||
style="width: 110px;"
|
||||
>
|
||||
<el-option v-for="(label, val) in statusMap" :key="val" :label="label" :value="Number(val)" />
|
||||
</el-select>
|
||||
<el-button type="text" size="mini" style="color:#409EFF;padding:0 6px;" @click="handleEditScheduled(row)">编辑</el-button>
|
||||
<el-button type="text" size="mini" style="color:#ff4d4f;padding:0 6px;" @click="handleDeleteScheduled(row)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="aps-scheduled-card-body">
|
||||
<div class="aps-scheduled-kv">
|
||||
<div class="kv-item"><span class="kv-label">生产日期</span><span class="kv-value">{{ row.prodDate }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">规格</span><span class="kv-value">{{ row.spec }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">材质</span><span class="kv-value">{{ row.material }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">排产吨数</span><span class="kv-value">{{ row.scheduleWeight }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">品名项</span><span class="kv-value">{{ row.productItem }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">品名</span><span class="kv-value">{{ row.productType }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">订货单位</span><span class="kv-value">{{ row.customerName }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">业务员</span><span class="kv-value">{{ row.businessUser }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">联系电话</span><span class="kv-value">{{ row.businessPhone }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">交货期(天)</span><span class="kv-value">{{ row.deliveryCycle }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">厚度公差</span><span class="kv-value">{{ row.thicknessTolerance }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">宽度公差</span><span class="kv-value">{{ row.widthTolerance }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">表面质量</span><span class="kv-value">{{ row.surfaceQuality }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">表面处理</span><span class="kv-value">{{ row.surfaceTreatment }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">内径尺寸</span><span class="kv-value">{{ row.innerDiameter }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">外径要求</span><span class="kv-value">{{ row.outerDiameter }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">包装要求</span><span class="kv-value">{{ row.packReq }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">切边要求</span><span class="kv-value">{{ row.cutEdgeReq }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">单件重量</span><span class="kv-value">{{ row.singleCoilWeight }}</span></div>
|
||||
<div class="kv-item"><span class="kv-label">交货重量偏差</span><span class="kv-value">{{ row.weightDeviation }}</span></div>
|
||||
<div class="kv-item kv-span-4"><span class="kv-label">产品用途</span><span class="kv-value kv-value-wrap">{{ row.usePurpose }}</span></div>
|
||||
<div class="kv-item kv-span-4" v-if="row.otherTechReq"><span class="kv-label">其他技术要求</span><span class="kv-value kv-value-wrap">{{ row.otherTechReq }}</span></div>
|
||||
<div class="kv-item kv-span-4" v-if="row.paymentDesc"><span class="kv-label">付款情况说明</span><span class="kv-value kv-value-wrap">{{ row.paymentDesc }}</span></div>
|
||||
<div class="kv-item kv-span-4" v-if="row.rowRemark"><span class="kv-label">单行排产备注</span><span class="kv-value kv-value-wrap">{{ row.rowRemark }}</span></div>
|
||||
<div class="kv-item kv-span-4" v-if="row.remark"><span class="kv-label">备注</span><span class="kv-value kv-value-wrap">{{ row.remark }}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</draggable>
|
||||
</div>
|
||||
</template>
|
||||
<div v-else-if="!schLoading" style="padding:40px;text-align:center;color:#909399;">
|
||||
{{ hasQueried ? '该日期暂无已排产数据' : '请选择日期查询' }}
|
||||
@@ -645,14 +672,16 @@ import {
|
||||
listScheduleItem,
|
||||
updateScheduleItem,
|
||||
delScheduleItem,
|
||||
receiveScheduleItem
|
||||
receiveScheduleItem,
|
||||
saveScheduleItemSort
|
||||
} from '@/api/aps/schedule'
|
||||
import { PROCESSES } from '@/utils/meta'
|
||||
import ProcessSelect from '@/components/KLPService/ProcessSelect/index.vue'
|
||||
import draggable from 'vuedraggable'
|
||||
|
||||
export default {
|
||||
name: 'ApsSchedule',
|
||||
components: { ProcessSelect },
|
||||
components: { ProcessSelect, draggable },
|
||||
data() {
|
||||
const today = new Date()
|
||||
const y = today.getFullYear()
|
||||
@@ -678,6 +707,10 @@ export default {
|
||||
// 已排产
|
||||
scheduledItemList: [],
|
||||
scheduledStepTab: '',
|
||||
scheduledOrderMap: {},
|
||||
scheduledStepItems: [],
|
||||
scheduledSortDirtyMap: {},
|
||||
saveSortLoading: false,
|
||||
|
||||
// 驳回
|
||||
rejectDialogVisible: false,
|
||||
@@ -724,13 +757,82 @@ export default {
|
||||
return this.scheduledItemList.filter(
|
||||
item => this.normalizeStepName(item.stepName) === tab
|
||||
)
|
||||
},
|
||||
scheduledSortDirty() {
|
||||
const tab = this.scheduledStepTab
|
||||
if (!tab) return false
|
||||
return !!this.scheduledSortDirtyMap[tab]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
scheduledStepTab() {
|
||||
this.refreshScheduledStepItems()
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.handleQuery()
|
||||
},
|
||||
methods: {
|
||||
getScheduledItemKey(row) {
|
||||
return row && row.scheduleId != null ? String(row.scheduleId) : ''
|
||||
},
|
||||
refreshScheduledStepItems() {
|
||||
const tab = this.scheduledStepTab
|
||||
if (!tab) {
|
||||
this.scheduledStepItems = []
|
||||
return
|
||||
}
|
||||
const stepItems = this.scheduledItemList.filter(i => this.normalizeStepName(i.stepName) === tab)
|
||||
const order = this.scheduledOrderMap[tab]
|
||||
if (!Array.isArray(order) || order.length === 0) {
|
||||
const keys = stepItems.map(i => this.getScheduledItemKey(i)).filter(Boolean)
|
||||
this.$set(this.scheduledOrderMap, tab, keys)
|
||||
this.scheduledStepItems = stepItems.slice()
|
||||
return
|
||||
}
|
||||
const indexMap = new Map(order.map((k, idx) => [k, idx]))
|
||||
this.scheduledStepItems = stepItems
|
||||
.slice()
|
||||
.sort((a, b) => {
|
||||
const ka = this.getScheduledItemKey(a)
|
||||
const kb = this.getScheduledItemKey(b)
|
||||
const ia = indexMap.has(ka) ? indexMap.get(ka) : 999999
|
||||
const ib = indexMap.has(kb) ? indexMap.get(kb) : 999999
|
||||
return ia - ib
|
||||
})
|
||||
const existKeys = new Set(stepItems.map(i => this.getScheduledItemKey(i)))
|
||||
const nextOrder = order.filter(k => existKeys.has(k))
|
||||
const missing = stepItems.map(i => this.getScheduledItemKey(i)).filter(k => k && !nextOrder.includes(k))
|
||||
if (missing.length) {
|
||||
nextOrder.push(...missing)
|
||||
}
|
||||
if (nextOrder.join('|') !== order.join('|')) {
|
||||
this.$set(this.scheduledOrderMap, tab, nextOrder)
|
||||
}
|
||||
},
|
||||
handleScheduledDragEnd() {
|
||||
const tab = this.scheduledStepTab
|
||||
if (!tab) return
|
||||
const keys = (this.scheduledStepItems || []).map(i => this.getScheduledItemKey(i)).filter(Boolean)
|
||||
this.$set(this.scheduledOrderMap, tab, keys)
|
||||
this.$set(this.scheduledSortDirtyMap, tab, true)
|
||||
},
|
||||
handleSaveScheduledSort() {
|
||||
const tab = this.scheduledStepTab
|
||||
if (!tab) return
|
||||
const scheduleIds = (this.scheduledStepItems || []).map(i => i.scheduleId).filter(v => v != null)
|
||||
if (scheduleIds.length === 0) return
|
||||
this.saveSortLoading = true
|
||||
saveScheduleItemSort({ scheduleIds }).then(() => {
|
||||
this.$modal.msgSuccess('排序已保存')
|
||||
this.$set(this.scheduledSortDirtyMap, tab, false)
|
||||
this.queryScheduled()
|
||||
}).catch(() => {
|
||||
this.$modal.msgError('保存排序失败')
|
||||
}).finally(() => {
|
||||
this.saveSortLoading = false
|
||||
})
|
||||
},
|
||||
getEmptyEditForm() {
|
||||
return {
|
||||
scheduleId: undefined,
|
||||
@@ -929,14 +1031,18 @@ export default {
|
||||
this.schLoading = true
|
||||
this.scheduledItemList = []
|
||||
this.scheduledStepTab = ''
|
||||
this.scheduledOrderMap = {}
|
||||
this.scheduledStepItems = []
|
||||
this.scheduledSortDirtyMap = {}
|
||||
|
||||
listScheduleItem({ prodDate: this.queryDate, pageNum: 1, pageSize: 999 }).then(res => {
|
||||
this.scheduledItemList = (res.rows || []).sort((a, b) => (a.scheduleNo || '').localeCompare(b.scheduleNo || ''))
|
||||
this.scheduledItemList = res.rows || []
|
||||
// 默认选中第一个步骤tab
|
||||
const tabs = this.scheduledStepTabs
|
||||
if (tabs.length > 0) {
|
||||
this.scheduledStepTab = tabs[0]
|
||||
}
|
||||
this.refreshScheduledStepItems()
|
||||
const totalWeight = this.scheduledItemList.reduce((sum, d) => {
|
||||
const w = parseFloat(d.scheduleWeight)
|
||||
return sum + (isNaN(w) ? 0 : w)
|
||||
@@ -945,6 +1051,9 @@ export default {
|
||||
}).catch((e) => {
|
||||
console.error('queryScheduled error:', e)
|
||||
this.scheduledItemList = []
|
||||
this.scheduledOrderMap = {}
|
||||
this.scheduledStepItems = []
|
||||
this.scheduledSortDirtyMap = {}
|
||||
this.summaryText = ''
|
||||
}).finally(() => {
|
||||
this.schLoading = false
|
||||
@@ -1046,20 +1155,20 @@ export default {
|
||||
|
||||
.aps-sch-page {
|
||||
height: 100%;
|
||||
padding: 8px;
|
||||
padding: 6px;
|
||||
box-sizing: border-box;
|
||||
background: $aps-bg;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
// 工具栏
|
||||
.aps-sch-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 10px 16px;
|
||||
gap: 8px;
|
||||
padding: 8px 12px;
|
||||
background: $aps-white;
|
||||
border: 1px solid $aps-border;
|
||||
border-radius: $aps-radius;
|
||||
@@ -1126,6 +1235,15 @@ export default {
|
||||
@include aps-btn-red;
|
||||
}
|
||||
|
||||
.aps-btn-red.is-disabled,
|
||||
.aps-btn-red.is-disabled:hover,
|
||||
.aps-btn-red.is-disabled:focus,
|
||||
.aps-btn-red.is-disabled:active {
|
||||
color: $aps-silver-4;
|
||||
background: $aps-silver-2;
|
||||
border-color: $aps-silver-3;
|
||||
}
|
||||
|
||||
.detail-card {
|
||||
background: $aps-white;
|
||||
border: 1px solid $aps-border;
|
||||
@@ -1137,7 +1255,7 @@ export default {
|
||||
.detail-card-header {
|
||||
background: linear-gradient(to right, $aps-red-2, $aps-red-3);
|
||||
color: white;
|
||||
padding: 8px 14px;
|
||||
padding: 6px 12px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
@@ -1147,7 +1265,7 @@ export default {
|
||||
}
|
||||
|
||||
.detail-card-body {
|
||||
padding: 14px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.form-grid-2 {
|
||||
@@ -1197,8 +1315,8 @@ export default {
|
||||
.aps-sch-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 8px;
|
||||
gap: 8px;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.aps-sch-item {
|
||||
@@ -1213,7 +1331,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 8px 14px;
|
||||
padding: 6px 12px;
|
||||
background: linear-gradient(135deg, $aps-silver-1 0%, #f8f9fb 100%);
|
||||
border-bottom: 1px solid $aps-border;
|
||||
}
|
||||
@@ -1221,7 +1339,7 @@ export default {
|
||||
.aps-sch-item-header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
gap: 10px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
@@ -1238,7 +1356,7 @@ export default {
|
||||
.aps-status-tag {
|
||||
display: inline-block;
|
||||
font-size: 11px;
|
||||
padding: 2px 8px;
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
@@ -1254,15 +1372,17 @@ export default {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 12px;
|
||||
table-layout: fixed;
|
||||
|
||||
td {
|
||||
padding: 5px 10px;
|
||||
padding: 3px 6px;
|
||||
border: 1px solid $aps-silver-mid;
|
||||
vertical-align: middle;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.req-td-label {
|
||||
width: 100px;
|
||||
width: 80px;
|
||||
background: $aps-silver-1;
|
||||
color: $aps-text-muted;
|
||||
font-weight: 500;
|
||||
@@ -1272,6 +1392,15 @@ export default {
|
||||
|
||||
.req-td-value {
|
||||
color: $aps-text;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.req-td-value[colspan] {
|
||||
overflow: visible;
|
||||
text-overflow: clip;
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1283,9 +1412,9 @@ export default {
|
||||
|
||||
.aps-sch-item-actions {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
gap: 4px;
|
||||
flex-shrink: 0;
|
||||
margin-left: 12px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
// 明细表
|
||||
@@ -1298,7 +1427,7 @@ export default {
|
||||
padding: 7px 14px;
|
||||
background: $aps-silver-1;
|
||||
border-bottom: 1px solid $aps-border;
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: $aps-text;
|
||||
}
|
||||
@@ -1307,7 +1436,7 @@ export default {
|
||||
display: flex;
|
||||
padding: 7px 14px;
|
||||
border-bottom: 1px solid $aps-silver-mid;
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
color: $aps-text;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
@@ -1330,7 +1459,7 @@ export default {
|
||||
}
|
||||
|
||||
.aps-sch-item-empty {
|
||||
padding: 20px;
|
||||
padding: 14px;
|
||||
text-align: center;
|
||||
color: $aps-text-muted;
|
||||
font-size: 12px;
|
||||
@@ -1370,6 +1499,12 @@ export default {
|
||||
border-bottom: 1px solid $aps-border;
|
||||
}
|
||||
|
||||
.aps-step-tabs-right {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.aps-step-tab {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -1417,4 +1552,135 @@ export default {
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
.aps-scheduled-cards {
|
||||
padding: 10px 10px 12px;
|
||||
}
|
||||
|
||||
.aps-scheduled-card {
|
||||
background: $aps-white;
|
||||
border: 1px solid $aps-border;
|
||||
border-radius: $aps-radius;
|
||||
box-shadow: $aps-shadow-sm;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.aps-scheduled-card + .aps-scheduled-card {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.aps-scheduled-card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 8px 12px;
|
||||
background: linear-gradient(135deg, $aps-silver-1 0%, #f8f9fb 100%);
|
||||
border-bottom: 1px solid $aps-border;
|
||||
}
|
||||
|
||||
.aps-scheduled-card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.aps-drag-handle {
|
||||
cursor: grab;
|
||||
color: $aps-text-muted;
|
||||
font-size: 16px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.aps-scheduled-no {
|
||||
color: $aps-red-2;
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.aps-scheduled-step {
|
||||
color: $aps-text-muted;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.aps-scheduled-card-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.aps-scheduled-card-body {
|
||||
padding: 10px 12px 12px;
|
||||
}
|
||||
|
||||
.aps-scheduled-kv {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 8px 12px;
|
||||
}
|
||||
|
||||
.kv-item {
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.kv-label {
|
||||
flex: 0 0 auto;
|
||||
color: $aps-text-muted;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.kv-value {
|
||||
color: $aps-text;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.kv-value-wrap {
|
||||
white-space: normal;
|
||||
overflow: visible;
|
||||
text-overflow: clip;
|
||||
}
|
||||
|
||||
.kv-span-2 {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.kv-span-4 {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.aps-drag-ghost {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
@media (max-width: 1366px) {
|
||||
.aps-scheduled-kv {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.aps-scheduled-kv {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.kv-span-2 {
|
||||
grid-column: span 2;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user