Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
jhd
2026-06-29 16:50:20 +08:00
42 changed files with 3275 additions and 224 deletions

View File

@@ -0,0 +1,27 @@
import request from '@/utils/request'
// 查询排产明细-钢卷绑定关系列表
export function listDetailCoilRel(query) {
return request({
url: '/flow/detailCoilRel/list',
method: 'get',
params: query
})
}
// 批量新增绑定关系
export function batchAddDetailCoilRel(data) {
return request({
url: '/flow/detailCoilRel/batch',
method: 'post',
data
})
}
// 删除绑定关系
export function delDetailCoilRel(relIds) {
return request({
url: '/flow/detailCoilRel/' + relIds,
method: 'delete'
})
}

View File

@@ -70,3 +70,32 @@ export function delScheduleItem(ids) {
method: 'delete'
})
}
// ====== 排产单明细项 接收/合并 ======
// 接收产需单(后端全字段复制)
export function receiveScheduleItem(scheduleId) {
return request({
url: '/flow/prodScheduleItem/receive',
method: 'post',
data: { scheduleId }
})
}
// 合并验证(检查源排产单字段一致性)
export function validateMerge(data) {
return request({
url: '/flow/prodScheduleItem/mergeValidate',
method: 'post',
data
})
}
// 合并排产单明细项
export function mergeScheduleItem(data) {
return request({
url: '/flow/prodScheduleItem/merge',
method: 'post',
data
})
}

View File

@@ -7,6 +7,7 @@
<el-input v-model="queryParams.keyword" placeholder="请输入关键字" clearable
@keyup.enter.native="handleQuery" style="width: 160px;" />
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">筛选</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button icon="el-icon-sort" size="mini" @click="toggleMoreFilter"
:type="showMoreFilter ? 'primary' : 'default'">
</el-button>
@@ -213,6 +214,7 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.keyword = undefined;
this.$refs["queryForm"].resetFields();
this.queryParams.signDateStart = undefined;
this.queryParams.signDateEnd = undefined;

View File

@@ -298,7 +298,7 @@ export default {
Object.assign(item, calculateProductFields(item, 'quantity'));
});
this.products = products;
this.remark = data.remark || '净边料/毛边料、简包/裸包、卷重结算';
this.remark = data.remark !== undefined ? data.remark : '净边料/毛边料、简包/裸包、卷重结算';
this.productName = data.productName || '';
} catch (error) {
console.error('解析content失败:', error);

View File

@@ -227,11 +227,10 @@
</el-dialog>
</div>
</template>
<script>
import { delOrder, listOrderPackaging, updateOrder, getOrder, addOrder } from "@/api/crm/order";
import { addCustomer } from "@/api/crm/customer";
import { getDicts, addData, updateData } from "@/api/system/dict/data";
import { listDeliveryWaybill } from "@/api/wms/deliveryWaybill";
import dayjs from "dayjs";
import ContractList from "./components/ContractList.vue";

View File

@@ -0,0 +1,334 @@
<template>
<span>
<el-button icon="el-icon-link" size="mini" @click="open">绑定排产明细</el-button>
<el-dialog title="排产明细 - 钢卷绑定" :visible.sync="visible" width="1200px" append-to-body :close-on-click-modal="false"
v-loading="loading">
<!-- 上半部分今日排产明细 -->
<div class="bind-section">
<div class="bind-section-header">今日排产明细{{ scheduleItems.length }} </div>
<el-table :data="scheduleItems" highlight-current-row @row-click="handleDetailClick" max-height="300"
size="small">
<el-table-column prop="scheduleNo" label="排产单号" min-width="130" show-overflow-tooltip />
<el-table-column prop="prodDate" label="生产日期" width="90" />
<el-table-column prop="spec" label="规格" width="90" show-overflow-tooltip />
<el-table-column prop="material" label="材质" width="70" />
<el-table-column prop="scheduleWeight" label="排产吨数" width="80" />
<el-table-column prop="productType" label="品名" min-width="100" show-overflow-tooltip />
<el-table-column prop="customerName" label="订货单位" min-width="100" show-overflow-tooltip />
<el-table-column label="已绑钢卷" width="80">
<template slot-scope="scope">
<el-tag size="mini" type="info">{{ scope.row._boundCount || 0 }} </el-tag>
</template>
</el-table-column>
</el-table>
</div>
<!-- 下半部分已绑定钢卷 -->
<div class="bind-section" v-if="currentDetail" style="margin-top:16px;">
<div class="bind-section-header">
已绑定钢卷 {{ currentDetail.spec }} / {{ currentDetail.material }}
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openCoilSelect">绑定钢卷</el-button>
</div>
<el-table :data="boundCoils" size="small" v-loading="boundCoilsLoading">
<el-table-column prop="currentCoilNo" label="钢卷号" width="140" show-overflow-tooltip />
<el-table-column prop="specification" label="规格" width="100" show-overflow-tooltip />
<el-table-column prop="material" label="材质" width="70" />
<el-table-column prop="netWeight" label="净重" width="80" />
<el-table-column prop="_remark" label="备注" min-width="100" show-overflow-tooltip />
<el-table-column label="操作" width="70" align="center">
<template slot-scope="scope">
<el-button type="text" style="color:#ff4d4f;" size="mini" @click="handleUnbind(scope.row)">解绑</el-button>
</template>
</el-table-column>
</el-table>
<el-empty v-if="boundCoils.length === 0 && !boundCoilsLoading" description="暂未绑定钢卷" />
</div>
<el-empty v-if="scheduleItems.length === 0 && !loading" description="今日无排产明细" />
</el-dialog>
<!-- 选卷子弹窗 -->
<el-dialog title="选择钢卷" :visible.sync="coilDialogVisible" width="900px" append-to-body
:close-on-click-modal="false">
<div style="display:flex;gap:8px;margin-bottom:10px;">
<el-input v-model="coilQuery.keyword" placeholder="钢卷号 / 入场卷号" size="small" style="width:220px"
clearable @keyup.enter.native="searchCoils" />
<el-button size="small" type="primary" icon="el-icon-search" @click="searchCoils">搜索</el-button>
<span style="margin-left:auto;font-size:12px;color:#909399;line-height:32px;">
已选 {{ selectedCoils.length }}
</span>
</div>
<el-table :data="coilList" @selection-change="handleCoilSelection" ref="coilSelectTable" size="small"
v-loading="coilListLoading" max-height="400">
<el-table-column type="selection" width="50" :selectable="checkCoilSelectable" />
<el-table-column prop="currentCoilNo" label="钢卷号" width="140" show-overflow-tooltip />
<el-table-column prop="enterCoilNo" label="入场卷号" width="140" show-overflow-tooltip />
<el-table-column prop="specification" label="规格" width="100" show-overflow-tooltip />
<el-table-column prop="material" label="材质"/>
<el-table-column prop="netWeight" label="净重" width="80" />
<el-table-column prop="warehouseName" label="仓库" width="80" show-overflow-tooltip />
</el-table>
<pagination v-show="coilTotal > 0" :total="coilTotal" :page.sync="coilQuery.pageNum"
:limit.sync="coilQuery.pageSize" @pagination="searchCoils" style="padding:10px 0 0 0;" />
<span slot="footer">
<el-button type="primary" @click="confirmBindCoils" :loading="bindLoading"
:disabled="selectedCoils.length === 0">确定绑定{{ selectedCoils.length }} </el-button>
<el-button @click="coilDialogVisible = false">取消</el-button>
</span>
</el-dialog>
</span>
</template>
<script>
import { listScheduleItem } from '@/api/aps/schedule'
import { listMaterialCoil } from '@/api/wms/coil'
import { listDetailCoilRel, batchAddDetailCoilRel, delDetailCoilRel } from '@/api/aps/detailCoilRel'
export default {
name: 'ScheduleDetailCoilBind',
data() {
return {
visible: false,
loading: false,
scheduleItems: [],
currentDetail: null,
boundCoils: [],
boundCoilsLoading: false,
allBoundCoilIds: new Set(),
coilDialogVisible: false,
coilListLoading: false,
coilList: [],
coilTotal: 0,
selectedCoils: [],
bindLoading: false,
coilQuery: {
keyword: '',
pageNum: 1,
pageSize: 20
}
}
},
computed: {
prodDate() {
return new Date().toISOString().slice(0, 10)
}
},
methods: {
open() {
this.visible = true
this.currentDetail = null
this.boundCoils = []
this.loadScheduleItems()
},
async loadScheduleItems() {
this.loading = true
try {
const res = await listScheduleItem({ prodDate: this.prodDate })
this.scheduleItems = (res.rows || []).map(item => {
item._boundCount = 0
return item
})
// 加载所有已绑定的钢卷ID
await this.loadAllBoundCoilIds()
} catch (e) {
this.scheduleItems = []
} finally {
this.loading = false
}
},
async loadAllBoundCoilIds() {
const ids = this.scheduleItems.map(i => i.id || i.scheduleDetailId).filter(Boolean)
if (ids.length === 0) return
try {
// 尝试批量查询
const res = await listDetailCoilRel({ scheduleDetailIds: ids.join(',') })
const rows = res.rows || []
this.allBoundCoilIds = new Set(rows.map(r => r.coilId))
this.applyBoundCounts(rows)
} catch (e) {
// 批量查询失败则逐个查询
try {
const allRows = []
const tasks = ids.map(id =>
listDetailCoilRel({ scheduleDetailId: id }).then(r => {
(r.rows || []).forEach(row => allRows.push(row))
}).catch(() => {})
)
await Promise.all(tasks)
this.allBoundCoilIds = new Set(allRows.map(r => r.coilId))
this.applyBoundCounts(allRows)
} catch (e2) {
// ignore
}
}
},
applyBoundCounts(rows) {
const countMap = {}
rows.forEach(r => {
const key = r.scheduleDetailId
countMap[key] = (countMap[key] || 0) + 1
})
this.scheduleItems.forEach(item => {
const key = item.id || item.scheduleDetailId
item._boundCount = countMap[key] || 0
})
},
async handleDetailClick(row) {
this.currentDetail = row
this.boundCoilsLoading = true
try {
const detailId = row.id || row.scheduleDetailId
const res = await listDetailCoilRel({ scheduleDetailId: detailId })
const rels = res.rows || []
if (rels.length > 0) {
const coilIds = rels.map(r => r.coilId).filter(Boolean)
const coilRes = await listMaterialCoil({
pageNum: 1,
pageSize: 200,
coilIds: coilIds.join(',')
})
const coilMap = {}
if (coilRes.rows) {
coilRes.rows.forEach(c => { coilMap[c.coilId || c.id] = c })
}
this.boundCoils = rels.map(r => ({
...r,
...(coilMap[r.coilId] || {}),
_remark: r.remark || ''
}))
} else {
this.boundCoils = []
}
} catch (e) {
this.boundCoils = []
} finally {
this.boundCoilsLoading = false
}
},
async openCoilSelect() {
this.coilDialogVisible = true
this.selectedCoils = []
this.coilQuery.keyword = ''
this.coilQuery.pageNum = 1
await this.searchCoils()
},
async searchCoils() {
this.coilListLoading = true
try {
const params = {
pageNum: this.coilQuery.pageNum,
pageSize: this.coilQuery.pageSize,
status: 0,
dataType: 1,
exclusiveStatus: 0
}
if (this.coilQuery.keyword) {
params.currentCoilNo = this.coilQuery.keyword
}
const res = await listMaterialCoil(params)
// 过滤掉已绑定的钢卷
this.coilList = (res.rows || []).filter(c => !this.allBoundCoilIds.has(c.coilId || c.id))
this.coilTotal = res.total || 0
} catch (e) {
this.coilList = []
} finally {
this.coilListLoading = false
}
},
checkCoilSelectable(row) {
return !this.allBoundCoilIds.has(row.coilId || row.id)
},
handleCoilSelection(selection) {
this.selectedCoils = selection
},
async confirmBindCoils() {
if (this.selectedCoils.length === 0) {
this.$message.warning('请至少选择一个钢卷')
return
}
this.bindLoading = true
try {
const detailId = this.currentDetail.id || this.currentDetail.scheduleDetailId
const data = this.selectedCoils.map(c => ({
scheduleDetailId: detailId,
coilId: c.coilId || c.id,
remark: ''
}))
await batchAddDetailCoilRel(data)
this.$modal.msgSuccess(`成功绑定 ${this.selectedCoils.length}`)
this.coilDialogVisible = false
// 记录新绑定的钢卷ID
this.selectedCoils.forEach(c => {
this.allBoundCoilIds.add(c.coilId || c.id)
})
// 更新当前明细的已绑卷数
if (this.currentDetail) {
this.currentDetail._boundCount = (this.currentDetail._boundCount || 0) + this.selectedCoils.length
}
// 刷新已绑定钢卷列表
await this.handleDetailClick(this.currentDetail)
} catch (e) {
this.$modal.msgError('绑定失败')
} finally {
this.bindLoading = false
}
},
async handleUnbind(row) {
try {
await this.$confirm('确认解绑该钢卷吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
const relId = row.relId || row.id
await delDetailCoilRel(relId)
this.$modal.msgSuccess('解绑成功')
// 从已绑定集合中移除
if (row.coilId) {
this.allBoundCoilIds.delete(row.coilId)
}
if (this.currentDetail) {
this.currentDetail._boundCount = Math.max(0, (this.currentDetail._boundCount || 0) - 1)
}
await this.handleDetailClick(this.currentDetail)
} catch (e) {
if (e !== 'cancel') {
this.$modal.msgError('解绑失败')
}
}
}
}
}
</script>
<style scoped lang="scss">
.bind-section {
border: 1px solid #e4e7ed;
border-radius: 4px;
overflow: hidden;
}
.bind-section-header {
background: #f5f7fa;
padding: 8px 12px;
font-size: 13px;
font-weight: 600;
color: #303133;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #e4e7ed;
}
</style>

View File

@@ -26,6 +26,7 @@
<div class="flow-left">
<div class="flow-section-title">
<span>源卷列表</span>
<schedule-detail-coil-bind />
<el-button v-if="!readonly" type="primary" size="small" @click="addSourceCoil">添加源卷</el-button>
</div>
@@ -374,6 +375,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import TimeInput from "@/components/TimeInput";
import AbnormalForm from './components/AbnormalForm';
import PlanSheetViewer from './components/PlanSheetViewer.vue';
import ScheduleDetailCoilBind from './components/ScheduleDetailCoilBind'
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
import ContractSelect from "@/components/KLPService/ContractSelect";
@@ -389,6 +391,7 @@ export default {
AbnormalForm,
ContractSelect,
PlanSheetViewer,
ScheduleDetailCoilBind,
},
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'],
data() {

View File

@@ -11,6 +11,7 @@
:name="tab.value"></el-tab-pane>
</el-tabs>
<h3 class="section-title" v-else>待领物料列表</h3>
<schedule-detail-coil-bind />
<el-button size="mini" icon="el-icon-refresh" @click="getMaterialCoil">刷新</el-button>
</div>
@@ -309,6 +310,7 @@ import CoilCard from '@/components/KLPService/Renderer/CoilCard.vue'
import LabelRender from './LabelRender/index.vue'
import StepSplit from './stepSplit.vue'
import ExceptionManager from '../components/ExceptionManager'
import ScheduleDetailCoilBind from '../components/ScheduleDetailCoilBind'
import { getCoilTagPrintType } from '@/views/wms/coil/js/coilPrint'
export default {
@@ -334,7 +336,8 @@ export default {
CoilCard,
LabelRender,
StepSplit,
ExceptionManager
ExceptionManager,
ScheduleDetailCoilBind
},
data() {
return {

View File

@@ -25,6 +25,7 @@
<div class="flow-left">
<div class="flow-section-title">
<span>母卷信息</span>
<schedule-detail-coil-bind />
</div>
<div class="coil-card mother-coil">
<div class="coil-header">
@@ -377,6 +378,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import TimeInput from "@/components/TimeInput";
import AbnormalForm from './components/AbnormalForm';
import PlanSheetViewer from './components/PlanSheetViewer.vue';
import ScheduleDetailCoilBind from './components/ScheduleDetailCoilBind'
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
import ContractSelect from "@/components/KLPService/ContractSelect";
@@ -391,6 +393,7 @@ export default {
AbnormalForm,
ContractSelect,
PlanSheetViewer,
ScheduleDetailCoilBind,
},
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'],
data() {

View File

@@ -30,9 +30,10 @@
<!-- 右侧更新表单 -->
<div>
<el-card class="form-card">
<div slot="header" class="card-header">
<div slot="header" class="card-header">
<span><i class="el-icon-edit-outline"></i> {{ '更新信息' }}</span>
<div>
<schedule-detail-coil-bind />
<el-button size="small" @click="saveTemp" :loading="loading">暂存内容</el-button>
<el-button type="primary" size="small" @click="handleSave" :loading="loading">保存更新</el-button>
</div>
@@ -405,6 +406,7 @@ import ContractSelect from "@/components/KLPService/ContractSelect";
import L2MatchPanel from './panels/L2MatchPanel.vue'
import DrMatchPanel from './panels/DrMatchPanel.vue';
import PlanSheetViewer from './components/PlanSheetViewer.vue';
import ScheduleDetailCoilBind from './components/ScheduleDetailCoilBind'
// actionType -> 产线名称映射
@@ -431,6 +433,7 @@ export default {
L2MatchPanel,
DrMatchPanel,
PlanSheetViewer,
ScheduleDetailCoilBind,
},
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'],
data() {

View File

@@ -418,11 +418,11 @@ export default {
methods: {
initDateRange() {
const now = new Date()
const firstDay = new Date(now.getFullYear(), now.getMonth(), 1)
const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0)
const yesterday = new Date(now)
yesterday.setDate(yesterday.getDate() - 1)
this.defaultStartTime = this.formatDate(firstDay)
this.defaultEndTime = this.formatDate(lastDay)
this.defaultStartTime = this.formatDate(yesterday)
this.defaultEndTime = this.formatDate(now)
this.dateRangeParams = {
startDate: this.defaultStartTime,

View File

@@ -93,7 +93,7 @@
<el-table-column label="状态" align="center" prop="state" />
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">

View File

@@ -158,7 +158,7 @@
<div v-for="order in currentReq.orderList" :key="order.orderId" class="bound-order-card">
<div class="bound-order-card-header">
<span>{{ order.orderCode || ('订单 #' + order.orderId) }}</span>
<button v-if="canEdit" class="link-btn" @click="handleUnbindByOrderId(order.orderId)">解绑</button>
<button v-if="canEdit" class="link-btn" @click="handleUnbindByOrderId(order)">解绑</button>
</div>
<div class="bound-order-card-body">
<div style="font-size:12px; color:#7f8c8d; margin-bottom:3px;">
@@ -399,6 +399,7 @@ import {
delRequirement,
addRel,
delRel,
listRel,
addRequirementDetail,
updateRequirementDetail,
delRequirementDetail
@@ -628,7 +629,8 @@ export default {
searchBindOrders() {
this.bindSearchLoading = true
listCrmOrder(this.bindQuery).then(res => {
this.candidateOrderList = res.rows || []
const boundOrderIds = (this.currentReq?.orderList || []).map(o => o.orderId)
this.candidateOrderList = (res.rows || []).filter(o => !boundOrderIds.includes(o.orderId))
}).catch(() => {
this.candidateOrderList = []
}).finally(() => {
@@ -672,65 +674,87 @@ export default {
}
this.bindBtnLoading = true
const scheduleId = this.currentReq.scheduleId
const allPromises = []
this.selectedBindOrders.forEach(order => {
// 1. 创建订单关联
allPromises.push(
addRel({
orderId: order.orderId,
scheduleId: scheduleId,
relWeight: null,
remark: ''
})
)
// 2. 解析 productContent每行产品创建一条排产明细
if (order.productContent) {
const parsed = parseProductContent(order.productContent)
const products = parsed.products || []
const productType = parsed.productName || ''
products.forEach(prod => {
allPromises.push(
addRequirementDetail({
scheduleId: scheduleId,
orderDetailId: order.orderId,
spec: prod.spec || '',
material: prod.material || '',
scheduleWeight: prod.quantity || 0,
productType: productType,
remark: prod.remark || ''
})
)
})
}
const orderTasks = this.selectedBindOrders.map(order => {
return addRel({
orderId: order.orderId,
scheduleId: scheduleId,
relWeight: null,
remark: ''
}).then(() => {
if (!order.productContent) return
let products = []
let productType = ''
try {
const parsed = parseProductContent(order.productContent)
products = (parsed.products || []).filter(p => p.spec && p.material)
productType = parsed.productName || ''
} catch (e) {
return
}
if (products.length === 0) return
const detailPromises = products.map(prod =>
addRequirementDetail({
scheduleId: scheduleId,
orderDetailId: order.orderId,
spec: prod.spec,
material: prod.material,
scheduleWeight: prod.quantity || 0,
productType: productType,
remark: prod.remark || ''
})
)
return Promise.all(detailPromises)
})
})
Promise.all(allPromises).then(() => {
this.$modal.msgSuccess('绑定成功,排产明细已生成')
Promise.allSettled(orderTasks).then(results => {
const successCount = results.filter(r => r.status === 'fulfilled').length
const failCount = results.filter(r => r.status === 'rejected').length
this.bindDialogVisible = false
this.handleReqClick(this.currentReq)
}).catch(() => {
this.$modal.msgError('绑定或创建明细失败')
if (failCount === 0) {
this.$modal.msgSuccess(`成功绑定 ${successCount} 个订单,排产明细已生成`)
} else if (successCount === 0) {
this.$modal.msgError('绑定失败,请重试')
} else {
this.$modal.msgWarning(`成功绑定 ${successCount} 个,${failCount} 个失败`)
}
}).finally(() => {
this.bindBtnLoading = false
})
},
handleUnbindByOrderId(orderId) {
const order = (this.currentReq.orderList || []).find(o => o.orderId === orderId)
if (!order) {
this.$message.warning('未找到关联记录')
return
}
this.$confirm('确认解绑该订单吗?', '提示', {
handleUnbindByOrderId(order) {
this.$confirm('确认解绑该订单吗?解绑将同时删除对应的排产明细。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delRel(order.relId || orderId).then(() => {
const tasks = []
// 1. 删除该订单关联的排产明细
const detailIds = this.requirementDetailList
.filter(d => d.orderDetailId === order.orderId)
.map(d => d.scheduleDetailId)
detailIds.forEach(id => {
tasks.push(delRequirementDetail(id))
})
// 2. 查询并删除关联表记录
tasks.push(
listRel({ orderId: order.orderId, scheduleId: this.currentReq.scheduleId }).then(res => {
const rows = res.rows || []
if (rows.length === 0) {
throw new Error('未找到关联记录')
}
const relId = rows[0].id || rows[0].relId
return delRel(relId)
})
)
Promise.all(tasks).then(() => {
this.$modal.msgSuccess('解绑成功')
this.handleReqClick(this.currentReq)
}).catch(() => {
this.$modal.msgError('解绑失败')
})
}).catch(() => { })
},

View File

@@ -17,22 +17,22 @@
<el-tab-pane label="待审核" name="pending" />
<el-tab-pane label="已排产" name="scheduled" />
</el-tabs>
<div class="aps-sch-summary" v-if="summaryText">
<div v-if="summaryText" class="aps-sch-summary">
<span>{{ summaryText }}</span>
</div>
</div>
<!-- 待审核 Tab -->
<div class="detail-card aps-sch-card" v-show="activeTab === 'pending'">
<div v-show="activeTab === 'pending'" class="detail-card aps-sch-card">
<div class="detail-card-header">
<span>待审核产需单明细</span>
<span v-if="pendingScheduleList.length > 0" style="font-weight:normal;font-size:12px;opacity:0.8;">
{{ pendingScheduleList.length }} 个产需单
</span>
</div>
<div class="detail-card-body" style="padding:0;" v-loading="loading">
<div v-loading="loading" class="detail-card-body" style="padding:0;">
<div v-if="pendingScheduleList.length > 0" class="aps-sch-list">
<div class="aps-sch-item" v-for="sch in pendingScheduleList" :key="sch.scheduleId">
<div v-for="sch in pendingScheduleList" :key="sch.scheduleId" class="aps-sch-item">
<!-- 产需单头部排产单号 + 状态标签 + 操作 -->
<div class="aps-sch-item-header">
<div class="aps-sch-item-header-left">
@@ -131,7 +131,7 @@
</table>
<!-- 明细列表 -->
<div class="aps-sch-item-details" v-if="(sch.detailList || []).length > 0">
<div v-if="(sch.detailList || []).length > 0" class="aps-sch-item-details">
<div class="aps-sch-detail-header">
<span class="aps-sch-detail-col col-spec">规格</span>
<span class="aps-sch-detail-col col-material">材质</span>
@@ -140,9 +140,9 @@
<span class="aps-sch-detail-col col-remark">备注</span>
</div>
<div
class="aps-sch-detail-row"
v-for="(d, di) in sch.detailList"
:key="di"
class="aps-sch-detail-row"
@click="handleDetailClick(sch, d)"
>
<span class="aps-sch-detail-col col-spec">{{ d.spec }}</span>
@@ -162,34 +162,84 @@
</div>
<!-- 已排产 Tab -->
<div class="detail-card aps-sch-card" v-show="activeTab === 'scheduled'">
<div v-show="activeTab === 'scheduled'" class="detail-card aps-sch-card">
<div class="detail-card-header">
<span>已排产明细</span>
<span v-if="scheduledItemList.length > 0" style="font-weight:normal;font-size:12px;opacity:0.8;">
{{ scheduledItemList.length }}
</span>
<div style="display:flex; align-items:center; gap:8px;">
<span v-if="scheduledItemList.length > 0" style="font-weight:normal;font-size:12px;opacity:0.8;">
{{ scheduledItemList.length }}
</span>
<span v-if="selectedItems.length >= 2" style="margin-left: auto;">
<el-button
size="mini"
type="warning"
icon="el-icon-link"
@click.stop="handleMergePrepare"
>
合并选中项 ({{ selectedItems.length }})
</el-button>
</span>
<span v-else style="margin-left: auto;">
<el-button
size="mini"
type="warning"
icon="el-icon-link"
disabled
>
合并选中项
</el-button>
</span>
</div>
</div>
<div class="detail-card-body" style="padding:0;" v-loading="schLoading">
<div v-loading="schLoading" class="detail-card-body" style="padding:0;">
<el-table
v-if="scheduledItemList.length > 0"
ref="scheduledTable"
:data="scheduledItemList"
border
size="small"
class="aps-table"
:row-class-name="getItemRowClassName"
@selection-change="handleSelectionChange"
>
<el-table-column label="排产单号" prop="scheduleNo" min-width="140" />
<el-table-column label="规格" prop="spec" min-width="120" />
<el-table-column label="材质" prop="material" width="90" align="center" />
<el-table-column label="排产吨数" prop="scheduleWeight" width="100" align="right" />
<el-table-column label="品名" prop="productType" min-width="100" />
<el-table-column label="订货单位" prop="customerName" min-width="140" />
<el-table-column label="备注" prop="remark" min-width="100" />
<el-table-column label="操作" width="110" align="center" fixed="right">
<el-table-column type="selection" width="45" align="center" />
<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="scheduleStatus" width="90" align="center">
<template slot-scope="scope">
<span style="white-space:nowrap;">
<el-button type="text" size="small" style="color:#409EFF;" @click="handleEditScheduled(scope.row)">编辑</el-button>
<el-button type="text" size="small" style="color:#ff4d4f;" @click="handleDeleteScheduled(scope.row)">删除</el-button>
</span>
<span class="aps-status-tag" :class="'status-' + (scope.row.scheduleStatus || 1)">{{ statusMap[scope.row.scheduleStatus] || '未知' }}</span>
</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>
</template>
</el-table-column>
</el-table>
@@ -237,33 +287,329 @@
</el-dialog>
<!-- 已排产明细编辑对话框 -->
<el-dialog :title="editDialogTitle" :visible.sync="editDialogVisible" width="500px" append-to-body
:close-on-click-modal="false">
<el-form ref="editForm" :model="editForm" label-width="100px" size="small">
<el-form-item label="排产单号">
<span style="color:#2c3e50;">{{ editForm.scheduleNo }}</span>
</el-form-item>
<el-form-item label="规格" prop="spec">
<el-input v-model="editForm.spec" />
</el-form-item>
<el-form-item label="材质" prop="material">
<el-input v-model="editForm.material" />
</el-form-item>
<el-form-item label="排产吨数" prop="scheduleWeight">
<el-input-number v-model="editForm.scheduleWeight" :min="0" :precision="3" :controls="false" style="width:100%" />
</el-form-item>
<el-form-item label="品名" prop="productType">
<el-input v-model="editForm.productType" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="editForm.remark" type="textarea" :rows="2" />
</el-form-item>
<el-dialog
:title="editDialogTitle"
:visible.sync="editDialogVisible"
width="800px"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="editForm" :model="editForm" label-width="110px" size="small">
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="排产单号">
<span style="color:#2c3e50;font-weight:500;">{{ editForm.scheduleNo }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="订货单位">
<el-input v-model="editForm.customerName" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input v-model="editForm.spec" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材质" prop="material">
<el-input v-model="editForm.material" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="排产吨数">
<el-input-number v-model="editForm.scheduleWeight" :min="0" :precision="3" :controls="false" style="width:100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="排产总计划吨数">
<el-input-number v-model="editForm.totalPlanWeight" :min="0" :precision="3" :controls="false" style="width:100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="品名">
<el-input v-model="editForm.productType" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="品名项">
<el-input v-model="editForm.productItem" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="业务员">
<el-input v-model="editForm.businessUser" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话">
<el-input v-model="editForm.businessPhone" />
</el-form-item>
</el-col>
</el-row>
<!-- <el-row :gutter="16">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="关联销售合同号">-->
<!-- <el-input v-model="editForm.relContractNo" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="订单日期">-->
<!-- <el-date-picker v-model="editForm.orderDate" type="date" value-format="yyyy-MM-dd" style="width:100%" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="交货期(天)">
<el-input-number v-model="editForm.deliveryCycle" :min="0" :controls="false" style="width:100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品用途">
<el-input v-model="editForm.usePurpose" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="厚度公差">
<el-input v-model="editForm.thicknessTolerance" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="宽度公差">
<el-input v-model="editForm.widthTolerance" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="表面质量">
<el-input v-model="editForm.surfaceQuality" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="表面处理">
<el-input v-model="editForm.surfaceTreatment" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="内径尺寸">
<el-input v-model="editForm.innerDiameter" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="外径要求">
<el-input v-model="editForm.outerDiameter" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="包装要求">
<el-input v-model="editForm.packReq" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="切边要求">
<el-input v-model="editForm.cutEdgeReq" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="单件重量">
<el-input v-model="editForm.singleCoilWeight" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="交货重量偏差">
<el-input v-model="editForm.weightDeviation" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="24">
<el-form-item label="其他技术要求">
<el-input v-model="editForm.otherTechReq" type="textarea" :rows="2" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="24">
<el-form-item label="付款情况说明">
<el-input v-model="editForm.paymentDesc" type="textarea" :rows="2" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="单行排产备注">
<el-input v-model="editForm.rowRemark" type="textarea" :rows="2" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注">
<el-input v-model="editForm.remark" type="textarea" :rows="2" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="editBtnLoading" type="danger" @click="submitEditForm"> </el-button>
<el-button @click="editDialogVisible = false"> </el-button>
</div>
</el-dialog>
<!-- 合并排产明细对话框 -->
<el-dialog
title="合并排产明细"
:visible.sync="mergeDialogVisible"
width="850px"
append-to-body
:close-on-click-modal="false"
>
<div style="margin-bottom:12px;font-size:13px;color:#e67e22;">
选中 {{ mergeForm.itemCount }} 条明细请选择一个作为合并模板下方字段将自动填充您可修改后确认合并
</div>
<!-- 选择模板 -->
<el-table :data="mergeSourceRows" border size="small" style="margin-bottom:12px;" @row-click="pickMergeTemplate">
<el-table-column width="50" align="center">
<template slot-scope="scope">
<el-radio v-model="mergeTemplateIndex" :label="scope.$index" @click.native.stop />
</template>
</el-table-column>
<el-table-column label="排产单号" prop="scheduleNo" min-width="130" show-overflow-tooltip />
<el-table-column label="规格" prop="spec" min-width="100" show-overflow-tooltip />
<el-table-column label="材质" prop="material" width="80" show-overflow-tooltip />
<el-table-column label="排产吨数" prop="scheduleWeight" width="90" align="right" />
<el-table-column label="品名" prop="productType" min-width="80" show-overflow-tooltip />
<el-table-column label="订货单位" prop="customerName" min-width="120" show-overflow-tooltip />
</el-table>
<!-- 合并表单 -->
<el-form ref="mergeFormRef" :model="mergeForm" label-width="110px" size="small">
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="排产单号"><el-input v-model="mergeForm.scheduleNo" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="订货单位"><el-input v-model="mergeForm.customerName" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="规格"><el-input v-model="mergeForm.spec" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材质"><el-input v-model="mergeForm.material" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="排产吨数(累加)">
<el-input-number v-model="mergeForm.scheduleWeight" :min="0" :precision="3" :controls="false" style="width:100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="品名"><el-input v-model="mergeForm.productType" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="品名项"><el-input v-model="mergeForm.productItem" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="业务员"><el-input v-model="mergeForm.businessUser" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="联系电话"><el-input v-model="mergeForm.businessPhone" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="交货期(天)">
<el-input-number v-model="mergeForm.deliveryCycle" :min="0" :controls="false" style="width:100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="产品用途"><el-input v-model="mergeForm.usePurpose" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="厚度公差"><el-input v-model="mergeForm.thicknessTolerance" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="宽度公差"><el-input v-model="mergeForm.widthTolerance" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="表面质量"><el-input v-model="mergeForm.surfaceQuality" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="表面处理"><el-input v-model="mergeForm.surfaceTreatment" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内径尺寸"><el-input v-model="mergeForm.innerDiameter" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="外径要求"><el-input v-model="mergeForm.outerDiameter" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="包装要求"><el-input v-model="mergeForm.packReq" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="切边要求"><el-input v-model="mergeForm.cutEdgeReq" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单件重量"><el-input v-model="mergeForm.singleCoilWeight" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="交货重量偏差"><el-input v-model="mergeForm.weightDeviation" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="其他技术要求"><el-input v-model="mergeForm.otherTechReq" /></el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="付款情况说明"><el-input v-model="mergeForm.paymentDesc" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注"><el-input v-model="mergeForm.remark" /></el-form-item>
</el-col>
</el-row>
</el-form>
<div style="margin-top:8px;font-size:12px;color:#909399;">
合并后 schedule_detail_ids{{ mergeForm.scheduleDetailIds }}
</div>
<div slot="footer" class="dialog-footer">
<el-button :loading="mergeBtnLoading" type="warning" @click="confirmMerge"> </el-button>
<el-button @click="mergeDialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@@ -275,9 +621,10 @@ import {
import {
getCrmOrderInfo,
listScheduleItem,
addScheduleItem,
updateScheduleItem,
delScheduleItem
delScheduleItem,
receiveScheduleItem,
mergeScheduleItem
} from '@/api/aps/schedule'
export default {
@@ -301,6 +648,24 @@ export default {
// 已排产
scheduledItemList: [],
selectedItems: [],
sourceColorMap: {},
// 合并对话框
mergeDialogVisible: false,
mergeBtnLoading: false,
mergeTemplateIndex: 0,
mergeSourceRows: [],
mergeForm: {
itemCount: 0, scheduleNo: '', customerName: '', spec: '', material: '',
scheduleWeight: 0, productType: '', productItem: '', businessUser: '',
businessPhone: '', deliveryCycle: undefined, usePurpose: '',
thicknessTolerance: '', widthTolerance: '', surfaceQuality: '',
surfaceTreatment: '', innerDiameter: '', outerDiameter: '',
packReq: '', cutEdgeReq: '', singleCoilWeight: '',
weightDeviation: '', otherTechReq: '', paymentDesc: '',
remark: '', scheduleDetailIds: ''
},
// 驳回
rejectDialogVisible: false,
@@ -322,20 +687,47 @@ export default {
drillOrder: null
}
},
watch: {
activeTab() {
this.selectedItems = []
}
},
created() {
this.handleQuery()
},
methods: {
getEmptyEditForm() {
return {
itemId: undefined,
scheduleId: undefined,
scheduleNo: '',
prodDate: '',
scheduleStatus: undefined,
totalPlanWeight: undefined,
relContractNo: '',
businessUser: '',
businessPhone: '',
orderDate: '',
customerName: '',
deliveryCycle: undefined,
usePurpose: '',
productType: '',
thicknessTolerance: '',
widthTolerance: '',
surfaceQuality: '',
surfaceTreatment: '',
innerDiameter: '',
outerDiameter: '',
packReq: '',
cutEdgeReq: '',
singleCoilWeight: '',
weightDeviation: '',
otherTechReq: '',
paymentDesc: '',
spec: '',
material: '',
scheduleWeight: 0,
productType: '',
customerName: '',
productItem: '',
rowRemark: '',
remark: ''
}
},
@@ -386,40 +778,18 @@ export default {
},
handleAccept(sch) {
const details = sch.detailList || []
if (details.length === 0) {
this.$message.warning('该产需单无可排产的明细')
return
}
this.$confirm(
`确认接收产需单「${sch.scheduleNo}」的全部排产明细吗?`,
`确认接收产需单「${sch.scheduleNo}」的全部排产明细吗?${details.length} 条明细`,
'提示',
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
).then(() => {
const details = sch.detailList || []
if (details.length === 0) {
this.$message.warning('该产需单无可排产的明细')
return
}
const promises = details.map(detail =>
addScheduleItem({
scheduleId: sch.scheduleId,
scheduleNo: sch.scheduleNo,
spec: detail.spec || '',
material: detail.material || '',
scheduleWeight: detail.scheduleWeight || 0,
productType: sch.productType || detail.productType || '',
customerName: sch.customerName || '',
remark: detail.remark || ''
})
)
// 更新产需单状态为 2已接收
promises.push(
updateRequirement({
scheduleId: sch.scheduleId,
scheduleStatus: 2
})
)
this.$message.info('正在处理接收...')
Promise.all(promises).then(() => {
receiveScheduleItem(sch.scheduleId).then(() => {
this.$modal.msgSuccess('接收成功,排产明细已写入')
this.queryPending()
}).catch(() => {
@@ -463,12 +833,24 @@ export default {
queryScheduled() {
this.schLoading = true
this.scheduledItemList = []
this.sourceColorMap = {}
this.selectedItems = []
listScheduleItem({ prodDate: this.queryDate, pageNum: 1, pageSize: 999 }).then(res => {
this.scheduledItemList = res.rows || []
const totalWeight = this.scheduledItemList.reduce((sum, d) => sum + (parseFloat(d.scheduleWeight) || 0), 0)
this.scheduledItemList = (res.rows || []).sort((a, b) => (a.scheduleNo || '').localeCompare(b.scheduleNo || ''))
try {
this.sourceColorMap = this.buildGroupColorMap(this.scheduledItemList)
} catch (e) {
console.error('buildGroupColorMap error:', e)
this.sourceColorMap = {}
}
const totalWeight = this.scheduledItemList.reduce((sum, d) => {
const w = parseFloat(d.scheduleWeight)
return sum + (isNaN(w) ? 0 : w)
}, 0)
this.summaryText = `${this.scheduledItemList.length} 条明细,排产总吨数 ${totalWeight.toFixed(3)}`
}).catch(() => {
}).catch((e) => {
console.error('queryScheduled error:', e)
this.scheduledItemList = []
this.summaryText = ''
}).finally(() => {
@@ -504,7 +886,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delScheduleItem(row.itemId || row.scheduleItemId).then(() => {
delScheduleItem(row.scheduleId).then(() => {
this.$modal.msgSuccess('删除成功')
this.queryScheduled()
}).catch(() => {
@@ -513,6 +895,97 @@ export default {
}).catch(() => {})
},
// ====== 合并 ======
handleSelectionChange(rows) {
this.selectedItems = rows
},
getItemRowClassName({ row }) {
const key = row.scheduleNo
if (!key) return ''
const colorIndex = this.sourceColorMap[key]
return colorIndex !== undefined ? `merge-source-${colorIndex}` : ''
},
buildGroupColorMap(list) {
const map = {}
let colorIdx = 0
list.forEach(item => {
const key = item.scheduleNo
if (!key) return
if (!(key in map)) {
map[key] = colorIdx % 5
colorIdx++
}
})
return map
},
handleMergePrepare() {
if (this.selectedItems.length < 2) {
this.$message.warning('请至少选择2条排产明细进行合并')
return
}
this.mergeSourceRows = [...this.selectedItems]
this.mergeTemplateIndex = 0
this.pickMergeTemplate(this.mergeSourceRows[0])
this.mergeDialogVisible = true
},
pickMergeTemplate(row) {
const idx = this.mergeSourceRows.indexOf(row)
if (idx >= 0) this.mergeTemplateIndex = idx
this.mergeForm = {
itemCount: this.mergeSourceRows.length,
scheduleNo: row.scheduleNo || '',
customerName: row.customerName || '',
spec: row.spec || '',
material: row.material || '',
scheduleWeight: this.mergeSourceRows.reduce((sum, r) => sum + (parseFloat(r.scheduleWeight) || 0), 0),
productType: row.productType || '',
productItem: row.productItem || '',
businessUser: row.businessUser || '',
businessPhone: row.businessPhone || '',
deliveryCycle: row.deliveryCycle,
usePurpose: row.usePurpose || '',
thicknessTolerance: row.thicknessTolerance || '',
widthTolerance: row.widthTolerance || '',
surfaceQuality: row.surfaceQuality || '',
surfaceTreatment: row.surfaceTreatment || '',
innerDiameter: row.innerDiameter || '',
outerDiameter: row.outerDiameter || '',
packReq: row.packReq || '',
cutEdgeReq: row.cutEdgeReq || '',
singleCoilWeight: row.singleCoilWeight || '',
weightDeviation: row.weightDeviation || '',
otherTechReq: row.otherTechReq || '',
paymentDesc: row.paymentDesc || '',
remark: row.remark || '',
scheduleDetailIds: this.mergeSourceRows.map(r => r.scheduleDetailIds || '').filter(Boolean).join(',')
}
},
confirmMerge() {
this.mergeBtnLoading = true
const ids = this.mergeSourceRows.map(r => r.scheduleId)
const mergedBo = {
...this.mergeForm,
prodDate: this.queryDate,
scheduleStatus: 2
}
delete mergedBo.itemCount
mergeScheduleItem({ ids, mergedBo }).then(() => {
this.$modal.msgSuccess(`合并成功:${ids.length} 条明细合并为 1 条`)
this.mergeDialogVisible = false
this.selectedItems = []
this.queryScheduled()
}).catch(() => {
this.$modal.msgError('合并失败')
}).finally(() => {
this.mergeBtnLoading = false
})
},
// ====== 下钻 & 辅助方法 ======
scheduleTotalWeight(sch) {
const details = sch.detailList || []
@@ -594,6 +1067,7 @@ export default {
flex: 1;
overflow: auto;
min-height: 0;
overflow-x: auto;
}
}
@@ -830,4 +1304,21 @@ export default {
color: $aps-text-muted;
font-size: 12px;
}
// ====== 合并候选行颜色高亮(同一源排产单 → 同色) ======
::v-deep .el-table__body tr.merge-source-0 > td {
background-color: #f0f5ff !important;
}
::v-deep .el-table__body tr.merge-source-1 > td {
background-color: #f6ffed !important;
}
::v-deep .el-table__body tr.merge-source-2 > td {
background-color: #fff7e6 !important;
}
::v-deep .el-table__body tr.merge-source-3 > td {
background-color: #f9f0ff !important;
}
::v-deep .el-table__body tr.merge-source-4 > td {
background-color: #fff0f6 !important;
}
</style>

View File

@@ -1,13 +1,63 @@
<template>
<div v-if="enabled" class="section-container">
<div class="detail-section">
<div class="detail-section-label">Complaint Content · 投诉情况</div>
<div class="detail-section-label">Complaint Content · 投诉情况与客户诉求</div>
<div class="detail-section-text">{{ data.complaintContent || '-' }}</div>
</div>
<div class="detail-section" v-if="customerInfo">
<div class="detail-section-label">Customer · 关联客户</div>
<div class="customer-info-card">
<div class="customer-row">
<span class="customer-row-label">公司名称</span>
<span class="customer-row-value">{{ customerInfo.companyName || '-' }}</span>
</div>
<div class="customer-row">
<span class="customer-row-label">联系人</span>
<span class="customer-row-value">{{ customerInfo.contactPerson || '-' }}</span>
</div>
<div class="customer-row">
<span class="customer-row-label">联系方式</span>
<span class="customer-row-value">{{ customerInfo.contactWay || '-' }}</span>
</div>
<div class="customer-row">
<span class="customer-row-label">客户地址</span>
<span class="customer-row-value">{{ customerInfo.address || '-' }}</span>
</div>
<div class="customer-row">
<span class="customer-row-label">客户等级</span>
<span class="customer-row-value">{{ customerInfo.customerLevel || '-' }}</span>
</div>
</div>
</div>
<div class="detail-section" v-else>
<div class="detail-section-label">Customer · 关联客户</div>
<div class="detail-section-text">-</div>
</div>
<div class="detail-section">
<div class="detail-section-label">Customer Demand · 客户诉求</div>
<div class="detail-section-text">{{ data.customerDemand || '-' }}</div>
<div class="detail-section-label">Downstream User · 下游使用用户</div>
<div class="detail-section-text">{{ data.downstreamUserName || '-' }}</div>
</div>
<div class="detail-section">
<div class="detail-section-label">Phone · 电话</div>
<div class="detail-section-text">{{ data.phone || '-' }}</div>
</div>
<div class="detail-section">
<div class="detail-section-label">Project Name · 工程名称</div>
<div class="detail-section-text">{{ data.projectName || '-' }}</div>
</div>
<div class="detail-section">
<div class="detail-section-label">Project Location · 使用地点</div>
<div class="detail-section-text">{{ data.projectLocation || '-' }}</div>
</div>
<div class="detail-section">
<div class="detail-section-label">Product Usage · 产品用途</div>
<div class="detail-section-text">{{ data.productUsage || '-' }}</div>
</div>
<div class="detail-section" v-if="data.file">
@@ -19,6 +69,7 @@
<script>
import FileList from "@/components/FileList/index.vue";
import { getCustomer } from "@/api/crm/customer";
export default {
name: 'BasicInfoSection',
@@ -32,6 +83,27 @@ export default {
type: Object,
default: () => ({})
}
},
data() {
return {
customerInfo: null
};
},
watch: {
'data.customerId': {
immediate: true,
handler(val) {
if (val) {
getCustomer(val).then(response => {
this.customerInfo = response.data || null;
}).catch(() => {
this.customerInfo = null;
});
} else {
this.customerInfo = null;
}
}
}
}
}
</script>
@@ -59,4 +131,38 @@ export default {
padding-bottom: 12px;
border-bottom: 1px solid #eeeae4;
}
/* ===== 客户信息卡片 ===== */
.customer-info-card {
padding: 10px 14px;
background: #faf8f5;
border: 1px solid #e8e4de;
border-radius: 2px;
margin-bottom: 6px;
}
.customer-row {
display: flex;
gap: 14px;
padding: 3px 0;
}
.customer-row + .customer-row {
border-top: 1px solid #f0ece6;
}
.customer-row-label {
flex-shrink: 0;
width: 70px;
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 11px;
color: #8c8c8c;
letter-spacing: 0.3px;
}
.customer-row-value {
flex: 1;
font-size: 13px;
color: #1a1a1a;
}
</style>

View File

@@ -11,15 +11,18 @@
<el-table-column label="厂家卷号" align="center" prop="coilInfo.supplierCoilNo" width="140" show-overflow-tooltip />
<el-table-column label="物料名称" align="center" prop="coilInfo.itemName" width="100" />
<el-table-column label="规格" align="center" prop="coilInfo.specification" width="100" />
<el-table-column label="制造时间" align="center" prop="coilInfo.createTime" width="90" />
<el-table-column label="发货时间" align="center" prop="coilInfo.exportTime" width="90" />
<el-table-column label="发货人" align="center" prop="coilInfo.exportBy" width="90" />
<el-table-column label="材质" align="center" prop="coilInfo.material" width="100" />
<el-table-column label="厂家" align="center" prop="coilInfo.manufacturer" width="90" />
<el-table-column label="厂家" align="center" prop="coilInfo.manufacturer" width="60" />
<el-table-column label="净重(t)" align="center" prop="coilInfo.netWeight" width="80" />
<el-table-column label="质量状态" align="center" prop="coilInfo.qualityStatus" width="90">
<el-table-column label="质" align="center" prop="coilInfo.qualityStatus" width="60">
<template slot-scope="scope">
<dict-tag v-if="scope.row.coilInfo.qualityStatus" :options="dict.type.coil_quality_status" :value="scope.row.coilInfo.qualityStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="coilInfo.remark" width="140" show-overflow-tooltip />
<el-table-column label="备注" align="center" prop="coilInfo.remark" show-overflow-tooltip />
<el-table-column v-if="editable" label="操作" align="center" width="70" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="$emit('remove', scope.row)"></el-button>

View File

@@ -17,8 +17,13 @@
<el-tag v-else-if="item.taskStatus === 1" type="success" size="mini">已完成</el-tag>
</div>
<div class="opinion-card-body">
<div v-if="item.deptOpinion" class="opinion-content" v-html="item.deptOpinion"></div>
<div v-else class="opinion-empty"> No opinion yet · 暂无意见 </div>
<template v-if="isJsonOpinion(item.deptOpinion)">
<DeptOpinionPreview :deptId="item.deptId" :jsonData="item.deptOpinion" />
</template>
<template v-else>
<div v-if="item.deptOpinion" class="opinion-content" v-html="item.deptOpinion"></div>
<div v-else class="opinion-empty"> No opinion yet · 暂无意见 </div>
</template>
<div v-if="item.fillFile" class="opinion-file">
<FileList :ossIds="item.fillFile" />
</div>
@@ -35,10 +40,11 @@
<script>
import FileList from "@/components/FileList/index.vue";
import DeptOpinionPreview from "./DeptOpinionPreview.vue";
export default {
name: 'DepartmentOpinionSection',
components: { FileList },
components: { FileList, DeptOpinionPreview },
props: {
enabled: {
type: Boolean,
@@ -50,6 +56,15 @@ export default {
}
},
methods: {
isJsonOpinion(str) {
if (!str) return false;
try {
const obj = JSON.parse(str);
return obj && typeof obj === 'object' && !Array.isArray(obj);
} catch (e) {
return false;
}
},
getDeptName(deptId) {
const map = { 1: '生产部', 2: '质量部', 3: '销售部' };
return map[deptId] || '部门' + deptId;

View File

@@ -0,0 +1,146 @@
<template>
<div class="dept-form-container">
<!-- 生产部 deptId=1 -->
<template v-if="deptId === 1">
<el-form-item label="内部调查情况" prop="internalInvestigation">
<el-input v-model="formData.internalInvestigation" type="textarea" :rows="3" placeholder="请描述内部调查情况" @input="emitJson" />
</el-form-item>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="确认人" prop="internalConfirmer">
<el-input v-model="formData.internalConfirmer" placeholder="请输入确认人" @input="emitJson" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="日期" prop="internalConfirmDate">
<el-date-picker v-model="formData.internalConfirmDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width:100%" @change="emitJson" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="外部调查情况" prop="externalInvestigation">
<el-input v-model="formData.externalInvestigation" type="textarea" :rows="3" placeholder="请描述外部调查情况" @input="emitJson" />
</el-form-item>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="确认人" prop="externalConfirmer">
<el-input v-model="formData.externalConfirmer" placeholder="请输入确认人" @input="emitJson" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="日期" prop="externalConfirmDate">
<el-date-picker v-model="formData.externalConfirmDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width:100%" @change="emitJson" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="责任单位" prop="responsibleUnit">
<el-input v-model="formData.responsibleUnit" placeholder="请输入责任单位" @input="emitJson" />
</el-form-item>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="接收人" prop="receiver">
<el-input v-model="formData.receiver" placeholder="请输入接收人" @input="emitJson" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="接受日期" prop="acceptDate">
<el-date-picker v-model="formData.acceptDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width:100%" @change="emitJson" />
</el-form-item>
</el-col>
</el-row>
</template>
<!-- 质量部 deptId=2 -->
<template v-else-if="deptId === 2">
<el-form-item label="产生原因" prop="cause">
<el-input v-model="formData.cause" type="textarea" :rows="3" placeholder="请描述产生原因" @input="emitJson" />
</el-form-item>
<el-form-item label="流出原因" prop="escapeReason">
<el-input v-model="formData.escapeReason" type="textarea" :rows="3" placeholder="请描述流出原因" @input="emitJson" />
</el-form-item>
<el-form-item label="纠正措施" prop="correctiveAction">
<el-input v-model="formData.correctiveAction" type="textarea" :rows="3" placeholder="请输入纠正措施" @input="emitJson" />
</el-form-item>
<el-form-item label="预计整改完成日期" prop="rectifyDate">
<el-date-picker v-model="formData.rectifyDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width:100%" @change="emitJson" />
</el-form-item>
<el-form-item label="主管意见" prop="supervisorOpinion">
<el-input v-model="formData.supervisorOpinion" type="textarea" :rows="2" placeholder="请输入主管意见" @input="emitJson" />
</el-form-item>
</template>
<!-- 销售部 deptId=3 -->
<template v-else>
<el-form-item label="处理意见" prop="handlingOpinion">
<el-input v-model="formData.handlingOpinion" type="textarea" :rows="4" placeholder="请输入处理意见" @input="emitJson" />
</el-form-item>
<el-form-item label="领导意见" prop="leaderOpinion">
<el-input v-model="formData.leaderOpinion" type="textarea" :rows="3" placeholder="请输入领导意见" @input="emitJson" />
</el-form-item>
</template>
</div>
</template>
<script>
export default {
name: 'DeptOpinionForm',
props: {
deptId: {
type: Number,
required: true
},
jsonData: {
type: String,
default: ''
}
},
data() {
return {
formData: {}
};
},
watch: {
jsonData: {
immediate: true,
handler(val) {
this.parseJson(val);
}
},
deptId() {
this.parseJson(this.jsonData);
}
},
methods: {
parseJson(val) {
const defaults = this.getDefaults();
if (val) {
try {
const parsed = JSON.parse(val);
this.formData = { ...defaults, ...parsed };
} catch (e) {
this.formData = { ...defaults };
}
} else {
this.formData = { ...defaults };
}
},
getDefaults() {
if (this.deptId === 1) {
return { internalInvestigation: '', internalConfirmer: '', internalConfirmDate: '', externalInvestigation: '', externalConfirmer: '', externalConfirmDate: '', responsibleUnit: '', receiver: '', acceptDate: '' };
} else if (this.deptId === 2) {
return { cause: '', escapeReason: '', correctiveAction: '', rectifyDate: '', supervisorOpinion: '' };
} else {
return { handlingOpinion: '', leaderOpinion: '' };
}
},
emitJson() {
this.$emit('input', JSON.stringify(this.formData));
}
}
};
</script>
<style scoped>
.dept-form-container {
width: 100%;
}
</style>

View File

@@ -0,0 +1,137 @@
<template>
<div class="dept-preview-container">
<template v-if="parsedData">
<!-- 生产部 deptId=1 -->
<template v-if="deptId === 1">
<div class="preview-row" v-if="parsedData.internalInvestigation">
<span class="preview-label">内部调查情况</span>
<span class="preview-value">{{ parsedData.internalInvestigation }}</span>
</div>
<div class="preview-row" v-if="parsedData.internalConfirmer || parsedData.internalConfirmDate">
<span class="preview-label">内部确认</span>
<span class="preview-value">{{ parsedData.internalConfirmer || '-' }} / {{ parsedData.internalConfirmDate || '-' }}</span>
</div>
<div class="preview-row" v-if="parsedData.externalInvestigation">
<span class="preview-label">外部调查情况</span>
<span class="preview-value">{{ parsedData.externalInvestigation }}</span>
</div>
<div class="preview-row" v-if="parsedData.externalConfirmer || parsedData.externalConfirmDate">
<span class="preview-label">外部确认</span>
<span class="preview-value">{{ parsedData.externalConfirmer || '-' }} / {{ parsedData.externalConfirmDate || '-' }}</span>
</div>
<div class="preview-row" v-if="parsedData.responsibleUnit">
<span class="preview-label">责任单位</span>
<span class="preview-value">{{ parsedData.responsibleUnit }}</span>
</div>
<div class="preview-row" v-if="parsedData.receiver || parsedData.acceptDate">
<span class="preview-label">接收</span>
<span class="preview-value">{{ parsedData.receiver || '-' }} / {{ parsedData.acceptDate || '-' }}</span>
</div>
</template>
<!-- 质量部 deptId=2 -->
<template v-else-if="deptId === 2">
<div class="preview-row" v-if="parsedData.cause">
<span class="preview-label">产生原因</span>
<span class="preview-value">{{ parsedData.cause }}</span>
</div>
<div class="preview-row" v-if="parsedData.escapeReason">
<span class="preview-label">流出原因</span>
<span class="preview-value">{{ parsedData.escapeReason }}</span>
</div>
<div class="preview-row" v-if="parsedData.correctiveAction">
<span class="preview-label">纠正措施</span>
<span class="preview-value">{{ parsedData.correctiveAction }}</span>
</div>
<div class="preview-row" v-if="parsedData.rectifyDate">
<span class="preview-label">预计整改日期</span>
<span class="preview-value">{{ parsedData.rectifyDate }}</span>
</div>
<div class="preview-row" v-if="parsedData.supervisorOpinion">
<span class="preview-label">主管意见</span>
<span class="preview-value">{{ parsedData.supervisorOpinion }}</span>
</div>
</template>
<!-- 销售部 deptId=3 -->
<template v-else>
<div class="preview-row" v-if="parsedData.handlingOpinion">
<span class="preview-label">处理意见</span>
<span class="preview-value">{{ parsedData.handlingOpinion }}</span>
</div>
<div class="preview-row" v-if="parsedData.leaderOpinion">
<span class="preview-label">领导意见</span>
<span class="preview-value">{{ parsedData.leaderOpinion }}</span>
</div>
</template>
</template>
<div v-else class="preview-empty"> No data · 暂无数据 </div>
</div>
</template>
<script>
export default {
name: 'DeptOpinionPreview',
props: {
deptId: {
type: Number,
required: true
},
jsonData: {
type: String,
default: ''
}
},
computed: {
parsedData() {
if (!this.jsonData) return null;
try {
return JSON.parse(this.jsonData);
} catch (e) {
return null;
}
}
}
};
</script>
<style scoped>
.dept-preview-container {
font-size: 13px;
color: #3a3a3a;
line-height: 1.7;
}
.preview-row {
display: flex;
gap: 12px;
padding: 4px 0;
border-bottom: 1px solid #f0ece6;
}
.preview-row:last-child {
border-bottom: none;
}
.preview-label {
flex-shrink: 0;
width: 100px;
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 11px;
color: #8c8c8c;
letter-spacing: 0.3px;
}
.preview-value {
flex: 1;
color: #1a1a1a;
word-break: break-all;
}
.preview-empty {
color: #bab5ae;
font-size: 12px;
font-style: italic;
font-family: 'Georgia', 'Times New Roman', serif;
}
</style>

View File

@@ -0,0 +1,621 @@
<template>
<el-dialog title="导出质量异议资料" :visible.sync="visible" width="90%" top="3vh" append-to-body destroy-on-close
:close-on-click-modal="false" @close="handleClose">
<div v-loading="loading" class="export-preview">
<div ref="pdfContent" class="pdf-content">
<!-- ========== 附件一质量异议反馈单 ========== -->
<div class="attachment-section">
<h2 class="doc-title">质量异议反馈单</h2>
<table class="form-table">
<tr>
<td class="label" style="width:120px">异议反馈单位</td>
<td colspan="5">{{ customer.companyName || '' }}</td>
</tr>
<tr>
<td class="label">联系人</td>
<td style="width:180px">{{ customer.contactPerson || '' }}</td>
<td class="label" style="width:100px">联系电话</td>
<td colspan="3">{{ customer.contactWay || '' }}</td>
</tr>
</table>
<table class="form-table" style="margin-top:-1px">
<tr>
<td class="label" style="width:60px;vertical-align:middle" :rowspan="8">情况概述<br>用户提供</td>
<td class="label" style="width:120px">产品名称</td>
<td style="width:180px">{{ firstCoil.itemName || '' }}</td>
<td class="label" style="width:110px">异议合同号</td>
<td>{{ firstContract.contractCode || '' }}</td>
</tr>
<tr>
<td class="label">合同交货量</td>
<td>{{ firstContract.orderAmount || '' }}</td>
<td class="label">牌号/钢种</td>
<td>{{ firstCoil.material || '' }}</td>
</tr>
<tr>
<td class="label">规格</td>
<td>{{ firstCoil.specification || '' }}</td>
<td class="label">异议量</td>
<td>{{ coilWeightSummary }}</td>
</tr>
<tr>
<td class="label">采购日期</td>
<td>{{ detail.complaintDate | formatDate }}</td>
<td class="label">使用日期</td>
<td>{{ firstCoil.exportTime | formatDate }}</td>
</tr>
<tr>
<td class="label">产品卷号</td>
<td colspan="3">{{ coilNoSummary }}</td>
</tr>
<tr>
<td class="label">产品生产日期</td>
<td colspan="3">{{ firstCoil.createTime | formatDate }}</td>
</tr>
<tr>
<td class="label">下游使用用户名称</td>
<td>{{ detail.downstreamUserName || '' }}</td>
<td class="label">电话</td>
<td>{{ detail.phone || '' }}</td>
</tr>
<tr>
<td class="label">使用的工程名称</td>
<td>{{ detail.projectName || '' }}</td>
<td class="label">工程使用地点</td>
<td>{{ detail.projectLocation || '' }}</td>
</tr>
<tr>
<td class="label" style="vertical-align:middle">产品用途</td>
<td colspan="3">{{ detail.productUsage || '' }}</td>
</tr>
</table>
<div class="complaint-desc">
<div class="desc-label">产品异议描述缺陷描述缺陷程度缺陷部位缺陷数量发生缺陷的生产/使用工序特殊说明等等</div>
<div class="desc-content">{{ detail.complaintContent || '' }}</div>
</div>
<div class="stamp-area">
<div>单位盖章</div>
<div style="margin-top:20px">日期</div>
</div>
<div class="company-section">
<div class="company-header">科伦普公司填写</div>
<table class="form-table" style="margin-top:0">
<tr>
<td class="label" style="width:120px">异议提交人</td>
<td>{{ currentUser }}</td>
<td class="label" style="width:80px">日期</td>
<td>{{ today }}</td>
</tr>
</table>
</div>
</div>
<!-- ========== 附件二质量投诉立案确认及处置单 ========== -->
<div class="page-break"></div>
<div class="attachment-section">
<h2 class="doc-title">附件 2</h2>
<h3 class="sub-title">质量投诉立案确认及处置单</h3>
<table class="form-table">
<tr>
<td class="label" style="width:120px">收到日期</td>
<td style="width:180px">{{ detail.complaintDate | formatDate }}</td>
<td class="label" style="width:100px">投诉单编号</td>
<td>{{ detail.complaintNo || '' }}</td>
</tr>
<tr>
<td class="label">异议反馈单位</td>
<td>{{ customer.companyName || '' }}</td>
<td class="label">反馈人姓名</td>
<td>{{ customer.contactPerson || '' }}</td>
</tr>
<tr>
<td class="label">信息接收人</td>
<td>{{ detail.auditOpinion || '' }}</td>
<td class="label">联系方式</td>
<td>{{ customer.contactWay || '' }}</td>
</tr>
<tr>
<td class="label">订货用户及使用<br>用户名称及地址</td>
<td colspan="3">{{ customer.companyName || '' }} {{ customer.address || '' }}</td>
</tr>
<tr>
<td class="label">产品名称</td>
<td>{{ firstCoil.itemName || '' }}</td>
<td class="label">合同号</td>
<td>{{ firstContract.contractCode || '' }}</td>
</tr>
<tr>
<td class="label">合同交货量</td>
<td>{{ firstContract.orderAmount || '' }}</td>
<td class="label">未出库量</td>
<td></td>
</tr>
<tr>
<td class="label">规格mm</td>
<td>{{ firstCoil.specification || '' }}</td>
<td class="label">产品钢种/牌号</td>
<td>{{ firstCoil.material || '' }}</td>
</tr>
<tr>
<td class="label">异议量</td>
<td>{{ coilWeightSummary }}</td>
<td class="label">产品用途</td>
<td>{{ detail.productUsage || '' }}</td>
</tr>
</table>
<div class="complaint-desc">
<div class="desc-label">问题描述产品卷号产品生产日期缺陷名称缺陷描述缺陷程度缺陷数量发生问题的生产工序等以及附加缺陷照片</div>
<div class="desc-content">客户反馈{{ detail.complaintContent || '' }}</div>
</div>
<table class="form-table">
<tr>
<td class="label" style="width:100px;vertical-align:middle" :rowspan="2">问题内/<br>外部调<br><br>确认</td>
<td class="label" style="width:60px">内部</td>
<td>
<div>{{ prodOpinion.internalInvestigation || '' }}</div>
<div style="text-align:right;margin-top:8px">
确认人{{ prodOpinion.internalConfirmer || '' }} 日期{{ prodOpinion.internalConfirmDate || '' }}
</div>
</td>
</tr>
<tr>
<td class="label">外部</td>
<td>
<div>{{ prodOpinion.externalInvestigation || '' }}</div>
<div style="text-align:right;margin-top:8px">
确认人{{ prodOpinion.externalConfirmer || '' }} 日期{{ prodOpinion.externalConfirmDate || '' }}
</div>
</td>
</tr>
</table>
<table class="form-table" style="margin-top:-1px">
<tr>
<td class="label" style="width:100px">责任单位</td>
<td style="width:200px">{{ prodOpinion.responsibleUnit || '' }}</td>
<td class="label" style="width:100px">接收人/日期</td>
<td>{{ prodOpinion.receiver || '' }} {{ prodOpinion.acceptDate || '' }}</td>
</tr>
</table>
<table class="form-table" style="margin-top:-1px">
<tr>
<td class="label" style="width:100px;vertical-align:middle" :rowspan="2">原因分析</td>
<td class="label" style="width:70px">产生原因</td>
<td>{{ qualityOpinion.cause || '' }}</td>
</tr>
<tr>
<td class="label">流出原因</td>
<td>{{ qualityOpinion.escapeReason || '' }}</td>
</tr>
</table>
<table class="form-table" style="margin-top:-1px">
<tr>
<td class="label" style="width:100px">纠正/预防措施</td>
<td>{{ qualityOpinion.correctiveAction || '' }}</td>
</tr>
</table>
<table class="form-table" style="margin-top:-1px">
<tr>
<td class="label" style="width:100px">整改计划完成时间</td>
<td style="width:200px">{{ qualityOpinion.rectifyDate || '' }}</td>
<td class="label" style="width:100px">责任人签字/日期</td>
<td></td>
</tr>
</table>
<table class="form-table" style="margin-top:-1px">
<tr>
<td class="label" style="width:120px">品质部主管审核</td>
<td>{{ qualityOpinion.supervisorOpinion || '' }}</td>
</tr>
</table>
<table class="form-table" style="margin-top:-1px">
<tr>
<td class="label" style="width:70px;vertical-align:middle">意见</td>
<td>
<div style="text-align:right">签字{{ qualityOpinion.internalConfirmer || '' }} 日期{{ qualityOpinion.internalConfirmDate || '' }}</div>
</td>
</tr>
<tr>
<td class="label" style="vertical-align:middle">商务<br>处置</td>
<td>
<table class="inner-table">
<tr>
<td class="label" style="width:100px">销售人员处<br>意见</td>
<td>{{ salesOpinion.handlingOpinion || '' }}</td>
</tr>
<tr>
<td class="label">销售部领导<br>审核意见</td>
<td>{{ salesOpinion.leaderOpinion || '' }}</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="label" style="vertical-align:middle">公司领导审批意<br></td>
<td>
<div style="min-height:40px">{{ detail.planContent || '' }}</div>
<div style="text-align:right;margin-top:8px">签字  日期</div>
</td>
</tr>
</table>
</div>
<!-- ========== 附件三缺陷图片 ========== -->
<div class="page-break"></div>
<div class="attachment-section">
<h2 class="doc-title">附缺陷照片</h2>
<div v-if="defectImages.length > 0" class="defect-grid">
<div v-for="(img, idx) in defectImages" :key="idx" class="defect-item">
<img :src="img" class="defect-img" />
</div>
</div>
<div v-else class="empty-tip">暂无缺陷照片</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" :loading="exporting" @click="exportPdf">
<i class="el-icon-download"></i> 导出PDF
</el-button>
</div>
</el-dialog>
</template>
<script>
import { getComplaintAccept } from "@/api/flow/complaintAccept";
import { listComplaintTask } from "@/api/flow/complaintTask";
import { listAcceptCoilRel } from "@/api/flow/acceptCoilRel";
import { getCustomer } from "@/api/crm/customer";
import { listByIds } from "@/api/system/oss";
import html2canvas from 'html2canvas';
import jsPDF from 'jspdf';
export default {
name: 'ExportPdfDialog',
filters: {
formatDate(val) {
if (!val) return '';
const d = new Date(val);
if (isNaN(d.getTime())) return val;
const y = d.getFullYear();
const m = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return `${y}.${m}.${day}`;
}
},
data() {
return {
visible: false,
loading: false,
exporting: false,
acceptId: null,
detail: {},
customer: {},
coilList: [],
taskList: [],
defectImages: []
};
},
computed: {
currentUser() {
return this.$store.state.user.name || '';
},
today() {
const d = new Date();
const y = d.getFullYear();
const m = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return `${y}.${m}.${day}`;
},
firstCoil() {
if (this.coilList.length === 0) return {};
const rel = this.coilList[0];
return rel.coilInfo || {};
},
firstContract() {
if (this.coilList.length === 0) return {};
const rel = this.coilList[0];
const orders = (rel.coilInfo && rel.coilInfo.orderList) || [];
return orders[0] || {};
},
coilNoSummary() {
return this.coilList
.map(rel => (rel.coilInfo && rel.coilInfo.currentCoilNo) || '')
.filter(Boolean)
.join('、');
},
coilWeightSummary() {
const weights = this.coilList
.map(rel => parseFloat((rel.coilInfo && rel.coilInfo.netWeight) || 0))
.filter(w => w > 0);
if (weights.length === 0) return '';
const total = weights.reduce((a, b) => a + b, 0);
return total.toFixed(3) + 't';
},
prodOpinion() {
return this.parseDeptOpinion(1);
},
qualityOpinion() {
return this.parseDeptOpinion(2);
},
salesOpinion() {
return this.parseDeptOpinion(3);
}
},
methods: {
open(acceptId) {
this.acceptId = acceptId;
this.visible = true;
this.loadData();
},
async loadData() {
this.loading = true;
try {
const [detailRes, taskRes, coilRes] = await Promise.all([
getComplaintAccept(this.acceptId),
listComplaintTask({ acceptId: this.acceptId, pageNum: 1, pageSize: 999 }),
listAcceptCoilRel({ acceptId: this.acceptId, pageNum: 1, pageSize: 999 })
]);
this.detail = detailRes.data || {};
this.taskList = (taskRes.rows || []).filter(t => t.rejectMark !== 1);
this.coilList = coilRes.rows || [];
if (this.detail.customerId) {
try {
const custRes = await getCustomer(this.detail.customerId);
this.customer = custRes.data || {};
} catch (e) {
this.customer = {};
}
}
if (this.detail.file) {
try {
const fileRes = await listByIds(this.detail.file);
const files = fileRes.data || [];
this.defectImages = files.map(f => f.url).filter(Boolean);
} catch (e) {
this.defectImages = [];
}
}
} catch (e) {
console.error('加载导出数据失败:', e);
this.$modal.msgError('加载数据失败');
} finally {
this.loading = false;
}
},
parseDeptOpinion(deptId) {
const task = this.taskList.find(t => t.deptId === deptId);
if (!task || !task.deptOpinion) return {};
try {
const obj = JSON.parse(task.deptOpinion);
return obj && typeof obj === 'object' ? obj : {};
} catch (e) {
return {};
}
},
handleClose() {
this.detail = {};
this.customer = {};
this.coilList = [];
this.taskList = [];
this.defectImages = [];
},
async exportPdf() {
const element = this.$refs.pdfContent;
if (!element) return;
this.exporting = true;
try {
const canvas = await html2canvas(element, {
scale: 2,
useCORS: true,
logging: false,
backgroundColor: '#ffffff',
windowWidth: 794
});
const imgData = canvas.toDataURL('image/png');
const pdf = new jsPDF('p', 'mm', 'a4');
const pdfWidth = pdf.internal.pageSize.getWidth();
const pageHeight = pdf.internal.pageSize.getHeight();
const imgWidth = pdfWidth;
const imgHeight = (canvas.height * imgWidth) / canvas.width;
if (imgHeight <= pageHeight) {
pdf.addImage(imgData, 'PNG', 0, 0, imgWidth, imgHeight);
} else {
let posY = 0;
const ratio = pdfWidth / canvas.width;
const pageCanvasHeight = pageHeight / ratio;
while (posY < canvas.height) {
if (posY > 0) pdf.addPage();
const pieceCanvas = document.createElement('canvas');
pieceCanvas.width = canvas.width;
pieceCanvas.height = Math.min(pageCanvasHeight, canvas.height - posY);
const ctx = pieceCanvas.getContext('2d');
ctx.drawImage(canvas, 0, posY, canvas.width, pieceCanvas.height, 0, 0, canvas.width, pieceCanvas.height);
const pieceData = pieceCanvas.toDataURL('image/png');
pdf.addImage(pieceData, 'PNG', 0, 0, imgWidth, pieceCanvas.height * ratio);
posY += pageCanvasHeight;
}
}
pdf.save(`${this.detail.complaintNo || '售后单'}_质量异议全套资料.pdf`);
this.$modal.msgSuccess('PDF导出成功');
this.visible = false;
} catch (err) {
console.error('PDF导出失败:', err);
this.$modal.msgError('PDF导出失败');
} finally {
this.exporting = false;
}
}
}
};
</script>
<style scoped>
.export-preview {
max-height: 70vh;
overflow-y: auto;
background: #f5f5f5;
padding: 16px;
}
.pdf-content {
width: 794px;
margin: 0 auto;
background: #ffffff;
padding: 40px 50px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.attachment-section {
margin-bottom: 20px;
}
.page-break {
page-break-after: always;
break-after: page;
height: 1px;
margin: 20px 0;
border-top: 1px dashed #ccc;
}
.doc-title {
text-align: center;
font-size: 20px;
font-weight: 700;
margin: 0 0 16px 0;
font-family: 'SimSun', 'Noto Serif SC', serif;
letter-spacing: 2px;
}
.sub-title {
text-align: center;
font-size: 16px;
font-weight: 700;
margin: 0 0 16px 0;
font-family: 'SimSun', 'Noto Serif SC', serif;
}
.form-table {
width: 100%;
border-collapse: collapse;
border: 1px solid #000;
font-size: 13px;
line-height: 1.6;
table-layout: fixed;
}
.form-table td {
border: 1px solid #000;
padding: 6px 8px;
word-break: break-all;
white-space: pre-wrap;
}
.form-table .label {
background-color: #f5f5f5;
font-weight: 500;
text-align: center;
vertical-align: middle;
}
.inner-table {
width: 100%;
border-collapse: collapse;
border: none;
}
.inner-table td {
border: 1px solid #000;
padding: 6px 8px;
word-break: break-all;
white-space: pre-wrap;
}
.complaint-desc {
border: 1px solid #000;
border-top: none;
padding: 10px 12px;
min-height: 80px;
}
.desc-label {
font-size: 12px;
color: #333;
margin-bottom: 8px;
}
.desc-content {
font-size: 13px;
line-height: 1.8;
white-space: pre-wrap;
}
.stamp-area {
border: 1px solid #000;
border-top: none;
padding: 16px 12px;
min-height: 60px;
font-size: 13px;
}
.company-section {
margin-top: 16px;
}
.company-header {
background-color: #f5f5f5;
text-align: center;
font-weight: 700;
font-size: 14px;
padding: 8px;
border: 1px solid #000;
}
.defect-grid {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.defect-item {
flex: 0 0 calc(50% - 6px);
border: 1px solid #ddd;
padding: 4px;
}
.defect-img {
width: 100%;
display: block;
object-fit: contain;
max-height: 300px;
}
.empty-tip {
text-align: center;
color: #999;
padding: 40px;
font-size: 14px;
}
.dialog-footer {
text-align: right;
}
</style>

View File

@@ -8,8 +8,6 @@
<el-step title="待审核" icon="el-icon-document" />
<el-step title="意见填写" icon="el-icon-edit-outline" />
<el-step title="汇总方案" icon="el-icon-s-data" />
<el-step title="执行反馈" icon="el-icon-s-promotion" />
<el-step title="执行完成" icon="el-icon-success" />
<el-step title="全部办结" icon="el-icon-circle-check" />
</el-steps>
<div class="current-status">
@@ -34,15 +32,13 @@ export default {
},
computed: {
/**
* el-steps active 属性是从 0 开始索引的
* 当 status=1 时 active=0待审核高亮
* status=2 时 active=1已完成待审核+意见填写中高亮),依此类推。
* status=5执行完成和 status=6全部办结共享第5步作为已完成状态。
* el-steps active 从 0 开始。
* 1=待审核→0, 2=意见填写→1, 3=汇总方案→2, 4=全部办结→3
*/
activeStep() {
if (this.flowStatus == null) return -1;
const v = Number(this.flowStatus);
if (v >= 6) return 5; // 全部办结 -> 第5步已完成
if (v >= 4) return 3;
return v - 1;
},
flowStatusText() {
@@ -50,9 +46,7 @@ export default {
1: '待审核',
2: '意见填写中',
3: '待汇总方案',
4: '执行反馈中',
5: '执行完成',
6: '全部办结'
4: '全部办结'
};
return map[this.flowStatus] || '未知';
},
@@ -61,9 +55,7 @@ export default {
1: 'info',
2: 'warning',
3: '',
4: 'warning',
5: 'success',
6: 'success'
4: 'success'
};
return map[this.flowStatus] || '';
}

View File

@@ -26,6 +26,8 @@
<span v-if="meta.complaintDate" title="投诉日期"><i class="el-icon-date"></i> 投诉日期{{ parseTime(meta.complaintDate, '{y}-{m}-{d}') }}</span>
</div>
<slot name="flow-overview"></slot>
<slot name="basic-info"></slot>
<slot name="contract-info"></slot>
</div>
@@ -58,9 +60,7 @@ export default {
1: '待审核',
2: '意见填写中',
3: '待汇总方案',
4: '执行反馈中',
5: '执行完成',
6: '全部办结'
4: '全部办结'
};
return map[this.flowStatus] || '未知';
},
@@ -69,9 +69,7 @@ export default {
1: 'info',
2: 'warning',
3: '',
4: 'warning',
5: 'success',
6: 'success'
4: 'success'
};
return map[this.flowStatus] || '';
}

View File

@@ -15,11 +15,9 @@
<el-option label="待审核" :value="1" />
<el-option label="意见填写中" :value="2" />
<el-option label="待汇总方案" :value="3" />
<el-option label="执行反馈中" :value="4" />
<el-option label="执行完成" :value="5" />
<el-option label="全部办结" :value="6" />
</el-select>
</div>
<el-option label="全部办结" :value="4" />
</el-select>
</div>
<div class="search-row">
<el-input v-model="queryParams.complaintNo" placeholder="搜索售后编号..." clearable prefix-icon="el-icon-search"
@@ -40,11 +38,11 @@
<el-tag v-if="item.flowStatus === 1" type="info" size="mini">待审核</el-tag>
<el-tag v-else-if="item.flowStatus === 2" type="warning" size="mini">意见填写中</el-tag>
<el-tag v-else-if="item.flowStatus === 3" size="mini">待汇总方案</el-tag>
<el-tag v-else-if="item.flowStatus === 4" type="warning" size="mini">执行反馈中</el-tag>
<el-tag v-else-if="item.flowStatus === 5" type="success" size="mini">执行完成</el-tag>
<el-tag v-else-if="item.flowStatus === 6" type="success" size="mini">全部办结</el-tag>
<el-tag v-else-if="item.flowStatus === 4" type="success" size="mini">全部办结</el-tag>
</div>
<div class="item-actions">
<el-button v-if="item.flowStatus === 4" size="mini" type="text" icon="el-icon-download"
@click.stop="handleExportPdf(item)" title="导出PDF"></el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="handleUpdate(item)"></el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleDelete(item)"></el-button>
</div>
@@ -76,7 +74,7 @@
:disabled="pdfLoading" title="导出PDF">导出PDF</el-button> -->
<el-button v-if="currentRow.flowStatus === 1" size="mini" type="primary" plain
icon="el-icon-s-promotion" @click="handleOpinionDispatch">意见下发</el-button>
<el-button v-if="currentRow.flowStatus === 3" size="mini" type="warning" plain
<el-button v-if="false" size="mini" type="warning" plain
icon="el-icon-s-promotion" @click="handleFeedbackDispatch">执行下发</el-button>
<el-button size="mini" type="text" icon="el-icon-refresh" @click="handleRefreshDetail"
title="刷新详情">刷新</el-button>
@@ -85,6 +83,10 @@
@click="handleDelete(currentRow)">删除</el-button>
</template>
<template #flow-overview>
<FlowOverviewSection :flowStatus="currentRow.flowStatus" />
</template>
<template #basic-info>
<BasicInfoSection :data="currentRow" />
</template>
@@ -92,8 +94,6 @@
<el-divider />
<FlowOverviewSection :flowStatus="currentRow.flowStatus" />
<CoilInfoSection :coilList="coilList" :loading="coilLoading" :editable="currentRow.flowStatus === 1"
@refresh="loadCoilList(currentRow.acceptId)"
@remove="handleRemoveCoil">
@@ -114,8 +114,11 @@
<div class="section-gap" />
<HandlingSchemeSection :content="currentRow.planContent" :editable="currentRow.flowStatus === 3" @save="handleSavePlan" />
<div class="section-gap" />
<template v-if="false">
<div class="section-gap" />
<ExecutionFeedbackSection :executeList="executeList" @refresh="refreshExecuteList" />
</template>
</div>
</div>
</template>
@@ -131,10 +134,25 @@
placeholder="请选择投诉日期" style="width:100%" />
</el-form-item>
<el-form-item label="投诉情况" prop="complaintContent">
<el-input v-model="form.complaintContent" type="textarea" :rows="4" placeholder="请输入投诉情况描述" />
<el-input v-model="form.complaintContent" type="textarea" :rows="4" placeholder="请输入投诉情况(含客户诉求)" />
</el-form-item>
<el-form-item label="客户诉求" prop="customerDemand">
<el-input v-model="form.customerDemand" type="textarea" :rows="3" placeholder="请输入客户诉求" />
<el-form-item label="关联客户" prop="customerId">
<CustomerSelect v-model="form.customerId" :style="{width:'100%'}" />
</el-form-item>
<el-form-item label="下游使用用户" prop="downstreamUserName">
<el-input v-model="form.downstreamUserName" placeholder="请输入下游使用用户名称" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
<el-form-item label="工程名称" prop="projectName">
<el-input v-model="form.projectName" placeholder="请输入使用的工程名称" />
</el-form-item>
<el-form-item label="使用地点" prop="projectLocation">
<el-input v-model="form.projectLocation" placeholder="请输入工程使用地点" />
</el-form-item>
<el-form-item label="产品用途" prop="productUsage">
<el-input v-model="form.productUsage" placeholder="请输入产品用途" />
</el-form-item>
<el-form-item label="关联钢卷">
<CoilSelector :multiple="true" :filters="{ status: 1 }" placeholder="选择钢卷" @confirm="handleCoilConfirm">
@@ -170,6 +188,8 @@
<el-button :loading="dispatchLoading" type="primary" @click="confirmFeedbackDispatch"> </el-button>
</div>
</el-dialog>
<ExportPdfDialog ref="exportPdfDialog" />
</div>
</template>
@@ -183,6 +203,7 @@ import jsPDF from 'jspdf';
import CoilSelector from "@/components/CoilSelector/index.vue";
import CurrentCoilNo from "@/components/KLPService/Renderer/CurrentCoilNo.vue";
import DragResizePanel from "@/components/DragResizePanel/index.vue";
import CustomerSelect from "@/components/KLPService/CustomerSelect/index.vue";
import HeaderControlSection from "./components/HeaderControlSection.vue";
import BasicInfoSection from "./components/BasicInfoSection.vue";
import ContractInfoSection from "./components/ContractInfoSection.vue";
@@ -191,13 +212,15 @@ import DepartmentOpinionSection from "./components/DepartmentOpinionSection.vue"
import HandlingSchemeSection from "./components/HandlingSchemeSection.vue";
import ExecutionFeedbackSection from "./components/ExecutionFeedbackSection.vue";
import FlowOverviewSection from "./components/FlowOverviewSection.vue";
import ExportPdfDialog from "./components/ExportPdfDialog.vue";
export default {
name: "AftermarketObjection",
components: {
CoilSelector, CurrentCoilNo, DragResizePanel,
CoilSelector, CurrentCoilNo, DragResizePanel, CustomerSelect,
HeaderControlSection, BasicInfoSection, ContractInfoSection,
CoilInfoSection, DepartmentOpinionSection, HandlingSchemeSection, ExecutionFeedbackSection, FlowOverviewSection
CoilInfoSection, DepartmentOpinionSection, HandlingSchemeSection, ExecutionFeedbackSection, FlowOverviewSection,
ExportPdfDialog
},
dicts: ['coil_quality_status'],
data() {
@@ -235,8 +258,7 @@ export default {
rules: {
complaintNo: [{ required: true, message: "请输入售后编号", trigger: "blur" }],
complaintDate: [{ required: true, message: "请选择投诉日期", trigger: "blur" }],
complaintContent: [{ required: true, message: "请输入投诉情况", trigger: "blur" }],
customerDemand: [{ required: true, message: "请输入客户诉求", trigger: "blur" }]
complaintContent: [{ required: true, message: "请输入投诉情况", trigger: "blur" }]
}
};
},
@@ -329,7 +351,12 @@ export default {
complaintNo: undefined,
complaintDate: undefined,
complaintContent: undefined,
customerDemand: undefined,
customerId: undefined,
downstreamUserName: undefined,
phone: undefined,
projectName: undefined,
projectLocation: undefined,
productUsage: undefined,
file: undefined,
auditStatus: undefined,
auditOpinion: undefined,
@@ -523,6 +550,9 @@ export default {
this.$modal.msgSuccess("移除成功");
this.loadCoilList(this.currentRow.acceptId);
}).catch(() => { });
},
handleExportPdf(row) {
this.$refs.exportPdfDialog.open(row.acceptId);
}
}
};

View File

@@ -73,6 +73,10 @@
<BasicInfoSection :data="acceptDetail" />
</template>
<template #flow-overview>
<FlowOverviewSection :flowStatus="acceptDetail.flowStatus" />
</template>
<template #contract-info>
<ContractInfoSection :coilList="dialogCoilList" />
</template>
@@ -80,20 +84,27 @@
<el-divider />
<FlowOverviewSection :flowStatus="acceptDetail.flowStatus" />
<CoilInfoSection :coilList="dialogCoilList" :loading="coilLoading" :editable="false" />
<div v-if="currentTask.taskStatus === 1 && opinionForm.deptOpinion" class="section-gap" />
<div v-if="currentTask.taskStatus === 1 && opinionForm.deptOpinion" class="opinion-preview-wrapper">
<div class="section-title">
<span>已提交意见 <span class="en-sub">· Submitted Opinion</span></span>
</div>
<DeptOpinionPreview :deptId="currentTask.deptId" :jsonData="opinionForm.deptOpinion" />
<div v-if="opinionForm.fillFile" class="opinion-file" style="margin-top:8px;">
<FileList :ossIds="opinionForm.fillFile" />
</div>
</div>
<div v-if="isEditable" class="section-gap" />
<div v-if="isEditable" class="opinion-form-wrapper">
<div class="opinion-form-section">
<div class="section-title">
<span>填写处理意见 <span class="en-sub">· Fill in Opinion</span></span>
<span>{{ currentTask.taskStatus === 1 ? '修改处理意见' : '填写处理意见' }} <span class="en-sub">· {{ currentTask.taskStatus === 1 ? 'Edit Opinion' : 'Fill in Opinion' }}</span></span>
</div>
<el-form ref="opinionForm" :model="opinionForm" label-width="100px">
<el-form-item label="处理意见" prop="deptOpinion">
<editor v-model="opinionForm.deptOpinion" :min-height="200" />
</el-form-item>
<DeptOpinionForm :deptId="currentTask.deptId" :jsonData="opinionForm.deptOpinion" @input="val => opinionForm.deptOpinion = val" />
<el-form-item label="意见文件">
<file-upload v-model="opinionForm.fillFile" />
</el-form-item>
@@ -121,10 +132,13 @@ import BasicInfoSection from "./components/BasicInfoSection.vue";
import CoilInfoSection from "./components/CoilInfoSection.vue";
import ContractInfoSection from "./components/ContractInfoSection.vue";
import FlowOverviewSection from "./components/FlowOverviewSection.vue";
import DeptOpinionForm from "./components/DeptOpinionForm.vue";
import DeptOpinionPreview from "./components/DeptOpinionPreview.vue";
import FileList from "@/components/FileList/index.vue";
export default {
name: "AftermarketOpinion",
components: { DragResizePanel, HeaderControlSection, BasicInfoSection, CoilInfoSection, ContractInfoSection, FlowOverviewSection },
components: { DragResizePanel, HeaderControlSection, BasicInfoSection, CoilInfoSection, ContractInfoSection, FlowOverviewSection, DeptOpinionForm, DeptOpinionPreview, FileList },
data() {
return {
loading: false,
@@ -212,7 +226,7 @@ export default {
},
canEdit(row) {
const status = (row.acceptInfo || {}).flowStatus;
return (status === 2 || status === 3) && row.taskStatus === 0;
return status === 2;
},
confirmCancel() {
this.$modal.confirm('确认取消?已填写的内容将不会保存。').then(() => {
@@ -235,7 +249,14 @@ export default {
}).catch(() => { }).finally(() => { this.rejectLoading = false; });
},
submitOpinion() {
if (!this.opinionForm.deptOpinion) {
try {
const data = JSON.parse(this.opinionForm.deptOpinion || '{}');
const hasContent = Object.values(data).some(v => v);
if (!hasContent) {
this.$modal.msgWarning("请至少填写一项处理意见");
return;
}
} catch (e) {
this.$modal.msgWarning("请填写处理意见");
return;
}
@@ -457,6 +478,10 @@ export default {
padding-top: 4px;
}
.opinion-preview-wrapper {
padding-top: 4px;
}
.opinion-form-section {
margin-bottom: 0;
}

View File

@@ -0,0 +1,464 @@
<template>
<div class="app-container objection-container">
<DragResizePanel :initialSize="280" :minSize="280" :maxSize="600">
<template #panelA>
<div class="left-panel">
<div class="panel-header">
<div class="header-title">
<i class="el-icon-s-data"></i>
<span>意见汇总</span>
<el-button size="mini" type="text" icon="el-icon-refresh" @click="getList" style="margin-left:4px;"
title="刷新列表"></el-button>
</div>
<el-select v-model="queryParams.flowStatus" placeholder="全部阶段" clearable size="mini" @change="handleQuery"
class="header-filter">
<el-option label="待汇总方案" :value="3" />
<el-option label="全部办结" :value="4" />
</el-select>
</div>
<div class="search-row">
<el-input v-model="queryParams.complaintNo" placeholder="搜索售后编号..." clearable prefix-icon="el-icon-search"
size="small" @keyup.enter.native="handleQuery" @clear="handleQuery" />
</div>
<div v-loading="loading" class="list-body">
<div v-for="item in dataList" :key="item.acceptId" class="list-item"
:class="{ active: currentRow && currentRow.acceptId === item.acceptId }" @click="handleRowClick(item)">
<div class="item-main">
<span class="item-title">{{ item.complaintNo }}</span>
<span class="item-sub">{{ parseTime(item.complaintDate, '{y}-{m}-{d}') }}</span>
</div>
<div class="item-meta">
<el-tag v-if="item.flowStatus === 3" size="mini">待汇总方案</el-tag>
<el-tag v-else-if="item.flowStatus === 4" type="success" size="mini">全部办结</el-tag>
</div>
</div>
<div v-if="dataList.length === 0 && !loading" class="list-empty">
<i class="el-icon-folder-opened"></i>
<span>暂无待汇总的售后单</span>
</div>
</div>
<div class="list-footer">
<pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</div>
</template>
<template #panelB>
<div class="right-panel">
<div v-if="!currentRow" class="empty-tip">
<i class="el-icon-info"></i>
<span>请在左侧列表中选择一条售后单查看详情</span>
</div>
<div v-else v-loading="detailLoading" class="detail-content">
<HeaderControlSection :complaintNo="currentRow.complaintNo" :flowStatus="currentRow.flowStatus"
:meta="currentRow">
<template #actions>
<el-button v-if="currentRow.flowStatus === 3" size="mini" type="success" plain
icon="el-icon-circle-check" :loading="completeLoading" @click="handleComplete"> </el-button>
<el-button v-if="currentRow.flowStatus === 4" size="mini" type="primary" plain
icon="el-icon-download" @click="handleExportPdf">导出</el-button>
<el-button size="mini" type="text" icon="el-icon-refresh" @click="handleRefreshDetail"
title="刷新详情">刷新</el-button>
</template>
<template #basic-info>
<BasicInfoSection :data="currentRow" />
</template>
<template #flow-overview>
<FlowOverviewSection :flowStatus="currentRow.flowStatus" />
</template>
</HeaderControlSection>
<el-divider />
<CoilInfoSection :coilList="coilList" :loading="coilLoading" :editable="false"
@refresh="loadCoilList(currentRow.acceptId)" />
<div class="section-gap" />
<ContractInfoSection :coilList="coilList" />
<div class="section-gap" />
<DepartmentOpinionSection :taskList="taskList" @refresh="refreshTaskList" />
<div class="section-gap" />
<HandlingSchemeSection :content="currentRow.planContent" :editable="currentRow.flowStatus === 3" @save="handleSavePlan" />
</div>
</div>
</template>
</DragResizePanel>
<ExportPdfDialog ref="exportPdfDialog" />
</div>
</template>
<script>
import { listComplaintAccept, getComplaintAccept, updateComplaintAccept } from "@/api/flow/complaintAccept";
import { listComplaintTask } from "@/api/flow/complaintTask";
import { listAcceptCoilRel } from "@/api/flow/acceptCoilRel";
import DragResizePanel from "@/components/DragResizePanel/index.vue";
import HeaderControlSection from "./components/HeaderControlSection.vue";
import BasicInfoSection from "./components/BasicInfoSection.vue";
import ContractInfoSection from "./components/ContractInfoSection.vue";
import CoilInfoSection from "./components/CoilInfoSection.vue";
import DepartmentOpinionSection from "./components/DepartmentOpinionSection.vue";
import HandlingSchemeSection from "./components/HandlingSchemeSection.vue";
import FlowOverviewSection from "./components/FlowOverviewSection.vue";
import ExportPdfDialog from "./components/ExportPdfDialog.vue";
export default {
name: "AftermarketSummary",
components: {
DragResizePanel,
HeaderControlSection, BasicInfoSection, ContractInfoSection,
CoilInfoSection, DepartmentOpinionSection, HandlingSchemeSection, FlowOverviewSection,
ExportPdfDialog
},
dicts: ['coil_quality_status'],
data() {
return {
loading: true,
detailLoading: false,
coilLoading: false,
completeLoading: false,
total: 0,
dataList: [],
currentRow: null,
queryParams: {
pageNum: 1,
pageSize: 10,
complaintNo: undefined,
flowStatus: 3
},
coilList: [],
taskList: []
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
listComplaintAccept(this.queryParams).then(response => {
this.dataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
handleRowClick(row) {
this.currentRow = row;
this.loadDetail(row.acceptId);
},
loadDetail(acceptId) {
this.detailLoading = true;
getComplaintAccept(acceptId).then(response => {
this.currentRow = response.data;
this.loadRelData(acceptId);
}).finally(() => { this.detailLoading = false; });
},
loadRelData(acceptId) {
this.loadCoilList(acceptId);
listComplaintTask({ acceptId, pageNum: 1, pageSize: 999 }).then(r => {
this.taskList = r.rows || [];
});
},
loadCoilList(acceptId) {
this.coilLoading = true;
listAcceptCoilRel({ acceptId, pageNum: 1, pageSize: 999 }).then(r => {
this.coilList = r.rows || [];
}).finally(() => { this.coilLoading = false; });
},
handleRefreshDetail() {
if (this.currentRow && this.currentRow.acceptId) {
this.loadDetail(this.currentRow.acceptId);
}
},
handleSavePlan(planContent) {
updateComplaintAccept({ acceptId: this.currentRow.acceptId, planContent }).then(() => {
this.$modal.msgSuccess("处理方案保存成功");
this.loadDetail(this.currentRow.acceptId);
});
},
refreshTaskList() {
if (this.currentRow && this.currentRow.acceptId) {
listComplaintTask({ acceptId: this.currentRow.acceptId, pageNum: 1, pageSize: 999 }).then(r => {
this.taskList = r.rows || [];
});
}
},
handleComplete() {
this.$modal.confirm('确认将此售后单办结?办结后部门将无法再修改意见。').then(() => {
this.completeLoading = true;
return updateComplaintAccept({ acceptId: this.currentRow.acceptId, flowStatus: 4 });
}).then(() => {
this.$modal.msgSuccess("已办结");
this.completeLoading = false;
this.loadDetail(this.currentRow.acceptId);
this.getList();
}).catch(() => { this.completeLoading = false; });
},
handleExportPdf() {
this.$refs.exportPdfDialog.open(this.currentRow.acceptId);
}
}
};
</script>
<style scoped>
.objection-container {
height: calc(100vh - 84px);
}
.left-panel {
display: flex;
flex-direction: column;
height: 100%;
background: #f5f7fa;
border-right: 1px solid #e4e7ed;
}
.panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 14px 8px;
background: #f5f7fa;
}
.header-title {
display: flex;
align-items: center;
gap: 6px;
font-size: 14px;
font-weight: 600;
color: #303133;
}
.header-title i {
color: #409eff;
font-size: 16px;
}
.header-filter {
width: 130px;
}
.search-row {
display: flex;
align-items: center;
gap: 6px;
padding: 0 14px 10px;
background: #f5f7fa;
}
.list-body {
flex: 1;
overflow-y: auto;
padding: 0 6px;
}
.list-item {
display: flex;
align-items: center;
padding: 10px 12px;
margin-bottom: 2px;
cursor: pointer;
border-radius: 6px;
transition: all 0.15s;
}
.list-item:hover {
background: #ebeef5;
}
.list-item.active {
background: #d9ecff;
}
.list-item.active .item-title {
color: #409eff;
font-weight: 600;
}
.item-main {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 3px;
}
.item-title {
font-size: 13px;
font-weight: 500;
color: #303133;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.item-sub {
font-size: 12px;
color: #909399;
}
.item-meta {
flex-shrink: 0;
margin: 0 8px;
}
.list-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60px 0;
color: #c0c4cc;
font-size: 13px;
gap: 8px;
}
.list-empty i {
font-size: 32px;
}
.list-footer {
border-top: 1px solid #e4e7ed;
padding: 2px 8px 0;
background: #f5f7fa;
}
/* ========== 右侧面板 ========== */
.right-panel {
height: 100%;
overflow-y: auto;
padding: 12px 16px;
background: #faf8f5;
}
.right-panel .detail-content {
margin: 0 auto;
background: #ffffff;
padding: 28px 32px 36px;
box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 2px 12px rgba(0,0,0,0.04);
min-height: 100%;
}
.empty-tip {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
color: #909399;
font-size: 14px;
gap: 8px;
}
.section-title {
font-family: 'Georgia', 'Times New Roman', 'Noto Serif SC', 'SimSun', serif;
width: 100%;
font-size: 15px;
font-weight: 700;
color: #1a1a1a;
margin: 22px 0 12px 0;
padding: 0 0 10px 0;
border-bottom: 1px solid #d4d0c8;
display: flex;
align-items: center;
gap: 10px;
letter-spacing: 0.3px;
}
.section-title:first-child {
margin-top: 0;
}
.section-gap {
height: 16px;
}
.plan-content {
padding: 12px 16px;
background: #faf8f5;
border: 1px solid #e8e4de;
border-radius: 2px;
font-size: 13px;
line-height: 1.8;
color: #1a1a1a;
}
.empty-data {
color: #8c8c8c;
font-size: 13px;
padding: 8px 0;
font-style: italic;
}
/* 正式表格覆写 */
.right-panel .el-table {
border: 1px solid #e8e4de !important;
border-radius: 2px !important;
font-size: 12px !important;
}
.right-panel .el-table thead th {
background-color: #2c3e50 !important;
color: #ffffff !important;
font-weight: 600 !important;
font-size: 11px !important;
letter-spacing: 0.5px !important;
border-bottom: none !important;
font-family: 'Georgia', 'Times New Roman', serif;
}
.right-panel .el-table thead th .cell {
color: #ffffff !important;
}
.right-panel .el-table__body tr:hover > td {
background-color: #f7f5f0 !important;
}
.right-panel .el-table--border td {
border-right: 1px solid #f0ece6 !important;
}
.right-panel .el-table--border th {
border-right: 1px solid #3a5166 !important;
}
.right-panel .el-table td {
padding: 6px 4px !important;
color: #3a3a3a !important;
}
.right-panel .el-divider--horizontal {
margin: 8px 0 4px;
background-color: #e0dcd6;
}
.right-panel .el-tag {
border-radius: 2px;
font-family: 'Georgia', 'Times New Roman', serif;
letter-spacing: 0.3px;
}
.right-panel .el-tag--mini {
padding: 0 6px;
line-height: 20px;
height: 20px;
}
.right-panel .el-tag--small {
padding: 0 8px;
}
</style>

View File

@@ -72,12 +72,14 @@
<template #basic-info>
<BasicInfoSection :data="acceptDetail" />
</template>
<template #flow-overview>
<FlowOverviewSection :flowStatus="acceptDetail.flowStatus" />
</template>
</HeaderControlSection>
<el-divider />
<FlowOverviewSection :flowStatus="acceptDetail.flowStatus" />
<CoilInfoSection :coilList="dialogCoilList" :loading="coilLoading" :editable="false" />
<ContractInfoSection :coilList="dialogCoilList" />